Skip to content

Commit

Permalink
SCUMM: _currentLights is v0 only
Browse files Browse the repository at this point in the history
  • Loading branch information
tobigun committed Feb 11, 2012
1 parent e14e4ab commit daff6f3
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 11 deletions.
19 changes: 11 additions & 8 deletions engines/scumm/gfx.cpp
Expand Up @@ -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"
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion engines/scumm/scumm.cpp
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
3 changes: 1 addition & 2 deletions engines/scumm/scumm.h
Expand Up @@ -942,8 +942,7 @@ class ScummEngine : public Engine {
public:
bool isLightOn() const;

byte _currentLights;
int getCurrentLights() const;
virtual int getCurrentLights() const;

protected:
void initScreens(int b, int h);
Expand Down
3 changes: 3 additions & 0 deletions engines/scumm/scumm_v0.h
Expand Up @@ -47,6 +47,7 @@ class ScummEngine_v0 : public ScummEngine_v2 {

protected:
byte _currentMode;
byte _currentLights;

int _activeVerb; // selected verb
int _activeObject; // 1st selected object (see OBJECT_V0())
Expand Down Expand Up @@ -115,6 +116,8 @@ class ScummEngine_v0 : public ScummEngine_v2 {

bool ifEqualActiveObject2Common(bool checkType);

virtual int getCurrentLights() const;

/* Version C64 script opcodes */
void o_stopCurrentScript();
void o_walkActorToObject();
Expand Down

0 comments on commit daff6f3

Please sign in to comment.