aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm
diff options
context:
space:
mode:
authorTobias Gunkel2012-02-04 15:40:36 +0100
committerTobias Gunkel2012-02-11 08:30:03 +0100
commitdaff6f36ae210bea03bc51f0e5293218f439cd89 (patch)
tree5de4c29ef6b94033ef923166ba313fde45b00c08 /engines/scumm
parente14e4ab3b035012781abfbac500e6de88e0ad60b (diff)
downloadscummvm-rg350-daff6f36ae210bea03bc51f0e5293218f439cd89.tar.gz
scummvm-rg350-daff6f36ae210bea03bc51f0e5293218f439cd89.tar.bz2
scummvm-rg350-daff6f36ae210bea03bc51f0e5293218f439cd89.zip
SCUMM: _currentLights is v0 only
Diffstat (limited to 'engines/scumm')
-rw-r--r--engines/scumm/gfx.cpp19
-rw-r--r--engines/scumm/scumm.cpp2
-rw-r--r--engines/scumm/scumm.h3
-rw-r--r--engines/scumm/scumm_v0.h3
4 files changed, 16 insertions, 11 deletions
diff --git a/engines/scumm/gfx.cpp b/engines/scumm/gfx.cpp
index a22aa1802f..a6b8377d2f 100644
--- a/engines/scumm/gfx.cpp
+++ b/engines/scumm/gfx.cpp
@@ -26,6 +26,7 @@
#include "scumm/he/intern_he.h"
#endif
#include "scumm/resource.h"
+#include "scumm/scumm_v0.h"
#include "scumm/scumm_v5.h"
#include "scumm/scumm_v6.h"
#include "scumm/usage_bits.h"
@@ -1487,15 +1488,17 @@ void ScummEngine_v5::drawFlashlight() {
_flashlight.isDrawn = true;
}
-// V0 Maniac doesn't have a ScummVar for VAR_CURRENT_LIGHTS, and just uses
-// an internal variable. Emulate this to prevent overwriting script vars...
-// And V6 games do not use the "lights" at all. There, the whole screen is
-// always visible, and actors are always colored, so we fake the correct
-// light value for it.
+int ScummEngine_v0::getCurrentLights() const {
+ // V0 Maniac doesn't have a ScummVar for VAR_CURRENT_LIGHTS, and just uses
+ // an internal variable. Emulate this to prevent overwriting script vars...
+ // And V6 games do not use the "lights" at all. There, the whole screen is
+ // always visible, and actors are always colored, so we fake the correct
+ // light value for it.
+ return _currentLights;
+}
+
int ScummEngine::getCurrentLights() const {
- if (_game.id == GID_MANIAC && _game.version == 0)
- return _currentLights;
- else if (_game.version >= 6)
+ if (_game.version >= 6)
return LIGHTMODE_room_lights_on | LIGHTMODE_actor_use_colors;
else
return VAR(VAR_CURRENT_LIGHTS);
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index 61d38dc593..d8b02d0881 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -263,7 +263,6 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr)
_bytesPerPixel = 1;
_doEffect = false;
_snapScroll = false;
- _currentLights = 0;
_shakeEnabled = false;
_shakeFrame = 0;
_screenStartStrip = 0;
@@ -713,6 +712,7 @@ ScummEngine_v0::ScummEngine_v0(OSystem *syst, const DetectorResult &dr)
: ScummEngine_v2(syst, dr) {
_currentMode = 0;
+ _currentLights = 0;
_activeVerb = kVerbNone;
_activeObject = 0;
diff --git a/engines/scumm/scumm.h b/engines/scumm/scumm.h
index fa04c5b616..f67536d3ed 100644
--- a/engines/scumm/scumm.h
+++ b/engines/scumm/scumm.h
@@ -942,8 +942,7 @@ protected:
public:
bool isLightOn() const;
- byte _currentLights;
- int getCurrentLights() const;
+ virtual int getCurrentLights() const;
protected:
void initScreens(int b, int h);
diff --git a/engines/scumm/scumm_v0.h b/engines/scumm/scumm_v0.h
index a64f108243..982b62d645 100644
--- a/engines/scumm/scumm_v0.h
+++ b/engines/scumm/scumm_v0.h
@@ -47,6 +47,7 @@ protected:
protected:
byte _currentMode;
+ byte _currentLights;
int _activeVerb; // selected verb
int _activeObject; // 1st selected object (see OBJECT_V0())
@@ -115,6 +116,8 @@ protected:
bool ifEqualActiveObject2Common(bool checkType);
+ virtual int getCurrentLights() const;
+
/* Version C64 script opcodes */
void o_stopCurrentScript();
void o_walkActorToObject();