From 97966c36e1ef2a00d30410c9d4daae491c1bd994 Mon Sep 17 00:00:00 2001 From: Sven Hesse Date: Tue, 29 Mar 2011 12:47:20 +0200 Subject: [PATCH] VIDEO: Add a workaround for the Inca 2 wisdom gate video When decompressing directly onto the output surface fails (because it's too small), retry decompressing into the video buffer first, which then gets blitted onto the output surface. --- video/coktel_decoder.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/video/coktel_decoder.cpp b/video/coktel_decoder.cpp index faf32eaffae..ef92e5f35eb 100644 --- a/video/coktel_decoder.cpp +++ b/video/coktel_decoder.cpp @@ -1381,9 +1381,9 @@ bool IMDDecoder::renderFrame(Common::Rect &rect) { const int offsetY = (_y + rect.top) * _surface.pitch; const int offset = offsetX + offsetY; - deLZ77((byte *)_surface.pixels + offset, dataPtr, dataSize, - _surface.w * _surface.h * _surface.bytesPerPixel - offset); - return true; + if (deLZ77((byte *)_surface.pixels + offset, dataPtr, dataSize, + _surface.w * _surface.h * _surface.bytesPerPixel - offset)) + return true; } _videoBufferLen[1] = deLZ77(_videoBuffer[1], dataPtr, dataSize, _videoBufferSize); @@ -2249,9 +2249,9 @@ bool VMDDecoder::renderFrame(Common::Rect &rect) { const int offsetY = (_y + rect.top) * _surface.pitch; const int offset = offsetX - offsetY; - deLZ77((byte *)_surface.pixels + offset, dataPtr, dataSize, - _surface.w * _surface.h * _surface.bytesPerPixel - offset); - return true; + if (deLZ77((byte *)_surface.pixels + offset, dataPtr, dataSize, + _surface.w * _surface.h * _surface.bytesPerPixel - offset)) + return true; } srcBuffer = 1;