cave-story-solaris/src/Random.cpp
Clownacy 22c967ca3a Add a replication of MSVC2003's rand() algorithm
This actually affects how the game sounds. Seriously, listen to the
dialogue boxes. Now it matches the original.
2019-09-04 19:23:35 +00:00

15 lines
243 B
C++

#include "Random.h"
// A replication of MSVC's rand algorithm
static unsigned long next = 1;
int msvc_rand(void)
{
next = ((next) * 214013 + 2531011);
return ((next) >> 16) & 0x7FFF;
}
void msvc_srand(unsigned int seed)
{
next = seed;
}