|
|
@@ -30,7 +30,6 @@ void luaRegister_Scene()
|
|
|
{"getNext", lua_Scene_getNext},
|
|
|
{"getNodeCount", lua_Scene_getNodeCount},
|
|
|
{"getRefCount", lua_Scene_getRefCount},
|
|
|
- {"getScene", lua_Scene_getScene},
|
|
|
{"release", lua_Scene_release},
|
|
|
{"removeAllNodes", lua_Scene_removeAllNodes},
|
|
|
{"removeNode", lua_Scene_removeNode},
|
|
|
@@ -45,6 +44,7 @@ void luaRegister_Scene()
|
|
|
const luaL_Reg lua_statics[] =
|
|
|
{
|
|
|
{"create", lua_Scene_static_create},
|
|
|
+ {"getScene", lua_Scene_static_getScene},
|
|
|
{"load", lua_Scene_static_load},
|
|
|
{NULL, NULL}
|
|
|
};
|
|
|
@@ -665,50 +665,6 @@ int lua_Scene_getRefCount(lua_State* state)
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
-int lua_Scene_getScene(lua_State* state)
|
|
|
-{
|
|
|
- // Get the number of parameters.
|
|
|
- int paramCount = lua_gettop(state);
|
|
|
-
|
|
|
- // Attempt to match the parameters to a valid binding.
|
|
|
- switch (paramCount)
|
|
|
- {
|
|
|
- case 1:
|
|
|
- {
|
|
|
- if ((lua_type(state, 1) == LUA_TUSERDATA))
|
|
|
- {
|
|
|
- Scene* instance = getInstance(state);
|
|
|
- void* returnPtr = (void*)instance->getScene();
|
|
|
- if (returnPtr)
|
|
|
- {
|
|
|
- gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
|
|
|
- object->instance = returnPtr;
|
|
|
- object->owns = false;
|
|
|
- luaL_getmetatable(state, "Scene");
|
|
|
- lua_setmetatable(state, -2);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- lua_pushnil(state);
|
|
|
- }
|
|
|
-
|
|
|
- return 1;
|
|
|
- }
|
|
|
-
|
|
|
- lua_pushstring(state, "lua_Scene_getScene - Failed to match the given parameters to a valid function signature.");
|
|
|
- lua_error(state);
|
|
|
- break;
|
|
|
- }
|
|
|
- default:
|
|
|
- {
|
|
|
- lua_pushstring(state, "Invalid number of parameters (expected 1).");
|
|
|
- lua_error(state);
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- return 0;
|
|
|
-}
|
|
|
-
|
|
|
int lua_Scene_release(lua_State* state)
|
|
|
{
|
|
|
// Get the number of parameters.
|
|
|
@@ -1034,6 +990,71 @@ int lua_Scene_static_create(lua_State* state)
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
+int lua_Scene_static_getScene(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 0:
|
|
|
+ {
|
|
|
+ void* returnPtr = (void*)Scene::getScene();
|
|
|
+ if (returnPtr)
|
|
|
+ {
|
|
|
+ gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
|
|
|
+ object->instance = returnPtr;
|
|
|
+ object->owns = false;
|
|
|
+ luaL_getmetatable(state, "Scene");
|
|
|
+ lua_setmetatable(state, -2);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushnil(state);
|
|
|
+ }
|
|
|
+
|
|
|
+ return 1;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case 1:
|
|
|
+ {
|
|
|
+ if ((lua_type(state, 1) == LUA_TSTRING || lua_type(state, 1) == LUA_TNIL))
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ const char* param1 = gameplay::ScriptUtil::getString(1, false);
|
|
|
+
|
|
|
+ void* returnPtr = (void*)Scene::getScene(param1);
|
|
|
+ if (returnPtr)
|
|
|
+ {
|
|
|
+ gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
|
|
|
+ object->instance = returnPtr;
|
|
|
+ object->owns = false;
|
|
|
+ luaL_getmetatable(state, "Scene");
|
|
|
+ lua_setmetatable(state, -2);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushnil(state);
|
|
|
+ }
|
|
|
+
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ lua_pushstring(state, "lua_Scene_static_getScene - Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 0 or 1).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
int lua_Scene_static_load(lua_State* state)
|
|
|
{
|
|
|
// Get the number of parameters.
|