summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorNils Wallménius <nils@rockbox.org>2011-09-08 12:44:34 +0000
committerNils Wallménius <nils@rockbox.org>2011-09-08 12:44:34 +0000
commit7337bcbf043b7a3a5af2559fd03abdb6be5eedb5 (patch)
tree16153d2f1ceb92e3279914f7c00722533809ca8d /apps
parenta483c9c6f1e6674eb2b5dcf01e21a7ab4c77e24f (diff)
downloadrockbox-7337bcbf043b7a3a5af2559fd03abdb6be5eedb5.zip
rockbox-7337bcbf043b7a3a5af2559fd03abdb6be5eedb5.tar.gz
rockbox-7337bcbf043b7a3a5af2559fd03abdb6be5eedb5.tar.bz2
rockbox-7337bcbf043b7a3a5af2559fd03abdb6be5eedb5.tar.xz
FS#12257 by Michael Goerner, fixing stone colours in goban for inversed displays (clips and mrobe100).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30479 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/plugins/goban/display.c29
1 files changed, 12 insertions, 17 deletions
diff --git a/apps/plugins/goban/display.c b/apps/plugins/goban/display.c
index 8c18039..64b3ade 100644
--- a/apps/plugins/goban/display.c
+++ b/apps/plugins/goban/display.c
@@ -938,14 +938,15 @@ draw_stone_raw (int pixel_x, int pixel_y, bool black)
#if LCD_DEPTH > 1
rb->lcd_set_foreground (black ? BLACK_COLOR : WHITE_COLOR);
#else
- if (black)
- {
- rb->lcd_set_drawmode (DRMODE_SOLID);
- }
- else
- {
- rb->lcd_set_drawmode (DRMODE_SOLID + DRMODE_INVERSEVID);
- }
+ int draw_mode;
+/* check whether foreground is bright or dark */
+#if defined(HAVE_NEGATIVE_LCD)
+ draw_mode = DRMODE_SOLID | (black ? DRMODE_INVERSEVID : 0);
+#else
+ draw_mode = DRMODE_SOLID | (black ? 0 : DRMODE_INVERSEVID);
+#endif /* HAVE_NEGATIVE_LCD */
+
+ rb->lcd_set_drawmode (draw_mode);
#endif
draw_circle (pixel_x + LINE_OFFSET,
@@ -955,17 +956,11 @@ draw_stone_raw (int pixel_x, int pixel_y, bool black)
#if LCD_DEPTH > 1
rb->lcd_set_foreground (black ? WHITE_COLOR : BLACK_COLOR);
#else
- if (black)
- {
- rb->lcd_set_drawmode (DRMODE_SOLID + DRMODE_INVERSEVID);
- }
- else
- {
- rb->lcd_set_drawmode (DRMODE_SOLID);
- }
+ rb->lcd_set_drawmode (draw_mode ^ DRMODE_INVERSEVID);
#endif /* LCD_DEPTH > 1 */
- if (!black)
+ /* outline stones of background color only */
+ if (draw_mode & DRMODE_INVERSEVID)
{
draw_circle (pixel_x + LINE_OFFSET,
pixel_y + LINE_OFFSET, LINE_OFFSET, false);