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) { 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() { void Parallaction_br::guiStart() {
guiSplash("dyna");
guiSplash("core");
// TODO: load progress value from special save game // TODO: load progress value from special save game
_progress = 3; _progress = 3;

View file

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

View file

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

View file

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

View file

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