From 9ed486bdc747b505a5b7b868c363dcff3e718a0d Mon Sep 17 00:00:00 2001 From: William Wilgus Date: Sat, 24 Nov 2018 16:40:23 -0500 Subject: lua add LCD_DEFAULT_FG, fix 2-bit screen fg/bg inversion Change-Id: Ibe2bc6602ff27524a3b96d9523780acbfbf03c76 --- apps/plugins/lua/include_lua/draw.lua | 4 ++-- apps/plugins/lua/rocklib.c | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'apps') diff --git a/apps/plugins/lua/include_lua/draw.lua b/apps/plugins/lua/include_lua/draw.lua index 7bf71f0a6b..0ee3e93d75 100644 --- a/apps/plugins/lua/include_lua/draw.lua +++ b/apps/plugins/lua/include_lua/draw.lua @@ -350,8 +350,8 @@ local _draw = {} do if rb.LCD_DEPTH == 2 then -- invert 2-bit screens --vp.drawmode = bit.bxor(vp.drawmode, 4) - vp.fg_pattern = 3 - vp.fg_pattern - vp.bg_pattern = 3 - vp.bg_pattern + opts.fg_pattern = 3 - opts.fg_pattern + opts.bg_pattern = 3 - opts.bg_pattern end rb.set_viewport(opts) diff --git a/apps/plugins/lua/rocklib.c b/apps/plugins/lua/rocklib.c index 5995fd89e9..a6a23f3381 100644 --- a/apps/plugins/lua/rocklib.c +++ b/apps/plugins/lua/rocklib.c @@ -649,6 +649,10 @@ LUALIB_API int luaopen_rock(lua_State *L) RB_CONSTANT(LCD_HEIGHT), RB_CONSTANT(LCD_WIDTH), RB_CONSTANT(SCREEN_MAIN), +#if LCD_DEPTH > 1 + RB_CONSTANT(LCD_DEFAULT_FG), + RB_CONSTANT(LCD_DEFAULT_BG), +#endif #ifdef HAVE_REMOTE_LCD RB_CONSTANT(LCD_REMOTE_DEPTH), RB_CONSTANT(LCD_REMOTE_HEIGHT), -- cgit v1.2.3