aboutsummaryrefslogtreecommitdiff
path: root/src/lua/modules/graphics/je_lua_bitmap.cpp
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2018-11-15 08:32:38 +0800
committerchai <chaifix@163.com>2018-11-15 08:32:38 +0800
commita6f2d5fff89b7322009c46a9272668ca4c32ce64 (patch)
treeff81127c3be8bde426e57db544d69b9616ddc25b /src/lua/modules/graphics/je_lua_bitmap.cpp
parent611d12bdd245dd43b7434661d3e24f2b435378cb (diff)
*修改代码结构
Diffstat (limited to 'src/lua/modules/graphics/je_lua_bitmap.cpp')
-rw-r--r--src/lua/modules/graphics/je_lua_bitmap.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/lua/modules/graphics/je_lua_bitmap.cpp b/src/lua/modules/graphics/je_lua_bitmap.cpp
index 1491bee..4b7c492 100644
--- a/src/lua/modules/graphics/je_lua_bitmap.cpp
+++ b/src/lua/modules/graphics/je_lua_bitmap.cpp
@@ -1,7 +1,8 @@
#include "lua/common/je_lua_common.h"
#include "lua/modules/luax.h"
-#include "lua/modules/types.h"
+
#include "libjin/jin.h"
+#include "je_lua_bitmap.h"
using namespace JinEngine::Graphics;
@@ -10,11 +11,13 @@ namespace JinEngine
namespace Lua
{
+ const char* Jin_Lua_Bitmap = "Bitmap";
+
typedef Shared<Bitmap>& SharedBitmap;
LUA_IMPLEMENT inline SharedBitmap checkBitmap(lua_State* L)
{
- Proxy* proxy = (Proxy*)luax_checktype(L, 1, JIN_GRAPHICS_BITMAP);
+ Proxy* proxy = (Proxy*)luax_checktype(L, 1, Jin_Lua_Bitmap);
return proxy->getShared<Bitmap>();
}
@@ -87,8 +90,8 @@ namespace JinEngine
SharedBitmap shared = checkBitmap(L);
Bitmap* bitmap = shared.getObject();
Bitmap* b = Bitmap::clone(bitmap);
- Proxy* proxy = luax_newinstance(L, JIN_GRAPHICS_BITMAP);
- proxy->bind(new Shared<Bitmap>(b, JIN_GRAPHICS_BITMAP));
+ Proxy* proxy = luax_newinstance(L, Jin_Lua_Bitmap);
+ proxy->bind(new Shared<Bitmap>(b, Jin_Lua_Bitmap));
return 1;
}
@@ -104,9 +107,9 @@ namespace JinEngine
{ "clone", l_clone },
{ 0, 0 }
};
- luax_newtype(L, JIN_GRAPHICS_BITMAP, f);
+ luax_newtype(L, Jin_Lua_Bitmap, f);
return 0;
}
- } // graphics
+ } // namespace Graphics
} // namespace JinEngine \ No newline at end of file