aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorMatthew Hoops2011-09-26 09:29:17 -0400
committerMatthew Hoops2011-09-26 09:29:17 -0400
commite412b62ffce4297da7df8fc4b71a619fa3a89880 (patch)
tree4bcf7785f5fdb6fe49a07accebc630742ff568e1 /engines
parent24cc9568cbefe6570dd846874c0681f3c09521bd (diff)
downloadscummvm-rg350-e412b62ffce4297da7df8fc4b71a619fa3a89880.tar.gz
scummvm-rg350-e412b62ffce4297da7df8fc4b71a619fa3a89880.tar.bz2
scummvm-rg350-e412b62ffce4297da7df8fc4b71a619fa3a89880.zip
PEGASUS: Implement the death code
Diffstat (limited to 'engines')
-rwxr-xr-xengines/pegasus/energymonitor.cpp6
-rw-r--r--engines/pegasus/pegasus.cpp22
-rw-r--r--engines/pegasus/pegasus.h3
3 files changed, 28 insertions, 3 deletions
diff --git a/engines/pegasus/energymonitor.cpp b/engines/pegasus/energymonitor.cpp
index fc22a32416..b1ea04435b 100755
--- a/engines/pegasus/energymonitor.cpp
+++ b/engines/pegasus/energymonitor.cpp
@@ -160,9 +160,9 @@ int32 EnergyMonitor::getCurrentEnergy() {
void EnergyMonitor::timeChanged(const TimeValue currentTime) {
if (currentTime == getStop()) {
- // TODO: Die :P
- if (((PegasusEngine *)g_engine)->getEnergyDeathReason() != -1)
- error("You're dead");
+ PegasusEngine *vm = (PegasusEngine *)g_engine;
+ if (vm->getEnergyDeathReason() != -1)
+ vm->die(vm->getEnergyDeathReason());
} else {
uint32 currentEnergy = kMaxJMPEnergy - currentTime;
diff --git a/engines/pegasus/pegasus.cpp b/engines/pegasus/pegasus.cpp
index 468f3a44b5..3a8e868d2d 100644
--- a/engines/pegasus/pegasus.cpp
+++ b/engines/pegasus/pegasus.cpp
@@ -495,6 +495,9 @@ void PegasusEngine::receiveNotification(Notification *notification, const tNotif
#endif
break;
}
+ case kPlayerDiedFlag:
+ doDeath();
+ break;
default:
break;
}
@@ -1020,4 +1023,23 @@ bool PegasusEngine::playMovieScaled(Video::SeekableVideoDecoder *video, uint16 x
return skipped;
}
+void PegasusEngine::die(const tDeathReason reason) {
+ // TODO: Stop dragging
+
+ _deathReason = reason;
+ _shellNotification.setNotificationFlags(kPlayerDiedFlag, kPlayerDiedFlag);
+}
+
+void PegasusEngine::doDeath() {
+ // TODO: Fade out
+ throwAwayEverything();
+ useMenu(new DeathMenu(_deathReason));
+ _gfx->updateDisplay();
+ // TODO: Fade in
+}
+
+void PegasusEngine::throwAwayEverything() {
+ // TODO
+}
+
} // End of namespace Pegasus
diff --git a/engines/pegasus/pegasus.h b/engines/pegasus/pegasus.h
index f881aa6f4c..b01e1929f6 100644
--- a/engines/pegasus/pegasus.h
+++ b/engines/pegasus/pegasus.h
@@ -111,6 +111,7 @@ public:
void setEnergyDeathReason(const tDeathReason reason) { _deathReason = reason; }
tDeathReason getEnergyDeathReason() { return _deathReason; }
void resetEnergyDeathReason();
+ void die(const tDeathReason);
// Volume
uint16 getSoundFXLevel();
@@ -188,6 +189,7 @@ private:
void showLoadDialog();
void showTempScreen(const Common::String &fileName);
bool playMovieScaled(Video::SeekableVideoDecoder *video, uint16 x, uint16 y);
+ void throwAwayEverything();
// Menu
GameMenu *_gameMenu;
@@ -199,6 +201,7 @@ private:
// Death
tDeathReason _deathReason;
+ void doDeath();
// Neighborhood
Neighborhood *_neighborhood;