lua_Platform.cpp 45 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516
  1. #include "Base.h"
  2. #include "ScriptController.h"
  3. #include "lua_Platform.h"
  4. #include "Platform.h"
  5. #include "lua_GestureGestureEvent.h"
  6. #include "lua_KeyboardKeyEvent.h"
  7. #include "lua_MouseMouseEvent.h"
  8. #include "lua_TouchTouchEvent.h"
  9. namespace gameplay
  10. {
  11. void luaRegister_Platform()
  12. {
  13. const luaL_Reg lua_members[] =
  14. {
  15. {"enterMessagePump", lua_Platform_enterMessagePump},
  16. {NULL, NULL}
  17. };
  18. const luaL_Reg lua_statics[] =
  19. {
  20. {"canExit", lua_Platform_static_canExit},
  21. {"displayKeyboard", lua_Platform_static_displayKeyboard},
  22. {"getAbsoluteTime", lua_Platform_static_getAbsoluteTime},
  23. {"getAccelerometerValues", lua_Platform_static_getAccelerometerValues},
  24. {"getDisplayHeight", lua_Platform_static_getDisplayHeight},
  25. {"getDisplayWidth", lua_Platform_static_getDisplayWidth},
  26. {"getGamepadButtonCount", lua_Platform_static_getGamepadButtonCount},
  27. {"getGamepadButtonState", lua_Platform_static_getGamepadButtonState},
  28. {"getGamepadId", lua_Platform_static_getGamepadId},
  29. {"getGamepadJoystickAxisValues", lua_Platform_static_getGamepadJoystickAxisValues},
  30. {"getGamepadJoystickAxisX", lua_Platform_static_getGamepadJoystickAxisX},
  31. {"getGamepadJoystickAxisY", lua_Platform_static_getGamepadJoystickAxisY},
  32. {"getGamepadJoystickCount", lua_Platform_static_getGamepadJoystickCount},
  33. {"getGamepadTriggerCount", lua_Platform_static_getGamepadTriggerCount},
  34. {"getGamepadTriggerValue", lua_Platform_static_getGamepadTriggerValue},
  35. {"getGamepadsConnected", lua_Platform_static_getGamepadsConnected},
  36. {"hasMouse", lua_Platform_static_hasMouse},
  37. {"isCursorVisible", lua_Platform_static_isCursorVisible},
  38. {"isGamepadConnected", lua_Platform_static_isGamepadConnected},
  39. {"isGamepadJoystickActive", lua_Platform_static_isGamepadJoystickActive},
  40. {"isGestureRegistered", lua_Platform_static_isGestureRegistered},
  41. {"isGestureSupported", lua_Platform_static_isGestureSupported},
  42. {"isMouseCaptured", lua_Platform_static_isMouseCaptured},
  43. {"isMultiTouch", lua_Platform_static_isMultiTouch},
  44. {"isVsync", lua_Platform_static_isVsync},
  45. {"keyEventInternal", lua_Platform_static_keyEventInternal},
  46. {"mouseEventInternal", lua_Platform_static_mouseEventInternal},
  47. {"registerGesture", lua_Platform_static_registerGesture},
  48. {"setAbsoluteTime", lua_Platform_static_setAbsoluteTime},
  49. {"setCursorVisible", lua_Platform_static_setCursorVisible},
  50. {"setMouseCaptured", lua_Platform_static_setMouseCaptured},
  51. {"setMultiTouch", lua_Platform_static_setMultiTouch},
  52. {"setVsync", lua_Platform_static_setVsync},
  53. {"signalShutdown", lua_Platform_static_signalShutdown},
  54. {"sleep", lua_Platform_static_sleep},
  55. {"swapBuffers", lua_Platform_static_swapBuffers},
  56. {"touchEventInternal", lua_Platform_static_touchEventInternal},
  57. {"unregisterGesture", lua_Platform_static_unregisterGesture},
  58. {NULL, NULL}
  59. };
  60. std::vector<std::string> scopePath;
  61. ScriptUtil::registerClass("Platform", lua_members, NULL, lua_Platform__gc, lua_statics, scopePath);
  62. }
  63. static Platform* getInstance(lua_State* state)
  64. {
  65. void* userdata = luaL_checkudata(state, 1, "Platform");
  66. luaL_argcheck(state, userdata != NULL, 1, "'Platform' expected.");
  67. return (Platform*)((ScriptUtil::LuaObject*)userdata)->instance;
  68. }
  69. int lua_Platform__gc(lua_State* state)
  70. {
  71. // Get the number of parameters.
  72. int paramCount = lua_gettop(state);
  73. // Attempt to match the parameters to a valid binding.
  74. switch (paramCount)
  75. {
  76. case 1:
  77. {
  78. if ((lua_type(state, 1) == LUA_TUSERDATA))
  79. {
  80. void* userdata = luaL_checkudata(state, 1, "Platform");
  81. luaL_argcheck(state, userdata != NULL, 1, "'Platform' expected.");
  82. ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)userdata;
  83. if (object->owns)
  84. {
  85. Platform* instance = (Platform*)object->instance;
  86. SAFE_DELETE(instance);
  87. }
  88. return 0;
  89. }
  90. else
  91. {
  92. lua_pushstring(state, "lua_Platform__gc - Failed to match the given parameters to a valid function signature.");
  93. lua_error(state);
  94. }
  95. break;
  96. }
  97. default:
  98. {
  99. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  100. lua_error(state);
  101. break;
  102. }
  103. }
  104. return 0;
  105. }
  106. int lua_Platform_enterMessagePump(lua_State* state)
  107. {
  108. // Get the number of parameters.
  109. int paramCount = lua_gettop(state);
  110. // Attempt to match the parameters to a valid binding.
  111. switch (paramCount)
  112. {
  113. case 1:
  114. {
  115. if ((lua_type(state, 1) == LUA_TUSERDATA))
  116. {
  117. Platform* instance = getInstance(state);
  118. int result = instance->enterMessagePump();
  119. // Push the return value onto the stack.
  120. lua_pushinteger(state, result);
  121. return 1;
  122. }
  123. else
  124. {
  125. lua_pushstring(state, "lua_Platform_enterMessagePump - Failed to match the given parameters to a valid function signature.");
  126. lua_error(state);
  127. }
  128. break;
  129. }
  130. default:
  131. {
  132. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  133. lua_error(state);
  134. break;
  135. }
  136. }
  137. return 0;
  138. }
  139. int lua_Platform_static_canExit(lua_State* state)
  140. {
  141. // Get the number of parameters.
  142. int paramCount = lua_gettop(state);
  143. // Attempt to match the parameters to a valid binding.
  144. switch (paramCount)
  145. {
  146. case 0:
  147. {
  148. bool result = Platform::canExit();
  149. // Push the return value onto the stack.
  150. lua_pushboolean(state, result);
  151. return 1;
  152. break;
  153. }
  154. default:
  155. {
  156. lua_pushstring(state, "Invalid number of parameters (expected 0).");
  157. lua_error(state);
  158. break;
  159. }
  160. }
  161. return 0;
  162. }
  163. int lua_Platform_static_displayKeyboard(lua_State* state)
  164. {
  165. // Get the number of parameters.
  166. int paramCount = lua_gettop(state);
  167. // Attempt to match the parameters to a valid binding.
  168. switch (paramCount)
  169. {
  170. case 1:
  171. {
  172. if (lua_type(state, 1) == LUA_TBOOLEAN)
  173. {
  174. // Get parameter 1 off the stack.
  175. bool param1 = ScriptUtil::luaCheckBool(state, 1);
  176. Platform::displayKeyboard(param1);
  177. return 0;
  178. }
  179. else
  180. {
  181. lua_pushstring(state, "lua_Platform_static_displayKeyboard - Failed to match the given parameters to a valid function signature.");
  182. lua_error(state);
  183. }
  184. break;
  185. }
  186. default:
  187. {
  188. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  189. lua_error(state);
  190. break;
  191. }
  192. }
  193. return 0;
  194. }
  195. int lua_Platform_static_getAbsoluteTime(lua_State* state)
  196. {
  197. // Get the number of parameters.
  198. int paramCount = lua_gettop(state);
  199. // Attempt to match the parameters to a valid binding.
  200. switch (paramCount)
  201. {
  202. case 0:
  203. {
  204. double result = Platform::getAbsoluteTime();
  205. // Push the return value onto the stack.
  206. lua_pushnumber(state, result);
  207. return 1;
  208. break;
  209. }
  210. default:
  211. {
  212. lua_pushstring(state, "Invalid number of parameters (expected 0).");
  213. lua_error(state);
  214. break;
  215. }
  216. }
  217. return 0;
  218. }
  219. int lua_Platform_static_getAccelerometerValues(lua_State* state)
  220. {
  221. // Get the number of parameters.
  222. int paramCount = lua_gettop(state);
  223. // Attempt to match the parameters to a valid binding.
  224. switch (paramCount)
  225. {
  226. case 2:
  227. {
  228. if ((lua_type(state, 1) == LUA_TTABLE || lua_type(state, 1) == LUA_TLIGHTUSERDATA) &&
  229. (lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TLIGHTUSERDATA))
  230. {
  231. // Get parameter 1 off the stack.
  232. ScriptUtil::LuaArray<float> param1 = ScriptUtil::getFloatPointer(1);
  233. // Get parameter 2 off the stack.
  234. ScriptUtil::LuaArray<float> param2 = ScriptUtil::getFloatPointer(2);
  235. Platform::getAccelerometerValues(param1, param2);
  236. return 0;
  237. }
  238. else
  239. {
  240. lua_pushstring(state, "lua_Platform_static_getAccelerometerValues - Failed to match the given parameters to a valid function signature.");
  241. lua_error(state);
  242. }
  243. break;
  244. }
  245. default:
  246. {
  247. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  248. lua_error(state);
  249. break;
  250. }
  251. }
  252. return 0;
  253. }
  254. int lua_Platform_static_getDisplayHeight(lua_State* state)
  255. {
  256. // Get the number of parameters.
  257. int paramCount = lua_gettop(state);
  258. // Attempt to match the parameters to a valid binding.
  259. switch (paramCount)
  260. {
  261. case 0:
  262. {
  263. unsigned int result = Platform::getDisplayHeight();
  264. // Push the return value onto the stack.
  265. lua_pushunsigned(state, result);
  266. return 1;
  267. break;
  268. }
  269. default:
  270. {
  271. lua_pushstring(state, "Invalid number of parameters (expected 0).");
  272. lua_error(state);
  273. break;
  274. }
  275. }
  276. return 0;
  277. }
  278. int lua_Platform_static_getDisplayWidth(lua_State* state)
  279. {
  280. // Get the number of parameters.
  281. int paramCount = lua_gettop(state);
  282. // Attempt to match the parameters to a valid binding.
  283. switch (paramCount)
  284. {
  285. case 0:
  286. {
  287. unsigned int result = Platform::getDisplayWidth();
  288. // Push the return value onto the stack.
  289. lua_pushunsigned(state, result);
  290. return 1;
  291. break;
  292. }
  293. default:
  294. {
  295. lua_pushstring(state, "Invalid number of parameters (expected 0).");
  296. lua_error(state);
  297. break;
  298. }
  299. }
  300. return 0;
  301. }
  302. int lua_Platform_static_getGamepadButtonCount(lua_State* state)
  303. {
  304. // Get the number of parameters.
  305. int paramCount = lua_gettop(state);
  306. // Attempt to match the parameters to a valid binding.
  307. switch (paramCount)
  308. {
  309. case 1:
  310. {
  311. if (lua_type(state, 1) == LUA_TNUMBER)
  312. {
  313. // Get parameter 1 off the stack.
  314. unsigned int param1 = (unsigned int)luaL_checkunsigned(state, 1);
  315. unsigned int result = Platform::getGamepadButtonCount(param1);
  316. // Push the return value onto the stack.
  317. lua_pushunsigned(state, result);
  318. return 1;
  319. }
  320. else
  321. {
  322. lua_pushstring(state, "lua_Platform_static_getGamepadButtonCount - Failed to match the given parameters to a valid function signature.");
  323. lua_error(state);
  324. }
  325. break;
  326. }
  327. default:
  328. {
  329. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  330. lua_error(state);
  331. break;
  332. }
  333. }
  334. return 0;
  335. }
  336. int lua_Platform_static_getGamepadButtonState(lua_State* state)
  337. {
  338. // Get the number of parameters.
  339. int paramCount = lua_gettop(state);
  340. // Attempt to match the parameters to a valid binding.
  341. switch (paramCount)
  342. {
  343. case 2:
  344. {
  345. if (lua_type(state, 1) == LUA_TNUMBER &&
  346. lua_type(state, 2) == LUA_TNUMBER)
  347. {
  348. // Get parameter 1 off the stack.
  349. unsigned int param1 = (unsigned int)luaL_checkunsigned(state, 1);
  350. // Get parameter 2 off the stack.
  351. unsigned int param2 = (unsigned int)luaL_checkunsigned(state, 2);
  352. bool result = Platform::getGamepadButtonState(param1, param2);
  353. // Push the return value onto the stack.
  354. lua_pushboolean(state, result);
  355. return 1;
  356. }
  357. else
  358. {
  359. lua_pushstring(state, "lua_Platform_static_getGamepadButtonState - Failed to match the given parameters to a valid function signature.");
  360. lua_error(state);
  361. }
  362. break;
  363. }
  364. default:
  365. {
  366. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  367. lua_error(state);
  368. break;
  369. }
  370. }
  371. return 0;
  372. }
  373. int lua_Platform_static_getGamepadId(lua_State* state)
  374. {
  375. // Get the number of parameters.
  376. int paramCount = lua_gettop(state);
  377. // Attempt to match the parameters to a valid binding.
  378. switch (paramCount)
  379. {
  380. case 1:
  381. {
  382. if (lua_type(state, 1) == LUA_TNUMBER)
  383. {
  384. // Get parameter 1 off the stack.
  385. unsigned int param1 = (unsigned int)luaL_checkunsigned(state, 1);
  386. const char* result = Platform::getGamepadId(param1);
  387. // Push the return value onto the stack.
  388. lua_pushstring(state, result);
  389. return 1;
  390. }
  391. else
  392. {
  393. lua_pushstring(state, "lua_Platform_static_getGamepadId - Failed to match the given parameters to a valid function signature.");
  394. lua_error(state);
  395. }
  396. break;
  397. }
  398. default:
  399. {
  400. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  401. lua_error(state);
  402. break;
  403. }
  404. }
  405. return 0;
  406. }
  407. int lua_Platform_static_getGamepadJoystickAxisValues(lua_State* state)
  408. {
  409. // Get the number of parameters.
  410. int paramCount = lua_gettop(state);
  411. // Attempt to match the parameters to a valid binding.
  412. switch (paramCount)
  413. {
  414. case 3:
  415. {
  416. if (lua_type(state, 1) == LUA_TNUMBER &&
  417. lua_type(state, 2) == LUA_TNUMBER &&
  418. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TTABLE || lua_type(state, 3) == LUA_TNIL))
  419. {
  420. // Get parameter 1 off the stack.
  421. unsigned int param1 = (unsigned int)luaL_checkunsigned(state, 1);
  422. // Get parameter 2 off the stack.
  423. unsigned int param2 = (unsigned int)luaL_checkunsigned(state, 2);
  424. // Get parameter 3 off the stack.
  425. ScriptUtil::LuaArray<Vector2> param3 = ScriptUtil::getObjectPointer<Vector2>(3, "Vector2", false);
  426. Platform::getGamepadJoystickAxisValues(param1, param2, param3);
  427. return 0;
  428. }
  429. else
  430. {
  431. lua_pushstring(state, "lua_Platform_static_getGamepadJoystickAxisValues - Failed to match the given parameters to a valid function signature.");
  432. lua_error(state);
  433. }
  434. break;
  435. }
  436. default:
  437. {
  438. lua_pushstring(state, "Invalid number of parameters (expected 3).");
  439. lua_error(state);
  440. break;
  441. }
  442. }
  443. return 0;
  444. }
  445. int lua_Platform_static_getGamepadJoystickAxisX(lua_State* state)
  446. {
  447. // Get the number of parameters.
  448. int paramCount = lua_gettop(state);
  449. // Attempt to match the parameters to a valid binding.
  450. switch (paramCount)
  451. {
  452. case 2:
  453. {
  454. if (lua_type(state, 1) == LUA_TNUMBER &&
  455. lua_type(state, 2) == LUA_TNUMBER)
  456. {
  457. // Get parameter 1 off the stack.
  458. unsigned int param1 = (unsigned int)luaL_checkunsigned(state, 1);
  459. // Get parameter 2 off the stack.
  460. unsigned int param2 = (unsigned int)luaL_checkunsigned(state, 2);
  461. float result = Platform::getGamepadJoystickAxisX(param1, param2);
  462. // Push the return value onto the stack.
  463. lua_pushnumber(state, result);
  464. return 1;
  465. }
  466. else
  467. {
  468. lua_pushstring(state, "lua_Platform_static_getGamepadJoystickAxisX - Failed to match the given parameters to a valid function signature.");
  469. lua_error(state);
  470. }
  471. break;
  472. }
  473. default:
  474. {
  475. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  476. lua_error(state);
  477. break;
  478. }
  479. }
  480. return 0;
  481. }
  482. int lua_Platform_static_getGamepadJoystickAxisY(lua_State* state)
  483. {
  484. // Get the number of parameters.
  485. int paramCount = lua_gettop(state);
  486. // Attempt to match the parameters to a valid binding.
  487. switch (paramCount)
  488. {
  489. case 2:
  490. {
  491. if (lua_type(state, 1) == LUA_TNUMBER &&
  492. lua_type(state, 2) == LUA_TNUMBER)
  493. {
  494. // Get parameter 1 off the stack.
  495. unsigned int param1 = (unsigned int)luaL_checkunsigned(state, 1);
  496. // Get parameter 2 off the stack.
  497. unsigned int param2 = (unsigned int)luaL_checkunsigned(state, 2);
  498. float result = Platform::getGamepadJoystickAxisY(param1, param2);
  499. // Push the return value onto the stack.
  500. lua_pushnumber(state, result);
  501. return 1;
  502. }
  503. else
  504. {
  505. lua_pushstring(state, "lua_Platform_static_getGamepadJoystickAxisY - Failed to match the given parameters to a valid function signature.");
  506. lua_error(state);
  507. }
  508. break;
  509. }
  510. default:
  511. {
  512. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  513. lua_error(state);
  514. break;
  515. }
  516. }
  517. return 0;
  518. }
  519. int lua_Platform_static_getGamepadJoystickCount(lua_State* state)
  520. {
  521. // Get the number of parameters.
  522. int paramCount = lua_gettop(state);
  523. // Attempt to match the parameters to a valid binding.
  524. switch (paramCount)
  525. {
  526. case 1:
  527. {
  528. if (lua_type(state, 1) == LUA_TNUMBER)
  529. {
  530. // Get parameter 1 off the stack.
  531. unsigned int param1 = (unsigned int)luaL_checkunsigned(state, 1);
  532. unsigned int result = Platform::getGamepadJoystickCount(param1);
  533. // Push the return value onto the stack.
  534. lua_pushunsigned(state, result);
  535. return 1;
  536. }
  537. else
  538. {
  539. lua_pushstring(state, "lua_Platform_static_getGamepadJoystickCount - Failed to match the given parameters to a valid function signature.");
  540. lua_error(state);
  541. }
  542. break;
  543. }
  544. default:
  545. {
  546. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  547. lua_error(state);
  548. break;
  549. }
  550. }
  551. return 0;
  552. }
  553. int lua_Platform_static_getGamepadTriggerCount(lua_State* state)
  554. {
  555. // Get the number of parameters.
  556. int paramCount = lua_gettop(state);
  557. // Attempt to match the parameters to a valid binding.
  558. switch (paramCount)
  559. {
  560. case 1:
  561. {
  562. if (lua_type(state, 1) == LUA_TNUMBER)
  563. {
  564. // Get parameter 1 off the stack.
  565. unsigned int param1 = (unsigned int)luaL_checkunsigned(state, 1);
  566. unsigned int result = Platform::getGamepadTriggerCount(param1);
  567. // Push the return value onto the stack.
  568. lua_pushunsigned(state, result);
  569. return 1;
  570. }
  571. else
  572. {
  573. lua_pushstring(state, "lua_Platform_static_getGamepadTriggerCount - Failed to match the given parameters to a valid function signature.");
  574. lua_error(state);
  575. }
  576. break;
  577. }
  578. default:
  579. {
  580. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  581. lua_error(state);
  582. break;
  583. }
  584. }
  585. return 0;
  586. }
  587. int lua_Platform_static_getGamepadTriggerValue(lua_State* state)
  588. {
  589. // Get the number of parameters.
  590. int paramCount = lua_gettop(state);
  591. // Attempt to match the parameters to a valid binding.
  592. switch (paramCount)
  593. {
  594. case 2:
  595. {
  596. if (lua_type(state, 1) == LUA_TNUMBER &&
  597. lua_type(state, 2) == LUA_TNUMBER)
  598. {
  599. // Get parameter 1 off the stack.
  600. unsigned int param1 = (unsigned int)luaL_checkunsigned(state, 1);
  601. // Get parameter 2 off the stack.
  602. unsigned int param2 = (unsigned int)luaL_checkunsigned(state, 2);
  603. float result = Platform::getGamepadTriggerValue(param1, param2);
  604. // Push the return value onto the stack.
  605. lua_pushnumber(state, result);
  606. return 1;
  607. }
  608. else
  609. {
  610. lua_pushstring(state, "lua_Platform_static_getGamepadTriggerValue - Failed to match the given parameters to a valid function signature.");
  611. lua_error(state);
  612. }
  613. break;
  614. }
  615. default:
  616. {
  617. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  618. lua_error(state);
  619. break;
  620. }
  621. }
  622. return 0;
  623. }
  624. int lua_Platform_static_getGamepadsConnected(lua_State* state)
  625. {
  626. // Get the number of parameters.
  627. int paramCount = lua_gettop(state);
  628. // Attempt to match the parameters to a valid binding.
  629. switch (paramCount)
  630. {
  631. case 0:
  632. {
  633. unsigned int result = Platform::getGamepadsConnected();
  634. // Push the return value onto the stack.
  635. lua_pushunsigned(state, result);
  636. return 1;
  637. break;
  638. }
  639. default:
  640. {
  641. lua_pushstring(state, "Invalid number of parameters (expected 0).");
  642. lua_error(state);
  643. break;
  644. }
  645. }
  646. return 0;
  647. }
  648. int lua_Platform_static_hasMouse(lua_State* state)
  649. {
  650. // Get the number of parameters.
  651. int paramCount = lua_gettop(state);
  652. // Attempt to match the parameters to a valid binding.
  653. switch (paramCount)
  654. {
  655. case 0:
  656. {
  657. bool result = Platform::hasMouse();
  658. // Push the return value onto the stack.
  659. lua_pushboolean(state, result);
  660. return 1;
  661. break;
  662. }
  663. default:
  664. {
  665. lua_pushstring(state, "Invalid number of parameters (expected 0).");
  666. lua_error(state);
  667. break;
  668. }
  669. }
  670. return 0;
  671. }
  672. int lua_Platform_static_isCursorVisible(lua_State* state)
  673. {
  674. // Get the number of parameters.
  675. int paramCount = lua_gettop(state);
  676. // Attempt to match the parameters to a valid binding.
  677. switch (paramCount)
  678. {
  679. case 0:
  680. {
  681. bool result = Platform::isCursorVisible();
  682. // Push the return value onto the stack.
  683. lua_pushboolean(state, result);
  684. return 1;
  685. break;
  686. }
  687. default:
  688. {
  689. lua_pushstring(state, "Invalid number of parameters (expected 0).");
  690. lua_error(state);
  691. break;
  692. }
  693. }
  694. return 0;
  695. }
  696. int lua_Platform_static_isGamepadConnected(lua_State* state)
  697. {
  698. // Get the number of parameters.
  699. int paramCount = lua_gettop(state);
  700. // Attempt to match the parameters to a valid binding.
  701. switch (paramCount)
  702. {
  703. case 1:
  704. {
  705. if (lua_type(state, 1) == LUA_TNUMBER)
  706. {
  707. // Get parameter 1 off the stack.
  708. unsigned int param1 = (unsigned int)luaL_checkunsigned(state, 1);
  709. bool result = Platform::isGamepadConnected(param1);
  710. // Push the return value onto the stack.
  711. lua_pushboolean(state, result);
  712. return 1;
  713. }
  714. else
  715. {
  716. lua_pushstring(state, "lua_Platform_static_isGamepadConnected - Failed to match the given parameters to a valid function signature.");
  717. lua_error(state);
  718. }
  719. break;
  720. }
  721. default:
  722. {
  723. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  724. lua_error(state);
  725. break;
  726. }
  727. }
  728. return 0;
  729. }
  730. int lua_Platform_static_isGamepadJoystickActive(lua_State* state)
  731. {
  732. // Get the number of parameters.
  733. int paramCount = lua_gettop(state);
  734. // Attempt to match the parameters to a valid binding.
  735. switch (paramCount)
  736. {
  737. case 2:
  738. {
  739. if (lua_type(state, 1) == LUA_TNUMBER &&
  740. lua_type(state, 2) == LUA_TNUMBER)
  741. {
  742. // Get parameter 1 off the stack.
  743. unsigned int param1 = (unsigned int)luaL_checkunsigned(state, 1);
  744. // Get parameter 2 off the stack.
  745. unsigned int param2 = (unsigned int)luaL_checkunsigned(state, 2);
  746. bool result = Platform::isGamepadJoystickActive(param1, param2);
  747. // Push the return value onto the stack.
  748. lua_pushboolean(state, result);
  749. return 1;
  750. }
  751. else
  752. {
  753. lua_pushstring(state, "lua_Platform_static_isGamepadJoystickActive - Failed to match the given parameters to a valid function signature.");
  754. lua_error(state);
  755. }
  756. break;
  757. }
  758. default:
  759. {
  760. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  761. lua_error(state);
  762. break;
  763. }
  764. }
  765. return 0;
  766. }
  767. int lua_Platform_static_isGestureRegistered(lua_State* state)
  768. {
  769. // Get the number of parameters.
  770. int paramCount = lua_gettop(state);
  771. // Attempt to match the parameters to a valid binding.
  772. switch (paramCount)
  773. {
  774. case 1:
  775. {
  776. if ((lua_type(state, 1) == LUA_TSTRING || lua_type(state, 1) == LUA_TNIL))
  777. {
  778. // Get parameter 1 off the stack.
  779. Gesture::GestureEvent param1 = (Gesture::GestureEvent)lua_enumFromString_GestureGestureEvent(luaL_checkstring(state, 1));
  780. bool result = Platform::isGestureRegistered(param1);
  781. // Push the return value onto the stack.
  782. lua_pushboolean(state, result);
  783. return 1;
  784. }
  785. else
  786. {
  787. lua_pushstring(state, "lua_Platform_static_isGestureRegistered - Failed to match the given parameters to a valid function signature.");
  788. lua_error(state);
  789. }
  790. break;
  791. }
  792. default:
  793. {
  794. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  795. lua_error(state);
  796. break;
  797. }
  798. }
  799. return 0;
  800. }
  801. int lua_Platform_static_isGestureSupported(lua_State* state)
  802. {
  803. // Get the number of parameters.
  804. int paramCount = lua_gettop(state);
  805. // Attempt to match the parameters to a valid binding.
  806. switch (paramCount)
  807. {
  808. case 1:
  809. {
  810. if ((lua_type(state, 1) == LUA_TSTRING || lua_type(state, 1) == LUA_TNIL))
  811. {
  812. // Get parameter 1 off the stack.
  813. Gesture::GestureEvent param1 = (Gesture::GestureEvent)lua_enumFromString_GestureGestureEvent(luaL_checkstring(state, 1));
  814. bool result = Platform::isGestureSupported(param1);
  815. // Push the return value onto the stack.
  816. lua_pushboolean(state, result);
  817. return 1;
  818. }
  819. else
  820. {
  821. lua_pushstring(state, "lua_Platform_static_isGestureSupported - Failed to match the given parameters to a valid function signature.");
  822. lua_error(state);
  823. }
  824. break;
  825. }
  826. default:
  827. {
  828. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  829. lua_error(state);
  830. break;
  831. }
  832. }
  833. return 0;
  834. }
  835. int lua_Platform_static_isMouseCaptured(lua_State* state)
  836. {
  837. // Get the number of parameters.
  838. int paramCount = lua_gettop(state);
  839. // Attempt to match the parameters to a valid binding.
  840. switch (paramCount)
  841. {
  842. case 0:
  843. {
  844. bool result = Platform::isMouseCaptured();
  845. // Push the return value onto the stack.
  846. lua_pushboolean(state, result);
  847. return 1;
  848. break;
  849. }
  850. default:
  851. {
  852. lua_pushstring(state, "Invalid number of parameters (expected 0).");
  853. lua_error(state);
  854. break;
  855. }
  856. }
  857. return 0;
  858. }
  859. int lua_Platform_static_isMultiTouch(lua_State* state)
  860. {
  861. // Get the number of parameters.
  862. int paramCount = lua_gettop(state);
  863. // Attempt to match the parameters to a valid binding.
  864. switch (paramCount)
  865. {
  866. case 0:
  867. {
  868. bool result = Platform::isMultiTouch();
  869. // Push the return value onto the stack.
  870. lua_pushboolean(state, result);
  871. return 1;
  872. break;
  873. }
  874. default:
  875. {
  876. lua_pushstring(state, "Invalid number of parameters (expected 0).");
  877. lua_error(state);
  878. break;
  879. }
  880. }
  881. return 0;
  882. }
  883. int lua_Platform_static_isVsync(lua_State* state)
  884. {
  885. // Get the number of parameters.
  886. int paramCount = lua_gettop(state);
  887. // Attempt to match the parameters to a valid binding.
  888. switch (paramCount)
  889. {
  890. case 0:
  891. {
  892. bool result = Platform::isVsync();
  893. // Push the return value onto the stack.
  894. lua_pushboolean(state, result);
  895. return 1;
  896. break;
  897. }
  898. default:
  899. {
  900. lua_pushstring(state, "Invalid number of parameters (expected 0).");
  901. lua_error(state);
  902. break;
  903. }
  904. }
  905. return 0;
  906. }
  907. int lua_Platform_static_keyEventInternal(lua_State* state)
  908. {
  909. // Get the number of parameters.
  910. int paramCount = lua_gettop(state);
  911. // Attempt to match the parameters to a valid binding.
  912. switch (paramCount)
  913. {
  914. case 2:
  915. {
  916. if ((lua_type(state, 1) == LUA_TSTRING || lua_type(state, 1) == LUA_TNIL) &&
  917. lua_type(state, 2) == LUA_TNUMBER)
  918. {
  919. // Get parameter 1 off the stack.
  920. Keyboard::KeyEvent param1 = (Keyboard::KeyEvent)lua_enumFromString_KeyboardKeyEvent(luaL_checkstring(state, 1));
  921. // Get parameter 2 off the stack.
  922. int param2 = (int)luaL_checkint(state, 2);
  923. Platform::keyEventInternal(param1, param2);
  924. return 0;
  925. }
  926. else
  927. {
  928. lua_pushstring(state, "lua_Platform_static_keyEventInternal - Failed to match the given parameters to a valid function signature.");
  929. lua_error(state);
  930. }
  931. break;
  932. }
  933. default:
  934. {
  935. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  936. lua_error(state);
  937. break;
  938. }
  939. }
  940. return 0;
  941. }
  942. int lua_Platform_static_mouseEventInternal(lua_State* state)
  943. {
  944. // Get the number of parameters.
  945. int paramCount = lua_gettop(state);
  946. // Attempt to match the parameters to a valid binding.
  947. switch (paramCount)
  948. {
  949. case 4:
  950. {
  951. if ((lua_type(state, 1) == LUA_TSTRING || lua_type(state, 1) == LUA_TNIL) &&
  952. lua_type(state, 2) == LUA_TNUMBER &&
  953. lua_type(state, 3) == LUA_TNUMBER &&
  954. lua_type(state, 4) == LUA_TNUMBER)
  955. {
  956. // Get parameter 1 off the stack.
  957. Mouse::MouseEvent param1 = (Mouse::MouseEvent)lua_enumFromString_MouseMouseEvent(luaL_checkstring(state, 1));
  958. // Get parameter 2 off the stack.
  959. int param2 = (int)luaL_checkint(state, 2);
  960. // Get parameter 3 off the stack.
  961. int param3 = (int)luaL_checkint(state, 3);
  962. // Get parameter 4 off the stack.
  963. int param4 = (int)luaL_checkint(state, 4);
  964. bool result = Platform::mouseEventInternal(param1, param2, param3, param4);
  965. // Push the return value onto the stack.
  966. lua_pushboolean(state, result);
  967. return 1;
  968. }
  969. else
  970. {
  971. lua_pushstring(state, "lua_Platform_static_mouseEventInternal - Failed to match the given parameters to a valid function signature.");
  972. lua_error(state);
  973. }
  974. break;
  975. }
  976. default:
  977. {
  978. lua_pushstring(state, "Invalid number of parameters (expected 4).");
  979. lua_error(state);
  980. break;
  981. }
  982. }
  983. return 0;
  984. }
  985. int lua_Platform_static_registerGesture(lua_State* state)
  986. {
  987. // Get the number of parameters.
  988. int paramCount = lua_gettop(state);
  989. // Attempt to match the parameters to a valid binding.
  990. switch (paramCount)
  991. {
  992. case 1:
  993. {
  994. if ((lua_type(state, 1) == LUA_TSTRING || lua_type(state, 1) == LUA_TNIL))
  995. {
  996. // Get parameter 1 off the stack.
  997. Gesture::GestureEvent param1 = (Gesture::GestureEvent)lua_enumFromString_GestureGestureEvent(luaL_checkstring(state, 1));
  998. Platform::registerGesture(param1);
  999. return 0;
  1000. }
  1001. else
  1002. {
  1003. lua_pushstring(state, "lua_Platform_static_registerGesture - Failed to match the given parameters to a valid function signature.");
  1004. lua_error(state);
  1005. }
  1006. break;
  1007. }
  1008. default:
  1009. {
  1010. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  1011. lua_error(state);
  1012. break;
  1013. }
  1014. }
  1015. return 0;
  1016. }
  1017. int lua_Platform_static_setAbsoluteTime(lua_State* state)
  1018. {
  1019. // Get the number of parameters.
  1020. int paramCount = lua_gettop(state);
  1021. // Attempt to match the parameters to a valid binding.
  1022. switch (paramCount)
  1023. {
  1024. case 1:
  1025. {
  1026. if (lua_type(state, 1) == LUA_TNUMBER)
  1027. {
  1028. // Get parameter 1 off the stack.
  1029. double param1 = (double)luaL_checknumber(state, 1);
  1030. Platform::setAbsoluteTime(param1);
  1031. return 0;
  1032. }
  1033. else
  1034. {
  1035. lua_pushstring(state, "lua_Platform_static_setAbsoluteTime - Failed to match the given parameters to a valid function signature.");
  1036. lua_error(state);
  1037. }
  1038. break;
  1039. }
  1040. default:
  1041. {
  1042. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  1043. lua_error(state);
  1044. break;
  1045. }
  1046. }
  1047. return 0;
  1048. }
  1049. int lua_Platform_static_setCursorVisible(lua_State* state)
  1050. {
  1051. // Get the number of parameters.
  1052. int paramCount = lua_gettop(state);
  1053. // Attempt to match the parameters to a valid binding.
  1054. switch (paramCount)
  1055. {
  1056. case 1:
  1057. {
  1058. if (lua_type(state, 1) == LUA_TBOOLEAN)
  1059. {
  1060. // Get parameter 1 off the stack.
  1061. bool param1 = ScriptUtil::luaCheckBool(state, 1);
  1062. Platform::setCursorVisible(param1);
  1063. return 0;
  1064. }
  1065. else
  1066. {
  1067. lua_pushstring(state, "lua_Platform_static_setCursorVisible - Failed to match the given parameters to a valid function signature.");
  1068. lua_error(state);
  1069. }
  1070. break;
  1071. }
  1072. default:
  1073. {
  1074. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  1075. lua_error(state);
  1076. break;
  1077. }
  1078. }
  1079. return 0;
  1080. }
  1081. int lua_Platform_static_setMouseCaptured(lua_State* state)
  1082. {
  1083. // Get the number of parameters.
  1084. int paramCount = lua_gettop(state);
  1085. // Attempt to match the parameters to a valid binding.
  1086. switch (paramCount)
  1087. {
  1088. case 1:
  1089. {
  1090. if (lua_type(state, 1) == LUA_TBOOLEAN)
  1091. {
  1092. // Get parameter 1 off the stack.
  1093. bool param1 = ScriptUtil::luaCheckBool(state, 1);
  1094. Platform::setMouseCaptured(param1);
  1095. return 0;
  1096. }
  1097. else
  1098. {
  1099. lua_pushstring(state, "lua_Platform_static_setMouseCaptured - Failed to match the given parameters to a valid function signature.");
  1100. lua_error(state);
  1101. }
  1102. break;
  1103. }
  1104. default:
  1105. {
  1106. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  1107. lua_error(state);
  1108. break;
  1109. }
  1110. }
  1111. return 0;
  1112. }
  1113. int lua_Platform_static_setMultiTouch(lua_State* state)
  1114. {
  1115. // Get the number of parameters.
  1116. int paramCount = lua_gettop(state);
  1117. // Attempt to match the parameters to a valid binding.
  1118. switch (paramCount)
  1119. {
  1120. case 1:
  1121. {
  1122. if (lua_type(state, 1) == LUA_TBOOLEAN)
  1123. {
  1124. // Get parameter 1 off the stack.
  1125. bool param1 = ScriptUtil::luaCheckBool(state, 1);
  1126. Platform::setMultiTouch(param1);
  1127. return 0;
  1128. }
  1129. else
  1130. {
  1131. lua_pushstring(state, "lua_Platform_static_setMultiTouch - Failed to match the given parameters to a valid function signature.");
  1132. lua_error(state);
  1133. }
  1134. break;
  1135. }
  1136. default:
  1137. {
  1138. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  1139. lua_error(state);
  1140. break;
  1141. }
  1142. }
  1143. return 0;
  1144. }
  1145. int lua_Platform_static_setVsync(lua_State* state)
  1146. {
  1147. // Get the number of parameters.
  1148. int paramCount = lua_gettop(state);
  1149. // Attempt to match the parameters to a valid binding.
  1150. switch (paramCount)
  1151. {
  1152. case 1:
  1153. {
  1154. if (lua_type(state, 1) == LUA_TBOOLEAN)
  1155. {
  1156. // Get parameter 1 off the stack.
  1157. bool param1 = ScriptUtil::luaCheckBool(state, 1);
  1158. Platform::setVsync(param1);
  1159. return 0;
  1160. }
  1161. else
  1162. {
  1163. lua_pushstring(state, "lua_Platform_static_setVsync - Failed to match the given parameters to a valid function signature.");
  1164. lua_error(state);
  1165. }
  1166. break;
  1167. }
  1168. default:
  1169. {
  1170. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  1171. lua_error(state);
  1172. break;
  1173. }
  1174. }
  1175. return 0;
  1176. }
  1177. int lua_Platform_static_signalShutdown(lua_State* state)
  1178. {
  1179. // Get the number of parameters.
  1180. int paramCount = lua_gettop(state);
  1181. // Attempt to match the parameters to a valid binding.
  1182. switch (paramCount)
  1183. {
  1184. case 0:
  1185. {
  1186. Platform::signalShutdown();
  1187. return 0;
  1188. break;
  1189. }
  1190. default:
  1191. {
  1192. lua_pushstring(state, "Invalid number of parameters (expected 0).");
  1193. lua_error(state);
  1194. break;
  1195. }
  1196. }
  1197. return 0;
  1198. }
  1199. int lua_Platform_static_sleep(lua_State* state)
  1200. {
  1201. // Get the number of parameters.
  1202. int paramCount = lua_gettop(state);
  1203. // Attempt to match the parameters to a valid binding.
  1204. switch (paramCount)
  1205. {
  1206. case 1:
  1207. {
  1208. if (lua_type(state, 1) == LUA_TNUMBER)
  1209. {
  1210. // Get parameter 1 off the stack.
  1211. long param1 = (long)luaL_checklong(state, 1);
  1212. Platform::sleep(param1);
  1213. return 0;
  1214. }
  1215. else
  1216. {
  1217. lua_pushstring(state, "lua_Platform_static_sleep - Failed to match the given parameters to a valid function signature.");
  1218. lua_error(state);
  1219. }
  1220. break;
  1221. }
  1222. default:
  1223. {
  1224. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  1225. lua_error(state);
  1226. break;
  1227. }
  1228. }
  1229. return 0;
  1230. }
  1231. int lua_Platform_static_swapBuffers(lua_State* state)
  1232. {
  1233. // Get the number of parameters.
  1234. int paramCount = lua_gettop(state);
  1235. // Attempt to match the parameters to a valid binding.
  1236. switch (paramCount)
  1237. {
  1238. case 0:
  1239. {
  1240. Platform::swapBuffers();
  1241. return 0;
  1242. break;
  1243. }
  1244. default:
  1245. {
  1246. lua_pushstring(state, "Invalid number of parameters (expected 0).");
  1247. lua_error(state);
  1248. break;
  1249. }
  1250. }
  1251. return 0;
  1252. }
  1253. int lua_Platform_static_touchEventInternal(lua_State* state)
  1254. {
  1255. // Get the number of parameters.
  1256. int paramCount = lua_gettop(state);
  1257. // Attempt to match the parameters to a valid binding.
  1258. switch (paramCount)
  1259. {
  1260. case 4:
  1261. {
  1262. if ((lua_type(state, 1) == LUA_TSTRING || lua_type(state, 1) == LUA_TNIL) &&
  1263. lua_type(state, 2) == LUA_TNUMBER &&
  1264. lua_type(state, 3) == LUA_TNUMBER &&
  1265. lua_type(state, 4) == LUA_TNUMBER)
  1266. {
  1267. // Get parameter 1 off the stack.
  1268. Touch::TouchEvent param1 = (Touch::TouchEvent)lua_enumFromString_TouchTouchEvent(luaL_checkstring(state, 1));
  1269. // Get parameter 2 off the stack.
  1270. int param2 = (int)luaL_checkint(state, 2);
  1271. // Get parameter 3 off the stack.
  1272. int param3 = (int)luaL_checkint(state, 3);
  1273. // Get parameter 4 off the stack.
  1274. unsigned int param4 = (unsigned int)luaL_checkunsigned(state, 4);
  1275. Platform::touchEventInternal(param1, param2, param3, param4);
  1276. return 0;
  1277. }
  1278. else
  1279. {
  1280. lua_pushstring(state, "lua_Platform_static_touchEventInternal - Failed to match the given parameters to a valid function signature.");
  1281. lua_error(state);
  1282. }
  1283. break;
  1284. }
  1285. default:
  1286. {
  1287. lua_pushstring(state, "Invalid number of parameters (expected 4).");
  1288. lua_error(state);
  1289. break;
  1290. }
  1291. }
  1292. return 0;
  1293. }
  1294. int lua_Platform_static_unregisterGesture(lua_State* state)
  1295. {
  1296. // Get the number of parameters.
  1297. int paramCount = lua_gettop(state);
  1298. // Attempt to match the parameters to a valid binding.
  1299. switch (paramCount)
  1300. {
  1301. case 1:
  1302. {
  1303. if ((lua_type(state, 1) == LUA_TSTRING || lua_type(state, 1) == LUA_TNIL))
  1304. {
  1305. // Get parameter 1 off the stack.
  1306. Gesture::GestureEvent param1 = (Gesture::GestureEvent)lua_enumFromString_GestureGestureEvent(luaL_checkstring(state, 1));
  1307. Platform::unregisterGesture(param1);
  1308. return 0;
  1309. }
  1310. else
  1311. {
  1312. lua_pushstring(state, "lua_Platform_static_unregisterGesture - Failed to match the given parameters to a valid function signature.");
  1313. lua_error(state);
  1314. }
  1315. break;
  1316. }
  1317. default:
  1318. {
  1319. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  1320. lua_error(state);
  1321. break;
  1322. }
  1323. }
  1324. return 0;
  1325. }
  1326. }