aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;