mirror of
https://github.com/nunuhara/xsystem4.git
synced 2026-10-09 15:20:01 +03:00
Implement Math.SetSeedByCurrentTime
Used in Alice 2010
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
#include <time.h>
|
||||
|
||||
#ifndef M_PI
|
||||
#define M_PI (3.14159265358979323846)
|
||||
@@ -56,6 +57,11 @@ static float Math_Sin(float x)
|
||||
return sinf(deg2rad(x));
|
||||
}
|
||||
|
||||
static void Math_SetSeedByCurrentTime(void)
|
||||
{
|
||||
srand(time(NULL));
|
||||
}
|
||||
|
||||
static int Math_Min(int a, int b)
|
||||
{
|
||||
return a < b ? a : b;
|
||||
@@ -159,6 +165,7 @@ HLL_LIBRARY(Math,
|
||||
HLL_EXPORT(AbsF, fabsf),
|
||||
HLL_EXPORT(Pow, powf),
|
||||
HLL_EXPORT(SetSeed, srand),
|
||||
HLL_EXPORT(SetSeedByCurrentTime, Math_SetSeedByCurrentTime),
|
||||
//HLL_EXPORT(SetRandMode, Math_SetRandMode),
|
||||
HLL_EXPORT(Rand, rand),
|
||||
HLL_EXPORT(RandF, Math_RandF),
|
||||
|
||||
Reference in New Issue
Block a user