[Scummvm-cvs-logs] scummvm master -> f3265626eddbfb49a0a5c332731052147aef5cac

bgK bastien.bouclet at gmail.com
Sat Feb 20 14:03:53 CET 2016


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

Summary:
406cc5a553 MOHAWK: Default to the first card when jumping to the intro stack
84841fa635 MOHAWK: Clip the videos to make sure they don't go outside of the screen
23c251bac9 MOHAWK: Replace an unneeded TODO with an explanation
9c99f74bda MOHAWK: Remove an unneeded TODO
f3265626ed MOHAWK: Fix Channelwood's opcode 129


Commit: 406cc5a553989d7e6ff511eb47371b1d8ccf6dc9
    https://github.com/scummvm/scummvm/commit/406cc5a553989d7e6ff511eb47371b1d8ccf6dc9
Author: Bastien Bouclet (bastien.bouclet at gmail.com)
Date: 2016-02-20T14:00:59+01:00

Commit Message:
MOHAWK: Default to the first card when jumping to the intro stack

Changed paths:
    engines/mohawk/console.cpp



diff --git a/engines/mohawk/console.cpp b/engines/mohawk/console.cpp
index 93fa05f..fd79e53 100644
--- a/engines/mohawk/console.cpp
+++ b/engines/mohawk/console.cpp
@@ -121,7 +121,7 @@ static const uint16 default_start_card[12] = {
 	10000,
 	2000,
 	5038,
-	2, // TODO: Should be 1?
+	1,
 	1,
 	6122,
 	4134,


Commit: 84841fa635d90ae1936339b63ec675d62a4d84b9
    https://github.com/scummvm/scummvm/commit/84841fa635d90ae1936339b63ec675d62a4d84b9
Author: Bastien Bouclet (bastien.bouclet at gmail.com)
Date: 2016-02-20T14:00:59+01:00

Commit Message:
MOHAWK: Clip the videos to make sure they don't go outside of the screen

Changed paths:
    engines/mohawk/myst_areas.cpp
    engines/mohawk/video.cpp



diff --git a/engines/mohawk/myst_areas.cpp b/engines/mohawk/myst_areas.cpp
index 005ee2a..59871ed 100644
--- a/engines/mohawk/myst_areas.cpp
+++ b/engines/mohawk/myst_areas.cpp
@@ -201,12 +201,6 @@ MystAreaVideo::MystAreaVideo(MohawkEngine_Myst *vm, Common::SeekableReadStream *
 	_loop = rlstStream->readUint16LE();
 	_playRate = rlstStream->readUint16LE();
 
-	// TODO: Out of bound values should clip the movie
-	if (_left < 0)
-		_left = 0;
-	if (_top < 0)
-		_top = 0;
-
 	debugC(kDebugResource, "\tvideoFile: \"%s\"", _videoFile.c_str());
 	debugC(kDebugResource, "\tleft: %d", _left);
 	debugC(kDebugResource, "\ttop: %d", _top);
diff --git a/engines/mohawk/video.cpp b/engines/mohawk/video.cpp
index 31e8de7..522dd5e 100644
--- a/engines/mohawk/video.cpp
+++ b/engines/mohawk/video.cpp
@@ -343,10 +343,34 @@ bool VideoManager::updateMovies() {
 						_vm->_system->getPaletteManager()->setPalette(video->getPalette(), 0, 256);
 				}
 
-				// Clip the width/height to make sure we stay on the screen (Myst does this a few times)
-				uint16 width = MIN<int32>(video->getWidth(), _vm->_system->getWidth() - (*it)->getX());
-				uint16 height = MIN<int32>(video->getHeight(), _vm->_system->getHeight() - (*it)->getY());
-				_vm->_system->copyRectToScreen(frame->getPixels(), frame->pitch, (*it)->getX(), (*it)->getY(), width, height);
+				// Clip the video to make sure it stays on the screen (Myst does this a few times)
+				Common::Rect targetRect = Common::Rect(video->getWidth(), video->getHeight());
+				targetRect.translate((*it)->getX(), (*it)->getY());
+
+				Common::Rect frameRect = Common::Rect(video->getWidth(), video->getHeight());
+
+				if (targetRect.left < 0) {
+					frameRect.left -= targetRect.left;
+					targetRect.left = 0;
+				}
+
+				if (targetRect.top < 0) {
+					frameRect.top -= targetRect.top;
+					targetRect.top = 0;
+				}
+
+				if (targetRect.right > _vm->_system->getWidth()) {
+					frameRect.right -= targetRect.right - _vm->_system->getWidth();
+					targetRect.right = _vm->_system->getWidth();
+				}
+
+				if (targetRect.bottom > _vm->_system->getHeight()) {
+					frameRect.bottom -= targetRect.bottom - _vm->_system->getHeight();
+					targetRect.bottom = _vm->_system->getHeight();
+				}
+
+				_vm->_system->copyRectToScreen(frame->getBasePtr(frameRect.left, frameRect.top), frame->pitch,
+				                               targetRect.left, targetRect.top, targetRect.width(), targetRect.height());
 
 				// We've drawn something to the screen, make sure we update it
 				updateScreen = true;


Commit: 23c251bac9b3d3533fc43adbe46003b3d6a2fe53
    https://github.com/scummvm/scummvm/commit/23c251bac9b3d3533fc43adbe46003b3d6a2fe53
Author: Bastien Bouclet (bastien.bouclet at gmail.com)
Date: 2016-02-20T14:00:59+01:00

Commit Message:
MOHAWK: Replace an unneeded TODO with an explanation

Changed paths:
    engines/mohawk/myst_scripts.cpp



diff --git a/engines/mohawk/myst_scripts.cpp b/engines/mohawk/myst_scripts.cpp
index 0e14b24..04e7c5a 100644
--- a/engines/mohawk/myst_scripts.cpp
+++ b/engines/mohawk/myst_scripts.cpp
@@ -434,7 +434,10 @@ void MystScriptParser::o_goToDestUp(uint16 op, uint16 var, uint16 argc, uint16 *
 
 void MystScriptParser::o_triggerMovie(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
 	debugC(kDebugScript, "Opcode %d: Trigger Type 6 Resource Movie..", op);
-	// TODO: If movie has sound, pause background music
+	// The original has code to pause the background music before playing the movie,
+	// if the movie has a sound track, as well as code to resume it afterwards. But since
+	// the movie has not yet been loaded at this point, it is impossible to know
+	// if the movie actually has a sound track. The code is never executed.
 
 	int16 direction = 1;
 	if (argc == 1)
@@ -446,8 +449,6 @@ void MystScriptParser::o_triggerMovie(uint16 op, uint16 var, uint16 argc, uint16
 	MystAreaVideo *resource = getInvokingResource<MystAreaVideo>();
 	resource->setDirection(direction);
 	resource->playMovie();
-
-	// TODO: If movie has sound, resume background music
 }
 
 void MystScriptParser::o_toggleVarNoRedraw(uint16 op, uint16 var, uint16 argc, uint16 *argv) {


Commit: 9c99f74bdab36499eb399b7e0b7b383116decba9
    https://github.com/scummvm/scummvm/commit/9c99f74bdab36499eb399b7e0b7b383116decba9
Author: Bastien Bouclet (bastien.bouclet at gmail.com)
Date: 2016-02-20T14:00:59+01:00

Commit Message:
MOHAWK: Remove an unneeded TODO

The original did not set the argument to wait until the foreground
sound has finished before playing the background sound, so it's fine to
play both at the same time.

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



diff --git a/engines/mohawk/myst_stacks/myst.cpp b/engines/mohawk/myst_stacks/myst.cpp
index 0576bdd..5033f0f 100644
--- a/engines/mohawk/myst_stacks/myst.cpp
+++ b/engines/mohawk/myst_stacks/myst.cpp
@@ -1380,7 +1380,7 @@ void Myst::o_generatorButtonPressed(uint16 op, uint16 var, uint16 argc, uint16 *
 		if (_generatorVoltage)
 			_vm->_sound->replaceSoundMyst(6297);
 		else {
-			_vm->_sound->replaceSoundMyst(7297); // TODO: Replace with play sound and replace background 4297
+			_vm->_sound->replaceSoundMyst(7297);
 			_vm->_sound->replaceBackgroundMyst(4297);
 		}
 


Commit: f3265626eddbfb49a0a5c332731052147aef5cac
    https://github.com/scummvm/scummvm/commit/f3265626eddbfb49a0a5c332731052147aef5cac
Author: Bastien Bouclet (bastien.bouclet at gmail.com)
Date: 2016-02-20T14:00:59+01:00

Commit Message:
MOHAWK: Fix Channelwood's opcode 129

It should only play the sound if no other is already playing

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 cd6935b..659c5dc 100644
--- a/engines/mohawk/myst_stacks/channelwood.cpp
+++ b/engines/mohawk/myst_stacks/channelwood.cpp
@@ -747,8 +747,9 @@ void Channelwood::o_soundReplace(uint16 op, uint16 var, uint16 argc, uint16 *arg
 
 	uint16 soundId = argv[0];
 
-	// TODO: If is foreground playing
-	_vm->_sound->replaceSoundMyst(soundId);
+	if (!_vm->_sound->isPlaying()) {
+		_vm->_sound->replaceSoundMyst(soundId);
+	}
 }
 
 void Channelwood::o_lever_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) {






More information about the Scummvm-git-logs mailing list