mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-24 00:03:11 +01:00
Implementing get_local_time()
This commit is contained in:
16
src/rct2.c
16
src/rct2.c
@@ -122,7 +122,8 @@ void rct2_init()
|
|||||||
RCT2_CALLPROC_EBPSAFE(0x006BA8E0); // init_audio();
|
RCT2_CALLPROC_EBPSAFE(0x006BA8E0); // init_audio();
|
||||||
viewport_init_all();
|
viewport_init_all();
|
||||||
news_item_init_queue();
|
news_item_init_queue();
|
||||||
RCT2_CALLPROC_EBPSAFE(0x006C45E7); // get local time
|
get_local_time();
|
||||||
|
OutputDebugString(s);
|
||||||
RCT2_CALLPROC_EBPSAFE(0x00667104);
|
RCT2_CALLPROC_EBPSAFE(0x00667104);
|
||||||
RCT2_CALLPROC_EBPSAFE(0x006C4209);
|
RCT2_CALLPROC_EBPSAFE(0x006C4209);
|
||||||
RCT2_CALLPROC_EBPSAFE(0x0069EB13);
|
RCT2_CALLPROC_EBPSAFE(0x0069EB13);
|
||||||
@@ -376,6 +377,19 @@ void get_system_time()
|
|||||||
RCT2_GLOBAL(RCT2_ADDRESS_OS_TIME_DAYOFWEEK, sint16) = systime.wDayOfWeek;
|
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
|
* 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.
|
* free it.
|
||||||
|
|||||||
@@ -126,6 +126,7 @@ void rct2_endupdate();
|
|||||||
char *get_file_path(int pathId);
|
char *get_file_path(int pathId);
|
||||||
void get_system_info();
|
void get_system_info();
|
||||||
void get_system_time();
|
void get_system_time();
|
||||||
|
void get_local_time();
|
||||||
void *rct2_malloc(size_t numBytes);
|
void *rct2_malloc(size_t numBytes);
|
||||||
void *rct2_realloc(void *block, size_t numBytes);
|
void *rct2_realloc(void *block, size_t numBytes);
|
||||||
void rct2_free(void *block);
|
void rct2_free(void *block);
|
||||||
|
|||||||
Reference in New Issue
Block a user