aboutsummaryrefslogtreecommitdiff
path: root/engines/xeen
diff options
context:
space:
mode:
authorPaul Gilbert2015-01-06 19:09:07 -0500
committerPaul Gilbert2015-01-06 19:09:07 -0500
commit31f4f5b843400531d3e091ae0eb673d6dacc227d (patch)
treea64ca3f6d284a0b5d2f57f88d74d1f966967d799 /engines/xeen
parenteb0c292aafc9b1b819ab1f43d4ec3a059842e96a (diff)
downloadscummvm-rg350-31f4f5b843400531d3e091ae0eb673d6dacc227d.tar.gz
scummvm-rg350-31f4f5b843400531d3e091ae0eb673d6dacc227d.tar.bz2
scummvm-rg350-31f4f5b843400531d3e091ae0eb673d6dacc227d.zip
XEEN: More interface setup and UI button definitions
Diffstat (limited to 'engines/xeen')
-rw-r--r--engines/xeen/dialogs.cpp2
-rw-r--r--engines/xeen/dialogs.h2
-rw-r--r--engines/xeen/interface.cpp49
-rw-r--r--engines/xeen/interface.h9
-rw-r--r--engines/xeen/xeen.cpp4
-rw-r--r--engines/xeen/xeen.h3
6 files changed, 63 insertions, 6 deletions
diff --git a/engines/xeen/dialogs.cpp b/engines/xeen/dialogs.cpp
index 8e8e7521cb..c677fc8efb 100644
--- a/engines/xeen/dialogs.cpp
+++ b/engines/xeen/dialogs.cpp
@@ -46,7 +46,7 @@ void ButtonContainer::restoreButtons() {
_buttons = _savedButtons.pop();
}
-void ButtonContainer::addButton(const Common::Rect &bounds, int val, SpriteResource *sprites, bool draw = true) {
+void ButtonContainer::addButton(const Common::Rect &bounds, int val, SpriteResource *sprites, bool draw) {
_buttons.push_back(UIButton(bounds, val, sprites, draw));
}
diff --git a/engines/xeen/dialogs.h b/engines/xeen/dialogs.h
index 987df6b2f1..229c40a2da 100644
--- a/engines/xeen/dialogs.h
+++ b/engines/xeen/dialogs.h
@@ -66,7 +66,7 @@ public:
void restoreButtons();
- void addButton(const Common::Rect &bounds, int val, SpriteResource *sprites, bool draw);
+ void addButton(const Common::Rect &bounds, int val, SpriteResource *sprites, bool draw = true);
};
class SettingsBaseDialog : public ButtonContainer {
diff --git a/engines/xeen/interface.cpp b/engines/xeen/interface.cpp
index daeb4402e5..c27cdb9bd3 100644
--- a/engines/xeen/interface.cpp
+++ b/engines/xeen/interface.cpp
@@ -38,11 +38,16 @@ Interface::Interface(XeenEngine *vm) : ButtonContainer(), _vm(vm) {
_powerShieldUIFrame = 0;
_holyBonusUIFrame = 0;
_heroismUIFrame = 0;
+ _flipUIFrame = 0;
_isEarlyGame = false;
_buttonsLoaded = false;
_hiliteChar = -1;
Common::fill(&_combatCharIds[0], &_combatCharIds[8], 0);
_intrIndex1 = 0;
+ _flipWtr = false;
+ _flag1 = false;
+ _flag2 = false;
+ _tillMove = 0;
initDrawStructs();
}
@@ -534,6 +539,17 @@ void Interface::draw3d(bool flag) {
if (!screen._windows[11]._enabled)
return;
+ _flipUIFrame = (_flipUIFrame + 1) % 4;
+ if (_flipUIFrame == 0)
+ _flipWtr = !_flipWtr;
+ if (_tillMove && (_vm->_mode == MODE_1 || _vm->_mode == MODE_2) &&
+ !_flag1 && _vm->_moveMonsters) {
+ if (--_tillMove == 0)
+ moveMonsters();
+ }
+
+ // TODO: more
+
warning("TODO");
}
@@ -578,6 +594,10 @@ void Interface::startup() {
_mainList[0]._sprites = &_globalSprites;
for (int i = 1; i < 16; ++i)
_mainList[i]._sprites = &_iconSprites;
+
+ setIconButtons();
+
+ _tillMove = false;
}
void Interface::mainIconsPrint() {
@@ -588,4 +608,33 @@ void Interface::mainIconsPrint() {
screen._windows[34].update();
}
+void Interface::moveMonsters() {
+
+}
+
+void Interface::setIconButtons() {
+ clearButtons();
+
+ addButton(Common::Rect(235, 75, 259, 95), 83, &_iconSprites);
+ addButton(Common::Rect(260, 75, 284, 95), 67, &_iconSprites);
+ addButton(Common::Rect(286, 75, 310, 95), 82, &_iconSprites);
+ addButton(Common::Rect(235, 96, 259, 116), 66, &_iconSprites);
+ addButton(Common::Rect(260, 96, 284, 116), 68, &_iconSprites);
+ addButton(Common::Rect(286, 96, 310, 116), 86, &_iconSprites);
+ addButton(Common::Rect(235, 117, 259, 137), 77, &_iconSprites);
+ addButton(Common::Rect(260, 117, 284, 137), 73, &_iconSprites);
+ addButton(Common::Rect(286, 117, 310, 137), 81, &_iconSprites);
+ addButton(Common::Rect(109, 137, 122, 147), 9, &_iconSprites);
+ addButton(Common::Rect(235, 148, 259, 168), 240, &_iconSprites);
+ addButton(Common::Rect(260, 148, 284, 168), 242, &_iconSprites);
+ addButton(Common::Rect(286, 148, 310, 168), 241, &_iconSprites);
+ addButton(Common::Rect(235, 169, 259, 189), 176, &_iconSprites);
+ addButton(Common::Rect(260, 169, 284, 189), 243, &_iconSprites);
+ addButton(Common::Rect(286, 169, 310, 189), 177, &_iconSprites);
+ addButton(Common::Rect(236, 11, 308, 69), 61, &_iconSprites, false);
+ addButton(Common::Rect(239, 27, 312, 37), 49, &_iconSprites, false);
+ addButton(Common::Rect(239, 37, 312, 47), 50, &_iconSprites, false);
+ addButton(Common::Rect(239, 47, 312, 57), 51, &_iconSprites, false);
+}
+
} // End of namespace Xeen
diff --git a/engines/xeen/interface.h b/engines/xeen/interface.h
index b19f031ac4..475e71bbce 100644
--- a/engines/xeen/interface.h
+++ b/engines/xeen/interface.h
@@ -60,11 +60,16 @@ private:
int _powerShieldUIFrame;
int _holyBonusUIFrame;
int _heroismUIFrame;
+ int _flipUIFrame;
bool _isEarlyGame;
bool _buttonsLoaded;
Common::String _interfaceText;
int _hiliteChar;
int _intrIndex1;
+ bool _flipWtr;
+ bool _flag1;
+ bool _flag2;
+ byte _tillMove;
void loadSprites();
@@ -91,6 +96,10 @@ private:
void setOutdoorsMonsters();
void setOutdoorsObjects();
+
+ void moveMonsters();
+
+ void setIconButtons();
public:
Interface(XeenEngine *vm);
diff --git a/engines/xeen/xeen.cpp b/engines/xeen/xeen.cpp
index 948b4154fe..c2abdd9e9f 100644
--- a/engines/xeen/xeen.cpp
+++ b/engines/xeen/xeen.cpp
@@ -52,7 +52,6 @@ XeenEngine::XeenEngine(OSystem *syst, const XeenGameDescription *gameDesc)
_face2State = 0;
_noDirectionSense = false;
_falling = false;
- _tillMove = false;
_moveMonsters = false;
_mode = MODE_0;
}
@@ -298,12 +297,13 @@ void XeenEngine::play() {
_events->setCursor(0);
_moveMonsters = true;
- _tillMove = false;
if (_mode == MODE_0) {
_mode = MODE_1;
_screen->fadeIn(4);
}
+ _moveMonsters = true;
+
// Main game loop
while (!shouldQuit()) {
_events->pollEventsAndWait();
diff --git a/engines/xeen/xeen.h b/engines/xeen/xeen.h
index 776f3196cd..44deaee43c 100644
--- a/engines/xeen/xeen.h
+++ b/engines/xeen/xeen.h
@@ -93,8 +93,6 @@ private:
const XeenGameDescription *_gameDescription;
Common::RandomSource _randomSource;
int _loadSaveSlot;
- bool _moveMonsters;
- bool _tillMove;
void showIntro();
@@ -146,6 +144,7 @@ public:
int _face2State;
bool _noDirectionSense;
bool _falling;
+ bool _moveMonsters;
public:
XeenEngine(OSystem *syst, const XeenGameDescription *gameDesc);
virtual ~XeenEngine();