diff options
Diffstat (limited to 'src/lua/modules/graphics/je_lua_particle_system.cpp')
-rw-r--r-- | src/lua/modules/graphics/je_lua_particle_system.cpp | 62 |
1 files changed, 30 insertions, 32 deletions
diff --git a/src/lua/modules/graphics/je_lua_particle_system.cpp b/src/lua/modules/graphics/je_lua_particle_system.cpp index 05be4b7..0b348ad 100644 --- a/src/lua/modules/graphics/je_lua_particle_system.cpp +++ b/src/lua/modules/graphics/je_lua_particle_system.cpp @@ -19,12 +19,10 @@ namespace JinEngine const char* Jin_Lua_ParticleSystem = "ParticleSystem"; - typedef Shared<ParticleSystem>& SharedParticleSystem; - - LUA_IMPLEMENT inline SharedParticleSystem checkPS(lua_State* L) + LUA_IMPLEMENT inline ParticleSystem* checkPS(lua_State* L) { LuaObject* luaObj = luax_checkobject(L, 1, Jin_Lua_ParticleSystem); - return luaObj->getShared<ParticleSystem>(); + return luaObj->getObject<ParticleSystem>(); } LUA_IMPLEMENT int l_gc(lua_State* L) @@ -36,7 +34,7 @@ namespace JinEngine LUA_IMPLEMENT int l_update(lua_State* L) { - SharedParticleSystem ps = checkPS(L); + ParticleSystem* ps = checkPS(L); float dt = luax_checknumber(L, 2); ps->update(dt); return 0; @@ -44,14 +42,14 @@ namespace JinEngine LUA_IMPLEMENT int l_render(lua_State* L) { - SharedParticleSystem ps = checkPS(L); + ParticleSystem* ps = checkPS(L); ps->render(); return 0; } LUA_IMPLEMENT int l_setPosition(lua_State* L) { - SharedParticleSystem ps = checkPS(L); + ParticleSystem* ps = checkPS(L); float x = luax_checknumber(L, 2); float y = luax_checknumber(L, 3); ps->setPosition(x, y); @@ -60,7 +58,7 @@ namespace JinEngine LUA_IMPLEMENT int l_setScale(lua_State* L) { - SharedParticleSystem ps = checkPS(L); + ParticleSystem* ps = checkPS(L); float sx = luax_checknumber(L, 2); float sy = luax_checknumber(L, 3); //ps->setScale(sx, sy); @@ -69,7 +67,7 @@ namespace JinEngine LUA_IMPLEMENT int l_pause(lua_State* L) { - SharedParticleSystem ps = checkPS(L); + ParticleSystem* ps = checkPS(L); bool b = luax_checkbool(L, 2); //ps->pause(b); return 0; @@ -77,14 +75,14 @@ namespace JinEngine LUA_IMPLEMENT int l_clear(lua_State* L) { - SharedParticleSystem ps = checkPS(L); + ParticleSystem* ps = checkPS(L); //ps->clear(); return 0; } LUA_IMPLEMENT int l_setEmitRate(lua_State* L) { - SharedParticleSystem ps = checkPS(L); + ParticleSystem* ps = checkPS(L); if (luax_gettop(L) >= 3) { float floor = luax_checknumber(L, 2); @@ -101,7 +99,7 @@ namespace JinEngine LUA_IMPLEMENT int l_setEmitForce(lua_State* L) { - SharedParticleSystem ps = checkPS(L); + ParticleSystem* ps = checkPS(L); if (luax_gettop(L) >= 3) { float floor = luax_checknumber(L, 2); @@ -118,7 +116,7 @@ namespace JinEngine LUA_IMPLEMENT int l_setEmitDirection(lua_State* L) { - SharedParticleSystem ps = checkPS(L); + ParticleSystem* ps = checkPS(L); if (luax_gettop(L) >= 3) { float floor = luax_checknumber(L, 2); @@ -135,7 +133,7 @@ namespace JinEngine LUA_IMPLEMENT int l_setEmitPosition(lua_State* L) { - SharedParticleSystem ps = checkPS(L); + ParticleSystem* ps = checkPS(L); if (luax_gettop(L) >= 3) { if (!luax_istable(L, 2)) @@ -172,7 +170,7 @@ namespace JinEngine LUA_IMPLEMENT int l_setParticleLife(lua_State* L) { - SharedParticleSystem ps = checkPS(L); + ParticleSystem* ps = checkPS(L); if (luax_gettop(L) >= 3) { float floor = luax_checknumber(L, 2); @@ -189,7 +187,7 @@ namespace JinEngine LUA_IMPLEMENT int l_setParticleLinearAccelaration(lua_State* L) { - SharedParticleSystem ps = checkPS(L); + ParticleSystem* ps = checkPS(L); if (!luax_istable(L, 2)) { luax_typerror(L, 2, "table"); @@ -204,7 +202,7 @@ namespace JinEngine LUA_IMPLEMENT int l_setParticleRadialAccelaration(lua_State* L) { - SharedParticleSystem ps = checkPS(L); + ParticleSystem* ps = checkPS(L); float ra = luax_checknumber(L, 2); ps->setParticleRadialAccelaration(ra); return 0; @@ -212,7 +210,7 @@ namespace JinEngine LUA_IMPLEMENT int l_setParticleAngularSpeed(lua_State* L) { - SharedParticleSystem ps = checkPS(L); + ParticleSystem* ps = checkPS(L); if (luax_gettop(L) >= 3) { float floor = luax_checknumber(L, 2); @@ -229,7 +227,7 @@ namespace JinEngine LUA_IMPLEMENT int l_setParticleSpritesMode(lua_State* L) { - SharedParticleSystem ps = checkPS(L); + ParticleSystem* ps = checkPS(L); int n = luax_checkinteger(L, 2); SpriteMode mode = static_cast<SpriteMode>(n); ps->setParticleSpritesMode(mode); @@ -239,7 +237,7 @@ namespace JinEngine LUA_IMPLEMENT int l_addParticleSprite(lua_State* L) { LuaObject* obj = luax_checkobject(L, 1, Jin_Lua_ParticleSystem); - SharedParticleSystem ps = obj->getShared<ParticleSystem>(); + ParticleSystem* ps = obj->getObject<ParticleSystem>(); LuaObject* objSpr = luax_checkobject(L, 2, Jin_Lua_Sprite); Sprite* spr = objSpr->getObject<Sprite>(); ps->addParticleSprite(spr); @@ -251,7 +249,7 @@ namespace JinEngine LUA_IMPLEMENT int l_addParticleSprites(lua_State* L) { LuaObject* obj = luax_checkobject(L, 1, Jin_Lua_ParticleSystem); - SharedParticleSystem ps = obj->getShared<ParticleSystem>(); + ParticleSystem* ps = obj->getObject<ParticleSystem>(); if (!luax_istable(L, 2)) { luax_typerror(L, 2, "sprites table"); @@ -275,7 +273,7 @@ namespace JinEngine LUA_IMPLEMENT int l_removeParticleSprite(lua_State* L) { LuaObject* obj = luax_checkobject(L, 1, Jin_Lua_ParticleSystem); - SharedParticleSystem ps = obj->getShared<ParticleSystem>(); + ParticleSystem* ps = obj->getObject<ParticleSystem>(); int n = luax_checkinteger(L, 2); ps->removeParticleSprite(n); (*obj).removeDependency((int)ParticleSystemDependency::DEP_SPRITES + n); @@ -284,7 +282,7 @@ namespace JinEngine LUA_IMPLEMENT int l_enableParticleBlendAdditive(lua_State* L) { - SharedParticleSystem ps = checkPS(L); + ParticleSystem* ps = checkPS(L); bool enable = luax_checkbool(L, 2); ps->enableParticleBlendAdditive(enable); return 0; @@ -292,7 +290,7 @@ namespace JinEngine LUA_IMPLEMENT int l_setParticleScale(lua_State* L) { - SharedParticleSystem ps = checkPS(L); + ParticleSystem* ps = checkPS(L); float scale = luax_checknumber(L, 2); ps->setParticleScale(scale); return 0; @@ -300,7 +298,7 @@ namespace JinEngine LUA_IMPLEMENT int l_addParticleScalePoint(lua_State* L) { - SharedParticleSystem ps = checkPS(L); + ParticleSystem* ps = checkPS(L); float scale = luax_checknumber(L, 2); float t = luax_checknumber(L, 3); ps->addParticleScalePoint(scale, t); @@ -309,7 +307,7 @@ namespace JinEngine LUA_IMPLEMENT int l_removeParticleScalePoint(lua_State* L) { - SharedParticleSystem ps = checkPS(L); + ParticleSystem* ps = checkPS(L); int i = luax_checkinteger(L, 2); ps->removeParticleScalePoint(i); return 0; @@ -317,7 +315,7 @@ namespace JinEngine LUA_IMPLEMENT int l_setParticleColor(lua_State* L) { - SharedParticleSystem ps = checkPS(L); + ParticleSystem* ps = checkPS(L); if (!luax_istable(L, 2)) { luax_typerror(L, 2, "color table"); @@ -334,7 +332,7 @@ namespace JinEngine LUA_IMPLEMENT int l_addParticleColorPoint(lua_State* L) { - SharedParticleSystem ps = checkPS(L); + ParticleSystem* ps = checkPS(L); if (!luax_istable(L, 2)) { luax_typerror(L, 2, "color table"); @@ -352,7 +350,7 @@ namespace JinEngine LUA_IMPLEMENT int l_removeParticleColorPoint(lua_State* L) { - SharedParticleSystem ps = checkPS(L); + ParticleSystem* ps = checkPS(L); int i = luax_checkinteger(L, 2); ps->removeParticleColorPoint(i); return 0; @@ -360,7 +358,7 @@ namespace JinEngine LUA_IMPLEMENT int l_setParticleTransparency(lua_State* L) { - SharedParticleSystem ps = checkPS(L); + ParticleSystem* ps = checkPS(L); float transparency = luax_checknumber(L, 2); ps->setParticleTransparency(transparency); return 0; @@ -368,7 +366,7 @@ namespace JinEngine LUA_IMPLEMENT int l_addParticleTransparencyPoint(lua_State* L) { - SharedParticleSystem ps = checkPS(L); + ParticleSystem* ps = checkPS(L); float transparency = luax_checknumber(L, 2); float t = luax_checknumber(L, 3); ps->addParticleTransparencyPoint(transparency, t); @@ -377,7 +375,7 @@ namespace JinEngine LUA_IMPLEMENT int l_removeParticleTransparencyPoint(lua_State* L) { - SharedParticleSystem ps = checkPS(L); + ParticleSystem* ps = checkPS(L); int i = luax_checkinteger(L, 2); ps->removeParticleTransparencyPoint(i); return 0; |