shithub: cstory

ref: cec5fdb231de1a6f87a00795e6e3c93fcf4f28ad
dir: /src/Random.cpp/

View raw version
// Released under the MIT licence.
// See LICENCE.txt for details.

#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;
}