From e58ae71bef7c25d20c23e75dc426f0e7321f2390 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 11 Oct 2014 16:27:25 -0400 Subject: MADS: Fix loading wide-screen backgrounds during intro animation --- engines/mads/scene_data.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'engines/mads/scene_data.cpp') diff --git a/engines/mads/scene_data.cpp b/engines/mads/scene_data.cpp index aeeb99d5b3..2101a85bd0 100644 --- a/engines/mads/scene_data.cpp +++ b/engines/mads/scene_data.cpp @@ -217,7 +217,7 @@ void SceneInfo::load(int sceneId, int variant, const Common::String &resName, int width = _width; int height = _height; - if (!bgSurface.getPixels()) { + if (!bgSurface.getPixels() || (bgSurface.w != width) || (bgSurface.h != height)) { bgSurface.setSize(width, height); } @@ -342,8 +342,8 @@ void SceneInfo::loadMadsV1Background(int sceneId, const Common::String &resName, File artFile(resourceName); MadsPack artResource(&artFile); - // Read in the background surface data - assert(_width == bgSurface.w && _height == bgSurface.h); + // Read inhh the background surface data + assert(_width && _height == bgSurface.h); stream = artResource.getItemStream(1); stream->read(bgSurface.getPixels(), bgSurface.w * bgSurface.h); delete stream; @@ -353,7 +353,9 @@ void SceneInfo::loadMadsV1Background(int sceneId, const Common::String &resName, Common::SeekableReadStream *palStream = artResource.getItemStream(0); Common::Array palette; - palStream->skip(4); // Skip width and height + _width = palStream->readUint16LE(); + _height = palStream->readUint16LE(); + int numColors = palStream->readUint16LE(); assert(numColors <= 252); palette.resize(numColors); -- cgit v1.2.3