diff options
Diffstat (limited to 'engines/saga/saga.cpp')
-rw-r--r-- | engines/saga/saga.cpp | 52 |
1 files changed, 27 insertions, 25 deletions
diff --git a/engines/saga/saga.cpp b/engines/saga/saga.cpp index a2dbeebda2..34cd70e47e 100644 --- a/engines/saga/saga.cpp +++ b/engines/saga/saga.cpp @@ -64,6 +64,7 @@ SagaEngine::SagaEngine(OSystem *syst, const SAGAGameDescription *gameDesc) _leftMouseButtonPressed = _rightMouseButtonPressed = false; _console = NULL; + _quit = false; _resource = NULL; _sndRes = NULL; @@ -141,7 +142,8 @@ SagaEngine::~SagaEngine() { } int SagaEngine::init() { - _musicVolume = ConfMan.getInt("music_volume"); + _soundVolume = ConfMan.getInt("sfx_volume") / 25; + _musicVolume = ConfMan.getInt("music_volume") / 25; _subtitlesEnabled = ConfMan.getBool("subtitles"); _readingSpeed = getTalkspeed(); _copyProtection = ConfMan.getBool("copy_protection"); @@ -192,21 +194,29 @@ int SagaEngine::init() { if (native_mt32) _driver->property(MidiDriver::PROP_CHANNEL_MASK, 0x03FE); - _music = new Music(this, _mixer, _driver); + _music = new Music(this, _mixer, _driver, _musicVolume); _music->setNativeMT32(native_mt32); _music->setAdlib(adlib); + + if (!_musicVolume) { + debug(1, "Music disabled."); + } + _render = new Render(this, _system); if (!_render->initialized()) { return FAILURE; } // Initialize system specific sound - _sound = new Sound(this, _mixer); - + _sound = new Sound(this, _mixer, _soundVolume); + if (!_soundVolume) { + debug(1, "Sound disabled."); + } + _interface->converseInit(); _script->setVerb(_script->getVerbType(kVerbWalkTo)); - _music->setVolume(_musicVolume, 1); + _music->setVolume(-1, 1); _gfx->initPalette(); @@ -223,8 +233,6 @@ int SagaEngine::init() { } } - syncSoundSettings(); - // FIXME: This is the ugly way of reducing redraw overhead. It works // well for 320x200 but it's unclear how well it will work for // 640x480. @@ -247,15 +255,21 @@ int SagaEngine::go() { _interface->addToInventory(_actor->objIndexToId(0)); // Magic hat _scene->changeScene(ConfMan.getInt("boot_param"), 0, kTransitionNoFade); } else if (ConfMan.hasKey("save_slot")) { + // Init the current chapter to 8 (character selection) for IHNM + if (getGameType() == GType_IHNM) + _scene->changeScene(-2, 0, kTransitionFade, 8); + // First scene sets up palette _scene->changeScene(getStartSceneNumber(), 0, kTransitionNoFade); _events->handleEvents(0); // Process immediate events - _interface->setMode(kPanelMain); - char *fileName; - fileName = calcSaveFileName(ConfMan.getInt("save_slot")); + if (getGameType() != GType_IHNM) + _interface->setMode(kPanelMain); + else + _interface->setMode(kPanelChapterSelection); + + char *fileName = calcSaveFileName(ConfMan.getInt("save_slot")); load(fileName); - syncSoundSettings(); } else { _framesEsc = 0; _scene->startScene(); @@ -263,7 +277,7 @@ int SagaEngine::go() { uint32 currentTicks; - while (!quit()) { + while (!_quit) { if (_console->isAttached()) _console->onFrame(); @@ -303,7 +317,7 @@ int SagaEngine::go() { _system->delayMillis(10); } - return _eventMan->shouldRTL(); + return 0; } void SagaEngine::loadStrings(StringsTable &stringsTable, const byte *stringsPointer, size_t stringsLength) { @@ -513,16 +527,4 @@ int SagaEngine::getTalkspeed() { return (ConfMan.getInt("talkspeed") * 3 + 255 / 2) / 255; } -void SagaEngine::syncSoundSettings() { - _subtitlesEnabled = ConfMan.getBool("subtitles"); - _readingSpeed = getTalkspeed(); - - if (_readingSpeed > 3) - _readingSpeed = 0; - - _musicVolume = ConfMan.getInt("music_volume"); - _music->setVolume(_musicVolume, 1); - _sound->setVolume(); -} - } // End of namespace Saga |