aboutsummaryrefslogtreecommitdiff
path: root/engines/parallaction/parallaction.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/parallaction/parallaction.cpp')
-rw-r--r--engines/parallaction/parallaction.cpp70
1 files changed, 28 insertions, 42 deletions
diff --git a/engines/parallaction/parallaction.cpp b/engines/parallaction/parallaction.cpp
index 1b69b163f4..649f21ae96 100644
--- a/engines/parallaction/parallaction.cpp
+++ b/engines/parallaction/parallaction.cpp
@@ -49,15 +49,12 @@ uint16 _mouseButtons = 0;
char _saveData1[30] = { '\0' };
uint16 _language = 0;
-char _slideText[2][MAX_TOKEN_LEN];
uint32 _engineFlags = 0;
uint16 _score = 1;
char _password[8];
uint32 _commandFlags = 0;
-uint16 _introSarcData3 = 200;
-uint16 _introSarcData2 = 1;
// private stuff
@@ -92,6 +89,7 @@ Parallaction::Parallaction(OSystem *syst, const PARALLACTIONGameDescription *gam
Parallaction::~Parallaction() {
delete _debugger;
+ delete _locationParser;
delete _globalTable;
delete _callableNames;
@@ -115,7 +113,7 @@ int Parallaction::init() {
_engineFlags = 0;
_objectsNames = NULL;
_globalTable = NULL;
- _hasLocationSound = false;
+ _location._hasSound = false;
_transCurrentHoverItem = 0;
_actionAfterWalk = false; // actived when the character needs to move before taking an action
_activeItem._index = 0;
@@ -591,45 +589,16 @@ void Parallaction::resumeJobs() {
return;
}
-
-void Parallaction::pushParserTables(OpcodeSet *opcodes, Table *statements) {
- _opcodes.push(_currentOpcodes);
- _statements.push(_currentStatements);
-
- _currentOpcodes = opcodes;
- _currentStatements = statements;
-}
-
-void Parallaction::popParserTables() {
- assert(_opcodes.size() > 0);
-
- _currentOpcodes = _opcodes.pop();
- _currentStatements = _statements.pop();
-}
-
-void Parallaction::parseStatement() {
- assert(_currentOpcodes != 0);
-
- _lookup = _currentStatements->lookup(_tokens[0]);
-
- debugC(9, kDebugParser, "parseStatement: %s (lookup = %i)", _tokens[0], _lookup);
-
- (*(*_currentOpcodes)[_lookup])();
-}
-
-
-
-
AnimationPtr Parallaction::findAnimation(const char *name) {
- for (AnimationList::iterator it = _animations.begin(); it != _animations.end(); it++)
+ for (AnimationList::iterator it = _location._animations.begin(); it != _location._animations.end(); it++)
if (!scumm_stricmp((*it)->_name, name)) return *it;
return nullAnimationPtr;
}
void Parallaction::freeAnimations() {
- _animations.clear();
+ _location._animations.clear();
return;
}
@@ -661,7 +630,7 @@ void Parallaction::allocateLocationSlot(const char *name) {
_locationNames[_numLocations][0] = '\0';
_localFlags[_numLocations] = 0;
} else {
- _localFlags[_currentLocationIndex] |= kFlagsVisited; // 'visited'
+ setLocationFlags(kFlagsVisited); // 'visited'
}
}
@@ -682,7 +651,7 @@ void Parallaction::freeLocation() {
_gfx->clearGfxObjects();
freeBackground();
- _programs.clear();
+ _location._programs.clear();
freeZones();
freeAnimations();
@@ -735,7 +704,7 @@ void Parallaction::doLocationEnterTransition() {
return;
}
- if (_localFlags[_currentLocationIndex] & kFlagsVisited) {
+ if (getLocationFlags() & kFlagsVisited) {
debugC(2, kDebugExec, "skipping location transition");
return; // visited
}
@@ -768,11 +737,28 @@ void Parallaction::doLocationEnterTransition() {
return;
}
+void Parallaction::setLocationFlags(uint32 flags) {
+ _localFlags[_currentLocationIndex] |= flags;
+}
+
+void Parallaction::clearLocationFlags(uint32 flags) {
+ _localFlags[_currentLocationIndex] &= ~flags;
+}
+
+void Parallaction::toggleLocationFlags(uint32 flags) {
+ _localFlags[_currentLocationIndex] ^= flags;
+}
+
+uint32 Parallaction::getLocationFlags() {
+ return _localFlags[_currentLocationIndex];
+}
+
+
ZonePtr Parallaction::findZone(const char *name) {
- for (ZoneList::iterator it = _zones.begin(); it != _zones.end(); it++) {
+ for (ZoneList::iterator it = _location._zones.begin(); it != _location._zones.end(); it++) {
if (!scumm_stricmp((*it)->_name, name)) return *it;
}
@@ -783,9 +769,9 @@ ZonePtr Parallaction::findZone(const char *name) {
void Parallaction::freeZones() {
debugC(2, kDebugExec, "freeZones: kEngineQuit = %i", _engineFlags & kEngineQuit);
- ZoneList::iterator it = _zones.begin();
+ ZoneList::iterator it = _location._zones.begin();
- while ( it != _zones.end() ) {
+ while ( it != _location._zones.end() ) {
// NOTE : this condition has been relaxed compared to the original, to allow the engine
// to retain special - needed - zones that were lost across location switches.
@@ -794,7 +780,7 @@ void Parallaction::freeZones() {
debugC(2, kDebugExec, "freeZones preserving zone '%s'", z->_name);
it++;
} else {
- it = _zones.erase(it);
+ it = _location._zones.erase(it);
}
}