[Scummvm-git-logs] scummvm master -> 71172add9cffd7747cefe6d1c07f6fccc7460075

bluegr bluegr at gmail.com
Sun May 5 14:41:23 CEST 2019


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
71172add9c SCUMM: Original V0-V2 flashlight shape and size for MM/Zak (#10947, #10951)


Commit: 71172add9cffd7747cefe6d1c07f6fccc7460075
    https://github.com/scummvm/scummvm/commit/71172add9cffd7747cefe6d1c07f6fccc7460075
Author: Robert Crossfield (robcrossfield at gmail.com)
Date: 2019-05-05T15:41:20+03:00

Commit Message:
SCUMM: Original V0-V2 flashlight shape and size for MM/Zak (#10947, #10951)

Changed paths:
    engines/scumm/costume.cpp
    engines/scumm/gfx.cpp
    engines/scumm/saveload.cpp
    engines/scumm/scumm.cpp


diff --git a/engines/scumm/costume.cpp b/engines/scumm/costume.cpp
index dc29414..f33d599 100644
--- a/engines/scumm/costume.cpp
+++ b/engines/scumm/costume.cpp
@@ -1213,7 +1213,7 @@ byte V0CostumeRenderer::drawLimb(const Actor *a, int limb) {
 		palette[1] = 10;
 		palette[2] = actorV0Colors[_actorID];
 	} else {
-		palette[2] = 11;
+		palette[2] = (_vm->getCurrentLights() & LIGHTMODE_flashlight_on) ?  actorV0Colors[_actorID] : 11;
 		palette[3] = 11;
 	}
 
@@ -1378,7 +1378,7 @@ byte V0CostumeLoader::increaseAnim(Actor *a, int limb) {
 			// Use the previous frame
 			--a0->_cost.curpos[limb];
 
-			// Reset the comstume command
+			// Reset the costume command
 			a0->_costCommandNew = 0xFF;
 			a0->_costCommand = 0xFF;
 
diff --git a/engines/scumm/gfx.cpp b/engines/scumm/gfx.cpp
index f35c1e5..9bf5133 100644
--- a/engines/scumm/gfx.cpp
+++ b/engines/scumm/gfx.cpp
@@ -1460,27 +1460,32 @@ void ScummEngine_v5::drawFlashlight() {
 
 	blit(_flashlight.buffer, vs->pitch, bgbak, vs->pitch, _flashlight.w, _flashlight.h, vs->format.bytesPerPixel);
 
-	// Round the corners. To do so, we simply hard-code a set of nicely
-	// rounded corners.
-	static const int corner_data[] = { 8, 6, 4, 3, 2, 2, 1, 1 };
-	int minrow = 0;
-	int maxcol = (_flashlight.w - 1) * vs->format.bytesPerPixel;
-	int maxrow = (_flashlight.h - 1) * vs->pitch;
-
-	for (i = 0; i < 8; i++, minrow += vs->pitch, maxrow -= vs->pitch) {
-		int d = corner_data[i];
-
-		for (j = 0; j < d; j++) {
-			if (vs->format.bytesPerPixel == 2) {
-				WRITE_UINT16(&_flashlight.buffer[minrow + 2 * j], 0);
-				WRITE_UINT16(&_flashlight.buffer[minrow + maxcol - 2 * j], 0);
-				WRITE_UINT16(&_flashlight.buffer[maxrow + 2 * j], 0);
-				WRITE_UINT16(&_flashlight.buffer[maxrow + maxcol - 2 * j], 0);
-			} else {
-				_flashlight.buffer[minrow + j] = 0;
-				_flashlight.buffer[minrow + maxcol - j] = 0;
-				_flashlight.buffer[maxrow + j] = 0;
-				_flashlight.buffer[maxrow + maxcol - j] = 0;
+	// C64 does not round the flashlight
+	if (_game.platform != Common::kPlatformC64) {
+
+		// Round the corners. To do so, we simply hard-code a set of nicely
+		// rounded corners.
+		static const int corner_data[] = { 8, 6, 4, 3, 2, 2, 1, 1 };
+		int minrow = 0;
+		int maxcol = (_flashlight.w - 1) * vs->format.bytesPerPixel;
+		int maxrow = (_flashlight.h - 1) * vs->pitch;
+
+		for (i = 0; i < 8; i++, minrow += vs->pitch, maxrow -= vs->pitch) {
+			int d = corner_data[i];
+
+			for (j = 0; j < d; j++) {
+				if (vs->format.bytesPerPixel == 2) {
+					WRITE_UINT16(&_flashlight.buffer[minrow + 2 * j], 0);
+					WRITE_UINT16(&_flashlight.buffer[minrow + maxcol - 2 * j], 0);
+					WRITE_UINT16(&_flashlight.buffer[maxrow + 2 * j], 0);
+					WRITE_UINT16(&_flashlight.buffer[maxrow + maxcol - 2 * j], 0);
+				}
+				else {
+					_flashlight.buffer[minrow + j] = 0;
+					_flashlight.buffer[minrow + maxcol - j] = 0;
+					_flashlight.buffer[maxrow + j] = 0;
+					_flashlight.buffer[maxrow + maxcol - j] = 0;
+				}
 			}
 		}
 	}
diff --git a/engines/scumm/saveload.cpp b/engines/scumm/saveload.cpp
index 84dd16e..0997fd0 100644
--- a/engines/scumm/saveload.cpp
+++ b/engines/scumm/saveload.cpp
@@ -68,7 +68,7 @@ struct SaveInfoSection {
 
 #define SaveInfoSectionSize (4+4+4 + 4+4 + 4+2)
 
-#define CURRENT_VER 98
+#define CURRENT_VER 99
 #define INFOSECTION_VERSION 2
 
 #pragma mark -
@@ -1518,6 +1518,9 @@ void ScummEngine_v2::saveLoadWithSerializer(Common::Serializer &s) {
 	if (s.getVersion() < VER(79) && s.isLoading()) {
 		_inventoryOffset = 0;
 	}
+
+	s.syncAsByte(_flashlight.xStrips, VER(99));
+	s.syncAsByte(_flashlight.yStrips, VER(99));
 }
 
 void ScummEngine_v5::saveLoadWithSerializer(Common::Serializer &s) {
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index 2f6ea48..8d781a0 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -705,6 +705,8 @@ ScummEngine_v2::ScummEngine_v2(OSystem *syst, const DetectorResult &dr)
 	: ScummEngine_v3old(syst, dr) {
 
 	_inventoryOffset = 0;
+	_flashlight.xStrips = 6;
+	_flashlight.yStrips = 4;
 
 	VAR_SENTENCE_VERB = 0xFF;
 	VAR_SENTENCE_OBJECT1 = 0xFF;





More information about the Scummvm-git-logs mailing list