diff options
Diffstat (limited to 'src')
30 files changed, 173 insertions, 173 deletions
diff --git a/src/lua/common/je_lua.cpp b/src/lua/common/je_lua.cpp index 020599d..a56ae4f 100644 --- a/src/lua/common/je_lua.cpp +++ b/src/lua/common/je_lua.cpp @@ -15,17 +15,17 @@ namespace JinEngine static const char* Jin_Lua_Reference_Table = "Jin_Reference_Table"; - Proxy* luax_newinstance(lua_State* L, const char* type, SharedBase* shared) + LuaObject* luax_newinstance(lua_State* L, const char* type, SharedBase* shared) { - Proxy* proxy = static_cast<Proxy*>(luax_newinstance(L, type, sizeof(Proxy))); - if (shared) proxy->bind(shared); + LuaObject* luaObj = static_cast<LuaObject*>(luax_newinstance(L, type, sizeof(LuaObject))); + if (shared) luaObj->bind(shared); luax_getobjectstable(L); - // Add to objects_table, like objects_table[shared] = proxy + // Add to objects_table, like objects_table[shared] = luaObj luax_pushlightuserdata(L, shared); luax_pushvalue(L, -3); luax_settable(L, -3); luax_pop(L, 1); // Pop objects table. - return proxy; + return luaObj; } int luax_getobject(lua_State* L, SharedBase* shared) diff --git a/src/lua/common/je_lua.h b/src/lua/common/je_lua.h index 1396970..b73ac3d 100644 --- a/src/lua/common/je_lua.h +++ b/src/lua/common/je_lua.h @@ -7,7 +7,7 @@ #include "luax/luax.h" #include "je_lua_shared.hpp" -#include "je_lua_proxy.h" +#include "je_lua_object.h" #include "je_lua_reference.h" namespace JinEngine @@ -20,7 +20,7 @@ namespace JinEngine /// /// /// - Proxy* luax_newinstance(lua_State* L, const char* type, SharedBase* shared); + LuaObject* luax_newinstance(lua_State* L, const char* type, SharedBase* shared); /// /// Access lua object by object pointer. diff --git a/src/lua/common/je_lua_proxy.cpp b/src/lua/common/je_lua_object.cpp index b892e67..ce71283 100644 --- a/src/lua/common/je_lua_proxy.cpp +++ b/src/lua/common/je_lua_object.cpp @@ -1,12 +1,12 @@ #include "je_lua.h" -#include "je_lua_proxy.h" +#include "je_lua_object.h" namespace JinEngine { namespace Lua { - void Proxy::bind(SharedBase* s) + void LuaObject::bind(SharedBase* s) { if (s == nullptr) return; @@ -14,7 +14,7 @@ namespace JinEngine shared->retain(); } - void Proxy::release() + void LuaObject::release() { if (shared != nullptr) { @@ -23,7 +23,7 @@ namespace JinEngine } } - const char* Proxy::getObjectType() + const char* LuaObject::getObjectType() { return shared->getType(); } diff --git a/src/lua/common/je_lua_proxy.h b/src/lua/common/je_lua_object.h index 517e209..bd3ddd6 100644 --- a/src/lua/common/je_lua_proxy.h +++ b/src/lua/common/je_lua_object.h @@ -10,7 +10,7 @@ namespace JinEngine namespace Lua { - class Proxy + class LuaObject { public: /// diff --git a/src/lua/modules/audio/je_lua_audio.cpp b/src/lua/modules/audio/je_lua_audio.cpp index 57500eb..4366cd1 100644 --- a/src/lua/modules/audio/je_lua_audio.cpp +++ b/src/lua/modules/audio/je_lua_audio.cpp @@ -97,7 +97,7 @@ namespace JinEngine luax_pushnil(L); return 1; } - Proxy* proxy = luax_newinstance(L, Jin_Lua_Source, new Shared<Source>(L, src, Jin_Lua_Source)); + LuaObject* luaObj = luax_newinstance(L, Jin_Lua_Source, new Shared<Source>(L, src, Jin_Lua_Source)); return 1; } diff --git a/src/lua/modules/audio/je_lua_source.cpp b/src/lua/modules/audio/je_lua_source.cpp index 0e7b09e..f115721 100644 --- a/src/lua/modules/audio/je_lua_source.cpp +++ b/src/lua/modules/audio/je_lua_source.cpp @@ -15,8 +15,8 @@ namespace JinEngine LUA_IMPLEMENT inline SharedSource checkSource(lua_State* L) { - Proxy* proxy = (Proxy*)luax_checktype(L, 1, Jin_Lua_Source); - return proxy->getShared<Source>(); + LuaObject* luaObj = (LuaObject*)luax_checktype(L, 1, Jin_Lua_Source); + return luaObj->getShared<Source>(); } LUA_IMPLEMENT int l_play(lua_State* L) @@ -88,8 +88,8 @@ namespace JinEngine LUA_IMPLEMENT int l_gc(lua_State* L) { - Proxy* proxy = (Proxy*)luax_checktype(L, 1, Jin_Lua_Source); - proxy->release(); + LuaObject* luaObj = (LuaObject*)luax_checktype(L, 1, Jin_Lua_Source); + luaObj->release(); return 0; } diff --git a/src/lua/modules/graphics/je_lua_animation.cpp b/src/lua/modules/graphics/je_lua_animation.cpp index d2c806a..32e2c9c 100644 --- a/src/lua/modules/graphics/je_lua_animation.cpp +++ b/src/lua/modules/graphics/je_lua_animation.cpp @@ -1,6 +1,6 @@ #include "libjin/jin.h" -#include "common/je_lua_proxy.h" +#include "common/je_lua_object.h" #include "common/je_lua_common.h" #include "je_lua_sprite.h" @@ -24,13 +24,13 @@ namespace JinEngine LUA_IMPLEMENT inline SharedAnimation checkAnimation(lua_State* L) { - Proxy* proxy = (Proxy*)luax_checktype(L, 1, Jin_Lua_Animation); - return proxy->getShared<Animation>(); + LuaObject* luaObj = (LuaObject*)luax_checktype(L, 1, Jin_Lua_Animation); + return luaObj->getShared<Animation>(); } LUA_IMPLEMENT int l_gc(lua_State* L) { - Proxy* p = (Proxy*)luax_checktype(L, 1, Jin_Lua_Animation); + LuaObject* p = (LuaObject*)luax_checktype(L, 1, Jin_Lua_Animation); p->release(); return 0; } @@ -39,7 +39,7 @@ namespace JinEngine LUA_IMPLEMENT int l_addFrame(lua_State* L) { SharedAnimation shrAnimation = checkAnimation(L); - Proxy* pxySprite = (Proxy*)luax_checktype(L, 2, Jin_Lua_Sprite); + LuaObject* pxySprite = (LuaObject*)luax_checktype(L, 2, Jin_Lua_Sprite); Shared<Sprite>& shrSprite = pxySprite->getShared<Sprite>(); shrAnimation->addFrame(shrSprite.getObject()); int i = shrAnimation->getFrameCount() - 1; @@ -60,7 +60,7 @@ namespace JinEngine for (int i = 1; i <= n; ++i) { luax_rawgeti(L, 2, i); - Proxy* pxySprite = (Proxy*)luax_checktype(L, -1, Jin_Lua_Sprite); + LuaObject* pxySprite = (LuaObject*)luax_checktype(L, -1, Jin_Lua_Sprite); Shared<Sprite>& shrSprite = pxySprite->getShared<Sprite>(); shrAnimation->addFrame(shrSprite.getObject()); int index = shrAnimation->getFrameCount() - 1; diff --git a/src/lua/modules/graphics/je_lua_animator.cpp b/src/lua/modules/graphics/je_lua_animator.cpp index 843204d..43a1f50 100644 --- a/src/lua/modules/graphics/je_lua_animator.cpp +++ b/src/lua/modules/graphics/je_lua_animator.cpp @@ -1,4 +1,4 @@ -#include "common/je_lua_proxy.h" +#include "common/je_lua_object.h" #include "common/je_lua_common.h" #include "libjin/jin.h" @@ -24,13 +24,13 @@ namespace JinEngine LUA_IMPLEMENT inline SharedAnimator checkAnimator(lua_State* L) { - Proxy* proxy = (Proxy*)luax_checktype(L, 1, Jin_Lua_Animator); - return proxy->getShared<Animator>(); + LuaObject* luaObj = (LuaObject*)luax_checktype(L, 1, Jin_Lua_Animator); + return luaObj->getShared<Animator>(); } LUA_IMPLEMENT int l_gc(lua_State* L) { - Proxy* p = (Proxy*)luax_checktype(L, 1, Jin_Lua_Animation); + LuaObject* p = (LuaObject*)luax_checktype(L, 1, Jin_Lua_Animation); p->release(); return 0; } @@ -86,8 +86,8 @@ namespace JinEngine LUA_IMPLEMENT int l_setAnimation(lua_State* L) { SharedAnimator shrAnimator = checkAnimator(L); - Proxy* proxy = (Proxy*)luax_checktype(L, 1, Jin_Lua_Animation); - Shared<Animation>& shrAnimation = proxy->getShared<Animation>(); + LuaObject* luaObj = (LuaObject*)luax_checktype(L, 1, Jin_Lua_Animation); + Shared<Animation>& shrAnimation = luaObj->getShared<Animation>(); shrAnimator.setDependency((int)AnimatorDependency::DEP_ANIMATION, &shrAnimation); shrAnimator->setAnimation(shrAnimation.getObject()); return 0; diff --git a/src/lua/modules/graphics/je_lua_bitmap.cpp b/src/lua/modules/graphics/je_lua_bitmap.cpp index 056ed70..9b71e9b 100644 --- a/src/lua/modules/graphics/je_lua_bitmap.cpp +++ b/src/lua/modules/graphics/je_lua_bitmap.cpp @@ -1,5 +1,5 @@ #include "common/je_lua_common.h" -#include "common/je_lua_proxy.h" +#include "common/je_lua_object.h" #include "libjin/jin.h" #include "je_lua_bitmap.h" @@ -17,8 +17,8 @@ namespace JinEngine LUA_IMPLEMENT inline SharedBitmap checkBitmap(lua_State* L) { - Proxy* proxy = (Proxy*)luax_checktype(L, 1, Jin_Lua_Bitmap); - return proxy->getShared<Bitmap>(); + LuaObject* luaObj = (LuaObject*)luax_checktype(L, 1, Jin_Lua_Bitmap); + return luaObj->getShared<Bitmap>(); } LUA_IMPLEMENT int l_gc(lua_State* L) @@ -90,7 +90,7 @@ namespace JinEngine SharedBitmap shared = checkBitmap(L); Bitmap* bitmap = shared.getObject(); Bitmap* b = Bitmap::clone(bitmap); - Proxy* proxy = luax_newinstance(L, Jin_Lua_Bitmap, new Shared<Bitmap>(L, b, Jin_Lua_Bitmap)); + LuaObject* luaObj = luax_newinstance(L, Jin_Lua_Bitmap, new Shared<Bitmap>(L, b, Jin_Lua_Bitmap)); return 1; } diff --git a/src/lua/modules/graphics/je_lua_canvas.cpp b/src/lua/modules/graphics/je_lua_canvas.cpp index 80ee155..261f940 100644 --- a/src/lua/modules/graphics/je_lua_canvas.cpp +++ b/src/lua/modules/graphics/je_lua_canvas.cpp @@ -1,4 +1,4 @@ -#include "common/je_lua_proxy.h" +#include "common/je_lua_object.h" #include "common/je_lua_common.h" #include "libjin/jin.h" #include "je_lua_canvas.h" @@ -16,8 +16,8 @@ namespace JinEngine LUA_IMPLEMENT inline SharedCanvas checkCanvas(lua_State* L) { - Proxy* proxy = (Proxy*)luax_checktype(L, 1, Jin_Lua_Canvas); - return proxy->getShared<Canvas>(); + LuaObject* luaObj = (LuaObject*)luax_checktype(L, 1, Jin_Lua_Canvas); + return luaObj->getShared<Canvas>(); } LUA_IMPLEMENT int l_getWidth(lua_State* L) @@ -44,8 +44,8 @@ namespace JinEngine LUA_IMPLEMENT int l_gc(lua_State* L) { - Proxy* proxy = (Proxy*)luax_checktype(L, 1, Jin_Lua_Canvas); - proxy->release(); + LuaObject* luaObj = (LuaObject*)luax_checktype(L, 1, Jin_Lua_Canvas); + luaObj->release(); return 0; } diff --git a/src/lua/modules/graphics/je_lua_graphics.cpp b/src/lua/modules/graphics/je_lua_graphics.cpp index d2f663d..907d90e 100644 --- a/src/lua/modules/graphics/je_lua_graphics.cpp +++ b/src/lua/modules/graphics/je_lua_graphics.cpp @@ -2,7 +2,7 @@ #include <fstream> #include "libjin/jin.h" -#include "common/je_lua_proxy.h" +#include "common/je_lua_object.h" #include "common/je_lua_common.h" #include "je_lua_canvas.h" @@ -207,7 +207,7 @@ namespace JinEngine return 1; } } - Proxy* proxy = luax_newinstance(L, Jin_Lua_Bitmap, new Shared<Bitmap>(L, bitmap, Jin_Lua_Bitmap)); + LuaObject* luaObj = luax_newinstance(L, Jin_Lua_Bitmap, new Shared<Bitmap>(L, bitmap, Jin_Lua_Bitmap)); return 1; } @@ -217,7 +217,7 @@ namespace JinEngine Texture* texture = nullptr; if (luax_istype(L, 1, Jin_Lua_Bitmap)) { - Proxy* p = (Proxy*)luax_checktype(L, 1, Jin_Lua_Bitmap); + LuaObject* p = (LuaObject*)luax_checktype(L, 1, Jin_Lua_Bitmap); Shared<Bitmap>& refBitmap = p->getShared<Bitmap>(); Bitmap* bitmap = refBitmap.getObject(); texture = Texture::createTexture(bitmap); @@ -227,7 +227,7 @@ namespace JinEngine const char* path = luax_checkstring(L, 1); texture = Texture::createTexture(path); } - Proxy* proxy = luax_newinstance(L, Jin_Lua_Texture, new Shared<Texture>(L, texture, Jin_Lua_Texture)); + LuaObject* luaObj = luax_newinstance(L, Jin_Lua_Texture, new Shared<Texture>(L, texture, Jin_Lua_Texture)); return 1; } @@ -241,7 +241,7 @@ namespace JinEngine luax_pushnil(L); return 1; } - Proxy* proxy = luax_newinstance(L, Jin_Lua_Shader, new Shared<Shader>(L, jsl, Jin_Lua_Shader)); + LuaObject* luaObj = luax_newinstance(L, Jin_Lua_Shader, new Shared<Shader>(L, jsl, Jin_Lua_Shader)); return 1; } @@ -264,7 +264,7 @@ namespace JinEngine luax_pushnil(L); return 1; } - Proxy* proxy = luax_newinstance(L, Jin_Lua_Shader, new Shared<Shader>(L, jsl, Jin_Lua_Shader)); + LuaObject* luaObj = luax_newinstance(L, Jin_Lua_Shader, new Shared<Shader>(L, jsl, Jin_Lua_Shader)); return 1; } @@ -273,7 +273,7 @@ namespace JinEngine int w = luax_checknumber(L, 1); int h = luax_checknumber(L, 2); Canvas* cvs = Canvas::createCanvas(w, h); - Proxy* proxy = luax_newinstance(L, Jin_Lua_Canvas, new Shared<Canvas>(L, cvs, Jin_Lua_Canvas)); + LuaObject* luaObj = luax_newinstance(L, Jin_Lua_Canvas, new Shared<Canvas>(L, cvs, Jin_Lua_Canvas)); return 1; } @@ -320,8 +320,8 @@ namespace JinEngine float r = luax_optnumber(L, 6, 0); float ox = luax_optnumber(L, 7, 0); float oy = luax_optnumber(L, 8, 0); - Proxy* proxy = (Proxy*)luax_toudata(L, 1); - Shared<Texture>& tex = proxy->getShared<Texture>(); + LuaObject* luaObj = (LuaObject*)luax_toudata(L, 1); + Shared<Texture>& tex = luaObj->getShared<Texture>(); tex->render(x, y, sx, sy, r, ox, oy); } @@ -336,8 +336,8 @@ namespace JinEngine float r = luax_optnumber(L, 6, 0); float ox = luax_optnumber(L, 7, 0); float oy = luax_optnumber(L, 8, 0); - Proxy* proxy = (Proxy*)luax_toudata(L, 1); - Shared<Canvas>& p = proxy->getShared<Canvas>(); + LuaObject* luaObj = (LuaObject*)luax_toudata(L, 1); + Shared<Canvas>& p = luaObj->getShared<Canvas>(); p->render(x, y, sx, sy, r, ox, oy); } @@ -346,13 +346,13 @@ namespace JinEngine { if (!luax_istype(L, 1, Jin_Lua_Text)) return; - Proxy* p = (Proxy*)luax_toudata(L, 1); + LuaObject* p = (LuaObject*)luax_toudata(L, 1); Text* text = p->getObject<Text>(); int x = luax_optnumber(L, 3, 0); int y = luax_optnumber(L, 4, 0); int spacing = luax_optnumber(L, 6, 0); Font* font = nullptr; - Proxy* p2 = (Proxy*)luax_toudata(L, 2); + LuaObject* p2 = (LuaObject*)luax_toudata(L, 2); if (luax_istype(L, 2, Jin_Lua_TextureFont)) { TextureFont* tf = p2->getObject<TextureFont>(); @@ -378,7 +378,7 @@ namespace JinEngine return; int x = luax_optnumber(L, 2, 0); int y = luax_optnumber(L, 3, 0); - Proxy* p = (Proxy*)luax_toudata(L, 1); + LuaObject* p = (LuaObject*)luax_toudata(L, 1); Page* page = p->getObject<Page>(); Font* font = page->font; font->render(page, x, y); @@ -388,7 +388,7 @@ namespace JinEngine { if (!luax_istype(L, 1, Jin_Lua_Sprite)) return; - Proxy* pxySprite = (Proxy*)luax_toudata(L, 1); + LuaObject* pxySprite = (LuaObject*)luax_toudata(L, 1); Sprite* sprite = pxySprite->getObject<Sprite>(); float x = luax_checknumber(L, 2); float y = luax_checknumber(L, 3); @@ -442,14 +442,14 @@ namespace JinEngine if (luax_istype(L, 1, Jin_Lua_Texture)) { - Proxy* proxy = (Proxy*)luax_toudata(L, 1); - Shared<Texture>& tex = proxy->getShared<Texture>(); + LuaObject* luaObj = (LuaObject*)luax_toudata(L, 1); + Shared<Texture>& tex = luaObj->getShared<Texture>(); tex->render(q, x, y, sx, sy, r, ox, oy); } else if (luax_istype(L, 1, Jin_Lua_Canvas)) { - Proxy* proxy = (Proxy*)luax_toudata(L, 1); - Shared<Canvas>& p = proxy->getShared<Canvas>(); + LuaObject* luaObj = (LuaObject*)luax_toudata(L, 1); + Shared<Canvas>& p = luaObj->getShared<Canvas>(); p->render(q, x, y, sx, sy, r, ox, oy); } else @@ -512,8 +512,8 @@ namespace JinEngine Canvas::unbind(); return 0; } - Proxy* proxy = (Proxy*)luax_checktype(L, 1, Jin_Lua_Canvas); - Shared<Canvas>& shared = proxy->getShared<Canvas>(); + LuaObject* luaObj = (LuaObject*)luax_checktype(L, 1, Jin_Lua_Canvas); + Shared<Canvas>& shared = luaObj->getShared<Canvas>(); Canvas::bind(shared.getObject()); return 0; } @@ -533,8 +533,8 @@ namespace JinEngine } if (luax_istype(L, 1, Jin_Lua_Shader)) { - Proxy* proxy = (Proxy*)luax_checktype(L, 1, Jin_Lua_Shader); - Shared<Shader>& jsl = proxy->getShared<Shader>(); + LuaObject* luaObj = (LuaObject*)luax_checktype(L, 1, Jin_Lua_Shader); + Shared<Shader>& jsl = luaObj->getShared<Shader>(); jsl->use(); } else @@ -684,7 +684,7 @@ namespace JinEngine fs->read(path, b); fd = TTFData::createTTFData(&b, b.size()); } - Proxy* proxy = luax_newinstance(L, Jin_Lua_TTFData, new Shared<TTFData>(L, fd, Jin_Lua_TTFData)); + LuaObject* luaObj = luax_newinstance(L, Jin_Lua_TTFData, new Shared<TTFData>(L, fd, Jin_Lua_TTFData)); return 1; } @@ -707,7 +707,7 @@ namespace JinEngine unsigned length; const char* data = luax_checklstring(L, 1, &length); Text* text = new Text(encode, data, length); - Proxy* proxy = luax_newinstance(L, Jin_Lua_Text, new Shared<Text>(L, text, Jin_Lua_Text)); + LuaObject* luaObj = luax_newinstance(L, Jin_Lua_Text, new Shared<Text>(L, text, Jin_Lua_Text)); return 1; } @@ -718,11 +718,11 @@ namespace JinEngine LUA_IMPLEMENT int l_newSprite(lua_State* L) { int n = luax_gettop(L); - Proxy* pxyGraphic = nullptr; + LuaObject* pxyGraphic = nullptr; if (luax_istype(L, 1, Jin_Lua_Texture)) - pxyGraphic = (Proxy*)luax_checktype(L, 1, Jin_Lua_Texture); + pxyGraphic = (LuaObject*)luax_checktype(L, 1, Jin_Lua_Texture); else if (luax_istype(L, 1, Jin_Lua_Canvas)) - pxyGraphic = (Proxy*)luax_checktype(L, 1, Jin_Lua_Canvas); + pxyGraphic = (LuaObject*)luax_checktype(L, 1, Jin_Lua_Canvas); Graphic* graphic = pxyGraphic->getObject<Graphic>(); if (pxyGraphic != nullptr) { @@ -735,7 +735,7 @@ namespace JinEngine quad.h = luax_rawgetnumberthenpop(L, 2, 4); int o = luax_checkinteger(L, 3); Origin origin = static_cast<Origin>(o); - Proxy* p = luax_newinstance(L, Jin_Lua_Sprite, new Shared<Sprite>(L, new Sprite(graphic, quad, origin), Jin_Lua_Sprite)); + LuaObject* p = luax_newinstance(L, Jin_Lua_Sprite, new Shared<Sprite>(L, new Sprite(graphic, quad, origin), Jin_Lua_Sprite)); } else if (n == 4) { @@ -746,19 +746,19 @@ namespace JinEngine quad.h = luax_rawgetnumberthenpop(L, 2, 4); int ox = luax_checkinteger(L, 3); int oy = luax_checkinteger(L, 4); - Proxy* p = luax_newinstance(L, Jin_Lua_Sprite, new Shared<Sprite>(L, new Sprite(graphic, quad, ox, oy), Jin_Lua_Sprite)); + LuaObject* p = luax_newinstance(L, Jin_Lua_Sprite, new Shared<Sprite>(L, new Sprite(graphic, quad, ox, oy), Jin_Lua_Sprite)); } else if (n == 2) { int o = luax_checkinteger(L, 2); Origin origin = static_cast<Origin>(o); - Proxy* p = luax_newinstance(L, Jin_Lua_Sprite, new Shared<Sprite>(L, new Sprite(graphic, origin), Jin_Lua_Sprite)); + LuaObject* p = luax_newinstance(L, Jin_Lua_Sprite, new Shared<Sprite>(L, new Sprite(graphic, origin), Jin_Lua_Sprite)); } else if (n == 3) { int ox = luax_checkinteger(L, 2); int oy = luax_checkinteger(L, 3); - Proxy* p = luax_newinstance(L, Jin_Lua_Sprite, new Shared<Sprite>(L, new Sprite(graphic, ox, oy), Jin_Lua_Sprite)); + LuaObject* p = luax_newinstance(L, Jin_Lua_Sprite, new Shared<Sprite>(L, new Sprite(graphic, ox, oy), Jin_Lua_Sprite)); } else { @@ -772,18 +772,18 @@ namespace JinEngine LUA_IMPLEMENT int l_newSpriteSheet(lua_State* L) { - Proxy* pxyGraphic = nullptr; + LuaObject* pxyGraphic = nullptr; if (luax_istype(L, 1, Jin_Lua_Texture)) - pxyGraphic = (Proxy*)luax_checktype(L, 1, Jin_Lua_Texture); + pxyGraphic = (LuaObject*)luax_checktype(L, 1, Jin_Lua_Texture); else if(luax_istype(L, 1, Jin_Lua_Canvas)) - pxyGraphic = (Proxy*)luax_checktype(L, 1, Jin_Lua_Canvas); + pxyGraphic = (LuaObject*)luax_checktype(L, 1, Jin_Lua_Canvas); if (pxyGraphic != nullptr) { Graphic* graphic = pxyGraphic->getObject<Graphic>(); Shared<SpriteSheet>* shrSSheet = new Shared<SpriteSheet>(L, new SpriteSheet(graphic), Jin_Lua_SpriteSheet); Shared<Graphic>& shrGraphic = pxyGraphic->getShared<Graphic>(); shrSSheet->setDependency((int)SpriteSheetDependency::DEP_GRAPHIC, &shrGraphic); - Proxy* pxySSheet = luax_newinstance(L, Jin_Lua_SpriteSheet, shrSSheet); + LuaObject* pxySSheet = luax_newinstance(L, Jin_Lua_SpriteSheet, shrSSheet); return 1; } else @@ -808,7 +808,7 @@ namespace JinEngine for (int i = 1; i <= n; ++i) { luax_rawgeti(L, 1, i); - Proxy* pxySprite = (Proxy*)luax_checktype(L, -1, Jin_Lua_Sprite); + LuaObject* pxySprite = (LuaObject*)luax_checktype(L, -1, Jin_Lua_Sprite); Shared<Sprite>& shrSprite = pxySprite->getShared<Sprite>(); (*shrAnimation)->addFrame(shrSprite.getObject()); int index = (*shrAnimation)->getFrameCount() - 1; @@ -817,7 +817,7 @@ namespace JinEngine (*shrAnimation)->setLoop(loop); (*shrAnimation)->setSpeed(speed); } - Proxy* pxyAnimation = luax_newinstance(L, Jin_Lua_Animation, shrAnimation); + LuaObject* pxyAnimation = luax_newinstance(L, Jin_Lua_Animation, shrAnimation); return 1; } @@ -828,24 +828,24 @@ namespace JinEngine Shared<Animator>* shrAniamtor = new Shared<Animator>(L, new Animator(), Jin_Lua_Animator); if (argc >= 1) { - Proxy* pxyAnimation = (Proxy*)luax_checktype(L, 1, Jin_Lua_Animation); + LuaObject* pxyAnimation = (LuaObject*)luax_checktype(L, 1, Jin_Lua_Animation); Shared<Animation>& shrAnimtion = pxyAnimation->getShared<Animation>(); (*shrAniamtor)->setAnimation(shrAnimtion.getObject()); (*shrAniamtor).setDependency((int)AnimatorDependency::DEP_ANIMATION, &shrAnimtion); } - Proxy* pxyAnimator = luax_newinstance(L, Jin_Lua_Animator, shrAniamtor); + LuaObject* pxyAnimator = luax_newinstance(L, Jin_Lua_Animator, shrAniamtor); return 1; } /* newTextureFont(bitmap, text, color | cellw, cellh) */ LUA_IMPLEMENT int l_newTextureFont(lua_State* L) { - Proxy* p = (Proxy*)luax_checktype(L, 1, Jin_Lua_Bitmap); + LuaObject* p = (LuaObject*)luax_checktype(L, 1, Jin_Lua_Bitmap); Bitmap* bitmap = p->getObject<Bitmap>(); Text* text; if (luax_istype(L, 2, Jin_Lua_Text)) { - Proxy* pt = (Proxy*)luax_checktype(L, 2, Jin_Lua_Text); + LuaObject* pt = (LuaObject*)luax_checktype(L, 2, Jin_Lua_Text); text = pt->getObject<Text>(); } else if (luax_isstring(L, 2)) @@ -884,7 +884,7 @@ namespace JinEngine // Delete temporary text. delete text; } - Proxy* proxy = luax_newinstance(L, Jin_Lua_TextureFont, new Shared<TextureFont>(L, textureFont, Jin_Lua_TextureFont)); + LuaObject* luaObj = luax_newinstance(L, Jin_Lua_TextureFont, new Shared<TextureFont>(L, textureFont, Jin_Lua_TextureFont)); return 1; } @@ -904,13 +904,13 @@ namespace JinEngine { if (luax_istype(L, 1, Jin_Lua_TTF)) { - Proxy* p = (Proxy*)luax_checktype(L, 1, Jin_Lua_TTF); + LuaObject* p = (LuaObject*)luax_checktype(L, 1, Jin_Lua_TTF); TTF* ttf = p->getObject<TTF>(); context.curFont = ttf; } else if (luax_istype(L, 1, Jin_Lua_TextureFont)) { - Proxy* p = (Proxy*)luax_checktype(L, 1, Jin_Lua_TextureFont); + LuaObject* p = (LuaObject*)luax_checktype(L, 1, Jin_Lua_TextureFont); TextureFont* tf = p->getObject<TextureFont>(); context.curFont = tf; } diff --git a/src/lua/modules/graphics/je_lua_page.cpp b/src/lua/modules/graphics/je_lua_page.cpp index c119991..6234f3f 100644 --- a/src/lua/modules/graphics/je_lua_page.cpp +++ b/src/lua/modules/graphics/je_lua_page.cpp @@ -1,4 +1,4 @@ -#include "common/je_lua_proxy.h" +#include "common/je_lua_object.h" #include "common/je_lua_common.h" #include "libjin/jin.h" @@ -19,14 +19,14 @@ namespace JinEngine Page* getPage(lua_State* L) { - Proxy* proxy = (Proxy*)luax_checktype(L, 1, Jin_Lua_Page); - return proxy->getObject<Page>(); + LuaObject* luaObj = (LuaObject*)luax_checktype(L, 1, Jin_Lua_Page); + return luaObj->getObject<Page>(); } LUA_IMPLEMENT int l_gc(lua_State* L) { - Proxy* proxy = (Proxy*)luax_checktype(L, 1, Jin_Lua_Page); - proxy->release(); + LuaObject* luaObj = (LuaObject*)luax_checktype(L, 1, Jin_Lua_Page); + luaObj->release(); return 0; } diff --git a/src/lua/modules/graphics/je_lua_shader.cpp b/src/lua/modules/graphics/je_lua_shader.cpp index ca4d6f6..8bef1bf 100644 --- a/src/lua/modules/graphics/je_lua_shader.cpp +++ b/src/lua/modules/graphics/je_lua_shader.cpp @@ -1,4 +1,4 @@ -#include "common/je_lua_proxy.h" +#include "common/je_lua_object.h" #include "common/je_lua_common.h" #include "libjin/jin.h" @@ -20,8 +20,8 @@ namespace JinEngine static inline ShaderRef checkShader(lua_State* L) { - Proxy* proxy = (Proxy*)luax_checktype(L, 1, Jin_Lua_Shader); - return proxy->getShared<Shader>(); + LuaObject* luaObj = (LuaObject*)luax_checktype(L, 1, Jin_Lua_Shader); + return luaObj->getShared<Shader>(); } /** @@ -40,8 +40,8 @@ namespace JinEngine { ShaderRef shared = checkShader(L); const char* variable = luax_checkstring(L, 2); - Proxy* proxy = (Proxy*)luax_checktype(L, 3, Jin_Lua_Texture); - Shared<Texture>& tex = proxy->getShared<Texture>(); + LuaObject* luaObj = (LuaObject*)luax_checktype(L, 3, Jin_Lua_Texture); + Shared<Texture>& tex = luaObj->getShared<Texture>(); shared->sendTexture(variable, tex.getObject()); return 0; } @@ -50,8 +50,8 @@ namespace JinEngine { ShaderRef shared = checkShader(L); const char* variable = luax_checkstring(L, 2); - Proxy* proxy = (Proxy*)luax_checktype(L, 3, Jin_Lua_Canvas); - Shared<Canvas>& canvas = proxy->getShared<Canvas>(); + LuaObject* luaObj = (LuaObject*)luax_checktype(L, 3, Jin_Lua_Canvas); + Shared<Canvas>& canvas = luaObj->getShared<Canvas>(); shared->sendCanvas(variable, canvas.getObject()); return 0; } @@ -111,8 +111,8 @@ namespace JinEngine LUA_IMPLEMENT int l_gc(lua_State* L) { - Proxy* proxy = (Proxy*)luax_checktype(L, 1, Jin_Lua_Shader); - proxy->release(); + LuaObject* luaObj = (LuaObject*)luax_checktype(L, 1, Jin_Lua_Shader); + luaObj->release(); return 0; } diff --git a/src/lua/modules/graphics/je_lua_sprite.cpp b/src/lua/modules/graphics/je_lua_sprite.cpp index 018a43d..f9f8b5d 100644 --- a/src/lua/modules/graphics/je_lua_sprite.cpp +++ b/src/lua/modules/graphics/je_lua_sprite.cpp @@ -1,4 +1,4 @@ -#include "common/je_lua_proxy.h" +#include "common/je_lua_object.h" #include "common/je_lua_common.h" #include "libjin/jin.h" @@ -21,13 +21,13 @@ namespace JinEngine LUA_IMPLEMENT inline SharedSprite checkSprite(lua_State* L) { - Proxy* proxy = (Proxy*)luax_checktype(L, 1, Jin_Lua_Sprite); - return proxy->getShared<Sprite>(); + LuaObject* luaObj = (LuaObject*)luax_checktype(L, 1, Jin_Lua_Sprite); + return luaObj->getShared<Sprite>(); } LUA_IMPLEMENT int l_gc(lua_State* L) { - Proxy* p = (Proxy*)luax_checktype(L, 1, Jin_Lua_Sprite); + LuaObject* p = (LuaObject*)luax_checktype(L, 1, Jin_Lua_Sprite); p->release(); return 0; } diff --git a/src/lua/modules/graphics/je_lua_spritesheet.cpp b/src/lua/modules/graphics/je_lua_spritesheet.cpp index 3c92cbc..a2f3c04 100644 --- a/src/lua/modules/graphics/je_lua_spritesheet.cpp +++ b/src/lua/modules/graphics/je_lua_spritesheet.cpp @@ -1,6 +1,6 @@ #include <vector> -#include "common/je_lua_proxy.h" +#include "common/je_lua_object.h" #include "common/je_lua_common.h" #include "libjin/jin.h" #include "je_lua_sprite.h" @@ -19,14 +19,14 @@ namespace JinEngine LUA_IMPLEMENT int l_gc(lua_State* L) { - Proxy* pxySSheet = (Proxy*)luax_checktype(L, 1, Jin_Lua_SpriteSheet); + LuaObject* pxySSheet = (LuaObject*)luax_checktype(L, 1, Jin_Lua_SpriteSheet); pxySSheet->release(); return 0; } LUA_IMPLEMENT int l_newSprite(lua_State* L) { - Proxy* pxySSheet = (Proxy*)luax_checktype(L, 1, Jin_Lua_SpriteSheet); + LuaObject* pxySSheet = (LuaObject*)luax_checktype(L, 1, Jin_Lua_SpriteSheet); Shared<SpriteSheet>& shrSSheet = pxySSheet->getShared<SpriteSheet>(); SpriteSheet* sheet = pxySSheet->getObject<SpriteSheet>(); Quad quad; @@ -50,14 +50,14 @@ namespace JinEngine } Shared<Sprite>* shrSprite = new Shared<Sprite>(L, spr, Jin_Lua_Sprite); shrSprite->setDependency((int)SpriteDependency::DEP_SPRITESHEET, &shrSSheet); - Proxy* pxySprite = luax_newinstance(L, Jin_Lua_Sprite, shrSprite); + LuaObject* pxySprite = luax_newinstance(L, Jin_Lua_Sprite, shrSprite); return 1; } // {} = newSprites LUA_IMPLEMENT int l_newSprites(lua_State* L) { - Proxy* pxySS = (Proxy*)luax_checktype(L, 1, Jin_Lua_SpriteSheet); + LuaObject* pxySS = (LuaObject*)luax_checktype(L, 1, Jin_Lua_SpriteSheet); Shared<SpriteSheet>& shrSS = pxySS->getShared<SpriteSheet>(); SpriteSheet* ss = pxySS->getObject<SpriteSheet>(); int count = luax_checkinteger(L, 2); @@ -99,7 +99,7 @@ namespace JinEngine Sprite* spr = sprs[i]; Shared<Sprite>* shrSpr = new Shared<Sprite>(L, spr, Jin_Lua_Sprite); shrSpr->setDependency((int)SpriteDependency::DEP_GRAPHIC, shrGraphic); - Proxy* pxys = (Proxy*)luax_newinstance(L, Jin_Lua_Sprite, shrSpr); + LuaObject* pxys = (LuaObject*)luax_newinstance(L, Jin_Lua_Sprite, shrSpr); luax_rawseti(L, -2, i + 1); } return 1; diff --git a/src/lua/modules/graphics/je_lua_text.cpp b/src/lua/modules/graphics/je_lua_text.cpp index adeed35..eb23879 100644 --- a/src/lua/modules/graphics/je_lua_text.cpp +++ b/src/lua/modules/graphics/je_lua_text.cpp @@ -1,4 +1,4 @@ -#include "common/je_lua_proxy.h" +#include "common/je_lua_object.h" #include "common/je_lua_common.h" #include "libjin/jin.h" @@ -13,7 +13,7 @@ namespace JinEngine LUA_IMPLEMENT int l_gc(lua_State* L) { - Proxy* p = (Proxy*)luax_checktype(L, 1, Jin_Lua_Text); + LuaObject* p = (LuaObject*)luax_checktype(L, 1, Jin_Lua_Text); p->release(); return 0; } diff --git a/src/lua/modules/graphics/je_lua_texture.cpp b/src/lua/modules/graphics/je_lua_texture.cpp index a8676f1..9d2d567 100644 --- a/src/lua/modules/graphics/je_lua_texture.cpp +++ b/src/lua/modules/graphics/je_lua_texture.cpp @@ -1,4 +1,4 @@ -#include "common/je_lua_proxy.h" +#include "common/je_lua_object.h" #include "common/je_lua_common.h" #include "libjin/jin.h" #include "je_lua_texture.h" @@ -16,8 +16,8 @@ namespace JinEngine LUA_IMPLEMENT inline SharedTexture checkTexture(lua_State* L) { - Proxy* proxy = (Proxy*)luax_checktype(L, 1, Jin_Lua_Texture); - return proxy->getShared<Texture>(); + LuaObject* luaObj = (LuaObject*)luax_checktype(L, 1, Jin_Lua_Texture); + return luaObj->getShared<Texture>(); } LUA_IMPLEMENT int l_getWidth(lua_State* L) @@ -44,8 +44,8 @@ namespace JinEngine LUA_IMPLEMENT int l_gc(lua_State* L) { - Proxy* proxy = (Proxy*)luax_checktype(L, 1, Jin_Lua_Texture); - proxy->release(); + LuaObject* luaObj = (LuaObject*)luax_checktype(L, 1, Jin_Lua_Texture); + luaObj->release(); return 0; } diff --git a/src/lua/modules/graphics/je_lua_texture_font.cpp b/src/lua/modules/graphics/je_lua_texture_font.cpp index 58677eb..eee134c 100644 --- a/src/lua/modules/graphics/je_lua_texture_font.cpp +++ b/src/lua/modules/graphics/je_lua_texture_font.cpp @@ -1,4 +1,4 @@ -#include "common/je_lua_proxy.h" +#include "common/je_lua_object.h" #include "common/je_lua_common.h" #include "libjin/jin.h" @@ -17,15 +17,15 @@ namespace JinEngine LUA_IMPLEMENT int l_gc(lua_State* L) { - Proxy* proxy = (Proxy*)luax_checktype(L, 1, Jin_Lua_TextureFont); - proxy->release(); + LuaObject* luaObj = (LuaObject*)luax_checktype(L, 1, Jin_Lua_TextureFont); + luaObj->release(); return 0; } /* typeset(Text | string, lineheight, spacing) */ LUA_IMPLEMENT int l_typeset(lua_State* L) { - Proxy* pxyTexFont = (Proxy*)luax_checktype(L, 1, Jin_Lua_TextureFont); + LuaObject* pxyTexFont = (LuaObject*)luax_checktype(L, 1, Jin_Lua_TextureFont); Shared<TextureFont>& shrTexFont = pxyTexFont->getShared<TextureFont>(); TextureFont* tf = pxyTexFont->getObject<TextureFont>(); int lineheight = luax_checkinteger(L, 3); @@ -40,13 +40,13 @@ namespace JinEngine } else if (luax_istype(L, 2, Jin_Lua_Text)) { - Proxy* p2 = (Proxy*)luax_checktype(L, 2, Jin_Lua_Text); + LuaObject* p2 = (LuaObject*)luax_checktype(L, 2, Jin_Lua_Text); Text* text = p2->getObject<Text>(); page = tf->typeset(*text, lineheight, spacing); } Shared<Page>* shrPage = new Shared<Page>(L, page, Jin_Lua_Page); shrPage->setDependency((int)PageDependency::DEP_TEXTURE_FONT, &shrTexFont); - Proxy* pxyPage = luax_newinstance(L, Jin_Lua_Page, shrPage); + LuaObject* pxyPage = luax_newinstance(L, Jin_Lua_Page, shrPage); return 1; } diff --git a/src/lua/modules/graphics/je_lua_ttf.cpp b/src/lua/modules/graphics/je_lua_ttf.cpp index c3d9aae..df0379e 100644 --- a/src/lua/modules/graphics/je_lua_ttf.cpp +++ b/src/lua/modules/graphics/je_lua_ttf.cpp @@ -1,4 +1,4 @@ -#include "common/je_lua_proxy.h" +#include "common/je_lua_object.h" #include "common/je_lua_common.h" #include "libjin/jin.h" @@ -17,15 +17,15 @@ namespace JinEngine LUA_IMPLEMENT int l_gc(lua_State* L) { - Proxy* proxy = (Proxy*)luax_checktype(L, 1, Jin_Lua_TTF); - proxy->release(); + LuaObject* luaObj = (LuaObject*)luax_checktype(L, 1, Jin_Lua_TTF); + luaObj->release(); return 0; } /* typeset(Text | string, lineheight, spacing) */ LUA_IMPLEMENT int l_typeset(lua_State* L) { - Proxy* pxyTTF = (Proxy*)luax_checktype(L, 1, Jin_Lua_TTF); + LuaObject* pxyTTF = (LuaObject*)luax_checktype(L, 1, Jin_Lua_TTF); Shared<TTF>& shrTTF = pxyTTF->getShared<TTF>(); TTF* ttf = pxyTTF->getObject<TTF>(); int lineheight = luax_optnumber(L, 3, ttf->getFontSize()); @@ -40,13 +40,13 @@ namespace JinEngine } else if (luax_istype(L, 2, Jin_Lua_Text)) { - Proxy* pxyText = (Proxy*)luax_checktype(L, 2, Jin_Lua_Text); + LuaObject* pxyText = (LuaObject*)luax_checktype(L, 2, Jin_Lua_Text); Text* text = pxyText->getObject<Text>(); page = ttf->typeset(*text, lineheight, spacing); } Shared<Page>* refPage = new Shared<Page>(L, page, Jin_Lua_Page); refPage->setDependency((int)PageDependency::DEP_TTF, &shrTTF); - Proxy* pxyPage = luax_newinstance(L, Jin_Lua_Page, refPage); + LuaObject* pxyPage = luax_newinstance(L, Jin_Lua_Page, refPage); return 1; } diff --git a/src/lua/modules/graphics/je_lua_ttf_data.cpp b/src/lua/modules/graphics/je_lua_ttf_data.cpp index 7fcadcd..207dde2 100644 --- a/src/lua/modules/graphics/je_lua_ttf_data.cpp +++ b/src/lua/modules/graphics/je_lua_ttf_data.cpp @@ -1,4 +1,4 @@ -#include "common/je_lua_proxy.h" +#include "common/je_lua_object.h" #include "common/je_lua_common.h" #include "libjin/jin.h" @@ -17,20 +17,20 @@ namespace JinEngine LUA_IMPLEMENT int l_newTTF(lua_State* L) { - Proxy* pxyTTFData = (Proxy*)luax_checktype(L, 1, Jin_Lua_TTFData); + LuaObject* pxyTTFData = (LuaObject*)luax_checktype(L, 1, Jin_Lua_TTFData); int fontsize = luax_checkinteger(L, 2); Shared<TTFData>& shrFontData = pxyTTFData->getShared<TTFData>(); TTFData* fontData = shrFontData.getObject(); TTF* font = fontData->createTTF(fontsize); Shared<TTF>* shrTTF = new Shared<TTF>(L, font, Jin_Lua_TTF); shrTTF->setDependency((int)TTFDependency::DEP_TTFDATA, &shrFontData); - Proxy* pxyTTF = luax_newinstance(L, Jin_Lua_TTF, shrTTF); + LuaObject* pxyTTF = luax_newinstance(L, Jin_Lua_TTF, shrTTF); return 1; } LUA_IMPLEMENT int l_gc(lua_State* L) { - Proxy* p = (Proxy*)luax_checktype(L, 1, Jin_Lua_TTFData); + LuaObject* p = (LuaObject*)luax_checktype(L, 1, Jin_Lua_TTFData); p->release(); return 0; } diff --git a/src/lua/modules/joypad/je_lua_joypad.cpp b/src/lua/modules/joypad/je_lua_joypad.cpp index 1261183..a3623ae 100644 --- a/src/lua/modules/joypad/je_lua_joypad.cpp +++ b/src/lua/modules/joypad/je_lua_joypad.cpp @@ -1,4 +1,4 @@ -#include "common/je_lua_proxy.h" +#include "common/je_lua_object.h" #include "common/je_lua_common.h" #include "libjin/jin.h" diff --git a/src/lua/modules/keyboard/je_lua_keyboard.cpp b/src/lua/modules/keyboard/je_lua_keyboard.cpp index 899fe9c..93a62bd 100644 --- a/src/lua/modules/keyboard/je_lua_keyboard.cpp +++ b/src/lua/modules/keyboard/je_lua_keyboard.cpp @@ -1,5 +1,5 @@ #include "common/je_lua_common.h" -#include "common/je_lua_proxy.h" +#include "common/je_lua_object.h" namespace JinEngine { diff --git a/src/lua/modules/math/je_lua_math.cpp b/src/lua/modules/math/je_lua_math.cpp index d12ccfa..5b320ff 100644 --- a/src/lua/modules/math/je_lua_math.cpp +++ b/src/lua/modules/math/je_lua_math.cpp @@ -1,5 +1,5 @@ #include "common/je_lua_common.h" -#include "common/je_lua_proxy.h" +#include "common/je_lua_object.h" #include "libjin/jin.h" namespace JinEngine diff --git a/src/lua/modules/mouse/je_lua_mouse.cpp b/src/lua/modules/mouse/je_lua_mouse.cpp index 44d72a2..222f596 100644 --- a/src/lua/modules/mouse/je_lua_mouse.cpp +++ b/src/lua/modules/mouse/je_lua_mouse.cpp @@ -1,5 +1,5 @@ #include "common/je_lua_common.h" -#include "common/je_lua_proxy.h" +#include "common/je_lua_object.h" #include "libjin/jin.h" using namespace JinEngine::Input; diff --git a/src/lua/modules/net/je_lua_buffer.cpp b/src/lua/modules/net/je_lua_buffer.cpp index 5442e14..327e7ed 100644 --- a/src/lua/modules/net/je_lua_buffer.cpp +++ b/src/lua/modules/net/je_lua_buffer.cpp @@ -1,4 +1,4 @@ -#include "common/je_lua_proxy.h" +#include "common/je_lua_object.h" #include "common/je_lua_common.h" #include "libjin/jin.h" #include "je_lua_buffer.h" @@ -14,8 +14,8 @@ namespace JinEngine static inline SharedBuffer checkNetBuffer(lua_State* L) { - Proxy* proxy = (Proxy*)luax_checktype(L, 1, Jin_Lua_Buffer); - return proxy->getShared<Net::Buffer>(); + LuaObject* luaObj = (LuaObject*)luax_checktype(L, 1, Jin_Lua_Buffer); + return luaObj->getShared<Net::Buffer>(); } // net.Buffer:append(value) -> value_length @@ -112,8 +112,8 @@ namespace JinEngine LUA_IMPLEMENT int l_gc(lua_State* L) { - Proxy* proxy = (Proxy*)luax_checktype(L, 1, Jin_Lua_Buffer); - proxy->release(); + LuaObject* luaObj = (LuaObject*)luax_checktype(L, 1, Jin_Lua_Buffer); + luaObj->release(); return 0; } diff --git a/src/lua/modules/net/je_lua_net.cpp b/src/lua/modules/net/je_lua_net.cpp index 058b4e8..bbafa3f 100644 --- a/src/lua/modules/net/je_lua_net.cpp +++ b/src/lua/modules/net/je_lua_net.cpp @@ -1,4 +1,4 @@ -#include "common/je_lua_proxy.h" +#include "common/je_lua_object.h" #include "libjin/jin.h" #include "common/je_lua_common.h" @@ -49,7 +49,7 @@ namespace Lua } } Socket* socket = new Socket(info); - Proxy* proxy = luax_newinstance(L, Jin_Lua_Socket, new Shared<Socket>(L, socket, Jin_Lua_Socket)); + LuaObject* luaObj = luax_newinstance(L, Jin_Lua_Socket, new Shared<Socket>(L, socket, Jin_Lua_Socket)); return 1; } @@ -57,7 +57,7 @@ namespace Lua { int size = luax_checkinteger(L, 1); Net::Buffer* buffer = new Net::Buffer(size); - Proxy* proxy = luax_newinstance(L, Jin_Lua_Buffer, new Shared<Buffer>(L, buffer, Jin_Lua_Buffer)); + LuaObject* luaObj = luax_newinstance(L, Jin_Lua_Buffer, new Shared<Buffer>(L, buffer, Jin_Lua_Buffer)); return 1; } diff --git a/src/lua/modules/net/je_lua_socket.cpp b/src/lua/modules/net/je_lua_socket.cpp index 899c70a..e6c2d79 100644 --- a/src/lua/modules/net/je_lua_socket.cpp +++ b/src/lua/modules/net/je_lua_socket.cpp @@ -1,4 +1,4 @@ -#include "common/je_lua_proxy.h" +#include "common/je_lua_object.h" #include "common/je_lua_common.h" #include "libjin/jin.h" #include "je_lua_buffer.h" @@ -19,14 +19,14 @@ namespace JinEngine LUA_IMPLEMENT inline SharedSocket checkSocket(lua_State* L, int pos = 1) { - Proxy* proxy = (Proxy*)luax_checktype(L, pos, Jin_Lua_Socket); - return proxy->getShared<Socket>(); + LuaObject* luaObj = (LuaObject*)luax_checktype(L, pos, Jin_Lua_Socket); + return luaObj->getShared<Socket>(); } LUA_IMPLEMENT inline Shared<Buffer>& checkNetBuffer(lua_State* L, int pos = 1) { - Proxy* proxy = (Proxy*)luax_checktype(L, pos, Jin_Lua_Buffer); - return proxy->getShared<Buffer>(); + LuaObject* luaObj = (LuaObject*)luax_checktype(L, pos, Jin_Lua_Buffer); + return luaObj->getShared<Buffer>(); } // return net.Socket @@ -34,7 +34,7 @@ namespace JinEngine { SharedSocket socket = checkSocket(L); Socket* client = socket->accept(); - Proxy* proxy = luax_newinstance(L, Jin_Lua_Socket, new Shared<Socket>(L, client, Jin_Lua_Socket)); + LuaObject* luaObj = luax_newinstance(L, Jin_Lua_Socket, new Shared<Socket>(L, client, Jin_Lua_Socket)); return 1; } @@ -45,7 +45,7 @@ namespace JinEngine char buffer[BUFFER_SIZE] = {0}; int size = socket->receive(buffer, BUFFER_SIZE); Net::Buffer* netBuffer = new Net::Buffer(buffer, size); - Proxy* proxy = luax_newinstance(L, Jin_Lua_Buffer, new Shared<Buffer>(L, netBuffer, Jin_Lua_Buffer)); + LuaObject* luaObj = luax_newinstance(L, Jin_Lua_Buffer, new Shared<Buffer>(L, netBuffer, Jin_Lua_Buffer)); return 1; } @@ -58,7 +58,7 @@ namespace JinEngine char buffer[BUFFER_SIZE]; int size = socket->receiveFrom(buffer, BUFFER_SIZE, address, port); Net::Buffer* netBuffer = new Net::Buffer(buffer, size); - Proxy* proxy = luax_newinstance(L, Jin_Lua_Buffer, new Shared<Buffer>(L, netBuffer, Jin_Lua_Buffer)); + LuaObject* luaObj = luax_newinstance(L, Jin_Lua_Buffer, new Shared<Buffer>(L, netBuffer, Jin_Lua_Buffer)); return 1; } @@ -100,8 +100,8 @@ namespace JinEngine LUA_IMPLEMENT int l_gc(lua_State* L) { - Proxy* proxy = (Proxy*)luax_checktype(L, 1, Jin_Lua_Socket); - proxy->release(); + LuaObject* luaObj = (LuaObject*)luax_checktype(L, 1, Jin_Lua_Socket); + luaObj->release(); return 0; } diff --git a/src/lua/modules/thread/je_lua_thread.cpp b/src/lua/modules/thread/je_lua_thread.cpp index a31a037..9d5713e 100644 --- a/src/lua/modules/thread/je_lua_thread.cpp +++ b/src/lua/modules/thread/je_lua_thread.cpp @@ -1,4 +1,4 @@ -#include "common/je_lua_proxy.h" +#include "common/je_lua_object.h" #include "libjin/jin.h" #include "lua/jin.h" @@ -18,8 +18,8 @@ namespace JinEngine static inline SharedThread checkThread(lua_State* L) { - Proxy* proxy = (Proxy*)luax_checktype(L, 1, Jin_Lua_Thread); - return proxy->getShared<Thread>(); + LuaObject* luaObj = (LuaObject*)luax_checktype(L, 1, Jin_Lua_Thread); + return luaObj->getShared<Thread>(); } LUA_IMPLEMENT int threadRunner(void* t) @@ -29,7 +29,7 @@ namespace JinEngine luax_openlibs(L); open(L); luax_getglobal(L, MODULE_NAME); - Proxy* proxy = luax_newinstance(L, Jin_Lua_Thread, &shared); + LuaObject* luaObj = luax_newinstance(L, Jin_Lua_Thread, &shared); luax_setfield(L, -2, "_curThread"); luax_dostring(L, shared->code.c_str()); luax_close(L); @@ -38,8 +38,8 @@ namespace JinEngine LUA_IMPLEMENT int l_thread_gc(lua_State* L) { - Proxy* proxy = (Proxy*)luax_checktype(L, 1, Jin_Lua_Thread); - proxy->release(); + LuaObject* luaObj = (LuaObject*)luax_checktype(L, 1, Jin_Lua_Thread); + luaObj->release(); return 0; } @@ -124,8 +124,8 @@ namespace JinEngine break; case Thread::Variant::POINTER: - Proxy* p = (Proxy*)v.pointer; - Proxy* proxy = luax_newinstance(L, p->getObjectType(), p->getSharedBase()); + LuaObject* p = (LuaObject*)v.pointer; + LuaObject* luaObj = luax_newinstance(L, p->getObjectType(), p->getSharedBase()); break; } @@ -156,9 +156,9 @@ namespace JinEngine break; case Thread::Variant::POINTER: - Proxy* p = (Proxy*)v.pointer; + LuaObject* p = (LuaObject*)v.pointer; const char* objType = p->getObjectType(); - Proxy* proxy = luax_newinstance(L, objType, p->getSharedBase()); + LuaObject* luaObj = luax_newinstance(L, objType, p->getSharedBase()); break; } @@ -215,7 +215,7 @@ namespace JinEngine const char* name = luax_checkstring(L, 1); const char* code = luax_checkstring(L, 2); Thread* thread = new Thread(name, code, threadRunner); - Proxy* proxy = luax_newinstance(L, Jin_Lua_Thread, new Shared<Thread>(L, thread, Jin_Lua_Thread)); + LuaObject* luaObj = luax_newinstance(L, Jin_Lua_Thread, new Shared<Thread>(L, thread, Jin_Lua_Thread)); return 1; } diff --git a/src/lua/modules/time/je_lua_time.cpp b/src/lua/modules/time/je_lua_time.cpp index 54ab798..6dc6cb5 100644 --- a/src/lua/modules/time/je_lua_time.cpp +++ b/src/lua/modules/time/je_lua_time.cpp @@ -1,6 +1,6 @@ #include "SDL2/SDL.h" #include "common/je_lua_common.h" -#include "common/je_lua_proxy.h" +#include "common/je_lua_object.h" #include "libjin/jin.h" #include "je_lua_timer.h" diff --git a/src/lua/modules/time/je_lua_timer.cpp b/src/lua/modules/time/je_lua_timer.cpp index 570e537..608665b 100644 --- a/src/lua/modules/time/je_lua_timer.cpp +++ b/src/lua/modules/time/je_lua_timer.cpp @@ -29,8 +29,8 @@ namespace JinEngine LUA_IMPLEMENT inline SharedTimer checkTimer(lua_State* L) { - Proxy* proxy = (Proxy*)luax_checktype(L, 1, Jin_Lua_Timer); - return proxy->getShared<Timer>(); + LuaObject* luaObj = (LuaObject*)luax_checktype(L, 1, Jin_Lua_Timer); + return luaObj->getShared<Timer>(); } // timer:every(time, callback, parameter) @@ -45,7 +45,7 @@ namespace JinEngine func->pushParam(i); Timer::Handler* handler = shared->every(s, timerCallback, func, finishCallback); Shared<Timer::Handler>* shrHandler = new Shared<Timer::Handler>(L, handler, Jin_Lua_Handler); - Proxy* proxy = luax_newinstance(L, Jin_Lua_Handler, shrHandler); + LuaObject* luaObj = luax_newinstance(L, Jin_Lua_Handler, shrHandler); return 1; } @@ -61,7 +61,7 @@ namespace JinEngine func->pushParam(i); Timer::Handler* handler = shared->after(s, timerCallback, func, finishCallback); Shared<Timer::Handler>* shrHandler = new Shared<Timer::Handler>(L, handler, Jin_Lua_Handler); - Proxy* proxy = luax_newinstance(L, Jin_Lua_Handler, shrHandler); + LuaObject* luaObj = luax_newinstance(L, Jin_Lua_Handler, shrHandler); return 1; } @@ -78,7 +78,7 @@ namespace JinEngine func->pushParam(i); Timer::Handler* handler = shared->repeat(s, count, timerCallback, func, finishCallback); Shared<Timer::Handler>* shrHandler = new Shared<Timer::Handler>(L, handler, Jin_Lua_Handler); - Proxy* proxy = luax_newinstance(L, Jin_Lua_Handler, shrHandler); + LuaObject* luaObj = luax_newinstance(L, Jin_Lua_Handler, shrHandler); return 1; } @@ -92,9 +92,9 @@ namespace JinEngine LUA_IMPLEMENT int l_cancel(lua_State* L) { - Proxy* p = (Proxy*)luax_checktype(L, 1, Jin_Lua_Timer); + LuaObject* p = (LuaObject*)luax_checktype(L, 1, Jin_Lua_Timer); Timer* timer = p->getObject<Timer>(); - Proxy* ph = (Proxy*)luax_checktype(L, 2, Jin_Lua_Handler); + LuaObject* ph = (LuaObject*)luax_checktype(L, 2, Jin_Lua_Handler); Timer::Handler* handler = ph->getObject<Timer::Handler>(); timer->cancel(handler); return 0; @@ -102,7 +102,7 @@ namespace JinEngine LUA_IMPLEMENT int l_cancelAll(lua_State* L) { - Proxy* p = (Proxy*)luax_checktype(L, 1, Jin_Lua_Timer); + LuaObject* p = (LuaObject*)luax_checktype(L, 1, Jin_Lua_Timer); Timer* timer = p->getObject<Timer>(); timer->cancelAll(); return 0; @@ -110,7 +110,7 @@ namespace JinEngine LUA_IMPLEMENT int l_gc(lua_State* L) { - Proxy* p = (Proxy*)luax_checktype(L, 1, Jin_Lua_Timer); + LuaObject* p = (LuaObject*)luax_checktype(L, 1, Jin_Lua_Timer); p->release(); return 0; } |