[Scummvm-cvs-logs] CVS: scummvm sound.cpp,1.114,1.115 config-file.cpp,1.12,1.13 config-file.h,1.5,1.6 gameDetector.cpp,1.78,1.79

Max Horn fingolfin at users.sourceforge.net
Sat Jul 27 07:56:03 CEST 2002


Update of /cvsroot/scummvm/scummvm
In directory usw-pr-cvs1:/tmp/cvs-serv4453

Modified Files:
	sound.cpp config-file.cpp config-file.h gameDetector.cpp 
Log Message:
set default volume to 192/192/192 (now that we unified the volume ranges to 0-255)

Index: sound.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound.cpp,v
retrieving revision 1.114
retrieving revision 1.115
diff -u -d -r1.114 -r1.115
--- sound.cpp	27 Jul 2002 13:17:50 -0000	1.114
+++ sound.cpp	27 Jul 2002 14:55:40 -0000	1.115
@@ -585,24 +585,15 @@
 
 void Scumm::setupSound()
 {
-	IMuse *se = _imuse;
-	if (se) {
-		se->setBase(res.address[rtSound]);
-		if (!scummcfg->get("music_volume"))
-			_sound_volume_music = 60;
-		else
-			_sound_volume_music = atoi(scummcfg->get("music_volume"));
-		if (!scummcfg->get("master_volume"))
-			_sound_volume_master = 125;
-		else
-			_sound_volume_master = atoi(scummcfg->get("master_volume"));
-		if (!scummcfg->get("sfx_volume"))
-			_sound_volume_sfx = 100;
-		else
-			_sound_volume_sfx = atoi(scummcfg->get("sfx_volume"));
+	if (_imuse) {
+		_imuse->setBase(res.address[rtSound]);
 
-		se->set_master_volume(_sound_volume_master);
-		se->set_music_volume(_sound_volume_music);
+		_sound_volume_music = scummcfg->getInt("music_volume", 192);
+		_sound_volume_master = scummcfg->getInt("master_volume", 192);
+		_sound_volume_sfx = scummcfg->getInt("sfx_volume", 192);
+
+		_imuse->set_master_volume(_sound_volume_master);
+		_imuse->set_music_volume(_sound_volume_music);
 		_mixer->set_volume(_sound_volume_sfx);
 		_mixer->set_music_volume(_sound_volume_music);
 	}

Index: config-file.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/config-file.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- config-file.cpp	16 Jul 2002 21:03:14 -0000	1.12
+++ config-file.cpp	27 Jul 2002 14:55:40 -0000	1.13
@@ -232,6 +232,25 @@
 	return 0;
 }
 
+const int Config::getInt(const char *key, int def, const char *d) const
+{
+	int i;
+
+	if (!d)
+		d = domain;
+
+	for (i = 0; i < ndomains; i++) {
+		if (hash[i]->is_domain(d)) {
+			const char *val = hash[i]->get(key);
+			if (val)
+				return atoi(val);
+			break;
+		}
+	}
+
+	return def;
+}
+
 const char *Config::set(const char *key, const char *value, const char *d)
 {
 	int i;

Index: config-file.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/config-file.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- config-file.h	7 Jul 2002 19:31:51 -0000	1.5
+++ config-file.h	27 Jul 2002 14:55:40 -0000	1.6
@@ -29,9 +29,10 @@
 public:
 	Config (const char * = "config.cfg", const char * = "default");
 	 ~Config ();
-	const char *get(const char *, const char * = 0) const;
-	const char *set(const char *, const char *, const char * = 0);
-	const char *set(const char *, int, const char * = 0);
+	const char *get(const char *key, const char *dom = 0) const;
+	const int getInt(const char *key, int def = 0, const char *dom = 0) const;
+	const char *set(const char *key, const char *value, const char *dom = 0);
+	const char *set(const char *key, int value, const char *dom = 0);
 	void set_domain(const char *);
 	void flush() const;
 	void rename_domain(const char *);

Index: gameDetector.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gameDetector.cpp,v
retrieving revision 1.78
retrieving revision 1.79
diff -u -d -r1.78 -r1.79
--- gameDetector.cpp	25 Jul 2002 21:34:05 -0000	1.78
+++ gameDetector.cpp	27 Jul 2002 14:55:40 -0000	1.79
@@ -489,8 +489,8 @@
 #else
 	_gfx_mode = GFX_NORMAL;
 #endif
-	_sfx_volume = 100;
-	_music_volume = 60;
+	_sfx_volume = 192;
+	_music_volume = 192;
 
 #if defined(USE_NULL_DRIVER)
 	_gfx_driver = GD_NULL;





More information about the Scummvm-git-logs mailing list