MCPcopy Create free account
hub / github.com/defold/defold / LuaTimerCallback

Function LuaTimerCallback

engine/script/src/script_timer.cpp:517–540  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

515 }
516
517 static void LuaTimerCallback(HTimerWorld timer_world, TimerEventType event_type, dmScript::HTimer timer_handle, float time_elapsed, uintptr_t owner, uintptr_t userdata)
518 {
519
520 LuaCallbackInfo* callback = (LuaCallbackInfo*)userdata;
521 if (!IsCallbackValid(callback))
522 {
523 return;
524 }
525
526 if (event_type != TIMER_EVENT_CANCELLED)
527 {
528 LuaTimerCallbackArgs args = { timer_handle, time_elapsed };
529
530 InvokeCallback(callback, LuaTimerCallbackArgsCB, &args);
531 }
532
533 if ((event_type != TIMER_EVENT_TRIGGER_WILL_REPEAT) && IsCallbackValid(callback))
534 {
535 DestroyCallback(callback);
536
537 Timer* timer = GetTimerFromHandle(timer_world, timer_handle);
538 timer->m_UserData = 0;
539 }
540 }
541
542 static dmScript::HTimerWorld GetTimerWorld(lua_State* L)
543 {

Callers

nothing calls this directly

Calls 4

IsCallbackValidFunction · 0.85
DestroyCallbackFunction · 0.85
GetTimerFromHandleFunction · 0.85
InvokeCallbackFunction · 0.70

Tested by

no test coverage detected