From 319b37bd7b42af88c1f721855587c955243891e6 Mon Sep 17 00:00:00 2001 From: Travis Howell Date: Wed, 23 Oct 2002 10:34:14 +0000 Subject: Add command line option for master volume, patch #591813 svn-id: r5280 --- common/gameDetector.cpp | 9 +++++++++ common/gameDetector.h | 1 + 2 files changed, 10 insertions(+) diff --git a/common/gameDetector.cpp b/common/gameDetector.cpp index ef46b8a2f6..8e759426d1 100644 --- a/common/gameDetector.cpp +++ b/common/gameDetector.cpp @@ -57,6 +57,7 @@ static const char USAGE_STRING[] = "\t-l - load config file instead of default\n" "\t-m - set music volume to (0-100)\n" "\t-n - no subtitles for speech\n" + "\t-o - set master volume to (0-255)\n" "\t-p - look for game in \n" "\t-s - set sfx volume to (0-255)\n" "\t-t - set music tempo (default- adlib: 0x1F0000, midi: 0x460000)\n" @@ -79,6 +80,7 @@ GameDetector::GameDetector() _use_adlib = false; + _master_volume = kDefaultMasterVolume; _music_volume = kDefaultMusicVolume; _sfx_volume = kDefaultSFXVolume; _amiga = false; @@ -150,6 +152,8 @@ void GameDetector::updateconfig() exit(-1); } + _master_volume = g_config->getInt("master_volume", _master_volume); + _music_volume = g_config->getInt("music_volume", _music_volume); _noSubtitles = g_config->getBool("nosubtitles", _noSubtitles ? true : false); @@ -271,6 +275,11 @@ void GameDetector::parseCommandLine(int argc, char **argv) _noSubtitles = (c == 'n'); g_config->setBool("nosubtitles", _noSubtitles ? true : false); break; + case 'o': + HANDLE_OPTION(); + _master_volume = atoi(option); + g_config->setInt("master_volume", _master_volume); + break; case 'p': HANDLE_OPTION(); _gameDataPath = option; diff --git a/common/gameDetector.h b/common/gameDetector.h index 0a58030c86..f40441ada1 100644 --- a/common/gameDetector.h +++ b/common/gameDetector.h @@ -58,6 +58,7 @@ public: int _music_volume; int _sfx_volume; + int _master_volume; bool _amiga; uint16 _talkSpeed; -- cgit v1.2.3