diff options
author | Paul Gilbert | 2015-09-09 21:02:57 -0400 |
---|---|---|
committer | Paul Gilbert | 2015-09-09 21:02:57 -0400 |
commit | 84bb389baedc458e5d10fe230d716e04375ddbf0 (patch) | |
tree | 7c1fe3a231a2187dfcb9a7695076f49d11cd95f5 /engines/sherlock/scalpel/scalpel.cpp | |
parent | 707afebbf19e62462f6ffd632f658fb2c1cf2cb4 (diff) | |
download | scummvm-rg350-84bb389baedc458e5d10fe230d716e04375ddbf0.tar.gz scummvm-rg350-84bb389baedc458e5d10fe230d716e04375ddbf0.tar.bz2 scummvm-rg350-84bb389baedc458e5d10fe230d716e04375ddbf0.zip |
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
Diffstat (limited to 'engines/sherlock/scalpel/scalpel.cpp')
-rw-r--r-- | engines/sherlock/scalpel/scalpel.cpp | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/engines/sherlock/scalpel/scalpel.cpp b/engines/sherlock/scalpel/scalpel.cpp index e91c7746c9..90a7493b39 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(); } } |