You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
269 B
21 lines
269 B
|
7 years ago
|
#include <stdint.h>
|
||
|
|
|
||
|
7 years ago
|
#include "devilution.h"
|
||
|
8 years ago
|
|
||
|
7 years ago
|
namespace dvl {
|
||
|
|
|
||
|
7 years ago
|
static uint32_t rand_state = 0;
|
||
|
8 years ago
|
|
||
|
7 years ago
|
int rand(void)
|
||
|
8 years ago
|
{
|
||
|
|
rand_state = rand_state * 214013 + 2531011;
|
||
|
|
return (rand_state >> 16) & 0x7FFF;
|
||
|
|
}
|
||
|
|
|
||
|
7 years ago
|
void srand(uint32_t seed)
|
||
|
8 years ago
|
{
|
||
|
|
rand_state = seed;
|
||
|
|
}
|
||
|
7 years ago
|
|
||
|
7 years ago
|
} // namespace dvl
|