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

Function LuaAnimationComplete

engine/gui/src/gui_script.cpp:1115–1133  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1113 }
1114
1115 static void LuaAnimationComplete(HScene scene, HNode node, bool finished, void* userdata1, void* userdata2)
1116 {
1117 lua_State* L = scene->m_Context->m_LuaState;
1118 DM_LUA_STACK_CHECK(L, 0);
1119
1120 dmScript::LuaCallbackInfo* cbk = (dmScript::LuaCallbackInfo*)userdata1;
1121 int node_ref = (int) ((uintptr_t) userdata2 & 0xffffffff);
1122
1123 if( finished && dmScript::IsCallbackValid(cbk))
1124 {
1125 LuaAnimationCompleteArgs args(scene, node_ref);
1126 dmScript::InvokeCallback(cbk, LuaCallbackCustomArgsCB, &args);
1127 }
1128
1129 lua_rawgeti(L, LUA_REGISTRYINDEX, scene->m_ContextTableReference);
1130 luaL_unref(L, -1, node_ref);
1131 lua_pop(L, 1);
1132 dmScript::DestroyCallback(cbk);
1133 }
1134
1135 /*# once forward
1136 *

Callers

nothing calls this directly

Calls 5

IsCallbackValidFunction · 0.85
lua_rawgetiFunction · 0.85
luaL_unrefFunction · 0.85
DestroyCallbackFunction · 0.85
InvokeCallbackFunction · 0.50

Tested by

no test coverage detected