aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/support
diff options
context:
space:
mode:
authorPaul Gilbert2016-11-22 21:19:54 -0500
committerPaul Gilbert2016-11-22 21:19:54 -0500
commitdd7525320f7778c0760cbae41647e90d419d7843 (patch)
tree9078ab05c178ef63d9c42c840ca186bdfddab800 /engines/titanic/support
parentfa0a6f281272181acc26dcab29cb9134a8ccd179 (diff)
downloadscummvm-rg350-dd7525320f7778c0760cbae41647e90d419d7843.tar.gz
scummvm-rg350-dd7525320f7778c0760cbae41647e90d419d7843.tar.bz2
scummvm-rg350-dd7525320f7778c0760cbae41647e90d419d7843.zip
TITANIC: Simplify movie rendering due to ManagedSurface blit enhancements
Diffstat (limited to 'engines/titanic/support')
-rw-r--r--engines/titanic/support/avi_surface.cpp20
1 files changed, 14 insertions, 6 deletions
diff --git a/engines/titanic/support/avi_surface.cpp b/engines/titanic/support/avi_surface.cpp
index 17a6fcf68f..2a671156e0 100644
--- a/engines/titanic/support/avi_surface.cpp
+++ b/engines/titanic/support/avi_surface.cpp
@@ -338,14 +338,22 @@ bool AVISurface::renderFrame() {
_videoSurface->unlock();
}
} else {
- // Blit the primary video track's frame to the video surface
- Graphics::Surface *s = _movieFrameSurface[0]->rawSurface().convertTo(
- g_system->getScreenFormat(), _decoder->getPalette());
+ const Graphics::Surface &frameSurface = _movieFrameSurface[0]->rawSurface();
_videoSurface->lock();
- _videoSurface->getRawSurface()->blitFrom(*s);
+
+ if (frameSurface.format.bytesPerPixel == 1) {
+ // For paletted 8-bit surfaces, we need to convert it to 16-bit,
+ // since the blitting method we're using doesn't support palettes
+ Graphics::Surface *s = frameSurface.convertTo(g_system->getScreenFormat(),
+ _decoder->getPalette());
+ _videoSurface->getRawSurface()->blitFrom(*s);
+ s->free();
+ delete s;
+ } else {
+ _videoSurface->getRawSurface()->blitFrom(frameSurface);
+ }
+
_videoSurface->unlock();
- s->free();
- delete s;
}
return false;