|
@@ -49,6 +49,7 @@ void luaRegister_Game()
|
|
|
{"getWidth", lua_Game_getWidth},
|
|
{"getWidth", lua_Game_getWidth},
|
|
|
{"hasMouse", lua_Game_hasMouse},
|
|
{"hasMouse", lua_Game_hasMouse},
|
|
|
{"isCursorVisible", lua_Game_isCursorVisible},
|
|
{"isCursorVisible", lua_Game_isCursorVisible},
|
|
|
|
|
+ {"isGestureRegistered", lua_Game_isGestureRegistered},
|
|
|
{"isGestureSupported", lua_Game_isGestureSupported},
|
|
{"isGestureSupported", lua_Game_isGestureSupported},
|
|
|
{"isInitialized", lua_Game_isInitialized},
|
|
{"isInitialized", lua_Game_isInitialized},
|
|
|
{"isMouseCaptured", lua_Game_isMouseCaptured},
|
|
{"isMouseCaptured", lua_Game_isMouseCaptured},
|
|
@@ -1262,6 +1263,47 @@ int lua_Game_isCursorVisible(lua_State* state)
|
|
|
return 0;
|
|
return 0;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+int lua_Game_isGestureRegistered(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_TSTRING || lua_type(state, 2) == LUA_TNIL))
|
|
|
|
|
+ {
|
|
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
|
|
+ Gesture::GestureEvent param1 = (Gesture::GestureEvent)lua_enumFromString_GestureGestureEvent(luaL_checkstring(state, 2));
|
|
|
|
|
+
|
|
|
|
|
+ Game* instance = getInstance(state);
|
|
|
|
|
+ bool result = instance->isGestureRegistered(param1);
|
|
|
|
|
+
|
|
|
|
|
+ // Push the return value onto the stack.
|
|
|
|
|
+ lua_pushboolean(state, result);
|
|
|
|
|
+
|
|
|
|
|
+ return 1;
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ lua_pushstring(state, "lua_Game_isGestureRegistered - 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_Game_isGestureSupported(lua_State* state)
|
|
int lua_Game_isGestureSupported(lua_State* state)
|
|
|
{
|
|
{
|
|
|
// Get the number of parameters.
|
|
// Get the number of parameters.
|