[Scummvm-cvs-logs] scummvm master -> 492166debe75bc392753561a4f995bbd72ca8b39

dreammaster dreammaster at scummvm.org
Sun Sep 13 23:08:46 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:
492166debe SHERLOCK: 3DO: Show portrait videos at full size when in hi-res mode


Commit: 492166debe75bc392753561a4f995bbd72ca8b39
    https://github.com/scummvm/scummvm/commit/492166debe75bc392753561a4f995bbd72ca8b39
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2015-09-13T17:08:12-04:00

Commit Message:
SHERLOCK: 3DO: Show portrait videos at full size when in hi-res mode

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



diff --git a/engines/sherlock/scalpel/scalpel.cpp b/engines/sherlock/scalpel/scalpel.cpp
index ebf4cde..affd0e9 100644
--- a/engines/sherlock/scalpel/scalpel.cpp
+++ b/engines/sherlock/scalpel/scalpel.cpp
@@ -1263,7 +1263,7 @@ void ScalpelEngine::showScummVMRestoreDialog() {
 	delete dialog;
 }
 
-bool ScalpelEngine::play3doMovie(const Common::String &filename, const Common::Point &pos, bool halfSize) {
+bool ScalpelEngine::play3doMovie(const Common::String &filename, const Common::Point &pos, bool isPortrait) {
 	Scalpel3DOScreen &screen = *(Scalpel3DOScreen *)_screen;
 	Scalpel3DOMovieDecoder *videoDecoder = new Scalpel3DOMovieDecoder();
 	Graphics::Surface tempSurface;
@@ -1278,7 +1278,8 @@ bool ScalpelEngine::play3doMovie(const Common::String &filename, const Common::P
 		return false;
 	}
 
-	if (halfSize) {
+	bool halfSize = isPortrait && !_isScreenDoubled;
+	if (isPortrait) {
 		// only for portrait videos, not for EA intro logo and such
 		if ((framePos.x >= 8) && (framePos.y >= 8)) { // safety check
 			framePos.x -= 8;
@@ -1362,31 +1363,24 @@ bool ScalpelEngine::play3doMovie(const Common::String &filename, const Common::P
 							downscaleTargetPtr++;
 						}
 					}
-#if 0
-					// 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;
-					}
-#endif
 
 					// Point the drawing frame to the temporary surface
 					frame = &tempSurface;
+				}
 
-					if (!frameShown) {
-						// Draw the frame (not the frame of the video, but a frame around the video) itself
-						_screen->transBlitFrom(frameImage->_frame, framePos);
-						frameShown = true;
-					}
+				if (isPortrait && !frameShown) {
+					// Draw the frame (not the frame of the video, but a frame around the video) itself
+					_screen->transBlitFrom(frameImage->_frame, framePos);
+					frameShown = true;
+				}
+
+				if (isPortrait && !halfSize) {
+					screen.rawBlitFrom(*frame, Common::Point(pos.x * 2, pos.y * 2));
+				} else {
+					_screen->blitFrom(*frame, pos);
 				}
 
-				_screen->blitFrom(*frame, pos);
 				_screen->update();
-				//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 0239730..af4d72a 100644
--- a/engines/sherlock/scalpel/scalpel.h
+++ b/engines/sherlock/scalpel/scalpel.h
@@ -150,7 +150,7 @@ public:
 	/**
 	 * Play back a 3do movie
 	 */
-	bool play3doMovie(const Common::String &filename, const Common::Point &pos, bool halfSize = false);
+	bool play3doMovie(const Common::String &filename, const Common::Point &pos, bool isPortrait = false);
 };
 
 } // End of namespace Scalpel
diff --git a/engines/sherlock/scalpel/scalpel_screen.cpp b/engines/sherlock/scalpel/scalpel_screen.cpp
index a06314f..71bcca5 100644
--- a/engines/sherlock/scalpel/scalpel_screen.cpp
+++ b/engines/sherlock/scalpel/scalpel_screen.cpp
@@ -329,6 +329,14 @@ uint16 Scalpel3DOScreen::h() const {
 	return _vm->_isScreenDoubled ? _surface.h / 2 : _surface.h;
 }
 
+void Scalpel3DOScreen::rawBlitFrom(const Graphics::Surface &src, const Common::Point &pt) {
+	Common::Rect srcRect(0, 0, src.w, src.h);
+	Common::Rect destRect(pt.x, pt.y, pt.x + src.w, pt.y + src.h);
+
+	addDirtyRect(destRect);
+	_surface.copyRectToSurface(src, destRect.left, destRect.top, srcRect);
+}
+
 } // End of namespace Scalpel
 
 } // End of namespace Sherlock
diff --git a/engines/sherlock/scalpel/scalpel_screen.h b/engines/sherlock/scalpel/scalpel_screen.h
index 15db24b..d6018a4 100644
--- a/engines/sherlock/scalpel/scalpel_screen.h
+++ b/engines/sherlock/scalpel/scalpel_screen.h
@@ -79,9 +79,7 @@ public:
 	/**
 	 * Draws a sub-section of a surface at a given position within this surface
 	 */
-	void rawBlitFrom(const Graphics::Surface &src, const Common::Point &pt, const Common::Rect &srcBounds) {
-		ScalpelScreen::blitFrom(src, pt, srcBounds);
-	}
+	void rawBlitFrom(const Graphics::Surface &src, const Common::Point &pt);
 
 	/**
 	 * Fade backbuffer 1 into screen (3DO RGB!)






More information about the Scummvm-git-logs mailing list