From d146970ca1e5c9b0641301d50823d29b2e25c9e4 Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Tue, 7 Jan 2014 22:14:41 +0100 Subject: 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 --- apps/plugins/lib/grey_parm.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'apps/plugins/lib/grey_parm.c') 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) /* Set the foreground shade for subsequent drawing operations */ void grey_set_foreground(unsigned brightness) { - _GREY_FG_BRIGHTNESS(_grey_info.vp) = brightness; + _grey_info.vp->fg_pattern = brightness; } /* Return the current foreground shade */ unsigned grey_get_foreground(void) { - return _GREY_FG_BRIGHTNESS(_grey_info.vp); + return _grey_info.vp->fg_pattern; } /* Set the background shade for subsequent drawing operations */ void grey_set_background(unsigned brightness) { - _GREY_BG_BRIGHTNESS(_grey_info.vp) = brightness; + _grey_info.vp->bg_pattern = brightness; } /* Return the current background shade */ unsigned grey_get_background(void) { - return _GREY_BG_BRIGHTNESS(_grey_info.vp); + return _grey_info.vp->bg_pattern; } /* Set draw mode, foreground and background shades at once */ @@ -177,8 +177,8 @@ void grey_viewport_set_fullscreen(struct viewport *vp, vp->y = 0; vp->width = _grey_info.width; vp->height = _grey_info.height; - _GREY_FG_BRIGHTNESS(vp) = 0; - _GREY_BG_BRIGHTNESS(vp) = 255; + vp->fg_pattern = 0; + vp->bg_pattern = 255; vp->drawmode = DRMODE_SOLID; vp->font = FONT_SYSFIXED; @@ -258,4 +258,3 @@ void grey_framebuffer_set_pos(int x, int y, int width, int height) grey_update_clip_rect(); } - -- cgit v1.2.3