[Scummvm-cvs-logs] SF.net SVN: scummvm: [31872] scummvm/trunk/engines/parallaction

peres001 at users.sourceforge.net peres001 at users.sourceforge.net
Mon May 5 13:02:41 CEST 2008


Revision: 31872
          http://scummvm.svn.sourceforge.net/scummvm/?rev=31872&view=rev
Author:   peres001
Date:     2008-05-05 04:02:40 -0700 (Mon, 05 May 2008)

Log Message:
-----------
- Moved some members from the engine class to Location, since they belong there.
- Cleaned up usage of location flags by using accessor functions.

Modified Paths:
--------------
    scummvm/trunk/engines/parallaction/callables_ns.cpp
    scummvm/trunk/engines/parallaction/debug.cpp
    scummvm/trunk/engines/parallaction/dialogue.cpp
    scummvm/trunk/engines/parallaction/exec_br.cpp
    scummvm/trunk/engines/parallaction/exec_ns.cpp
    scummvm/trunk/engines/parallaction/objects.h
    scummvm/trunk/engines/parallaction/parallaction.cpp
    scummvm/trunk/engines/parallaction/parallaction.h
    scummvm/trunk/engines/parallaction/parallaction_br.cpp
    scummvm/trunk/engines/parallaction/parallaction_ns.cpp
    scummvm/trunk/engines/parallaction/parser_br.cpp
    scummvm/trunk/engines/parallaction/parser_ns.cpp
    scummvm/trunk/engines/parallaction/walk.cpp

Modified: scummvm/trunk/engines/parallaction/callables_ns.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/callables_ns.cpp	2008-05-05 10:45:11 UTC (rev 31871)
+++ scummvm/trunk/engines/parallaction/callables_ns.cpp	2008-05-05 11:02:40 UTC (rev 31872)
@@ -268,7 +268,7 @@
 		a = findAnimation("finito");
 
 		a->_flags |= (kFlagsActive | kFlagsActing);
-		_localFlags[_currentLocationIndex] |= 0x20;		// GROSS HACK: activates 'finito' flag in dinoit_museo.loc
+		setLocationFlags(0x20);		// GROSS HACK: activates 'finito' flag in dinoit_museo.loc
 	}
 
 	return;

