[Scummvm-git-logs] scummvm master -> 33cfcfd5ff626e8b341fdee3171bf1367191fe65

bgK bastien.bouclet at gmail.com
Sun Jul 9 06:58:58 CEST 2017


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:
bcd027cf64 MOHAWK: Riven: Fix use after free when using the trap book
efcbe65757 MOHAWK: Riven: Fix ending video not playing when using the trap book
c4207ad3a3 MOHAWK: Myst: Fix the piano sound effect restarting when moving the mouse
33cfcfd5ff MOHAWK: Myst: Fix the sound receiver sound restarting on each frame


Commit: bcd027cf6471207dc1724646de94b32d10252a31
    https://github.com/scummvm/scummvm/commit/bcd027cf6471207dc1724646de94b32d10252a31
Author: Bastien Bouclet (bastien.bouclet at gmail.com)
Date: 2017-07-09T06:53:51+02:00

Commit Message:
MOHAWK: Riven: Fix use after free when using the trap book

Changed paths:
    engines/mohawk/riven_stacks/ospit.cpp


diff --git a/engines/mohawk/riven_stacks/ospit.cpp b/engines/mohawk/riven_stacks/ospit.cpp
index 2393052..c48bebc 100644
--- a/engines/mohawk/riven_stacks/ospit.cpp
+++ b/engines/mohawk/riven_stacks/ospit.cpp
@@ -50,8 +50,9 @@ void OSpit::xorollcredittime(const ArgumentArray &args) {
 	// be messy to modify the way that currently works. If we use the trap book on Tay,
 	// we should be using the Tay end game sequences.
 	if (_vm->_vars["returnstackid"] == kStackRspit) {
-		_vm->changeToStack(kStackRspit);
-		_vm->changeToCard(2);
+		RivenScriptPtr script = _vm->_scriptMan->createScriptWithCommand(
+				new RivenStackChangeCommand(_vm, kStackRspit, 0x3338, true));
+		_vm->_scriptMan->runScript(script, false);
 		return;
 	}
 


Commit: efcbe6575717764207f017e16c58d2c493a78939
    https://github.com/scummvm/scummvm/commit/efcbe6575717764207f017e16c58d2c493a78939
Author: Bastien Bouclet (bastien.bouclet at gmail.com)
Date: 2017-07-09T06:55:10+02:00

Commit Message:
MOHAWK: Riven: Fix ending video not playing when using the trap book

Fixes #9911.

Changed paths:
    engines/mohawk/riven_graphics.cpp
    engines/mohawk/riven_stack.cpp


diff --git a/engines/mohawk/riven_graphics.cpp b/engines/mohawk/riven_graphics.cpp
index d152419..824372a 100644
--- a/engines/mohawk/riven_graphics.cpp
+++ b/engines/mohawk/riven_graphics.cpp
@@ -633,7 +633,6 @@ void RivenGraphics::updateCredits() {
 
 		// Now flush the new screen
 		_vm->_system->copyRectToScreen(_mainScreen->getPixels(), _mainScreen->pitch, 0, 0, _mainScreen->w, _mainScreen->h);
-		_vm->_system->updateScreen();
 	}
 }
 
