aboutsummaryrefslogtreecommitdiff
path: root/src/lua/modules/graphics/je_lua_graphics.cpp
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2018-11-13 08:27:26 +0800
committerchai <chaifix@163.com>2018-11-13 08:27:26 +0800
commit75792c15480d3d99b2ba7e79e143e4b569b22611 (patch)
tree61e3abc45326c67d348e08400da11f60dff18fa3 /src/lua/modules/graphics/je_lua_graphics.cpp
parentc7e59fb376453e5abad8c862b52eb0f4c7ba829b (diff)
*修改lua ref
Diffstat (limited to 'src/lua/modules/graphics/je_lua_graphics.cpp')
-rw-r--r--src/lua/modules/graphics/je_lua_graphics.cpp36
1 files changed, 11 insertions, 25 deletions
diff --git a/src/lua/modules/graphics/je_lua_graphics.cpp b/src/lua/modules/graphics/je_lua_graphics.cpp
index 3155aa0..b1437e2 100644
--- a/src/lua/modules/graphics/je_lua_graphics.cpp
+++ b/src/lua/modules/graphics/je_lua_graphics.cpp
@@ -426,7 +426,7 @@ namespace JinEngine
{
if (luax_gettop(L) == 0)
{
- glColor4f(1, 1, 1, 1);
+ gl.setColor(Color(255, 255, 255, 255));
return 0;
}
@@ -437,10 +437,7 @@ namespace JinEngine
context.curRenderColor.a = luax_checknumber(L, 4);
else
context.curRenderColor.a = 255;
- glColor4f(context.curRenderColor.r / 255.f,
- context.curRenderColor.g / 255.f,
- context.curRenderColor.b / 255.f,
- context.curRenderColor.a / 255.f);
+ gl.setColor(context.curRenderColor);
return 0;
}
@@ -738,28 +735,17 @@ namespace JinEngine
return 0;
}
- LUA_PORT int luaopen_Texture(lua_State* L);
- LUA_PORT int luaopen_Text(lua_State* L);
- LUA_PORT int luaopen_TTF(lua_State* L);
- LUA_PORT int luaopen_TextureFont(lua_State* L);
- LUA_PORT int luaopen_TTFData(lua_State* L);
- LUA_PORT int luaopen_Page(lua_State* L);
- LUA_PORT int luaopen_Canvas(lua_State* L);
- LUA_PORT int luaopen_JSL(lua_State* L);
- LUA_PORT int luaopen_Bitmap(lua_State* L);
-
LUA_EXPORT int luaopen_graphics(lua_State* L)
{
- // register types
- luaopen_Bitmap(L);
- luaopen_Texture(L);
- luaopen_Canvas(L);
- luaopen_TTFData(L);
- luaopen_TTF(L);
- luaopen_Text(L);
- luaopen_TextureFont(L);
- luaopen_Page(L);
- luaopen_JSL(L);
+ luax_newclass(L, luaopen_Bitmap);
+ luax_newclass(L, luaopen_Texture);
+ luax_newclass(L, luaopen_Canvas);
+ luax_newclass(L, luaopen_TTFData);
+ luax_newclass(L, luaopen_TTF);
+ luax_newclass(L, luaopen_Text);
+ luax_newclass(L, luaopen_TextureFont);
+ luax_newclass(L, luaopen_Page);
+ luax_newclass(L, luaopen_JSL);
luaL_Reg f[] = {
/* window */