|
@@ -27,9 +27,13 @@ void luaRegister_Model()
|
|
|
{"getRefCount", lua_Model_getRefCount},
|
|
{"getRefCount", lua_Model_getRefCount},
|
|
|
{"getSkin", lua_Model_getSkin},
|
|
{"getSkin", lua_Model_getSkin},
|
|
|
{"hasMaterial", lua_Model_hasMaterial},
|
|
{"hasMaterial", lua_Model_hasMaterial},
|
|
|
|
|
+ {"isShadowCaster", lua_Model_isShadowCaster},
|
|
|
|
|
+ {"isShadowReceiver", lua_Model_isShadowReceiver},
|
|
|
{"release", lua_Model_release},
|
|
{"release", lua_Model_release},
|
|
|
{"setMaterial", lua_Model_setMaterial},
|
|
{"setMaterial", lua_Model_setMaterial},
|
|
|
{"setNode", lua_Model_setNode},
|
|
{"setNode", lua_Model_setNode},
|
|
|
|
|
+ {"setShadowCaster", lua_Model_setShadowCaster},
|
|
|
|
|
+ {"setShadowReceiver", lua_Model_setShadowReceiver},
|
|
|
{NULL, NULL}
|
|
{NULL, NULL}
|
|
|
};
|
|
};
|
|
|
const luaL_Reg lua_statics[] =
|
|
const luaL_Reg lua_statics[] =
|
|
@@ -132,9 +136,12 @@ int lua_Model_draw(lua_State* state)
|
|
|
if ((lua_type(state, 1) == LUA_TUSERDATA))
|
|
if ((lua_type(state, 1) == LUA_TUSERDATA))
|
|
|
{
|
|
{
|
|
|
Model* instance = getInstance(state);
|
|
Model* instance = getInstance(state);
|
|
|
- instance->draw();
|
|
|
|
|
-
|
|
|
|
|
- return 0;
|
|
|
|
|
|
|
+ unsigned int result = instance->draw();
|
|
|
|
|
+
|
|
|
|
|
+ // Push the return value onto the stack.
|
|
|
|
|
+ lua_pushunsigned(state, result);
|
|
|
|
|
+
|
|
|
|
|
+ return 1;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
lua_pushstring(state, "lua_Model_draw - Failed to match the given parameters to a valid function signature.");
|
|
lua_pushstring(state, "lua_Model_draw - Failed to match the given parameters to a valid function signature.");
|
|
@@ -150,9 +157,12 @@ int lua_Model_draw(lua_State* state)
|
|
|
bool param1 = gameplay::ScriptUtil::luaCheckBool(state, 2);
|
|
bool param1 = gameplay::ScriptUtil::luaCheckBool(state, 2);
|
|
|
|
|
|
|
|
Model* instance = getInstance(state);
|
|
Model* instance = getInstance(state);
|
|
|
- instance->draw(param1);
|
|
|
|
|
-
|
|
|
|
|
- return 0;
|
|
|
|
|
|
|
+ unsigned int result = instance->draw(param1);
|
|
|
|
|
+
|
|
|
|
|
+ // Push the return value onto the stack.
|
|
|
|
|
+ lua_pushunsigned(state, result);
|
|
|
|
|
+
|
|
|
|
|
+ return 1;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
lua_pushstring(state, "lua_Model_draw - Failed to match the given parameters to a valid function signature.");
|
|
lua_pushstring(state, "lua_Model_draw - Failed to match the given parameters to a valid function signature.");
|
|
@@ -484,6 +494,76 @@ int lua_Model_hasMaterial(lua_State* state)
|
|
|
return 0;
|
|
return 0;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+int lua_Model_isShadowCaster(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))
|
|
|
|
|
+ {
|
|
|
|
|
+ Model* instance = getInstance(state);
|
|
|
|
|
+ bool result = instance->isShadowCaster();
|
|
|
|
|
+
|
|
|
|
|
+ // Push the return value onto the stack.
|
|
|
|
|
+ lua_pushboolean(state, result);
|
|
|
|
|
+
|
|
|
|
|
+ return 1;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ lua_pushstring(state, "lua_Model_isShadowCaster - 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_Model_isShadowReceiver(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))
|
|
|
|
|
+ {
|
|
|
|
|
+ Model* instance = getInstance(state);
|
|
|
|
|
+ bool result = instance->isShadowReceiver();
|
|
|
|
|
+
|
|
|
|
|
+ // Push the return value onto the stack.
|
|
|
|
|
+ lua_pushboolean(state, result);
|
|
|
|
|
+
|
|
|
|
|
+ return 1;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ lua_pushstring(state, "lua_Model_isShadowReceiver - 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_Model_release(lua_State* state)
|
|
int lua_Model_release(lua_State* state)
|
|
|
{
|
|
{
|
|
|
// Get the number of parameters.
|
|
// Get the number of parameters.
|
|
@@ -803,6 +883,78 @@ int lua_Model_setNode(lua_State* state)
|
|
|
return 0;
|
|
return 0;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+int lua_Model_setShadowCaster(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 2:
|
|
|
|
|
+ {
|
|
|
|
|
+ if ((lua_type(state, 1) == LUA_TUSERDATA) &&
|
|
|
|
|
+ lua_type(state, 2) == LUA_TBOOLEAN)
|
|
|
|
|
+ {
|
|
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
|
|
+ bool param1 = gameplay::ScriptUtil::luaCheckBool(state, 2);
|
|
|
|
|
+
|
|
|
|
|
+ Model* instance = getInstance(state);
|
|
|
|
|
+ instance->setShadowCaster(param1);
|
|
|
|
|
+
|
|
|
|
|
+ return 0;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ lua_pushstring(state, "lua_Model_setShadowCaster - Failed to match the given parameters to a valid function signature.");
|
|
|
|
|
+ lua_error(state);
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ default:
|
|
|
|
|
+ {
|
|
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 2).");
|
|
|
|
|
+ lua_error(state);
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return 0;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+int lua_Model_setShadowReceiver(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 2:
|
|
|
|
|
+ {
|
|
|
|
|
+ if ((lua_type(state, 1) == LUA_TUSERDATA) &&
|
|
|
|
|
+ lua_type(state, 2) == LUA_TBOOLEAN)
|
|
|
|
|
+ {
|
|
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
|
|
+ bool param1 = gameplay::ScriptUtil::luaCheckBool(state, 2);
|
|
|
|
|
+
|
|
|
|
|
+ Model* instance = getInstance(state);
|
|
|
|
|
+ instance->setShadowReceiver(param1);
|
|
|
|
|
+
|
|
|
|
|
+ return 0;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ lua_pushstring(state, "lua_Model_setShadowReceiver - Failed to match the given parameters to a valid function signature.");
|
|
|
|
|
+ lua_error(state);
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ default:
|
|
|
|
|
+ {
|
|
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 2).");
|
|
|
|
|
+ lua_error(state);
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return 0;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
int lua_Model_static_create(lua_State* state)
|
|
int lua_Model_static_create(lua_State* state)
|
|
|
{
|
|
{
|
|
|
// Get the number of parameters.
|
|
// Get the number of parameters.
|