Implementing get_local_time()

This commit is contained in:
Maciek Baron 2014-05-04 16:31:32 +01:00
parent 61238c70f3
commit 0477e2803b
2 changed files with 16 additions and 1 deletions

View File

@ -122,7 +122,8 @@ void rct2_init()
RCT2_CALLPROC_EBPSAFE(0x006BA8E0); // init_audio();
viewport_init_all();
news_item_init_queue();
RCT2_CALLPROC_EBPSAFE(0x006C45E7); // get local time
get_local_time();
OutputDebugString(s);
RCT2_CALLPROC_EBPSAFE(0x00667104);
RCT2_CALLPROC_EBPSAFE(0x006C4209);
RCT2_CALLPROC_EBPSAFE(0x0069EB13);
@ -376,6 +377,19 @@ void get_system_time()
RCT2_GLOBAL(RCT2_ADDRESS_OS_TIME_DAYOFWEEK, sint16) = systime.wDayOfWeek;
}
/**
* Obtains os local time (hour and minute)
* rct2: 0x006C45E7;
*/
void get_local_time()
{
SYSTEMTIME systime;
GetLocalTime(&systime);
RCT2_GLOBAL(RCT2_ADDRESS_OS_TIME_HOUR, sint16) = systime.wHour;
RCT2_GLOBAL(RCT2_ADDRESS_OS_TIME_MINUTE, sint16) = systime.wMinute;
}
/**
* RCT2 and this DLL can not free each other's allocated memory blocks. Use this to allocate memory if RCT2 is still able to
* free it.

View File

@ -126,6 +126,7 @@ void rct2_endupdate();
char *get_file_path(int pathId);
void get_system_info();
void get_system_time();
void get_local_time();
void *rct2_malloc(size_t numBytes);
void *rct2_realloc(void *block, size_t numBytes);
void rct2_free(void *block);