[Scummvm-cvs-logs] scummvm master -> 9f1ac5d54caf8792a6856684da8068bc221eca33

bgK bastien.bouclet at gmail.com
Sat Feb 13 13:53:27 CET 2016


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

Summary:
fd1f82e227 MOHAWK: Make the conversion from VideoEntryPtr to VideoHandle explicit
f47d7c7328 MOHAWK: Don't close videos when displaying just a frame
9f1ac5d54c MOHAWK: Allow movie areas to override the playback rate


Commit: fd1f82e2278878879d5694af3f95894fe06e8d5b
    https://github.com/scummvm/scummvm/commit/fd1f82e2278878879d5694af3f95894fe06e8d5b
Author: Bastien Bouclet (bastien.bouclet at gmail.com)
Date: 2016-02-13T13:52:37+01:00

Commit Message:
MOHAWK: Make the conversion from VideoEntryPtr to VideoHandle explicit

So that it is a bit less confusing

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



diff --git a/engines/mohawk/video.cpp b/engines/mohawk/video.cpp
index ff4a69c..f9115db 100644
--- a/engines/mohawk/video.cpp
+++ b/engines/mohawk/video.cpp
@@ -184,7 +184,7 @@ void VideoManager::playMovieBlocking(const Common::String &fileName, uint16 x, u
 	}
 
 	ptr->start();
