aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/parallaction/parallaction.cpp45
-rw-r--r--engines/parallaction/parallaction.h9
-rw-r--r--engines/parallaction/parallaction_ns.cpp37
3 files changed, 41 insertions, 50 deletions
diff --git a/engines/parallaction/parallaction.cpp b/engines/parallaction/parallaction.cpp
index e576218fdd..cf6fde1d39 100644
--- a/engines/parallaction/parallaction.cpp
+++ b/engines/parallaction/parallaction.cpp
@@ -35,7 +35,6 @@
#include "parallaction/parallaction.h"
#include "parallaction/debug.h"
-#include "parallaction/menu.h"
#include "parallaction/sound.h"
@@ -152,7 +151,6 @@ int Parallaction::init() {
_objectsNames = NULL;
_globalTable = NULL;
_hasLocationSound = false;
- _skipMenu = false;
_transCurrentHoverItem = 0;
_actionAfterWalk = false; // actived when the character needs to move before taking an action
_activeItem._index = 0;
@@ -191,48 +189,7 @@ int Parallaction::init() {
-int Parallaction::go() {
- initGame();
- runGame();
-
- return 0;
-}
-
-void Parallaction::initGame() {
-
- _menu = new Menu(this);
-
- initGlobals();
- if (_skipMenu == false) {
- _menu->start();
- }
-
- char *v4 = strchr(_location._name, '.');
- if (v4) {
- *v4 = '\0';
- }
-
- _engineFlags &= ~kEngineChangeLocation;
- changeCharacter(_characterName);
-
- strcpy(_saveData1, _location._name);
- parseLocation(_location._name);
-
- if (_location._startPosition.x != -1000) {
- _char._ani._left = _location._startPosition.x;
- _char._ani._top = _location._startPosition.y;
- _char._ani._frame = _location._startFrame;
- _location._startPosition.y = -1000;
- _location._startPosition.x = -1000;
- }
-
- return;
-}
-
-void Parallaction::initGlobals() {
- _globalTable = _disk->loadTable("global");
-}
// FIXME: the engine has 3 event loops. The following routine hosts the main one,
// and it's called from 8 different places in the code. There exist 2 more specialised
@@ -392,8 +349,6 @@ void Parallaction::runGame() {
}
- delete _menu;
-
return;
}
diff --git a/engines/parallaction/parallaction.h b/engines/parallaction/parallaction.h
index f7f09ce916..e8331ac767 100644
--- a/engines/parallaction/parallaction.h
+++ b/engines/parallaction/parallaction.h
@@ -301,7 +301,6 @@ public:
~Parallaction();
int init();
- int go();
void loadGame();
void saveGame();
@@ -378,7 +377,6 @@ public:
SoundMan *_soundMan;
Gfx* _gfx;
- Menu* _menu;
Disk* _disk;
Character _char;
@@ -412,8 +410,6 @@ protected: // data
Label* _label;
};
- bool _skipMenu;
-
bool _mouseHidden;
// input-only
@@ -443,7 +439,6 @@ protected: // data
protected: // members
bool detectGame(void);
- void initGame();
void initGlobals();
void runGame();
uint32 getElapsedTime();
@@ -509,6 +504,7 @@ public:
~Parallaction_ns();
int init();
+ int go();
public:
typedef void (Parallaction_ns::*Callable)(void*);
@@ -518,6 +514,9 @@ public:
void setMousePointer(int16 index);
+public:
+ Menu* _menu;
+
private:
void initFonts();
void freeFonts();
diff --git a/engines/parallaction/parallaction_ns.cpp b/engines/parallaction/parallaction_ns.cpp
index e3a706d794..6dcae1bdc8 100644
--- a/engines/parallaction/parallaction_ns.cpp
+++ b/engines/parallaction/parallaction_ns.cpp
@@ -30,6 +30,8 @@
#include "parallaction/parallaction.h"
#include "parallaction/sound.h"
+#include "parallaction/menu.h"
+
namespace Parallaction {
@@ -164,4 +166,39 @@ void Parallaction_ns::callFunction(uint index, void* parm) {
}
+int Parallaction_ns::go() {
+
+ _menu = new Menu(this);
+ _menu->start();
+
+ char *v4 = strchr(_location._name, '.');
+ if (v4) {
+ *v4 = '\0';
+ }
+
+ _globalTable = _disk->loadTable("global");
+
+ _engineFlags &= ~kEngineChangeLocation;
+ changeCharacter(_characterName);
+
+ strcpy(_saveData1, _location._name);
+ parseLocation(_location._name);
+
+ if (_location._startPosition.x != -1000) {
+ _char._ani._left = _location._startPosition.x;
+ _char._ani._top = _location._startPosition.y;
+ _char._ani._frame = _location._startFrame;
+ _location._startPosition.y = -1000;
+ _location._startPosition.x = -1000;
+ };
+
+ runGame();
+
+ delete _menu;
+
+ return 0;
+}
+
+
+
} // namespace Parallaction