From 85d456d30810347257a33d9443d4ad158d6d5fb1 Mon Sep 17 00:00:00 2001 From: chai Date: Tue, 4 Dec 2018 14:15:29 +0800 Subject: =?UTF-8?q?*=E6=A0=BC=E5=BC=8F=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lua/modules/graphics/je_lua_animation.cpp | 8 ++++---- src/lua/modules/graphics/je_lua_graphics.cpp | 18 +++++++++--------- src/lua/modules/graphics/je_lua_spritesheet.cpp | 22 +++++++++++----------- src/lua/modules/graphics/je_lua_texture_font.cpp | 6 +++--- src/lua/modules/graphics/je_lua_ttf.cpp | 10 +++++----- src/lua/modules/graphics/je_lua_ttf_data.cpp | 4 ++-- 6 files changed, 34 insertions(+), 34 deletions(-) (limited to 'src') diff --git a/src/lua/modules/graphics/je_lua_animation.cpp b/src/lua/modules/graphics/je_lua_animation.cpp index 4cb513c..bdba10d 100644 --- a/src/lua/modules/graphics/je_lua_animation.cpp +++ b/src/lua/modules/graphics/je_lua_animation.cpp @@ -40,8 +40,8 @@ namespace JinEngine { LuaObject* luaObj = (LuaObject*)luax_checktype(L, 1, Jin_Lua_Animation); SharedAnimation shrAnimation = luaObj->getShared(); - LuaObject* pxySprite = (LuaObject*)luax_checktype(L, 2, Jin_Lua_Sprite); - Shared& shrSprite = pxySprite->getShared(); + LuaObject* luaSprite = (LuaObject*)luax_checktype(L, 2, Jin_Lua_Sprite); + Shared& shrSprite = luaSprite->getShared(); shrAnimation->addFrame(shrSprite.getObject()); int i = shrAnimation->getFrameCount() - 1; luaObj->setDependency((int)AnimationDependency::DEP_SPRITES + i, &shrSprite); @@ -62,8 +62,8 @@ namespace JinEngine for (int i = 1; i <= n; ++i) { luax_rawgeti(L, 2, i); - LuaObject* pxySprite = (LuaObject*)luax_checktype(L, -1, Jin_Lua_Sprite); - Shared& shrSprite = pxySprite->getShared(); + LuaObject* luaSprite = (LuaObject*)luax_checktype(L, -1, Jin_Lua_Sprite); + Shared& shrSprite = luaSprite->getShared(); shrAnimation->addFrame(shrSprite.getObject()); int index = shrAnimation->getFrameCount() - 1; luaObj->setDependency((int)AnimationDependency::DEP_SPRITES + index, &shrSprite); diff --git a/src/lua/modules/graphics/je_lua_graphics.cpp b/src/lua/modules/graphics/je_lua_graphics.cpp index 34ef8e7..867547d 100644 --- a/src/lua/modules/graphics/je_lua_graphics.cpp +++ b/src/lua/modules/graphics/je_lua_graphics.cpp @@ -388,8 +388,8 @@ namespace JinEngine { if (!luax_istype(L, 1, Jin_Lua_Sprite)) return; - LuaObject* pxySprite = (LuaObject*)luax_toudata(L, 1); - Sprite* sprite = pxySprite->getObject(); + LuaObject* luaSprite = (LuaObject*)luax_toudata(L, 1); + Sprite* sprite = luaSprite->getObject(); float x = luax_checknumber(L, 2); float y = luax_checknumber(L, 3); float sx = luax_checknumber(L, 4); @@ -809,8 +809,8 @@ namespace JinEngine for (int i = 1; i <= n; ++i) { luax_rawgeti(L, 1, i); - LuaObject* pxySprite = (LuaObject*)luax_checktype(L, -1, Jin_Lua_Sprite); - Shared& shrSprite = pxySprite->getShared(); + LuaObject* luaSprite = (LuaObject*)luax_checktype(L, -1, Jin_Lua_Sprite); + Shared& shrSprite = luaSprite->getShared(); (*shrAnimation)->addFrame(shrSprite.getObject()); int index = (*shrAnimation)->getFrameCount() - 1; luaAnimation->setDependency((int)AnimationDependency::DEP_SPRITES + index, &shrSprite); @@ -829,14 +829,14 @@ namespace JinEngine Shared* shrAniamtor = new Shared(new Animator(), Jin_Lua_Animator); if (argc >= 1) { - LuaObject* pxyAnimation = (LuaObject*)luax_checktype(L, 1, Jin_Lua_Animation); - Shared& shrAnimtion = pxyAnimation->getShared(); + LuaObject* luaAnimation = (LuaObject*)luax_checktype(L, 1, Jin_Lua_Animation); + Shared& shrAnimtion = luaAnimation->getShared(); (*shrAniamtor)->setAnimation(shrAnimtion.getObject()); - LuaObject* pxyAnimator = luax_newinstance(L, Jin_Lua_Animator, shrAniamtor); - pxyAnimator->setDependency((int)AnimatorDependency::DEP_ANIMATION, &shrAnimtion); + LuaObject* luaAnimator = luax_newinstance(L, Jin_Lua_Animator, shrAniamtor); + luaAnimator->setDependency((int)AnimatorDependency::DEP_ANIMATION, &shrAnimtion); return 1; } - LuaObject* pxyAnimator = luax_newinstance(L, Jin_Lua_Animator, shrAniamtor); + LuaObject* luaAnimator = luax_newinstance(L, Jin_Lua_Animator, shrAniamtor); return 1; } diff --git a/src/lua/modules/graphics/je_lua_spritesheet.cpp b/src/lua/modules/graphics/je_lua_spritesheet.cpp index 8e336c3..23b655e 100644 --- a/src/lua/modules/graphics/je_lua_spritesheet.cpp +++ b/src/lua/modules/graphics/je_lua_spritesheet.cpp @@ -19,16 +19,16 @@ namespace JinEngine LUA_IMPLEMENT int l_gc(lua_State* L) { - LuaObject* pxySSheet = (LuaObject*)luax_checktype(L, 1, Jin_Lua_SpriteSheet); - pxySSheet->release(); + LuaObject* luaSSheet = (LuaObject*)luax_checktype(L, 1, Jin_Lua_SpriteSheet); + luaSSheet->release(); return 0; } LUA_IMPLEMENT int l_newSprite(lua_State* L) { - LuaObject* pxySSheet = (LuaObject*)luax_checktype(L, 1, Jin_Lua_SpriteSheet); - Shared& shrSSheet = pxySSheet->getShared(); - SpriteSheet* sheet = pxySSheet->getObject(); + LuaObject* luaSSheet = (LuaObject*)luax_checktype(L, 1, Jin_Lua_SpriteSheet); + Shared& shrSSheet = luaSSheet->getShared(); + SpriteSheet* sheet = luaSSheet->getObject(); Quad quad; quad.x = luax_rawgetnumberthenpop(L, 2, 1); quad.y = luax_rawgetnumberthenpop(L, 2, 2); @@ -49,17 +49,17 @@ namespace JinEngine spr = sheet->createSprite(quad, origin); } Shared* shrSprite = new Shared(spr, Jin_Lua_Sprite); - LuaObject* pxySprite = luax_newinstance(L, Jin_Lua_Sprite, shrSprite); - pxySprite->setDependency((int)SpriteDependency::DEP_SPRITESHEET, &shrSSheet); + LuaObject* luaSprite = luax_newinstance(L, Jin_Lua_Sprite, shrSprite); + luaSprite->setDependency((int)SpriteDependency::DEP_SPRITESHEET, &shrSSheet); return 1; } // {} = newSprites LUA_IMPLEMENT int l_newSprites(lua_State* L) { - LuaObject* pxySS = (LuaObject*)luax_checktype(L, 1, Jin_Lua_SpriteSheet); - Shared& shrSS = pxySS->getShared(); - SpriteSheet* ss = pxySS->getObject(); + LuaObject* luaSS = (LuaObject*)luax_checktype(L, 1, Jin_Lua_SpriteSheet); + Shared& shrSS = luaSS->getShared(); + SpriteSheet* ss = luaSS->getObject(); int count = luax_checkinteger(L, 2); int r = luax_checkinteger(L, 3); int c = luax_checkinteger(L, 4); @@ -93,7 +93,7 @@ namespace JinEngine return 1; } luax_newtable(L); - SharedBase* shrGraphic = pxySS->getDependency((int)SpriteSheetDependency::DEP_GRAPHIC); + SharedBase* shrGraphic = luaSS->getDependency((int)SpriteSheetDependency::DEP_GRAPHIC); for (int i = 0; i < sprs.size(); ++i) { Sprite* spr = sprs[i]; diff --git a/src/lua/modules/graphics/je_lua_texture_font.cpp b/src/lua/modules/graphics/je_lua_texture_font.cpp index afabf18..8a3eca0 100644 --- a/src/lua/modules/graphics/je_lua_texture_font.cpp +++ b/src/lua/modules/graphics/je_lua_texture_font.cpp @@ -25,9 +25,9 @@ namespace JinEngine /* typeset(Text | string, lineheight, spacing) */ LUA_IMPLEMENT int l_typeset(lua_State* L) { - LuaObject* pxyTexFont = (LuaObject*)luax_checktype(L, 1, Jin_Lua_TextureFont); - Shared& shrTexFont = pxyTexFont->getShared(); - TextureFont* tf = pxyTexFont->getObject(); + LuaObject* luaTexFont = (LuaObject*)luax_checktype(L, 1, Jin_Lua_TextureFont); + Shared& shrTexFont = luaTexFont->getShared(); + TextureFont* tf = luaTexFont->getObject(); int lineheight = luax_checkinteger(L, 3); int spacing = luax_optnumber(L, 4, 0); Page* page = nullptr; diff --git a/src/lua/modules/graphics/je_lua_ttf.cpp b/src/lua/modules/graphics/je_lua_ttf.cpp index 875c132..317670c 100644 --- a/src/lua/modules/graphics/je_lua_ttf.cpp +++ b/src/lua/modules/graphics/je_lua_ttf.cpp @@ -25,9 +25,9 @@ namespace JinEngine /* typeset(Text | string, lineheight, spacing) */ LUA_IMPLEMENT int l_typeset(lua_State* L) { - LuaObject* pxyTTF = (LuaObject*)luax_checktype(L, 1, Jin_Lua_TTF); - Shared& shrTTF = pxyTTF->getShared(); - TTF* ttf = pxyTTF->getObject(); + LuaObject* luaTTF = (LuaObject*)luax_checktype(L, 1, Jin_Lua_TTF); + Shared& shrTTF = luaTTF->getShared(); + TTF* ttf = luaTTF->getObject(); int lineheight = luax_optnumber(L, 3, ttf->getFontSize()); int spacing = luax_optnumber(L, 4, 0); Page* page = nullptr; @@ -40,8 +40,8 @@ namespace JinEngine } else if (luax_istype(L, 2, Jin_Lua_Text)) { - LuaObject* pxyText = (LuaObject*)luax_checktype(L, 2, Jin_Lua_Text); - Text* text = pxyText->getObject(); + LuaObject* luaText = (LuaObject*)luax_checktype(L, 2, Jin_Lua_Text); + Text* text = luaText->getObject(); page = ttf->typeset(*text, lineheight, spacing); } Shared* refPage = new Shared(page, Jin_Lua_Page); diff --git a/src/lua/modules/graphics/je_lua_ttf_data.cpp b/src/lua/modules/graphics/je_lua_ttf_data.cpp index a4e8d2c..9f4437e 100644 --- a/src/lua/modules/graphics/je_lua_ttf_data.cpp +++ b/src/lua/modules/graphics/je_lua_ttf_data.cpp @@ -17,9 +17,9 @@ namespace JinEngine LUA_IMPLEMENT int l_newTTF(lua_State* L) { - LuaObject* pxyTTFData = (LuaObject*)luax_checktype(L, 1, Jin_Lua_TTFData); + LuaObject* luaTTFData = (LuaObject*)luax_checktype(L, 1, Jin_Lua_TTFData); int fontsize = luax_checkinteger(L, 2); - Shared& shrFontData = pxyTTFData->getShared(); + Shared& shrFontData = luaTTFData->getShared(); TTFData* fontData = shrFontData.getObject(); TTF* font = fontData->createTTF(fontsize); Shared* shrTTF = new Shared(font, Jin_Lua_TTF); -- cgit v1.1-26-g67d0