| 1 |
#include <windows.h> |
| 2 |
#include <stdlib.h> |
| 3 |
#include <stdarg.h> |
| 4 |
#include <stdint.h> |
| 5 |
#include "oni_stdio.h" |
| 6 |
|
| 7 |
#include "Daodan_Utility.h" |
| 8 |
#include "BFW_Utility.h" |
| 9 |
|
| 10 |
void __cdecl DDrStartupMessage(const char* fmt, ...) |
| 11 |
{ |
| 12 |
va_list ap; |
| 13 |
va_start(ap, fmt); |
| 14 |
char* buffer = malloc(vsnprintf(NULL, 0, fmt, ap) + 1); |
| 15 |
|
| 16 |
vsprintf(buffer, fmt, ap); |
| 17 |
va_end(ap); |
| 18 |
|
| 19 |
if (!ONgFileStartup) |
| 20 |
if (!(ONgFileStartup = oni_fopen("startup.txt", "w"))) |
| 21 |
return; |
| 22 |
|
| 23 |
oni_fprintf(ONgFileStartup, "%s\n", buffer); |
| 24 |
free(buffer); |
| 25 |
|
| 26 |
oni_fflush(ONgFileStartup); |
| 27 |
return; |
| 28 |
} |
| 29 |
|
| 30 |
int64_t DDrMachineTime_High() |
| 31 |
{ |
| 32 |
// LARGE_INTEGER PerfCount; |
| 33 |
// |
| 34 |
// if (!QueryPerformanceCounter(&PerfCount)) |
| 35 |
// PerfCount.QuadPart = GetTickCount(); |
| 36 |
// |
| 37 |
// return PerfCount.QuadPart; |
| 38 |
return GetTickCount(); |
| 39 |
} |
| 40 |
|
| 41 |
double DDrMachineTime_High_Frequency() |
| 42 |
{ |
| 43 |
// LARGE_INTEGER Frequency; |
| 44 |
// |
| 45 |
// if (!QueryPerformanceFrequency(&Frequency)) |
| 46 |
return 1000.0; |
| 47 |
|
| 48 |
// return Frequency.QuadPart; |
| 49 |
} |