From b554063d3018a39f328f0cd818b03546918c60d6 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 17 Jun 2012 15:01:13 +1000 Subject: [PATCH] TONY: Moved global initialisations out of TonyEngine and into Globals class --- engines/tony/globals.cpp | 37 +++++++++++++++++++------------------ engines/tony/tony.cpp | 18 ------------------ 2 files changed, 19 insertions(+), 36 deletions(-) diff --git a/engines/tony/globals.cpp b/engines/tony/globals.cpp index 9115dafd6316..3042b5843a4c 100644 --- a/engines/tony/globals.cpp +++ b/engines/tony/globals.cpp @@ -60,24 +60,7 @@ Globals::Globals() { _bTonyInTexts = false; _bStaticTalk = false; _bPatIrqFreeze = false; - _bCfgInvLocked = false; - _bCfgInvNoScroll = false; - _bCfgTimerizedText = false; - _bCfgInvUp = false; - _bCfgAnni30 = false; - _bCfgAntiAlias = false; - _bCfgSottotitoli = false; - _bCfgTransparence = false; - _bCfgInterTips = false; - _bCfgDubbing = false; - _bCfgMusic = false; - _bCfgSFX = false; _bAlwaysDisplay = false; - _nCfgTonySpeed = 0; - _nCfgTextSpeed = 0; - _nCfgDubbingVolume = 0; - _nCfgMusicVolume = 0; - _nCfgSFXVolume = 0; _bIdleExited = false; _bSkipSfxNoLoop = false; _bNoBullsEye = false; @@ -85,7 +68,6 @@ Globals::Globals() { _curSoundEffect = 0; _bFadeOutStop = false; -// OSystem::MutexRef vdb; Common::fill(&_mut[0], &_mut[10], 0); _bSkipIdle = false; _hSkipIdle = 0; @@ -143,6 +125,25 @@ Globals::Globals() { Common::fill((byte *)&_mCharacter[i], (byte *)&_mCharacter[i] + sizeof(MCharacterStruct), 0); for (int i = 0; i < 256; ++i) Common::fill((byte *)&_changedHotspot[i], (byte *)&_changedHotspot[i] + sizeof(ChangedHotspotStruct), 0); + + // Set up globals that have explicit initial values + _bCfgInvLocked = false; + _bCfgInvNoScroll = false; + _bCfgTimerizedText = true; + _bCfgInvUp = false; + _bCfgAnni30 = false; + _bCfgAntiAlias = false; + _bCfgTransparence = true; + _bCfgInterTips = true; + _bCfgSottotitoli = true; + _nCfgTonySpeed = 3; + _nCfgTextSpeed = 5; + _bCfgDubbing = true; + _bCfgMusic = true; + _bCfgSFX = true; + _nCfgDubbingVolume = 10; + _nCfgMusicVolume = 7; + _nCfgSFXVolume = 10; } } // End of namespace Tony diff --git a/engines/tony/tony.cpp b/engines/tony/tony.cpp index 094e1bd0387c..91204763b331 100644 --- a/engines/tony/tony.cpp +++ b/engines/tony/tony.cpp @@ -167,24 +167,6 @@ Common::ErrorCode TonyEngine::init() { // Allocate space for thumbnails when saving the game _curThumbnail = new uint16[160 * 120]; - // Set up global defaults - GLOBALS._bCfgInvLocked = false; - GLOBALS._bCfgInvNoScroll = false; - GLOBALS._bCfgTimerizedText = true; - GLOBALS._bCfgInvUp = false; - GLOBALS._bCfgAnni30 = false; - GLOBALS._bCfgAntiAlias = false; - GLOBALS._bCfgTransparence = true; - GLOBALS._bCfgInterTips = true; - GLOBALS._bCfgSottotitoli = true; - GLOBALS._nCfgTonySpeed = 3; - GLOBALS._nCfgTextSpeed = 5; - GLOBALS._bCfgDubbing = true; - GLOBALS._bCfgMusic = true; - GLOBALS._bCfgSFX = true; - GLOBALS._nCfgDubbingVolume = 10; - GLOBALS._nCfgMusicVolume = 7; - GLOBALS._nCfgSFXVolume = 10; _bQuitNow = false; return Common::kNoError;