aboutsummaryrefslogtreecommitdiff
path: root/engines/mads
diff options
context:
space:
mode:
authorPaul Gilbert2014-03-15 21:33:15 -0400
committerPaul Gilbert2014-03-15 21:33:15 -0400
commit630679a5c8d72242866638b470cd361c0d5c6b0a (patch)
treeee023ed868528e20e5a623ff56c8d64d9c192969 /engines/mads
parentc4ed42e6d5974e635b4241aa110d8ffe2a8c99c7 (diff)
downloadscummvm-rg350-630679a5c8d72242866638b470cd361c0d5c6b0a.tar.gz
scummvm-rg350-630679a5c8d72242866638b470cd361c0d5c6b0a.tar.bz2
scummvm-rg350-630679a5c8d72242866638b470cd361c0d5c6b0a.zip
MADS: Completed UserInterface::loadElements
Diffstat (limited to 'engines/mads')
-rw-r--r--engines/mads/game.cpp4
-rw-r--r--engines/mads/hotspots.cpp3
-rw-r--r--engines/mads/scene.cpp1
-rw-r--r--engines/mads/scene.h1
-rw-r--r--engines/mads/scene_data.cpp6
-rw-r--r--engines/mads/scene_data.h2
-rw-r--r--engines/mads/user_interface.cpp53
-rw-r--r--engines/mads/user_interface.h2
8 files changed, 63 insertions, 9 deletions
diff --git a/engines/mads/game.cpp b/engines/mads/game.cpp
index bcebc04a00..ad3ea5e85d 100644
--- a/engines/mads/game.cpp
+++ b/engines/mads/game.cpp
@@ -265,6 +265,10 @@ void Game::initSection(int sectionNumber) {
_vm->_palette->resetGamePalette(18, 10);
_vm->_palette->setLowRange();
+
+ if (_scene._layer == LAYER_GUI)
+ _vm->_palette->setPalette(_vm->_palette->_mainPalette, 0, 4);
+
_vm->_events->loadCursors("*CURSOR.SS");
assert(_vm->_events->_cursorSprites);
diff --git a/engines/mads/hotspots.cpp b/engines/mads/hotspots.cpp
index d754c47fe3..b33b4b2f28 100644
--- a/engines/mads/hotspots.cpp
+++ b/engines/mads/hotspots.cpp
@@ -129,7 +129,8 @@ void DynamicHotspots::refresh() {
switch (_vm->_game->_scene._screenObjects._v832EC) {
case 0:
case 2:
- _vm->_game->_scene._screenObjects.add(dh._bounds, CAT_12, dh._descId);
+ _vm->_game->_scene._screenObjects.add(dh._bounds, _vm->_game->_scene._layer,
+ CAT_12, dh._descId);
_vm->_game->_scene._screenObjects._v8333C = true;
break;
default:
diff --git a/engines/mads/scene.cpp b/engines/mads/scene.cpp
index d1e83f6d0a..9ece16fab5 100644
--- a/engines/mads/scene.cpp
+++ b/engines/mads/scene.cpp
@@ -51,6 +51,7 @@ Scene::Scene(MADSEngine *vm): _vm(vm), _action(_vm), _depthSurface(vm),
_activeAnimation = nullptr;
_textSpacing = -1;
_frameStartTime = 0;
+ _layer = LAYER_GUI;
_verbList.push_back(VerbInit(VERB_LOOK, 2, 0));
_verbList.push_back(VerbInit(VERB_TAKE, 2, 0));
diff --git a/engines/mads/scene.h b/engines/mads/scene.h
index 292eb4af80..d88f5eccf2 100644
--- a/engines/mads/scene.h
+++ b/engines/mads/scene.h
@@ -127,6 +127,7 @@ public:
int _destFacing;
Common::Point _posAdjust;
uint32 _frameStartTime;
+ Layer _layer;
/**
* Constructor
diff --git a/engines/mads/scene_data.cpp b/engines/mads/scene_data.cpp
index 94bbb7b4c1..aa3670ee41 100644
--- a/engines/mads/scene_data.cpp
+++ b/engines/mads/scene_data.cpp
@@ -51,14 +51,14 @@ ScreenObjects::ScreenObjects(MADSEngine *vm): _vm(vm) {
_released = false;
}
-void ScreenObjects::add(const Common::Rect &bounds, ScrCategory category, int descId) {
+void ScreenObjects::add(const Common::Rect &bounds, Layer layer, ScrCategory category, int descId) {
assert(size() < 100);
ScreenObject so;
so._bounds = bounds;
so._category = category;
so._descId = descId;
- so._layer = 0x1413;
+ so._layer = layer;
push_back(so);
}
@@ -119,7 +119,7 @@ void ScreenObjects::check(bool scanFlag) {
scene._action.refresh();
// Loop through image inter list
- warning("TODO: iimageInterList loop");
+ warning("TODO: imageInterList loop");
}
int ScreenObjects::scanBackwards(const Common::Point &pt, int layer) {
diff --git a/engines/mads/scene_data.h b/engines/mads/scene_data.h
index 1cd262755f..ffea369166 100644
--- a/engines/mads/scene_data.h
+++ b/engines/mads/scene_data.h
@@ -102,7 +102,7 @@ public:
/**
* Add a new item to the list
*/
- void add(const Common::Rect &bounds, ScrCategory category, int descId);
+ void add(const Common::Rect &bounds, Layer layer, ScrCategory category, int descId);
/**
*/
diff --git a/engines/mads/user_interface.cpp b/engines/mads/user_interface.cpp
index e6840ac01a..cbd4573eb4 100644
--- a/engines/mads/user_interface.cpp
+++ b/engines/mads/user_interface.cpp
@@ -130,9 +130,56 @@ void UserInterface::loadElements() {
scene._screenObjects.clear();
if (!scene._screenObjects._v832EC) {
+ // Set up screen objects for the inventory scroller
for (int idx = 1; idx <= 3; ++idx) {
getBounds(CAT_INV_SCROLLER, idx, bounds);
- // TODO
+ moveRect(bounds);
+
+ scene._screenObjects.add(bounds, LAYER_GUI, CAT_INV_SCROLLER, idx);
+ }
+
+ // Set up actions
+ for (int idx = 0; idx < 10; ++idx) {
+ getBounds(CAT_ACTION, idx, bounds);
+ moveRect(bounds);
+
+ scene._screenObjects.add(bounds, LAYER_GUI, CAT_ACTION, idx);
+ }
+
+ // Set up inventory list
+ for (int idx = 0; idx < 5; ++idx) {
+ getBounds(CAT_INV_LIST, idx, bounds);
+ moveRect(bounds);
+
+ scene._screenObjects.add(bounds, LAYER_GUI, CAT_INV_LIST, idx);
+ }
+
+ // Set up the inventory vocab list
+ for (int idx = 0; idx < 5; ++idx) {
+ getBounds(CAT_INV_VOCAB, idx, bounds);
+ moveRect(bounds);
+
+ scene._screenObjects.add(bounds, LAYER_GUI, CAT_INV_VOCAB, idx);
+ }
+
+ // Set up the inventory item picture
+ scene._screenObjects.add(Common::Rect(160, 159, 231, 194), LAYER_GUI,
+ CAT_INV_ANIM, 0);
+ }
+
+ if (!scene._screenObjects._v832EC || scene._screenObjects._v832EC == 2) {
+ for (int hotspotIdx = scene._hotspots.size() - 1; hotspotIdx >= 0; --hotspotIdx) {
+ Hotspot &hs = scene._hotspots[hotspotIdx];
+ scene._screenObjects.add(hs._bounds, LAYER_GUI, CAT_HOTSPOT, hotspotIdx);
+ }
+ }
+
+ if (scene._screenObjects._v832EC == 1) {
+ for (int idx = 0; idx < 5; ++idx) {
+ getBounds(CAT_6, idx, bounds);
+ moveRect(bounds);
+
+ scene._screenObjects.add(bounds, LAYER_GUI, CAT_6, idx);
}
}
}
@@ -222,8 +269,8 @@ bool UserInterface::getBounds(ScrCategory category, int v, Common::Rect &bounds)
return true;
}
-void UserInterface::extendRect(Common::Rect &bounds) {
-
+void UserInterface::moveRect(Common::Rect &bounds) {
+ bounds.translate(0, MADS_SCREEN_HEIGHT - MADS_INTERFACE_HEIGHT);
}
} // End of namespace MADS
diff --git a/engines/mads/user_interface.h b/engines/mads/user_interface.h
index b8e86bfefb..d50a820563 100644
--- a/engines/mads/user_interface.h
+++ b/engines/mads/user_interface.h
@@ -53,7 +53,7 @@ private:
/**
* Reposition a bounding rectangle to physical co-ordinates
*/
- void extendRect(Common::Rect &bounds);
+ void moveRect(Common::Rect &bounds);
public:
ScrCategory _category;
int _screenObjectsCount;