[Scummvm-git-logs] scummvm master -> cafec8773d4a5b9b38da9d12ee68ec6ad02bf163

bgK bastien.bouclet at gmail.com
Sat Aug 12 09:04:00 CEST 2017


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:
cafec8773d MOHAWK: Myst: Fix incorrect vault instructions using image patch


Commit: cafec8773d4a5b9b38da9d12ee68ec6ad02bf163
    https://github.com/scummvm/scummvm/commit/cafec8773d4a5b9b38da9d12ee68ec6ad02bf163
Author: Bastien Bouclet (bastien.bouclet at gmail.com)
Date: 2017-08-12T09:02:51+02:00

Commit Message:
MOHAWK: Myst: Fix incorrect vault instructions using image patch

Thanks to dafioram for providing the replacement image.

Fixes #10115.

Changed paths:
    engines/mohawk/myst_graphics.cpp
    engines/mohawk/myst_graphics.h


diff --git a/engines/mohawk/myst_graphics.cpp b/engines/mohawk/myst_graphics.cpp
index 0aceb1d..9b0d33e 100644
--- a/engines/mohawk/myst_graphics.cpp
+++ b/engines/mohawk/myst_graphics.cpp
@@ -97,7 +97,7 @@ MohawkSurface *MystGraphics::decodeImage(uint16 id) {
 		Image::PICTDecoder pict;
 
 		if (!pict.loadStream(*dataStream))
-			error("Could not decode Myst ME PICT");
+			error("Could not decode Myst ME PICT %d", id);
 
 		delete dataStream;
 
@@ -113,9 +113,80 @@ MohawkSurface *MystGraphics::decodeImage(uint16 id) {
 	}
 
 	assert(mhkSurface);
+	applyImagePatches(id, mhkSurface);
 	return mhkSurface;
 }
 
+void MystGraphics::applyImagePatches(uint16 id, const MohawkSurface *mhkSurface) const {
+
+	// In the English ME version of the game, the instructions found on Stoneship
+	// to open the vault are incorrect. They are:
+	//     Turn every one of [these switches to the] "off" position.
+	// They should be:
+	//     Turn every one of [these switches to the] "on" position.
+	//
+	// Here we stomp over the "off" with an "on".
+	// The fixed image was provided by dafioram in bug Trac#10115.
+	if (id == 2019 && _vm->getFeatures() & GF_ME && _vm->getLanguage() == Common::EN_ANY) {
+		static const byte markerSwitchInstructionsFixPic[] = {
+				0x1d, 0x1c, 0x19, 0x19, 0x19, 0x19, 0x1c, 0x19, 0x19, 0x17, 0x19, 0x19, 0x19, 0x19, 0x19,
+				0x1e, 0x1e, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19,
+				0x1c, 0x19, 0x19, 0x19, 0x1c, 0x19, 0x19, 0x19, 0x1c, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19,
+				0x1d, 0x1e, 0x16, 0x0d, 0x0e, 0x12, 0x19, 0x19, 0x17, 0x10, 0x06, 0x05, 0x19, 0x19, 0x19,
+				0x1e, 0x1e, 0x10, 0x13, 0x1c, 0x11, 0x0d, 0x19, 0x12, 0x09, 0x16, 0x04, 0x18, 0x18, 0x19,
+				0x1e, 0x1a, 0x03, 0x1b, 0x1c, 0x17, 0x02, 0x15, 0x13, 0x00, 0x19, 0x06, 0x18, 0x19, 0x18,
+				0x1e, 0x1e, 0x01, 0x1b, 0x1c, 0x1b, 0x02, 0x15, 0x13, 0x00, 0x19, 0x07, 0x0a, 0x19, 0x18,
+				0x1e, 0x1c, 0x0c, 0x0e, 0x14, 0x0c, 0x0c, 0x19, 0x0b, 0x00, 0x19, 0x00, 0x08, 0x19, 0x19,
+				0x1e, 0x1c, 0x19, 0x14, 0x0f, 0x0f, 0x14, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x17,
+				0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19,
+				0x1c, 0x1c, 0x1e, 0x19, 0x19, 0x19, 0x17, 0x19, 0x19, 0x17, 0x19, 0x19, 0x19, 0x19, 0x19
+		};
+
+		static const byte markerSwitchInstructionsFixPal[] = {
+				0x00, 0x00, 0x00,
+				0x10, 0x08, 0x08,
+				0x18, 0x10, 0x10,
+				0x28, 0x10, 0x08,
+				0x20, 0x18, 0x18,
+				0x28, 0x20, 0x20,
+				0x38, 0x20, 0x10,
+				0x30, 0x28, 0x20,
+				0x38, 0x30, 0x28,
+				0x40, 0x38, 0x28,
+				0x48, 0x38, 0x28,
+				0x48, 0x40, 0x30,
+				0x50, 0x48, 0x38,
+				0x50, 0x48, 0x40,
+				0x60, 0x50, 0x38,
+				0x68, 0x58, 0x40,
+				0x68, 0x58, 0x48,
+				0x70, 0x60, 0x50,
+				0x78, 0x68, 0x50,
+				0x80, 0x70, 0x50,
+				0x80, 0x78, 0x60,
+				0x88, 0x80, 0x60,
+				0x98, 0x90, 0x70,
+				0xb0, 0xa0, 0x78,
+				0xb8, 0xa8, 0x8d,
+				0xb8, 0xa8, 0x90,
+				0xb8, 0xb0, 0x88,
+				0xc0, 0xb8, 0x90,
+				0xd8, 0xcc, 0x98,
+				0xd0, 0xe0, 0xc8,
+				0xf0, 0xe4, 0xc8
+		};
+
+		Graphics::Surface fixSurf;
+		fixSurf.create(15, 11, Graphics::PixelFormat::createFormatCLUT8());
+		fixSurf.copyRectToSurface(markerSwitchInstructionsFixPic, fixSurf.w, 0, 0, fixSurf.w, fixSurf.h);
+		fixSurf.convertToInPlace(_pixelFormat, markerSwitchInstructionsFixPal);
+
+		mhkSurface->getSurface()->copyRectToSurface(fixSurf, 171, 208, Common::Rect(fixSurf.w, fixSurf.h));
+
+		fixSurf.free();
+	}
+}
+
 void MystGraphics::copyImageSectionToScreen(uint16 image, Common::Rect src, Common::Rect dest) {
 	Graphics::Surface *surface = findImage(image)->getSurface();
 
diff --git a/engines/mohawk/myst_graphics.h b/engines/mohawk/myst_graphics.h
index 173e023..44669bd 100644
--- a/engines/mohawk/myst_graphics.h
+++ b/engines/mohawk/myst_graphics.h
@@ -82,6 +82,8 @@ private:
 
 	void remapSurfaceToSystemPalette(MohawkSurface *mhkSurface);
 	byte getColorIndex(const byte *palette, byte red, byte green, byte blue);
+
+	void applyImagePatches(uint16 id, const MohawkSurface *mhkSurface) const;
 };
 
 } // End of namespace Mohawk





More information about the Scummvm-git-logs mailing list