[Scummvm-cvs-logs] SF.net SVN: scummvm: [21288] scummvm/trunk/engines/scumm
fingolfin at users.sourceforge.net
fingolfin at users.sourceforge.net
Tue Mar 14 06:07:05 CET 2006
Revision: 21288
Author: fingolfin
Date: 2006-03-14 06:06:44 -0800 (Tue, 14 Mar 2006)
ViewCVS: http://svn.sourceforge.net/scummvm/?rev=21288&view=rev
Log Message:
-----------
Renamed & documented the LIGHTMODE flags
Modified Paths:
--------------
scummvm/trunk/engines/scumm/costume.cpp
scummvm/trunk/engines/scumm/gfx.cpp
scummvm/trunk/engines/scumm/scumm.cpp
scummvm/trunk/engines/scumm/scumm.h
scummvm/trunk/engines/scumm/vars.cpp
Modified: scummvm/trunk/engines/scumm/costume.cpp
===================================================================
--- scummvm/trunk/engines/scumm/costume.cpp 2006-03-14 13:37:15 UTC (rev 21287)
+++ scummvm/trunk/engines/scumm/costume.cpp 2006-03-14 14:06:44 UTC (rev 21288)
@@ -354,15 +354,19 @@
// 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 @@
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 @@
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 @@
}
_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 @@
// 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 {
Modified: scummvm/trunk/engines/scumm/gfx.cpp
===================================================================
--- scummvm/trunk/engines/scumm/gfx.cpp 2006-03-14 13:37:15 UTC (rev 21287)
+++ scummvm/trunk/engines/scumm/gfx.cpp 2006-03-14 14:06:44 UTC (rev 21288)
@@ -1179,13 +1179,13 @@
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) {
Modified: scummvm/trunk/engines/scumm/scumm.cpp
===================================================================
--- scummvm/trunk/engines/scumm/scumm.cpp 2006-03-14 13:37:15 UTC (rev 21287)
+++ scummvm/trunk/engines/scumm/scumm.cpp 2006-03-14 14:06:44 UTC (rev 21288)
@@ -2060,8 +2060,8 @@
setActorRedrawFlags();
resetActorBgs();
- if (!(getCurrentLights() & LIGHTMODE_screen) &&
- getCurrentLights() & LIGHTMODE_flashlight) {
+ if (!(getCurrentLights() & LIGHTMODE_room_lights_on) &&
+ getCurrentLights() & LIGHTMODE_flashlight_on) {
drawFlashlight();
setActorRedrawFlags();
}
Modified: scummvm/trunk/engines/scumm/scumm.h
===================================================================
--- scummvm/trunk/engines/scumm/scumm.h 2006-03-14 13:37:15 UTC (rev 21287)
+++ scummvm/trunk/engines/scumm/scumm.h 2006-03-14 14:06:44 UTC (rev 21288)
@@ -176,11 +176,36 @@
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 {
Modified: scummvm/trunk/engines/scumm/vars.cpp
===================================================================
--- scummvm/trunk/engines/scumm/vars.cpp 2006-03-14 13:37:15 UTC (rev 21287)
+++ scummvm/trunk/engines/scumm/vars.cpp 2006-03-14 14:06:44 UTC (rev 21288)
@@ -546,7 +546,7 @@
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 @@
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;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list