Added simple game loop to BRA. The game still crashes after menu.

svn-id: r28560
This commit is contained in:
Nicola Mettifogo 2007-08-12 13:10:04 +00:00
parent 9125ccb3eb
commit 6bbeb8c6d1
2 changed files with 44 additions and 3 deletions

View File

@ -584,6 +584,7 @@ public:
Table *_audioCommandsNames;
const char **_audioCommandsNamesRes;
int _part;
int _progress;
private:
@ -591,6 +592,9 @@ private:
void initFonts();
void freeFonts();
void initPart();
void freePart();
void setMousePointer(int16 index);
void initCursors();

View File

@ -66,6 +66,8 @@ int Parallaction_br::init() {
initFonts();
initCursors();
_part = -1;
Parallaction::init();
return 0;
@ -97,10 +99,34 @@ int Parallaction_br::go() {
// TODO: load progress value from special save game
_progress = 3;
// TODO: game loop :P
while ((_engineFlags & kEngineQuit) == 0) {
int option = showMenu();
printf("option = %i\n", option);
// initCharacter();
int option = showMenu();
switch (option) {
case kMenuQuit:
_engineFlags |= kEngineQuit;
break;
case kMenuLoadGame:
warning("loadgame not yet implemented");
break;
default:
_part = option;
initPart();
break;
}
runGame();
freePart();
// freeLocation();
// freeCharacter();
}
return 0;
}
@ -274,4 +300,15 @@ void Parallaction_br::setMousePointer(int16 index) {
}
void Parallaction_br::initPart() {
}
void Parallaction_br::freePart() {
}
} // namespace Parallaction