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

Function TestScriptExtensionInitialize

engine/script/src/test/test_script_lua.cpp:883–895  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

881}
882
883void TestScriptExtensionInitialize(dmScript::HContext context)
884{
885 lua_State* L = dmScript::GetLuaState(context);
886 DM_LUA_STACK_CHECK(L, 0);
887
888 TestScriptExtension* extension = (TestScriptExtension*)lua_newuserdata(L, sizeof(TestScriptExtension));
889 memset(extension, 0, sizeof(TestScriptExtension));
890 extension->m_SelfRef = dmScript::Ref(L, LUA_REGISTRYINDEX);
891 extension->m_InitializeCalled = 1;
892 lua_pushinteger(L, (lua_Integer)dmHashBuffer32("__TestScriptExtension__", strlen("__TestScriptExtension__")));
893 lua_pushnumber(L, extension->m_SelfRef);
894 dmScript::SetContextValue(context);
895}
896
897static void TestScriptExtensionUpdate(dmScript::HContext context)
898{

Callers

nothing calls this directly

Calls 7

lua_newuserdataFunction · 0.85
RefFunction · 0.85
lua_pushintegerFunction · 0.85
lua_pushnumberFunction · 0.85
SetContextValueFunction · 0.85
GetLuaStateFunction · 0.50
dmHashBuffer32Function · 0.50

Tested by

no test coverage detected