diff options
| author | Johannes Schickel | 2011-04-11 00:20:55 +0200 | 
|---|---|---|
| committer | Johannes Schickel | 2011-04-11 00:21:18 +0200 | 
| commit | ee4699a49557ab47a4c6660ce97e968676bb5f8b (patch) | |
| tree | 73c8f16d5d826671911e1693c40a5b714825bd6a /engines | |
| parent | 1244f122e09d7b11a562ce8f4e14a63c28026c2f (diff) | |
| download | scummvm-rg350-ee4699a49557ab47a4c6660ce97e968676bb5f8b.tar.gz scummvm-rg350-ee4699a49557ab47a4c6660ce97e968676bb5f8b.tar.bz2 scummvm-rg350-ee4699a49557ab47a4c6660ce97e968676bb5f8b.zip  | |
KYRA: Get rid of non-const static variables in HoF.
Diffstat (limited to 'engines')
| -rw-r--r-- | engines/kyra/kyra_hof.cpp | 35 | ||||
| -rw-r--r-- | engines/kyra/kyra_hof.h | 4 | 
2 files changed, 23 insertions, 16 deletions
diff --git a/engines/kyra/kyra_hof.cpp b/engines/kyra/kyra_hof.cpp index 990e55bcf2..4fef760028 100644 --- a/engines/kyra/kyra_hof.cpp +++ b/engines/kyra/kyra_hof.cpp @@ -87,7 +87,9 @@ KyraEngine_HoF::KyraEngine_HoF(OSystem *system, const GameFlags &flags) : KyraEn  	_pathfinderFlag = 0;  	_mouseX = _mouseY = 0; +	_nextIdleAnim = 0;  	_lastIdleScript = -1; +	_useSceneIdleAnim = false;  	_currentTalkSections.STATim = 0;  	_currentTalkSections.TLKTim = 0; @@ -145,6 +147,11 @@ KyraEngine_HoF::KyraEngine_HoF(OSystem *system, const GameFlags &flags) : KyraEn  	_menu = 0;  	_chatIsNote = false;  	memset(&_npcScriptData, 0, sizeof(_npcScriptData)); + +	_setCharPalFinal = false; +	_useCharPal = false; + +	memset(_characterFacingCountTable, 0, sizeof(_characterFacingCountTable));  }  KyraEngine_HoF::~KyraEngine_HoF() { @@ -1135,8 +1142,6 @@ void KyraEngine_HoF::restorePage0() {  }  void KyraEngine_HoF::updateCharPal(int unk1) { -	static bool unkVar1 = false; -  	if (!_useCharPal)  		return; @@ -1152,12 +1157,12 @@ void KyraEngine_HoF::updateCharPal(int unk1) {  			++src;  		}  		_screen->setScreenPalette(_screen->getPalette(0)); -		unkVar1 = true; +		_setCharPalFinal = true;  		_charPalEntry = palEntry; -	} else if (unkVar1 || !unk1) { +	} else if (_setCharPalFinal || !unk1) {  		_screen->getPalette(0).copy(_scenePal, palEntry << 4, 16, 112);  		_screen->setScreenPalette(_screen->getPalette(0)); -		unkVar1 = false; +		_setCharPalFinal = false;  	}  } @@ -1275,7 +1280,6 @@ int KyraEngine_HoF::getCharacterWalkspeed() const {  }  void KyraEngine_HoF::updateCharAnimFrame(int charId, int *table) { -	static int unkTable1[] = { 0, 0 };  	static const int unkTable2[] = { 17, 0 };  	static const int unkTable3[] = { 10, 0 };  	static const int unkTable4[] = { 24, 0 }; @@ -1297,20 +1301,20 @@ void KyraEngine_HoF::updateCharAnimFrame(int charId, int *table) {  	}  	if (!facing) { -		++unkTable1[charId]; +		++_characterFacingCountTable[charId];  	} else if (facing == 4) { -		++unkTable1[charId+1]; +		++_characterFacingCountTable[charId+1];  	} else if (facing == 7 || facing == 1 || facing == 5 || facing == 3) {  		if (facing == 7 || facing == 1) { -			if (unkTable1[charId] > 2) +			if (_characterFacingCountTable[charId] > 2)  				facing = 0;  		} else { -			if (unkTable1[charId+1] > 2) +			if (_characterFacingCountTable[charId+1] > 2)  				facing = 4;  		} -		unkTable1[charId] = 0; -		unkTable1[charId+1] = 0; +		_characterFacingCountTable[charId] = 0; +		_characterFacingCountTable[charId+1] = 0;  	}  	if (facing == 0) { @@ -1393,12 +1397,11 @@ void KyraEngine_HoF::showIdleAnim() {  	if (queryGameFlag(0x159) && _flags.isTalkie)  		return; -	static bool scriptAnimation = false; -	if (!scriptAnimation && _flags.isTalkie) { -		scriptAnimation = true; +	if (!_useSceneIdleAnim && _flags.isTalkie) { +		_useSceneIdleAnim = true;  		randomSceneChat();  	} else { -		scriptAnimation = false; +		_useSceneIdleAnim = false;  		if (_characterShapeFile > 8)  			return; diff --git a/engines/kyra/kyra_hof.h b/engines/kyra/kyra_hof.h index b862a89dd0..3040107fc4 100644 --- a/engines/kyra/kyra_hof.h +++ b/engines/kyra/kyra_hof.h @@ -574,11 +574,14 @@ protected:  	// character  	bool _useCharPal; +	bool _setCharPalFinal;  	int _charPalEntry;  	uint8 _charPalTable[16];  	void updateCharPal(int unk1);  	void setCharPalEntry(int entry, int value); +	int _characterFacingCountTable[2]; +  	int getCharacterWalkspeed() const;  	void updateCharAnimFrame(int num, int *table); @@ -681,6 +684,7 @@ protected:  	uint32 _nextIdleAnim;  	int _lastIdleScript; +	bool _useSceneIdleAnim;  	void setNextIdleAnimTimer();  	void showIdleAnim();  | 
