about summary refs log tree commit diff
path: root/src/GameInitDispose.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/GameInitDispose.cpp')
-rw-r--r--src/GameInitDispose.cpp21
1 files changed, 3 insertions, 18 deletions
diff --git a/src/GameInitDispose.cpp b/src/GameInitDispose.cpp
index 76721ee..23d3e67 100644
--- a/src/GameInitDispose.cpp
+++ b/src/GameInitDispose.cpp
@@ -134,6 +134,7 @@ void loadSounds(bool musictoggle)
 	alSourcei(gSourceID[explosionsound], AL_BUFFER, gSampleSet[explosionsound]);
 	alSourcei(gSourceID[bodywhacksound], AL_BUFFER, gSampleSet[bodywhacksound]);
 	alSourcei(gSourceID[rainsound], AL_BUFFER, gSampleSet[rainsound]);
+	alSourcei(gSourceID[rainsound], AL_LOOPING, 1);
 	alSourcei(gSourceID[losesound], AL_BUFFER, gSampleSet[losesound]);
 	alSourcei(gSourceID[disguisekillsound], AL_BUFFER, gSampleSet[disguisekillsound]);
 	alSourcei(gSourceID[knifeslashsound], AL_BUFFER, gSampleSet[knifeslashsound]);
@@ -307,24 +308,8 @@ void initGame(Game* game)
 	if (!game->initialized) {
 		soundscalefactor = 10;
 		loadSounds(game->musictoggle);
-
-		//Play correct song
-		if (environment == rainy_environment)
-			alSourcePlay(gSourceID[rainsound]);
-		else
-			alSourcePause(gSourceID[rainsound]);
-
-		ALuint sound_source = gSourceID[game->whichsong];
-		alSourceStop(sound_source);
-		alSourcef(sound_source, AL_MIN_GAIN, 0);
-		alSourcef(sound_source, AL_MAX_GAIN, 0);
-
-		sound_source = gSourceID[game->whichsong = mainmenusong];
-		alSourceStop(sound_source);
-		alSourcef(sound_source, AL_PITCH, 1);
-		alSourcePlay(sound_source);
-		alSourcef(sound_source, AL_MIN_GAIN, 1);
-		alSourcef(sound_source, AL_MAX_GAIN, 1);
+		if (game->musictoggle)
+			alSourcePlay(gSourceID[game->whichsong = mainmenusong]);
 	}
 
 	auto& vip = game->person[game->numpeople = 1];