From dd7525320f7778c0760cbae41647e90d419d7843 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 22 Nov 2016 21:19:54 -0500 Subject: TITANIC: Simplify movie rendering due to ManagedSurface blit enhancements --- engines/titanic/support/avi_surface.cpp | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'engines/titanic/support') 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; -- cgit v1.2.3