lua_ParticleEmitter.cpp 85 KB

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