lua_MeshBatch.cpp 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730
  1. // Autogenerated by gameplay-luagen
  2. #include "Base.h"
  3. #include "ScriptController.h"
  4. #include "lua_MeshBatch.h"
  5. #include "MeshBatch.h"
  6. namespace gameplay
  7. {
  8. void luaRegister_MeshBatch()
  9. {
  10. const luaL_Reg lua_members[] =
  11. {
  12. {"add", lua_MeshBatch_add},
  13. {"draw", lua_MeshBatch_draw},
  14. {"finish", lua_MeshBatch_finish},
  15. {"getCapacity", lua_MeshBatch_getCapacity},
  16. {"getMaterial", lua_MeshBatch_getMaterial},
  17. {"isStarted", lua_MeshBatch_isStarted},
  18. {"setCapacity", lua_MeshBatch_setCapacity},
  19. {"start", lua_MeshBatch_start},
  20. {NULL, NULL}
  21. };
  22. const luaL_Reg lua_statics[] =
  23. {
  24. {"create", lua_MeshBatch_static_create},
  25. {NULL, NULL}
  26. };
  27. std::vector<std::string> scopePath;
  28. gameplay::ScriptUtil::registerClass("MeshBatch", lua_members, NULL, lua_MeshBatch__gc, lua_statics, scopePath);
  29. }
  30. static MeshBatch* getInstance(lua_State* state)
  31. {
  32. void* userdata = luaL_checkudata(state, 1, "MeshBatch");
  33. luaL_argcheck(state, userdata != NULL, 1, "'MeshBatch' expected.");
  34. return (MeshBatch*)((gameplay::ScriptUtil::LuaObject*)userdata)->instance;
  35. }
  36. int lua_MeshBatch__gc(lua_State* state)
  37. {
  38. // Get the number of parameters.
  39. int paramCount = lua_gettop(state);
  40. // Attempt to match the parameters to a valid binding.
  41. switch (paramCount)
  42. {
  43. case 1:
  44. {
  45. if ((lua_type(state, 1) == LUA_TUSERDATA))
  46. {
  47. void* userdata = luaL_checkudata(state, 1, "MeshBatch");
  48. luaL_argcheck(state, userdata != NULL, 1, "'MeshBatch' expected.");
  49. gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)userdata;
  50. if (object->owns)
  51. {
  52. MeshBatch* instance = (MeshBatch*)object->instance;
  53. SAFE_DELETE(instance);
  54. }
  55. return 0;
  56. }
  57. lua_pushstring(state, "lua_MeshBatch__gc - Failed to match the given parameters to a valid function signature.");
  58. lua_error(state);
  59. break;
  60. }
  61. default:
  62. {
  63. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  64. lua_error(state);
  65. break;
  66. }
  67. }
  68. return 0;
  69. }
  70. int lua_MeshBatch_add(lua_State* state)
  71. {
  72. // Get the number of parameters.
  73. int paramCount = lua_gettop(state);
  74. // Attempt to match the parameters to a valid binding.
  75. switch (paramCount)
  76. {
  77. case 3:
  78. {
  79. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  80. (lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TLIGHTUSERDATA) &&
  81. lua_type(state, 3) == LUA_TNUMBER)
  82. {
  83. // Get parameter 1 off the stack.
  84. gameplay::ScriptUtil::LuaArray<float> param1 = gameplay::ScriptUtil::getFloatPointer(2);
  85. // Get parameter 2 off the stack.
  86. unsigned int param2 = (unsigned int)luaL_checkunsigned(state, 3);
  87. MeshBatch* instance = getInstance(state);
  88. instance->add(param1, param2);
  89. return 0;
  90. }
  91. lua_pushstring(state, "lua_MeshBatch_add - Failed to match the given parameters to a valid function signature.");
  92. lua_error(state);
  93. break;
  94. }
  95. case 4:
  96. {
  97. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  98. (lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TLIGHTUSERDATA) &&
  99. lua_type(state, 3) == LUA_TNUMBER &&
  100. (lua_type(state, 4) == LUA_TTABLE || lua_type(state, 4) == LUA_TLIGHTUSERDATA))
  101. {
  102. // Get parameter 1 off the stack.
  103. gameplay::ScriptUtil::LuaArray<float> param1 = gameplay::ScriptUtil::getFloatPointer(2);
  104. // Get parameter 2 off the stack.
  105. unsigned int param2 = (unsigned int)luaL_checkunsigned(state, 3);
  106. // Get parameter 3 off the stack.
  107. gameplay::ScriptUtil::LuaArray<unsigned short> param3 = gameplay::ScriptUtil::getUnsignedShortPointer(4);
  108. MeshBatch* instance = getInstance(state);
  109. instance->add(param1, param2, param3);
  110. return 0;
  111. }
  112. lua_pushstring(state, "lua_MeshBatch_add - Failed to match the given parameters to a valid function signature.");
  113. lua_error(state);
  114. break;
  115. }
  116. case 5:
  117. {
  118. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  119. (lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TLIGHTUSERDATA) &&
  120. lua_type(state, 3) == LUA_TNUMBER &&
  121. (lua_type(state, 4) == LUA_TTABLE || lua_type(state, 4) == LUA_TLIGHTUSERDATA) &&
  122. lua_type(state, 5) == LUA_TNUMBER)
  123. {
  124. // Get parameter 1 off the stack.
  125. gameplay::ScriptUtil::LuaArray<float> param1 = gameplay::ScriptUtil::getFloatPointer(2);
  126. // Get parameter 2 off the stack.
  127. unsigned int param2 = (unsigned int)luaL_checkunsigned(state, 3);
  128. // Get parameter 3 off the stack.
  129. gameplay::ScriptUtil::LuaArray<unsigned short> param3 = gameplay::ScriptUtil::getUnsignedShortPointer(4);
  130. // Get parameter 4 off the stack.
  131. unsigned int param4 = (unsigned int)luaL_checkunsigned(state, 5);
  132. MeshBatch* instance = getInstance(state);
  133. instance->add(param1, param2, param3, param4);
  134. return 0;
  135. }
  136. lua_pushstring(state, "lua_MeshBatch_add - Failed to match the given parameters to a valid function signature.");
  137. lua_error(state);
  138. break;
  139. }
  140. default:
  141. {
  142. lua_pushstring(state, "Invalid number of parameters (expected 3, 4 or 5).");
  143. lua_error(state);
  144. break;
  145. }
  146. }
  147. return 0;
  148. }
  149. int lua_MeshBatch_draw(lua_State* state)
  150. {
  151. // Get the number of parameters.
  152. int paramCount = lua_gettop(state);
  153. // Attempt to match the parameters to a valid binding.
  154. switch (paramCount)
  155. {
  156. case 1:
  157. {
  158. if ((lua_type(state, 1) == LUA_TUSERDATA))
  159. {
  160. MeshBatch* instance = getInstance(state);
  161. instance->draw();
  162. return 0;
  163. }
  164. lua_pushstring(state, "lua_MeshBatch_draw - Failed to match the given parameters to a valid function signature.");
  165. lua_error(state);
  166. break;
  167. }
  168. default:
  169. {
  170. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  171. lua_error(state);
  172. break;
  173. }
  174. }
  175. return 0;
  176. }
  177. int lua_MeshBatch_finish(lua_State* state)
  178. {
  179. // Get the number of parameters.
  180. int paramCount = lua_gettop(state);
  181. // Attempt to match the parameters to a valid binding.
  182. switch (paramCount)
  183. {
  184. case 1:
  185. {
  186. if ((lua_type(state, 1) == LUA_TUSERDATA))
  187. {
  188. MeshBatch* instance = getInstance(state);
  189. instance->finish();
  190. return 0;
  191. }
  192. lua_pushstring(state, "lua_MeshBatch_finish - Failed to match the given parameters to a valid function signature.");
  193. lua_error(state);
  194. break;
  195. }
  196. default:
  197. {
  198. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  199. lua_error(state);
  200. break;
  201. }
  202. }
  203. return 0;
  204. }
  205. int lua_MeshBatch_getCapacity(lua_State* state)
  206. {
  207. // Get the number of parameters.
  208. int paramCount = lua_gettop(state);
  209. // Attempt to match the parameters to a valid binding.
  210. switch (paramCount)
  211. {
  212. case 1:
  213. {
  214. if ((lua_type(state, 1) == LUA_TUSERDATA))
  215. {
  216. MeshBatch* instance = getInstance(state);
  217. unsigned int result = instance->getCapacity();
  218. // Push the return value onto the stack.
  219. lua_pushunsigned(state, result);
  220. return 1;
  221. }
  222. lua_pushstring(state, "lua_MeshBatch_getCapacity - Failed to match the given parameters to a valid function signature.");
  223. lua_error(state);
  224. break;
  225. }
  226. default:
  227. {
  228. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  229. lua_error(state);
  230. break;
  231. }
  232. }
  233. return 0;
  234. }
  235. int lua_MeshBatch_getMaterial(lua_State* state)
  236. {
  237. // Get the number of parameters.
  238. int paramCount = lua_gettop(state);
  239. // Attempt to match the parameters to a valid binding.
  240. switch (paramCount)
  241. {
  242. case 1:
  243. {
  244. if ((lua_type(state, 1) == LUA_TUSERDATA))
  245. {
  246. MeshBatch* instance = getInstance(state);
  247. void* returnPtr = ((void*)instance->getMaterial());
  248. if (returnPtr)
  249. {
  250. gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
  251. object->instance = returnPtr;
  252. object->owns = false;
  253. luaL_getmetatable(state, "Material");
  254. lua_setmetatable(state, -2);
  255. }
  256. else
  257. {
  258. lua_pushnil(state);
  259. }
  260. return 1;
  261. }
  262. lua_pushstring(state, "lua_MeshBatch_getMaterial - Failed to match the given parameters to a valid function signature.");
  263. lua_error(state);
  264. break;
  265. }
  266. default:
  267. {
  268. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  269. lua_error(state);
  270. break;
  271. }
  272. }
  273. return 0;
  274. }
  275. int lua_MeshBatch_isStarted(lua_State* state)
  276. {
  277. // Get the number of parameters.
  278. int paramCount = lua_gettop(state);
  279. // Attempt to match the parameters to a valid binding.
  280. switch (paramCount)
  281. {
  282. case 1:
  283. {
  284. if ((lua_type(state, 1) == LUA_TUSERDATA))
  285. {
  286. MeshBatch* instance = getInstance(state);
  287. bool result = instance->isStarted();
  288. // Push the return value onto the stack.
  289. lua_pushboolean(state, result);
  290. return 1;
  291. }
  292. lua_pushstring(state, "lua_MeshBatch_isStarted - Failed to match the given parameters to a valid function signature.");
  293. lua_error(state);
  294. break;
  295. }
  296. default:
  297. {
  298. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  299. lua_error(state);
  300. break;
  301. }
  302. }
  303. return 0;
  304. }
  305. int lua_MeshBatch_setCapacity(lua_State* state)
  306. {
  307. // Get the number of parameters.
  308. int paramCount = lua_gettop(state);
  309. // Attempt to match the parameters to a valid binding.
  310. switch (paramCount)
  311. {
  312. case 2:
  313. {
  314. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  315. lua_type(state, 2) == LUA_TNUMBER)
  316. {
  317. // Get parameter 1 off the stack.
  318. unsigned int param1 = (unsigned int)luaL_checkunsigned(state, 2);
  319. MeshBatch* instance = getInstance(state);
  320. instance->setCapacity(param1);
  321. return 0;
  322. }
  323. lua_pushstring(state, "lua_MeshBatch_setCapacity - Failed to match the given parameters to a valid function signature.");
  324. lua_error(state);
  325. break;
  326. }
  327. default:
  328. {
  329. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  330. lua_error(state);
  331. break;
  332. }
  333. }
  334. return 0;
  335. }
  336. int lua_MeshBatch_start(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 1:
  344. {
  345. if ((lua_type(state, 1) == LUA_TUSERDATA))
  346. {
  347. MeshBatch* instance = getInstance(state);
  348. instance->start();
  349. return 0;
  350. }
  351. lua_pushstring(state, "lua_MeshBatch_start - Failed to match the given parameters to a valid function signature.");
  352. lua_error(state);
  353. break;
  354. }
  355. default:
  356. {
  357. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  358. lua_error(state);
  359. break;
  360. }
  361. }
  362. return 0;
  363. }
  364. int lua_MeshBatch_static_create(lua_State* state)
  365. {
  366. // Get the number of parameters.
  367. int paramCount = lua_gettop(state);
  368. // Attempt to match the parameters to a valid binding.
  369. switch (paramCount)
  370. {
  371. case 4:
  372. {
  373. do
  374. {
  375. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  376. lua_type(state, 2) == LUA_TNUMBER &&
  377. (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL) &&
  378. lua_type(state, 4) == LUA_TBOOLEAN)
  379. {
  380. // Get parameter 1 off the stack.
  381. bool param1Valid;
  382. gameplay::ScriptUtil::LuaArray<VertexFormat> param1 = gameplay::ScriptUtil::getObjectPointer<VertexFormat>(1, "VertexFormat", true, &param1Valid);
  383. if (!param1Valid)
  384. break;
  385. // Get parameter 2 off the stack.
  386. Mesh::PrimitiveType param2 = (Mesh::PrimitiveType)luaL_checkint(state, 2);
  387. // Get parameter 3 off the stack.
  388. const char* param3 = gameplay::ScriptUtil::getString(3, false);
  389. // Get parameter 4 off the stack.
  390. bool param4 = gameplay::ScriptUtil::luaCheckBool(state, 4);
  391. void* returnPtr = ((void*)MeshBatch::create(*param1, param2, param3, param4));
  392. if (returnPtr)
  393. {
  394. gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
  395. object->instance = returnPtr;
  396. object->owns = true;
  397. luaL_getmetatable(state, "MeshBatch");
  398. lua_setmetatable(state, -2);
  399. }
  400. else
  401. {
  402. lua_pushnil(state);
  403. }
  404. return 1;
  405. }
  406. } while (0);
  407. do
  408. {
  409. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  410. lua_type(state, 2) == LUA_TNUMBER &&
  411. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TTABLE || lua_type(state, 3) == LUA_TNIL) &&
  412. lua_type(state, 4) == LUA_TBOOLEAN)
  413. {
  414. // Get parameter 1 off the stack.
  415. bool param1Valid;
  416. gameplay::ScriptUtil::LuaArray<VertexFormat> param1 = gameplay::ScriptUtil::getObjectPointer<VertexFormat>(1, "VertexFormat", true, &param1Valid);
  417. if (!param1Valid)
  418. break;
  419. // Get parameter 2 off the stack.
  420. Mesh::PrimitiveType param2 = (Mesh::PrimitiveType)luaL_checkint(state, 2);
  421. // Get parameter 3 off the stack.
  422. bool param3Valid;
  423. gameplay::ScriptUtil::LuaArray<Material> param3 = gameplay::ScriptUtil::getObjectPointer<Material>(3, "Material", false, &param3Valid);
  424. if (!param3Valid)
  425. break;
  426. // Get parameter 4 off the stack.
  427. bool param4 = gameplay::ScriptUtil::luaCheckBool(state, 4);
  428. void* returnPtr = ((void*)MeshBatch::create(*param1, param2, param3, param4));
  429. if (returnPtr)
  430. {
  431. gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
  432. object->instance = returnPtr;
  433. object->owns = true;
  434. luaL_getmetatable(state, "MeshBatch");
  435. lua_setmetatable(state, -2);
  436. }
  437. else
  438. {
  439. lua_pushnil(state);
  440. }
  441. return 1;
  442. }
  443. } while (0);
  444. lua_pushstring(state, "lua_MeshBatch_static_create - Failed to match the given parameters to a valid function signature.");
  445. lua_error(state);
  446. break;
  447. }
  448. case 5:
  449. {
  450. do
  451. {
  452. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  453. lua_type(state, 2) == LUA_TNUMBER &&
  454. (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL) &&
  455. lua_type(state, 4) == LUA_TBOOLEAN &&
  456. lua_type(state, 5) == LUA_TNUMBER)
  457. {
  458. // Get parameter 1 off the stack.
  459. bool param1Valid;
  460. gameplay::ScriptUtil::LuaArray<VertexFormat> param1 = gameplay::ScriptUtil::getObjectPointer<VertexFormat>(1, "VertexFormat", true, &param1Valid);
  461. if (!param1Valid)
  462. break;
  463. // Get parameter 2 off the stack.
  464. Mesh::PrimitiveType param2 = (Mesh::PrimitiveType)luaL_checkint(state, 2);
  465. // Get parameter 3 off the stack.
  466. const char* param3 = gameplay::ScriptUtil::getString(3, false);
  467. // Get parameter 4 off the stack.
  468. bool param4 = gameplay::ScriptUtil::luaCheckBool(state, 4);
  469. // Get parameter 5 off the stack.
  470. unsigned int param5 = (unsigned int)luaL_checkunsigned(state, 5);
  471. void* returnPtr = ((void*)MeshBatch::create(*param1, param2, param3, param4, param5));
  472. if (returnPtr)
  473. {
  474. gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
  475. object->instance = returnPtr;
  476. object->owns = true;
  477. luaL_getmetatable(state, "MeshBatch");
  478. lua_setmetatable(state, -2);
  479. }
  480. else
  481. {
  482. lua_pushnil(state);
  483. }
  484. return 1;
  485. }
  486. } while (0);
  487. do
  488. {
  489. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  490. lua_type(state, 2) == LUA_TNUMBER &&
  491. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TTABLE || lua_type(state, 3) == LUA_TNIL) &&
  492. lua_type(state, 4) == LUA_TBOOLEAN &&
  493. lua_type(state, 5) == LUA_TNUMBER)
  494. {
  495. // Get parameter 1 off the stack.
  496. bool param1Valid;
  497. gameplay::ScriptUtil::LuaArray<VertexFormat> param1 = gameplay::ScriptUtil::getObjectPointer<VertexFormat>(1, "VertexFormat", true, &param1Valid);
  498. if (!param1Valid)
  499. break;
  500. // Get parameter 2 off the stack.
  501. Mesh::PrimitiveType param2 = (Mesh::PrimitiveType)luaL_checkint(state, 2);
  502. // Get parameter 3 off the stack.
  503. bool param3Valid;
  504. gameplay::ScriptUtil::LuaArray<Material> param3 = gameplay::ScriptUtil::getObjectPointer<Material>(3, "Material", false, &param3Valid);
  505. if (!param3Valid)
  506. break;
  507. // Get parameter 4 off the stack.
  508. bool param4 = gameplay::ScriptUtil::luaCheckBool(state, 4);
  509. // Get parameter 5 off the stack.
  510. unsigned int param5 = (unsigned int)luaL_checkunsigned(state, 5);
  511. void* returnPtr = ((void*)MeshBatch::create(*param1, param2, param3, param4, param5));
  512. if (returnPtr)
  513. {
  514. gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
  515. object->instance = returnPtr;
  516. object->owns = true;
  517. luaL_getmetatable(state, "MeshBatch");
  518. lua_setmetatable(state, -2);
  519. }
  520. else
  521. {
  522. lua_pushnil(state);
  523. }
  524. return 1;
  525. }
  526. } while (0);
  527. lua_pushstring(state, "lua_MeshBatch_static_create - Failed to match the given parameters to a valid function signature.");
  528. lua_error(state);
  529. break;
  530. }
  531. case 6:
  532. {
  533. do
  534. {
  535. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  536. lua_type(state, 2) == LUA_TNUMBER &&
  537. (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL) &&
  538. lua_type(state, 4) == LUA_TBOOLEAN &&
  539. lua_type(state, 5) == LUA_TNUMBER &&
  540. lua_type(state, 6) == LUA_TNUMBER)
  541. {
  542. // Get parameter 1 off the stack.
  543. bool param1Valid;
  544. gameplay::ScriptUtil::LuaArray<VertexFormat> param1 = gameplay::ScriptUtil::getObjectPointer<VertexFormat>(1, "VertexFormat", true, &param1Valid);
  545. if (!param1Valid)
  546. break;
  547. // Get parameter 2 off the stack.
  548. Mesh::PrimitiveType param2 = (Mesh::PrimitiveType)luaL_checkint(state, 2);
  549. // Get parameter 3 off the stack.
  550. const char* param3 = gameplay::ScriptUtil::getString(3, false);
  551. // Get parameter 4 off the stack.
  552. bool param4 = gameplay::ScriptUtil::luaCheckBool(state, 4);
  553. // Get parameter 5 off the stack.
  554. unsigned int param5 = (unsigned int)luaL_checkunsigned(state, 5);
  555. // Get parameter 6 off the stack.
  556. unsigned int param6 = (unsigned int)luaL_checkunsigned(state, 6);
  557. void* returnPtr = ((void*)MeshBatch::create(*param1, param2, param3, param4, param5, param6));
  558. if (returnPtr)
  559. {
  560. gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
  561. object->instance = returnPtr;
  562. object->owns = true;
  563. luaL_getmetatable(state, "MeshBatch");
  564. lua_setmetatable(state, -2);
  565. }
  566. else
  567. {
  568. lua_pushnil(state);
  569. }
  570. return 1;
  571. }
  572. } while (0);
  573. do
  574. {
  575. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  576. lua_type(state, 2) == LUA_TNUMBER &&
  577. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TTABLE || lua_type(state, 3) == LUA_TNIL) &&
  578. lua_type(state, 4) == LUA_TBOOLEAN &&
  579. lua_type(state, 5) == LUA_TNUMBER &&
  580. lua_type(state, 6) == LUA_TNUMBER)
  581. {
  582. // Get parameter 1 off the stack.
  583. bool param1Valid;
  584. gameplay::ScriptUtil::LuaArray<VertexFormat> param1 = gameplay::ScriptUtil::getObjectPointer<VertexFormat>(1, "VertexFormat", true, &param1Valid);
  585. if (!param1Valid)
  586. break;
  587. // Get parameter 2 off the stack.
  588. Mesh::PrimitiveType param2 = (Mesh::PrimitiveType)luaL_checkint(state, 2);
  589. // Get parameter 3 off the stack.
  590. bool param3Valid;
  591. gameplay::ScriptUtil::LuaArray<Material> param3 = gameplay::ScriptUtil::getObjectPointer<Material>(3, "Material", false, &param3Valid);
  592. if (!param3Valid)
  593. break;
  594. // Get parameter 4 off the stack.
  595. bool param4 = gameplay::ScriptUtil::luaCheckBool(state, 4);
  596. // Get parameter 5 off the stack.
  597. unsigned int param5 = (unsigned int)luaL_checkunsigned(state, 5);
  598. // Get parameter 6 off the stack.
  599. unsigned int param6 = (unsigned int)luaL_checkunsigned(state, 6);
  600. void* returnPtr = ((void*)MeshBatch::create(*param1, param2, param3, param4, param5, param6));
  601. if (returnPtr)
  602. {
  603. gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
  604. object->instance = returnPtr;
  605. object->owns = true;
  606. luaL_getmetatable(state, "MeshBatch");
  607. lua_setmetatable(state, -2);
  608. }
  609. else
  610. {
  611. lua_pushnil(state);
  612. }
  613. return 1;
  614. }
  615. } while (0);
  616. lua_pushstring(state, "lua_MeshBatch_static_create - Failed to match the given parameters to a valid function signature.");
  617. lua_error(state);
  618. break;
  619. }
  620. default:
  621. {
  622. lua_pushstring(state, "Invalid number of parameters (expected 4, 5 or 6).");
  623. lua_error(state);
  624. break;
  625. }
  626. }
  627. return 0;
  628. }
  629. }