aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2014-03-18 23:13:13 -0400
committerPaul Gilbert2014-03-18 23:13:13 -0400
commit53eac0d7c045c734e897df1c0246cab185af0463 (patch)
tree542501349bea6e7e8246f6134f99b7c5d610c41c /engines
parent5b4b7a5ca972f533c7a6129e84fd5d26e3b2ebb6 (diff)
downloadscummvm-rg350-53eac0d7c045c734e897df1c0246cab185af0463.tar.gz
scummvm-rg350-53eac0d7c045c734e897df1c0246cab185af0463.tar.bz2
scummvm-rg350-53eac0d7c045c734e897df1c0246cab185af0463.zip
MADS: Fixes for scene background loading
Diffstat (limited to 'engines')
-rw-r--r--engines/mads/scene.cpp4
-rw-r--r--engines/mads/user_interface.cpp8
-rw-r--r--engines/mads/user_interface.h2
3 files changed, 6 insertions, 8 deletions
diff --git a/engines/mads/scene.cpp b/engines/mads/scene.cpp
index 79ac2ceab1..02ef916958 100644
--- a/engines/mads/scene.cpp
+++ b/engines/mads/scene.cpp
@@ -150,8 +150,8 @@ void Scene::loadScene(int sceneId, const Common::String &prefix, bool palFlag) {
flags |= 0x200;
_animationData = Animation::init(_vm, this);
- UserInterface surface(_vm);
- _animationData->load(surface, _userInterface, prefix, flags, nullptr, nullptr);
+ MSurface depthSurface;
+ _animationData->load(_userInterface, depthSurface, prefix, flags, nullptr, nullptr);
_vm->_palette->_paletteUsage.load(0);
diff --git a/engines/mads/user_interface.cpp b/engines/mads/user_interface.cpp
index d11c1220df..a117ae0d01 100644
--- a/engines/mads/user_interface.cpp
+++ b/engines/mads/user_interface.cpp
@@ -83,7 +83,7 @@ void UISlots::draw(bool updateFlag, bool delFlag) {
if (dirtyAreaPtr)
dirtyAreaPtr->_active = true;
- // Main draw loop
+ // Copy parts of the user interface background that are going to have sprites drawn
for (uint idx = 0; idx < size(); ++idx) {
DirtyArea &dirtyArea = userInterface._dirtyAreas[idx];
UISlot &slot = (*this)[idx];
@@ -205,6 +205,8 @@ UserInterface::UserInterface(MADSEngine *vm) : _vm(vm), _dirtyAreas(vm),
// Map the user interface to the bottom of the game's screen surface
byte *pData = _vm->_screen.getBasePtr(0, MADS_SCENE_HEIGHT);
setPixels(pData, MADS_SCREEN_WIDTH, MADS_INTERFACE_HEIGHT);
+
+ _surface.setSize(MADS_SCREEN_WIDTH, MADS_INTERFACE_HEIGHT);
}
void UserInterface::load(const Common::String &resName) {
@@ -228,7 +230,6 @@ void UserInterface::load(const Common::String &resName) {
// Read in the surface data
Common::SeekableReadStream *pixelsStream = madsPack.getItemStream(1);
- _surface.setSize(MADS_SCREEN_WIDTH, MADS_INTERFACE_HEIGHT);
pixelsStream->read(_surface.getData(), MADS_SCREEN_WIDTH * MADS_INTERFACE_HEIGHT);
delete pixelsStream;
}
@@ -263,9 +264,6 @@ void UserInterface::setup(int id) {
_v1E = -1;
_v1C = -1;
- // Make a copy of the surface
- copyTo(&_surface);
-
if (_vm->_game->_v1 == 5)
scene._userInterface._uiSlots.draw(false, false);
diff --git a/engines/mads/user_interface.h b/engines/mads/user_interface.h
index 9d2af0425d..b9035c59ee 100644
--- a/engines/mads/user_interface.h
+++ b/engines/mads/user_interface.h
@@ -83,7 +83,6 @@ class UserInterface : public MSurface {
friend class UISlots;
private:
MADSEngine *_vm;
- MSurface _surface;
int _invSpritesIndex;
int _invFrameNumber;
@@ -139,6 +138,7 @@ private:
*/
void inventoryAnim();
public:
+ MSurface _surface;
UISlots _uiSlots;
DirtyAreas _dirtyAreas;
ScrCategory _category;