[Scummvm-cvs-logs] SF.net SVN: scummvm: [28556] scummvm/trunk/engines/parallaction
peres001 at users.sourceforge.net
peres001 at users.sourceforge.net
Sun Aug 12 14:44:26 CEST 2007
Revision: 28556
http://scummvm.svn.sourceforge.net/scummvm/?rev=28556&view=rev
Author: peres001
Date: 2007-08-12 05:44:26 -0700 (Sun, 12 Aug 2007)
Log Message:
-----------
Pushed menu handling into Parallaction_ns.
Modified Paths:
--------------
scummvm/trunk/engines/parallaction/parallaction.cpp
scummvm/trunk/engines/parallaction/parallaction.h
scummvm/trunk/engines/parallaction/parallaction_ns.cpp
Modified: scummvm/trunk/engines/parallaction/parallaction.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction.cpp 2007-08-12 12:26:46 UTC (rev 28555)
+++ scummvm/trunk/engines/parallaction/parallaction.cpp 2007-08-12 12:44:26 UTC (rev 28556)
@@ -35,7 +35,6 @@
#include "parallaction/parallaction.h"
#include "parallaction/debug.h"
-#include "parallaction/menu.h"
#include "parallaction/sound.h"
@@ -152,7 +151,6 @@
_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,49 +189,8 @@
-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
// loops which could possibly be merged into this one with some effort in changing
@@ -392,8 +349,6 @@
}
- delete _menu;
-
return;
}
Modified: scummvm/trunk/engines/parallaction/parallaction.h
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction.h 2007-08-12 12:26:46 UTC (rev 28555)
+++ scummvm/trunk/engines/parallaction/parallaction.h 2007-08-12 12:44:26 UTC (rev 28556)
@@ -301,7 +301,6 @@
~Parallaction();
int init();
- int go();
void loadGame();
void saveGame();
@@ -378,7 +377,6 @@
SoundMan *_soundMan;
Gfx* _gfx;
- Menu* _menu;
Disk* _disk;
Character _char;
@@ -412,8 +410,6 @@
Label* _label;
};
- bool _skipMenu;
-
bool _mouseHidden;
// input-only
@@ -443,7 +439,6 @@
protected: // members
bool detectGame(void);
- void initGame();
void initGlobals();
void runGame();
uint32 getElapsedTime();
@@ -509,6 +504,7 @@
~Parallaction_ns();
int init();
+ int go();
public:
typedef void (Parallaction_ns::*Callable)(void*);
@@ -518,6 +514,9 @@
void setMousePointer(int16 index);
+public:
+ Menu* _menu;
+
private:
void initFonts();
void freeFonts();
Modified: scummvm/trunk/engines/parallaction/parallaction_ns.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction_ns.cpp 2007-08-12 12:26:46 UTC (rev 28555)
+++ scummvm/trunk/engines/parallaction/parallaction_ns.cpp 2007-08-12 12:44:26 UTC (rev 28556)
@@ -30,7 +30,9 @@
#include "parallaction/parallaction.h"
#include "parallaction/sound.h"
+#include "parallaction/menu.h"
+
namespace Parallaction {
#define MOUSEARROW_WIDTH 16
@@ -164,4 +166,39 @@
}
+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
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list