wrap_ParticleSystem.cpp 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677
  1. /**
  2. * Copyright (c) 2006-2013 LOVE Development Team
  3. *
  4. * This software is provided 'as-is', without any express or implied
  5. * warranty. In no event will the authors be held liable for any damages
  6. * arising from the use of this software.
  7. *
  8. * Permission is granted to anyone to use this software for any purpose,
  9. * including commercial applications, and to alter it and redistribute it
  10. * freely, subject to the following restrictions:
  11. *
  12. * 1. The origin of this software must not be misrepresented; you must not
  13. * claim that you wrote the original software. If you use this software
  14. * in a product, an acknowledgment in the product documentation would be
  15. * appreciated but is not required.
  16. * 2. Altered source versions must be plainly marked as such, and must not be
  17. * misrepresented as being the original software.
  18. * 3. This notice may not be removed or altered from any source distribution.
  19. **/
  20. #include "wrap_ParticleSystem.h"
  21. #include "common/Vector.h"
  22. #include <cstring>
  23. namespace love
  24. {
  25. namespace graphics
  26. {
  27. namespace opengl
  28. {
  29. ParticleSystem *luax_checkparticlesystem(lua_State *L, int idx)
  30. {
  31. return luax_checktype<ParticleSystem>(L, idx, "ParticleSystem", GRAPHICS_PARTICLE_SYSTEM_T);
  32. }
  33. int w_ParticleSystem_setImage(lua_State *L)
  34. {
  35. ParticleSystem *t = luax_checkparticlesystem(L, 1);
  36. Image *i = luax_checkimage(L, 2);
  37. t->setImage(i);
  38. return 0;
  39. }
  40. int w_ParticleSystem_getImage(lua_State *L)
  41. {
  42. ParticleSystem *t = luax_checkparticlesystem(L, 1);
  43. Image *i = t->getImage();
  44. i->retain();
  45. luax_pushtype(L, "Image", GRAPHICS_IMAGE_T, i);
  46. return 1;
  47. }
  48. int w_ParticleSystem_setBufferSize(lua_State *L)
  49. {
  50. ParticleSystem *t = luax_checkparticlesystem(L, 1);
  51. lua_Number arg1 = luaL_checknumber(L, 2);
  52. if (arg1 < 1.0 || arg1 > ParticleSystem::MAX_PARTICLES)
  53. return luaL_error(L, "Invalid buffer size");
  54. try
  55. {
  56. t->setBufferSize((uint32) arg1);
  57. }
  58. catch (love::Exception &e)
  59. {
  60. return luaL_error(L, "%s", e.what());
  61. }
  62. return 0;
  63. }
  64. int w_ParticleSystem_getBufferSize(lua_State *L)
  65. {
  66. ParticleSystem *t = luax_checkparticlesystem(L, 1);
  67. lua_pushinteger(L, t->getBufferSize());
  68. return 1;
  69. }
  70. int w_ParticleSystem_setInsertMode(lua_State *L)
  71. {
  72. ParticleSystem *t = luax_checkparticlesystem(L, 1);
  73. ParticleSystem::InsertMode mode;
  74. const char *str = luaL_checkstring(L, 2);
  75. if (!ParticleSystem::getConstant(str, mode))
  76. return luaL_error(L, "Invalid insert mode: '%s'", str);
  77. t->setInsertMode(mode);
  78. return 0;
  79. }
  80. int w_ParticleSystem_getInsertMode(lua_State *L)
  81. {
  82. ParticleSystem *t = luax_checkparticlesystem(L, 1);
  83. ParticleSystem::InsertMode mode;
  84. mode = t->getInsertMode();
  85. const char *str;
  86. if (!ParticleSystem::getConstant(mode, str))
  87. return luaL_error(L, "Unknown insert mode");
  88. lua_pushstring(L, str);
  89. return 1;
  90. }
  91. int w_ParticleSystem_setEmissionRate(lua_State *L)
  92. {
  93. ParticleSystem *t = luax_checkparticlesystem(L, 1);
  94. int arg1 = luaL_checkint(L, 2);
  95. try
  96. {
  97. t->setEmissionRate(arg1);
  98. }
  99. catch (love::Exception &e)
  100. {
  101. return luaL_error(L, "%s", e.what());
  102. }
  103. return 0;
  104. }
  105. int w_ParticleSystem_getEmissionRate(lua_State *L)
  106. {
  107. ParticleSystem *t = luax_checkparticlesystem(L, 1);
  108. lua_pushinteger(L, t->getEmissionRate());
  109. return 1;
  110. }
  111. int w_ParticleSystem_setEmitterLifetime(lua_State *L)
  112. {
  113. ParticleSystem *t = luax_checkparticlesystem(L, 1);
  114. float arg1 = (float)luaL_checknumber(L, 2);
  115. t->setEmitterLifetime(arg1);
  116. return 0;
  117. }
  118. int w_ParticleSystem_getEmitterLifetime(lua_State *L)
  119. {
  120. ParticleSystem *t = luax_checkparticlesystem(L, 1);
  121. lua_pushnumber(L, t->getEmitterLifetime());
  122. return 1;
  123. }
  124. int w_ParticleSystem_setParticleLifetime(lua_State *L)
  125. {
  126. ParticleSystem *t = luax_checkparticlesystem(L, 1);
  127. float arg1 = (float)luaL_checknumber(L, 2);
  128. float arg2 = (float)luaL_optnumber(L, 3, arg1);
  129. t->setParticleLifetime(arg1, arg2);
  130. return 0;
  131. }
  132. int w_ParticleSystem_getParticleLifetime(lua_State *L)
  133. {
  134. ParticleSystem *t = luax_checkparticlesystem(L, 1);
  135. float min, max;
  136. t->getParticleLifetime(&min, &max);
  137. lua_pushnumber(L, min);
  138. lua_pushnumber(L, max);
  139. return 2;
  140. }
  141. int w_ParticleSystem_setPosition(lua_State *L)
  142. {
  143. ParticleSystem *t = luax_checkparticlesystem(L, 1);
  144. float arg1 = (float)luaL_checknumber(L, 2);
  145. float arg2 = (float)luaL_checknumber(L, 3);
  146. t->setPosition(arg1, arg2);
  147. return 0;
  148. }
  149. int w_ParticleSystem_getPosition(lua_State *L)
  150. {
  151. ParticleSystem *t = luax_checkparticlesystem(L, 1);
  152. love::Vector pos = t->getPosition();
  153. lua_pushnumber(L, pos.getX());
  154. lua_pushnumber(L, pos.getY());
  155. return 2;
  156. }
  157. int w_ParticleSystem_setAreaSpread(lua_State *L)
  158. {
  159. ParticleSystem *t = luax_checkparticlesystem(L, 1);
  160. ParticleSystem::AreaSpreadDistribution distribution;
  161. const char *str = luaL_checkstring(L, 2);
  162. if (!ParticleSystem::getConstant(str, distribution))
  163. return luaL_error(L, "Invalid distribution: '%s'", str);
  164. float x = (float)luaL_checknumber(L, 3);
  165. float y = (float)luaL_checknumber(L, 4);
  166. if (x < 0.0f || y < 0.0f)
  167. return luaL_error(L, "Invalid area spread parameters (must be >= 0)");
  168. t->setAreaSpread(distribution, x, y);
  169. return 0;
  170. }
  171. int w_ParticleSystem_getAreaSpread(lua_State *L)
  172. {
  173. ParticleSystem *t = luax_checkparticlesystem(L, 1);
  174. ParticleSystem::AreaSpreadDistribution distribution = t-> getAreaSpreadDistribution();
  175. const char *str;
  176. ParticleSystem::getConstant(distribution, str);
  177. const love::Vector &p = t->getAreaSpreadParameters();
  178. lua_pushstring(L, str);
  179. lua_pushnumber(L, p.x);
  180. lua_pushnumber(L, p.y);
  181. return 3;
  182. }
  183. int w_ParticleSystem_setDirection(lua_State *L)
  184. {
  185. ParticleSystem *t = luax_checkparticlesystem(L, 1);
  186. float arg1 = (float)luaL_checknumber(L, 2);
  187. t->setDirection(arg1);
  188. return 0;
  189. }
  190. int w_ParticleSystem_getDirection(lua_State *L)
  191. {
  192. ParticleSystem *t = luax_checkparticlesystem(L, 1);
  193. lua_pushnumber(L, t->getDirection());
  194. return 1;
  195. }
  196. int w_ParticleSystem_setSpread(lua_State *L)
  197. {
  198. ParticleSystem *t = luax_checkparticlesystem(L, 1);
  199. float arg1 = (float)luaL_checknumber(L, 2);
  200. t->setSpread(arg1);
  201. return 0;
  202. }
  203. int w_ParticleSystem_getSpread(lua_State *L)
  204. {
  205. ParticleSystem *t = luax_checkparticlesystem(L, 1);
  206. lua_pushnumber(L, t->getSpread());
  207. return 1;
  208. }
  209. int w_ParticleSystem_setSpeed(lua_State *L)
  210. {
  211. ParticleSystem *t = luax_checkparticlesystem(L, 1);
  212. float arg1 = (float)luaL_checknumber(L, 2);
  213. float arg2 = (float)luaL_optnumber(L, 3, arg1);
  214. t->setSpeed(arg1, arg2);
  215. return 0;
  216. }
  217. int w_ParticleSystem_getSpeed(lua_State *L)
  218. {
  219. ParticleSystem *t = luax_checkparticlesystem(L, 1);
  220. float min, max;
  221. t->getSpeed(&min, &max);
  222. lua_pushnumber(L, min);
  223. lua_pushnumber(L, max);
  224. return 2;
  225. }
  226. int w_ParticleSystem_setLinearAcceleration(lua_State *L)
  227. {
  228. ParticleSystem *t = luax_checkparticlesystem(L, 1);
  229. float xmin = (float) luaL_optnumber(L, 2, 0.0);
  230. float ymin = (float) luaL_optnumber(L, 3, 0.0);
  231. float xmax = (float) luaL_optnumber(L, 4, xmin);
  232. float ymax = (float) luaL_optnumber(L, 5, ymin);
  233. t->setLinearAcceleration(xmin, ymin, xmax, ymax);
  234. return 0;
  235. }
  236. int w_ParticleSystem_getLinearAcceleration(lua_State *L)
  237. {
  238. ParticleSystem *t = luax_checkparticlesystem(L, 1);
  239. love::Vector min, max;
  240. t->getLinearAcceleration(&min, &max);
  241. lua_pushnumber(L, min.x);
  242. lua_pushnumber(L, min.y);
  243. lua_pushnumber(L, max.x);
  244. lua_pushnumber(L, max.y);
  245. return 4;
  246. }
  247. int w_ParticleSystem_setRadialAcceleration(lua_State *L)
  248. {
  249. ParticleSystem *t = luax_checkparticlesystem(L, 1);
  250. float arg1 = (float)luaL_checknumber(L, 2);
  251. float arg2 = (float)luaL_optnumber(L, 3, arg1);
  252. t->setRadialAcceleration(arg1, arg2);
  253. return 0;
  254. }
  255. int w_ParticleSystem_getRadialAcceleration(lua_State *L)
  256. {
  257. ParticleSystem *t = luax_checkparticlesystem(L, 1);
  258. float min, max;
  259. t->getRadialAcceleration(&min, &max);
  260. lua_pushnumber(L, min);
  261. lua_pushnumber(L, max);
  262. return 2;
  263. }
  264. int w_ParticleSystem_setTangentialAcceleration(lua_State *L)
  265. {
  266. ParticleSystem *t = luax_checkparticlesystem(L, 1);
  267. float arg1 = (float)luaL_checknumber(L, 2);
  268. float arg2 = (float)luaL_optnumber(L, 3, arg1);
  269. t->setTangentialAcceleration(arg1, arg2);
  270. return 0;
  271. }
  272. int w_ParticleSystem_getTangentialAcceleration(lua_State *L)
  273. {
  274. ParticleSystem *t = luax_checkparticlesystem(L, 1);
  275. float min, max;
  276. t->getTangentialAcceleration(&min, &max);
  277. lua_pushnumber(L, min);
  278. lua_pushnumber(L, max);
  279. return 2;
  280. }
  281. int w_ParticleSystem_setSizes(lua_State *L)
  282. {
  283. ParticleSystem *t = luax_checkparticlesystem(L, 1);
  284. size_t nSizes = lua_gettop(L) - 1;
  285. if (nSizes > 8)
  286. return luaL_error(L, "At most eight (8) sizes may be used.");
  287. if (nSizes <= 1)
  288. {
  289. float size = luax_checkfloat(L, 2);
  290. t->setSize(size);
  291. }
  292. else
  293. {
  294. std::vector<float> sizes(nSizes);
  295. for (size_t i = 0; i < nSizes; ++i)
  296. sizes[i] = luax_checkfloat(L, 1 + i + 1);
  297. t->setSizes(sizes);
  298. }
  299. return 0;
  300. }
  301. int w_ParticleSystem_getSizes(lua_State *L)
  302. {
  303. ParticleSystem *t = luax_checkparticlesystem(L, 1);
  304. const std::vector<float> &sizes = t->getSizes();
  305. for (size_t i = 0; i < sizes.size(); i++)
  306. lua_pushnumber(L, sizes[i]);
  307. return sizes.size();
  308. }
  309. int w_ParticleSystem_setSizeVariation(lua_State *L)
  310. {
  311. ParticleSystem *t = luax_checkparticlesystem(L, 1);
  312. float arg1 = (float)luaL_checknumber(L, 2);
  313. if (arg1 < 0.0f || arg1 > 1.0f)
  314. return luaL_error(L, "Size variation has to be between 0 and 1, inclusive.");
  315. t->setSizeVariation(arg1);
  316. return 0;
  317. }
  318. int w_ParticleSystem_getSizeVariation(lua_State *L)
  319. {
  320. ParticleSystem *t = luax_checkparticlesystem(L, 1);
  321. lua_pushnumber(L, t->getSizeVariation());
  322. return 1;
  323. }
  324. int w_ParticleSystem_setRotation(lua_State *L)
  325. {
  326. ParticleSystem *t = luax_checkparticlesystem(L, 1);
  327. float arg1 = (float)luaL_checknumber(L, 2);
  328. float arg2 = (float)luaL_optnumber(L, 3, arg1);
  329. t->setRotation(arg1, arg2);
  330. return 0;
  331. }
  332. int w_ParticleSystem_getRotation(lua_State *L)
  333. {
  334. ParticleSystem *t = luax_checkparticlesystem(L, 1);
  335. float min, max;
  336. t->getRotation(&min, &max);
  337. lua_pushnumber(L, min);
  338. lua_pushnumber(L, max);
  339. return 2;
  340. }
  341. int w_ParticleSystem_setSpin(lua_State *L)
  342. {
  343. ParticleSystem *t = luax_checkparticlesystem(L, 1);
  344. float arg1 = (float)luaL_checknumber(L, 2);
  345. float arg2 = (float)luaL_optnumber(L, 3, arg1);
  346. t->setSpin(arg1, arg2);
  347. return 0;
  348. }
  349. int w_ParticleSystem_getSpin(lua_State *L)
  350. {
  351. ParticleSystem *t = luax_checkparticlesystem(L, 1);
  352. float start, end;
  353. t->getSpin(&start, &end);
  354. lua_pushnumber(L, start);
  355. lua_pushnumber(L, end);
  356. return 2;
  357. }
  358. int w_ParticleSystem_setSpinVariation(lua_State *L)
  359. {
  360. ParticleSystem *t = luax_checkparticlesystem(L, 1);
  361. float arg1 = (float)luaL_checknumber(L, 2);
  362. t->setSpinVariation(arg1);
  363. return 0;
  364. }
  365. int w_ParticleSystem_getSpinVariation(lua_State *L)
  366. {
  367. ParticleSystem *t = luax_checkparticlesystem(L, 1);
  368. lua_pushnumber(L, t->getSpinVariation());
  369. return 1;
  370. }
  371. int w_ParticleSystem_setOffset(lua_State *L)
  372. {
  373. ParticleSystem *t = luax_checkparticlesystem(L, 1);
  374. float x = (float)luaL_checknumber(L, 2);
  375. float y = (float)luaL_checknumber(L, 3);
  376. t->setOffset(x, y);
  377. return 0;
  378. }
  379. int w_ParticleSystem_getOffset(lua_State *L)
  380. {
  381. ParticleSystem *t = luax_checkparticlesystem(L, 1);
  382. love::Vector offset = t->getOffset();
  383. lua_pushnumber(L, offset.getX());
  384. lua_pushnumber(L, offset.getY());
  385. return 2;
  386. }
  387. int w_ParticleSystem_setColors(lua_State *L)
  388. {
  389. ParticleSystem *t = luax_checkparticlesystem(L, 1);
  390. if (lua_istable(L, 2)) // setColors({r,g,b,a}, {r,g,b,a}, ...)
  391. {
  392. size_t nColors = lua_gettop(L) - 1;
  393. if (nColors > 8)
  394. return luaL_error(L, "At most eight (8) colors may be used.");
  395. std::vector<Color> colors(nColors);
  396. for (size_t i = 0; i < nColors; i++)
  397. {
  398. luaL_checktype(L, i + 2, LUA_TTABLE);
  399. if (lua_objlen(L, i + 2) < 3)
  400. return luaL_argerror(L, i + 2, "expected 4 color components");
  401. for (int j = 0; j < 4; j++)
  402. // push args[i+2][j+1] onto the stack
  403. lua_rawgeti(L, i + 2, j + 1);
  404. int r = luaL_checkint(L, -4);
  405. int g = luaL_checkint(L, -3);
  406. int b = luaL_checkint(L, -2);
  407. int a = luaL_optint(L, -1, 255);
  408. // pop the color components from the stack
  409. lua_pop(L, 4);
  410. colors[i] = Color(r, g, b, a);
  411. }
  412. t->setColor(colors);
  413. }
  414. else // setColors(r,g,b,a, r,g,b,a, ...)
  415. {
  416. int cargs = lua_gettop(L) - 1;
  417. size_t nColors = (cargs + 3) / 4; // nColors = ceil(color_args / 4)
  418. if (cargs != 3 && (cargs % 4 != 0 || cargs == 0))
  419. return luaL_error(L, "Expected red, green, blue, and alpha. Only got %d of 4 components.", cargs % 4);
  420. if (nColors > 8)
  421. return luaL_error(L, "At most eight (8) colors may be used.");
  422. if (nColors == 1)
  423. {
  424. int r = luaL_checkint(L, 2);
  425. int g = luaL_checkint(L, 3);
  426. int b = luaL_checkint(L, 4);
  427. int a = luaL_optint(L, 5, 255);
  428. t->setColor(Color(r,g,b,a));
  429. }
  430. else
  431. {
  432. std::vector<Color> colors(nColors);
  433. for (size_t i = 0; i < nColors; ++i)
  434. {
  435. int r = luaL_checkint(L, 1 + i*4 + 1);
  436. int g = luaL_checkint(L, 1 + i*4 + 2);
  437. int b = luaL_checkint(L, 1 + i*4 + 3);
  438. int a = luaL_checkint(L, 1 + i*4 + 4);
  439. colors[i] = Color(r,g,b,a);
  440. }
  441. t->setColor(colors);
  442. }
  443. }
  444. return 0;
  445. }
  446. int w_ParticleSystem_getColors(lua_State *L)
  447. {
  448. ParticleSystem *t = luax_checkparticlesystem(L, 1);
  449. const std::vector<Color> &colors =t->getColor();
  450. for (size_t i = 0; i < colors.size(); i++)
  451. {
  452. lua_createtable(L, 4, 0);
  453. lua_pushinteger(L, colors[i].r);
  454. lua_rawseti(L, -2, 1);
  455. lua_pushinteger(L, colors[i].g);
  456. lua_rawseti(L, -2, 2);
  457. lua_pushinteger(L, colors[i].b);
  458. lua_rawseti(L, -2, 3);
  459. lua_pushinteger(L, colors[i].a);
  460. lua_rawseti(L, -2, 4);
  461. }
  462. return colors.size();
  463. }
  464. int w_ParticleSystem_getCount(lua_State *L)
  465. {
  466. ParticleSystem *t = luax_checkparticlesystem(L, 1);
  467. lua_pushnumber(L, t->getCount());
  468. return 1;
  469. }
  470. int w_ParticleSystem_start(lua_State *L)
  471. {
  472. ParticleSystem *t = luax_checkparticlesystem(L, 1);
  473. t->start();
  474. return 0;
  475. }
  476. int w_ParticleSystem_stop(lua_State *L)
  477. {
  478. ParticleSystem *t = luax_checkparticlesystem(L, 1);
  479. t->stop();
  480. return 0;
  481. }
  482. int w_ParticleSystem_pause(lua_State *L)
  483. {
  484. ParticleSystem *t = luax_checkparticlesystem(L, 1);
  485. t->pause();
  486. return 0;
  487. }
  488. int w_ParticleSystem_reset(lua_State *L)
  489. {
  490. ParticleSystem *t = luax_checkparticlesystem(L, 1);
  491. t->reset();
  492. return 0;
  493. }
  494. int w_ParticleSystem_emit(lua_State *L)
  495. {
  496. ParticleSystem *t = luax_checkparticlesystem(L, 1);
  497. int num = luaL_checkint(L, 2);
  498. t->emit(num);
  499. return 0;
  500. }
  501. int w_ParticleSystem_isActive(lua_State *L)
  502. {
  503. ParticleSystem *t = luax_checkparticlesystem(L, 1);
  504. luax_pushboolean(L, t->isActive());
  505. return 1;
  506. }
  507. int w_ParticleSystem_isPaused(lua_State *L)
  508. {
  509. ParticleSystem *t = luax_checkparticlesystem(L, 1);
  510. luax_pushboolean(L, t->isPaused());
  511. return 1;
  512. }
  513. int w_ParticleSystem_isStopped(lua_State *L)
  514. {
  515. ParticleSystem *t = luax_checkparticlesystem(L, 1);
  516. luax_pushboolean(L, t->isStopped());
  517. return 1;
  518. }
  519. int w_ParticleSystem_update(lua_State *L)
  520. {
  521. ParticleSystem *t = luax_checkparticlesystem(L, 1);
  522. float dt = (float)luaL_checknumber(L, 2);
  523. t->update(dt);
  524. return 0;
  525. }
  526. static const luaL_Reg functions[] =
  527. {
  528. { "setImage", w_ParticleSystem_setImage },
  529. { "getImage", w_ParticleSystem_getImage },
  530. { "setBufferSize", w_ParticleSystem_setBufferSize },
  531. { "getBufferSize", w_ParticleSystem_getBufferSize },
  532. { "setInsertMode", w_ParticleSystem_setInsertMode },
  533. { "getInsertMode", w_ParticleSystem_getInsertMode },
  534. { "setEmissionRate", w_ParticleSystem_setEmissionRate },
  535. { "getEmissionRate", w_ParticleSystem_getEmissionRate },
  536. { "setEmitterLifetime", w_ParticleSystem_setEmitterLifetime },
  537. { "getEmitterLifetime", w_ParticleSystem_getEmitterLifetime },
  538. { "setParticleLifetime", w_ParticleSystem_setParticleLifetime },
  539. { "getParticleLifetime", w_ParticleSystem_getParticleLifetime },
  540. { "setPosition", w_ParticleSystem_setPosition },
  541. { "getPosition", w_ParticleSystem_getPosition },
  542. { "setAreaSpread", w_ParticleSystem_setAreaSpread },
  543. { "getAreaSpread", w_ParticleSystem_getAreaSpread },
  544. { "setDirection", w_ParticleSystem_setDirection },
  545. { "getDirection", w_ParticleSystem_getDirection },
  546. { "setSpread", w_ParticleSystem_setSpread },
  547. { "getSpread", w_ParticleSystem_getSpread },
  548. { "setSpeed", w_ParticleSystem_setSpeed },
  549. { "getSpeed", w_ParticleSystem_getSpeed },
  550. { "setLinearAcceleration", w_ParticleSystem_setLinearAcceleration },
  551. { "getLinearAcceleration", w_ParticleSystem_getLinearAcceleration },
  552. { "setRadialAcceleration", w_ParticleSystem_setRadialAcceleration },
  553. { "getRadialAcceleration", w_ParticleSystem_getRadialAcceleration },
  554. { "setTangentialAcceleration", w_ParticleSystem_setTangentialAcceleration },
  555. { "getTangentialAcceleration", w_ParticleSystem_getTangentialAcceleration },
  556. { "setSizes", w_ParticleSystem_setSizes },
  557. { "getSizes", w_ParticleSystem_getSizes },
  558. { "setSizeVariation", w_ParticleSystem_setSizeVariation },
  559. { "getSizeVariation", w_ParticleSystem_getSizeVariation },
  560. { "setRotation", w_ParticleSystem_setRotation },
  561. { "getRotation", w_ParticleSystem_getRotation },
  562. { "setSpin", w_ParticleSystem_setSpin },
  563. { "getSpin", w_ParticleSystem_getSpin },
  564. { "setSpinVariation", w_ParticleSystem_setSpinVariation },
  565. { "getSpinVariation", w_ParticleSystem_getSpinVariation },
  566. { "setColors", w_ParticleSystem_setColors },
  567. { "getColors", w_ParticleSystem_getColors },
  568. { "setOffset", w_ParticleSystem_setOffset },
  569. { "getOffset", w_ParticleSystem_getOffset },
  570. { "getCount", w_ParticleSystem_getCount },
  571. { "start", w_ParticleSystem_start },
  572. { "stop", w_ParticleSystem_stop },
  573. { "pause", w_ParticleSystem_pause },
  574. { "reset", w_ParticleSystem_reset },
  575. { "emit", w_ParticleSystem_emit },
  576. { "isActive", w_ParticleSystem_isActive },
  577. { "isPaused", w_ParticleSystem_isPaused },
  578. { "isStopped", w_ParticleSystem_isStopped },
  579. { "update", w_ParticleSystem_update },
  580. { 0, 0 }
  581. };
  582. extern "C" int luaopen_particlesystem(lua_State *L)
  583. {
  584. return luax_register_type(L, "ParticleSystem", functions);
  585. }
  586. } // opengl
  587. } // graphics
  588. } // love