[Scummvm-cvs-logs] SF.net SVN: scummvm: [21286] scummvm/trunk/engines/scumm

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Tue Mar 14 05:37:01 CET 2006


Revision: 21286
Author:   fingolfin
Date:     2006-03-14 05:36:13 -0800 (Tue, 14 Mar 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=21286&view=rev

Log Message:
-----------
Enhance the new getCurrentLights to work for V6+ games, too, making it possible to remove several special cases throughout the code

Modified Paths:
--------------
    scummvm/trunk/engines/scumm/costume.cpp
    scummvm/trunk/engines/scumm/gfx.cpp
    scummvm/trunk/engines/scumm/scumm.cpp
Modified: scummvm/trunk/engines/scumm/costume.cpp
===================================================================
--- scummvm/trunk/engines/scumm/costume.cpp	2006-03-14 13:28:28 UTC (rev 21285)
+++ scummvm/trunk/engines/scumm/costume.cpp	2006-03-14 13:36:13 UTC (rev 21286)
@@ -837,7 +837,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_color) {
 			memcpy(_palette, palette, 16);
 		} else {
 			memset(_palette, 8, 16);
@@ -845,7 +845,7 @@
 		}
 		_palette[_loaded._palette[0]] = _palette[0];
 	} else {
-		if (_vm->_game.version >= 6 || (_vm->getCurrentLights() & LIGHTMODE_actor_color)) {
+		if (_vm->getCurrentLights() & LIGHTMODE_actor_color) {
 			for (i = 0; i < _loaded._numColors; i++) {
 				color = palette[i];
 				if (color == 255)
@@ -1019,12 +1019,12 @@
 
 	// Set up the palette data
 	byte palette[4] = { 0, 0, 0, 0 };
-	if (!(_vm->getCurrentLights() & LIGHTMODE_actor_color)) {
+	if (_vm->getCurrentLights() & LIGHTMODE_actor_color) {
+		palette[1] = 10;
+		palette[2] = actorColorsMMC64[_actorID];
+	} else {
 		palette[2] = 11;
 		palette[3] = 11;
-	} else {
-		palette[1] = 10;
-		palette[2] = actorColorsMMC64[_actorID];
 	}
 
 	int width = *data++;

Modified: scummvm/trunk/engines/scumm/gfx.cpp
===================================================================
--- scummvm/trunk/engines/scumm/gfx.cpp	2006-03-14 13:28:28 UTC (rev 21285)
+++ scummvm/trunk/engines/scumm/gfx.cpp	2006-03-14 13:36:13 UTC (rev 21286)
@@ -1172,15 +1172,20 @@
 
 // C64 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::getCurrentLights() const {
 	if (_game.id == GID_MANIAC && _game.platform == Common::kPlatformC64)
 		return _currentLights;
+	else if (_game.version >= 6)
+		return LIGHTMODE_screen | LIGHTMODE_actor_color;
 	else
 		return VAR(VAR_CURRENT_LIGHTS);
 }
 
 bool ScummEngine::isLightOn() const {
-	return (_game.version >= 6) || (getCurrentLights() & LIGHTMODE_screen);
+	return (getCurrentLights() & LIGHTMODE_screen);
 }
 
 void ScummEngine::setShake(int mode) {

Modified: scummvm/trunk/engines/scumm/scumm.cpp
===================================================================
--- scummvm/trunk/engines/scumm/scumm.cpp	2006-03-14 13:28:28 UTC (rev 21285)
+++ scummvm/trunk/engines/scumm/scumm.cpp	2006-03-14 13:36:13 UTC (rev 21286)
@@ -2060,8 +2060,7 @@
 		setActorRedrawFlags();
 		resetActorBgs();
 
-		if (_game.version <= 5 &&
-		    !(getCurrentLights() & LIGHTMODE_screen) &&
+		if (!(getCurrentLights() & LIGHTMODE_screen) &&
 		      getCurrentLights() & LIGHTMODE_flashlight) {
 			drawFlashlight();
 			setActorRedrawFlags();


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