-	waitUntilMovieEnds(ptr);
+	waitUntilMovieEnds(VideoHandle(ptr));
 }
 
 void VideoManager::playMovieBlockingCentered(const Common::String &fileName, bool clearScreen) {
@@ -200,7 +200,7 @@ void VideoManager::playMovieBlockingCentered(const Common::String &fileName, boo
 
 	ptr->center();
 	ptr->start();
-	waitUntilMovieEnds(ptr);
+	waitUntilMovieEnds(VideoHandle(ptr));
 }
 
 void VideoManager::waitUntilMovieEnds(VideoHandle videoHandle) {
@@ -278,7 +278,7 @@ VideoHandle VideoManager::playMovie(const Common::String &fileName) {
 		return VideoHandle();
 
 	ptr->start();
-	return ptr;
+	return VideoHandle(ptr);
 }
 
 VideoHandle VideoManager::playMovie(uint16 id) {
@@ -287,7 +287,7 @@ VideoHandle VideoManager::playMovie(uint16 id) {
 		return VideoHandle();
 
 	ptr->start();
-	return ptr;
+	return VideoHandle(ptr);
 }
 
 bool VideoManager::updateMovies() {
@@ -360,7 +360,7 @@ bool VideoManager::updateMovies() {
 		}
 
 		// Check the video time
-		_vm->doVideoTimer(*it, false);
+		_vm->doVideoTimer(VideoHandle(*it), false);
 
 		// Remember to increase the iterator
 		it++;
@@ -430,7 +430,7 @@ VideoHandle VideoManager::playMovieRiven(uint16 id) {
 				ptr->start();
 			}
 
-			return ptr;
+			return VideoHandle(ptr);
 		}
 	}
 
@@ -445,7 +445,7 @@ void VideoManager::playMovieBlockingRiven(uint16 id) {
 			ptr->moveTo(_mlstRecords[i].left, _mlstRecords[i].top);
 			ptr->setVolume(_mlstRecords[i].volume);
 			ptr->start();
-			waitUntilMovieEnds(ptr);
+			waitUntilMovieEnds(VideoHandle(ptr));
 			return;
 		}
 	}
@@ -522,7 +522,7 @@ VideoHandle VideoManager::findVideoHandleRiven(uint16 id) {
 		if (_mlstRecords[i].code == id)
 			for (VideoList::iterator it = _videos.begin(); it != _videos.end(); it++)
 				if ((*it)->getID() == _mlstRecords[i].movieID)
-					return *it;
+					return VideoHandle(*it);
 
 	return VideoHandle();
 }
@@ -533,7 +533,7 @@ VideoHandle VideoManager::findVideoHandle(uint16 id) {
 
 	for (VideoList::iterator it = _videos.begin(); it != _videos.end(); it++)
 		if ((*it)->getID() == id)
-			return *it;
+			return VideoHandle(*it);
 
 	return VideoHandle();
 }
@@ -544,7 +544,7 @@ VideoHandle VideoManager::findVideoHandle(const Common::String &fileName) {
 
 	for (VideoList::iterator it = _videos.begin(); it != _videos.end(); it++)
 		if ((*it)->getFileName().equalsIgnoreCase(fileName))
-			return *it;
+			return VideoHandle(*it);
 
 	return VideoHandle();
 }
diff --git a/engines/mohawk/video.h b/engines/mohawk/video.h
index 106a32f..c5a3dc7 100644
--- a/engines/mohawk/video.h
+++ b/engines/mohawk/video.h
@@ -293,7 +293,7 @@ private:
 	/**
 	 * Constructor for internal VideoManager use
 	 */
-	VideoHandle(VideoEntryPtr ptr);
+	explicit VideoHandle(VideoEntryPtr ptr);
 
 	/**
 	 * The video entry this is associated with


Commit: f47d7c73284362fc04aad2d32e5328a221788671
    https://github.com/scummvm/scummvm/commit/f47d7c73284362fc04aad2d32e5328a221788671
Author: Bastien Bouclet (bastien.bouclet at gmail.com)
Date: 2016-02-13T13:52:37+01:00

Commit Message:
MOHAWK: Don't close videos when displaying just a frame

Changed paths:
    engines/mohawk/video.cpp



diff --git a/engines/mohawk/video.cpp b/engines/mohawk/video.cpp
index f9115db..31e8de7 100644
--- a/engines/mohawk/video.cpp
+++ b/engines/mohawk/video.cpp
@@ -563,7 +563,7 @@ void VideoManager::drawVideoFrame(VideoHandle handle, const Audio::Timestamp &ti
 	assert(handle);
 	handle->seek(time);
 	updateMovies();
-	handle->close();
+	handle->stop();
 }
 
 VideoManager::VideoList::iterator VideoManager::findEntry(VideoEntryPtr ptr) {


Commit: 9f1ac5d54caf8792a6856684da8068bc221eca33
    https://github.com/scummvm/scummvm/commit/9f1ac5d54caf8792a6856684da8068bc221eca33
Author: Bastien Bouclet (bastien.bouclet at gmail.com)
Date: 2016-02-13T13:52:37+01:00

Commit Message:
MOHAWK: Allow movie areas to override the playback rate

Unfortunately our QuickTime player does not allow overriding the playback rate
for videos with sound. The steel jaw trap in Channelwood is not played at
125% speed as it should.

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



diff --git a/engines/mohawk/myst_areas.cpp b/engines/mohawk/myst_areas.cpp
index 82213fa..005ee2a 100644
--- a/engines/mohawk/myst_areas.cpp
+++ b/engines/mohawk/myst_areas.cpp
@@ -199,7 +199,7 @@ MystAreaVideo::MystAreaVideo(MohawkEngine_Myst *vm, Common::SeekableReadStream *
 	_direction = rlstStream->readSint16LE();
 	_playBlocking = rlstStream->readUint16LE();
 	_loop = rlstStream->readUint16LE();
-	_u3 = rlstStream->readUint16LE();
+	_playRate = rlstStream->readUint16LE();
 
 	// TODO: Out of bound values should clip the movie
 	if (_left < 0)
@@ -207,9 +207,6 @@ MystAreaVideo::MystAreaVideo(MohawkEngine_Myst *vm, Common::SeekableReadStream *
 	if (_top < 0)
 		_top = 0;
 
-	if (_u3 != 0)
-		warning("Type 6 _u3 != 0");
-
 	debugC(kDebugResource, "\tvideoFile: \"%s\"", _videoFile.c_str());
 	debugC(kDebugResource, "\tleft: %d", _left);
 	debugC(kDebugResource, "\ttop: %d", _top);
@@ -217,7 +214,7 @@ MystAreaVideo::MystAreaVideo(MohawkEngine_Myst *vm, Common::SeekableReadStream *
 	debugC(kDebugResource, "\tdirection: %d", _direction);
 	debugC(kDebugResource, "\tplayBlocking: %d", _playBlocking);
 	debugC(kDebugResource, "\tplayOnCardChange: %d", _playOnCardChange);
-	debugC(kDebugResource, "\tu3: %d", _u3);
+	debugC(kDebugResource, "\tplayRate: %d", _playRate);
 }
 
 VideoHandle MystAreaVideo::playMovie() {
@@ -233,10 +230,19 @@ VideoHandle MystAreaVideo::playMovie() {
 		handle->moveTo(_left, _top);
 		handle->setLooping(_loop != 0);
 
+		Common::Rational rate;
+		if (_playRate != 0) {
+			rate = Common::Rational(_playRate, 100);
+		} else {
+			rate = 1;
+		}
+
 		if (_direction == -1) {
+			rate = -rate;
 			handle->seek(handle->getDuration());
-			handle->setRate(-1);
 		}
+
+		handle->setRate(rate);
 	} else {
 		// Resume the video
 		handle->pause(false);
@@ -400,6 +406,7 @@ void MystAreaImageSwitch::drawDataToScreen() {
 	}
 }
 
+//TODO: Merge with the method above?
 void MystAreaImageSwitch::drawConditionalDataToScreen(uint16 state, bool update) {
 	bool drawSubImage = false;
 	int16 subImageId = 0;
diff --git a/engines/mohawk/myst_areas.h b/engines/mohawk/myst_areas.h
index 63357e5..09ec6a2 100644
--- a/engines/mohawk/myst_areas.h
+++ b/engines/mohawk/myst_areas.h
@@ -124,7 +124,7 @@ protected:
 	int16 _direction; // 1 => forward, -1 => backwards
 	uint16 _playBlocking;
 	uint16 _playOnCardChange;
-	uint16 _u3;
+	uint16 _playRate; // percents
 };
 
 class MystAreaActionSwitch : public MystArea {






More information about the Scummvm-git-logs mailing list