aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Kiewitz2015-09-12 18:57:32 +0200
committerMartin Kiewitz2015-09-12 18:57:32 +0200
commit37ee1f5640ca8523382c5eadac0697fcd0484fed (patch)
tree0afb025a2080026cada4366b4c296fc8e8c58823
parent0d662c22a34547578fca52483f580db34b215cc0 (diff)
downloadscummvm-rg350-37ee1f5640ca8523382c5eadac0697fcd0484fed.tar.gz
scummvm-rg350-37ee1f5640ca8523382c5eadac0697fcd0484fed.tar.bz2
scummvm-rg350-37ee1f5640ca8523382c5eadac0697fcd0484fed.zip
SHERLOCK: SS: 3DO: draw video frame for videos
-rw-r--r--engines/sherlock/scalpel/scalpel.cpp36
1 files changed, 34 insertions, 2 deletions
diff --git a/engines/sherlock/scalpel/scalpel.cpp b/engines/sherlock/scalpel/scalpel.cpp
index b3531e86bb..8478327d33 100644
--- a/engines/sherlock/scalpel/scalpel.cpp
+++ b/engines/sherlock/scalpel/scalpel.cpp
@@ -1248,11 +1248,29 @@ bool ScalpelEngine::play3doMovie(const Common::String &filename, const Common::P
Scalpel3DOMovieDecoder *videoDecoder = new Scalpel3DOMovieDecoder();
Graphics::Surface tempSurface;
+ Common::Point framePos(pos.x, pos.y);
+ ImageFile3DO *frameImageFile = nullptr;
+ ImageFrame *frameImage = nullptr;
+ bool frameShown = false;
+
if (!videoDecoder->loadFile(filename)) {
warning("Scalpel3DOMoviePlay: could not open '%s'", filename.c_str());
return false;
}
+ _screen->_backBuffer1.blitFrom(*_screen); // save into backbuffer 1
+
+ if (halfSize) {
+ // 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
+ }
+
+ frameImageFile = new ImageFile3DO("vidframe.cel", kImageFile3DOType_Cel);
+ frameImage = &(*frameImageFile)[0];
+ }
+
bool skipVideo = false;
//byte bytesPerPixel = videoDecoder->getPixelFormat().bytesPerPixel;
uint16 width = videoDecoder->getWidth();
@@ -1283,10 +1301,18 @@ bool ScalpelEngine::play3doMovie(const Common::String &filename, const Common::P
// 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;
+ }
}
- g_system->copyRectToScreen(frame->getPixels(), frame->pitch, pos.x, pos.y, frame->w, frame->h);
- g_system->updateScreen();
+ _screen->blitFrom(*frame, pos);
+ _screen->update();
+ //g_system->copyRectToScreen(frame->getPixels(), frame->pitch, pos.x, pos.y, frame->w, frame->h);
+ //g_system->updateScreen();
}
}
@@ -1308,6 +1334,12 @@ bool ScalpelEngine::play3doMovie(const Common::String &filename, const Common::P
videoDecoder->close();
delete videoDecoder;
+ if (halfSize) {
+ delete frameImage;
+ }
+
+ _screen->blitFrom(_screen->_backBuffer1);
+
return !skipVideo;
}