World of Might and Magic  0.2.0
Open reimplementation of Might and Magic 6 7 8 game engine
Файл SDL_test_random.h

См. исходные тексты.

Классы

struct  SDLTest_RandomContext
 

Функции

void SDLTest_RandomInit (SDLTest_RandomContext *rndContext, unsigned int xi, unsigned int ci)
 Initialize random number generator with two integers. Подробнее...
 
void SDLTest_RandomInitTime (SDLTest_RandomContext *rndContext)
 Initialize random number generator based on current system time. Подробнее...
 
unsigned int SDLTest_Random (SDLTest_RandomContext *rndContext)
 Initialize random number generator based on current system time. Подробнее...
 

Подробное описание

Include file for SDL test framework.

This code is a part of the SDL2_test library, not the main SDL library.

См. определение в файле SDL_test_random.h

Функции

◆ SDLTest_RandomInit()

void SDLTest_RandomInit ( SDLTest_RandomContext rndContext,
unsigned int  xi,
unsigned int  ci 
)

Initialize random number generator with two integers.

Note: The random sequence of numbers returned by ...Random() is the same for the same two integers and has a period of 2^31.

Аргументы
rndContextpointer to context structure
xiinteger that defines the random sequence
ciinteger that defines the random sequence

◆ SDLTest_RandomInitTime()

void SDLTest_RandomInitTime ( SDLTest_RandomContext rndContext)

Initialize random number generator based on current system time.

Аргументы
rndContextpointer to context structure

◆ SDLTest_Random()

unsigned int SDLTest_Random ( SDLTest_RandomContext rndContext)

Initialize random number generator based on current system time.

Note: ...RandomInit() or ...RandomInitTime() must have been called before using this function.

Аргументы
rndContextpointer to context structure
Возвращает
A random number (32bit unsigned integer)