From ba26cd15313b7268d5ca6024f1a0a3aa260306e7 Mon Sep 17 00:00:00 2001 From: Jan Pieter Waagmeester Date: Tue, 24 Feb 2015 08:54:51 +0100 Subject: [PATCH] Fix #56, increase and decrease raw values, not scaled ones. --- src/setup.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/setup.c b/src/setup.c index 71c00b7..a38bb1e 100644 --- a/src/setup.c +++ b/src/setup.c @@ -37,8 +37,12 @@ int Setup_getNumItems(void) { return NUM_SETUP_ITEMS; } +int _getRawValue(int item) { + return NV_GetConfig(setupmenu[item].nvval); +} + float Setup_getValue(int item) { - int intval = NV_GetConfig(setupmenu[item].nvval); + int intval = _getRawValue(item); intval += setupmenu[item].offset; return ((float)intval) * setupmenu[item].multiplier; } @@ -49,7 +53,7 @@ void Setup_setValue(int item, int value) { } void Setup_increaseValue(int item, int amount) { - int curval = Setup_getValue(item) + amount; + int curval = _getRawValue(item) + amount; int maxval = setupmenu[item].maxval; if (curval > maxval) curval = maxval; @@ -58,7 +62,7 @@ void Setup_increaseValue(int item, int amount) { } void Setup_decreaseValue(int item, int amount) { - int curval = Setup_getValue(item) - amount; + int curval = _getRawValue(item) - amount; int minval = setupmenu[item].minval; if (curval < minval) curval = minval;