[Scummvm-git-logs] scummvm master -> 9341ec0a8f228f26c22fc3f9db27c918d6b32a47
eriktorbjorn
noreply at scummvm.org
Thu Dec 9 18:18:15 UTC 2021
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
c2c5eb4a14 SHERLOCK: 3DO: Fix crash when playing downscaled portrait movies
9341ec0a8f SHERLOCK: 3DO: Improve portrait movie positioning
Commit: c2c5eb4a148d407ed061e85f964e0117080556ab
https://github.com/scummvm/scummvm/commit/c2c5eb4a148d407ed061e85f964e0117080556ab
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2021-12-09T19:18:01+01:00
Commit Message:
SHERLOCK: 3DO: Fix crash when playing downscaled portrait movies
If The Case of the Serrated Scalpel can't run in 640x400 pixels, the
portrait movies have to be downscaled on a temporary surface. Use the
same pixel format on this surface as the video decoder uses for the
full-size frame.
Changed paths:
engines/sherlock/scalpel/scalpel.cpp
diff --git a/engines/sherlock/scalpel/scalpel.cpp b/engines/sherlock/scalpel/scalpel.cpp
index 3469372d37..c71b17c5af 100644
--- a/engines/sherlock/scalpel/scalpel.cpp
+++ b/engines/sherlock/scalpel/scalpel.cpp
@@ -1308,7 +1308,7 @@ bool ScalpelEngine::play3doMovie(const Common::String &filename, const Common::P
// 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);
+ tempSurface.create(width / 2, height / 2, videoDecoder->getPixelFormat());
while (!shouldQuit() && !videoDecoder->endOfVideo() && !skipVideo) {
if (videoDecoder->needsUpdate()) {
Commit: 9341ec0a8f228f26c22fc3f9db27c918d6b32a47
https://github.com/scummvm/scummvm/commit/9341ec0a8f228f26c22fc3f9db27c918d6b32a47
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2021-12-09T19:18:01+01:00
Commit Message:
SHERLOCK: 3DO: Improve portrait movie positioning
The exact position is still guesswork, apparently, but at least now the
movie should be correctly positioned inside its decorative frame, both
in high and low resolution mode.
Changed paths:
engines/sherlock/scalpel/3do/scalpel_3do_screen.cpp
engines/sherlock/scalpel/scalpel.cpp
diff --git a/engines/sherlock/scalpel/3do/scalpel_3do_screen.cpp b/engines/sherlock/scalpel/3do/scalpel_3do_screen.cpp
index fb2f6f862b..ab30260d2b 100644
--- a/engines/sherlock/scalpel/3do/scalpel_3do_screen.cpp
+++ b/engines/sherlock/scalpel/3do/scalpel_3do_screen.cpp
@@ -36,7 +36,7 @@ void Scalpel3DOScreen::SHblitFrom(const Graphics::Surface &src) {
}
void Scalpel3DOScreen::SHblitFrom(const Graphics::Surface &src, const Common::Point &destPos) {
- SHblitFrom(src, Common::Point(0, 0), Common::Rect(0, 0, src.w, src.h));
+ SHblitFrom(src, destPos, Common::Rect(0, 0, src.w, src.h));
}
void Scalpel3DOScreen::SHblitFrom(const Graphics::Surface &src, const Common::Point &pt, const Common::Rect &srcBounds) {
diff --git a/engines/sherlock/scalpel/scalpel.cpp b/engines/sherlock/scalpel/scalpel.cpp
index c71b17c5af..af6a0dd570 100644
--- a/engines/sherlock/scalpel/scalpel.cpp
+++ b/engines/sherlock/scalpel/scalpel.cpp
@@ -1275,7 +1275,6 @@ bool ScalpelEngine::play3doMovie(const Common::String &filename, const Common::P
Video::ThreeDOMovieDecoder *videoDecoder = new Video::ThreeDOMovieDecoder();
Graphics::ManagedSurface tempSurface;
- Common::Point framePos(pos.x, pos.y);
ImageFile3DO *frameImageFile = nullptr;
ImageFrame *frameImage = nullptr;
bool frameShown = false;
@@ -1285,18 +1284,31 @@ bool ScalpelEngine::play3doMovie(const Common::String &filename, const Common::P
return false;
}
+ Common::Point moviePos(pos.x, pos.y);
+ int frameWidth = 8;
+
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;
- framePos.y -= 8; // frame is 8 pixels on left + top, and 7 pixels on right + bottom
+ if (!halfSize) {
+ moviePos.x *= 2;
+ moviePos.y *= 2;
+ frameWidth *= 2;
}
+ // Safety check. Only for portrait videos, not for EA intro logo and such
+ if (moviePos.x < frameWidth)
+ moviePos.x = frameWidth;
+ if (moviePos.y < frameWidth)
+ moviePos.y = frameWidth;
+
frameImageFile = new ImageFile3DO("vidframe.cel", kImageFile3DOType_Cel);
frameImage = &(*frameImageFile)[0];
}
+ // frame is 8 pixels on left + top, and 7 pixels on right + bottom
+ Common::Point framePos(moviePos.x - frameWidth, moviePos.y - frameWidth);
+
bool skipVideo = false;
//byte bytesPerPixel = videoDecoder->getPixelFormat().bytesPerPixel;
uint16 width = videoDecoder->getWidth();
@@ -1382,9 +1394,9 @@ bool ScalpelEngine::play3doMovie(const Common::String &filename, const Common::P
}
if (isPortrait && !halfSize) {
- screen.rawBlitFrom(*frame, Common::Point(pos.x * 2, pos.y * 2));
+ screen.rawBlitFrom(*frame, moviePos);
} else {
- _screen->SHblitFrom(*frame, pos);
+ _screen->SHblitFrom(*frame, moviePos);
}
_screen->update();
More information about the Scummvm-git-logs
mailing list