aboutsummaryrefslogtreecommitdiff
path: root/engines/sludge/builtin.cpp
diff options
context:
space:
mode:
authorSimei Yin2018-04-27 19:12:30 +0200
committerSimei Yin2018-04-27 19:48:29 +0200
commitda491601d4fca4deebe8d1a4a18e67fe48dff55d (patch)
tree53d18f67a2893bf3f870d7174a17d84392460d35 /engines/sludge/builtin.cpp
parent5ced49576924c18dd3d04c08f4e1822f21c52894 (diff)
downloadscummvm-rg350-da491601d4fca4deebe8d1a4a18e67fe48dff55d.tar.gz
scummvm-rg350-da491601d4fca4deebe8d1a4a18e67fe48dff55d.tar.bz2
scummvm-rg350-da491601d4fca4deebe8d1a4a18e67fe48dff55d.zip
SLUDGE: Move global variable brightnessLevel to GraphicsManager and refactor save&load
Diffstat (limited to 'engines/sludge/builtin.cpp')
-rw-r--r--engines/sludge/builtin.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/engines/sludge/builtin.cpp b/engines/sludge/builtin.cpp
index 909118a2dd..bc635f88cd 100644
--- a/engines/sludge/builtin.cpp
+++ b/engines/sludge/builtin.cpp
@@ -67,7 +67,6 @@ extern int numBIFNames, numUserFunc;
extern Common::String *allUserFunc;
extern Common::String *allBIFNames;
-extern byte brightnessLevel;
extern byte fadeMode;
extern uint16 saveEncoding;
@@ -1971,17 +1970,12 @@ builtIn(setFontSpacing) {
builtIn(transitionLevel) {
UNUSEDALL
- int number;
- if (!getValueType(number, SVT_INT, fun->stack->thisVar))
+ int brightnessLevel;
+ if (!getValueType(brightnessLevel, SVT_INT, fun->stack->thisVar))
return BR_ERROR;
trimStack(fun->stack);
- if (number < 0)
- brightnessLevel = 0;
- else if (number > 255)
- brightnessLevel = 255;
- else
- brightnessLevel = number;
+ g_sludge->_gfxMan->setBrightnessLevel(brightnessLevel);
setVariable(fun->reg, SVT_INT, 1);
return BR_CONTINUE;