[Scummvm-git-logs] scummvm master -> 4e774450869855e4fd990716db63370a66c2d108

bgK bastien.bouclet at gmail.com
Thu May 17 20:49:47 CEST 2018


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

Summary:
2a02e0311d MOHAWK: Remove midi playback
44fd44ccc9 MOHAWK: Remove detection entries for games not supported by the engines
6798f9c77e MOHAWK: Don't allow displaying the map when the game is not interactive
4e77445086 MOHAWK: MYST: Opcode 102 in Channelwood can only set the volume to non 0 values


Commit: 2a02e0311d6d958d5aa2a71c80677beeeb369a95
    https://github.com/scummvm/scummvm/commit/2a02e0311d6d958d5aa2a71c80677beeeb369a95
Author: Bastien Bouclet (bastien.bouclet at gmail.com)
Date: 2018-05-17T20:49:28+02:00

Commit Message:
MOHAWK: Remove midi playback

This was unused and not touched for many years

Changed paths:
    engines/mohawk/detection_tables.h
    engines/mohawk/mohawk.h
    engines/mohawk/sound.cpp
    engines/mohawk/sound.h


diff --git a/engines/mohawk/detection_tables.h b/engines/mohawk/detection_tables.h
index 6dac0b8..31c8146 100644
--- a/engines/mohawk/detection_tables.h
+++ b/engines/mohawk/detection_tables.h
@@ -630,7 +630,7 @@ static const MohawkGameDescription gameDescriptions[] = {
 			GUIO1(GUIO_NOASPECT)
 		},
 		GType_ZOOMBINI,
-		GF_HASMIDI,
+		0,
 		0
 	},
 
@@ -645,7 +645,7 @@ static const MohawkGameDescription gameDescriptions[] = {
 			GUIO1(GUIO_NOASPECT)
 		},
 		GType_ZOOMBINI,
-		GF_HASMIDI,
+		0,
 		0
 	},
 
@@ -660,7 +660,7 @@ static const MohawkGameDescription gameDescriptions[] = {
 			GUIO1(GUIO_NOASPECT)
 		},
 		GType_ZOOMBINI,
-		GF_HASMIDI,
+		0,
 		0
 	},
 
@@ -675,7 +675,7 @@ static const MohawkGameDescription gameDescriptions[] = {
 			GUIO1(GUIO_NOASPECT)
 		},
 		GType_ZOOMBINI,
-		GF_HASMIDI,
+		0,
 		0
 	},
 
@@ -690,7 +690,7 @@ static const MohawkGameDescription gameDescriptions[] = {
 			GUIO1(GUIO_NOASPECT)
 		},
 		GType_ZOOMBINI,
-		GF_HASMIDI,
+		0,
 		0
 	},
 
@@ -962,7 +962,7 @@ static const MohawkGameDescription gameDescriptions[] = {
 			GUIO1(GUIO_NOASPECT)
 		},
 		GType_JAMESMATH,
-		GF_HASMIDI,
+		0,
 		0
 	},
 
@@ -978,7 +978,7 @@ static const MohawkGameDescription gameDescriptions[] = {
 			GUIO1(GUIO_NOASPECT)
 		},
 		GType_JAMESMATH,
-		GF_HASMIDI,
+		0,
 		0
 	},
 
@@ -993,7 +993,7 @@ static const MohawkGameDescription gameDescriptions[] = {
 			GUIO1(GUIO_NOASPECT)
 		},
 		GType_TREEHOUSE,
-		GF_HASMIDI,
+		0,
 		0
 	},
 
@@ -1115,7 +1115,7 @@ static const MohawkGameDescription gameDescriptions[] = {
 			GUIO1(GUIO_NOASPECT)
 		},
 		GType_1STDEGREE,
-		GF_HASMIDI,
+		0,
 		0
 	},
 
@@ -1133,7 +1133,7 @@ static const MohawkGameDescription gameDescriptions[] = {
 			GUIO1(GUIO_NOASPECT)
 		},
 		GType_1STDEGREE,
