Engine now returns to the menu when intro is over.

svn-id: r34047
This commit is contained in:
Nicola Mettifogo 2008-08-20 04:02:12 +00:00
parent d5d4500b64
commit 9549cbee7f
3 changed files with 22 additions and 24 deletions

View File

@ -264,29 +264,24 @@ const MainMenuInputState_BR::MenuOptions MainMenuInputState_BR::_options[NUM_MEN
void Parallaction_br::startGui() {
void Parallaction_br::startGui(bool showSplash) {
_menuHelper = new MenuInputHelper;
new SplashInputState0_BR(this, _menuHelper);
new SplashInputState1_BR(this, _menuHelper);
new MainMenuInputState_BR(this, _menuHelper);
_menuHelper->setState("intro0");
if (showSplash) {
new SplashInputState0_BR(this, _menuHelper);
new SplashInputState1_BR(this, _menuHelper);
_menuHelper->setState("intro0");
} else {
_menuHelper->setState("mainmenu");
}
_input->_inputMode = Input::kInputModeMenu;
do {
_input->readInput();
if (!_menuHelper->run()) break;
_gfx->beginFrame();
_gfx->updateScreen();
} while (true);
delete _menuHelper;
_menuHelper = 0;
_input->_inputMode = Input::kInputModeGame;
}
} // namespace Parallaction

View File

@ -667,7 +667,7 @@ private:
static const char *_partNames[];
void startGui();
void startGui(bool showSplash);
static const Callable _dosCallables[6];

View File

@ -133,17 +133,21 @@ void Parallaction_br::callFunction(uint index, void* parm) {
int Parallaction_br::go() {
if (getFeatures() & GF_DEMO) {
startPart(1);
} else {
startGui();
}
bool splash = true;
while ((_engineFlags & kEngineQuit) == 0) {
if (getFeatures() & GF_DEMO) {
startPart(1);
_input->_inputMode = Input::kInputModeGame;
} else {
startGui(splash);
// don't show splash after first time
splash = false;
}
// initCharacter();
_input->_inputMode = Input::kInputModeGame;
while ((_engineFlags & (kEngineReturn | kEngineQuit)) == 0) {
runGame();
}
@ -151,7 +155,6 @@ int Parallaction_br::go() {
freePart();
// freeCharacter();
}
return 0;