- Global options dialog support

svn-id: r34981
This commit is contained in:
Benjamin Haisch 2008-11-10 00:19:43 +00:00
parent 03a0046b1c
commit 8709acb6de
2 changed files with 11 additions and 12 deletions

View File

@ -66,10 +66,6 @@ static const GameSettings madeSettings[] = {
MadeEngine::MadeEngine(OSystem *syst, const MadeGameDescription *gameDesc) : Engine(syst), _gameDescription(gameDesc) {
// Setup mixer
_mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, ConfMan.getInt("sfx_volume"));
_mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, ConfMan.getInt("music_volume"));
const GameSettings *g;
const char *gameid = ConfMan.get("gameid").c_str();
@ -110,12 +106,6 @@ MadeEngine::MadeEngine(OSystem *syst, const MadeGameDescription *gameDesc) : Eng
_music->setNativeMT32(native_mt32);
//_music->setAdlib(adlib);
_musicVolume = ConfMan.getInt("music_volume");
if (!_musicVolume) {
debug(1, "Music disabled.");
}
// Set default sound frequency
// Return to Zork sets it itself via a script funtion
if (getGameID() == GID_MANHOLE || getGameID() == GID_RODNEY) {
@ -124,6 +114,8 @@ MadeEngine::MadeEngine(OSystem *syst, const MadeGameDescription *gameDesc) : Eng
_soundRate = 8000;
}
syncSoundSettings();
}
MadeEngine::~MadeEngine() {
@ -146,6 +138,14 @@ Common::Error MadeEngine::init() {
return Common::kNoError;
}
void MadeEngine::syncSoundSettings() {
_music->setVolume(ConfMan.getInt("music_volume"));
_mixer->setVolumeForSoundType(Audio::Mixer::kPlainSoundType, ConfMan.getInt("sfx_volume"));
_mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, ConfMan.getInt("sfx_volume"));
_mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, ConfMan.getInt("speech_volume"));
_mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, ConfMan.getInt("music_volume"));
}
int16 MadeEngine::getTicks() {
return g_system->getMillis() * 30 / 1000;
}

View File

@ -87,6 +87,7 @@ public:
virtual ~MadeEngine();
virtual bool hasFeature(EngineFeature f) const;
virtual void syncSoundSettings();
int getGameId() {
return _gameId;
@ -115,8 +116,6 @@ public:
int _soundRate;
bool _autoStopSound;
int _musicVolume;
// 2 = LGOP2, Manhole N&E
// 3 = Return to Zork
int _engineVersion;