aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2014-03-15 18:43:39 -0400
committerPaul Gilbert2014-03-15 18:43:39 -0400
commitb652e2eafd3de5436b45619659b5299d945074be (patch)
tree4766419b95c6f44c309256a7d5860d4bb184e8c1
parent10124f6806150aad409f6db9a6c7a60afcb44872 (diff)
downloadscummvm-rg350-b652e2eafd3de5436b45619659b5299d945074be.tar.gz
scummvm-rg350-b652e2eafd3de5436b45619659b5299d945074be.tar.bz2
scummvm-rg350-b652e2eafd3de5436b45619659b5299d945074be.zip
MADS: Merged the InterfaceSurface and UserInterface classes
-rw-r--r--engines/mads/animation.cpp11
-rw-r--r--engines/mads/animation.h6
-rw-r--r--engines/mads/interface.cpp132
-rw-r--r--engines/mads/interface.h69
-rw-r--r--engines/mads/mads.cpp3
-rw-r--r--engines/mads/mads.h1
-rw-r--r--engines/mads/module.mk1
-rw-r--r--engines/mads/nebular/nebular_scenes1.cpp2
-rw-r--r--engines/mads/nebular/nebular_scenes8.cpp2
-rw-r--r--engines/mads/scene.cpp24
-rw-r--r--engines/mads/scene.h3
-rw-r--r--engines/mads/scene_data.cpp16
-rw-r--r--engines/mads/user_interface.cpp101
-rw-r--r--engines/mads/user_interface.h37
14 files changed, 155 insertions, 253 deletions
diff --git a/engines/mads/animation.cpp b/engines/mads/animation.cpp
index 09a9e1fc04..783611e3da 100644
--- a/engines/mads/animation.cpp
+++ b/engines/mads/animation.cpp
@@ -172,9 +172,9 @@ void Animation::free() {
delete this;
}
-void Animation::load(MSurface &depthSurface, InterfaceSurface &interfaceSurface,
- const Common::String &resName, int flags, Common::Array<RGB4> *palAnimData,
- SceneInfo *sceneInfo) {
+void Animation::load(UserInterface &interfaceSurface, MSurface &depthSurface,
+ const Common::String &resName, int flags, Common::Array<RGB4> *palAnimData,
+ SceneInfo *sceneInfo) {
Common::String resourceName = resName;
if (!resourceName.contains("."))
resourceName += ".AA";
@@ -352,7 +352,7 @@ bool Animation::drawFrame(SpriteAsset &spriteSet, const Common::Point &pt, int f
return 0;
}
-void Animation::loadInterface(InterfaceSurface &interfaceSurface, MSurface &depthSurface,
+void Animation::loadInterface(UserInterface &interfaceSurface, MSurface &depthSurface,
AAHeader &header, int flags, Common::Array<RGB4> *palAnimData, SceneInfo *sceneInfo) {
_scene->_depthStyle = 0;
if (header._animMode <= 2) {
@@ -363,8 +363,7 @@ void Animation::loadInterface(InterfaceSurface &interfaceSurface, MSurface &dept
for (uint i = 0; i < sceneInfo->_palAnimData.size(); ++i)
palAnimData->push_back(sceneInfo->_palAnimData[i]);
}
- }
- else if (header._animMode == 4) {
+ } else if (header._animMode == 4) {
// Load a scene interface
Common::String resourceName = "*" + header._interfaceFile;
interfaceSurface.load(resourceName);
diff --git a/engines/mads/animation.h b/engines/mads/animation.h
index c5308b7753..dd902b8b68 100644
--- a/engines/mads/animation.h
+++ b/engines/mads/animation.h
@@ -29,7 +29,7 @@
#include "mads/msurface.h"
#include "mads/scene_data.h"
#include "mads/font.h"
-#include "mads/interface.h"
+#include "mads/user_interface.h"
namespace MADS {
@@ -144,7 +144,7 @@ private:
/**
* Load the user interface display for an animation
*/
- void loadInterface(InterfaceSurface &interfaceSurface, MSurface &depthSurface,
+ void loadInterface(UserInterface &interfaceSurface, MSurface &depthSurface,
AAHeader &header, int flags, Common::Array<RGB4> *palAnimData, SceneInfo *sceneInfo);
/**
@@ -169,7 +169,7 @@ public:
/**
* Loads animation data
*/
- void load(MSurface &depthSurface, InterfaceSurface &interfaceSurface, const Common::String &resName,
+ void load(UserInterface &interfaceSurface, MSurface &depthSurface, const Common::String &resName,
int flags, Common::Array<RGB4> *palAnimData, SceneInfo *sceneInfo);
/**
diff --git a/engines/mads/interface.cpp b/engines/mads/interface.cpp
deleted file mode 100644
index 8ea8913b69..0000000000
--- a/engines/mads/interface.cpp
+++ /dev/null
@@ -1,132 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
-
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
-
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "common/scummsys.h"
-#include "mads/mads.h"
-#include "mads/compression.h"
-#include "mads/interface.h"
-
-namespace MADS {
-
-void SceneNode::load(Common::SeekableReadStream *f) {
- _walkPos.x = f->readSint16LE();
- _walkPos.y = f->readSint16LE();
- for (int i = 0; i < MAX_ROUTE_NODES; ++i)
- _indexes[i] = f->readUint16LE();
-}
-
-/*------------------------------------------------------------------------*/
-
-InterfaceSurface::InterfaceSurface(MADSEngine *vm) : _vm(vm) {
- _category = CAT_NONE;
- _screenObjectsCount = 0;
-}
-
-
-void InterfaceSurface::load(const Common::String &resName) {
- File f(resName);
- MadsPack madsPack(&f);
-
- // Load in the palette
- Common::SeekableReadStream *palStream = madsPack.getItemStream(0);
-
- uint32 *gamePalP = &_vm->_palette->_palFlags[0];
- byte *palP = &_vm->_palette->_mainPalette[0];
-
- for (int i = 0; i < 16; ++i, gamePalP++, palP += 3) {
- palP[0] = VGA_COLOR_TRANS(palStream->readByte());
- palP[1] = VGA_COLOR_TRANS(palStream->readByte());
- palP[2] = VGA_COLOR_TRANS(palStream->readByte());
- *gamePalP |= 1;
- palStream->skip(3);
- }
- delete palStream;
-
- // set the size for the interface
- setSize(MADS_SCREEN_WIDTH, MADS_INTERFACE_HEIGHT);
- Common::SeekableReadStream *pixelsStream = madsPack.getItemStream(1);
- pixelsStream->read(getData(), MADS_SCREEN_WIDTH * MADS_INTERFACE_HEIGHT);
- delete pixelsStream;
-}
-
-void InterfaceSurface::setup(int id) {
- Scene &scene = _vm->_game->_scene;
-
- if (scene._screenObjects._v832EC != id) {
- Common::String resName = _vm->_game->_aaName;
-
- // Strip off any extension
- const char *p = strchr(resName.c_str(), '.');
- if (p) {
- resName = Common::String(resName.c_str(), p);
- }
-
- // Add on suffix if necessary
- if (id)
- resName += "A";
-
- resName += ".INT";
- free();
- load(resName);
- }
- scene._screenObjects._v832EC = id;
-
- scene._imageInterEntries.clear();
- scene._imageInterEntries.add(-2, 0xff);
- _vm->_game->_ticksExpiry = _vm->_events->getFrameCounter();
- scene._v1A = true;
- _vm->_game->_objectHiliteVocabIdx = -1;
- scene._v1C = -1;
-
- // Make a copy of the surface
- copyTo(&_surface);
-
- if (_vm->_game->_v1 == 5)
- scene._imageInterEntries.call(0, 0);
-
- scene._action.clear();
- writeText();
- loadElements();
- scene._dynamicHotspots.refresh();
-}
-
-void InterfaceSurface::elementHighlighted() {
- warning("TODO: InterfaceSurface::elementHighlighted");
-}
-
-void InterfaceSurface::writeText() {
- warning("TODO: InterfaceSurface::writeText");
-}
-
-
-void InterfaceSurface::setBounds(const Common::Rect &r) {
- _bounds = r;
-}
-
-void InterfaceSurface::loadElements() {
- warning("TODO: InterfaceSurface::loadElements");
-}
-
-/*------------------------------------------------------------------------*/
-
-
-} // End of namespace MADS
diff --git a/engines/mads/interface.h b/engines/mads/interface.h
deleted file mode 100644
index 0d7860b30a..0000000000
--- a/engines/mads/interface.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
-
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
-
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef MADS_INTERFACE_H
-#define MADS_INTERFACE_H
-
-#include "common/scummsys.h"
-#include "common/rect.h"
-#include "common/str.h"
-#include "mads/msurface.h"
-
-namespace MADS {
-
-class InterfaceSurface : public MSurface {
-private:
- MADSEngine *_vm;
-
- void loadElements();
-public:
- ScrCategory _category;
- int _screenObjectsCount;
- Common::Rect _bounds;
- Common::Rect *_rectP;
- MSurface _surface;
-public:
- /**
- * Constructor
- */
- InterfaceSurface(MADSEngine *vm);
-
- /**
- * Loads an interface from a specified resource
- */
- void load(const Common::String &resName);
-
- /**
- * Set up the interface
- */
- void setup(int id);
-
- void elementHighlighted();
-
- void writeText();
-
- void setBounds(const Common::Rect &r);
-};
-
-} // End of namespace MADS
-
-#endif /* MADS_INTERFACE_H */
diff --git a/engines/mads/mads.cpp b/engines/mads/mads.cpp
index 9cab1ad8f9..ded94871f6 100644
--- a/engines/mads/mads.cpp
+++ b/engines/mads/mads.cpp
@@ -52,7 +52,6 @@ MADSEngine::MADSEngine(OSystem *syst, const MADSGameDescription *gameDesc) :
_palette = nullptr;
_resources = nullptr;
_sound = nullptr;
- _userInterface = nullptr;
}
MADSEngine::~MADSEngine() {
@@ -64,7 +63,6 @@ MADSEngine::~MADSEngine() {
delete _palette;
delete _resources;
delete _sound;
- delete _userInterface;
}
void MADSEngine::initialise() {
@@ -85,7 +83,6 @@ void MADSEngine::initialise() {
_font = new Font(this);
_screen.init();
_sound = new SoundManager(this, _mixer);
- _userInterface = UserInterface::init(this);
_game = Game::init(this);
_screen.empty();
diff --git a/engines/mads/mads.h b/engines/mads/mads.h
index 749c69a64c..10f4badf75 100644
--- a/engines/mads/mads.h
+++ b/engines/mads/mads.h
@@ -100,7 +100,6 @@ public:
Resources *_resources;
ScreenSurface _screen;
SoundManager *_sound;
- UserInterface *_userInterface;
bool _easyMouse;
bool _invObjectStill;
bool _textWindowStill;
diff --git a/engines/mads/module.mk b/engines/mads/module.mk
index 76d80bc3e3..74376dc149 100644
--- a/engines/mads/module.mk
+++ b/engines/mads/module.mk
@@ -20,7 +20,6 @@ MODULE_OBJS := \
game.o \
game_data.o \
hotspots.o \
- interface.o \
inventory.o \
mads.o \
messages.o \
diff --git a/engines/mads/nebular/nebular_scenes1.cpp b/engines/mads/nebular/nebular_scenes1.cpp
index d684f02c84..cdc754702c 100644
--- a/engines/mads/nebular/nebular_scenes1.cpp
+++ b/engines/mads/nebular/nebular_scenes1.cpp
@@ -117,7 +117,7 @@ void Scene103::enter() {
_globals._spriteIndexes[17], SM_FRAME_INDEX, 2, 72);
_globals._spriteIndexes[19] = _scene->_sequences.addSubEntry(
_globals._spriteIndexes[17], SM_FRAME_INDEX, 2, 72);
- int idx = _scene->_sequences.addSubEntry(_globals._spriteIndexes[17],
+ _scene->_sequences.addSubEntry(_globals._spriteIndexes[17],
SM_FRAME_INDEX, 2, 73);
_globals._spriteIndexes[23] = _scene->_sequences.addSpriteCycle(
diff --git a/engines/mads/nebular/nebular_scenes8.cpp b/engines/mads/nebular/nebular_scenes8.cpp
index 7bc1af9298..2aa65d90f0 100644
--- a/engines/mads/nebular/nebular_scenes8.cpp
+++ b/engines/mads/nebular/nebular_scenes8.cpp
@@ -138,7 +138,7 @@ void Scene804::enter() {
Scene8xx::enter1();
if (_globals[165] && !_globals[164]) {
- _scene->_interface.setup(2);
+ _scene->_userInterface.setup(2);
_vm->_sound->command(19);
}
}
diff --git a/engines/mads/scene.cpp b/engines/mads/scene.cpp
index 8bf0b6a527..d1e83f6d0a 100644
--- a/engines/mads/scene.cpp
+++ b/engines/mads/scene.cpp
@@ -29,9 +29,9 @@
namespace MADS {
Scene::Scene(MADSEngine *vm): _vm(vm), _action(_vm), _depthSurface(vm),
- _dirtyAreas(_vm), _dynamicHotspots(vm), _interface(vm),
- _kernelMessages(vm), _screenObjects(vm), _sequences(vm),
- _sprites(vm), _spriteSlots(vm), _textDisplay(vm) {
+ _dirtyAreas(_vm), _dynamicHotspots(vm), _kernelMessages(vm),
+ _screenObjects(vm), _sequences(vm), _sprites(vm), _spriteSlots(vm),
+ _textDisplay(vm), _userInterface(vm) {
_priorSceneId = 0;
_nextSceneId = 0;
_currentSceneId = 0;
@@ -159,8 +159,8 @@ void Scene::loadScene(int sceneId, const Common::String &prefix, bool palFlag) {
flags |= 0x200;
_animationData = Animation::init(_vm, this);
- MSurface surface;
- _animationData->load(surface, _interface, prefix, flags, nullptr, nullptr);
+ UserInterface surface(_vm);
+ _animationData->load(surface, _userInterface, prefix, flags, nullptr, nullptr);
_vm->_palette->_paletteUsage.load(0);
@@ -171,7 +171,7 @@ void Scene::loadScene(int sceneId, const Common::String &prefix, bool palFlag) {
_interfaceY = MADS_SCENE_HEIGHT;
_spritesCount = _sprites.size();
- _interface.setup(_screenObjects._v832EC);
+ _userInterface.setup(_screenObjects._v832EC);
warning("TODO: showMouse");
@@ -341,7 +341,7 @@ void Scene::doFrame() {
CursorType cursorId = CURSOR_ARROW;
if (_action._v83338 == 1 && !_screenObjects._v7FECA &&
_screenObjects._category == CAT_HOTSPOT) {
- int idx = _screenObjects._selectedObject - _interface._screenObjectsCount;
+ int idx = _screenObjects._selectedObject - _userInterface._screenObjectsCount;
if (idx >= (int)_hotspots.size()) {
idx -= _hotspots.size();
_vm->_events->_newCursorId = _dynamicHotspots[idx]._cursor;
@@ -392,7 +392,7 @@ void Scene::doFrame() {
// Write any text needed by the interface
if (_vm->_game->_abortTimers2)
- _interface.writeText();
+ _userInterface.writeText();
// Draw any elements
drawElements((ScreenTransition)_vm->_game->_abortTimers2, _vm->_game->_abortTimers2);
@@ -454,7 +454,7 @@ void Scene::drawElements(ScreenTransition transitionType, bool surfaceFlag) {
//
_vm->_screen.setPointer(&_vm->_screen);
- _interface.setBounds(Common::Rect(_vm->_screen._offset.x, _vm->_screen._offset.y,
+ _userInterface.setBounds(Common::Rect(_vm->_screen._offset.x, _vm->_screen._offset.y,
_vm->_screen._offset.x + _vm->_screen.w, _vm->_screen._offset.y + _vm->_screen.h));
if (transitionType) {
@@ -500,11 +500,11 @@ void Scene::checkKeyboard() {
void Scene::loadAnimation(const Common::String &resName, int abortTimers) {
assert(_activeAnimation == nullptr);
- MSurface sceneSurface;
- InterfaceSurface interfaceSurface(_vm);
+ MSurface depthSurface;
+ UserInterface interfaceSurface(_vm);
_activeAnimation = Animation::init(_vm, this);
- _activeAnimation->load(sceneSurface, interfaceSurface, resName,
+ _activeAnimation->load(interfaceSurface, depthSurface, resName,
_vm->_game->_v2 ? 1 : 0, nullptr, nullptr);
_activeAnimation->startAnimation(abortTimers);
}
diff --git a/engines/mads/scene.h b/engines/mads/scene.h
index f96cb592e2..292eb4af80 100644
--- a/engines/mads/scene.h
+++ b/engines/mads/scene.h
@@ -35,6 +35,7 @@
#include "mads/animation.h"
#include "mads/sequence.h"
#include "mads/sprites.h"
+#include "mads/user_interface.h"
namespace MADS {
@@ -101,7 +102,7 @@ public:
SceneInfo *_sceneInfo;
MSurface _backgroundSurface;
DepthSurface _depthSurface;
- InterfaceSurface _interface;
+ UserInterface _userInterface;
bool _animFlag;
int _animVal1;
int _animCount;
diff --git a/engines/mads/scene_data.cpp b/engines/mads/scene_data.cpp
index de053a62e9..94bbb7b4c1 100644
--- a/engines/mads/scene_data.cpp
+++ b/engines/mads/scene_data.cpp
@@ -77,34 +77,34 @@ void ScreenObjects::check(bool scanFlag) {
}
// Handling for easy mouse
- ScrCategory category = scene._interface._category;
+ ScrCategory category = scene._userInterface._category;
if (_vm->_easyMouse && !_vm->_events->_vD4 && category != _category
- && scene._interface._category != CAT_NONE) {
+ && scene._userInterface._category != CAT_NONE) {
_released = true;
if (category >= CAT_ACTION && category <= CAT_6) {
- scene._interface.elementHighlighted();
+ scene._userInterface.elementHighlighted();
}
}
_released = _vm->_events->_mouseReleased;
if (_vm->_events->_vD2 || (_vm->_easyMouse && !_vm->_events->_vD4))
- scene._interface._category = _category;
+ scene._userInterface._category = _category;
if (!_vm->_events->_mouseButtons || _vm->_easyMouse) {
if (category >= CAT_ACTION && category <= CAT_6) {
- scene._interface.elementHighlighted();
+ scene._userInterface.elementHighlighted();
}
}
if (_vm->_events->_mouseButtons || (_vm->_easyMouse && scene._action._v83338 > 1
- && scene._interface._category == CAT_INV_LIST) ||
- (_vm->_easyMouse && scene._interface._category == CAT_HOTSPOT)) {
+ && scene._userInterface._category == CAT_INV_LIST) ||
+ (_vm->_easyMouse && scene._userInterface._category == CAT_HOTSPOT)) {
scene._action.checkActionAtMousePos();
}
if (_vm->_events->_mouseReleased) {
scene.leftClick();
- scene._interface._category = CAT_NONE;
+ scene._userInterface._category = CAT_NONE;
}
if (_vm->_events->_mouseButtons || _vm->_easyMouse || _yp)
diff --git a/engines/mads/user_interface.cpp b/engines/mads/user_interface.cpp
index ec5ca8a0b5..6afbf4c09c 100644
--- a/engines/mads/user_interface.cpp
+++ b/engines/mads/user_interface.cpp
@@ -22,22 +22,107 @@
#include "common/scummsys.h"
#include "mads/mads.h"
-#include "mads/screen.h"
+#include "mads/compression.h"
#include "mads/user_interface.h"
-#include "mads/msurface.h"
namespace MADS {
-UserInterface *UserInterface::init(MADSEngine *vm) {
- return new UserInterface(vm);
+void SceneNode::load(Common::SeekableReadStream *f) {
+ _walkPos.x = f->readSint16LE();
+ _walkPos.y = f->readSint16LE();
+ for (int i = 0; i < MAX_ROUTE_NODES; ++i)
+ _indexes[i] = f->readUint16LE();
}
-UserInterface::UserInterface(MADSEngine *vm): _vm(vm), _surface(
- new MSurface(MADS_SCREEN_WIDTH, MADS_INTERFACE_HEIGHT)) {
+/*------------------------------------------------------------------------*/
+
+UserInterface::UserInterface(MADSEngine *vm) : _vm(vm) {
+ _category = CAT_NONE;
+ _screenObjectsCount = 0;
+}
+
+void UserInterface::load(const Common::String &resName) {
+ File f(resName);
+ MadsPack madsPack(&f);
+
+ // Load in the palette
+ Common::SeekableReadStream *palStream = madsPack.getItemStream(0);
+
+ uint32 *gamePalP = &_vm->_palette->_palFlags[0];
+ byte *palP = &_vm->_palette->_mainPalette[0];
+
+ for (int i = 0; i < 16; ++i, gamePalP++, palP += 3) {
+ palP[0] = VGA_COLOR_TRANS(palStream->readByte());
+ palP[1] = VGA_COLOR_TRANS(palStream->readByte());
+ palP[2] = VGA_COLOR_TRANS(palStream->readByte());
+ *gamePalP |= 1;
+ palStream->skip(3);
+ }
+ delete palStream;
+
+ // set the size for the interface
+ setSize(MADS_SCREEN_WIDTH, MADS_INTERFACE_HEIGHT);
+ Common::SeekableReadStream *pixelsStream = madsPack.getItemStream(1);
+ pixelsStream->read(getData(), MADS_SCREEN_WIDTH * MADS_INTERFACE_HEIGHT);
+ delete pixelsStream;
+}
+
+void UserInterface::setup(int id) {
+ Scene &scene = _vm->_game->_scene;
+
+ if (scene._screenObjects._v832EC != id) {
+ Common::String resName = _vm->_game->_aaName;
+
+ // Strip off any extension
+ const char *p = strchr(resName.c_str(), '.');
+ if (p) {
+ resName = Common::String(resName.c_str(), p);
+ }
+
+ // Add on suffix if necessary
+ if (id)
+ resName += "A";
+
+ resName += ".INT";
+ free();
+ load(resName);
+ }
+ scene._screenObjects._v832EC = id;
+
+ scene._imageInterEntries.clear();
+ scene._imageInterEntries.add(-2, 0xff);
+ _vm->_game->_ticksExpiry = _vm->_events->getFrameCounter();
+ scene._v1A = true;
+ _vm->_game->_objectHiliteVocabIdx = -1;
+ scene._v1C = -1;
+
+ // Make a copy of the surface
+ copyTo(&_surface);
+
+ if (_vm->_game->_v1 == 5)
+ scene._imageInterEntries.call(0, 0);
+
+ scene._action.clear();
+ writeText();
+ loadElements();
+ scene._dynamicHotspots.refresh();
+}
+
+void UserInterface::elementHighlighted() {
+ warning("TODO: UserInterface::elementHighlighted");
+}
+
+void UserInterface::writeText() {
+ warning("TODO: UserInterface::writeText");
+}
+
+
+void UserInterface::setBounds(const Common::Rect &r) {
+ _bounds = r;
}
-UserInterface::~UserInterface() {
- delete _surface;
+void UserInterface::loadElements() {
+ warning("TODO: UserInterface::loadElements");
}
} // End of namespace MADS
diff --git a/engines/mads/user_interface.h b/engines/mads/user_interface.h
index 838638ba0b..8bd02ff6fc 100644
--- a/engines/mads/user_interface.h
+++ b/engines/mads/user_interface.h
@@ -24,21 +24,44 @@
#define MADS_USER_INTERFACE_H
#include "common/scummsys.h"
+#include "common/rect.h"
+#include "common/str.h"
+#include "mads/msurface.h"
namespace MADS {
-class MADSEngine;
-
-class UserInterface {
+class UserInterface : public MSurface {
private:
MADSEngine *_vm;
- MSurface *_surface;
- UserInterface(MADSEngine *vm);
+ void loadElements();
public:
- static UserInterface *init(MADSEngine *vm);
+ ScrCategory _category;
+ int _screenObjectsCount;
+ Common::Rect _bounds;
+ Common::Rect *_rectP;
+ MSurface _surface;
public:
- ~UserInterface();
+ /**
+ * Constructor
+ */
+ UserInterface(MADSEngine *vm);
+
+ /**
+ * Loads an interface from a specified resource
+ */
+ void load(const Common::String &resName);
+
+ /**
+ * Set up the interface
+ */
+ void setup(int id);
+
+ void elementHighlighted();
+
+ void writeText();
+
+ void setBounds(const Common::Rect &r);
};
} // End of namespace MADS