Modified: scummvm/trunk/engines/parallaction/debug.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/debug.cpp	2008-05-05 10:45:11 UTC (rev 31871)
+++ scummvm/trunk/engines/parallaction/debug.cpp	2008-05-05 11:02:40 UTC (rev 31872)
@@ -117,7 +117,7 @@
 
 bool Debugger::Cmd_LocalFlags(int argc, const char **argv) {
 
-	uint32 flags = _vm->_localFlags[_vm->_currentLocationIndex];
+	uint32 flags = _vm->getLocationFlags();
 
 	DebugPrintf("+------------------------------+---------+\n"
 				"| flag name                    |  value  |\n"
@@ -149,8 +149,8 @@
 
 bool Debugger::Cmd_Zones(int argc, const char **argv) {
 
-	ZoneList::iterator b = _vm->_zones.begin();
-	ZoneList::iterator e = _vm->_zones.end();
+	ZoneList::iterator b = _vm->_location._zones.begin();
+	ZoneList::iterator e = _vm->_location._zones.end();
 
 	DebugPrintf("+--------------------+---+---+---+---+--------+--------+\n"
 				"| name               | l | t | r | b |  type  |  flag  |\n"
@@ -167,8 +167,8 @@
 
 bool Debugger::Cmd_Animations(int argc, const char **argv) {
 
-	AnimationList::iterator b = _vm->_animations.begin();
-	AnimationList::iterator e = _vm->_animations.end();
+	AnimationList::iterator b = _vm->_location._animations.begin();
+	AnimationList::iterator e = _vm->_location._animations.end();
 
 	DebugPrintf("+--------------------+---+---+---+---+--------+--------+\n"
 				"| name               | x | y | z | f |  type  |  flag  | \n"
@@ -219,8 +219,8 @@
 
 bool Debugger::Cmd_Programs(int argc, const char** argv) {
 
-	ProgramList::iterator b = _vm->_programs.begin();
-	ProgramList::iterator e = _vm->_programs.end();
+	ProgramList::iterator b = _vm->_location._programs.begin();
+	ProgramList::iterator e = _vm->_location._programs.end();
 
 	const char *status[] = { "idle", "running", "completed" };
 

Modified: scummvm/trunk/engines/parallaction/dialogue.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/dialogue.cpp	2008-05-05 10:45:11 UTC (rev 31871)
+++ scummvm/trunk/engines/parallaction/dialogue.cpp	2008-05-05 11:02:40 UTC (rev 31872)
@@ -155,7 +155,7 @@
 
 	Answer *a = _q->_answers[i];
 
-	uint32 flags = _vm->_localFlags[_vm->_currentLocationIndex];
+	uint32 flags = _vm->getLocationFlags();
 	if (a->_yesFlags & kFlagsGlobal)
 		flags = _commandFlags | kFlagsGlobal;
 

Modified: scummvm/trunk/engines/parallaction/exec_br.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/exec_br.cpp	2008-05-05 10:45:11 UTC (rev 31871)
+++ scummvm/trunk/engines/parallaction/exec_br.cpp	2008-05-05 11:02:40 UTC (rev 31872)
@@ -215,25 +215,25 @@
 
 DECLARE_COMMAND_OPCODE(ifeq) {
 	if (_counters[_cmdRunCtxt.cmd->u._lvalue] == _cmdRunCtxt.cmd->u._rvalue) {
-		_localFlags[_currentLocationIndex] |= kFlagsTestTrue;
+		setLocationFlags(kFlagsTestTrue);
 	} else {
-		_localFlags[_currentLocationIndex] &= ~kFlagsTestTrue;
+		clearLocationFlags(kFlagsTestTrue);
 	}
 }
 
 DECLARE_COMMAND_OPCODE(iflt) {
 	if (_counters[_cmdRunCtxt.cmd->u._lvalue] < _cmdRunCtxt.cmd->u._rvalue) {
-		_localFlags[_currentLocationIndex] |= kFlagsTestTrue;
+		setLocationFlags(kFlagsTestTrue);
 	} else {
-		_localFlags[_currentLocationIndex] &= ~kFlagsTestTrue;
+		clearLocationFlags(kFlagsTestTrue);
 	}
 }
 
 DECLARE_COMMAND_OPCODE(ifgt) {
 	if (_counters[_cmdRunCtxt.cmd->u._lvalue] > _cmdRunCtxt.cmd->u._rvalue) {
-		_localFlags[_currentLocationIndex] |= kFlagsTestTrue;
+		setLocationFlags(kFlagsTestTrue);
 	} else {
-		_localFlags[_currentLocationIndex] &= ~kFlagsTestTrue;
+		clearLocationFlags(kFlagsTestTrue);
 	}
 }
 
@@ -259,9 +259,9 @@
 
 
 DECLARE_COMMAND_OPCODE(zeta) {
-	_zeta0 = _cmdRunCtxt.cmd->u._zeta0;
-	_zeta1 = _cmdRunCtxt.cmd->u._zeta1;
-	_zeta2 = _cmdRunCtxt.cmd->u._zeta2;
+	_location._zeta0 = _cmdRunCtxt.cmd->u._zeta0;
+	_location._zeta1 = _cmdRunCtxt.cmd->u._zeta1;
+	_location._zeta2 = _cmdRunCtxt.cmd->u._zeta2;
 }
 
 
@@ -294,7 +294,7 @@
 
 DECLARE_COMMAND_OPCODE(testsfx) {
 	warning("Parallaction_br::cmdOp_testsfx not completely implemented");
-	_localFlags[_currentLocationIndex] &= ~kFlagsTestTrue;	// should test if sfx are enabled
+	clearLocationFlags(kFlagsTestTrue);	// should test if sfx are enabled
 }
 
 

Modified: scummvm/trunk/engines/parallaction/exec_ns.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/exec_ns.cpp	2008-05-05 10:45:11 UTC (rev 31871)
+++ scummvm/trunk/engines/parallaction/exec_ns.cpp	2008-05-05 11:02:40 UTC (rev 31872)
@@ -209,7 +209,7 @@
 		_cmdRunCtxt.cmd->u._flags &= ~kFlagsGlobal;
 		_commandFlags |= _cmdRunCtxt.cmd->u._flags;
 	} else {
-		_localFlags[_currentLocationIndex] |= _cmdRunCtxt.cmd->u._flags;
+		setLocationFlags(_cmdRunCtxt.cmd->u._flags);
 	}
 }
 
@@ -219,7 +219,7 @@
 		_cmdRunCtxt.cmd->u._flags &= ~kFlagsGlobal;
 		_commandFlags &= ~_cmdRunCtxt.cmd->u._flags;
 	} else {
-		_localFlags[_currentLocationIndex] &= ~_cmdRunCtxt.cmd->u._flags;
+		clearLocationFlags(_cmdRunCtxt.cmd->u._flags);
 	}
 }
 
@@ -294,7 +294,7 @@
 		_cmdRunCtxt.cmd->u._flags &= ~kFlagsGlobal;
 		_commandFlags ^= _cmdRunCtxt.cmd->u._flags;
 	} else {
-		_localFlags[_currentLocationIndex] ^= _cmdRunCtxt.cmd->u._flags;
+		toggleLocationFlags(_cmdRunCtxt.cmd->u._flags);
 	}
 }
 
@@ -323,7 +323,7 @@
 
 	uint16 layer = 0;
 
-	for (AnimationList::iterator it = _animations.begin(); it != _animations.end(); it++) {
+	for (AnimationList::iterator it = _location._animations.begin(); it != _location._animations.end(); it++) {
 
 		AnimationPtr v18 = *it;
 		GfxObj *obj = v18->gfxobj;
@@ -374,7 +374,7 @@
 
 	static uint16 modCounter = 0;
 
-	for (ProgramList::iterator it = _programs.begin(); it != _programs.end(); it++) {
+	for (ProgramList::iterator it = _location._programs.begin(); it != _location._programs.end(); it++) {
 
 		AnimationPtr a = (*it)->_anim;
 
@@ -434,7 +434,7 @@
 	for ( ; it != list.end(); it++) {
 
 		CommandPtr cmd = *it;
-		uint32 v8 = _localFlags[_currentLocationIndex];
+		uint32 v8 = getLocationFlags();
 
 		if (_engineFlags & kEngineQuit)
 			break;
@@ -576,7 +576,7 @@
 	uint16 _di = y;
 	uint16 _si = x;
 
-	for (ZoneList::iterator it = _zones.begin(); it != _zones.end(); it++) {
+	for (ZoneList::iterator it = _location._zones.begin(); it != _location._zones.end(); it++) {
 //		printf("Zone name: %s", z->_name);
 
 		ZonePtr z = *it;
@@ -637,7 +637,7 @@
 
 
 	int16 _a, _b, _c, _d, _e, _f;
-	for (AnimationList::iterator ait = _animations.begin(); ait != _animations.end(); ait++) {
+	for (AnimationList::iterator ait = _location._animations.begin(); ait != _location._animations.end(); ait++) {
 
 		AnimationPtr a = *ait;
 

Modified: scummvm/trunk/engines/parallaction/objects.h
===================================================================
--- scummvm/trunk/engines/parallaction/objects.h	2008-05-05 10:45:11 UTC (rev 31871)
+++ scummvm/trunk/engines/parallaction/objects.h	2008-05-05 11:02:40 UTC (rev 31872)
@@ -94,6 +94,8 @@
 
 
 enum CommandFlags {
+	kFlagsAll			= 0xFFFFFFFF,
+
 	kFlagsVisited		= 1,
 	kFlagsExit			= 0x10000000,
 	kFlagsEnter			= 0x20000000,

Modified: scummvm/trunk/engines/parallaction/parallaction.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction.cpp	2008-05-05 10:45:11 UTC (rev 31871)
+++ scummvm/trunk/engines/parallaction/parallaction.cpp	2008-05-05 11:02:40 UTC (rev 31872)
@@ -113,7 +113,7 @@
 	_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,14 +591,14 @@
 
 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;
 }
 
@@ -630,7 +630,7 @@
 		_locationNames[_numLocations][0] = '\0';
 		_localFlags[_numLocations] = 0;
 	} else {
-		_localFlags[_currentLocationIndex] |= kFlagsVisited;	// 'visited'
+		setLocationFlags(kFlagsVisited);	// 'visited'
 	}
 }
 
@@ -651,7 +651,7 @@
 	_gfx->clearGfxObjects();
 	freeBackground();
 
-	_programs.clear();
+	_location._programs.clear();
 	freeZones();
 	freeAnimations();
 
@@ -704,7 +704,7 @@
 		return;
 	}
 
-	if (_localFlags[_currentLocationIndex] & kFlagsVisited) {
+	if (getLocationFlags() & kFlagsVisited) {
 		debugC(2, kDebugExec, "skipping location transition");
 		return; // visited
 	}
@@ -737,11 +737,28 @@
 	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;
 	}
 
@@ -752,9 +769,9 @@
 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.
@@ -763,7 +780,7 @@
 			debugC(2, kDebugExec, "freeZones preserving zone '%s'", z->_name);
 			it++;
 		} else {
-			it = _zones.erase(it);
+			it = _location._zones.erase(it);
 		}
 	}
 

Modified: scummvm/trunk/engines/parallaction/parallaction.h
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction.h	2008-05-05 10:45:11 UTC (rev 31871)
+++ scummvm/trunk/engines/parallaction/parallaction.h	2008-05-05 11:02:40 UTC (rev 31872)
@@ -185,10 +185,20 @@
 	char	   *_comment;
 	char	   *_endComment;
 
+	ZoneList		_zones;
+	AnimationList	_animations;
+	ProgramList		_programs;
+
+	bool		_hasSound;
+	char		_soundFile[50];
+
 	// NS specific
 	WalkNodeList	_walkNodes;
 
 	// BRA specific
+	int			_zeta0;
+	int			_zeta1;
+	int			_zeta2;
 	CommandList		_escapeCommands;
 };
 
@@ -352,6 +362,11 @@
 
 	Character		_char;
 
+	void			setLocationFlags(uint32 flags);
+	void			clearLocationFlags(uint32 flags);
+	void			toggleLocationFlags(uint32 flags);
+	uint32			getLocationFlags();
+
 	uint32			_localFlags[NUM_LOCATIONS];
 	char			_locationNames[NUM_LOCATIONS][32];
 	int16			_currentLocationIndex;
@@ -367,9 +382,6 @@
 
 	ZonePtr			_activeZone;
 
-	ZoneList		_zones;
-	AnimationList	_animations;
-	ProgramList		_programs;
 
 	Font		*_labelFont;
 	Font		*_menuFont;
@@ -406,8 +418,6 @@
 
 	Common::String	_saveFileName;
 
-	bool		_hasLocationSound;
-	char		_locationSound[50];
 
 	ZonePtr		_hoverZone;
 
@@ -859,10 +869,6 @@
 	int			_part;
 	int			_progress;
 
-	int			_zeta0;
-	int			_zeta1;
-	int			_zeta2;
-
 	int16		_lipSyncVal;
 	uint		_subtitleLipSync;
 	int			_subtitleY;

Modified: scummvm/trunk/engines/parallaction/parallaction_br.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction_br.cpp	2008-05-05 10:45:11 UTC (rev 31871)
+++ scummvm/trunk/engines/parallaction/parallaction_br.cpp	2008-05-05 11:02:40 UTC (rev 31872)
@@ -215,7 +215,7 @@
 	clearSubtitles();
 	freeBackground();
 	_gfx->clearGfxObjects();
-	_programs.clear();
+	_location._programs.clear();
 	freeZones();
 	freeAnimations();
 //	free(_location._comment);

Modified: scummvm/trunk/engines/parallaction/parallaction_ns.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction_ns.cpp	2008-05-05 10:45:11 UTC (rev 31871)
+++ scummvm/trunk/engines/parallaction/parallaction_ns.cpp	2008-05-05 11:02:40 UTC (rev 31872)
@@ -143,7 +143,7 @@
 
 	num_foglie = 0;
 
-	_animations.push_front(_char._ani);
+	_location._animations.push_front(_char._ani);
 
 	Parallaction::init();
 
@@ -159,7 +159,7 @@
 	delete _instructionNames;
 	delete _locationStmt;
 
-	_animations.remove(_char._ani);
+	_location._animations.remove(_char._ani);
 
 }
 
@@ -306,7 +306,7 @@
 		setArrowCursor();
 	}
 
-	_animations.remove(_char._ani);
+	_location._animations.remove(_char._ani);
 
 	freeLocation();
 
@@ -326,7 +326,7 @@
 		changeCharacter(locname.character());
 	}
 
-	_animations.push_front(_char._ani);
+	_location._animations.push_front(_char._ani);
 
 	strcpy(_saveData1, locname.location());
 	parseLocation(_saveData1);
@@ -357,8 +357,8 @@
 
 	runCommands(_location._aCommands);
 
-	if (_hasLocationSound)
-		_soundMan->playSfx(_locationSound, 0, true);
+	if (_location._hasSound)
+		_soundMan->playSfx(_location._soundFile, 0, true);
 
 	debugC(1, kDebugExec, "changeLocation() done");
 
@@ -420,7 +420,7 @@
 	_engineFlags &= ~kEngineTransformedDonna;
 
 	// this code saves main character animation from being removed from the following code
-	_animations.remove(_char._ani);
+	_location._animations.remove(_char._ani);
 	_numLocations = 0;
 	_commandFlags = 0;
 
@@ -437,7 +437,7 @@
 	_engineFlags &= ~kEngineQuit;
 
 	// main character animation is restored
-	_animations.push_front(_char._ani);
+	_location._animations.push_front(_char._ani);
 	_score = 0;
 
 	return;

Modified: scummvm/trunk/engines/parallaction/parser_br.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parser_br.cpp	2008-05-05 10:45:11 UTC (rev 31871)
+++ scummvm/trunk/engines/parallaction/parser_br.cpp	2008-05-05 11:02:40 UTC (rev 31872)
@@ -146,11 +146,11 @@
 DECLARE_LOCATION_PARSER(zone)  {
 	debugC(7, kDebugParser, "LOCATION_PARSER(zone) ");
 
-	parseZone(*_locParseCtxt.script, _zones, _tokens[1]);
+	parseZone(*_locParseCtxt.script, _location._zones, _tokens[1]);
 
 	_locParseCtxt.z->_index = _locParseCtxt.numZones++;
 
-	if (_localFlags[_currentLocationIndex] & kFlagsVisited) {
+	if (getLocationFlags() & kFlagsVisited) {
 		_locParseCtxt.z->_flags = _zoneFlags[_currentLocationIndex][_locParseCtxt.z->_index];
 	} else {
 		_zoneFlags[_currentLocationIndex][_locParseCtxt.z->_index] = _locParseCtxt.z->_flags;
@@ -162,11 +162,11 @@
 DECLARE_LOCATION_PARSER(animation)  {
 	debugC(7, kDebugParser, "LOCATION_PARSER(animation) ");
 
-	parseAnimation(*_locParseCtxt.script, _animations, _tokens[1]);
+	parseAnimation(*_locParseCtxt.script, _location._animations, _tokens[1]);
 
 	_locParseCtxt.a->_index = _locParseCtxt.numZones++;
 
-	if (_localFlags[_currentLocationIndex] & kFlagsVisited) {
+	if (getLocationFlags() & kFlagsVisited) {
 		_locParseCtxt.a->_flags = _zoneFlags[_currentLocationIndex][_locParseCtxt.a->_index];
 	} else {
 		_zoneFlags[_currentLocationIndex][_locParseCtxt.a->_index] = _locParseCtxt.a->_flags;
@@ -189,14 +189,14 @@
 DECLARE_LOCATION_PARSER(flags)  {
 	debugC(7, kDebugParser, "LOCATION_PARSER(flags) ");
 
-	if ((_localFlags[_currentLocationIndex] & kFlagsVisited) == 0) {
+	if ((getLocationFlags() & kFlagsVisited) == 0) {
 		// only for 1st visit
-		_localFlags[_currentLocationIndex] = 0;
+		clearLocationFlags(kFlagsAll);
 		int _si = 1;
 
 		do {
 			byte _al = _localFlagNames->lookup(_tokens[_si]);
-			_localFlags[_currentLocationIndex] |= 1 << (_al - 1);
+			setLocationFlags(1 << (_al - 1));
 
 			_si++;
 			if (scumm_stricmp(_tokens[_si], "|")) break;
@@ -288,13 +288,13 @@
 DECLARE_LOCATION_PARSER(zeta)  {
 	debugC(7, kDebugParser, "LOCATION_PARSER(zeta) ");
 
-	_zeta0 = atoi(_tokens[1]);
-	_zeta1 = atoi(_tokens[2]);
+	_location._zeta0 = atoi(_tokens[1]);
+	_location._zeta1 = atoi(_tokens[2]);
 
 	if (_tokens[3][0] != '\0') {
-		_zeta2 = atoi(_tokens[1]);
+		_location._zeta2 = atoi(_tokens[1]);
 	} else {
-		_zeta2 = 50;
+		_location._zeta2 = 50;
 	}
 }
 

Modified: scummvm/trunk/engines/parallaction/parser_ns.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parser_ns.cpp	2008-05-05 10:45:11 UTC (rev 31871)
+++ scummvm/trunk/engines/parallaction/parser_ns.cpp	2008-05-05 11:02:40 UTC (rev 31872)
@@ -239,7 +239,7 @@
 
 	delete script;
 
-	_programs.push_back(program);
+	_location._programs.push_back(program);
 
 	debugC(1, kDebugParser, "loadProgram() done");
 
@@ -882,14 +882,14 @@
 DECLARE_LOCATION_PARSER(zone)  {
 	debugC(7, kDebugParser, "LOCATION_PARSER(zone) ");
 
-	parseZone(*_locParseCtxt.script, _zones, _tokens[1]);
+	parseZone(*_locParseCtxt.script, _location._zones, _tokens[1]);
 }
 
 
 DECLARE_LOCATION_PARSER(animation)  {
 	debugC(7, kDebugParser, "LOCATION_PARSER(animation) ");
 
-	parseAnimation(*_locParseCtxt.script, _animations, _tokens[1]);
+	parseAnimation(*_locParseCtxt.script, _location._animations, _tokens[1]);
 }
 
 
@@ -921,14 +921,14 @@
 DECLARE_LOCATION_PARSER(flags)  {
 	debugC(7, kDebugParser, "LOCATION_PARSER(flags) ");
 
-	if ((_localFlags[_currentLocationIndex] & kFlagsVisited) == 0) {
+	if ((getLocationFlags() & kFlagsVisited) == 0) {
 		// only for 1st visit
-		_localFlags[_currentLocationIndex] = 0;
+		clearLocationFlags(kFlagsAll);
 		int _si = 1;
 
 		do {
 			byte _al = _localFlagNames->lookup(_tokens[_si]);
-			_localFlags[_currentLocationIndex] |= 1 << (_al - 1);
+			setLocationFlags(1 << (_al - 1));
 
 			_si++;
 			if (scumm_stricmp(_tokens[_si], "|")) break;
@@ -956,8 +956,8 @@
 	debugC(7, kDebugParser, "LOCATION_PARSER(sound) ");
 
 	if (getPlatform() == Common::kPlatformAmiga) {
-		strcpy(_locationSound, _tokens[1]);
-		_hasLocationSound = true;
+		strcpy(_location._soundFile, _tokens[1]);
+		_location._hasSound = true;
 	}
 }
 
@@ -983,7 +983,7 @@
 
 	// TODO: the following two lines are specific to Nippon Safes
 	// and should be moved into something like 'initializeParsing()'
-	_hasLocationSound = false;
+	_location._hasSound = false;
 
 	_locParseCtxt.end = false;
 	_locParseCtxt.script = script;
@@ -1001,8 +1001,8 @@
 	resolveCommandForwards();
 
 	// this loads animation scripts
-	AnimationList::iterator it = _animations.begin();
-	for ( ; it != _animations.end(); it++) {
+	AnimationList::iterator it = _location._animations.begin();
+	for ( ; it != _location._animations.end(); it++) {
 		if ((*it)->_scriptName) {
 			loadProgram(*it, (*it)->_scriptName);
 		}

Modified: scummvm/trunk/engines/parallaction/walk.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/walk.cpp	2008-05-05 10:45:11 UTC (rev 31871)
+++ scummvm/trunk/engines/parallaction/walk.cpp	2008-05-05 11:02:40 UTC (rev 31872)
@@ -355,15 +355,15 @@
 	z = hitZone(kZoneTrap, foot.x, foot.y);
 
 	if (z) {
-		_localFlags[_currentLocationIndex] |= kFlagsEnter;
+		setLocationFlags(kFlagsEnter);
 		runCommands(z->_commands, z);
-		_localFlags[_currentLocationIndex] &= ~kFlagsEnter;
+		clearLocationFlags(kFlagsEnter);
 		_zoneTrap = z;
 	} else
 	if (_zoneTrap) {
-		_localFlags[_currentLocationIndex] |= kFlagsExit;
+		setLocationFlags(kFlagsExit);
 		runCommands(_zoneTrap->_commands, _zoneTrap);
-		_localFlags[_currentLocationIndex] &= ~kFlagsExit;
+		clearLocationFlags(kFlagsExit);
 		_zoneTrap = nullZonePtr;
 	}
 


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