CLuaInstCCWindow: fix passed shadow paramater

This commit is contained in:
2017-05-09 12:08:03 +02:00
parent 468fbcd79c
commit 1f978f01ad
2 changed files with 5 additions and 4 deletions

View File

@@ -4,4 +4,4 @@
* to luainstance.h changes * to luainstance.h changes
*/ */
#define LUA_API_VERSION_MAJOR 1 #define LUA_API_VERSION_MAJOR 1
#define LUA_API_VERSION_MINOR 73 #define LUA_API_VERSION_MINOR 74

View File

@@ -89,12 +89,13 @@ int CLuaInstCCWindow::CCWindowNew(lua_State *L)
tableLookup(L, "name", name) || tableLookup(L, "title", name) || tableLookup(L, "caption", name); tableLookup(L, "name", name) || tableLookup(L, "title", name) || tableLookup(L, "caption", name);
tableLookup(L, "icon", icon); tableLookup(L, "icon", icon);
bool has_shadow = false; int has_shadow = CC_SHADOW_OFF;
if (!tableLookup(L, "has_shadow", has_shadow)) { if (!tableLookup(L, "has_shadow", has_shadow)) {
tmp1 = "false"; tmp1 = "false";
if (tableLookup(L, "has_shadow", tmp1)) if (tableLookup(L, "has_shadow", tmp1))
paramBoolDeprecated(L, tmp1.c_str()); paramBoolDeprecated(L, tmp1.c_str());
has_shadow = (tmp1 == "true" || tmp1 == "1" || tmp1 == "yes"); if ((tmp1 == "true" || tmp1 == "1" || tmp1 == "yes"))
has_shadow = CC_SHADOW_ON;
} }
tableLookup(L, "color_frame" , color_frame); tableLookup(L, "color_frame" , color_frame);
@@ -126,7 +127,7 @@ int CLuaInstCCWindow::CCWindowNew(lua_State *L)
CLuaCCWindow **udata = (CLuaCCWindow **) lua_newuserdata(L, sizeof(CLuaCCWindow *)); CLuaCCWindow **udata = (CLuaCCWindow **) lua_newuserdata(L, sizeof(CLuaCCWindow *));
*udata = new CLuaCCWindow(); *udata = new CLuaCCWindow();
(*udata)->w = new CComponentsWindow(x, y, dx, dy, name.c_str(), icon.c_str(), 0, has_shadow, (fb_pixel_t)color_frame, (fb_pixel_t)color_body, (fb_pixel_t)color_shadow); (*udata)->w = new CComponentsWindow(x, y, dx, dy, name.c_str(), icon.c_str(), NULL, has_shadow, (fb_pixel_t)color_frame, (fb_pixel_t)color_body, (fb_pixel_t)color_shadow);
/* Ignore percent conversion of width and height /* Ignore percent conversion of width and height
to remain compatible with the Lua API */ to remain compatible with the Lua API */
(*udata)->w->setWidth(dx); (*udata)->w->setWidth(dx);