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.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/apps/plugins/cube.c b/apps/plugins/cube.c
index 5c6f9934eb..2b1e00d690 100644
--- a/apps/plugins/cube.c
+++ b/apps/plugins/cube.c
@@ -21,8 +21,14 @@
21* 21*
22***************************************************************************/ 22***************************************************************************/
23#include "plugin.h" 23#include "plugin.h"
24#include "lib/grey.h"
25#include "lib/playergfx.h" 24#include "lib/playergfx.h"
25#if LCD_DEPTH > 1
26#include "lib/mylcd.h" /* MYLCD_CFG_RB_XLCD or MYLCD_CFG_PGFX */
27#include "lib/grey.h"
28#else
29#include "lib/grey.h"
30#include "lib/mylcd.h" /* MYLCD_CFG_GREYLIB or MYLCD_CFG_PGFX */
31#endif
26#include "lib/xlcd.h" 32#include "lib/xlcd.h"
27#include "lib/fixedpoint.h" 33#include "lib/fixedpoint.h"
28 34
@@ -339,15 +345,9 @@ static struct my_lcd lcdfuncs; /* initialised at runtime */
339static struct my_lcd *mylcd = &greyfuncs; 345static struct my_lcd *mylcd = &greyfuncs;
340 346
341#define MYLCD(fn) mylcd->fn 347#define MYLCD(fn) mylcd->fn
342#define MY_FILLTRIANGLE(x1, y1, x2, y2, x3, y3) grey_filltriangle(x1, y1, x2, y2, x3, y3)
343#define MY_SET_FOREGROUND(fg) grey_set_foreground(fg)
344#define MY_GET_FOREGROUND() grey_get_foreground()
345 348
346#else 349#else
347#define MYLCD(fn) rb->lcd_ ## fn 350#define MYLCD(fn) rb->lcd_ ## fn
348#define MY_FILLTRIANGLE(x1, y1, x2, y2, x3, y3) xlcd_filltriangle(x1, y1, x2, y2, x3, y3)
349#define MY_SET_FOREGROUND(fg) rb->lcd_set_foreground(fg)
350#define MY_GET_FOREGROUND() rb->lcd_get_foreground()
351#endif 351#endif
352 352
353#if CONFIG_LCD == LCD_SSD1815 353#if CONFIG_LCD == LCD_SSD1815
@@ -540,7 +540,7 @@ static void cube_draw(void)
540#if LCD_DEPTH > 1 || defined(USEGSLIB) 540#if LCD_DEPTH > 1 || defined(USEGSLIB)
541 case SOLID: 541 case SOLID:
542 542
543 old_foreground = MY_GET_FOREGROUND(); 543 old_foreground = mylcd_get_foreground();
544 for (i = 0; i < 6; i++) 544 for (i = 0; i < 6; i++)
545 { 545 {
546 /* backface culling; if the shape winds counter-clockwise, we are 546 /* backface culling; if the shape winds counter-clockwise, we are
@@ -552,22 +552,22 @@ static void cube_draw(void)
552 * (point2D[faces[i].corner[2]].x - point2D[faces[i].corner[1]].x)) 552 * (point2D[faces[i].corner[2]].x - point2D[faces[i].corner[1]].x))
553 continue; 553 continue;
554 554
555 MY_SET_FOREGROUND(face_colors[i]); 555 mylcd_set_foreground(face_colors[i]);
556 MY_FILLTRIANGLE(point2D[faces[i].corner[0]].x, 556 mylcd_filltriangle(point2D[faces[i].corner[0]].x,
557 point2D[faces[i].corner[0]].y, 557 point2D[faces[i].corner[0]].y,
558 point2D[faces[i].corner[1]].x, 558 point2D[faces[i].corner[1]].x,
559 point2D[faces[i].corner[1]].y, 559 point2D[faces[i].corner[1]].y,
560 point2D[faces[i].corner[2]].x, 560 point2D[faces[i].corner[2]].x,
561 point2D[faces[i].corner[2]].y); 561 point2D[faces[i].corner[2]].y);
562 MY_FILLTRIANGLE(point2D[faces[i].corner[0]].x, 562 mylcd_filltriangle(point2D[faces[i].corner[0]].x,
563 point2D[faces[i].corner[0]].y, 563 point2D[faces[i].corner[0]].y,
564 point2D[faces[i].corner[2]].x, 564 point2D[faces[i].corner[2]].x,
565 point2D[faces[i].corner[2]].y, 565 point2D[faces[i].corner[2]].y,
566 point2D[faces[i].corner[3]].x, 566 point2D[faces[i].corner[3]].x,
567 point2D[faces[i].corner[3]].y); 567 point2D[faces[i].corner[3]].y);
568 568
569 } 569 }
570 MY_SET_FOREGROUND(old_foreground); 570 mylcd_set_foreground(old_foreground);
571 break; 571 break;
572#endif /* (LCD_DEPTH > 1) || GSLIB */ 572#endif /* (LCD_DEPTH > 1) || GSLIB */
573 573