From 492166debe75bc392753561a4f995bbd72ca8b39 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 13 Sep 2015 17:08:12 -0400 Subject: SHERLOCK: 3DO: Show portrait videos at full size when in hi-res mode --- engines/sherlock/scalpel/scalpel.cpp | 34 ++++++++++++----------------- engines/sherlock/scalpel/scalpel.h | 2 +- engines/sherlock/scalpel/scalpel_screen.cpp | 8 +++++++ engines/sherlock/scalpel/scalpel_screen.h | 4 +--- 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/engines/sherlock/scalpel/scalpel.cpp b/engines/sherlock/scalpel/scalpel.cpp index ebf4cdea2a..affd0e956f 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 02397304e0..af4d72a7d7 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 a06314f57f..71bcca5dc5 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 15db24bbd2..d6018a44a0 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!) -- cgit v1.2.3