diff --git a/engines/mohawk/riven_stack.cpp b/engines/mohawk/riven_stack.cpp
index 323cbc0..d3c76ed 100644
--- a/engines/mohawk/riven_stack.cpp
+++ b/engines/mohawk/riven_stack.cpp
@@ -186,6 +186,7 @@ void RivenStack::runDemoBoundaryDialog() {
 void RivenStack::runEndGame(uint16 videoCode, uint32 delay) {
 	_vm->_sound->stopAllSLST();
 	RivenVideo *video = _vm->_video->openSlot(videoCode);
+	video->enable();
 	video->play();
 	runCredits(videoCode, delay);
 }
@@ -202,27 +203,20 @@ void RivenStack::runCredits(uint16 video, uint32 delay) {
 		if (videoPtr->getCurFrame() >= (int32)videoPtr->getFrameCount() - 1) {
 			if (nextCreditsFrameStart == 0) {
 				// Set us up to start after delay ms
-				nextCreditsFrameStart = _vm->_system->getMillis() + delay;
-			} else if (_vm->_system->getMillis() >= nextCreditsFrameStart) {
+				nextCreditsFrameStart = _vm->getTotalPlayTime() + delay;
+			} else if (_vm->getTotalPlayTime() >= nextCreditsFrameStart) {
 				// the first two frames stay on for 4 seconds
 				// the rest of the scroll updates happen at 30Hz
 				if (_vm->_gfx->getCurCreditsImage() < 304)
-					nextCreditsFrameStart = _vm->_system->getMillis() + 4000;
+					nextCreditsFrameStart = _vm->getTotalPlayTime() + 4000;
 				else
-					nextCreditsFrameStart = _vm->_system->getMillis() + 1000 / 30;
+					nextCreditsFrameStart = _vm->getTotalPlayTime() + 1000 / 30;
 
 				_vm->_gfx->updateCredits();
 			}
-		} else {
-			_vm->_video->updateMovies();
-			_vm->_system->updateScreen();
 		}
 
-		Common::Event event;
-		while (_vm->_system->getEventManager()->pollEvent(event))
-			;
-
-		_vm->_system->delayMillis(10);
+		_vm->doFrame();
 	}
 
 	if (_vm->shouldQuit()) {


Commit: c4207ad3a313887df8d4d94d642e5ecdbf2eb992
    https://github.com/scummvm/scummvm/commit/c4207ad3a313887df8d4d94d642e5ecdbf2eb992
Author: Bastien Bouclet (bastien.bouclet at gmail.com)
Date: 2017-07-09T06:55:42+02:00

Commit Message:
MOHAWK: Myst: Fix the piano sound effect restarting when moving the mouse

Fixes #9916.

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


diff --git a/engines/mohawk/myst_stacks/myst.cpp b/engines/mohawk/myst_stacks/myst.cpp
index d9a1178..84a91e2 100644
--- a/engines/mohawk/myst_stacks/myst.cpp
+++ b/engines/mohawk/myst_stacks/myst.cpp
@@ -60,6 +60,7 @@ Myst::Myst(MohawkEngine_Myst *vm) :
 	_observatoryCurrentSlider = nullptr;
 	_butterfliesMoviePlayed = false;
 	_state.treeLastMoveTime = _vm->_system->getMillis();
+	_rocketPianoSound = 0;
 }
 
 Myst::~Myst() {
@@ -2318,9 +2319,11 @@ void Myst::o_rocketPianoStart(uint16 op, uint16 var, uint16 argc, uint16 *argv)
 	_vm->_system->updateScreen();
 
 	// Play note
+	_rocketPianoSound = 0;
 	if (_state.generatorVoltage == 59 && !_state.generatorBreakers) {
-		uint16 soundId = key->getList1(0);
-		_vm->_sound->replaceSoundMyst(soundId, Audio::Mixer::kMaxChannelVolume, true);
+		_vm->_sound->pauseBackgroundMyst();
+		_rocketPianoSound = key->getList1(0);
+		_vm->_sound->replaceSoundMyst(_rocketPianoSound, Audio::Mixer::kMaxChannelVolume, true);
 	}
 }
 
@@ -2358,7 +2361,10 @@ void Myst::o_rocketPianoMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
 			// Play note
 			if (_state.generatorVoltage == 59 && !_state.generatorBreakers) {
 				uint16 soundId = key->getList1(0);
-				_vm->_sound->replaceSoundMyst(soundId, Audio::Mixer::kMaxChannelVolume, true);
+				if (soundId != _rocketPianoSound) {
+					_rocketPianoSound = soundId;
+					_vm->_sound->replaceSoundMyst(soundId, Audio::Mixer::kMaxChannelVolume, true);
+				}
 			}
 		} else {
 			// Not pressing a key anymore
diff --git a/engines/mohawk/myst_stacks/myst.h b/engines/mohawk/myst_stacks/myst.h
index 6e2f7cc..a44f914 100644
--- a/engines/mohawk/myst_stacks/myst.h
+++ b/engines/mohawk/myst_stacks/myst.h
@@ -191,6 +191,7 @@ protected:
 	bool _generatorControlRoomRunning;
 	uint16 _generatorVoltage; // 58
 
+	uint16 _rocketPianoSound; // 292
 	MystAreaSlider *_rocketSlider1; // 248
 	MystAreaSlider *_rocketSlider2; // 252
 	MystAreaSlider *_rocketSlider3; // 256
@@ -198,7 +199,7 @@ protected:
 	MystAreaSlider *_rocketSlider5; // 264
 	uint16 _rocketSliderSound; // 294
 	uint16 _rocketLeverPosition; // 296
-	VideoHandle _rocketLinkBook;
+	VideoHandle _rocketLinkBook; // 268
 
 	bool _libraryCombinationBookPagesTurning;
 	int16 _libraryBookPage; // 86


Commit: 33cfcfd5ff626e8b341fdee3171bf1367191fe65
    https://github.com/scummvm/scummvm/commit/33cfcfd5ff626e8b341fdee3171bf1367191fe65
Author: Bastien Bouclet (bastien.bouclet at gmail.com)
Date: 2017-07-09T06:56:00+02:00

Commit Message:
MOHAWK: Myst: Fix the sound receiver sound restarting on each frame

Fixes #9921.

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


diff --git a/engines/mohawk/myst_stacks/selenitic.cpp b/engines/mohawk/myst_stacks/selenitic.cpp
index ad3de69..8d2e660 100644
--- a/engines/mohawk/myst_stacks/selenitic.cpp
+++ b/engines/mohawk/myst_stacks/selenitic.cpp
@@ -982,7 +982,7 @@ void Selenitic::soundReceiverIncreaseSpeed() {
 
 void Selenitic::soundReceiverUpdateSound() {
 	uint16 soundId = soundReceiverCurrentSound(_state.soundReceiverCurrentSource, *_soundReceiverPosition);
-	_vm->_sound->replaceSoundMyst(soundId);
+	_vm->_sound->replaceBackgroundMyst(soundId);
 }
 
 uint16 Selenitic::soundReceiverCurrentSound(uint16 source, uint16 position) {





More information about the Scummvm-git-logs mailing list