lua instances: adopt for last rebases with splitted lua source files

TODO: check/fix lua functionality, not tested yet


Origin commit data
------------------
Branch: ni/coolstream
Commit: 7b28c80b74
Author: Thilo Graf <dbt@novatux.de>
Date: 2015-12-12 (Sat, 12 Dec 2015)



------------------
This commit was generated by Migit
This commit is contained in:
2015-12-12 14:42:01 +01:00
parent 6e833a30ee
commit 3e4f973a06
3 changed files with 13 additions and 10 deletions

View File

@@ -98,12 +98,12 @@ int CLuaInstCCText::CCTextNew(lua_State *L)
if (font_text >= SNeutrinoSettings::FONT_TYPE_COUNT || font_text < 0)
font_text = SNeutrinoSettings::FONT_TYPE_MENU;
bool has_shadow = false;
if (!tableLookup(L, "has_shadow", has_shadow)) {
int shadow_mode = CC_SHADOW_OFF;
if (!tableLookup(L, "has_shadow", shadow_mode)) {
std::string tmp1 = "false";
if (tableLookup(L, "has_shadow", tmp1))
paramBoolDeprecated(L, tmp1.c_str());
has_shadow = (tmp1 == "true" || tmp1 == "1" || tmp1 == "yes");
shadow_mode = (tmp1 == "true" || tmp1 == "1" || tmp1 == "yes");
}
tableLookup(L, "color_text", color_text);
@@ -142,7 +142,7 @@ int CLuaInstCCText::CCTextNew(lua_State *L)
CLuaCCText **udata = (CLuaCCText **) lua_newuserdata(L, sizeof(CLuaCCText *));
*udata = new CLuaCCText();
(*udata)->ct = new CComponentsText(x, y, dx, dy, text, mode, g_Font[font_text], pw, has_shadow, (fb_pixel_t)color_text, (fb_pixel_t)color_frame, (fb_pixel_t)color_body, (fb_pixel_t)color_shadow);
(*udata)->ct = new CComponentsText(x, y, dx, dy, text, mode, g_Font[font_text], 0 /*TODO: style not passed*/, pw, shadow_mode, (fb_pixel_t)color_text, (fb_pixel_t)color_frame, (fb_pixel_t)color_body, (fb_pixel_t)color_shadow);
(*udata)->parent = pw;
(*udata)->mode = mode;
(*udata)->font_text = font_text;
@@ -173,7 +173,7 @@ int CLuaInstCCText::CCTextHide(lua_State *L)
lua_assert(lua_istable(L,1));
CLuaCCText *D = CCTextCheck(L, 1);
if (!D) return 0;
#if 0
bool no_restore = false;
if (!tableLookup(L, "no_restore", no_restore)) {
std::string tmp = "false";
@@ -181,11 +181,12 @@ int CLuaInstCCText::CCTextHide(lua_State *L)
paramBoolDeprecated(L, tmp.c_str());
no_restore = (tmp == "true" || tmp == "1" || tmp == "yes");
}
#endif
if (D->parent) {
D->ct->setText("", D->mode, g_Font[D->font_text]);
D->ct->paint();
} else
D->ct->hide(no_restore);
D->ct->hide();
return 0;
}