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

Function GetInstanceId

engine/script/src/script.cpp:1110–1119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1108 }
1109
1110 uintptr_t GetInstanceId(lua_State* L)
1111 {
1112 DM_LUA_STACK_CHECK(L, 0);
1113 GetInstance(L);
1114 int instance_type = lua_type(L, -1);
1115 // We assume that all users of SetInstance puts some form of user data/light user data, it is an assumption that works for now
1116 uintptr_t id = (instance_type == LUA_TLIGHTUSERDATA || instance_type == LUA_TUSERDATA) ? (uintptr_t)lua_touserdata(L, -1) : 0;
1117 lua_pop(L, 1);
1118 return id;
1119 }
1120
1121 struct ScriptWorld
1122 {

Callers 3

TimerDelayFunction · 0.85
TEST_FFunction · 0.85

Calls 3

lua_typeFunction · 0.85
lua_touserdataFunction · 0.85
GetInstanceFunction · 0.70

Tested by 1

TEST_FFunction · 0.68