diff options
| -rw-r--r-- | engines/parallaction/callables_ns.cpp | 2 | ||||
| -rw-r--r-- | engines/parallaction/debug.cpp | 14 | ||||
| -rw-r--r-- | engines/parallaction/dialogue.cpp | 2 | ||||
| -rw-r--r-- | engines/parallaction/exec_br.cpp | 20 | ||||
| -rw-r--r-- | engines/parallaction/exec_ns.cpp | 16 | ||||
| -rw-r--r-- | engines/parallaction/objects.h | 2 | ||||
| -rw-r--r-- | engines/parallaction/parallaction.cpp | 37 | ||||
| -rw-r--r-- | engines/parallaction/parallaction.h | 24 | ||||
| -rw-r--r-- | engines/parallaction/parallaction_br.cpp | 2 | ||||
| -rw-r--r-- | engines/parallaction/parallaction_ns.cpp | 16 | ||||
| -rw-r--r-- | engines/parallaction/parser_br.cpp | 22 | ||||
| -rw-r--r-- | engines/parallaction/parser_ns.cpp | 22 | ||||
| -rw-r--r-- | engines/parallaction/walk.cpp | 8 | 
13 files changed, 106 insertions, 81 deletions
| diff --git a/engines/parallaction/callables_ns.cpp b/engines/parallaction/callables_ns.cpp index ae7b485d8d..c9a547d75b 100644 --- a/engines/parallaction/callables_ns.cpp +++ b/engines/parallaction/callables_ns.cpp @@ -268,7 +268,7 @@ void Parallaction_ns::_c_moveSarc(void *parm) {  		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; diff --git a/engines/parallaction/debug.cpp b/engines/parallaction/debug.cpp index c88cc63575..4f281998e2 100644 --- a/engines/parallaction/debug.cpp +++ b/engines/parallaction/debug.cpp @@ -117,7 +117,7 @@ bool Debugger::Cmd_GlobalFlags(int argc, const char **argv) {  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_Give(int argc, const char **argv) {  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_Zones(int argc, const char **argv) {  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_Set(int argc, const char** argv) {  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" }; diff --git a/engines/parallaction/dialogue.cpp b/engines/parallaction/dialogue.cpp index 73414ce0b4..2e3ecb590f 100644 --- a/engines/parallaction/dialogue.cpp +++ b/engines/parallaction/dialogue.cpp @@ -155,7 +155,7 @@ bool DialogueManager::displayAnswer(uint16 i) {  	Answer *a = _q->_answers[i]; -	uint32 flags = _vm->_localFlags[_vm->_currentLocationIndex]; +	uint32 flags = _vm->getLocationFlags();  	if (a->_yesFlags & kFlagsGlobal)  		flags = _commandFlags | kFlagsGlobal; diff --git a/engines/parallaction/exec_br.cpp b/engines/parallaction/exec_br.cpp index 6aeb090ad9..e4859a8851 100644 --- a/engines/parallaction/exec_br.cpp +++ b/engines/parallaction/exec_br.cpp @@ -215,25 +215,25 @@ DECLARE_COMMAND_OPCODE(dec) {  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(unfix) {  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(part) {  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  } diff --git a/engines/parallaction/exec_ns.cpp b/engines/parallaction/exec_ns.cpp index ed4592646b..385e49b78d 100644 --- a/engines/parallaction/exec_ns.cpp +++ b/engines/parallaction/exec_ns.cpp @@ -209,7 +209,7 @@ DECLARE_COMMAND_OPCODE(set) {  		_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 @@ DECLARE_COMMAND_OPCODE(clear) {  		_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 @@ DECLARE_COMMAND_OPCODE(toggle) {  		_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 @@ void Parallaction_ns::drawAnimations() {  	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 @@ void Parallaction_ns::runScripts() {  	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 @@ void Parallaction::runCommands(CommandList& list, ZonePtr z) {  	for ( ; it != list.end(); it++) {  		CommandPtr cmd = *it; -		uint32 v8 = _localFlags[_currentLocationIndex]; +		uint32 v8 = getLocationFlags();  		if (_engineFlags & kEngineQuit)  			break; @@ -576,7 +576,7 @@ ZonePtr Parallaction::hitZone(uint32 type, uint16 x, uint16 y) {  	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 @@ ZonePtr Parallaction::hitZone(uint32 type, uint16 x, uint16 y) {  	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; diff --git a/engines/parallaction/objects.h b/engines/parallaction/objects.h index eb7a1445b3..cfb78f941b 100644 --- a/engines/parallaction/objects.h +++ b/engines/parallaction/objects.h @@ -94,6 +94,8 @@ enum ZoneFlags {  enum CommandFlags { +	kFlagsAll			= 0xFFFFFFFF, +  	kFlagsVisited		= 1,  	kFlagsExit			= 0x10000000,  	kFlagsEnter			= 0x20000000, diff --git a/engines/parallaction/parallaction.cpp b/engines/parallaction/parallaction.cpp index 17b2c70687..649f21ae96 100644 --- a/engines/parallaction/parallaction.cpp +++ b/engines/parallaction/parallaction.cpp @@ -113,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,14 +591,14 @@ void Parallaction::resumeJobs() {  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 @@ void Parallaction::allocateLocationSlot(const char *name) {  		_locationNames[_numLocations][0] = '\0';  		_localFlags[_numLocations] = 0;  	} else { -		_localFlags[_currentLocationIndex] |= kFlagsVisited;	// 'visited' +		setLocationFlags(kFlagsVisited);	// 'visited'  	}  } @@ -651,7 +651,7 @@ void Parallaction::freeLocation() {  	_gfx->clearGfxObjects();  	freeBackground(); -	_programs.clear(); +	_location._programs.clear();  	freeZones();  	freeAnimations(); @@ -704,7 +704,7 @@ void Parallaction::doLocationEnterTransition() {  		return;  	} -	if (_localFlags[_currentLocationIndex] & kFlagsVisited) { +	if (getLocationFlags() & kFlagsVisited) {  		debugC(2, kDebugExec, "skipping location transition");  		return; // visited  	} @@ -737,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;  	} @@ -752,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. @@ -763,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);  		}  	} diff --git a/engines/parallaction/parallaction.h b/engines/parallaction/parallaction.h index 4300a12f86..19ce437410 100644 --- a/engines/parallaction/parallaction.h +++ b/engines/parallaction/parallaction.h @@ -185,10 +185,20 @@ struct Location {  	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 @@ public:  	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 @@ public:  	ZonePtr			_activeZone; -	ZoneList		_zones; -	AnimationList	_animations; -	ProgramList		_programs;  	Font		*_labelFont;  	Font		*_menuFont; @@ -406,8 +418,6 @@ protected:		// data  	Common::String	_saveFileName; -	bool		_hasLocationSound; -	char		_locationSound[50];  	ZonePtr		_hoverZone; @@ -859,10 +869,6 @@ public:  	int			_part;  	int			_progress; -	int			_zeta0; -	int			_zeta1; -	int			_zeta2; -  	int16		_lipSyncVal;  	uint		_subtitleLipSync;  	int			_subtitleY; diff --git a/engines/parallaction/parallaction_br.cpp b/engines/parallaction/parallaction_br.cpp index 34d6868b52..29e9fe6d70 100644 --- a/engines/parallaction/parallaction_br.cpp +++ b/engines/parallaction/parallaction_br.cpp @@ -215,7 +215,7 @@ void Parallaction_br::changeLocation(char *location) {  	clearSubtitles();  	freeBackground();  	_gfx->clearGfxObjects(); -	_programs.clear(); +	_location._programs.clear();  	freeZones();  	freeAnimations();  //	free(_location._comment); diff --git a/engines/parallaction/parallaction_ns.cpp b/engines/parallaction/parallaction_ns.cpp index d77152d5d2..7a476f7d24 100644 --- a/engines/parallaction/parallaction_ns.cpp +++ b/engines/parallaction/parallaction_ns.cpp @@ -143,7 +143,7 @@ int Parallaction_ns::init() {  	num_foglie = 0; -	_animations.push_front(_char._ani); +	_location._animations.push_front(_char._ani);  	Parallaction::init(); @@ -159,7 +159,7 @@ Parallaction_ns::~Parallaction_ns() {  	delete _instructionNames;  	delete _locationStmt; -	_animations.remove(_char._ani); +	_location._animations.remove(_char._ani);  } @@ -306,7 +306,7 @@ void Parallaction_ns::changeLocation(char *location) {  		setArrowCursor();  	} -	_animations.remove(_char._ani); +	_location._animations.remove(_char._ani);  	freeLocation(); @@ -326,7 +326,7 @@ void Parallaction_ns::changeLocation(char *location) {  		changeCharacter(locname.character());  	} -	_animations.push_front(_char._ani); +	_location._animations.push_front(_char._ani);  	strcpy(_saveData1, locname.location());  	parseLocation(_saveData1); @@ -357,8 +357,8 @@ void Parallaction_ns::changeLocation(char *location) {  	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 @@ void Parallaction_ns::cleanupGame() {  	_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 @@ void Parallaction_ns::cleanupGame() {  	_engineFlags &= ~kEngineQuit;  	// main character animation is restored -	_animations.push_front(_char._ani); +	_location._animations.push_front(_char._ani);  	_score = 0;  	return; diff --git a/engines/parallaction/parser_br.cpp b/engines/parallaction/parser_br.cpp index 8b36f54ea7..2544267382 100644 --- a/engines/parallaction/parser_br.cpp +++ b/engines/parallaction/parser_br.cpp @@ -146,11 +146,11 @@ DECLARE_LOCATION_PARSER(location)  {  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(zone)  {  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(localflags)  {  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(escape)  {  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;  	}  } diff --git a/engines/parallaction/parser_ns.cpp b/engines/parallaction/parser_ns.cpp index f955f44c8c..b8b36a0885 100644 --- a/engines/parallaction/parser_ns.cpp +++ b/engines/parallaction/parser_ns.cpp @@ -239,7 +239,7 @@ void Parallaction_ns::loadProgram(AnimationPtr a, const char *filename) {  	delete script; -	_programs.push_back(program); +	_location._programs.push_back(program);  	debugC(1, kDebugParser, "loadProgram() done"); @@ -882,14 +882,14 @@ DECLARE_LOCATION_PARSER(nodes)  {  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(acommands)  {  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 @@ DECLARE_LOCATION_PARSER(sound)  {  	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 @@ void Parallaction_ns::parseLocation(const char *filename) {  	// 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 @@ void Parallaction_ns::parseLocation(const char *filename) {  	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);  		} diff --git a/engines/parallaction/walk.cpp b/engines/parallaction/walk.cpp index 3272a16179..0a8ded9e29 100644 --- a/engines/parallaction/walk.cpp +++ b/engines/parallaction/walk.cpp @@ -355,15 +355,15 @@ uint16 Parallaction::checkDoor() {  	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;  	} | 
