[Scummvm-cvs-logs] CVS: scummvm/simon simon.cpp,1.48,1.49

Max Horn fingolfin at users.sourceforge.net
Sun Aug 18 11:16:01 CEST 2002


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

Modified Files:
	simon.cpp 
Log Message:
fixed simon crasher

Index: simon.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/simon.cpp,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -d -r1.48 -r1.49
--- simon.cpp	18 Aug 2002 17:48:18 -0000	1.48
+++ simon.cpp	18 Aug 2002 18:15:15 -0000	1.49
@@ -126,8 +126,13 @@
 	midi.set_driver(driver);
 
 	_game = detector->_gameId;
-	set_volume(detector->_sfx_volume);
 	_game_path = detector->_gameDataPath;
+
+	/* Setup mixer */
+	if (!_mixer->bind_to_system(syst))
+		warning("Sound initialization failed. "
+						"Features of the game that depend on sound synchronization will most likely break");
+	set_volume(detector->_sfx_volume);
 }
 
 SimonState::~SimonState()
@@ -141,15 +146,7 @@
 
 SimonState *SimonState::createFromDetector(GameDetector *detector, OSystem *syst)
 {
-	SimonState *s = new SimonState(detector, syst);
-
-	/* Setup mixer */
-	if (!s->_mixer->bind_to_system(syst))
-		warning("Sound initialization failed. "
-						"Features of the game that depend on sound synchronization will most likely break");
-
-	return s;
-
+	return new SimonState(detector, syst);
 }
 
 void palette_fadeout(uint32 *pal_values, uint num)
@@ -4948,7 +4945,7 @@
 
 void SimonState::set_volume(byte volume)
 {
-	_mixer->set_volume(volume * 256 / 100);
+	_mixer->set_volume(volume);
 }
 
 





More information about the Scummvm-git-logs mailing list