diff options
author | Max Horn | 2006-03-14 14:06:44 +0000 |
---|---|---|
committer | Max Horn | 2006-03-14 14:06:44 +0000 |
commit | 0cc41c7cbb1fc4078f94afb9c0b62fe4b6ae8bae (patch) | |
tree | 608ed00abed301d05703b79684851aaf70956f86 /engines | |
parent | 9673573bec897126c53607089825706e40c92a1c (diff) | |
download | scummvm-rg350-0cc41c7cbb1fc4078f94afb9c0b62fe4b6ae8bae.tar.gz scummvm-rg350-0cc41c7cbb1fc4078f94afb9c0b62fe4b6ae8bae.tar.bz2 scummvm-rg350-0cc41c7cbb1fc4078f94afb9c0b62fe4b6ae8bae.zip |
Renamed & documented the LIGHTMODE flags
svn-id: r21288
Diffstat (limited to 'engines')
-rw-r--r-- | engines/scumm/costume.cpp | 26 | ||||
-rw-r--r-- | engines/scumm/gfx.cpp | 4 | ||||
-rw-r--r-- | engines/scumm/scumm.cpp | 4 | ||||
-rw-r--r-- | engines/scumm/scumm.h | 35 | ||||
-rw-r--r-- | engines/scumm/vars.cpp | 4 |
5 files changed, 51 insertions, 22 deletions
diff --git a/engines/scumm/costume.cpp b/engines/scumm/costume.cpp index af15257b32..a5e0e7d0da 100644 --- a/engines/scumm/costume.cpp +++ b/engines/scumm/costume.cpp @@ -354,15 +354,19 @@ void ClassicCostumeRenderer::procC64(Codec1 &v1, int actor) { // Set up the palette data byte palette[4] = { 0, 0, 0, 0 }; - if (!(_vm->getCurrentLights() & LIGHTMODE_actor_color)) { + if (_vm->getCurrentLights() & LIGHTMODE_actor_use_colors) { + if (_vm->_game.id == GID_MANIAC) { + palette[1] = v1MMActorPalatte1[actor]; + palette[2] = v1MMActorPalatte2[actor]; + } else { + // FIXME: Fingolfin asks: Can we ever see kPlatformC64 here? + // After all, we already have C64CostumeRenderer, right? + palette[1] = (_vm->_game.platform == Common::kPlatformC64) ? 10 : 8; + palette[2] = _palette[actor]; + } + } else { palette[2] = 11; palette[3] = 11; - } else if (_vm->_game.id == GID_MANIAC) { - palette[1] = v1MMActorPalatte1[actor]; - palette[2] = v1MMActorPalatte2[actor]; - } else { - palette[1] = (_vm->_game.platform == Common::kPlatformC64) ? 10 : 8; - palette[2] = _palette[actor]; } mask = v1.mask_ptr; @@ -614,7 +618,7 @@ byte NESCostumeRenderer::drawLimb(const Actor *a, int limb) { if (cost.curpos[limb] == 0xFFFF) return 0; - if (_vm->getCurrentLights() & LIGHTMODE_actor_base) + if (_vm->getCurrentLights() & LIGHTMODE_actor_use_base_palette) palette = _vm->_NESPalette[1]; else palette = darkpalette; @@ -837,7 +841,7 @@ void ClassicCostumeRenderer::setPalette(byte *palette) { if (_loaded._format == 0x57) { memcpy(_palette, palette, 13); } else if (_vm->_game.features & GF_OLD_BUNDLE) { - if (_vm->getCurrentLights() & LIGHTMODE_actor_color) { + if (_vm->getCurrentLights() & LIGHTMODE_actor_use_colors) { memcpy(_palette, palette, 16); } else { memset(_palette, 8, 16); @@ -845,7 +849,7 @@ void ClassicCostumeRenderer::setPalette(byte *palette) { } _palette[_loaded._palette[0]] = _palette[0]; } else { - if (_vm->getCurrentLights() & LIGHTMODE_actor_color) { + if (_vm->getCurrentLights() & LIGHTMODE_actor_use_colors) { for (i = 0; i < _loaded._numColors; i++) { color = palette[i]; if (color == 255) @@ -1019,7 +1023,7 @@ byte C64CostumeRenderer::drawLimb(const Actor *a, int limb) { // Set up the palette data byte palette[4] = { 0, 0, 0, 0 }; - if (_vm->getCurrentLights() & LIGHTMODE_actor_color) { + if (_vm->getCurrentLights() & LIGHTMODE_actor_use_colors) { palette[1] = 10; palette[2] = actorColorsMMC64[_actorID]; } else { diff --git a/engines/scumm/gfx.cpp b/engines/scumm/gfx.cpp index 37affec485..95df2e4e20 100644 --- a/engines/scumm/gfx.cpp +++ b/engines/scumm/gfx.cpp @@ -1179,13 +1179,13 @@ int ScummEngine::getCurrentLights() const { if (_game.id == GID_MANIAC && _game.platform == Common::kPlatformC64) return _currentLights; else if (_game.version >= 6) - return LIGHTMODE_screen | LIGHTMODE_actor_color; + return LIGHTMODE_room_lights_on | LIGHTMODE_actor_use_colors; else return VAR(VAR_CURRENT_LIGHTS); } bool ScummEngine::isLightOn() const { - return (getCurrentLights() & LIGHTMODE_screen); + return (getCurrentLights() & LIGHTMODE_room_lights_on); } void ScummEngine::setShake(int mode) { diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index 1eda957bf1..d429538ccc 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -2060,8 +2060,8 @@ load_game: setActorRedrawFlags(); resetActorBgs(); - if (!(getCurrentLights() & LIGHTMODE_screen) && - getCurrentLights() & LIGHTMODE_flashlight) { + if (!(getCurrentLights() & LIGHTMODE_room_lights_on) && + getCurrentLights() & LIGHTMODE_flashlight_on) { drawFlashlight(); setActorRedrawFlags(); } diff --git a/engines/scumm/scumm.h b/engines/scumm/scumm.h index c2d1e4aee0..48f8081f2d 100644 --- a/engines/scumm/scumm.h +++ b/engines/scumm/scumm.h @@ -176,11 +176,36 @@ struct VerbSlot; struct ObjectData; enum { - LIGHTMODE_dark = 0, - LIGHTMODE_actor_base = 1, - LIGHTMODE_screen = 2, - LIGHTMODE_flashlight = 4, - LIGHTMODE_actor_color = 8 + /** + * Lighting flag that indicates whether the normal palette, or the 'dark' + * palette shall be used to draw actors. + * Apparantly only used in very old games (so far only NESCostumeRenderer + * checks it). + */ + LIGHTMODE_actor_use_base_palette = 1 << 0, + + /** + * Lighting flag that indicates whether the room is currently lit. Normally + * always on. Used for rooms in which the light can be switched "off". + */ + LIGHTMODE_room_lights_on = 1 << 1, + + /** + * Lighting flag that indicates whether a flashlight like device is active. + * Used in Loom (flashlight follows the actor) and Indy 3 (flashlight + * follows the mouse). Only has any effect if the room lights are off. + */ + LIGHTMODE_flashlight_on = 1 << 2, + + /** + * Lighting flag that indicates whether actors are to be drawn with their + * own custom palette, or using a fixed 'dark' palette. This is the + * modern successor of LIGHTMODE_actor_use_base_palette. + * Note: It is tempting to 'merge' these two flags, but since flags can + * check their values, this is probably not a good idea. + */ + LIGHTMODE_actor_use_colors = 1 << 3 + // }; enum { diff --git a/engines/scumm/vars.cpp b/engines/scumm/vars.cpp index 3c4de18390..b47332c60d 100644 --- a/engines/scumm/vars.cpp +++ b/engines/scumm/vars.cpp @@ -546,7 +546,7 @@ void ScummEngine_c64::initScummVars() { VAR(VAR_EGO) = 3; // Setup light - _currentLights = LIGHTMODE_actor_base | LIGHTMODE_actor_color | LIGHTMODE_screen; + _currentLights = LIGHTMODE_actor_use_base_palette | LIGHTMODE_actor_use_colors | LIGHTMODE_room_lights_on; } void ScummEngine_v2::initScummVars() { @@ -564,7 +564,7 @@ void ScummEngine_v5::initScummVars() { VAR(VAR_V5_TALK_STRING_Y) = -0x50; // Setup light - VAR(VAR_CURRENT_LIGHTS) = LIGHTMODE_actor_base | LIGHTMODE_actor_color | LIGHTMODE_screen; + VAR(VAR_CURRENT_LIGHTS) = LIGHTMODE_actor_use_base_palette | LIGHTMODE_actor_use_colors | LIGHTMODE_room_lights_on; if (_game.id == GID_MONKEY) _scummVars[74] = 1225; |