diff options
author | Paul Gilbert | 2012-06-17 17:04:10 +1000 |
---|---|---|
committer | Paul Gilbert | 2012-06-17 17:04:10 +1000 |
commit | 9405f9eb4aed1d4c248e57ab4972b0132b2253f5 (patch) | |
tree | 2eec56fa61f45cf4a724b0b8d5974c4be462b27c /engines/tony | |
parent | b554063d3018a39f328f0cd818b03546918c60d6 (diff) | |
download | scummvm-rg350-9405f9eb4aed1d4c248e57ab4972b0132b2253f5.tar.gz scummvm-rg350-9405f9eb4aed1d4c248e57ab4972b0132b2253f5.tar.bz2 scummvm-rg350-9405f9eb4aed1d4c248e57ab4972b0132b2253f5.zip |
TONY: Added code to load and save the ScummVM sound settings
Diffstat (limited to 'engines/tony')
-rw-r--r-- | engines/tony/font.cpp | 2 | ||||
-rw-r--r-- | engines/tony/game.cpp | 7 | ||||
-rw-r--r-- | engines/tony/gfxengine.cpp | 4 | ||||
-rw-r--r-- | engines/tony/globals.cpp | 2 | ||||
-rw-r--r-- | engines/tony/globals.h | 2 | ||||
-rw-r--r-- | engines/tony/tony.cpp | 32 | ||||
-rw-r--r-- | engines/tony/tony.h | 3 |
7 files changed, 45 insertions, 7 deletions
diff --git a/engines/tony/font.cpp b/engines/tony/font.cpp index a567fe20cd..af6f5d687c 100644 --- a/engines/tony/font.cpp +++ b/engines/tony/font.cpp @@ -2144,7 +2144,7 @@ void RMTextDialog::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *p _startTime = _vm->getTime(); if (_bShowed) { - if (GLOBALS._bCfgSottotitoli || _bAlwaysDisplay) { + if (GLOBALS._bShowSubtitles || _bAlwaysDisplay) { prim->getDst().topLeft() = _dst; CORO_INVOKE_2(RMText::draw, bigBuf, prim); } diff --git a/engines/tony/game.cpp b/engines/tony/game.cpp index 2e7297cac3..7b2834a8fa 100644 --- a/engines/tony/game.cpp +++ b/engines/tony/game.cpp @@ -700,7 +700,7 @@ void RMOptionScreen::initState(CORO_PARAM) { _buttonGfx_AntiAlias->setActiveState(!GLOBALS._bCfgAntiAlias); assert(_buttonGfx_Sottotitoli == NULL); _buttonGfx_Sottotitoli = new RMOptionButton(20017, RMPoint(98, 82), true); - _buttonGfx_Sottotitoli->setActiveState(!GLOBALS._bCfgSottotitoli); + _buttonGfx_Sottotitoli->setActiveState(!GLOBALS._bShowSubtitles); assert(_buttonGfx_Tips == NULL); _buttonGfx_Tips = new RMOptionButton(20018, RMPoint(431, 246), true); _buttonGfx_Tips->setActiveState(GLOBALS._bCfgInterTips); @@ -822,7 +822,7 @@ void RMOptionScreen::closeState(void) { delete _buttonGfx_AntiAlias; _buttonGfx_AntiAlias = NULL; - GLOBALS._bCfgSottotitoli = !_buttonGfx_Sottotitoli->isActive(); + GLOBALS._bShowSubtitles = !_buttonGfx_Sottotitoli->isActive(); delete _buttonGfx_Sottotitoli; _buttonGfx_Sottotitoli = NULL; @@ -858,6 +858,9 @@ void RMOptionScreen::closeState(void) { delete _buttonSound_SFXOn; _buttonSound_SFXOn = NULL; } + + // Save the new settings to ScummVM + _vm->saveSoundSettings(); } _nState = MENUNONE; diff --git a/engines/tony/gfxengine.cpp b/engines/tony/gfxengine.cpp index deae0cb641..9dab3eeb52 100644 --- a/engines/tony/gfxengine.cpp +++ b/engines/tony/gfxengine.cpp @@ -659,7 +659,7 @@ void RMGfxEngine::saveState(const Common::String &fn, byte *curThumb, const Comm f->writeByte(GLOBALS._bCfgInvUp); f->writeByte(GLOBALS._bCfgAnni30); f->writeByte(GLOBALS._bCfgAntiAlias); - f->writeByte(GLOBALS._bCfgSottotitoli); + f->writeByte(GLOBALS._bShowSubtitles); f->writeByte(GLOBALS._bCfgTransparence); f->writeByte(GLOBALS._bCfgInterTips); f->writeByte(GLOBALS._bCfgDubbing); @@ -795,7 +795,7 @@ void RMGfxEngine::loadState(CORO_PARAM, const Common::String &fn) { GLOBALS._bCfgInvUp = _ctx->f->readByte(); GLOBALS._bCfgAnni30 = _ctx->f->readByte(); GLOBALS._bCfgAntiAlias = _ctx->f->readByte(); - GLOBALS._bCfgSottotitoli = _ctx->f->readByte(); + GLOBALS._bShowSubtitles = _ctx->f->readByte(); GLOBALS._bCfgTransparence = _ctx->f->readByte(); GLOBALS._bCfgInterTips = _ctx->f->readByte(); GLOBALS._bCfgDubbing = _ctx->f->readByte(); diff --git a/engines/tony/globals.cpp b/engines/tony/globals.cpp index 3042b5843a..48b04007b4 100644 --- a/engines/tony/globals.cpp +++ b/engines/tony/globals.cpp @@ -135,7 +135,7 @@ Globals::Globals() { _bCfgAntiAlias = false; _bCfgTransparence = true; _bCfgInterTips = true; - _bCfgSottotitoli = true; + _bShowSubtitles = true; _nCfgTonySpeed = 3; _nCfgTextSpeed = 5; _bCfgDubbing = true; diff --git a/engines/tony/globals.h b/engines/tony/globals.h index 098a98025e..cf231018a6 100644 --- a/engines/tony/globals.h +++ b/engines/tony/globals.h @@ -194,7 +194,7 @@ public: bool _bCfgInvUp; bool _bCfgAnni30; bool _bCfgAntiAlias; - bool _bCfgSottotitoli; + bool _bShowSubtitles; bool _bCfgTransparence; bool _bCfgInterTips; bool _bCfgDubbing; diff --git a/engines/tony/tony.cpp b/engines/tony/tony.cpp index 91204763b3..654a3f8222 100644 --- a/engines/tony/tony.cpp +++ b/engines/tony/tony.cpp @@ -42,6 +42,7 @@ TonyEngine::TonyEngine(OSystem *syst, const TonyGameDescription *gameDesc) : Eng _vm = this; _loadSlotNumber = -1; + // Set the up the debugger _debugger = new Debugger(); DebugMan.addDebugChannel(kTonyDebugAnimations, "animations", "Animations debugging"); DebugMan.addDebugChannel(kTonyDebugActions, "actions", "Actions debugging"); @@ -62,6 +63,9 @@ TonyEngine::TonyEngine(OSystem *syst, const TonyGameDescription *gameDesc) : Eng _initialLoadSlotNumber = slotNumber; } + // Load the ScummVM sound settings + syncSoundSettings(); + _hEndOfFrame = 0; for (int i = 0; i < 6; i++) _stream[i] = NULL; @@ -627,4 +631,32 @@ Common::Error TonyEngine::saveGameState(int slot, const Common::String &desc) { return Common::kNoError; } +void TonyEngine::syncSoundSettings() { + Engine::syncSoundSettings(); + + GLOBALS._bCfgDubbing = !ConfMan.getBool("mute") && !ConfMan.getBool("speech_mute"); + GLOBALS._bCfgSFX = !ConfMan.getBool("mute") && !ConfMan.getBool("sfx_mute"); + GLOBALS._bCfgMusic = !ConfMan.getBool("mute") && !ConfMan.getBool("music_mute"); + + GLOBALS._nCfgDubbingVolume = ConfMan.getInt("speech_volume") * 10 / 256; + GLOBALS._nCfgSFXVolume = ConfMan.getInt("sfx_volume") * 10 / 256; + GLOBALS._nCfgMusicVolume = ConfMan.getInt("music_volume") * 10 / 256; + + GLOBALS._bShowSubtitles = ConfMan.getBool("subtitles"); + GLOBALS._nCfgTextSpeed = ConfMan.getInt("talkspeed") * 10 / 256; +} + +void TonyEngine::saveSoundSettings() { + ConfMan.setBool("speech_mute", GLOBALS._bCfgDubbing); + ConfMan.setBool("sfx_mute", GLOBALS._bCfgSFX); + ConfMan.setBool("music_mute", GLOBALS._bCfgMusic); + + ConfMan.setInt("speech_volume", GLOBALS._nCfgDubbingVolume * 256 / 10); + ConfMan.setInt("sfx_volume", GLOBALS._nCfgSFXVolume * 256 / 10); + ConfMan.setInt("music_volume", GLOBALS._nCfgMusicVolume * 256 / 10); + + ConfMan.setBool("subtitles", GLOBALS._bShowSubtitles); + ConfMan.setBool("talkspeed", GLOBALS._nCfgTextSpeed); +} + } // End of namespace Tony diff --git a/engines/tony/tony.h b/engines/tony/tony.h index 93232b950d..709465ca89 100644 --- a/engines/tony/tony.h +++ b/engines/tony/tony.h @@ -221,6 +221,9 @@ public: void openInitLoadMenu(CORO_PARAM); void openInitOptions(CORO_PARAM); + + virtual void syncSoundSettings(); + void saveSoundSettings(); }; // Global reference to the TonyEngine object |