summaryrefslogtreecommitdiff
path: root/apps/plugins/cube.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/cube.c')
-rw-r--r--apps/plugins/cube.c33
1 files changed, 16 insertions, 17 deletions
diff --git a/apps/plugins/cube.c b/apps/plugins/cube.c
index 31faf323f9..5eea42f634 100644
--- a/apps/plugins/cube.c
+++ b/apps/plugins/cube.c
@@ -19,7 +19,7 @@
19* 19*
20***************************************************************************/ 20***************************************************************************/
21#include "plugin.h" 21#include "plugin.h"
22#include "gray.h" 22#include "grey.h"
23#include "playergfx.h" 23#include "playergfx.h"
24#include "xlcd.h" 24#include "xlcd.h"
25#include "fixedpoint.h" 25#include "fixedpoint.h"
@@ -221,16 +221,16 @@ struct my_lcd {
221 void (*putsxy)(int x, int y, const unsigned char *string); 221 void (*putsxy)(int x, int y, const unsigned char *string);
222}; 222};
223 223
224static struct my_lcd grayfuncs = { 224static struct my_lcd greyfuncs = {
225 gray_update, gray_clear_display, gray_drawline, gray_putsxy 225 grey_update, grey_clear_display, grey_drawline, grey_putsxy
226}; 226};
227static struct my_lcd lcdfuncs; /* initialised at runtime */ 227static struct my_lcd lcdfuncs; /* initialised at runtime */
228static struct my_lcd *mylcd = &grayfuncs; 228static struct my_lcd *mylcd = &greyfuncs;
229 229
230#define MYLCD(fn) mylcd->fn 230#define MYLCD(fn) mylcd->fn
231#define MY_FILLTRIANGLE(x1, y1, x2, y2, x3, y3) gray_filltriangle(x1, y1, x2, y2, x3, y3) 231#define MY_FILLTRIANGLE(x1, y1, x2, y2, x3, y3) grey_filltriangle(x1, y1, x2, y2, x3, y3)
232#define MY_SET_FOREGROUND(fg) gray_set_foreground(fg) 232#define MY_SET_FOREGROUND(fg) grey_set_foreground(fg)
233#define MY_GET_FOREGROUND() gray_get_foreground() 233#define MY_GET_FOREGROUND() grey_get_foreground()
234 234
235#else 235#else
236#define MYLCD(fn) rb->lcd_ ## fn 236#define MYLCD(fn) rb->lcd_ ## fn
@@ -314,8 +314,8 @@ static const unsigned face_colors[6] =
314 LCD_RGBPACK(255, 0, 0), LCD_RGBPACK(255, 0, 0), LCD_RGBPACK(0, 255, 0), 314 LCD_RGBPACK(255, 0, 0), LCD_RGBPACK(255, 0, 0), LCD_RGBPACK(0, 255, 0),
315 LCD_RGBPACK(0, 255, 0), LCD_RGBPACK(0, 0, 255), LCD_RGBPACK(0, 0, 255) 315 LCD_RGBPACK(0, 255, 0), LCD_RGBPACK(0, 0, 255), LCD_RGBPACK(0, 0, 255)
316#elif defined(USE_GSLIB) 316#elif defined(USE_GSLIB)
317 GRAY_LIGHTGRAY, GRAY_LIGHTGRAY, GRAY_DARKGRAY, 317 GREY_LIGHTGRAY, GREY_LIGHTGRAY, GREY_DARKGRAY,
318 GRAY_DARKGRAY, GRAY_BLACK, GRAY_BLACK 318 GREY_DARKGRAY, GREY_BLACK, GREY_BLACK
319#else 319#else
320 LCD_LIGHTGRAY, LCD_LIGHTGRAY, LCD_DARKGRAY, 320 LCD_LIGHTGRAY, LCD_LIGHTGRAY, LCD_DARKGRAY,
321 LCD_DARKGRAY, LCD_BLACK, LCD_BLACK 321 LCD_DARKGRAY, LCD_BLACK, LCD_BLACK
@@ -490,7 +490,7 @@ void cleanup(void *parameter)
490 (void)parameter; 490 (void)parameter;
491 491
492#ifdef USE_GSLIB 492#ifdef USE_GSLIB
493 gray_release(); 493 grey_release();
494#elif defined HAVE_LCD_CHARCELLS 494#elif defined HAVE_LCD_CHARCELLS
495 pgfx_release(); 495 pgfx_release();
496#endif 496#endif
@@ -527,10 +527,9 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
527 xlcd_init(rb); 527 xlcd_init(rb);
528#elif defined(USE_GSLIB) 528#elif defined(USE_GSLIB)
529 gbuf = (unsigned char *)rb->plugin_get_buffer(&gbuf_size); 529 gbuf = (unsigned char *)rb->plugin_get_buffer(&gbuf_size);
530 if (gray_init(rb, gbuf, gbuf_size, true, LCD_WIDTH, LCD_HEIGHT, 3, 0, NULL) 530 if (!grey_init(rb, gbuf, gbuf_size, true, LCD_WIDTH, LCD_HEIGHT, NULL))
531 != 3)
532 { 531 {
533 rb->splash(HZ, "Couldn't get grayscale buffer"); 532 rb->splash(HZ, "Couldn't init greyscale display");
534 return PLUGIN_ERROR; 533 return PLUGIN_ERROR;
535 } 534 }
536 /* init lcd_ function pointers */ 535 /* init lcd_ function pointers */
@@ -539,7 +538,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
539 lcdfuncs.drawline = rb->lcd_drawline; 538 lcdfuncs.drawline = rb->lcd_drawline;
540 lcdfuncs.putsxy = rb->lcd_putsxy; 539 lcdfuncs.putsxy = rb->lcd_putsxy;
541 540
542 gray_setfont(FONT_SYSFIXED); 541 grey_setfont(FONT_SYSFIXED);
543#endif 542#endif
544 rb->lcd_setfont(FONT_SYSFIXED); 543 rb->lcd_setfont(FONT_SYSFIXED);
545#else /* LCD_CHARCELLS */ 544#else /* LCD_CHARCELLS */
@@ -603,7 +602,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
603#ifdef USE_GSLIB 602#ifdef USE_GSLIB
604 if (mode_switch) 603 if (mode_switch)
605 { 604 {
606 gray_show(mode == SOLID); 605 grey_show(mode == SOLID);
607 mode_switch = false; 606 mode_switch = false;
608 } 607 }
609#endif 608#endif
@@ -744,7 +743,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
744 if (++mode >= NUM_MODES) 743 if (++mode >= NUM_MODES)
745 mode = 0; 744 mode = 0;
746#ifdef USE_GSLIB 745#ifdef USE_GSLIB
747 mylcd = (mode == SOLID) ? &grayfuncs : &lcdfuncs; 746 mylcd = (mode == SOLID) ? &greyfuncs : &lcdfuncs;
748 mode_switch = true; 747 mode_switch = true;
749#endif 748#endif
750 redraw = true; 749 redraw = true;
@@ -785,7 +784,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
785 } 784 }
786 785
787#ifdef USE_GSLIB 786#ifdef USE_GSLIB
788 gray_release(); 787 grey_release();
789#elif defined(HAVE_LCD_CHARCELLS) 788#elif defined(HAVE_LCD_CHARCELLS)
790 pgfx_release(); 789 pgfx_release();
791#endif 790#endif