-		GF_HASMIDI,
+		0,
 		0
 	},
 
diff --git a/engines/mohawk/mohawk.h b/engines/mohawk/mohawk.h
index a3583a5..880863b 100644
--- a/engines/mohawk/mohawk.h
+++ b/engines/mohawk/mohawk.h
@@ -68,8 +68,7 @@ enum MohawkGameFeatures {
 	GF_ME =      (1 << 0),	// Myst Masterpiece Edition
 	GF_DVD =     (1 << 1),
 	GF_DEMO =    (1 << 2),
-	GF_HASMIDI = (1 << 3),
-	GF_LB_10   = (1 << 4)   // very early Living Books 1.0 games
+	GF_LB_10   = (1 << 3)   // very early Living Books 1.0 games
 };
 
 struct MohawkGameDescription;
diff --git a/engines/mohawk/sound.cpp b/engines/mohawk/sound.cpp
index 5e0cae1..2b9047c 100644
--- a/engines/mohawk/sound.cpp
+++ b/engines/mohawk/sound.cpp
@@ -180,42 +180,12 @@ Audio::RewindableAudioStream *makeMohawkWaveStream(Common::SeekableReadStream *s
 	return nullptr;
 }
 
-Sound::Sound(MohawkEngine* vm) : _vm(vm) {
-	_midiDriver = nullptr;
-	_midiParser = nullptr;
-	_midiData = nullptr;
-	initMidi();
+Sound::Sound(MohawkEngine* vm) :
+		_vm(vm) {
 }
 
 Sound::~Sound() {
 	stopSound();
-
-	if (_midiParser) {
-		_midiParser->unloadMusic();
-		delete _midiParser;
-	}
-
-	if (_midiDriver) {
-		_midiDriver->close();
-		delete _midiDriver;
-	}
-
-	if (_midiData)
-		delete[] _midiData;
-}
-
-void Sound::initMidi() {
-	if (!(_vm->getFeatures() & GF_HASMIDI))
-		return;
-
-	// Let's get our MIDI parser/driver
-	_midiParser = MidiParser::createParser_SMF();
-	_midiDriver = MidiDriver::createMidi(MidiDriver::detectDevice(MDT_ADLIB|MDT_MIDI));
-
-	// Set up everything!
-	_midiDriver->open();
-	_midiParser->setMidiDriver(_midiDriver);
-	_midiParser->setTimerRate(_midiDriver->getBaseTempo());
 }
 
 Audio::RewindableAudioStream *Sound::makeAudioStream(uint16 id, CueList *cueList) {
@@ -264,54 +234,6 @@ Audio::SoundHandle *Sound::playSound(uint16 id, byte volume, bool loop, CueList
 	return nullptr;
 }
 
-void Sound::playMidi(uint16 id) {
-	uint32 idTag;
-	if (!(_vm->getFeatures() & GF_HASMIDI)) {
-		warning ("Attempting to play MIDI in a game without MIDI");
-		return;
-	}
-
-	assert(_midiDriver && _midiParser);
-
-	_midiParser->unloadMusic();
-	if (_midiData)
-		delete[] _midiData;
-
-	Common::SeekableReadStream *midi = _vm->getResource(ID_TMID, id);
-
-	idTag = midi->readUint32BE();
-	assert(idTag == ID_MHWK);
-	midi->readUint32BE(); // Skip size
-	idTag = midi->readUint32BE();
-	assert(idTag == ID_MIDI);
-
-	_midiData = new byte[midi->size() - 12]; // Enough to cover MThd/Prg#/MTrk
-
-	// Read the MThd Data
-	midi->read(_midiData, 14);
-
-	// TODO: Load patches from the Prg# section... skip it for now.
-	idTag = midi->readUint32BE();
-	assert(idTag == ID_PRG);
-	midi->skip(midi->readUint32BE());
-
-	// Read the MTrk Data
-	uint32 mtrkSize = midi->size() - midi->pos();
-	midi->read(_midiData + 14, mtrkSize);
-
-	delete midi;
-
-	// Now, play it :)
-	if (!_midiParser->loadMusic(_midiData, 14 + mtrkSize))
-		error ("Could not play MIDI music from tMID %04x\n", id);
-
-	_midiDriver->setTimerCallback(_midiParser, MidiParser::timerCallback);
-}
-
-void Sound::stopMidi() {
-	_midiParser->unloadMusic();
-}
-
 Audio::RewindableAudioStream *Sound::makeLivingBooksWaveStream_v1(Common::SeekableReadStream *stream) {
 	uint16 header = stream->readUint16BE();
 	uint16 rate = 0;
diff --git a/engines/mohawk/sound.h b/engines/mohawk/sound.h
index 15bda07..15ee249 100644
--- a/engines/mohawk/sound.h
+++ b/engines/mohawk/sound.h
@@ -107,8 +107,6 @@ public:
 
 	// Generic sound functions
 	Audio::SoundHandle *playSound(uint16 id, byte volume = Audio::Mixer::kMaxChannelVolume, bool loop = false, CueList *cueList = NULL);
-	void playMidi(uint16 id);
-	void stopMidi();
 	void stopSound();
 	void stopSound(uint16 id);
 	bool isPlaying(uint16 id);
@@ -117,12 +115,8 @@ public:
 
 private:
 	MohawkEngine *_vm;
-	MidiDriver *_midiDriver;
-	MidiParser *_midiParser;
-	byte *_midiData;
 
 	static Audio::RewindableAudioStream *makeLivingBooksWaveStream_v1(Common::SeekableReadStream *stream);
-	void initMidi();
 
 	Common::Array<SndHandle> _handles;
 	SndHandle *getHandle();


Commit: 44fd44ccc965b91a38c534e0a890772e83577c4b
    https://github.com/scummvm/scummvm/commit/44fd44ccc965b91a38c534e0a890772e83577c4b
Author: Bastien Bouclet (bastien.bouclet at gmail.com)
Date: 2018-05-17T20:49:28+02:00

Commit Message:
MOHAWK: Remove detection entries for games not supported by the engines

Changed paths:
    engines/mohawk/detection.cpp
    engines/mohawk/detection_tables.h
    engines/mohawk/mohawk.h
    engines/mohawk/resource.h
    engines/mohawk/sound.cpp


diff --git a/engines/mohawk/detection.cpp b/engines/mohawk/detection.cpp
index 82f901d..9e177b7 100644
--- a/engines/mohawk/detection.cpp
+++ b/engines/mohawk/detection.cpp
@@ -116,19 +116,12 @@ static const PlainGameDescriptor mohawkGames[] = {
 	{"myst", "Myst"},
 	{"makingofmyst", "The Making of Myst"},
 	{"riven", "Riven: The Sequel to Myst"},
-	{"zoombini", "Logical Journey of the Zoombinis"},
 	{"cstime", "Where in Time is Carmen Sandiego?"},
-	{"csworld", "Where in the World is Carmen Sandiego?"},
-	{"csamtrak", "Where in America is Carmen Sandiego? (The Great Amtrak Train Adventure)"},
 	{"carmentq", "Carmen Sandiego's ThinkQuick Challenge"},
 	{"carmentqc", "Carmen Sandiego's ThinkQuick Challenge Custom Question Creator"},
 	{"maggiesfa", "Maggie's Farmyard Adventure"},
-	{"jamesmath", "James Discovers/Explores Math"},
-	{"treehouse", "The Treehouse"},
 	{"greeneggs", "Green Eggs and Ham"},
 	{"seussabc", "Dr Seuss's ABC"},
-	{"1stdegree", "In the 1st Degree"},
-	{"csusa", "Where in the USA is Carmen Sandiego?"},
 	{"tortoise", "Aesop's Fables: The Tortoise and the Hare"},
 	{"arthur", "Arthur's Teacher Trouble"},
 	{"grandma", "Just Grandma and Me"},
@@ -340,15 +333,6 @@ bool MohawkMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGa
 			warning("CSTime support not compiled in");
 			return false;
 #endif
-		case Mohawk::GType_ZOOMBINI:
-		case Mohawk::GType_CSWORLD:
-		case Mohawk::GType_CSAMTRAK:
-		case Mohawk::GType_JAMESMATH:
-		case Mohawk::GType_TREEHOUSE:
-		case Mohawk::GType_1STDEGREE:
-		case Mohawk::GType_CSUSA:
-			warning("Unsupported Mohawk Engine");
-			return false;
 		default:
 			error("Unknown Mohawk Engine");
 		}
diff --git a/engines/mohawk/detection_tables.h b/engines/mohawk/detection_tables.h
index 31c8146..e887c11 100644
--- a/engines/mohawk/detection_tables.h
+++ b/engines/mohawk/detection_tables.h
@@ -618,127 +618,6 @@ static const MohawkGameDescription gameDescriptions[] = {
 		0
 	},
 
-
-	{
-		{
-			"zoombini",
-			"",
-			AD_ENTRY1("ZOOMBINI.MHK", "98b758fec55104c096cfd129048be9a6"),
-			Common::EN_ANY,
-			Common::kPlatformWindows,
-			ADGF_UNSTABLE,
-			GUIO1(GUIO_NOASPECT)
-		},
-		GType_ZOOMBINI,
-		0,
-		0
-	},
-
-	{
-		{
-			"zoombini",
-			"",
-			AD_ENTRY1("ZOOMBINI.MHK", "0672f65c40dd065840c896e41c13f980"),
-			Common::EN_ANY,
-			Common::kPlatformWindows,
-			ADGF_UNSTABLE,
-			GUIO1(GUIO_NOASPECT)
-		},
-		GType_ZOOMBINI,
-		0,
-		0
-	},
-
-	{
-		{
-			"zoombini",
-			"v2.0",
-			AD_ENTRY1("ZOOMBINI.MHK", "506b1122ffa740e2566cf0b583d24478"),
-			Common::EN_ANY,
-			Common::kPlatformWindows,
-			ADGF_NO_FLAGS,
-			GUIO1(GUIO_NOASPECT)
-		},
-		GType_ZOOMBINI,
-		0,
-		0
-	},
-
-	{
-		{
-			"zoombini",
-			"",
-			AD_ENTRY1("ZOOMBINI.MHK", "6ae0bdf791266b1fe3d4fabbf44c3faa"),
-			Common::DE_DEU,
-			Common::kPlatformWindows,
-			ADGF_UNSTABLE,
-			GUIO1(GUIO_NOASPECT)
-		},
-		GType_ZOOMBINI,
-		0,
-		0
-	},
-
-	{
-		{
-			"zoombini",
-			"",
-			AD_ENTRY1("ZOOMBINI.MHK", "8231e58525143ccf6e8b747df34b139f"),
-			Common::FR_FRA,
-			Common::kPlatformWindows,
-			ADGF_UNSTABLE,
-			GUIO1(GUIO_NOASPECT)
-		},
-		GType_ZOOMBINI,
-		0,
-		0
-	},
-
-	{
-		{
-			"csworld",
-			"v3.0",
-			AD_ENTRY1("C2K.MHK", "605fe88380848031bbd0ff84ade6fe40"),
-			Common::EN_ANY,
-			Common::kPlatformWindows,
-			ADGF_UNSTABLE,
-			GUIO1(GUIO_NOASPECT)
-		},
-		GType_CSWORLD,
-		0,
-		0
-	},
-
-	{
-		{
-			"csworld",
-			"v3.5",
-			AD_ENTRY1("C2K.MHK", "d4857aeb0f5e2e0c4ac556aa74f38c23"),
-			Common::EN_ANY,
-			Common::kPlatformWindows,
-			ADGF_UNSTABLE,
-			GUIO1(GUIO_NOASPECT)
-		},
-		GType_CSWORLD,
-		0,
-		0
-	},
-
-	{
-		{
-			"csamtrak",
-			"",
-			AD_ENTRY1("AMTRAK.MHK", "2f95301f0bb950d555bb7b0e3b1b7eb1"),
-			Common::EN_ANY,
-			Common::kPlatformWindows,
-			ADGF_UNSTABLE,
-			GUIO1(GUIO_NOASPECT)
-		},
-		GType_CSAMTRAK,
-		0,
-		0
-	},
-
 	// Harry and the Haunted House v1.0E
 	// English Windows 3.11
 	// From strangerke
@@ -953,52 +832,6 @@ static const MohawkGameDescription gameDescriptions[] = {
 
 	{
 		{
-			"jamesmath",
-			"",
-			AD_ENTRY1("BRODER.MHK", "007299da8b2c6e8ec1cde9598c243024"),
-			Common::EN_ANY,
-			Common::kPlatformWindows,
-			ADGF_UNSTABLE,
-			GUIO1(GUIO_NOASPECT)
-		},
-		GType_JAMESMATH,
-		0,
-		0
-	},
-
-	// This is in the NEWDATA folder, so I assume it's a newer version ;)
-	{
-		{
-			"jamesmath",
-			"",
-			AD_ENTRY1("BRODER.MHK", "53c000938a50dca92860fd9b546dd276"),
-			Common::EN_ANY,
-			Common::kPlatformWindows,
-			ADGF_UNSTABLE,
-			GUIO1(GUIO_NOASPECT)
-		},
-		GType_JAMESMATH,
-		0,
-		0
-	},
-
-	{
-		{
-			"treehouse",
-			"",
-			AD_ENTRY1("MAINROOM.MHK", "12f51894d7f838af639ea9bf1bc8f45b"),
-			Common::EN_ANY,
-			Common::kPlatformWindows,
-			ADGF_UNSTABLE,
-			GUIO1(GUIO_NOASPECT)
-		},
-		GType_TREEHOUSE,
-		0,
-		0
-	},
-
-	{
-		{
 			"greeneggs",
 			"",
 			AD_ENTRY1("GREEN.LB", "5df8438138186f89e71299d7b4f88d06"),
@@ -1106,54 +939,6 @@ static const MohawkGameDescription gameDescriptions[] = {
 
 	{
 		{
-			"1stdegree",
-			"",
-			AD_ENTRY1("AL236_1.MHK", "3ba145492a7b8b4dee0ef4222c5639c3"),
-			Common::EN_ANY,
-			Common::kPlatformWindows,
-			ADGF_UNSTABLE,
-			GUIO1(GUIO_NOASPECT)
-		},
-		GType_1STDEGREE,
-		0,
-		0
-	},
-
-	// In The 1st Degree
-	// French Windows
-	// From Strangerke
-	{
-		{
-			"1stdegree",
-			"",
-			AD_ENTRY1("AL236_1.MHK", "0e0c70b1b702b6ddca61a1192ada1282"),
-			Common::FR_FRA,
-			Common::kPlatformWindows,
-			ADGF_UNSTABLE,
-			GUIO1(GUIO_NOASPECT)
-		},
-		GType_1STDEGREE,
-		0,
-		0
-	},
-
-	{
-		{
-			"csusa",
-			"",
-			AD_ENTRY1("USAC2K.MHK", "b8c9d3a2586f62bce3a48b50d7a700e9"),
-			Common::EN_ANY,
-			Common::kPlatformWindows,
-			ADGF_UNSTABLE,
-			GUIO1(GUIO_NOASPECT)
-		},
-		GType_CSUSA,
-		0,
-		0
-	},
-
-	{
-		{
 			"tortoise",
 			"",
 			AD_ENTRY1("TORTOISE.512", "dfcf7bff3d0f187832c9897497efde0e"),
diff --git a/engines/mohawk/mohawk.h b/engines/mohawk/mohawk.h
index 880863b..8184f46 100644
--- a/engines/mohawk/mohawk.h
+++ b/engines/mohawk/mohawk.h
@@ -49,14 +49,7 @@ enum MohawkGameType {
 	GType_MYST,
 	GType_MAKINGOF,
 	GType_RIVEN,
-	GType_ZOOMBINI,
 	GType_CSTIME,
-	GType_CSWORLD,
-	GType_CSAMTRAK,
-	GType_JAMESMATH,
-	GType_TREEHOUSE,
-	GType_1STDEGREE,
-	GType_CSUSA,
 	GType_LIVINGBOOKSV1,
 	GType_LIVINGBOOKSV2,
 	GType_LIVINGBOOKSV3,
diff --git a/engines/mohawk/resource.h b/engines/mohawk/resource.h
index ecaef44..809c55d 100644
--- a/engines/mohawk/resource.h
+++ b/engines/mohawk/resource.h
@@ -93,10 +93,6 @@ namespace Mohawk {
 #define ID_BMAP MKTAG('B','M','A','P') // Old Mohawk Bitmap
 #define ID_BCOD MKTAG('B','C','O','D') // Book Code
 
-// JamesMath Resource FourCC's
-#define ID_TANM MKTAG('t','A','N','M') // Animation?
-#define ID_TMFO MKTAG('t','M','F','O') // ???
-
 // CSTime Resource FourCC's
 #define ID_CINF MKTAG('C','I','N','F') // Case Info
 #define ID_CONV MKTAG('C','O','N','V') // Conversation
@@ -112,10 +108,6 @@ namespace Mohawk {
 #define ID_DATA MKTAG('D','a','t','a') // Game Sound Chunk
 #define ID_CUE  MKTAG('C','u','e','#') // Game Sound Chunk
 
-// Mohawk MIDI Tags
-#define ID_MIDI MKTAG('M','I','D','I') // Game Sound (Third Tag), instead of WAVE
-#define ID_PRG  MKTAG('P','r','g','#') // MIDI Patch
-
 // Common Resource FourCC's
 #define ID_TBMP MKTAG('t','B','M','P') // Standard Mohawk Bitmap
 #define ID_TWAV MKTAG('t','W','A','V') // Standard Mohawk Sound
diff --git a/engines/mohawk/sound.cpp b/engines/mohawk/sound.cpp
index 2b9047c..c465940 100644
--- a/engines/mohawk/sound.cpp
+++ b/engines/mohawk/sound.cpp
@@ -192,9 +192,6 @@ Audio::RewindableAudioStream *Sound::makeAudioStream(uint16 id, CueList *cueList
 	Audio::RewindableAudioStream *audStream = nullptr;
 
 	switch (_vm->getGameType()) {
-	case GType_ZOOMBINI:
-		audStream = makeMohawkWaveStream(_vm->getResource(ID_SND, id));
-		break;
 	case GType_LIVINGBOOKSV1:
 		audStream = makeLivingBooksWaveStream_v1(_vm->getResource(ID_WAV, id));
 		break;


Commit: 6798f9c77ebe9c436c16cd1525554eb49bc1ba1d
    https://github.com/scummvm/scummvm/commit/6798f9c77ebe9c436c16cd1525554eb49bc1ba1d
Author: Bastien Bouclet (bastien.bouclet at gmail.com)
Date: 2018-05-17T20:49:28+02:00

Commit Message:
MOHAWK: Don't allow displaying the map when the game is not interactive

Fixes Trac#10526 and Trac#10531.

Changed paths:
    engines/mohawk/dialogs.cpp
    engines/mohawk/myst.cpp
    engines/mohawk/myst.h


diff --git a/engines/mohawk/dialogs.cpp b/engines/mohawk/dialogs.cpp
index f181db8..5700a46 100644
--- a/engines/mohawk/dialogs.cpp
+++ b/engines/mohawk/dialogs.cpp
@@ -204,16 +204,19 @@ MystOptionsDialog::~MystOptionsDialog() {
 void MystOptionsDialog::open() {
 	MohawkOptionsDialog::open();
 
-	_dropPageButton->setEnabled(_vm->_gameState->_globals.heldPage != kNoPage);
+	bool canDropPage = _vm->isInteractive() && _vm->_gameState->_globals.heldPage != kNoPage;
+	_dropPageButton->setEnabled(canDropPage);
 
-	if (_showMapButton)
-		_showMapButton->setEnabled(_vm->_scriptParser &&
-				_vm->_scriptParser->getMap());
+	if (_showMapButton) {
+		bool canShowMap = _vm->isInteractive() && _vm->_scriptParser->getMap();
+		_showMapButton->setEnabled(canShowMap);
+	}
 
-	// Return to menu button is not enabled on the menu
-	if (_returnToMenuButton)
-		_returnToMenuButton->setEnabled(_vm->_scriptParser &&
-				_vm->getCurStack() != kDemoStack);
+	if (_returnToMenuButton) {
+		// Return to menu button is not enabled on the menu
+		bool canReturnToMenu = _vm->isInteractive() && _vm->getCurStack() != kDemoStack;
+		_returnToMenuButton->setEnabled(canReturnToMenu);
+	}
 
 	// Zip mode is disabled in the demo
 	if (_vm->getFeatures() & GF_DEMO)
diff --git a/engines/mohawk/myst.cpp b/engines/mohawk/myst.cpp
index bda6918..f324c8c 100644
--- a/engines/mohawk/myst.cpp
+++ b/engines/mohawk/myst.cpp
@@ -91,7 +91,7 @@ MohawkEngine_Myst::MohawkEngine_Myst(OSystem *syst, const MohawkGameDescription
 	_mouseClicked = false;
 	_mouseMoved = false;
 	_escapePressed = false;
-	_interactive = true;
+	_waitingOnBlockingOperation = false;
 	_runExitScript = true;
 
 	_needsPageDrop = false;
@@ -310,7 +310,7 @@ void MohawkEngine_Myst::waitUntilMovieEnds(const VideoEntryPtr &video) {
 	if (!video)
 		return;
 
-	_interactive = false;
+	_waitingOnBlockingOperation = true;
 
 	// Sanity check
 	if (video->isLooping())
@@ -328,17 +328,17 @@ void MohawkEngine_Myst::waitUntilMovieEnds(const VideoEntryPtr &video) {
 
 	// Ensure it's removed
 	_video->removeEntry(video);
-	_interactive = true;
+	_waitingOnBlockingOperation = false;
 }
 
 void MohawkEngine_Myst::playSoundBlocking(uint16 id) {
-	_interactive = false;
+	_waitingOnBlockingOperation = true;
 	_sound->playEffect(id);
 
 	while (_sound->isEffectPlaying() && !shouldQuit()) {
 		doFrame();
 	}
-	_interactive = true;
+	_waitingOnBlockingOperation = false;
 }
 
 Common::Error MohawkEngine_Myst::run() {
@@ -389,10 +389,10 @@ Common::Error MohawkEngine_Myst::run() {
 void MohawkEngine_Myst::doFrame() {
 	// Update any background videos
 	_video->updateMovies();
-	if (!_scriptParser->isScriptRunning() && _interactive) {
-		_interactive = false;
+	if (isInteractive()) {
+		_waitingOnBlockingOperation = true;
 		_scriptParser->runPersistentScripts();
-		_interactive = true;
+		_waitingOnBlockingOperation = false;
 	}
 
 	Common::Event event;
@@ -446,7 +446,7 @@ void MohawkEngine_Myst::doFrame() {
 						}
 
 						if (_needsShowCredits) {
-							if (_interactive) {
+							if (isInteractive()) {
 								_cursor->hideCursor();
 								changeToStack(kCreditsStack, 10000, 0, 0);
 								_needsShowCredits = false;
@@ -479,7 +479,7 @@ void MohawkEngine_Myst::doFrame() {
 		}
 	}
 
-	if (!_scriptParser->isScriptRunning() && _interactive) {
+	if (isInteractive()) {
 		updateActiveResource();
 		checkCurrentResource();
 	}
@@ -491,7 +491,7 @@ void MohawkEngine_Myst::doFrame() {
 }
 
 bool MohawkEngine_Myst::wait(uint32 duration, bool skippable) {
-	_interactive = false;
+	_waitingOnBlockingOperation = true;
 	uint32 end = getTotalPlayTime() + duration;
 
 	do {
@@ -503,7 +503,7 @@ bool MohawkEngine_Myst::wait(uint32 duration, bool skippable) {
 		}
 	} while (getTotalPlayTime() < end && !shouldQuit());
 
-	_interactive = true;
+	_waitingOnBlockingOperation = false;
 	return false;
 }
 
@@ -1165,8 +1165,12 @@ bool MohawkEngine_Myst::hasGameSaveSupport() const {
 	return !(getFeatures() & GF_DEMO) && getGameType() != GType_MAKINGOF;
 }
 
+bool MohawkEngine_Myst::isInteractive() {
+	return !_scriptParser->isScriptRunning() && !_waitingOnBlockingOperation;
+}
+
 bool MohawkEngine_Myst::canLoadGameStateCurrently() {
-	if (_scriptParser->isScriptRunning() || !_interactive) {
+	if (!isInteractive()) {
 		return false;
 	}
 
diff --git a/engines/mohawk/myst.h b/engines/mohawk/myst.h
index 2758b7f..fcbdafa 100644
--- a/engines/mohawk/myst.h
+++ b/engines/mohawk/myst.h
@@ -236,6 +236,13 @@ public:
 
 	GUI::Debugger *getDebugger() override { return _console; }
 
+	/**
+	 * Is the game currently interactive
+	 *
+	 * When the game is interactive, the user can interact with the game world
+	 * and perform other operations such as loading saved games, ...
+	 */
+	bool isInteractive();
 	bool canLoadGameStateCurrently() override;
 	bool canSaveGameStateCurrently() override;
 	Common::Error loadGameState(int slot) override;
@@ -284,7 +291,7 @@ private:
 	bool _mouseClicked;
 	bool _mouseMoved;
 	bool _escapePressed;
-	bool _interactive; // Is the game currently interactive
+	bool _waitingOnBlockingOperation;
 
 	Common::Array<MystCursorHint> _cursorHints;
 	void loadCursorHints();


Commit: 4e774450869855e4fd990716db63370a66c2d108
    https://github.com/scummvm/scummvm/commit/4e774450869855e4fd990716db63370a66c2d108
Author: Bastien Bouclet (bastien.bouclet at gmail.com)
Date: 2018-05-17T20:49:28+02:00

Commit Message:
MOHAWK: MYST: Opcode 102 in Channelwood can only set the volume to non 0 values

Fixes Trac#10532.

Changed paths:
    engines/mohawk/myst_stacks/channelwood.cpp


diff --git a/engines/mohawk/myst_stacks/channelwood.cpp b/engines/mohawk/myst_stacks/channelwood.cpp
index d0b3d2a..726b3d6 100644
--- a/engines/mohawk/myst_stacks/channelwood.cpp
+++ b/engines/mohawk/myst_stacks/channelwood.cpp
@@ -335,6 +335,7 @@ void Channelwood::o_pipeExtend(uint16 var, const ArgumentsArray &args) {
 void Channelwood::o_drawImageChangeCardAndVolume(uint16 var, const ArgumentsArray &args) {
 	uint16 imageId = args[0];
 	uint16 cardId = args[1];
+	uint16 volume = args.size() == 3 ? args[2] : 0;
 
 	debugC(kDebugScript, "\timageId: %d", imageId);
 	debugC(kDebugScript, "\tcardId: %d", cardId);
@@ -344,8 +345,7 @@ void Channelwood::o_drawImageChangeCardAndVolume(uint16 var, const ArgumentsArra
 
 	_vm->changeToCard(cardId, kTransitionPartToLeft);
 
-	if (args.size() == 3) {
-		uint16 volume = args[2];
+	if (volume) {
 		_vm->_sound->changeBackgroundVolume(volume);
 	}
 }





More information about the Scummvm-git-logs mailing list