diff options
-rw-r--r-- | engines/titanic/support/avi_surface.cpp | 20 |
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; |