summaryrefslogtreecommitdiff
path: root/apps/plugins/lib/grey_parm.c
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2014-01-07 22:14:41 +0100
committerThomas Martitz <kugel@rockbox.org>2014-01-07 22:14:41 +0100
commitd146970ca1e5c9b0641301d50823d29b2e25c9e4 (patch)
tree30f738042a8d81e9336b594d1d52ec75e428d3b2 /apps/plugins/lib/grey_parm.c
parente1c7b3b8f72becc9079c04253a2985f577850a48 (diff)
downloadrockbox-d146970ca1e5c9b0641301d50823d29b2e25c9e4.tar.gz
rockbox-d146970ca1e5c9b0641301d50823d29b2e25c9e4.zip
lcd/grey: Enable viewport fg_pattern and bg_pattern for all bitmap targets.
Greylib performed a horrible hack and stored fg and bg patterns in other struct viewport fields. One of them was just removed. So instead of this hack simply enable the *_pattern fields for mono targets as well, so that greylib can use them normally. Change-Id: Ib0842ebcc97f5bf9d9382b4471903afa2f96f39f
Diffstat (limited to 'apps/plugins/lib/grey_parm.c')
-rw-r--r--apps/plugins/lib/grey_parm.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/apps/plugins/lib/grey_parm.c b/apps/plugins/lib/grey_parm.c
index 9b4ba8c5f6..d2dfde42f1 100644
--- a/apps/plugins/lib/grey_parm.c
+++ b/apps/plugins/lib/grey_parm.c
@@ -79,25 +79,25 @@ int grey_get_drawmode(void)
79/* Set the foreground shade for subsequent drawing operations */ 79/* Set the foreground shade for subsequent drawing operations */
80void grey_set_foreground(unsigned brightness) 80void grey_set_foreground(unsigned brightness)
81{ 81{
82 _GREY_FG_BRIGHTNESS(_grey_info.vp) = brightness; 82 _grey_info.vp->fg_pattern = brightness;
83} 83}
84 84
85/* Return the current foreground shade */ 85/* Return the current foreground shade */
86unsigned grey_get_foreground(void) 86unsigned grey_get_foreground(void)
87{ 87{
88 return _GREY_FG_BRIGHTNESS(_grey_info.vp); 88 return _grey_info.vp->fg_pattern;
89} 89}
90 90
91/* Set the background shade for subsequent drawing operations */ 91/* Set the background shade for subsequent drawing operations */
92void grey_set_background(unsigned brightness) 92void grey_set_background(unsigned brightness)
93{ 93{
94 _GREY_BG_BRIGHTNESS(_grey_info.vp) = brightness; 94 _grey_info.vp->bg_pattern = brightness;
95} 95}
96 96
97/* Return the current background shade */ 97/* Return the current background shade */
98unsigned grey_get_background(void) 98unsigned grey_get_background(void)
99{ 99{
100 return _GREY_BG_BRIGHTNESS(_grey_info.vp); 100 return _grey_info.vp->bg_pattern;
101} 101}
102 102
103/* Set draw mode, foreground and background shades at once */ 103/* Set draw mode, foreground and background shades at once */
@@ -177,8 +177,8 @@ void grey_viewport_set_fullscreen(struct viewport *vp,
177 vp->y = 0; 177 vp->y = 0;
178 vp->width = _grey_info.width; 178 vp->width = _grey_info.width;
179 vp->height = _grey_info.height; 179 vp->height = _grey_info.height;
180 _GREY_FG_BRIGHTNESS(vp) = 0; 180 vp->fg_pattern = 0;
181 _GREY_BG_BRIGHTNESS(vp) = 255; 181 vp->bg_pattern = 255;
182 vp->drawmode = DRMODE_SOLID; 182 vp->drawmode = DRMODE_SOLID;
183 vp->font = FONT_SYSFIXED; 183 vp->font = FONT_SYSFIXED;
184 184
@@ -258,4 +258,3 @@ void grey_framebuffer_set_pos(int x, int y, int width, int height)
258 258
259 grey_update_clip_rect(); 259 grey_update_clip_rect();
260} 260}
261