2018-04-28 11:30:53 -04:00
|
|
|
#include "dglutil.h"
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
#define SYS_CLOCKS_PER_SEC (1000.0f / 55.0f)
|
|
|
|
|
|
|
|
|
2020-07-19 19:24:48 -04:00
|
|
|
uint32 sys_clock() {
|
|
|
|
return *((uint32*)0x046c);
|
2018-04-28 11:30:53 -04:00
|
|
|
}
|
|
|
|
|
2020-07-19 19:24:48 -04:00
|
|
|
float clock_ticks_to_seconds(uint32 clocks) {
|
2018-04-28 11:30:53 -04:00
|
|
|
return clocks / (float)SYS_CLOCKS_PER_SEC;
|
|
|
|
}
|
|
|
|
|
|
|
|
int rnd_int(int low, int high) {
|
|
|
|
return rand() % ((high - low) + 1) + low;
|
|
|
|
}
|
|
|
|
|
|
|
|
float rnd_float(float low, float high) {
|
|
|
|
return low + (rand() / (float)RAND_MAX) * (high - low);
|
|
|
|
}
|
|
|
|
|