aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorMatthew Hoops2011-09-29 20:12:51 -0400
committerMatthew Hoops2011-09-29 20:12:51 -0400
commitc4c83e2346e9a281e84c423717c0fc23d402d698 (patch)
tree61c6734e5ffc66247ff10d4b527550cf415d062c /engines
parent1fe7ca1d3868a701a2e53c08fbbeaac69df74dd0 (diff)
downloadscummvm-rg350-c4c83e2346e9a281e84c423717c0fc23d402d698.tar.gz
scummvm-rg350-c4c83e2346e9a281e84c423717c0fc23d402d698.tar.bz2
scummvm-rg350-c4c83e2346e9a281e84c423717c0fc23d402d698.zip
PEGASUS: Resolve some TODO's and cleanup
Diffstat (limited to 'engines')
-rw-r--r--engines/pegasus/graphics.cpp8
-rw-r--r--engines/pegasus/graphics.h2
-rw-r--r--engines/pegasus/pegasus.cpp75
-rw-r--r--engines/pegasus/pegasus.h1
4 files changed, 59 insertions, 27 deletions
diff --git a/engines/pegasus/graphics.cpp b/engines/pegasus/graphics.cpp
index 6cce9ddbd8..e0bf6fde5a 100644
--- a/engines/pegasus/graphics.cpp
+++ b/engines/pegasus/graphics.cpp
@@ -201,5 +201,13 @@ DisplayElement *GraphicsManager::findDisplayElement(const tDisplayElementID id)
return 0;
}
+
+void GraphicsManager::doFadeOutSync() {
+ // TODO
+}
+
+void GraphicsManager::doFadeInSync() {
+ // TODO
+}
} // End of namespace Pegasus
diff --git a/engines/pegasus/graphics.h b/engines/pegasus/graphics.h
index fffa3a6292..874524304e 100644
--- a/engines/pegasus/graphics.h
+++ b/engines/pegasus/graphics.h
@@ -54,6 +54,8 @@ public:
Graphics::Surface *getWorkArea() { return &_workArea; }
void clearScreen();
DisplayElement *findDisplayElement(const tDisplayElementID id);
+ void doFadeOutSync();
+ void doFadeInSync();
private:
PegasusEngine *_vm;
diff --git a/engines/pegasus/pegasus.cpp b/engines/pegasus/pegasus.cpp
index ac6946db67..5996d97579 100644
--- a/engines/pegasus/pegasus.cpp
+++ b/engines/pegasus/pegasus.cpp
@@ -643,15 +643,15 @@ void PegasusEngine::doGameMenuCommand(const tGameMenuCommand command) {
case kMenuCmdCredits:
if (isDemo()) {
showTempScreen("Images/Demo/DemoCredits.pict");
- // TODO: Fade out
+ _gfx->doFadeOutSync();
_gfx->updateDisplay();
- // TODO: Fade in
+ _gfx->doFadeInSync();
} else {
// TODO: Stop intro timer
- // TODO: Fade out
+ _gfx->doFadeOutSync();
useMenu(new CreditsMenu());
_gfx->updateDisplay();
- // TODO: Fade in
+ _gfx->doFadeInSync();
}
break;
case kMenuCmdQuit:
@@ -674,22 +674,22 @@ void PegasusEngine::doGameMenuCommand(const tGameMenuCommand command) {
error("Load game");
break;
case kMenuCmdCreditsMainMenu:
- // TODO: Fade out
+ _gfx->doFadeOutSync();
useMenu(new MainMenu());
_gfx->updateDisplay();
((MainMenu *)_gameMenu)->startMainMenuLoop();
- // TODO: Fade in
+ _gfx->doFadeInSync();
resetIntroTimer();
break;
case kMenuCmdDeathContinue:
if (((DeathMenu *)_gameMenu)->playerWon()) {
if (isDemo()) {
showTempScreen("Images/Demo/DemoCredits.pict");
- // TODO: Fade out
+ _gfx->doFadeOutSync();
_gfx->updateDisplay();
- // TODO: Fade in
+ _gfx->doFadeInSync();
} else {
- // TODO: Fade out
+ _gfx->doFadeOutSync();
useMenu(0);
_gfx->clearScreen();
_gfx->updateDisplay();
@@ -711,7 +711,7 @@ void PegasusEngine::doGameMenuCommand(const tGameMenuCommand command) {
useMenu(new MainMenu());
_gfx->updateDisplay();
((MainMenu *)_gameMenu)->startMainMenuLoop();
- // TODO: Fade in
+ _gfx->doFadeInSync();
resetIntroTimer();
}
} else {
@@ -720,11 +720,11 @@ void PegasusEngine::doGameMenuCommand(const tGameMenuCommand command) {
break;
case kMenuCmdDeathMainMenuDemo:
case kMenuCmdDeathMainMenu:
- // TODO: Fade out
+ _gfx->doFadeOutSync();
useMenu(new MainMenu());
_gfx->updateDisplay();
((MainMenu *)_gameMenu)->startMainMenuLoop();
- // TODO: Fade in
+ _gfx->doFadeInSync();
if (!isDemo())
resetIntroTimer();
break;
@@ -738,13 +738,13 @@ void PegasusEngine::doGameMenuCommand(const tGameMenuCommand command) {
error("Load game");
break;
case kMenuCmdPauseQuit:
- // TODO: Fade out
+ _gfx->doFadeOutSync();
throwAwayEverything();
pauseMenu(false);
useMenu(new MainMenu());
_gfx->updateDisplay();
((MainMenu *)_gameMenu)->startMainMenuLoop();
- // TODO: Fade in
+ _gfx->doFadeInSync();
if (!isDemo())
resetIntroTimer();
break;
@@ -765,7 +765,6 @@ void PegasusEngine::handleInput(const Input &input, const Hotspot *cursorSpot) {
_console->onFrame();
}
- // TODO: Quit request
// TODO: Save request
// TODO: Load request
}
@@ -786,7 +785,7 @@ void PegasusEngine::doInterfaceOverview() {
Common::Rect(542, 36, 542 + 58, 36 + 20)
};
- // TODO: fade out
+ _gfx->doFadeOutSync();
useMenu(0);
Picture leftBackground(kNoDisplayElement);
@@ -878,7 +877,7 @@ void PegasusEngine::doInterfaceOverview() {
_cursor->show();
_gfx->updateDisplay();
- // TODO: Fade in
+ _gfx->doFadeInSync();
for (;;) {
InputHandler::getCurrentInputDevice()->getInput(input, kFilterAllInput);
@@ -924,17 +923,17 @@ void PegasusEngine::doInterfaceOverview() {
highlight.hide();
_cursor->hide();
- // TODO: Fade out
+ _gfx->doFadeOutSync();
useMenu(new MainMenu());
_gfx->updateDisplay();
((MainMenu *)_gameMenu)->startMainMenuLoop();
- // TODO: Fade in
+ _gfx->doFadeInSync();
// TODO: Cancel save/load requests?
}
void PegasusEngine::showTempScreen(const Common::String &fileName) {
- // TODO: Fade out
+ _gfx->doFadeOutSync();
Picture picture(0);
picture.initFromPICTFile(fileName);
@@ -943,7 +942,7 @@ void PegasusEngine::showTempScreen(const Common::String &fileName) {
picture.show();
_gfx->updateDisplay();
- // TODO: Fade in
+ _gfx->doFadeInSync();
// Wait for the next event
bool done = false;
@@ -971,8 +970,21 @@ void PegasusEngine::refreshDisplay() {
}
void PegasusEngine::resetEnergyDeathReason() {
- // TODO!
- _deathReason = kDeathStranded;
+ switch (getCurrentNeighborhoodID()) {
+ case kMarsID:
+ _deathReason = kDeathArrestedInMars;
+ break;
+ case kNoradAlphaID:
+ case kNoradDeltaID:
+ _deathReason = kDeathArrestedInNorad;
+ break;
+ case kWSCID:
+ _deathReason = kDeathArrestedInWSC;
+ break;
+ default:
+ _deathReason = kDeathStranded;
+ break;
+ }
}
bool PegasusEngine::playerHasItem(const Item *item) {
@@ -1121,18 +1133,20 @@ bool PegasusEngine::playMovieScaled(Video::SeekableVideoDecoder *video, uint16 x
}
void PegasusEngine::die(const tDeathReason reason) {
- // TODO: Stop dragging
+ Input dummy;
+ if (isDragging())
+ _itemDragger.stopTracking(dummy);
_deathReason = reason;
_shellNotification.setNotificationFlags(kPlayerDiedFlag, kPlayerDiedFlag);
}
void PegasusEngine::doDeath() {
- // TODO: Fade out
+ _gfx->doFadeOutSync();
throwAwayEverything();
useMenu(new DeathMenu(_deathReason));
_gfx->updateDisplay();
- // TODO: Fade in
+ _gfx->doFadeInSync();
}
void PegasusEngine::throwAwayEverything() {
@@ -1299,7 +1313,7 @@ void PegasusEngine::startNewGame() {
GameState.setWalkthroughMode(isWalkthrough);
// TODO: Enable erase
- // TODO: Fade out
+ _gfx->doFadeOutSync();
useMenu(0);
_gfx->updateDisplay();
@@ -1830,4 +1844,11 @@ void PegasusEngine::autoDragItemIntoInventory(Item *, Sprite *draggingSprite) {
g_AIArea->unlockAI();
}
+tNeighborhoodID PegasusEngine::getCurrentNeighborhoodID() const {
+ if (_neighborhood)
+ return _neighborhood->getObjectID();
+
+ return kNoNeighborhoodID;
+}
+
} // End of namespace Pegasus
diff --git a/engines/pegasus/pegasus.h b/engines/pegasus/pegasus.h
index 6f2309a437..e8e67b54d3 100644
--- a/engines/pegasus/pegasus.h
+++ b/engines/pegasus/pegasus.h
@@ -154,6 +154,7 @@ public:
// Neighborhood
void jumpToNewEnvironment(const tNeighborhoodID, const tRoomID, const tDirectionConstant);
+ tNeighborhoodID getCurrentNeighborhoodID() const;
// Dragging
void dragItem(const Input &, Item *, tDragType);