[Scummvm-cvs-logs] scummvm master -> 84bb389baedc458e5d10fe230d716e04375ddbf0

dreammaster dreammaster at scummvm.org
Thu Sep 10 03:06:35 CEST 2015


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:
84bb389bae SHERLOCK: 3DO: Implement half-size drawing for portrait movies


Commit: 84bb389baedc458e5d10fe230d716e04375ddbf0
    https://github.com/scummvm/scummvm/commit/84bb389baedc458e5d10fe230d716e04375ddbf0
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2015-09-09T21:02:57-04:00

Commit Message:
SHERLOCK: 3DO: Implement half-size drawing for portrait movies

Ideally, it would be great if the portraits could be played at their
original size, but it would mean using a higher resolution graphics
mode, and changing co-ordinates everywhere in the engine, which
would be a major undertaking

Changed paths:
    engines/sherlock/scalpel/scalpel.cpp
    engines/sherlock/scalpel/scalpel.h
    engines/sherlock/scalpel/scalpel_talk.cpp



diff --git a/engines/sherlock/scalpel/scalpel.cpp b/engines/sherlock/scalpel/scalpel.cpp
index e91c774..90a7493 100644
--- a/engines/sherlock/scalpel/scalpel.cpp
+++ b/engines/sherlock/scalpel/scalpel.cpp
@@ -1240,8 +1240,9 @@ void ScalpelEngine::showScummVMRestoreDialog() {
 	}
 }
 
-bool ScalpelEngine::play3doMovie(const Common::String &filename, const Common::Point &pos) {
+bool ScalpelEngine::play3doMovie(const Common::String &filename, const Common::Point &pos, bool halfSize) {
 	Scalpel3DOMovieDecoder *videoDecoder = new Scalpel3DOMovieDecoder();
+	Graphics::Surface tempSurface;
 
 	if (!videoDecoder->loadFile(filename)) {
 		warning("Scalpel3DOMoviePlay: could not open '%s'", filename.c_str());
@@ -1257,12 +1258,30 @@ bool ScalpelEngine::play3doMovie(const Common::String &filename, const Common::P
 	_events->clearEvents();
 	videoDecoder->start();
 
+	// If we're to show the movie at half-size, we'll need a temporary intermediate surface
+	if (halfSize)
+		tempSurface.create(width / 2, height / 2, _screen->getPixelFormat());
+
 	while (!shouldQuit() && !videoDecoder->endOfVideo() && !skipVideo) {
 		if (videoDecoder->needsUpdate()) {
 			const Graphics::Surface *frame = videoDecoder->decodeNextFrame();
 
 			if (frame) {
-				g_system->copyRectToScreen(frame->getPixels(), frame->pitch, pos.x, pos.y, width, height);
+				if (halfSize) {
+					// Reduce the movie frame to half-size on a temp surface
+					for (int yp = 0; yp < height / 2; ++yp) {
+						const uint16 *srcP = (const uint16 *)frame->getBasePtr(0, yp * 2);
+						uint16 *destP = (uint16 *)tempSurface.getBasePtr(0, yp);
+
+						for (int xp = 0; xp < width / 2; ++xp, ++destP, srcP += 2)
+							*destP = *srcP;
+					}
+
+					// Point the drawing frame to the temporary surface
+					frame = &tempSurface;
+				}
+
+				g_system->copyRectToScreen(frame->getPixels(), frame->pitch, pos.x, pos.y, frame->w, frame->h);
 				g_system->updateScreen();
 			}
 		}
diff --git a/engines/sherlock/scalpel/scalpel.h b/engines/sherlock/scalpel/scalpel.h
index 1a208d7..7bf3615 100644
--- a/engines/sherlock/scalpel/scalpel.h
+++ b/engines/sherlock/scalpel/scalpel.h
@@ -142,7 +142,7 @@ public:
 	/**
 	 * Play back a 3do movie
 	 */
-	bool play3doMovie(const Common::String &filename, const Common::Point &pos);
+	bool play3doMovie(const Common::String &filename, const Common::Point &pos, bool halfSize = false);
 };
 
 } // End of namespace Scalpel
diff --git a/engines/sherlock/scalpel/scalpel_talk.cpp b/engines/sherlock/scalpel/scalpel_talk.cpp
index 0c0feed..3f894d7 100644
--- a/engines/sherlock/scalpel/scalpel_talk.cpp
+++ b/engines/sherlock/scalpel/scalpel_talk.cpp
@@ -600,7 +600,7 @@ void ScalpelTalk::talk3DOMovieTrigger(int subIndex) {
 	warning("selector: %d", selector);
 	warning("subindex: %d", subIndex);
 
-	vm.play3doMovie(movieFilename, Common::Point(5, 5));
+	vm.play3doMovie(movieFilename, Common::Point(5, 5), true);
 
 	// Restore screen HACK
 	_vm->_screen->makeAllDirty();






More information about the Scummvm-git-logs mailing list