Horus Shadowed (#4979)
* Introduce SHADOWED and use it for BattCheck * numbers too * For drawTimer too * Compilation fix
This commit is contained in:
@@ -205,8 +205,9 @@ See the [Appendix](../appendix/fonts.md) for available characters in each font s
|
||||
* `SMLSIZE` small font
|
||||
* `INVERS` inverted display
|
||||
* `BLINK` blinking text
|
||||
* `SHADOWED` Horus only, apply a shadow effect
|
||||
|
||||
@status current Introduced in 2.0.0
|
||||
@status current Introduced in 2.0.0, `SHADOWED` introduced in 2.2.1
|
||||
*/
|
||||
static int luaLcdDrawText(lua_State *L)
|
||||
{
|
||||
@@ -215,6 +216,9 @@ static int luaLcdDrawText(lua_State *L)
|
||||
int y = luaL_checkinteger(L, 2);
|
||||
const char * s = luaL_checkstring(L, 3);
|
||||
unsigned int att = luaL_optunsigned(L, 4, 0);
|
||||
#if defined(COLORLCD)
|
||||
if ((att&SHADOWED) && !(att&INVERS)) lcdDrawText(x+1, y+1, s, att&0xFFFF);
|
||||
#endif
|
||||
lcdDrawText(x, y, s, att);
|
||||
return 0;
|
||||
}
|
||||
@@ -232,8 +236,9 @@ Display a value formatted as time at (x,y)
|
||||
* `0 or not specified` normal representation (minutes and seconds)
|
||||
* `TIMEHOUR` display hours
|
||||
* other general LCD flag also apply
|
||||
* `SHADOWED` Horus only, apply a shadow effect
|
||||
|
||||
@status current Introduced in 2.0.0
|
||||
@status current Introduced in 2.0.0, `SHADOWED` introduced in 2.2.1
|
||||
*/
|
||||
static int luaLcdDrawTimer(lua_State *L)
|
||||
{
|
||||
@@ -243,6 +248,7 @@ static int luaLcdDrawTimer(lua_State *L)
|
||||
int seconds = luaL_checkinteger(L, 3);
|
||||
unsigned int att = luaL_optunsigned(L, 4, 0);
|
||||
#if defined(COLORLCD)
|
||||
if (att&SHADOWED) drawTimer(x+1, y+1, seconds, (att&0xFFFF)|LEFT);
|
||||
drawTimer(x, y, seconds, att|LEFT);
|
||||
#else
|
||||
drawTimer(x, y, seconds, att|LEFT, att);
|
||||
@@ -264,8 +270,9 @@ Display a number at (x,y)
|
||||
* `PREC1` display with one decimal place (number 386 is displayed as 38.6)
|
||||
* `PREC2` display with tow decimal places (number 386 is displayed as 3.86)
|
||||
* other general LCD flag also apply
|
||||
* `SHADOWED` Horus only, apply a shadow effect
|
||||
|
||||
@status current Introduced in 2.0.0
|
||||
@status current Introduced in 2.0.0, `SHADOWED` introduced in 2.2.1
|
||||
*/
|
||||
static int luaLcdDrawNumber(lua_State *L)
|
||||
{
|
||||
@@ -274,6 +281,9 @@ static int luaLcdDrawNumber(lua_State *L)
|
||||
int y = luaL_checkinteger(L, 2);
|
||||
int val = luaL_checkinteger(L, 3);
|
||||
unsigned int att = luaL_optunsigned(L, 4, 0);
|
||||
#if defined(COLORLCD)
|
||||
if ((att&SHADOWED) && !(att&INVERS)) lcdDrawNumber(x, y, val, att&0xFFFF);
|
||||
#endif
|
||||
lcdDrawNumber(x, y, val, att);
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user