lua_ParticleEmitter.cpp 84 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653
  1. #include "Base.h"
  2. #include "ScriptController.h"
  3. #include "lua_ParticleEmitter.h"
  4. #include "Base.h"
  5. #include "Game.h"
  6. #include "Node.h"
  7. #include "ParticleEmitter.h"
  8. #include "Properties.h"
  9. #include "Quaternion.h"
  10. #include "Ref.h"
  11. #include "Scene.h"
  12. #include "lua_ParticleEmitterTextureBlending.h"
  13. namespace gameplay
  14. {
  15. void luaRegister_ParticleEmitter()
  16. {
  17. const luaL_Reg lua_members[] =
  18. {
  19. {"addRef", lua_ParticleEmitter_addRef},
  20. {"draw", lua_ParticleEmitter_draw},
  21. {"emitOnce", lua_ParticleEmitter_emitOnce},
  22. {"getAcceleration", lua_ParticleEmitter_getAcceleration},
  23. {"getAccelerationVariance", lua_ParticleEmitter_getAccelerationVariance},
  24. {"getColorEnd", lua_ParticleEmitter_getColorEnd},
  25. {"getColorEndVariance", lua_ParticleEmitter_getColorEndVariance},
  26. {"getColorStart", lua_ParticleEmitter_getColorStart},
  27. {"getColorStartVariance", lua_ParticleEmitter_getColorStartVariance},
  28. {"getEmissionRate", lua_ParticleEmitter_getEmissionRate},
  29. {"getEnergyMax", lua_ParticleEmitter_getEnergyMax},
  30. {"getEnergyMin", lua_ParticleEmitter_getEnergyMin},
  31. {"getNode", lua_ParticleEmitter_getNode},
  32. {"getParticlesCount", lua_ParticleEmitter_getParticlesCount},
  33. {"getPosition", lua_ParticleEmitter_getPosition},
  34. {"getPositionVariance", lua_ParticleEmitter_getPositionVariance},
  35. {"getRefCount", lua_ParticleEmitter_getRefCount},
  36. {"getRotationAxis", lua_ParticleEmitter_getRotationAxis},
  37. {"getRotationAxisVariance", lua_ParticleEmitter_getRotationAxisVariance},
  38. {"getRotationPerParticleSpeedMax", lua_ParticleEmitter_getRotationPerParticleSpeedMax},
  39. {"getRotationPerParticleSpeedMin", lua_ParticleEmitter_getRotationPerParticleSpeedMin},
  40. {"getRotationSpeedMax", lua_ParticleEmitter_getRotationSpeedMax},
  41. {"getRotationSpeedMin", lua_ParticleEmitter_getRotationSpeedMin},
  42. {"getSizeEndMax", lua_ParticleEmitter_getSizeEndMax},
  43. {"getSizeEndMin", lua_ParticleEmitter_getSizeEndMin},
  44. {"getSizeStartMax", lua_ParticleEmitter_getSizeStartMax},
  45. {"getSizeStartMin", lua_ParticleEmitter_getSizeStartMin},
  46. {"getSpriteFrameDuration", lua_ParticleEmitter_getSpriteFrameDuration},
  47. {"getSpriteFrameRandomOffset", lua_ParticleEmitter_getSpriteFrameRandomOffset},
  48. {"getVelocity", lua_ParticleEmitter_getVelocity},
  49. {"getVelocityVariance", lua_ParticleEmitter_getVelocityVariance},
  50. {"isActive", lua_ParticleEmitter_isActive},
  51. {"isEllipsoid", lua_ParticleEmitter_isEllipsoid},
  52. {"isSpriteAnimated", lua_ParticleEmitter_isSpriteAnimated},
  53. {"isSpriteLooped", lua_ParticleEmitter_isSpriteLooped},
  54. {"isStarted", lua_ParticleEmitter_isStarted},
  55. {"release", lua_ParticleEmitter_release},
  56. {"setAcceleration", lua_ParticleEmitter_setAcceleration},
  57. {"setColor", lua_ParticleEmitter_setColor},
  58. {"setEllipsoid", lua_ParticleEmitter_setEllipsoid},
  59. {"setEmissionRate", lua_ParticleEmitter_setEmissionRate},
  60. {"setEnergy", lua_ParticleEmitter_setEnergy},
  61. {"setOrbit", lua_ParticleEmitter_setOrbit},
  62. {"setPosition", lua_ParticleEmitter_setPosition},
  63. {"setRotation", lua_ParticleEmitter_setRotation},
  64. {"setRotationPerParticle", lua_ParticleEmitter_setRotationPerParticle},
  65. {"setSize", lua_ParticleEmitter_setSize},
  66. {"setSpriteAnimated", lua_ParticleEmitter_setSpriteAnimated},
  67. {"setSpriteFrameCoords", lua_ParticleEmitter_setSpriteFrameCoords},
  68. {"setSpriteFrameDuration", lua_ParticleEmitter_setSpriteFrameDuration},
  69. {"setSpriteFrameRandomOffset", lua_ParticleEmitter_setSpriteFrameRandomOffset},
  70. {"setSpriteLooped", lua_ParticleEmitter_setSpriteLooped},
  71. {"setSpriteTexCoords", lua_ParticleEmitter_setSpriteTexCoords},
  72. {"setTextureBlending", lua_ParticleEmitter_setTextureBlending},
  73. {"setVelocity", lua_ParticleEmitter_setVelocity},
  74. {"start", lua_ParticleEmitter_start},
  75. {"stop", lua_ParticleEmitter_stop},
  76. {"update", lua_ParticleEmitter_update},
  77. {NULL, NULL}
  78. };
  79. const luaL_Reg lua_statics[] =
  80. {
  81. {"create", lua_ParticleEmitter_static_create},
  82. {"getTextureBlendingFromString", lua_ParticleEmitter_static_getTextureBlendingFromString},
  83. {NULL, NULL}
  84. };
  85. std::vector<std::string> scopePath;
  86. ScriptUtil::registerClass("ParticleEmitter", lua_members, NULL, lua_ParticleEmitter__gc, lua_statics, scopePath);
  87. }
  88. static ParticleEmitter* getInstance(lua_State* state)
  89. {
  90. void* userdata = luaL_checkudata(state, 1, "ParticleEmitter");
  91. luaL_argcheck(state, userdata != NULL, 1, "'ParticleEmitter' expected.");
  92. return (ParticleEmitter*)((ScriptUtil::LuaObject*)userdata)->instance;
  93. }
  94. int lua_ParticleEmitter__gc(lua_State* state)
  95. {
  96. // Get the number of parameters.
  97. int paramCount = lua_gettop(state);
  98. // Attempt to match the parameters to a valid binding.
  99. switch (paramCount)
  100. {
  101. case 1:
  102. {
  103. if ((lua_type(state, 1) == LUA_TUSERDATA))
  104. {
  105. void* userdata = luaL_checkudata(state, 1, "ParticleEmitter");
  106. luaL_argcheck(state, userdata != NULL, 1, "'ParticleEmitter' expected.");
  107. ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)userdata;
  108. if (object->owns)
  109. {
  110. ParticleEmitter* instance = (ParticleEmitter*)object->instance;
  111. SAFE_RELEASE(instance);
  112. }
  113. return 0;
  114. }
  115. else
  116. {
  117. lua_pushstring(state, "lua_ParticleEmitter__gc - Failed to match the given parameters to a valid function signature.");
  118. lua_error(state);
  119. }
  120. break;
  121. }
  122. default:
  123. {
  124. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  125. lua_error(state);
  126. break;
  127. }
  128. }
  129. return 0;
  130. }
  131. int lua_ParticleEmitter_addRef(lua_State* state)
  132. {
  133. // Get the number of parameters.
  134. int paramCount = lua_gettop(state);
  135. // Attempt to match the parameters to a valid binding.
  136. switch (paramCount)
  137. {
  138. case 1:
  139. {
  140. if ((lua_type(state, 1) == LUA_TUSERDATA))
  141. {
  142. ParticleEmitter* instance = getInstance(state);
  143. instance->addRef();
  144. return 0;
  145. }
  146. else
  147. {
  148. lua_pushstring(state, "lua_ParticleEmitter_addRef - Failed to match the given parameters to a valid function signature.");
  149. lua_error(state);
  150. }
  151. break;
  152. }
  153. default:
  154. {
  155. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  156. lua_error(state);
  157. break;
  158. }
  159. }
  160. return 0;
  161. }
  162. int lua_ParticleEmitter_draw(lua_State* state)
  163. {
  164. // Get the number of parameters.
  165. int paramCount = lua_gettop(state);
  166. // Attempt to match the parameters to a valid binding.
  167. switch (paramCount)
  168. {
  169. case 1:
  170. {
  171. if ((lua_type(state, 1) == LUA_TUSERDATA))
  172. {
  173. ParticleEmitter* instance = getInstance(state);
  174. instance->draw();
  175. return 0;
  176. }
  177. else
  178. {
  179. lua_pushstring(state, "lua_ParticleEmitter_draw - Failed to match the given parameters to a valid function signature.");
  180. lua_error(state);
  181. }
  182. break;
  183. }
  184. default:
  185. {
  186. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  187. lua_error(state);
  188. break;
  189. }
  190. }
  191. return 0;
  192. }
  193. int lua_ParticleEmitter_emitOnce(lua_State* state)
  194. {
  195. // Get the number of parameters.
  196. int paramCount = lua_gettop(state);
  197. // Attempt to match the parameters to a valid binding.
  198. switch (paramCount)
  199. {
  200. case 2:
  201. {
  202. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  203. lua_type(state, 2) == LUA_TNUMBER)
  204. {
  205. // Get parameter 1 off the stack.
  206. unsigned int param1 = (unsigned int)luaL_checkunsigned(state, 2);
  207. ParticleEmitter* instance = getInstance(state);
  208. instance->emitOnce(param1);
  209. return 0;
  210. }
  211. else
  212. {
  213. lua_pushstring(state, "lua_ParticleEmitter_emitOnce - Failed to match the given parameters to a valid function signature.");
  214. lua_error(state);
  215. }
  216. break;
  217. }
  218. default:
  219. {
  220. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  221. lua_error(state);
  222. break;
  223. }
  224. }
  225. return 0;
  226. }
  227. int lua_ParticleEmitter_getAcceleration(lua_State* state)
  228. {
  229. // Get the number of parameters.
  230. int paramCount = lua_gettop(state);
  231. // Attempt to match the parameters to a valid binding.
  232. switch (paramCount)
  233. {
  234. case 1:
  235. {
  236. if ((lua_type(state, 1) == LUA_TUSERDATA))
  237. {
  238. ParticleEmitter* instance = getInstance(state);
  239. void* returnPtr = (void*)&(instance->getAcceleration());
  240. if (returnPtr)
  241. {
  242. ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
  243. object->instance = returnPtr;
  244. object->owns = false;
  245. luaL_getmetatable(state, "Vector3");
  246. lua_setmetatable(state, -2);
  247. }
  248. else
  249. {
  250. lua_pushnil(state);
  251. }
  252. return 1;
  253. }
  254. else
  255. {
  256. lua_pushstring(state, "lua_ParticleEmitter_getAcceleration - Failed to match the given parameters to a valid function signature.");
  257. lua_error(state);
  258. }
  259. break;
  260. }
  261. default:
  262. {
  263. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  264. lua_error(state);
  265. break;
  266. }
  267. }
  268. return 0;
  269. }
  270. int lua_ParticleEmitter_getAccelerationVariance(lua_State* state)
  271. {
  272. // Get the number of parameters.
  273. int paramCount = lua_gettop(state);
  274. // Attempt to match the parameters to a valid binding.
  275. switch (paramCount)
  276. {
  277. case 1:
  278. {
  279. if ((lua_type(state, 1) == LUA_TUSERDATA))
  280. {
  281. ParticleEmitter* instance = getInstance(state);
  282. void* returnPtr = (void*)&(instance->getAccelerationVariance());
  283. if (returnPtr)
  284. {
  285. ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
  286. object->instance = returnPtr;
  287. object->owns = false;
  288. luaL_getmetatable(state, "Vector3");
  289. lua_setmetatable(state, -2);
  290. }
  291. else
  292. {
  293. lua_pushnil(state);
  294. }
  295. return 1;
  296. }
  297. else
  298. {
  299. lua_pushstring(state, "lua_ParticleEmitter_getAccelerationVariance - Failed to match the given parameters to a valid function signature.");
  300. lua_error(state);
  301. }
  302. break;
  303. }
  304. default:
  305. {
  306. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  307. lua_error(state);
  308. break;
  309. }
  310. }
  311. return 0;
  312. }
  313. int lua_ParticleEmitter_getColorEnd(lua_State* state)
  314. {
  315. // Get the number of parameters.
  316. int paramCount = lua_gettop(state);
  317. // Attempt to match the parameters to a valid binding.
  318. switch (paramCount)
  319. {
  320. case 1:
  321. {
  322. if ((lua_type(state, 1) == LUA_TUSERDATA))
  323. {
  324. ParticleEmitter* instance = getInstance(state);
  325. void* returnPtr = (void*)&(instance->getColorEnd());
  326. if (returnPtr)
  327. {
  328. ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
  329. object->instance = returnPtr;
  330. object->owns = false;
  331. luaL_getmetatable(state, "Vector4");
  332. lua_setmetatable(state, -2);
  333. }
  334. else
  335. {
  336. lua_pushnil(state);
  337. }
  338. return 1;
  339. }
  340. else
  341. {
  342. lua_pushstring(state, "lua_ParticleEmitter_getColorEnd - Failed to match the given parameters to a valid function signature.");
  343. lua_error(state);
  344. }
  345. break;
  346. }
  347. default:
  348. {
  349. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  350. lua_error(state);
  351. break;
  352. }
  353. }
  354. return 0;
  355. }
  356. int lua_ParticleEmitter_getColorEndVariance(lua_State* state)
  357. {
  358. // Get the number of parameters.
  359. int paramCount = lua_gettop(state);
  360. // Attempt to match the parameters to a valid binding.
  361. switch (paramCount)
  362. {
  363. case 1:
  364. {
  365. if ((lua_type(state, 1) == LUA_TUSERDATA))
  366. {
  367. ParticleEmitter* instance = getInstance(state);
  368. void* returnPtr = (void*)&(instance->getColorEndVariance());
  369. if (returnPtr)
  370. {
  371. ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
  372. object->instance = returnPtr;
  373. object->owns = false;
  374. luaL_getmetatable(state, "Vector4");
  375. lua_setmetatable(state, -2);
  376. }
  377. else
  378. {
  379. lua_pushnil(state);
  380. }
  381. return 1;
  382. }
  383. else
  384. {
  385. lua_pushstring(state, "lua_ParticleEmitter_getColorEndVariance - Failed to match the given parameters to a valid function signature.");
  386. lua_error(state);
  387. }
  388. break;
  389. }
  390. default:
  391. {
  392. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  393. lua_error(state);
  394. break;
  395. }
  396. }
  397. return 0;
  398. }
  399. int lua_ParticleEmitter_getColorStart(lua_State* state)
  400. {
  401. // Get the number of parameters.
  402. int paramCount = lua_gettop(state);
  403. // Attempt to match the parameters to a valid binding.
  404. switch (paramCount)
  405. {
  406. case 1:
  407. {
  408. if ((lua_type(state, 1) == LUA_TUSERDATA))
  409. {
  410. ParticleEmitter* instance = getInstance(state);
  411. void* returnPtr = (void*)&(instance->getColorStart());
  412. if (returnPtr)
  413. {
  414. ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
  415. object->instance = returnPtr;
  416. object->owns = false;
  417. luaL_getmetatable(state, "Vector4");
  418. lua_setmetatable(state, -2);
  419. }
  420. else
  421. {
  422. lua_pushnil(state);
  423. }
  424. return 1;
  425. }
  426. else
  427. {
  428. lua_pushstring(state, "lua_ParticleEmitter_getColorStart - Failed to match the given parameters to a valid function signature.");
  429. lua_error(state);
  430. }
  431. break;
  432. }
  433. default:
  434. {
  435. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  436. lua_error(state);
  437. break;
  438. }
  439. }
  440. return 0;
  441. }
  442. int lua_ParticleEmitter_getColorStartVariance(lua_State* state)
  443. {
  444. // Get the number of parameters.
  445. int paramCount = lua_gettop(state);
  446. // Attempt to match the parameters to a valid binding.
  447. switch (paramCount)
  448. {
  449. case 1:
  450. {
  451. if ((lua_type(state, 1) == LUA_TUSERDATA))
  452. {
  453. ParticleEmitter* instance = getInstance(state);
  454. void* returnPtr = (void*)&(instance->getColorStartVariance());
  455. if (returnPtr)
  456. {
  457. ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
  458. object->instance = returnPtr;
  459. object->owns = false;
  460. luaL_getmetatable(state, "Vector4");
  461. lua_setmetatable(state, -2);
  462. }
  463. else
  464. {
  465. lua_pushnil(state);
  466. }
  467. return 1;
  468. }
  469. else
  470. {
  471. lua_pushstring(state, "lua_ParticleEmitter_getColorStartVariance - Failed to match the given parameters to a valid function signature.");
  472. lua_error(state);
  473. }
  474. break;
  475. }
  476. default:
  477. {
  478. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  479. lua_error(state);
  480. break;
  481. }
  482. }
  483. return 0;
  484. }
  485. int lua_ParticleEmitter_getEmissionRate(lua_State* state)
  486. {
  487. // Get the number of parameters.
  488. int paramCount = lua_gettop(state);
  489. // Attempt to match the parameters to a valid binding.
  490. switch (paramCount)
  491. {
  492. case 1:
  493. {
  494. if ((lua_type(state, 1) == LUA_TUSERDATA))
  495. {
  496. ParticleEmitter* instance = getInstance(state);
  497. unsigned int result = instance->getEmissionRate();
  498. // Push the return value onto the stack.
  499. lua_pushunsigned(state, result);
  500. return 1;
  501. }
  502. else
  503. {
  504. lua_pushstring(state, "lua_ParticleEmitter_getEmissionRate - Failed to match the given parameters to a valid function signature.");
  505. lua_error(state);
  506. }
  507. break;
  508. }
  509. default:
  510. {
  511. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  512. lua_error(state);
  513. break;
  514. }
  515. }
  516. return 0;
  517. }
  518. int lua_ParticleEmitter_getEnergyMax(lua_State* state)
  519. {
  520. // Get the number of parameters.
  521. int paramCount = lua_gettop(state);
  522. // Attempt to match the parameters to a valid binding.
  523. switch (paramCount)
  524. {
  525. case 1:
  526. {
  527. if ((lua_type(state, 1) == LUA_TUSERDATA))
  528. {
  529. ParticleEmitter* instance = getInstance(state);
  530. long result = instance->getEnergyMax();
  531. // Push the return value onto the stack.
  532. lua_pushinteger(state, result);
  533. return 1;
  534. }
  535. else
  536. {
  537. lua_pushstring(state, "lua_ParticleEmitter_getEnergyMax - Failed to match the given parameters to a valid function signature.");
  538. lua_error(state);
  539. }
  540. break;
  541. }
  542. default:
  543. {
  544. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  545. lua_error(state);
  546. break;
  547. }
  548. }
  549. return 0;
  550. }
  551. int lua_ParticleEmitter_getEnergyMin(lua_State* state)
  552. {
  553. // Get the number of parameters.
  554. int paramCount = lua_gettop(state);
  555. // Attempt to match the parameters to a valid binding.
  556. switch (paramCount)
  557. {
  558. case 1:
  559. {
  560. if ((lua_type(state, 1) == LUA_TUSERDATA))
  561. {
  562. ParticleEmitter* instance = getInstance(state);
  563. long result = instance->getEnergyMin();
  564. // Push the return value onto the stack.
  565. lua_pushinteger(state, result);
  566. return 1;
  567. }
  568. else
  569. {
  570. lua_pushstring(state, "lua_ParticleEmitter_getEnergyMin - Failed to match the given parameters to a valid function signature.");
  571. lua_error(state);
  572. }
  573. break;
  574. }
  575. default:
  576. {
  577. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  578. lua_error(state);
  579. break;
  580. }
  581. }
  582. return 0;
  583. }
  584. int lua_ParticleEmitter_getNode(lua_State* state)
  585. {
  586. // Get the number of parameters.
  587. int paramCount = lua_gettop(state);
  588. // Attempt to match the parameters to a valid binding.
  589. switch (paramCount)
  590. {
  591. case 1:
  592. {
  593. if ((lua_type(state, 1) == LUA_TUSERDATA))
  594. {
  595. ParticleEmitter* instance = getInstance(state);
  596. void* returnPtr = (void*)instance->getNode();
  597. if (returnPtr)
  598. {
  599. ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
  600. object->instance = returnPtr;
  601. object->owns = false;
  602. luaL_getmetatable(state, "Node");
  603. lua_setmetatable(state, -2);
  604. }
  605. else
  606. {
  607. lua_pushnil(state);
  608. }
  609. return 1;
  610. }
  611. else
  612. {
  613. lua_pushstring(state, "lua_ParticleEmitter_getNode - Failed to match the given parameters to a valid function signature.");
  614. lua_error(state);
  615. }
  616. break;
  617. }
  618. default:
  619. {
  620. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  621. lua_error(state);
  622. break;
  623. }
  624. }
  625. return 0;
  626. }
  627. int lua_ParticleEmitter_getParticlesCount(lua_State* state)
  628. {
  629. // Get the number of parameters.
  630. int paramCount = lua_gettop(state);
  631. // Attempt to match the parameters to a valid binding.
  632. switch (paramCount)
  633. {
  634. case 1:
  635. {
  636. if ((lua_type(state, 1) == LUA_TUSERDATA))
  637. {
  638. ParticleEmitter* instance = getInstance(state);
  639. unsigned int result = instance->getParticlesCount();
  640. // Push the return value onto the stack.
  641. lua_pushunsigned(state, result);
  642. return 1;
  643. }
  644. else
  645. {
  646. lua_pushstring(state, "lua_ParticleEmitter_getParticlesCount - Failed to match the given parameters to a valid function signature.");
  647. lua_error(state);
  648. }
  649. break;
  650. }
  651. default:
  652. {
  653. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  654. lua_error(state);
  655. break;
  656. }
  657. }
  658. return 0;
  659. }
  660. int lua_ParticleEmitter_getPosition(lua_State* state)
  661. {
  662. // Get the number of parameters.
  663. int paramCount = lua_gettop(state);
  664. // Attempt to match the parameters to a valid binding.
  665. switch (paramCount)
  666. {
  667. case 1:
  668. {
  669. if ((lua_type(state, 1) == LUA_TUSERDATA))
  670. {
  671. ParticleEmitter* instance = getInstance(state);
  672. void* returnPtr = (void*)&(instance->getPosition());
  673. if (returnPtr)
  674. {
  675. ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
  676. object->instance = returnPtr;
  677. object->owns = false;
  678. luaL_getmetatable(state, "Vector3");
  679. lua_setmetatable(state, -2);
  680. }
  681. else
  682. {
  683. lua_pushnil(state);
  684. }
  685. return 1;
  686. }
  687. else
  688. {
  689. lua_pushstring(state, "lua_ParticleEmitter_getPosition - Failed to match the given parameters to a valid function signature.");
  690. lua_error(state);
  691. }
  692. break;
  693. }
  694. default:
  695. {
  696. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  697. lua_error(state);
  698. break;
  699. }
  700. }
  701. return 0;
  702. }
  703. int lua_ParticleEmitter_getPositionVariance(lua_State* state)
  704. {
  705. // Get the number of parameters.
  706. int paramCount = lua_gettop(state);
  707. // Attempt to match the parameters to a valid binding.
  708. switch (paramCount)
  709. {
  710. case 1:
  711. {
  712. if ((lua_type(state, 1) == LUA_TUSERDATA))
  713. {
  714. ParticleEmitter* instance = getInstance(state);
  715. void* returnPtr = (void*)&(instance->getPositionVariance());
  716. if (returnPtr)
  717. {
  718. ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
  719. object->instance = returnPtr;
  720. object->owns = false;
  721. luaL_getmetatable(state, "Vector3");
  722. lua_setmetatable(state, -2);
  723. }
  724. else
  725. {
  726. lua_pushnil(state);
  727. }
  728. return 1;
  729. }
  730. else
  731. {
  732. lua_pushstring(state, "lua_ParticleEmitter_getPositionVariance - Failed to match the given parameters to a valid function signature.");
  733. lua_error(state);
  734. }
  735. break;
  736. }
  737. default:
  738. {
  739. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  740. lua_error(state);
  741. break;
  742. }
  743. }
  744. return 0;
  745. }
  746. int lua_ParticleEmitter_getRefCount(lua_State* state)
  747. {
  748. // Get the number of parameters.
  749. int paramCount = lua_gettop(state);
  750. // Attempt to match the parameters to a valid binding.
  751. switch (paramCount)
  752. {
  753. case 1:
  754. {
  755. if ((lua_type(state, 1) == LUA_TUSERDATA))
  756. {
  757. ParticleEmitter* instance = getInstance(state);
  758. unsigned int result = instance->getRefCount();
  759. // Push the return value onto the stack.
  760. lua_pushunsigned(state, result);
  761. return 1;
  762. }
  763. else
  764. {
  765. lua_pushstring(state, "lua_ParticleEmitter_getRefCount - Failed to match the given parameters to a valid function signature.");
  766. lua_error(state);
  767. }
  768. break;
  769. }
  770. default:
  771. {
  772. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  773. lua_error(state);
  774. break;
  775. }
  776. }
  777. return 0;
  778. }
  779. int lua_ParticleEmitter_getRotationAxis(lua_State* state)
  780. {
  781. // Get the number of parameters.
  782. int paramCount = lua_gettop(state);
  783. // Attempt to match the parameters to a valid binding.
  784. switch (paramCount)
  785. {
  786. case 1:
  787. {
  788. if ((lua_type(state, 1) == LUA_TUSERDATA))
  789. {
  790. ParticleEmitter* instance = getInstance(state);
  791. void* returnPtr = (void*)&(instance->getRotationAxis());
  792. if (returnPtr)
  793. {
  794. ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
  795. object->instance = returnPtr;
  796. object->owns = false;
  797. luaL_getmetatable(state, "Vector3");
  798. lua_setmetatable(state, -2);
  799. }
  800. else
  801. {
  802. lua_pushnil(state);
  803. }
  804. return 1;
  805. }
  806. else
  807. {
  808. lua_pushstring(state, "lua_ParticleEmitter_getRotationAxis - Failed to match the given parameters to a valid function signature.");
  809. lua_error(state);
  810. }
  811. break;
  812. }
  813. default:
  814. {
  815. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  816. lua_error(state);
  817. break;
  818. }
  819. }
  820. return 0;
  821. }
  822. int lua_ParticleEmitter_getRotationAxisVariance(lua_State* state)
  823. {
  824. // Get the number of parameters.
  825. int paramCount = lua_gettop(state);
  826. // Attempt to match the parameters to a valid binding.
  827. switch (paramCount)
  828. {
  829. case 1:
  830. {
  831. if ((lua_type(state, 1) == LUA_TUSERDATA))
  832. {
  833. ParticleEmitter* instance = getInstance(state);
  834. void* returnPtr = (void*)&(instance->getRotationAxisVariance());
  835. if (returnPtr)
  836. {
  837. ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
  838. object->instance = returnPtr;
  839. object->owns = false;
  840. luaL_getmetatable(state, "Vector3");
  841. lua_setmetatable(state, -2);
  842. }
  843. else
  844. {
  845. lua_pushnil(state);
  846. }
  847. return 1;
  848. }
  849. else
  850. {
  851. lua_pushstring(state, "lua_ParticleEmitter_getRotationAxisVariance - Failed to match the given parameters to a valid function signature.");
  852. lua_error(state);
  853. }
  854. break;
  855. }
  856. default:
  857. {
  858. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  859. lua_error(state);
  860. break;
  861. }
  862. }
  863. return 0;
  864. }
  865. int lua_ParticleEmitter_getRotationPerParticleSpeedMax(lua_State* state)
  866. {
  867. // Get the number of parameters.
  868. int paramCount = lua_gettop(state);
  869. // Attempt to match the parameters to a valid binding.
  870. switch (paramCount)
  871. {
  872. case 1:
  873. {
  874. if ((lua_type(state, 1) == LUA_TUSERDATA))
  875. {
  876. ParticleEmitter* instance = getInstance(state);
  877. float result = instance->getRotationPerParticleSpeedMax();
  878. // Push the return value onto the stack.
  879. lua_pushnumber(state, result);
  880. return 1;
  881. }
  882. else
  883. {
  884. lua_pushstring(state, "lua_ParticleEmitter_getRotationPerParticleSpeedMax - Failed to match the given parameters to a valid function signature.");
  885. lua_error(state);
  886. }
  887. break;
  888. }
  889. default:
  890. {
  891. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  892. lua_error(state);
  893. break;
  894. }
  895. }
  896. return 0;
  897. }
  898. int lua_ParticleEmitter_getRotationPerParticleSpeedMin(lua_State* state)
  899. {
  900. // Get the number of parameters.
  901. int paramCount = lua_gettop(state);
  902. // Attempt to match the parameters to a valid binding.
  903. switch (paramCount)
  904. {
  905. case 1:
  906. {
  907. if ((lua_type(state, 1) == LUA_TUSERDATA))
  908. {
  909. ParticleEmitter* instance = getInstance(state);
  910. float result = instance->getRotationPerParticleSpeedMin();
  911. // Push the return value onto the stack.
  912. lua_pushnumber(state, result);
  913. return 1;
  914. }
  915. else
  916. {
  917. lua_pushstring(state, "lua_ParticleEmitter_getRotationPerParticleSpeedMin - Failed to match the given parameters to a valid function signature.");
  918. lua_error(state);
  919. }
  920. break;
  921. }
  922. default:
  923. {
  924. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  925. lua_error(state);
  926. break;
  927. }
  928. }
  929. return 0;
  930. }
  931. int lua_ParticleEmitter_getRotationSpeedMax(lua_State* state)
  932. {
  933. // Get the number of parameters.
  934. int paramCount = lua_gettop(state);
  935. // Attempt to match the parameters to a valid binding.
  936. switch (paramCount)
  937. {
  938. case 1:
  939. {
  940. if ((lua_type(state, 1) == LUA_TUSERDATA))
  941. {
  942. ParticleEmitter* instance = getInstance(state);
  943. float result = instance->getRotationSpeedMax();
  944. // Push the return value onto the stack.
  945. lua_pushnumber(state, result);
  946. return 1;
  947. }
  948. else
  949. {
  950. lua_pushstring(state, "lua_ParticleEmitter_getRotationSpeedMax - Failed to match the given parameters to a valid function signature.");
  951. lua_error(state);
  952. }
  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_ParticleEmitter_getRotationSpeedMin(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. ParticleEmitter* instance = getInstance(state);
  976. float result = instance->getRotationSpeedMin();
  977. // Push the return value onto the stack.
  978. lua_pushnumber(state, result);
  979. return 1;
  980. }
  981. else
  982. {
  983. lua_pushstring(state, "lua_ParticleEmitter_getRotationSpeedMin - Failed to match the given parameters to a valid function signature.");
  984. lua_error(state);
  985. }
  986. break;
  987. }
  988. default:
  989. {
  990. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  991. lua_error(state);
  992. break;
  993. }
  994. }
  995. return 0;
  996. }
  997. int lua_ParticleEmitter_getSizeEndMax(lua_State* state)
  998. {
  999. // Get the number of parameters.
  1000. int paramCount = lua_gettop(state);
  1001. // Attempt to match the parameters to a valid binding.
  1002. switch (paramCount)
  1003. {
  1004. case 1:
  1005. {
  1006. if ((lua_type(state, 1) == LUA_TUSERDATA))
  1007. {
  1008. ParticleEmitter* instance = getInstance(state);
  1009. float result = instance->getSizeEndMax();
  1010. // Push the return value onto the stack.
  1011. lua_pushnumber(state, result);
  1012. return 1;
  1013. }
  1014. else
  1015. {
  1016. lua_pushstring(state, "lua_ParticleEmitter_getSizeEndMax - Failed to match the given parameters to a valid function signature.");
  1017. lua_error(state);
  1018. }
  1019. break;
  1020. }
  1021. default:
  1022. {
  1023. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  1024. lua_error(state);
  1025. break;
  1026. }
  1027. }
  1028. return 0;
  1029. }
  1030. int lua_ParticleEmitter_getSizeEndMin(lua_State* state)
  1031. {
  1032. // Get the number of parameters.
  1033. int paramCount = lua_gettop(state);
  1034. // Attempt to match the parameters to a valid binding.
  1035. switch (paramCount)
  1036. {
  1037. case 1:
  1038. {
  1039. if ((lua_type(state, 1) == LUA_TUSERDATA))
  1040. {
  1041. ParticleEmitter* instance = getInstance(state);
  1042. float result = instance->getSizeEndMin();
  1043. // Push the return value onto the stack.
  1044. lua_pushnumber(state, result);
  1045. return 1;
  1046. }
  1047. else
  1048. {
  1049. lua_pushstring(state, "lua_ParticleEmitter_getSizeEndMin - Failed to match the given parameters to a valid function signature.");
  1050. lua_error(state);
  1051. }
  1052. break;
  1053. }
  1054. default:
  1055. {
  1056. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  1057. lua_error(state);
  1058. break;
  1059. }
  1060. }
  1061. return 0;
  1062. }
  1063. int lua_ParticleEmitter_getSizeStartMax(lua_State* state)
  1064. {
  1065. // Get the number of parameters.
  1066. int paramCount = lua_gettop(state);
  1067. // Attempt to match the parameters to a valid binding.
  1068. switch (paramCount)
  1069. {
  1070. case 1:
  1071. {
  1072. if ((lua_type(state, 1) == LUA_TUSERDATA))
  1073. {
  1074. ParticleEmitter* instance = getInstance(state);
  1075. float result = instance->getSizeStartMax();
  1076. // Push the return value onto the stack.
  1077. lua_pushnumber(state, result);
  1078. return 1;
  1079. }
  1080. else
  1081. {
  1082. lua_pushstring(state, "lua_ParticleEmitter_getSizeStartMax - Failed to match the given parameters to a valid function signature.");
  1083. lua_error(state);
  1084. }
  1085. break;
  1086. }
  1087. default:
  1088. {
  1089. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  1090. lua_error(state);
  1091. break;
  1092. }
  1093. }
  1094. return 0;
  1095. }
  1096. int lua_ParticleEmitter_getSizeStartMin(lua_State* state)
  1097. {
  1098. // Get the number of parameters.
  1099. int paramCount = lua_gettop(state);
  1100. // Attempt to match the parameters to a valid binding.
  1101. switch (paramCount)
  1102. {
  1103. case 1:
  1104. {
  1105. if ((lua_type(state, 1) == LUA_TUSERDATA))
  1106. {
  1107. ParticleEmitter* instance = getInstance(state);
  1108. float result = instance->getSizeStartMin();
  1109. // Push the return value onto the stack.
  1110. lua_pushnumber(state, result);
  1111. return 1;
  1112. }
  1113. else
  1114. {
  1115. lua_pushstring(state, "lua_ParticleEmitter_getSizeStartMin - Failed to match the given parameters to a valid function signature.");
  1116. lua_error(state);
  1117. }
  1118. break;
  1119. }
  1120. default:
  1121. {
  1122. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  1123. lua_error(state);
  1124. break;
  1125. }
  1126. }
  1127. return 0;
  1128. }
  1129. int lua_ParticleEmitter_getSpriteFrameDuration(lua_State* state)
  1130. {
  1131. // Get the number of parameters.
  1132. int paramCount = lua_gettop(state);
  1133. // Attempt to match the parameters to a valid binding.
  1134. switch (paramCount)
  1135. {
  1136. case 1:
  1137. {
  1138. if ((lua_type(state, 1) == LUA_TUSERDATA))
  1139. {
  1140. ParticleEmitter* instance = getInstance(state);
  1141. long result = instance->getSpriteFrameDuration();
  1142. // Push the return value onto the stack.
  1143. lua_pushinteger(state, result);
  1144. return 1;
  1145. }
  1146. else
  1147. {
  1148. lua_pushstring(state, "lua_ParticleEmitter_getSpriteFrameDuration - Failed to match the given parameters to a valid function signature.");
  1149. lua_error(state);
  1150. }
  1151. break;
  1152. }
  1153. default:
  1154. {
  1155. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  1156. lua_error(state);
  1157. break;
  1158. }
  1159. }
  1160. return 0;
  1161. }
  1162. int lua_ParticleEmitter_getSpriteFrameRandomOffset(lua_State* state)
  1163. {
  1164. // Get the number of parameters.
  1165. int paramCount = lua_gettop(state);
  1166. // Attempt to match the parameters to a valid binding.
  1167. switch (paramCount)
  1168. {
  1169. case 1:
  1170. {
  1171. if ((lua_type(state, 1) == LUA_TUSERDATA))
  1172. {
  1173. ParticleEmitter* instance = getInstance(state);
  1174. int result = instance->getSpriteFrameRandomOffset();
  1175. // Push the return value onto the stack.
  1176. lua_pushinteger(state, result);
  1177. return 1;
  1178. }
  1179. else
  1180. {
  1181. lua_pushstring(state, "lua_ParticleEmitter_getSpriteFrameRandomOffset - Failed to match the given parameters to a valid function signature.");
  1182. lua_error(state);
  1183. }
  1184. break;
  1185. }
  1186. default:
  1187. {
  1188. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  1189. lua_error(state);
  1190. break;
  1191. }
  1192. }
  1193. return 0;
  1194. }
  1195. int lua_ParticleEmitter_getVelocity(lua_State* state)
  1196. {
  1197. // Get the number of parameters.
  1198. int paramCount = lua_gettop(state);
  1199. // Attempt to match the parameters to a valid binding.
  1200. switch (paramCount)
  1201. {
  1202. case 1:
  1203. {
  1204. if ((lua_type(state, 1) == LUA_TUSERDATA))
  1205. {
  1206. ParticleEmitter* instance = getInstance(state);
  1207. void* returnPtr = (void*)&(instance->getVelocity());
  1208. if (returnPtr)
  1209. {
  1210. ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
  1211. object->instance = returnPtr;
  1212. object->owns = false;
  1213. luaL_getmetatable(state, "Vector3");
  1214. lua_setmetatable(state, -2);
  1215. }
  1216. else
  1217. {
  1218. lua_pushnil(state);
  1219. }
  1220. return 1;
  1221. }
  1222. else
  1223. {
  1224. lua_pushstring(state, "lua_ParticleEmitter_getVelocity - Failed to match the given parameters to a valid function signature.");
  1225. lua_error(state);
  1226. }
  1227. break;
  1228. }
  1229. default:
  1230. {
  1231. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  1232. lua_error(state);
  1233. break;
  1234. }
  1235. }
  1236. return 0;
  1237. }
  1238. int lua_ParticleEmitter_getVelocityVariance(lua_State* state)
  1239. {
  1240. // Get the number of parameters.
  1241. int paramCount = lua_gettop(state);
  1242. // Attempt to match the parameters to a valid binding.
  1243. switch (paramCount)
  1244. {
  1245. case 1:
  1246. {
  1247. if ((lua_type(state, 1) == LUA_TUSERDATA))
  1248. {
  1249. ParticleEmitter* instance = getInstance(state);
  1250. void* returnPtr = (void*)&(instance->getVelocityVariance());
  1251. if (returnPtr)
  1252. {
  1253. ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
  1254. object->instance = returnPtr;
  1255. object->owns = false;
  1256. luaL_getmetatable(state, "Vector3");
  1257. lua_setmetatable(state, -2);
  1258. }
  1259. else
  1260. {
  1261. lua_pushnil(state);
  1262. }
  1263. return 1;
  1264. }
  1265. else
  1266. {
  1267. lua_pushstring(state, "lua_ParticleEmitter_getVelocityVariance - Failed to match the given parameters to a valid function signature.");
  1268. lua_error(state);
  1269. }
  1270. break;
  1271. }
  1272. default:
  1273. {
  1274. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  1275. lua_error(state);
  1276. break;
  1277. }
  1278. }
  1279. return 0;
  1280. }
  1281. int lua_ParticleEmitter_isActive(lua_State* state)
  1282. {
  1283. // Get the number of parameters.
  1284. int paramCount = lua_gettop(state);
  1285. // Attempt to match the parameters to a valid binding.
  1286. switch (paramCount)
  1287. {
  1288. case 1:
  1289. {
  1290. if ((lua_type(state, 1) == LUA_TUSERDATA))
  1291. {
  1292. ParticleEmitter* instance = getInstance(state);
  1293. bool result = instance->isActive();
  1294. // Push the return value onto the stack.
  1295. lua_pushboolean(state, result);
  1296. return 1;
  1297. }
  1298. else
  1299. {
  1300. lua_pushstring(state, "lua_ParticleEmitter_isActive - Failed to match the given parameters to a valid function signature.");
  1301. lua_error(state);
  1302. }
  1303. break;
  1304. }
  1305. default:
  1306. {
  1307. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  1308. lua_error(state);
  1309. break;
  1310. }
  1311. }
  1312. return 0;
  1313. }
  1314. int lua_ParticleEmitter_isEllipsoid(lua_State* state)
  1315. {
  1316. // Get the number of parameters.
  1317. int paramCount = lua_gettop(state);
  1318. // Attempt to match the parameters to a valid binding.
  1319. switch (paramCount)
  1320. {
  1321. case 1:
  1322. {
  1323. if ((lua_type(state, 1) == LUA_TUSERDATA))
  1324. {
  1325. ParticleEmitter* instance = getInstance(state);
  1326. bool result = instance->isEllipsoid();
  1327. // Push the return value onto the stack.
  1328. lua_pushboolean(state, result);
  1329. return 1;
  1330. }
  1331. else
  1332. {
  1333. lua_pushstring(state, "lua_ParticleEmitter_isEllipsoid - Failed to match the given parameters to a valid function signature.");
  1334. lua_error(state);
  1335. }
  1336. break;
  1337. }
  1338. default:
  1339. {
  1340. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  1341. lua_error(state);
  1342. break;
  1343. }
  1344. }
  1345. return 0;
  1346. }
  1347. int lua_ParticleEmitter_isSpriteAnimated(lua_State* state)
  1348. {
  1349. // Get the number of parameters.
  1350. int paramCount = lua_gettop(state);
  1351. // Attempt to match the parameters to a valid binding.
  1352. switch (paramCount)
  1353. {
  1354. case 1:
  1355. {
  1356. if ((lua_type(state, 1) == LUA_TUSERDATA))
  1357. {
  1358. ParticleEmitter* instance = getInstance(state);
  1359. bool result = instance->isSpriteAnimated();
  1360. // Push the return value onto the stack.
  1361. lua_pushboolean(state, result);
  1362. return 1;
  1363. }
  1364. else
  1365. {
  1366. lua_pushstring(state, "lua_ParticleEmitter_isSpriteAnimated - Failed to match the given parameters to a valid function signature.");
  1367. lua_error(state);
  1368. }
  1369. break;
  1370. }
  1371. default:
  1372. {
  1373. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  1374. lua_error(state);
  1375. break;
  1376. }
  1377. }
  1378. return 0;
  1379. }
  1380. int lua_ParticleEmitter_isSpriteLooped(lua_State* state)
  1381. {
  1382. // Get the number of parameters.
  1383. int paramCount = lua_gettop(state);
  1384. // Attempt to match the parameters to a valid binding.
  1385. switch (paramCount)
  1386. {
  1387. case 1:
  1388. {
  1389. if ((lua_type(state, 1) == LUA_TUSERDATA))
  1390. {
  1391. ParticleEmitter* instance = getInstance(state);
  1392. bool result = instance->isSpriteLooped();
  1393. // Push the return value onto the stack.
  1394. lua_pushboolean(state, result);
  1395. return 1;
  1396. }
  1397. else
  1398. {
  1399. lua_pushstring(state, "lua_ParticleEmitter_isSpriteLooped - Failed to match the given parameters to a valid function signature.");
  1400. lua_error(state);
  1401. }
  1402. break;
  1403. }
  1404. default:
  1405. {
  1406. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  1407. lua_error(state);
  1408. break;
  1409. }
  1410. }
  1411. return 0;
  1412. }
  1413. int lua_ParticleEmitter_isStarted(lua_State* state)
  1414. {
  1415. // Get the number of parameters.
  1416. int paramCount = lua_gettop(state);
  1417. // Attempt to match the parameters to a valid binding.
  1418. switch (paramCount)
  1419. {
  1420. case 1:
  1421. {
  1422. if ((lua_type(state, 1) == LUA_TUSERDATA))
  1423. {
  1424. ParticleEmitter* instance = getInstance(state);
  1425. bool result = instance->isStarted();
  1426. // Push the return value onto the stack.
  1427. lua_pushboolean(state, result);
  1428. return 1;
  1429. }
  1430. else
  1431. {
  1432. lua_pushstring(state, "lua_ParticleEmitter_isStarted - Failed to match the given parameters to a valid function signature.");
  1433. lua_error(state);
  1434. }
  1435. break;
  1436. }
  1437. default:
  1438. {
  1439. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  1440. lua_error(state);
  1441. break;
  1442. }
  1443. }
  1444. return 0;
  1445. }
  1446. int lua_ParticleEmitter_release(lua_State* state)
  1447. {
  1448. // Get the number of parameters.
  1449. int paramCount = lua_gettop(state);
  1450. // Attempt to match the parameters to a valid binding.
  1451. switch (paramCount)
  1452. {
  1453. case 1:
  1454. {
  1455. if ((lua_type(state, 1) == LUA_TUSERDATA))
  1456. {
  1457. ParticleEmitter* instance = getInstance(state);
  1458. instance->release();
  1459. return 0;
  1460. }
  1461. else
  1462. {
  1463. lua_pushstring(state, "lua_ParticleEmitter_release - Failed to match the given parameters to a valid function signature.");
  1464. lua_error(state);
  1465. }
  1466. break;
  1467. }
  1468. default:
  1469. {
  1470. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  1471. lua_error(state);
  1472. break;
  1473. }
  1474. }
  1475. return 0;
  1476. }
  1477. int lua_ParticleEmitter_setAcceleration(lua_State* state)
  1478. {
  1479. // Get the number of parameters.
  1480. int paramCount = lua_gettop(state);
  1481. // Attempt to match the parameters to a valid binding.
  1482. switch (paramCount)
  1483. {
  1484. case 3:
  1485. {
  1486. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1487. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL) &&
  1488. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TNIL))
  1489. {
  1490. // Get parameter 1 off the stack.
  1491. Vector3* param1 = ScriptUtil::getObjectPointer<Vector3>(2, "Vector3", true);
  1492. // Get parameter 2 off the stack.
  1493. Vector3* param2 = ScriptUtil::getObjectPointer<Vector3>(3, "Vector3", true);
  1494. ParticleEmitter* instance = getInstance(state);
  1495. instance->setAcceleration(*param1, *param2);
  1496. return 0;
  1497. }
  1498. else
  1499. {
  1500. lua_pushstring(state, "lua_ParticleEmitter_setAcceleration - Failed to match the given parameters to a valid function signature.");
  1501. lua_error(state);
  1502. }
  1503. break;
  1504. }
  1505. default:
  1506. {
  1507. lua_pushstring(state, "Invalid number of parameters (expected 3).");
  1508. lua_error(state);
  1509. break;
  1510. }
  1511. }
  1512. return 0;
  1513. }
  1514. int lua_ParticleEmitter_setColor(lua_State* state)
  1515. {
  1516. // Get the number of parameters.
  1517. int paramCount = lua_gettop(state);
  1518. // Attempt to match the parameters to a valid binding.
  1519. switch (paramCount)
  1520. {
  1521. case 5:
  1522. {
  1523. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1524. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL) &&
  1525. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TNIL) &&
  1526. (lua_type(state, 4) == LUA_TUSERDATA || lua_type(state, 4) == LUA_TNIL) &&
  1527. (lua_type(state, 5) == LUA_TUSERDATA || lua_type(state, 5) == LUA_TNIL))
  1528. {
  1529. // Get parameter 1 off the stack.
  1530. Vector4* param1 = ScriptUtil::getObjectPointer<Vector4>(2, "Vector4", true);
  1531. // Get parameter 2 off the stack.
  1532. Vector4* param2 = ScriptUtil::getObjectPointer<Vector4>(3, "Vector4", true);
  1533. // Get parameter 3 off the stack.
  1534. Vector4* param3 = ScriptUtil::getObjectPointer<Vector4>(4, "Vector4", true);
  1535. // Get parameter 4 off the stack.
  1536. Vector4* param4 = ScriptUtil::getObjectPointer<Vector4>(5, "Vector4", true);
  1537. ParticleEmitter* instance = getInstance(state);
  1538. instance->setColor(*param1, *param2, *param3, *param4);
  1539. return 0;
  1540. }
  1541. else
  1542. {
  1543. lua_pushstring(state, "lua_ParticleEmitter_setColor - Failed to match the given parameters to a valid function signature.");
  1544. lua_error(state);
  1545. }
  1546. break;
  1547. }
  1548. default:
  1549. {
  1550. lua_pushstring(state, "Invalid number of parameters (expected 5).");
  1551. lua_error(state);
  1552. break;
  1553. }
  1554. }
  1555. return 0;
  1556. }
  1557. int lua_ParticleEmitter_setEllipsoid(lua_State* state)
  1558. {
  1559. // Get the number of parameters.
  1560. int paramCount = lua_gettop(state);
  1561. // Attempt to match the parameters to a valid binding.
  1562. switch (paramCount)
  1563. {
  1564. case 2:
  1565. {
  1566. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1567. lua_type(state, 2) == LUA_TBOOLEAN)
  1568. {
  1569. // Get parameter 1 off the stack.
  1570. bool param1 = ScriptUtil::luaCheckBool(state, 2);
  1571. ParticleEmitter* instance = getInstance(state);
  1572. instance->setEllipsoid(param1);
  1573. return 0;
  1574. }
  1575. else
  1576. {
  1577. lua_pushstring(state, "lua_ParticleEmitter_setEllipsoid - Failed to match the given parameters to a valid function signature.");
  1578. lua_error(state);
  1579. }
  1580. break;
  1581. }
  1582. default:
  1583. {
  1584. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  1585. lua_error(state);
  1586. break;
  1587. }
  1588. }
  1589. return 0;
  1590. }
  1591. int lua_ParticleEmitter_setEmissionRate(lua_State* state)
  1592. {
  1593. // Get the number of parameters.
  1594. int paramCount = lua_gettop(state);
  1595. // Attempt to match the parameters to a valid binding.
  1596. switch (paramCount)
  1597. {
  1598. case 2:
  1599. {
  1600. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1601. lua_type(state, 2) == LUA_TNUMBER)
  1602. {
  1603. // Get parameter 1 off the stack.
  1604. unsigned int param1 = (unsigned int)luaL_checkunsigned(state, 2);
  1605. ParticleEmitter* instance = getInstance(state);
  1606. instance->setEmissionRate(param1);
  1607. return 0;
  1608. }
  1609. else
  1610. {
  1611. lua_pushstring(state, "lua_ParticleEmitter_setEmissionRate - Failed to match the given parameters to a valid function signature.");
  1612. lua_error(state);
  1613. }
  1614. break;
  1615. }
  1616. default:
  1617. {
  1618. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  1619. lua_error(state);
  1620. break;
  1621. }
  1622. }
  1623. return 0;
  1624. }
  1625. int lua_ParticleEmitter_setEnergy(lua_State* state)
  1626. {
  1627. // Get the number of parameters.
  1628. int paramCount = lua_gettop(state);
  1629. // Attempt to match the parameters to a valid binding.
  1630. switch (paramCount)
  1631. {
  1632. case 3:
  1633. {
  1634. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1635. lua_type(state, 2) == LUA_TNUMBER &&
  1636. lua_type(state, 3) == LUA_TNUMBER)
  1637. {
  1638. // Get parameter 1 off the stack.
  1639. long param1 = (long)luaL_checklong(state, 2);
  1640. // Get parameter 2 off the stack.
  1641. long param2 = (long)luaL_checklong(state, 3);
  1642. ParticleEmitter* instance = getInstance(state);
  1643. instance->setEnergy(param1, param2);
  1644. return 0;
  1645. }
  1646. else
  1647. {
  1648. lua_pushstring(state, "lua_ParticleEmitter_setEnergy - Failed to match the given parameters to a valid function signature.");
  1649. lua_error(state);
  1650. }
  1651. break;
  1652. }
  1653. default:
  1654. {
  1655. lua_pushstring(state, "Invalid number of parameters (expected 3).");
  1656. lua_error(state);
  1657. break;
  1658. }
  1659. }
  1660. return 0;
  1661. }
  1662. int lua_ParticleEmitter_setOrbit(lua_State* state)
  1663. {
  1664. // Get the number of parameters.
  1665. int paramCount = lua_gettop(state);
  1666. // Attempt to match the parameters to a valid binding.
  1667. switch (paramCount)
  1668. {
  1669. case 4:
  1670. {
  1671. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1672. lua_type(state, 2) == LUA_TBOOLEAN &&
  1673. lua_type(state, 3) == LUA_TBOOLEAN &&
  1674. lua_type(state, 4) == LUA_TBOOLEAN)
  1675. {
  1676. // Get parameter 1 off the stack.
  1677. bool param1 = ScriptUtil::luaCheckBool(state, 2);
  1678. // Get parameter 2 off the stack.
  1679. bool param2 = ScriptUtil::luaCheckBool(state, 3);
  1680. // Get parameter 3 off the stack.
  1681. bool param3 = ScriptUtil::luaCheckBool(state, 4);
  1682. ParticleEmitter* instance = getInstance(state);
  1683. instance->setOrbit(param1, param2, param3);
  1684. return 0;
  1685. }
  1686. else
  1687. {
  1688. lua_pushstring(state, "lua_ParticleEmitter_setOrbit - Failed to match the given parameters to a valid function signature.");
  1689. lua_error(state);
  1690. }
  1691. break;
  1692. }
  1693. default:
  1694. {
  1695. lua_pushstring(state, "Invalid number of parameters (expected 4).");
  1696. lua_error(state);
  1697. break;
  1698. }
  1699. }
  1700. return 0;
  1701. }
  1702. int lua_ParticleEmitter_setPosition(lua_State* state)
  1703. {
  1704. // Get the number of parameters.
  1705. int paramCount = lua_gettop(state);
  1706. // Attempt to match the parameters to a valid binding.
  1707. switch (paramCount)
  1708. {
  1709. case 3:
  1710. {
  1711. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1712. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL) &&
  1713. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TNIL))
  1714. {
  1715. // Get parameter 1 off the stack.
  1716. Vector3* param1 = ScriptUtil::getObjectPointer<Vector3>(2, "Vector3", true);
  1717. // Get parameter 2 off the stack.
  1718. Vector3* param2 = ScriptUtil::getObjectPointer<Vector3>(3, "Vector3", true);
  1719. ParticleEmitter* instance = getInstance(state);
  1720. instance->setPosition(*param1, *param2);
  1721. return 0;
  1722. }
  1723. else
  1724. {
  1725. lua_pushstring(state, "lua_ParticleEmitter_setPosition - Failed to match the given parameters to a valid function signature.");
  1726. lua_error(state);
  1727. }
  1728. break;
  1729. }
  1730. default:
  1731. {
  1732. lua_pushstring(state, "Invalid number of parameters (expected 3).");
  1733. lua_error(state);
  1734. break;
  1735. }
  1736. }
  1737. return 0;
  1738. }
  1739. int lua_ParticleEmitter_setRotation(lua_State* state)
  1740. {
  1741. // Get the number of parameters.
  1742. int paramCount = lua_gettop(state);
  1743. // Attempt to match the parameters to a valid binding.
  1744. switch (paramCount)
  1745. {
  1746. case 5:
  1747. {
  1748. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1749. lua_type(state, 2) == LUA_TNUMBER &&
  1750. lua_type(state, 3) == LUA_TNUMBER &&
  1751. (lua_type(state, 4) == LUA_TUSERDATA || lua_type(state, 4) == LUA_TNIL) &&
  1752. (lua_type(state, 5) == LUA_TUSERDATA || lua_type(state, 5) == LUA_TNIL))
  1753. {
  1754. // Get parameter 1 off the stack.
  1755. float param1 = (float)luaL_checknumber(state, 2);
  1756. // Get parameter 2 off the stack.
  1757. float param2 = (float)luaL_checknumber(state, 3);
  1758. // Get parameter 3 off the stack.
  1759. Vector3* param3 = ScriptUtil::getObjectPointer<Vector3>(4, "Vector3", true);
  1760. // Get parameter 4 off the stack.
  1761. Vector3* param4 = ScriptUtil::getObjectPointer<Vector3>(5, "Vector3", true);
  1762. ParticleEmitter* instance = getInstance(state);
  1763. instance->setRotation(param1, param2, *param3, *param4);
  1764. return 0;
  1765. }
  1766. else
  1767. {
  1768. lua_pushstring(state, "lua_ParticleEmitter_setRotation - Failed to match the given parameters to a valid function signature.");
  1769. lua_error(state);
  1770. }
  1771. break;
  1772. }
  1773. default:
  1774. {
  1775. lua_pushstring(state, "Invalid number of parameters (expected 5).");
  1776. lua_error(state);
  1777. break;
  1778. }
  1779. }
  1780. return 0;
  1781. }
  1782. int lua_ParticleEmitter_setRotationPerParticle(lua_State* state)
  1783. {
  1784. // Get the number of parameters.
  1785. int paramCount = lua_gettop(state);
  1786. // Attempt to match the parameters to a valid binding.
  1787. switch (paramCount)
  1788. {
  1789. case 3:
  1790. {
  1791. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1792. lua_type(state, 2) == LUA_TNUMBER &&
  1793. lua_type(state, 3) == LUA_TNUMBER)
  1794. {
  1795. // Get parameter 1 off the stack.
  1796. float param1 = (float)luaL_checknumber(state, 2);
  1797. // Get parameter 2 off the stack.
  1798. float param2 = (float)luaL_checknumber(state, 3);
  1799. ParticleEmitter* instance = getInstance(state);
  1800. instance->setRotationPerParticle(param1, param2);
  1801. return 0;
  1802. }
  1803. else
  1804. {
  1805. lua_pushstring(state, "lua_ParticleEmitter_setRotationPerParticle - Failed to match the given parameters to a valid function signature.");
  1806. lua_error(state);
  1807. }
  1808. break;
  1809. }
  1810. default:
  1811. {
  1812. lua_pushstring(state, "Invalid number of parameters (expected 3).");
  1813. lua_error(state);
  1814. break;
  1815. }
  1816. }
  1817. return 0;
  1818. }
  1819. int lua_ParticleEmitter_setSize(lua_State* state)
  1820. {
  1821. // Get the number of parameters.
  1822. int paramCount = lua_gettop(state);
  1823. // Attempt to match the parameters to a valid binding.
  1824. switch (paramCount)
  1825. {
  1826. case 5:
  1827. {
  1828. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1829. lua_type(state, 2) == LUA_TNUMBER &&
  1830. lua_type(state, 3) == LUA_TNUMBER &&
  1831. lua_type(state, 4) == LUA_TNUMBER &&
  1832. lua_type(state, 5) == LUA_TNUMBER)
  1833. {
  1834. // Get parameter 1 off the stack.
  1835. float param1 = (float)luaL_checknumber(state, 2);
  1836. // Get parameter 2 off the stack.
  1837. float param2 = (float)luaL_checknumber(state, 3);
  1838. // Get parameter 3 off the stack.
  1839. float param3 = (float)luaL_checknumber(state, 4);
  1840. // Get parameter 4 off the stack.
  1841. float param4 = (float)luaL_checknumber(state, 5);
  1842. ParticleEmitter* instance = getInstance(state);
  1843. instance->setSize(param1, param2, param3, param4);
  1844. return 0;
  1845. }
  1846. else
  1847. {
  1848. lua_pushstring(state, "lua_ParticleEmitter_setSize - Failed to match the given parameters to a valid function signature.");
  1849. lua_error(state);
  1850. }
  1851. break;
  1852. }
  1853. default:
  1854. {
  1855. lua_pushstring(state, "Invalid number of parameters (expected 5).");
  1856. lua_error(state);
  1857. break;
  1858. }
  1859. }
  1860. return 0;
  1861. }
  1862. int lua_ParticleEmitter_setSpriteAnimated(lua_State* state)
  1863. {
  1864. // Get the number of parameters.
  1865. int paramCount = lua_gettop(state);
  1866. // Attempt to match the parameters to a valid binding.
  1867. switch (paramCount)
  1868. {
  1869. case 2:
  1870. {
  1871. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1872. lua_type(state, 2) == LUA_TBOOLEAN)
  1873. {
  1874. // Get parameter 1 off the stack.
  1875. bool param1 = ScriptUtil::luaCheckBool(state, 2);
  1876. ParticleEmitter* instance = getInstance(state);
  1877. instance->setSpriteAnimated(param1);
  1878. return 0;
  1879. }
  1880. else
  1881. {
  1882. lua_pushstring(state, "lua_ParticleEmitter_setSpriteAnimated - Failed to match the given parameters to a valid function signature.");
  1883. lua_error(state);
  1884. }
  1885. break;
  1886. }
  1887. default:
  1888. {
  1889. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  1890. lua_error(state);
  1891. break;
  1892. }
  1893. }
  1894. return 0;
  1895. }
  1896. int lua_ParticleEmitter_setSpriteFrameCoords(lua_State* state)
  1897. {
  1898. // Get the number of parameters.
  1899. int paramCount = lua_gettop(state);
  1900. // Attempt to match the parameters to a valid binding.
  1901. switch (paramCount)
  1902. {
  1903. case 3:
  1904. {
  1905. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1906. lua_type(state, 2) == LUA_TNUMBER &&
  1907. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TTABLE || lua_type(state, 3) == LUA_TNIL))
  1908. {
  1909. // Get parameter 1 off the stack.
  1910. unsigned int param1 = (unsigned int)luaL_checkunsigned(state, 2);
  1911. // Get parameter 2 off the stack.
  1912. Rectangle* param2 = ScriptUtil::getObjectPointer<Rectangle>(3, "Rectangle", false);
  1913. ParticleEmitter* instance = getInstance(state);
  1914. instance->setSpriteFrameCoords(param1, param2);
  1915. return 0;
  1916. }
  1917. else
  1918. {
  1919. lua_pushstring(state, "lua_ParticleEmitter_setSpriteFrameCoords - Failed to match the given parameters to a valid function signature.");
  1920. lua_error(state);
  1921. }
  1922. break;
  1923. }
  1924. case 4:
  1925. {
  1926. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1927. lua_type(state, 2) == LUA_TNUMBER &&
  1928. lua_type(state, 3) == LUA_TNUMBER &&
  1929. lua_type(state, 4) == LUA_TNUMBER)
  1930. {
  1931. // Get parameter 1 off the stack.
  1932. unsigned int param1 = (unsigned int)luaL_checkunsigned(state, 2);
  1933. // Get parameter 2 off the stack.
  1934. int param2 = (int)luaL_checkint(state, 3);
  1935. // Get parameter 3 off the stack.
  1936. int param3 = (int)luaL_checkint(state, 4);
  1937. ParticleEmitter* instance = getInstance(state);
  1938. instance->setSpriteFrameCoords(param1, param2, param3);
  1939. return 0;
  1940. }
  1941. else
  1942. {
  1943. lua_pushstring(state, "lua_ParticleEmitter_setSpriteFrameCoords - Failed to match the given parameters to a valid function signature.");
  1944. lua_error(state);
  1945. }
  1946. break;
  1947. }
  1948. default:
  1949. {
  1950. lua_pushstring(state, "Invalid number of parameters (expected 3 or 4).");
  1951. lua_error(state);
  1952. break;
  1953. }
  1954. }
  1955. return 0;
  1956. }
  1957. int lua_ParticleEmitter_setSpriteFrameDuration(lua_State* state)
  1958. {
  1959. // Get the number of parameters.
  1960. int paramCount = lua_gettop(state);
  1961. // Attempt to match the parameters to a valid binding.
  1962. switch (paramCount)
  1963. {
  1964. case 2:
  1965. {
  1966. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1967. lua_type(state, 2) == LUA_TNUMBER)
  1968. {
  1969. // Get parameter 1 off the stack.
  1970. long param1 = (long)luaL_checklong(state, 2);
  1971. ParticleEmitter* instance = getInstance(state);
  1972. instance->setSpriteFrameDuration(param1);
  1973. return 0;
  1974. }
  1975. else
  1976. {
  1977. lua_pushstring(state, "lua_ParticleEmitter_setSpriteFrameDuration - Failed to match the given parameters to a valid function signature.");
  1978. lua_error(state);
  1979. }
  1980. break;
  1981. }
  1982. default:
  1983. {
  1984. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  1985. lua_error(state);
  1986. break;
  1987. }
  1988. }
  1989. return 0;
  1990. }
  1991. int lua_ParticleEmitter_setSpriteFrameRandomOffset(lua_State* state)
  1992. {
  1993. // Get the number of parameters.
  1994. int paramCount = lua_gettop(state);
  1995. // Attempt to match the parameters to a valid binding.
  1996. switch (paramCount)
  1997. {
  1998. case 2:
  1999. {
  2000. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  2001. lua_type(state, 2) == LUA_TNUMBER)
  2002. {
  2003. // Get parameter 1 off the stack.
  2004. int param1 = (int)luaL_checkint(state, 2);
  2005. ParticleEmitter* instance = getInstance(state);
  2006. instance->setSpriteFrameRandomOffset(param1);
  2007. return 0;
  2008. }
  2009. else
  2010. {
  2011. lua_pushstring(state, "lua_ParticleEmitter_setSpriteFrameRandomOffset - Failed to match the given parameters to a valid function signature.");
  2012. lua_error(state);
  2013. }
  2014. break;
  2015. }
  2016. default:
  2017. {
  2018. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  2019. lua_error(state);
  2020. break;
  2021. }
  2022. }
  2023. return 0;
  2024. }
  2025. int lua_ParticleEmitter_setSpriteLooped(lua_State* state)
  2026. {
  2027. // Get the number of parameters.
  2028. int paramCount = lua_gettop(state);
  2029. // Attempt to match the parameters to a valid binding.
  2030. switch (paramCount)
  2031. {
  2032. case 2:
  2033. {
  2034. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  2035. lua_type(state, 2) == LUA_TBOOLEAN)
  2036. {
  2037. // Get parameter 1 off the stack.
  2038. bool param1 = ScriptUtil::luaCheckBool(state, 2);
  2039. ParticleEmitter* instance = getInstance(state);
  2040. instance->setSpriteLooped(param1);
  2041. return 0;
  2042. }
  2043. else
  2044. {
  2045. lua_pushstring(state, "lua_ParticleEmitter_setSpriteLooped - Failed to match the given parameters to a valid function signature.");
  2046. lua_error(state);
  2047. }
  2048. break;
  2049. }
  2050. default:
  2051. {
  2052. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  2053. lua_error(state);
  2054. break;
  2055. }
  2056. }
  2057. return 0;
  2058. }
  2059. int lua_ParticleEmitter_setSpriteTexCoords(lua_State* state)
  2060. {
  2061. // Get the number of parameters.
  2062. int paramCount = lua_gettop(state);
  2063. // Attempt to match the parameters to a valid binding.
  2064. switch (paramCount)
  2065. {
  2066. case 3:
  2067. {
  2068. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  2069. lua_type(state, 2) == LUA_TNUMBER &&
  2070. (lua_type(state, 3) == LUA_TTABLE || lua_type(state, 3) == LUA_TLIGHTUSERDATA))
  2071. {
  2072. // Get parameter 1 off the stack.
  2073. unsigned int param1 = (unsigned int)luaL_checkunsigned(state, 2);
  2074. // Get parameter 2 off the stack.
  2075. float* param2 = ScriptUtil::getFloatPointer(3);
  2076. ParticleEmitter* instance = getInstance(state);
  2077. instance->setSpriteTexCoords(param1, param2);
  2078. return 0;
  2079. }
  2080. else
  2081. {
  2082. lua_pushstring(state, "lua_ParticleEmitter_setSpriteTexCoords - Failed to match the given parameters to a valid function signature.");
  2083. lua_error(state);
  2084. }
  2085. break;
  2086. }
  2087. default:
  2088. {
  2089. lua_pushstring(state, "Invalid number of parameters (expected 3).");
  2090. lua_error(state);
  2091. break;
  2092. }
  2093. }
  2094. return 0;
  2095. }
  2096. int lua_ParticleEmitter_setTextureBlending(lua_State* state)
  2097. {
  2098. // Get the number of parameters.
  2099. int paramCount = lua_gettop(state);
  2100. // Attempt to match the parameters to a valid binding.
  2101. switch (paramCount)
  2102. {
  2103. case 2:
  2104. {
  2105. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  2106. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL))
  2107. {
  2108. // Get parameter 1 off the stack.
  2109. ParticleEmitter::TextureBlending param1 = (ParticleEmitter::TextureBlending)lua_enumFromString_ParticleEmitterTextureBlending(luaL_checkstring(state, 2));
  2110. ParticleEmitter* instance = getInstance(state);
  2111. instance->setTextureBlending(param1);
  2112. return 0;
  2113. }
  2114. else
  2115. {
  2116. lua_pushstring(state, "lua_ParticleEmitter_setTextureBlending - Failed to match the given parameters to a valid function signature.");
  2117. lua_error(state);
  2118. }
  2119. break;
  2120. }
  2121. default:
  2122. {
  2123. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  2124. lua_error(state);
  2125. break;
  2126. }
  2127. }
  2128. return 0;
  2129. }
  2130. int lua_ParticleEmitter_setVelocity(lua_State* state)
  2131. {
  2132. // Get the number of parameters.
  2133. int paramCount = lua_gettop(state);
  2134. // Attempt to match the parameters to a valid binding.
  2135. switch (paramCount)
  2136. {
  2137. case 3:
  2138. {
  2139. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  2140. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL) &&
  2141. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TNIL))
  2142. {
  2143. // Get parameter 1 off the stack.
  2144. Vector3* param1 = ScriptUtil::getObjectPointer<Vector3>(2, "Vector3", true);
  2145. // Get parameter 2 off the stack.
  2146. Vector3* param2 = ScriptUtil::getObjectPointer<Vector3>(3, "Vector3", true);
  2147. ParticleEmitter* instance = getInstance(state);
  2148. instance->setVelocity(*param1, *param2);
  2149. return 0;
  2150. }
  2151. else
  2152. {
  2153. lua_pushstring(state, "lua_ParticleEmitter_setVelocity - Failed to match the given parameters to a valid function signature.");
  2154. lua_error(state);
  2155. }
  2156. break;
  2157. }
  2158. default:
  2159. {
  2160. lua_pushstring(state, "Invalid number of parameters (expected 3).");
  2161. lua_error(state);
  2162. break;
  2163. }
  2164. }
  2165. return 0;
  2166. }
  2167. int lua_ParticleEmitter_start(lua_State* state)
  2168. {
  2169. // Get the number of parameters.
  2170. int paramCount = lua_gettop(state);
  2171. // Attempt to match the parameters to a valid binding.
  2172. switch (paramCount)
  2173. {
  2174. case 1:
  2175. {
  2176. if ((lua_type(state, 1) == LUA_TUSERDATA))
  2177. {
  2178. ParticleEmitter* instance = getInstance(state);
  2179. instance->start();
  2180. return 0;
  2181. }
  2182. else
  2183. {
  2184. lua_pushstring(state, "lua_ParticleEmitter_start - Failed to match the given parameters to a valid function signature.");
  2185. lua_error(state);
  2186. }
  2187. break;
  2188. }
  2189. default:
  2190. {
  2191. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  2192. lua_error(state);
  2193. break;
  2194. }
  2195. }
  2196. return 0;
  2197. }
  2198. int lua_ParticleEmitter_static_create(lua_State* state)
  2199. {
  2200. // Get the number of parameters.
  2201. int paramCount = lua_gettop(state);
  2202. // Attempt to match the parameters to a valid binding.
  2203. switch (paramCount)
  2204. {
  2205. case 1:
  2206. {
  2207. if ((lua_type(state, 1) == LUA_TSTRING || lua_type(state, 1) == LUA_TNIL))
  2208. {
  2209. // Get parameter 1 off the stack.
  2210. const char* param1 = ScriptUtil::getString(1, false);
  2211. void* returnPtr = (void*)ParticleEmitter::create(param1);
  2212. if (returnPtr)
  2213. {
  2214. ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
  2215. object->instance = returnPtr;
  2216. object->owns = false;
  2217. luaL_getmetatable(state, "ParticleEmitter");
  2218. lua_setmetatable(state, -2);
  2219. }
  2220. else
  2221. {
  2222. lua_pushnil(state);
  2223. }
  2224. return 1;
  2225. }
  2226. else if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TTABLE || lua_type(state, 1) == LUA_TNIL))
  2227. {
  2228. // Get parameter 1 off the stack.
  2229. Properties* param1 = ScriptUtil::getObjectPointer<Properties>(1, "Properties", false);
  2230. void* returnPtr = (void*)ParticleEmitter::create(param1);
  2231. if (returnPtr)
  2232. {
  2233. ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
  2234. object->instance = returnPtr;
  2235. object->owns = false;
  2236. luaL_getmetatable(state, "ParticleEmitter");
  2237. lua_setmetatable(state, -2);
  2238. }
  2239. else
  2240. {
  2241. lua_pushnil(state);
  2242. }
  2243. return 1;
  2244. }
  2245. else
  2246. {
  2247. lua_pushstring(state, "lua_ParticleEmitter_static_create - Failed to match the given parameters to a valid function signature.");
  2248. lua_error(state);
  2249. }
  2250. break;
  2251. }
  2252. case 3:
  2253. {
  2254. if ((lua_type(state, 1) == LUA_TSTRING || lua_type(state, 1) == LUA_TNIL) &&
  2255. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
  2256. lua_type(state, 3) == LUA_TNUMBER)
  2257. {
  2258. // Get parameter 1 off the stack.
  2259. const char* param1 = ScriptUtil::getString(1, false);
  2260. // Get parameter 2 off the stack.
  2261. ParticleEmitter::TextureBlending param2 = (ParticleEmitter::TextureBlending)lua_enumFromString_ParticleEmitterTextureBlending(luaL_checkstring(state, 2));
  2262. // Get parameter 3 off the stack.
  2263. unsigned int param3 = (unsigned int)luaL_checkunsigned(state, 3);
  2264. void* returnPtr = (void*)ParticleEmitter::create(param1, param2, param3);
  2265. if (returnPtr)
  2266. {
  2267. ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
  2268. object->instance = returnPtr;
  2269. object->owns = false;
  2270. luaL_getmetatable(state, "ParticleEmitter");
  2271. lua_setmetatable(state, -2);
  2272. }
  2273. else
  2274. {
  2275. lua_pushnil(state);
  2276. }
  2277. return 1;
  2278. }
  2279. else
  2280. {
  2281. lua_pushstring(state, "lua_ParticleEmitter_static_create - Failed to match the given parameters to a valid function signature.");
  2282. lua_error(state);
  2283. }
  2284. break;
  2285. }
  2286. default:
  2287. {
  2288. lua_pushstring(state, "Invalid number of parameters (expected 1 or 3).");
  2289. lua_error(state);
  2290. break;
  2291. }
  2292. }
  2293. return 0;
  2294. }
  2295. int lua_ParticleEmitter_static_getTextureBlendingFromString(lua_State* state)
  2296. {
  2297. // Get the number of parameters.
  2298. int paramCount = lua_gettop(state);
  2299. // Attempt to match the parameters to a valid binding.
  2300. switch (paramCount)
  2301. {
  2302. case 1:
  2303. {
  2304. if ((lua_type(state, 1) == LUA_TSTRING || lua_type(state, 1) == LUA_TNIL))
  2305. {
  2306. // Get parameter 1 off the stack.
  2307. const char* param1 = ScriptUtil::getString(1, false);
  2308. ParticleEmitter::TextureBlending result = ParticleEmitter::getTextureBlendingFromString(param1);
  2309. // Push the return value onto the stack.
  2310. lua_pushstring(state, lua_stringFromEnum_ParticleEmitterTextureBlending(result));
  2311. return 1;
  2312. }
  2313. else
  2314. {
  2315. lua_pushstring(state, "lua_ParticleEmitter_static_getTextureBlendingFromString - Failed to match the given parameters to a valid function signature.");
  2316. lua_error(state);
  2317. }
  2318. break;
  2319. }
  2320. default:
  2321. {
  2322. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  2323. lua_error(state);
  2324. break;
  2325. }
  2326. }
  2327. return 0;
  2328. }
  2329. int lua_ParticleEmitter_stop(lua_State* state)
  2330. {
  2331. // Get the number of parameters.
  2332. int paramCount = lua_gettop(state);
  2333. // Attempt to match the parameters to a valid binding.
  2334. switch (paramCount)
  2335. {
  2336. case 1:
  2337. {
  2338. if ((lua_type(state, 1) == LUA_TUSERDATA))
  2339. {
  2340. ParticleEmitter* instance = getInstance(state);
  2341. instance->stop();
  2342. return 0;
  2343. }
  2344. else
  2345. {
  2346. lua_pushstring(state, "lua_ParticleEmitter_stop - Failed to match the given parameters to a valid function signature.");
  2347. lua_error(state);
  2348. }
  2349. break;
  2350. }
  2351. default:
  2352. {
  2353. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  2354. lua_error(state);
  2355. break;
  2356. }
  2357. }
  2358. return 0;
  2359. }
  2360. int lua_ParticleEmitter_update(lua_State* state)
  2361. {
  2362. // Get the number of parameters.
  2363. int paramCount = lua_gettop(state);
  2364. // Attempt to match the parameters to a valid binding.
  2365. switch (paramCount)
  2366. {
  2367. case 2:
  2368. {
  2369. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  2370. lua_type(state, 2) == LUA_TNUMBER)
  2371. {
  2372. // Get parameter 1 off the stack.
  2373. float param1 = (float)luaL_checknumber(state, 2);
  2374. ParticleEmitter* instance = getInstance(state);
  2375. instance->update(param1);
  2376. return 0;
  2377. }
  2378. else
  2379. {
  2380. lua_pushstring(state, "lua_ParticleEmitter_update - Failed to match the given parameters to a valid function signature.");
  2381. lua_error(state);
  2382. }
  2383. break;
  2384. }
  2385. default:
  2386. {
  2387. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  2388. lua_error(state);
  2389. break;
  2390. }
  2391. }
  2392. return 0;
  2393. }
  2394. }