From 9bfa51ef300cf95872ca2325b7bd0d64f85372e6 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Thu, 22 Oct 2015 02:14:41 +0300 Subject: MADS: Phantom: Expand the existing camera adjustment logic for V2 games This fixes all of the scenes that expand over the screen (e.g. 101, 104, 109 in Phantom, as well as the several scenes in the Dragonsphere intro). Also added a new debugger command, "set_camera", which sets the scene camera to specific coordinates --- engines/mads/scene_data.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'engines/mads/scene_data.cpp') diff --git a/engines/mads/scene_data.cpp b/engines/mads/scene_data.cpp index e48bcd8c6f..d4610c53d4 100644 --- a/engines/mads/scene_data.cpp +++ b/engines/mads/scene_data.cpp @@ -422,6 +422,18 @@ void SceneInfo::loadMadsV2Background(int sceneId, const Common::String &resName, assert(screenWidth == _width); assert(screenHeight <= _height); + // Resize the background surface to hold all of the tiles + uint16 newWidth = bgSurface.w; + uint16 newHeight = bgSurface.h; + + if (tileWidth < screenWidth && bgSurface.w != tileCount * tileWidth) + newWidth = tileCount * tileWidth; + if (tileHeight < screenHeight && bgSurface.h != tileCount * tileHeight) + newHeight = tileCount * tileHeight; + + if (bgSurface.w != newWidth || bgSurface.h != newHeight) + bgSurface.setSize(newWidth, newHeight); + // -------------------------------------------------------------------------------- // Get tile data -- cgit v1.2.3