diff options
| -rw-r--r-- | engines/avalanche/acci2.cpp | 16 | ||||
| -rw-r--r-- | engines/avalanche/animation.cpp | 224 | ||||
| -rw-r--r-- | engines/avalanche/animation.h | 90 | ||||
| -rw-r--r-- | engines/avalanche/avalanche.cpp | 24 | ||||
| -rw-r--r-- | engines/avalanche/gyro2.cpp | 2 | ||||
| -rw-r--r-- | engines/avalanche/lucerna2.cpp | 24 | ||||
| -rw-r--r-- | engines/avalanche/scrolls2.cpp | 2 | ||||
| -rw-r--r-- | engines/avalanche/timeout2.cpp | 20 | ||||
| -rw-r--r-- | engines/avalanche/visa2.cpp | 2 | 
9 files changed, 203 insertions, 201 deletions
| diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp index 370ba87dab..24d74b5470 100644 --- a/engines/avalanche/acci2.cpp +++ b/engines/avalanche/acci2.cpp @@ -408,7 +408,7 @@ void Acci::storeInterrogation(byte interrogation) {  		_vm->_gyro->_dna._spareEvening = _vm->_parser->_inputText;  		_vm->_visa->dixi('z', 5); // His closing statement...  		_vm->_animation->tr[1].walkto(4); // The end of the drawbridge -		_vm->_animation->tr[1].vanishifstill = true; // Then go away! +		_vm->_animation->tr[1]._vanishIfStill = true; // Then go away!  		_vm->_gyro->_magics[1]._operation = _vm->_gyro->kMagicNothing;  		_vm->_gyro->_dna._cardiffQuestionNum = 5;  		break; @@ -937,7 +937,7 @@ void Acci::openDoor() {  				_vm->_animation->call_special(_vm->_gyro->_portals[fv]._data);  				break;  			case Gyro::kMagicOpenDoor: -				_vm->_animation->open_the_door((_vm->_gyro->_portals[fv]._data) >> 8, (_vm->_gyro->_portals[fv]._data) & 0x0F, fv + 9); +				_vm->_animation->openDoor((_vm->_gyro->_portals[fv]._data) >> 8, (_vm->_gyro->_portals[fv]._data) & 0x0F, fv + 9);  				break;  			} @@ -1040,7 +1040,7 @@ void Acci::notInOrder() {  }  void Acci::goToCauldron() { -	_vm->_animation->tr[1].call_eachstep = false; // Stops Geida_Procs. +	_vm->_animation->tr[1]._callEachStepFl = false; // Stops Geida_Procs.  	_vm->_timeout->set_up_timer(1, _vm->_timeout->procspludwick_goes_to_cauldron, _vm->_timeout->reason_spludwalk);  	_vm->_animation->tr[1].walkto(2);  } @@ -1278,7 +1278,7 @@ void Acci::personSpeaks() {  	bool found = false; // The _person we're looking for's code is in _person.  	for (int16 i = 0; i < _vm->_animation->kSpriteNumbMax; i++) { -		if (_vm->_animation->tr[i].quick && ((_vm->_animation->tr[i]._stat.accinum + 149) == _person)) { +		if (_vm->_animation->tr[i]._quick && ((_vm->_animation->tr[i]._stat.accinum + 149) == _person)) {  			_vm->_scrolls->displayText(Common::String(_vm->_scrolls->kControlRegister) + byte(i + 49) + _vm->_scrolls->kControlToBuffer);  			found = true;  		} @@ -1703,8 +1703,8 @@ void Acci::doThat() {  					_vm->_animation->tr[1].init(1, false, _vm->_animation); // Avaricius  					_vm->_animation->apped(2, 4);  					_vm->_animation->tr[1].walkto(5); -					_vm->_animation->tr[1].call_eachstep = true; -					_vm->_animation->tr[1].eachstep = _vm->_animation->kProcBackAndForth; +					_vm->_animation->tr[1]._callEachStepFl = true; +					_vm->_animation->tr[1]._eachStepProc = _vm->_animation->kProcBackAndForth;  					_vm->_gyro->_dna._avariciusTalk = 14;  					_vm->_timeout->set_up_timer(177, _vm->_timeout->procavaricius_talks, _vm->_timeout->reason_avariciustalks);  				} @@ -1862,8 +1862,8 @@ void Acci::doThat() {  				_vm->_gyro->_magics[11]._operation = _vm->_gyro->kMagicNothing;  				_vm->_lucerna->incScore(7);  				_vm->_animation->tr[1].walkto(2); -				_vm->_animation->tr[1].vanishifstill = true; -				_vm->_animation->tr[1].call_eachstep = false; +				_vm->_animation->tr[1]._vanishIfStill = true; +				_vm->_animation->tr[1]._callEachStepFl = false;  				_vm->_gyro->_whereIs[7] = 177;  				break;  			default: diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp index 739c884a96..a4b129b736 100644 --- a/engines/avalanche/animation.cpp +++ b/engines/avalanche/animation.cpp @@ -45,18 +45,16 @@  namespace Avalanche { -void AnimationType::init(byte spritenum, bool do_check, Animation *tr) { +void AnimationType::init(byte spritenum, bool doCheck, Animation *tr) {  	_tr = tr;  	const int32 idshould = -1317732048; -	byte fv; -	int32 id; -	Common::File inf;  	if (spritenum == 177)  		return; // Already running!  	Common::String filename; +	Common::File inf;  	filename = filename.format("sprite%d.avd", spritenum);  	if (!inf.open(filename)) {  		warning("AVALANCHE: Trip: File not found: %s", filename.c_str()); @@ -65,7 +63,7 @@ void AnimationType::init(byte spritenum, bool do_check, Animation *tr) {  	inf.seek(177); -	id = inf.readSint32LE(); +	int32 id = inf.readSint32LE();  	if (id != idshould) {  		//output << '\7';  		inf.close(); @@ -100,14 +98,13 @@ void AnimationType::init(byte spritenum, bool do_check, Animation *tr) {  	_info._xWidth = _info._xLength / 8;  	if ((_info._xLength % 8) > 0)  		_info._xWidth++; -	for (byte aa = 0; aa < _stat._frameNum; aa++) { - +	for (byte i = 0; i < _stat._frameNum; i++) {  		_info._sil[_animCount] = new SilType[11 * (_info._yLength + 1)];  		//getmem(sil[totalnum-1], 11 * (a.yl + 1));  		_info._mani[_animCount] = new ManiType[_info._size - 6];  		//getmem(mani[totalnum-1], a.size - 6); -		for (fv = 0; fv <= _info._yLength; fv++) -			inf.read((*_info._sil[_animCount])[fv], _info._xWidth); +		for (byte j = 0; j <= _info._yLength; j++) +			inf.read((*_info._sil[_animCount])[j], _info._xWidth);  			//blockread(inf, (*sil[totalnum-1])[fv], xw);  		inf.read(*_info._mani[_animCount], _info._size - 6);  		//blockread(inf, *mani[totalnum-1], a.size - 6); @@ -119,7 +116,7 @@ void AnimationType::init(byte spritenum, bool do_check, Animation *tr) {  	// on;  	_x = 0;  	_y = 0; -	quick = true; +	_quick = true;  	_visible = false;  	_speedX = 3;  	_speedY = 1; @@ -129,25 +126,25 @@ void AnimationType::init(byte spritenum, bool do_check, Animation *tr) {  	_homing = false;  	_moveX = 0;  	_moveY = 0; -	step = 0; -	check_me = do_check; -	count = 0; +	_stepNum = 0; +	_doCheck = doCheck; +	_count = 0;  	_id = spritenum; -	vanishifstill = false; -	call_eachstep = false; +	_vanishIfStill = false; +	_callEachStepFl = false;  	inf.close();  }  void AnimationType::original() { -	quick = false; +	_quick = false;  	_id = 177;  }  void AnimationType::andexor() { -	if ((vanishifstill) && (_moveX == 0) && (_moveY == 0)) +	if ((_vanishIfStill) && (_moveX == 0) && (_moveY == 0))  		return; -	byte picnum = _facingDir * _stat.seq + step; // There'll maybe problem because of the different array indexes in Pascal (starting from 1). +	byte picnum = _facingDir * _stat.seq + _stepNum; // There'll maybe problem because of the different array indexes in Pascal (starting from 1).  	_tr->_vm->_graphics->drawSprite(_info, picnum, _x, _y);  } @@ -176,7 +173,7 @@ void AnimationType::appear(int16 wx, int16 wy, byte wf) {   */  bool AnimationType::checkCollision() {  	for (int16 i = 0; i < _tr->kSpriteNumbMax; i++) { -		if (_tr->tr[i].quick && (_tr->tr[i]._id != _id) && +		if (_tr->tr[i]._quick && (_tr->tr[i]._id != _id) &&  			((_x + _info._xLength) > _tr->tr[i]._x) &&  			(_x < (_tr->tr[i]._x + _tr->tr[i]._info._xLength)) &&  			(_tr->tr[i]._y == _y)) @@ -211,7 +208,7 @@ void AnimationType::walk() {  		_y = _y + _moveY;  	} -	if (check_me) { +	if (_doCheck) {  		if (checkCollision()) {  			bounce();  			return; @@ -243,19 +240,19 @@ void AnimationType::walk() {  				_tr->call_special(_tr->_vm->_gyro->_magics[tc]._data);  				break;  			case Gyro::kMagicOpenDoor: -				_tr->open_the_door(_tr->_vm->_gyro->_magics[tc]._data >> 8, _tr->_vm->_gyro->_magics[tc]._data & 0xff, tc); +				_tr->openDoor(_tr->_vm->_gyro->_magics[tc]._data >> 8, _tr->_vm->_gyro->_magics[tc]._data & 0xff, tc);  				break;  			}  		}  	}  	if (!_tr->_vm->_gyro->_doingSpriteRun) { -		count++; -		if (((_moveX != 0) || (_moveY != 0)) && (count > 1)) { -			step++; -			if (step == _stat.seq) -				step = 0; -			count = 0; +		_count++; +		if (((_moveX != 0) || (_moveY != 0)) && (_count > 1)) { +			_stepNum++; +			if (_stepNum == _stat.seq) +				_stepNum = 0; +			_count = 0;  		}  	}  } @@ -263,7 +260,7 @@ void AnimationType::walk() {  void AnimationType::bounce() {  	_x = _oldX[_tr->_vm->_gyro->_cp];  	_y = _oldY[_tr->_vm->_gyro->_cp]; -	if (check_me) +	if (_doCheck)  		_tr->stopWalking();  	else  		stopWalk(); @@ -355,50 +352,54 @@ void AnimationType::chatter() {  	_tr->_vm->_gyro->_talkBackgroundColor = _stat._bgBubbleCol;  } -void AnimationType::set_up_saver(trip_saver_type &v) { -	v.whichsprite = _id; -	v.face = _facingDir; -	v.step = step; -	v.x = _x; -	v.y = _y; -	v.ix = _moveX; -	v.iy = _moveY; -	v.visible = _visible; -	v.homing = _homing; -	v.check_me = check_me; -	v.count = count; -	v.xw = _info._xWidth; -	v.xs = _speedX; -	v.ys = _speedY; -	v.totalnum = _animCount; -	v.hx = _homingX; -	v.hy = _homingY; -	v.call_eachstep = call_eachstep; -	v.eachstep = eachstep; -	v.vanishifstill = vanishifstill; +/** + * Init Saver structure + * @remarks	Originally called 'set_up_saver' + */ +void AnimationType::setupSaver(AnimationSaver &sav) { +	sav._id = _id; +	sav._facingDir = _facingDir; +	sav._stepNum = _stepNum; +	sav._x = _x; +	sav._y = _y; +	sav._moveX = _moveX; +	sav._moveY = _moveY; +	sav._visible = _visible; +	sav._homing = _homing; +	sav._doCheck = _doCheck; +	sav._count = _count; +	sav._xWidth = _info._xWidth; +	sav._speedX = _speedX; +	sav._speedY = _speedY; +	sav._animCount = _animCount; +	sav._homingX = _homingX; +	sav._homingY = _homingY; +	sav._callEachStepFl = _callEachStepFl; +	sav._eachStepProc = _eachStepProc; +	sav._vanishIfStill = _vanishIfStill;  } -void AnimationType::unload_saver(trip_saver_type v) { -	_id = v.whichsprite; -	_facingDir = v.face; -	step = v.step; -	_x = v.x; -	_y = v.y; -	_moveX = v.ix; -	_moveY = v.iy; -	_visible = v.visible; -	_homing = v.homing; -	check_me = v.check_me; -	count = v.count; -	_info._xWidth = v.xw; -	_speedX = v.xs; -	_speedY = v.ys; -	_animCount = v.totalnum; -	_homingX = v.hx; -	_homingY = v.hy; -	call_eachstep = v.call_eachstep; -	eachstep = v.eachstep; -	vanishifstill = v.vanishifstill; +void AnimationType::unload_saver(AnimationSaver sav) { +	_id = sav._id; +	_facingDir = sav._facingDir; +	_stepNum = sav._stepNum; +	_x = sav._x; +	_y = sav._y; +	_moveX = sav._moveX; +	_moveY = sav._moveY; +	_visible = sav._visible; +	_homing = sav._homing; +	_doCheck = sav._doCheck; +	_count = sav._count; +	_info._xWidth = sav._xWidth; +	_speedX = sav._speedX; +	_speedY = sav._speedY; +	_animCount = sav._animCount; +	_homingX = sav._homingX; +	_homingY = sav._homingY; +	_callEachStepFl = sav._callEachStepFl; +	_eachStepProc = sav._eachStepProc; +	_vanishIfStill = sav._vanishIfStill;  }  void AnimationType::savedata(Common::File &f) { @@ -429,7 +430,7 @@ AnimationType *AnimationType::done() {  		delete[] _info._sil[_animCount];  	} -	quick = false; +	_quick = false;  	_id = 177;  	return this;  } @@ -460,7 +461,7 @@ Animation::Animation(AvalancheEngine *vm) {  Animation::~Animation() {  	for (int16 i = 0; i < kSpriteNumbMax; i++) { -		if (tr[i].quick) +		if (tr[i]._quick)  			tr[i].done();  	}  } @@ -827,11 +828,11 @@ void Animation::catamove(byte ped) {  	}  	if ((_vm->_gyro->_dna._geidaFollows) && (ped > 0)) { -		if (!tr[1].quick)  // If we don't already have her... +		if (!tr[1]._quick)  // If we don't already have her...  			tr[1].init(5, true, this); // ...Load Geida.  		apped(2, geida_ped(ped)); -		tr[1].call_eachstep = true; -		tr[1].eachstep = kProcGeida; +		tr[1]._callEachStepFl = true; +		tr[1]._eachStepProc = kProcGeida;  	}  } @@ -875,8 +876,8 @@ void Animation::call_special(uint16 which) {  			// graphic of the arrow buried in the plaster. */  			// OK! -			tr[1].call_eachstep = true; -			tr[1].eachstep = kProcArrow; +			tr[1]._callEachStepFl = true; +			tr[1]._eachStepProc = kProcArrow;  		}  		break;  	case 4: // This is the ghost room link. @@ -897,8 +898,8 @@ void Animation::call_special(uint16 which) {  			_vm->_gyro->_dna._tiedUp = true;  			_vm->_gyro->_dna._friarWillTieYouUp = false;  			tr[1].walkto(3); -			tr[1].vanishifstill = true; -			tr[1].check_me = true; // One of them must have Check_Me switched on. +			tr[1]._vanishIfStill = true; +			tr[1]._doCheck = true; // One of them must have Check_Me switched on.  			_vm->_gyro->_whereIs[_vm->_gyro->kPeopleFriarTuck - 150] = 177; // Not here, then.  			_vm->_timeout->set_up_timer(364, _vm->_timeout->prochang_around, _vm->_timeout->reason_hanging_around);  		} @@ -925,14 +926,14 @@ void Animation::call_special(uint16 which) {  			_vm->_visa->dixi('q', 63);  			tr[1].turn(kDirDown);  			tr[1].stopWalk(); -			tr[1].call_eachstep = false; // Geida +			tr[1]._callEachStepFl = false; // Geida  			_vm->_lucerna->gameOver();  		}  		break;  	case 9: // _vm->_gyro->special 9: lose Geida to Robin Hood...  		if (!_vm->_gyro->_dna._geidaFollows)  			return;   // DOESN'T COUNT: no Geida. -		tr[1].call_eachstep = false; // She no longer follows Avvy around. +		tr[1]._callEachStepFl = false; // She no longer follows Avvy around.  		tr[1].walkto(4); // She walks to somewhere...  		tr[0].done();     // Lose Avvy.  		_vm->_gyro->_dna._userMovesAvvy = false; @@ -999,12 +1000,14 @@ void Animation::call_special(uint16 which) {  	}  } - - -void Animation::open_the_door(byte whither, byte ped, byte magicnum) { -// This slides the door open. (The data really ought to be saved in -// the Also file, and will be next time. However, for now, they're -// here.) +/** + * Open the Door. + * This slides the door open. The data really ought to be saved in + * the Also file, and will be next time. However, for now, they're + * here. + * @remarks	Originally called 'open_the_door' + */ +void Animation::openDoor(byte whither, byte ped, byte magicnum) {  	switch (_vm->_gyro->_dna._room) {  	case r__outsideyours:  	case r__outsidenottspub: @@ -1059,9 +1062,8 @@ void Animation::open_the_door(byte whither, byte ped, byte magicnum) {  }  void Animation::newspeed() { -	// Given that you've just changed the speed in triptype.xs, this adjusts ix. +	// Given that you've just changed the speed in triptype._speedX, this adjusts _moveX.  	const ByteField lightspace = {40, 199, 47, 199}; -	byte page_;  	tr[0]._moveX = (tr[0]._moveX / 3) * tr[0]._speedX; @@ -1079,8 +1081,8 @@ void Animation::newspeed() {  	//setactivepage(1 - cp); -	for (page_ = 0; page_ <= 1; page_++) -		getset[page_].remember(lightspace); +	for (byte i = 0; i <= 1; i++) +		getset[i].remember(lightspace);  } @@ -1166,10 +1168,10 @@ void Animation::follow_avvy_y(byte tripnum) {  		else  			return;  		if (tr[tripnum]._moveX == 0)  { -			tr[tripnum].step += 1; -			if (tr[tripnum].step == tr[tripnum]._stat.seq) -				tr[tripnum].step = 0; -			tr[tripnum].count = 0; +			tr[tripnum]._stepNum += 1; +			if (tr[tripnum]._stepNum == tr[tripnum]._stat.seq) +				tr[tripnum]._stepNum = 0; +			tr[tripnum]._count = 0;  		}  	}  } @@ -1204,7 +1206,7 @@ void Animation::arrow_procs(byte tripnum) {  				&& ((tr[tripnum]._x + tr[tripnum]._info._xLength) >= tr[0]._x)) { // C  			// OK, it's hit him... what now? -			tr[1].call_eachstep = false; // prevent recursion. +			tr[1]._callEachStepFl = false; // prevent recursion.  			_vm->_visa->dixi('Q', 47); // Complaint!  			tr[tripnum].done(); // Deallocate the arrow.  #if 0 @@ -1251,7 +1253,7 @@ void Animation::grab_avvy(byte tripnum) {     // For Friar Tuck, in Nottingham.  	int16 tox = tr[0]._x + 17;  	int16 toy = tr[0]._y - 1;  	if ((tr[tripnum]._x == tox) && (tr[tripnum]._y == toy)) { -		tr[tripnum].call_eachstep = false; +		tr[tripnum]._callEachStepFl = false;  		tr[tripnum]._facingDir = kDirLeft;  		tr[tripnum].stopWalk();  		// ... whatever ... @@ -1264,18 +1266,18 @@ void Animation::grab_avvy(byte tripnum) {     // For Friar Tuck, in Nottingham.  		}  		if (tr[tripnum]._y < toy)  			tr[tripnum]._y++; -		tr[tripnum].step++; -		if (tr[tripnum].step == tr[tripnum]._stat.seq) -			tr[tripnum].step = 0; +		tr[tripnum]._stepNum++; +		if (tr[tripnum]._stepNum == tr[tripnum]._stat.seq) +			tr[tripnum]._stepNum = 0;  	}  }  void Animation::take_a_step(byte &tripnum) {  	if (tr[tripnum]._moveX == 0) { -		tr[tripnum].step++; -		if (tr[tripnum].step == tr[tripnum]._stat.seq) -			tr[tripnum].step = 0; -		tr[tripnum].count = 0; +		tr[tripnum]._stepNum++; +		if (tr[tripnum]._stepNum == tr[tripnum]._stat.seq) +			tr[tripnum]._stepNum = 0; +		tr[tripnum]._count = 0;  	}  } @@ -1344,7 +1346,7 @@ void Animation::call_andexors() {  		order[i] = -1;  	for (int16 i = 0; i < kSpriteNumbMax; i++) { -		if (tr[i].quick && tr[i]._visible) +		if (tr[i]._quick && tr[i]._visible)  			order[i] = i;  	} @@ -1379,15 +1381,15 @@ void Animation::animLink() {  	if (_vm->_gyro->_dropdownActive | _vm->_gyro->_onToolbar | _vm->_gyro->_seeScroll)  		return;  	for (int16 i = 0; i < kSpriteNumbMax; i++) { -		if (tr[i].quick && tr[i]._visible) +		if (tr[i]._quick && tr[i]._visible)  			tr[i].walk();  	}  	call_andexors();  	for (int16 i = 0; i < kSpriteNumbMax; i++) { -		if (tr[i].quick && tr[i].call_eachstep) { -			switch (tr[i].eachstep) { +		if (tr[i]._quick && tr[i]._callEachStepFl) { +			switch (tr[i]._eachStepProc) {  			case kProcFollowAvvyY :  				follow_avvy_y(i);  				break; @@ -1419,7 +1421,7 @@ void Animation::animLink() {  void Animation::get_back_loretta() {  	for (int16 i = 0; i < kSpriteNumbMax; i++) { -		if (tr[i].quick) { +		if (tr[i]._quick) {  			getback();  			return;  		} @@ -1431,7 +1433,7 @@ void Animation::stopWalking() {  	tr[0].stopWalk();  	_vm->_gyro->_dna._direction = kDirStopped;  	if (_vm->_gyro->_alive) -		tr[0].step = 1; +		tr[0]._stepNum = 1;  }  void Animation::tripkey(char dir) { @@ -1500,7 +1502,7 @@ void Animation::fliproom(byte room, byte ped) {  	getsetclear();  	for (int16 i = 1; i < kSpriteNumbMax; i++) { -		if (tr[i].quick) +		if (tr[i]._quick)  			tr[i].done();  	} // Deallocate sprite diff --git a/engines/avalanche/animation.h b/engines/avalanche/animation.h index 5e339346e1..72c86a48de 100644 --- a/engines/avalanche/animation.h +++ b/engines/avalanche/animation.h @@ -49,25 +49,25 @@ struct adxtype { // Second revision of ADX type  	byte accinum; // the number according to Acci (1=Avvy, etc.)  }; -struct trip_saver_type { -	byte whichsprite; -	byte face; -	byte step; -	int16 x; -	int16 y; -	int8 ix; -	int8 iy; -	bool visible; -	bool homing; -	bool check_me; -	byte count; -	byte xw, xs, ys; -	byte totalnum; -	int16 hx; -	int16 hy; -	bool call_eachstep; -	byte eachstep; -	bool vanishifstill; +struct AnimationSaver { +	byte _id; +	byte _facingDir; +	byte _stepNum; +	int16 _x; +	int16 _y; +	int8 _moveX; +	int8 _moveY; +	bool _visible; +	bool _homing; +	bool _doCheck; +	byte _count; +	byte _xWidth, _speedX, _speedY; +	byte _animCount; +	int16 _homingX; +	int16 _homingY; +	bool _callEachStepFl; +	byte _eachStepProc; +	bool _vanishIfStill;  };  class Animation; @@ -77,22 +77,22 @@ public:  	SpriteInfo _info;  	adxtype _stat; // vital statistics -	byte _facingDir, step; +	byte _facingDir, _stepNum;  	int16 _x, _y; // current xy coords  	int16 _oldX[2], _oldY[2];  // last xy coords  	int8 _moveX, _moveY; // amount to move sprite by, each step  	byte _id; -	bool quick, _visible, _homing, check_me; +	bool _quick, _visible, _homing, _doCheck;  	int16 _homingX, _homingY; // homing x & y coords -	byte count; // counts before changing step +	byte _count; // counts before changing step  	byte _speedX, _speedY; // x & y speed  	byte _animCount; // total number of sprites -	bool vanishifstill; // Do we show this sprite if it's still? +	bool _vanishIfStill; // Do we show this sprite if it's still? -	bool call_eachstep; // Do we call the eachstep procedure? -	byte eachstep; +	bool _callEachStepFl; // Do we call the eachstep procedure? +	byte _eachStepProc; -	void init(byte spritenum, bool do_check, Animation *tr); +	void init(byte spritenum, bool doCheck, Animation *tr);  	// loads & sets up the sprite  	void original();    // just sets Quick to false  	void andexor();    // drops sprite onto screen @@ -106,8 +106,8 @@ public:  	void speed(int8 xx, int8 yy); // sets ix & iy, non-homing, etc  	void stopWalk();    // Stops the sprite from moving  	void chatter();    // Sets up talk vars -	void set_up_saver(trip_saver_type &v); -	void unload_saver(trip_saver_type v); +	void setupSaver(AnimationSaver &sav); +	void unload_saver(AnimationSaver sav);  	void savedata(Common::File &f); // Self-explanatory,  	void loaddata(Common::File &f);  // really. @@ -140,25 +140,25 @@ public:  	friend class AnimationType;  	friend class getsettype; -	static const int16 kDirUp = 0; -	static const int16 kDirRight = 1; -	static const int16 kDirDown = 2; -	static const int16 kDirLeft = 3; -	static const int16 kDirUpRight = 4; -	static const int16 kDirDownRight = 5; -	static const int16 kDirDownLeft = 6; -	static const int16 kDirUpLeft = 7; -	static const int16 kDirStopped = 8; +	static const byte kDirUp = 0; +	static const byte kDirRight = 1; +	static const byte kDirDown = 2; +	static const byte kDirLeft = 3; +	static const byte kDirUpRight = 4; +	static const byte kDirDownRight = 5; +	static const byte kDirDownLeft = 6; +	static const byte kDirUpLeft = 7; +	static const byte kDirStopped = 8;  	static const int16 kSpriteNumbMax = 5; // current max no. of sprites -	static const int16 kProcFollowAvvyY = 1; -	static const int16 kProcBackAndForth = 2; -	static const int16 kProcFaceAvvy = 3; -	static const int16 kProcArrow = 4; -	static const int16 kProcsPludwick = 5; // Unused -	static const int16 kProcGrabAvvy = 6; -	static const int16 kProcGeida = 7; +	static const byte kProcFollowAvvyY = 1; +	static const byte kProcBackAndForth = 2; +	static const byte kProcFaceAvvy = 3; +	static const byte kProcArrow = 4; +	static const byte kProcsPludwick = 5; // Unused +	static const byte kProcGrabAvvy = 6; +	static const byte kProcGeida = 7;  	Animation(AvalancheEngine *vm);  	~Animation(); @@ -167,7 +167,7 @@ public:  	void get_back_loretta();  	void loadtrip();  	void call_special(uint16 which); -	void open_the_door(byte whither, byte ped, byte magicnum); // Handles slidey-open doors. +	void openDoor(byte whither, byte ped, byte magicnum); // Handles slidey-open doors.  	void catamove(byte ped);  	void stopWalking();  	void tripkey(char dir); diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp index 50b451a372..7462268714 100644 --- a/engines/avalanche/avalanche.cpp +++ b/engines/avalanche/avalanche.cpp @@ -283,7 +283,7 @@ void AvalancheEngine::synchronize(Common::Serializer &sz) {  	byte spriteNum = 0;  	if (sz.isSaving()) {  		for (int16 i = 0; i < _animation->kSpriteNumbMax; i++) { -			if (_animation->tr[i].quick) +			if (_animation->tr[i]._quick)  				spriteNum++;  		}  	} @@ -291,37 +291,37 @@ void AvalancheEngine::synchronize(Common::Serializer &sz) {  	if (sz.isLoading()) {  		for (int16 i = 0; i < _animation->kSpriteNumbMax; i++) { // Deallocate sprites. -			if (_animation->tr[i].quick) +			if (_animation->tr[i]._quick)  				_animation->tr[i].done();  		}  	}  	for (byte i = 0; i < spriteNum; i++) {  		sz.syncAsByte(_animation->tr[i]._id); -		sz.syncAsByte(_animation->tr[i].check_me); +		sz.syncAsByte(_animation->tr[i]._doCheck);  		if (sz.isLoading()) { -			_animation->tr[i].quick = true; -			_animation->tr[i].init(_animation->tr[i]._id, _animation->tr[i].check_me, _animation); +			_animation->tr[i]._quick = true; +			_animation->tr[i].init(_animation->tr[i]._id, _animation->tr[i]._doCheck, _animation);  		}  		sz.syncAsByte(_animation->tr[i]._moveX);  		sz.syncAsByte(_animation->tr[i]._moveY);  		sz.syncAsByte(_animation->tr[i]._facingDir); -		sz.syncAsByte(_animation->tr[i].step); +		sz.syncAsByte(_animation->tr[i]._stepNum);  		sz.syncAsByte(_animation->tr[i]._visible);  		sz.syncAsByte(_animation->tr[i]._homing); -		sz.syncAsByte(_animation->tr[i].count); +		sz.syncAsByte(_animation->tr[i]._count);  		sz.syncAsByte(_animation->tr[i]._info._xWidth);  		sz.syncAsByte(_animation->tr[i]._speedX);  		sz.syncAsByte(_animation->tr[i]._speedY);  		sz.syncAsByte(_animation->tr[i]._animCount);  		sz.syncAsSint16LE(_animation->tr[i]._homingX);  		sz.syncAsSint16LE(_animation->tr[i]._homingY); -		sz.syncAsByte(_animation->tr[i].call_eachstep); -		sz.syncAsByte(_animation->tr[i].eachstep); -		sz.syncAsByte(_animation->tr[i].vanishifstill); +		sz.syncAsByte(_animation->tr[i]._callEachStepFl); +		sz.syncAsByte(_animation->tr[i]._eachStepProc); +		sz.syncAsByte(_animation->tr[i]._vanishIfStill);  		sz.syncAsSint16LE(_animation->tr[i]._x);  		sz.syncAsSint16LE(_animation->tr[i]._y); @@ -484,14 +484,14 @@ bool AvalancheEngine::loadGame(const int16 slot) {  		+ _gyro->_roomnName + _scrolls->kControlNewLine + _scrolls->kControlNewLine  		+ "saved on " + expandDate(t.tm_mday, t.tm_mon, t.tm_year) + '.'); -	if (_animation->tr[0].quick && _animation->tr[0]._visible) +	if (_animation->tr[0]._quick && _animation->tr[0]._visible)  		_animation->rwsp(0, _gyro->_dna._direction); // We push Avvy in the right direction is he was moving.  	return true;  }  Common::String AvalancheEngine::expandDate(int d, int m, int y) { -	const Common::String months[12] = { +	static const Common::String months[12] = {  		"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"  	}; diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp index 6fa91cf87f..f7e917ed88 100644 --- a/engines/avalanche/gyro2.cpp +++ b/engines/avalanche/gyro2.cpp @@ -228,7 +228,7 @@ void Gyro::drawShadowBox(int16 x1, int16 y1, int16 x2, int16 y2, Common::String  void Gyro::newGame() {  	for (byte i = 0; i < kMaxSprites; i++) { -		if (_vm->_animation->tr[i].quick) +		if (_vm->_animation->tr[i]._quick)  			_vm->_animation->tr[i].done();  	}  	// Deallocate sprite. Sorry, beta testers! diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp index 94a58fa05d..3464a7c9f4 100644 --- a/engines/avalanche/lucerna2.cpp +++ b/engines/avalanche/lucerna2.cpp @@ -402,8 +402,8 @@ void Lucerna::putGeidaAt(byte whichPed, byte &ped) {  		return;  	_vm->_animation->tr[1].init(5, false, _vm->_animation); // load Geida  	_vm->_animation->apped(2, whichPed); -	_vm->_animation->tr[1].call_eachstep = true; -	_vm->_animation->tr[1].eachstep = _vm->_animation->kProcGeida; +	_vm->_animation->tr[1]._callEachStepFl = true; +	_vm->_animation->tr[1]._eachStepProc = _vm->_animation->kProcGeida;  }  void Lucerna::enterRoom(byte room, byte ped) { @@ -455,8 +455,8 @@ void Lucerna::enterRoom(byte room, byte ped) {  					_vm->_animation->tr[1]._facingDir = Animation::kDirLeft;  				} -				_vm->_animation->tr[1].call_eachstep = true; -				_vm->_animation->tr[1].eachstep = _vm->_animation->kProcFaceAvvy; // He always faces Avvy. +				_vm->_animation->tr[1]._callEachStepFl = true; +				_vm->_animation->tr[1]._eachStepProc = _vm->_animation->kProcFaceAvvy; // He always faces Avvy.  			} else _vm->_gyro->_whereIs[_vm->_gyro->kPeopleCrapulus - 150] = r__nowhere; @@ -487,8 +487,8 @@ void Lucerna::enterRoom(byte room, byte ped) {  			_vm->_gyro->_dna._dogFoodPos = 0;  // _vm->_gyro->also Spludwick pos. -			_vm->_animation->tr[1].call_eachstep = true; -			_vm->_animation->tr[1].eachstep = _vm->_animation->kProcGeida; +			_vm->_animation->tr[1]._callEachStepFl = true; +			_vm->_animation->tr[1]._eachStepProc = _vm->_animation->kProcGeida;  		} else  			_vm->_gyro->_whereIs[1] = r__nowhere;  		break; @@ -502,8 +502,8 @@ void Lucerna::enterRoom(byte room, byte ped) {  		} else {  			if (ped > 0) {  				_vm->_animation->tr[1].init(4, false, _vm->_animation); // 4 = Cwytalot -				_vm->_animation->tr[1].call_eachstep = true; -				_vm->_animation->tr[1].eachstep = _vm->_animation->kProcFollowAvvyY; +				_vm->_animation->tr[1]._callEachStepFl = true; +				_vm->_animation->tr[1]._eachStepProc = _vm->_animation->kProcFollowAvvyY;  				_vm->_gyro->_whereIs[_vm->_gyro->kPeopleCwytalot - 150] = r__brummieroad;  				if (_vm->_gyro->_dna._roomCount[r__brummieroad] == 1) { // First time here... @@ -524,7 +524,7 @@ void Lucerna::enterRoom(byte room, byte ped) {  			_vm->_animation->tr[1].init(4, false, _vm->_animation); // 4 = Cwytalot again  			_vm->_animation->apped(2, 1);  			_vm->_animation->tr[1].walkto(2); -			_vm->_animation->tr[1].vanishifstill = true; +			_vm->_animation->tr[1]._vanishIfStill = true;  			_vm->_gyro->_dna._passedCwytalotInHerts = true;  			// _vm->_gyro->whereis[#157] = r__Nowhere; // can we fit this in?  			_vm->_timeout->set_up_timer(20, _vm->_timeout->proc_cwytalot_in_herts, _vm->_timeout->reason_cwytalot_in_herts); @@ -716,8 +716,8 @@ void Lucerna::enterRoom(byte room, byte ped) {  			_vm->_animation->tr[1]._facingDir = Animation::kDirLeft;  		} -		_vm->_animation->tr[1].call_eachstep = true; -		_vm->_animation->tr[1].eachstep = _vm->_animation->kProcFaceAvvy; // She always faces Avvy. +		_vm->_animation->tr[1]._callEachStepFl = true; +		_vm->_animation->tr[1]._eachStepProc = _vm->_animation->kProcFaceAvvy; // She always faces Avvy.  		break;  	case r__insidecardiffcastle: @@ -1187,7 +1187,7 @@ void Lucerna::gameOver() {  	_vm->_animation->tr[0].done();  	_vm->_animation->tr[0].init(12, true, _vm->_animation); // 12 = Avalot falls -	_vm->_animation->tr[0].step = 0; +	_vm->_animation->tr[0]._stepNum = 0;  	_vm->_animation->tr[0].appear(sx, sy, 0);  	_vm->_timeout->set_up_timer(3, _vm->_timeout->procavalot_falls, _vm->_timeout->reason_falling_over); diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp index 444762b275..5e41ab27c2 100644 --- a/engines/avalanche/scrolls2.cpp +++ b/engines/avalanche/scrolls2.cpp @@ -689,7 +689,7 @@ void Scrolls::callScrollDriver() {  				if (_param == 0)  					setBubbleStateNatural();  				else if ((1 <= _param) && (_param <= 9)) { -					if ((_param > _vm->_animation->kSpriteNumbMax) || (!_vm->_animation->tr[_param - 1].quick)) { // Not valid. +					if ((_param > _vm->_animation->kSpriteNumbMax) || (!_vm->_animation->tr[_param - 1]._quick)) { // Not valid.  						_vm->_lucerna->errorLed();  						setBubbleStateNatural();  					} else diff --git a/engines/avalanche/timeout2.cpp b/engines/avalanche/timeout2.cpp index 2b954907a9..842a7dca6e 100644 --- a/engines/avalanche/timeout2.cpp +++ b/engines/avalanche/timeout2.cpp @@ -301,8 +301,8 @@ void Timeout::get_tied_up() {  	_vm->_animation->stopWalking();  	_vm->_animation->tr[1].stopWalk();  	_vm->_animation->tr[1].stophoming(); -	_vm->_animation->tr[1].call_eachstep = true; -	_vm->_animation->tr[1].eachstep = _vm->_animation->kProcGrabAvvy; +	_vm->_animation->tr[1]._callEachStepFl = true; +	_vm->_animation->tr[1]._eachStepProc = _vm->_animation->kProcGrabAvvy;  	set_up_timer(70, procget_tied_up2, reason_getting_tied_up);  } @@ -314,7 +314,7 @@ void Timeout::get_tied_up2() {  }  void Timeout::hang_around() { -	_vm->_animation->tr[1].check_me = false; +	_vm->_animation->tr[1]._doCheck = false;  	_vm->_animation->tr[0].init(7, true, _vm->_animation); // Robin Hood  	_vm->_gyro->_whereIs[_vm->_gyro->kPeopleRobinHood - 150] = r__robins;  	_vm->_animation->apped(1, 2); @@ -325,7 +325,7 @@ void Timeout::hang_around() {  void Timeout::hang_around2() {  	_vm->_visa->dixi('q', 40); -	_vm->_animation->tr[1].vanishifstill = false; +	_vm->_animation->tr[1]._vanishIfStill = false;  	_vm->_animation->tr[1].walkto(4);  	_vm->_gyro->_whereIs[_vm->_gyro->kPeopleFriarTuck - 150] = r__robins;  	_vm->_visa->dixi('q', 41); @@ -430,7 +430,7 @@ void Timeout::naughty_duke() { // This is when the Duke comes in and takes your  void Timeout::naughty_duke2() {  	_vm->_visa->dixi('q', 48); // "Ha ha, it worked again!"  	_vm->_animation->tr[1].walkto(1); // Walk to the door. -	_vm->_animation->tr[1].vanishifstill = true; // Then go away! +	_vm->_animation->tr[1]._vanishIfStill = true; // Then go away!  	set_up_timer(32, procnaughty_duke3, reason_naughty_duke);  } @@ -578,8 +578,8 @@ void Timeout::robin_hood_and_geida_talk() {  	_vm->_visa->dixi('q', 66);  	_vm->_animation->tr[0].walkto(2);  	_vm->_animation->tr[1].walkto(2); -	_vm->_animation->tr[0].vanishifstill = true; -	_vm->_animation->tr[1].vanishifstill = true; +	_vm->_animation->tr[0]._vanishIfStill = true; +	_vm->_animation->tr[1]._vanishIfStill = true;  	set_up_timer(162, procavalot_returns, reason_robin_hood_and_geida);  } @@ -636,8 +636,8 @@ void Timeout::winning() {  }  void Timeout::avalot_falls() { -	if (_vm->_animation->tr[0].step < 5) { -		_vm->_animation->tr[0].step++; +	if (_vm->_animation->tr[0]._stepNum < 5) { +		_vm->_animation->tr[0]._stepNum++;  		set_up_timer(3, procavalot_falls, reason_falling_over);  	} else {  		Common::String toDisplay; @@ -658,7 +658,7 @@ void Timeout::spludwick_goes_to_cauldron() {  }  void Timeout::spludwick_leaves_cauldron() { -	_vm->_animation->tr[1].call_eachstep = true; // So that normal procs will continue. +	_vm->_animation->tr[1]._callEachStepFl = true; // So that normal procs will continue.  }  void Timeout::give_lute_to_geida() { // Moved here from Acci. diff --git a/engines/avalanche/visa2.cpp b/engines/avalanche/visa2.cpp index 1fd7405563..66f1faf4c8 100644 --- a/engines/avalanche/visa2.cpp +++ b/engines/avalanche/visa2.cpp @@ -274,7 +274,7 @@ void Visa::talkto(byte whom) {  		_vm->_gyro->_whereIs[_vm->_gyro->kPeopleCrapulus - 150] = 177; // Crapulus walks off. -		_vm->_animation->tr[1].vanishifstill = true; +		_vm->_animation->tr[1]._vanishIfStill = true;  		_vm->_animation->tr[1].walkto(3); // Walks away.  		_vm->_lucerna->incScore(2); | 
