summaryrefslogtreecommitdiff
path: root/firmware/target
diff options
context:
space:
mode:
authorSebastian Leonhardt <sebastian.leonhardt@web.de>2018-04-04 16:28:53 +0200
committerSolomon Peachy <pizza@shaftnet.org>2019-02-07 22:52:07 +0100
commit666405f346bef501a6707c4b152704f5c34246c6 (patch)
tree7dcf80583d3a9978eac5634c9558c461b7a71690 /firmware/target
parent287685932e53849192020092bce7d7a21d9e2a71 (diff)
downloadrockbox-666405f346bef501a6707c4b152704f5c34246c6.tar.gz
rockbox-666405f346bef501a6707c4b152704f5c34246c6.zip
Simulator: improve simulation of transflective screens
This patch simulates the three possible states of a transflective LCD: backlight on (bright screen as usual), backlight off (dimmed screen) and LCD off (black screen). Makes use of already defined 'BACKLIGHT_OFF_ALPHA'. Change-Id: I9b0fc79b8d50c29e024ba1e6d9c2501119a7e0e0
Diffstat (limited to 'firmware/target')
-rw-r--r--firmware/target/hosted/sdl/lcd-bitmap.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/firmware/target/hosted/sdl/lcd-bitmap.c b/firmware/target/hosted/sdl/lcd-bitmap.c
index 5f895d802d..aefbb17b42 100644
--- a/firmware/target/hosted/sdl/lcd-bitmap.c
+++ b/firmware/target/hosted/sdl/lcd-bitmap.c
@@ -162,7 +162,15 @@ void sim_backlight(int value)
162#endif 162#endif
163 } 163 }
164#else /* LCD_DEPTH > 8 */ 164#else /* LCD_DEPTH > 8 */
165#ifdef HAVE_TRANSFLECTIVE_LCD
166 if (!lcd_active())
167 SDL_SetAlpha(lcd_surface, SDL_SRCALPHA, 0);
168 else
169 SDL_SetAlpha(lcd_surface, SDL_SRCALPHA,
170 MAX(BACKLIGHT_OFF_ALPHA, (value * 255) / 100));
171#else
165 SDL_SetAlpha(lcd_surface, SDL_SRCALPHA, (value * 255) / 100); 172 SDL_SetAlpha(lcd_surface, SDL_SRCALPHA, (value * 255) / 100);
173#endif
166#endif /* LCD_DEPTH */ 174#endif /* LCD_DEPTH */
167 175
168 sdl_gui_update(lcd_surface, 0, 0, SIM_LCD_WIDTH, SIM_LCD_HEIGHT, 176 sdl_gui_update(lcd_surface, 0, 0, SIM_LCD_WIDTH, SIM_LCD_HEIGHT,