CLuaInstance::CPictureNew: Add parameter 'transparent' for cpicture.new

- Default is CFrameBuffer::TM_NONE (No 'pseudo' transparency)
This commit is contained in:
M. Liebmann
2014-07-10 16:05:41 +02:00
parent a182fca81f
commit e991507888

View File

@@ -1896,6 +1896,12 @@ int CLuaInstance::CPictureNew(lua_State *L)
lua_Integer color_background = (lua_Integer)COL_MENUCONTENT_PLUS_0;
lua_Integer color_shadow = (lua_Integer)COL_MENUCONTENTDARK_PLUS_0;
/*
transparency = CFrameBuffer::TM_BLACK (2): Transparency when black content ('pseudo' transparency)
transparency = CFrameBuffer::TM_NONE (1): No 'pseudo' transparency
*/
lua_Integer transparency = CFrameBuffer::TM_NONE;
tableLookup(L, "parent" , (void**)&parent);
tableLookup(L, "x" , x);
tableLookup(L, "y" , y);
@@ -1912,12 +1918,13 @@ int CLuaInstance::CPictureNew(lua_State *L)
tableLookup(L, "color_frame" , color_frame);
tableLookup(L, "color_background" , color_background);
tableLookup(L, "color_shadow" , color_shadow);
tableLookup(L, "transparency" , transparency);
CComponentsForm* pw = (parent && parent->w) ? parent->w->getBodyObject() : NULL;
CLuaPicture **udata = (CLuaPicture **) lua_newuserdata(L, sizeof(CLuaPicture *));
*udata = new CLuaPicture();
(*udata)->cp = new CComponentsPicture(x, y, dx, dy, image_name, pw, has_shadow, (fb_pixel_t)color_frame, (fb_pixel_t)color_background, (fb_pixel_t)color_shadow);
(*udata)->cp = new CComponentsPicture(x, y, dx, dy, image_name, pw, has_shadow, (fb_pixel_t)color_frame, (fb_pixel_t)color_background, (fb_pixel_t)color_shadow, transparency);
(*udata)->parent = pw;
luaL_getmetatable(L, "cpicture");
lua_setmetatable(L, -2);