MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / SetSceneNodeData

Method SetSceneNodeData

src/lua/LuaSceneNode.cpp:439–462  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

437
438
439int LuaSceneNodeMgr::SetSceneNodeData(lua_State* L) {
440 LuaSceneNode* sceneNode = CheckLuaSceneNode(L, 1);
441
442 luaL_checkany(L, 2);
443
444 if (sceneNode == NULL) {
445 lua_settop(L, 1);
446 return 1;
447 }
448
449 int& ref = sceneNode->renderNode.dataRef;
450 if (ref != LUA_NOREF) {
451 luaL_unref(L, LUA_REGISTRYINDEX, ref);
452 ref = LUA_NOREF;
453 }
454
455 if (!lua_isnil(L, 2)) {
456 lua_settop(L, 2);
457 ref = luaL_ref(L, LUA_REGISTRYINDEX);
458 }
459
460 lua_settop(L, 1);
461 return 1;
462}
463
464
465int LuaSceneNodeMgr::SetSceneNodeActive(lua_State* L) {

Callers

nothing calls this directly

Calls 5

CheckLuaSceneNodeFunction · 0.85
luaL_checkanyFunction · 0.50
lua_settopFunction · 0.50
luaL_unrefFunction · 0.50
luaL_refFunction · 0.50

Tested by

no test coverage detected