From 55bfff7cf6541caac172b43186cf14405185b14d Mon Sep 17 00:00:00 2001 From: Andrew Opalach Date: Sat, 13 Apr 2019 12:40:52 -0400 Subject: fix curses on linux --- .../calculator/CEdev/examples/gfx_char/src/main.c | 104 ++++++++++----------- 1 file changed, 52 insertions(+), 52 deletions(-) (limited to 'frontends/calculator/CEdev/examples/gfx_char/src') diff --git a/frontends/calculator/CEdev/examples/gfx_char/src/main.c b/frontends/calculator/CEdev/examples/gfx_char/src/main.c index 7d1b5ec..a7f108e 100644 --- a/frontends/calculator/CEdev/examples/gfx_char/src/main.c +++ b/frontends/calculator/CEdev/examples/gfx_char/src/main.c @@ -1,52 +1,52 @@ -#include -#include -#include -#include - -#include -#include -#include - -#include - -/* Use some random color as the transparent one */ -#define TRANSPARENT_COLOR 10 -#define FONT_WIDTH 8 -#define FONT_HEIGHT 8 - -/* Function prototypes */ -void printu(char *str, int x, int y); - -const char *my_str = "!!DEPPILF si txet sihT"; - -void main(void) { - /* Initialize the 8bpp graphics */ - gfx_Begin(); - gfx_FillScreen(gfx_black); - - /* Setup the colors */ - gfx_SetTextFGColor(gfx_white); - - /* Set the transparent text background color */ - gfx_SetTextBGColor(TRANSPARENT_COLOR); - gfx_SetTextTransparentColor(TRANSPARENT_COLOR); - gfx_SetMonospaceFont(FONT_WIDTH); - - /* Print some upside down text */ - printu(my_str, (LCD_WIDTH - gfx_GetStringWidth(my_str)) / 2, (LCD_HEIGHT - FONT_HEIGHT) / 2); - - /* Wait for key */ - while (!os_GetCSC()); - - /* Finish the graphics */ - gfx_End(); -} - -void printu(char *str, int x, int y) { - gfx_TempSprite(my_char, 8, 8); - - while (*str) { - gfx_TransparentSprite(gfx_RotateSpriteHalf(gfx_GetSpriteChar(*str), my_char), x, y); - x += gfx_GetCharWidth(*str++); - } -} +#include +#include +#include +#include + +#include +#include +#include + +#include + +/* Use some random color as the transparent one */ +#define TRANSPARENT_COLOR 10 +#define FONT_WIDTH 8 +#define FONT_HEIGHT 8 + +/* Function prototypes */ +void printu(char *str, int x, int y); + +const char *my_str = "!!DEPPILF si txet sihT"; + +void main(void) { + /* Initialize the 8bpp graphics */ + gfx_Begin(); + gfx_FillScreen(gfx_black); + + /* Setup the colors */ + gfx_SetTextFGColor(gfx_white); + + /* Set the transparent text background color */ + gfx_SetTextBGColor(TRANSPARENT_COLOR); + gfx_SetTextTransparentColor(TRANSPARENT_COLOR); + gfx_SetMonospaceFont(FONT_WIDTH); + + /* Print some upside down text */ + printu(my_str, (LCD_WIDTH - gfx_GetStringWidth(my_str)) / 2, (LCD_HEIGHT - FONT_HEIGHT) / 2); + + /* Wait for key */ + while (!os_GetCSC()); + + /* Finish the graphics */ + gfx_End(); +} + +void printu(char *str, int x, int y) { + gfx_TempSprite(my_char, 8, 8); + + while (*str) { + gfx_TransparentSprite(gfx_RotateSpriteHalf(gfx_GetSpriteChar(*str), my_char), x, y); + x += gfx_GetCharWidth(*str++); + } +} -- cgit v1.2.3-101-g0448