PEGASUS: Implement demo credits

This commit is contained in:
Matthew Hoops 2011-09-22 09:24:14 -04:00
parent 35cc9b5d0f
commit 17d6f74867
2 changed files with 41 additions and 1 deletions

View File

@ -558,7 +558,14 @@ void PegasusEngine::doGameMenuCommand(const tGameMenuCommand command) {
error("Start new game (adventure mode)");
break;
case kMenuCmdCredits:
error("Show credits");
if (isDemo()) {
showTempScreen("Images/Demo/DemoCredits.pict");
// TODO: Fade out
_gfx->updateDisplay();
// TODO: Fade in
} else {
error("Show credits");
}
break;
case kMenuCmdQuit:
_system->quit();
@ -755,4 +762,36 @@ void PegasusEngine::doInterfaceOverview() {
// TODO: Cancel save/load requests?
}
void PegasusEngine::showTempScreen(const Common::String &fileName) {
// TODO: Fade out
Picture picture(0);
picture.initFromPICTFile(fileName);
picture.setDisplayOrder(kMaxAvailableOrder);
picture.startDisplaying();
picture.show();
_gfx->updateDisplay();
// TODO: Fade in
// Wait for the next event
bool done = false;
while (!shouldQuit() && !done) {
Common::Event event;
while (_eventMan->pollEvent(event)) {
switch (event.type) {
case Common::EVENT_LBUTTONUP:
case Common::EVENT_RBUTTONUP:
case Common::EVENT_KEYDOWN:
done = true;
break;
default:
break;
}
}
_system->delayMillis(10);
}
}
} // End of namespace Pegasus

View File

@ -133,6 +133,7 @@ private:
// Misc.
Hotspot _returnHotspot;
void showLoadDialog();
void showTempScreen(const Common::String &fileName);
// Menu
GameMenu *_gameMenu;