summaryrefslogtreecommitdiffstats
path: root/uisimulator/common
diff options
context:
space:
mode:
authorBertrik Sikken <bertrik@sikken.nl>2011-10-30 20:06:30 +0000
committerBertrik Sikken <bertrik@sikken.nl>2011-10-30 20:06:30 +0000
commit539fb71b9d9eda14c0e370519c38ed4d503d3994 (patch)
tree510e073ad39115525d6ae76b35906c996b63d5ff /uisimulator/common
parent10832b8c1c5d8c5daed5c488d491c82527bedaa4 (diff)
downloadrockbox-539fb71b9d9eda14c0e370519c38ed4d503d3994.tar.gz
rockbox-539fb71b9d9eda14c0e370519c38ed4d503d3994.tar.bz2
rockbox-539fb71b9d9eda14c0e370519c38ed4d503d3994.zip
Fix simulator brightness calculation in case MIN_BRIGHTNESS_SETTING != 1
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30870 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'uisimulator/common')
-rw-r--r--uisimulator/common/backlight-sim.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/uisimulator/common/backlight-sim.c b/uisimulator/common/backlight-sim.c
index f5da77a782..f60a218c41 100644
--- a/uisimulator/common/backlight-sim.c
+++ b/uisimulator/common/backlight-sim.c
@@ -41,7 +41,8 @@ bool _backlight_init(void)
static inline int normalize_backlight(int val)
{
/* normalize to xx% brightness for sdl */
- return ((val - MIN_BRIGHTNESS_SETTING + 1) * 100)/MAX_BRIGHTNESS_SETTING;
+ return ((val - MIN_BRIGHTNESS_SETTING + 1) * 100) /
+ (MAX_BRIGHTNESS_SETTING - MIN_BRIGHTNESS_SETTING + 1);
}
void _backlight_set_brightness(int val)