summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2006-02-02 22:00:56 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2006-02-02 22:00:56 +0000
commit0ecd0b0fc2450c3a51239af2970793124b7af5e1 (patch)
tree886063daab4ca07d3b9dc896c006501b51512d55
parent33f2e28daa94fb8996822311fee4a596608638f7 (diff)
downloadrockbox-0ecd0b0fc2450c3a51239af2970793124b7af5e1.tar.gz
rockbox-0ecd0b0fc2450c3a51239af2970793124b7af5e1.zip
patch #1422861 by Adam Boot - Fix splash() color problems
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8541 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/gui/splash.c16
-rw-r--r--apps/screen_access.c6
-rw-r--r--apps/screen_access.h3
3 files changed, 22 insertions, 3 deletions
diff --git a/apps/gui/splash.c b/apps/gui/splash.c
index fffa520b4f..d04ef015b9 100644
--- a/apps/gui/splash.c
+++ b/apps/gui/splash.c
@@ -51,6 +51,10 @@ static void splash(struct screen * screen,
51 bool first=true; 51 bool first=true;
52#ifdef HAVE_LCD_BITMAP 52#ifdef HAVE_LCD_BITMAP
53 int maxw=0; 53 int maxw=0;
54#if LCD_DEPTH > 1
55 unsigned prevbg = LCD_DEFAULT_BG;
56 unsigned prevfg = LCD_DEFAULT_FG;
57#endif
54#endif 58#endif
55 59
56#ifdef HAVE_LCD_CHARCELLS 60#ifdef HAVE_LCD_CHARCELLS
@@ -127,8 +131,12 @@ static void splash(struct screen * screen,
127 int xx = (screen->width-maxw)/2 - 2; 131 int xx = (screen->width-maxw)/2 - 2;
128 /* The new graphics routines handle clipping, so no need to check */ 132 /* The new graphics routines handle clipping, so no need to check */
129#if LCD_DEPTH > 1 133#if LCD_DEPTH > 1
130 if(screen->depth>1) 134 if(screen->depth>1) {
135 prevbg = screen->get_background();
136 prevfg = screen->get_foreground();
131 screen->set_background(LCD_LIGHTGRAY); 137 screen->set_background(LCD_LIGHTGRAY);
138 screen->set_foreground(LCD_BLACK);
139 }
132#endif 140#endif
133 screen->set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); 141 screen->set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
134 screen->fillrect(xx, y-2, maxw+4, screen->height-y*2+4); 142 screen->fillrect(xx, y-2, maxw+4, screen->height-y*2+4);
@@ -177,8 +185,10 @@ static void splash(struct screen * screen,
177 } 185 }
178 186
179#if defined(HAVE_LCD_BITMAP) && (LCD_DEPTH > 1) 187#if defined(HAVE_LCD_BITMAP) && (LCD_DEPTH > 1)
180 if(screen->depth > 1) 188 if(screen->depth > 1) {
181 screen->set_background(LCD_DEFAULT_BG); 189 screen->set_background(prevbg);
190 screen->set_foreground(prevfg);
191 }
182#endif 192#endif
183#if defined(HAVE_LCD_BITMAP) || defined(SIMULATOR) 193#if defined(HAVE_LCD_BITMAP) || defined(SIMULATOR)
184 screen->update(); 194 screen->update();
diff --git a/apps/screen_access.c b/apps/screen_access.c
index d38f1ca6a9..a1f615cd16 100644
--- a/apps/screen_access.c
+++ b/apps/screen_access.c
@@ -54,7 +54,10 @@ void screen_init(struct screen * screen, enum screen_type screen_type)
54 screen->mono_bitmap=&lcd_remote_mono_bitmap; 54 screen->mono_bitmap=&lcd_remote_mono_bitmap;
55 screen->set_drawmode=&lcd_remote_set_drawmode; 55 screen->set_drawmode=&lcd_remote_set_drawmode;
56#if LCD_REMOTE_DEPTH > 1 56#if LCD_REMOTE_DEPTH > 1
57 screen->get_background=&lcd_remote_get_background;
58 screen->get_foreground=&lcd_remote_get_foreground;
57 screen->set_background=&lcd_remote_set_background; 59 screen->set_background=&lcd_remote_set_background;
60 screen->set_foreground=&lcd_remote_set_foreground;
58#endif /* LCD_REMOTE_DEPTH > 1 */ 61#endif /* LCD_REMOTE_DEPTH > 1 */
59 screen->update_rect=&lcd_remote_update_rect; 62 screen->update_rect=&lcd_remote_update_rect;
60 screen->fillrect=&lcd_remote_fillrect; 63 screen->fillrect=&lcd_remote_fillrect;
@@ -127,7 +130,10 @@ void screen_init(struct screen * screen, enum screen_type screen_type)
127#else 130#else
128 screen->transparent_bitmap=&lcd_bitmap_transparent; 131 screen->transparent_bitmap=&lcd_bitmap_transparent;
129#endif 132#endif
133 screen->get_background=&lcd_get_background;
134 screen->get_foreground=&lcd_get_foreground;
130 screen->set_background=&lcd_set_background; 135 screen->set_background=&lcd_set_background;
136 screen->set_foreground=&lcd_set_foreground;
131#endif 137#endif
132 screen->update_rect=&lcd_update_rect; 138 screen->update_rect=&lcd_update_rect;
133 screen->fillrect=&lcd_fillrect; 139 screen->fillrect=&lcd_fillrect;
diff --git a/apps/screen_access.h b/apps/screen_access.h
index 3664ecb13d..7b8018dc41 100644
--- a/apps/screen_access.h
+++ b/apps/screen_access.h
@@ -88,7 +88,10 @@ struct screen
88 int x, int y, int width, int height); 88 int x, int y, int width, int height);
89 void (*set_drawmode)(int mode); 89 void (*set_drawmode)(int mode);
90#if (LCD_DEPTH > 1) || (LCD_REMOTE_DEPTH > 1) 90#if (LCD_DEPTH > 1) || (LCD_REMOTE_DEPTH > 1)
91 unsigned (*get_background)(void);
92 unsigned (*get_foreground)(void);
91 void (*set_background)(unsigned background); 93 void (*set_background)(unsigned background);
94 void (*set_foreground)(unsigned foreground);
92#endif /* (LCD_DEPTH > 1) || (LCD_REMOTE_DEPTH > 1) */ 95#endif /* (LCD_DEPTH > 1) || (LCD_REMOTE_DEPTH > 1) */
93 void (*update_rect)(int x, int y, int width, int height); 96 void (*update_rect)(int x, int y, int width, int height);
94 void (*fillrect)(int x, int y, int width, int height); 97 void (*fillrect)(int x, int y, int width, int height);