Skip to content

Commit

Permalink
Add GetTicks function
Browse files Browse the repository at this point in the history
  • Loading branch information
EliteMasterEric committed May 12, 2023
1 parent dc16f37 commit 4e5be80
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions project/include/system/System.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ namespace lime {

static void GCEnterBlocking ();
static void GCExitBlocking ();
static long GetTicks ();
static bool GetAllowScreenTimeout ();
static std::wstring* GetDeviceModel ();
static std::wstring* GetDeviceVendor ();
Expand Down
16 changes: 16 additions & 0 deletions project/src/ExternalInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2663,6 +2663,20 @@ namespace lime {
}


long lime_sdl_get_ticks () {

return System::GetTicks ();

}


HL_PRIM long HL_NAME(hl_sdl_get_ticks) () {

return System::GetTicks ();

}


bool lime_system_get_allow_screen_timeout () {

return System::GetAllowScreenTimeout ();
Expand Down Expand Up @@ -3929,6 +3943,7 @@ namespace lime {
DEFINE_PRIME3 (lime_png_decode_bytes);
DEFINE_PRIME3 (lime_png_decode_file);
DEFINE_PRIME2v (lime_render_event_manager_register);
DEFINE_PRIME0 (lime_sdl_get_ticks);
DEFINE_PRIME2v (lime_sensor_event_manager_register);
DEFINE_PRIME0 (lime_system_get_allow_screen_timeout);
DEFINE_PRIME0 (lime_system_get_device_model);
Expand Down Expand Up @@ -4113,6 +4128,7 @@ namespace lime {
DEFINE_HL_PRIM (_TIMAGEBUFFER, hl_png_decode_bytes, _TBYTES _BOOL _TIMAGEBUFFER);
DEFINE_HL_PRIM (_TIMAGEBUFFER, hl_png_decode_file, _STRING _BOOL _TIMAGEBUFFER);
DEFINE_HL_PRIM (_VOID, hl_render_event_manager_register, _FUN (_VOID, _NO_ARG) _TRENDER_EVENT);
DEFINE_HL_PRIM (_I64, hl_sdl_get_ticks, _FUN (_VOID, _NO_ARG) _TRENDER_EVENT);
DEFINE_HL_PRIM (_VOID, hl_sensor_event_manager_register, _FUN (_VOID, _NO_ARG) _TSENSOR_EVENT);
DEFINE_HL_PRIM (_BOOL, hl_system_get_allow_screen_timeout, _NO_ARG);
DEFINE_HL_PRIM (_BYTES, hl_system_get_device_model, _NO_ARG);
Expand Down
7 changes: 7 additions & 0 deletions project/src/backend/sdl/SDLSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,13 @@ namespace lime {
}


long System::GetTicks () {

return SDL_GetTicks ();

}


bool System::GetAllowScreenTimeout () {

return SDL_IsScreenSaverEnabled ();
Expand Down

0 comments on commit 4e5be80

Please sign in to comment.