lua_SpriteBatch.cpp 61 KB

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