aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2015-01-19 12:13:03 -0500
committerPaul Gilbert2015-01-19 12:13:03 -0500
commitec294d662e7d54a9927c2b85ec430e1519be5de7 (patch)
tree4154357408d88562bab79a80bdcc46c50ef5204b /engines
parent687423b3612d61a18a9854010af56f7a98e5563d (diff)
downloadscummvm-rg350-ec294d662e7d54a9927c2b85ec430e1519be5de7.tar.gz
scummvm-rg350-ec294d662e7d54a9927c2b85ec430e1519be5de7.tar.bz2
scummvm-rg350-ec294d662e7d54a9927c2b85ec430e1519be5de7.zip
XEEN: Add extra ending code for pausing turns
Diffstat (limited to 'engines')
-rw-r--r--engines/xeen/dialogs.cpp1
-rw-r--r--engines/xeen/interface.cpp32
-rw-r--r--engines/xeen/interface.h7
-rw-r--r--engines/xeen/party.cpp4
-rw-r--r--engines/xeen/party.h2
-rw-r--r--engines/xeen/sound.h2
-rw-r--r--engines/xeen/xeen.cpp4
7 files changed, 44 insertions, 8 deletions
diff --git a/engines/xeen/dialogs.cpp b/engines/xeen/dialogs.cpp
index 824e8249ce..d1662aeb68 100644
--- a/engines/xeen/dialogs.cpp
+++ b/engines/xeen/dialogs.cpp
@@ -52,6 +52,7 @@ void ButtonContainer::addButton(const Common::Rect &bounds, int val, SpriteResou
bool ButtonContainer::checkEvents(XeenEngine *vm) {
EventsManager &events = *vm->_events;
+ _buttonValue = 0;
if (events._leftButton) {
// Check whether any button is selected
diff --git a/engines/xeen/interface.cpp b/engines/xeen/interface.cpp
index e15c0574aa..8ff0b92d13 100644
--- a/engines/xeen/interface.cpp
+++ b/engines/xeen/interface.cpp
@@ -49,6 +49,7 @@ Interface::Interface(XeenEngine *vm) : ButtonContainer(), InterfaceMap(vm), _vm(
_thinWall = false;
_overallFrame = 0;
_upDoorText = false;
+ _steppingFX = 0;
Common::fill(&_combatCharIds[0], &_combatCharIds[8], 0);
initDrawStructs();
@@ -2316,7 +2317,7 @@ void Interface::updateAutoMap() {
* Waits for a keypress or click, whilst still allowing the game scene to
* be animated.
*/
-void Interface::wait() {
+void Interface::perform() {
EventsManager &events = *_vm->_events;
Map &map = *_vm->_map;
Party &party = *_vm->_party;
@@ -2328,7 +2329,7 @@ void Interface::wait() {
draw3d(true);
// Wait for a frame
- while (!_vm->shouldQuit()) {
+ do {
events.pollEventsAndWait();
checkEvents(_vm);
} while (!_buttonValue && events.timeElapsed() < 1 && !_vm->_party->_partyDead);
@@ -2392,6 +2393,8 @@ void Interface::wait() {
_upDoorText = false;
_flipDefaultGround = !_flipDefaultGround;
_flipGround = !_flipGround;
+
+ stepTime();
break;
default:
break;
@@ -2410,4 +2413,29 @@ void Interface::chargeStep() {
}
}
+/**
+ * Handles incrementing game time
+ */
+void Interface::stepTime() {
+ Party &party = *_vm->_party;
+ SoundManager &sound = *_vm->_sound;
+ doStepCode();
+
+ if (++party._ctr24 == 24)
+ party._ctr24 = 0;
+
+ if (_buttonValue != Common::KEYCODE_SPACE && _buttonValue != Common::KEYCODE_w) {
+ _steppingFX ^= 1;
+ sound.playFX(_steppingFX + 7);
+ }
+
+ _upDoorText = false;
+ _flipDefaultGround = !_flipDefaultGround;
+ _flipGround = !_flipGround;
+}
+
+void Interface::doStepCode() {
+ // TODO
+}
+
} // End of namespace Xeen
diff --git a/engines/xeen/interface.h b/engines/xeen/interface.h
index c6fee9e0d4..af26611e6d 100644
--- a/engines/xeen/interface.h
+++ b/engines/xeen/interface.h
@@ -74,6 +74,7 @@ private:
bool _thinWall;
int _overallFrame;
bool _upDoorText;
+ int _steppingFX;
void initDrawStructs();
@@ -100,6 +101,10 @@ private:
void updateAutoMap();
void chargeStep();
+
+ void stepTime();
+
+ void doStepCode();
public:
Interface(XeenEngine *vm);
@@ -119,7 +124,7 @@ public:
void charIconsPrint(bool updateFlag);
- void wait();
+ void perform();
};
} // End of namespace Xeen
diff --git a/engines/xeen/party.cpp b/engines/xeen/party.cpp
index 6d5cc22ffa..4571bbe518 100644
--- a/engines/xeen/party.cpp
+++ b/engines/xeen/party.cpp
@@ -198,7 +198,7 @@ Party::Party(XeenEngine *vm): _vm(vm) {
_cloudsEnd = false;
_darkSideEnd = false;
_worldEnd = false;
- hour_maybe = 0;
+ _ctr24 = 0;
_day = 0;
_year = 0;
_minutes = 0;
@@ -273,7 +273,7 @@ void Party::synchronize(Common::Serializer &s) {
s.syncAsUint16LE(_cloudsEnd);
s.syncAsUint16LE(_darkSideEnd);
s.syncAsUint16LE(_worldEnd);
- s.syncAsUint16LE(hour_maybe);
+ s.syncAsUint16LE(_ctr24);
s.syncAsUint16LE(_day);
s.syncAsUint16LE(_year);
s.syncAsUint16LE(_minutes);
diff --git a/engines/xeen/party.h b/engines/xeen/party.h
index 75a6c2b07b..8db52df1a6 100644
--- a/engines/xeen/party.h
+++ b/engines/xeen/party.h
@@ -176,7 +176,7 @@ public:
bool _cloudsEnd;
bool _darkSideEnd;
bool _worldEnd;
- int hour_maybe;
+ int _ctr24; // TODO: Figure out proper name
int _day;
int _year;
int _minutes;
diff --git a/engines/xeen/sound.h b/engines/xeen/sound.h
index 553b1c6f44..c1215249a9 100644
--- a/engines/xeen/sound.h
+++ b/engines/xeen/sound.h
@@ -42,6 +42,8 @@ public:
void playSong(Common::SeekableReadStream &f) {}
void playSample(const Common::SeekableReadStream *stream, int v2) {}
+
+ void playFX(int id) {}
};
} // End of namespace Xeen
diff --git a/engines/xeen/xeen.cpp b/engines/xeen/xeen.cpp
index b8f9030c85..e9b4d93de8 100644
--- a/engines/xeen/xeen.cpp
+++ b/engines/xeen/xeen.cpp
@@ -327,8 +327,8 @@ void XeenEngine::gameLoop() {
}
_scripts->giveTreasure();
- // Wait loop
- _interface->wait();
+ // Main user interface handler for waiting for and processing user input
+ _interface->perform();
}
}