Changed main loop to allow BRA to return to menu after intro.

svn-id: r30798
This commit is contained in:
Nicola Mettifogo 2008-02-05 10:24:22 +00:00
parent 17fdd182b6
commit dabefdce05
6 changed files with 29 additions and 24 deletions

View File

@ -279,7 +279,7 @@ DECLARE_COMMAND_OPCODE(testsfx) {
DECLARE_COMMAND_OPCODE(ret) {
warning("Parallaction_br::cmdOp_ret not yet implemented");
_engineFlags |= kEngineReturn;
}

View File

@ -41,8 +41,6 @@ enum MenuOptions {
void Parallaction_br::guiStart() {
guiSplash("dyna");
guiSplash("core");
// TODO: load progress value from special save game
_progress = 3;

View File

@ -245,27 +245,22 @@ void waitUntilLeftClick() {
void Parallaction::runGame() {
_inputMode = kInputModeGame;
updateInput();
while ((_engineFlags & kEngineQuit) == 0) {
updateInput();
runPendingZones();
if (_engineFlags & kEngineChangeLocation) {
changeLocation(_location._name);
}
if (_inputMode == kInputModeGame) {
runScripts();
walk();
drawAnimations();
}
updateView();
runPendingZones();
if (_engineFlags & kEngineChangeLocation) {
changeLocation(_location._name);
}
if (_inputMode == kInputModeGame) {
runScripts();
walk();
drawAnimations();
}
updateView();
}
void Parallaction::updateView() {

View File

@ -111,7 +111,10 @@ enum EngineFlags {
kEngineChangeLocation = (1 << 4),
kEngineBlockInput = (1 << 5),
kEngineDragging = (1 << 6),
kEngineTransformedDonna = (1 << 7)
kEngineTransformedDonna = (1 << 7),
// BRA specific
kEngineReturn = (1 << 10)
};
enum {

View File

@ -96,16 +96,22 @@ void Parallaction_br::callFunction(uint index, void* parm) {
int Parallaction_br::go() {
guiSplash("dyna");
guiSplash("core");
while ((_engineFlags & kEngineQuit) == 0) {
guiStart();
// initCharacter();
runGame();
_inputMode = kInputModeGame;
while ((_engineFlags & (kEngineReturn | kEngineQuit)) == 0) {
runGame();
}
_engineFlags &= ~kEngineReturn;
freePart();
// freeLocation();
// freeCharacter();
}

View File

@ -240,7 +240,10 @@ int Parallaction_ns::go() {
changeLocation(_location._name);
runGame();
_inputMode = kInputModeGame;
while ((_engineFlags & kEngineQuit) == 0) {
runGame();
}
return 0;
}