about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Constants.h7
-rw-r--r--src/GameInitDispose.cpp22
-rw-r--r--src/Person.cpp4
3 files changed, 18 insertions, 15 deletions
diff --git a/src/Constants.h b/src/Constants.h
index 2009d5a..cfd784a 100644
--- a/src/Constants.h
+++ b/src/Constants.h
@@ -87,9 +87,10 @@
 #define disguisekillsound 30
 #define knifeslashsound 31
 #define shotgunsound 32
-#define mainmenusong 33
-#define assassinsong 34
-#define zombiesong 35
+#define munchsound 33
+#define mainmenusong 34
+#define assassinsong 35
+#define zombiesong 36
 
 #define sunny_environment 0
 #define foggy_environment 1
diff --git a/src/GameInitDispose.cpp b/src/GameInitDispose.cpp
index 145949d..b560b48 100644
--- a/src/GameInitDispose.cpp
+++ b/src/GameInitDispose.cpp
@@ -82,6 +82,13 @@ void loadSounds(bool musictoggle)
 	gSampleSet[bodyhitsound] = loadSound("impact/body-hit.wav");
 	gSampleSet[knifeslashsound] = loadSound("impact/knife-stab.wav");
 	gSampleSet[wallhitsound] = loadSound("impact/wall-hit.wav");
+	gSampleSet[munchsound] = loadSound("impact/munch.wav");
+	gSampleSet[rainsound] = loadSound("rain.ogg");
+	if (musictoggle) {
+		gSampleSet[mainmenusong] = loadSound("music/menu.opus");
+		gSampleSet[assassinsong] = loadSound("music/assassin.opus");
+		gSampleSet[zombiesong] = loadSound("music/zombie.opus");
+	}
 
 	gSampleSet[visionsound] = loadSound("underwater.ogg");
 	gSampleSet[soulinsound] = loadSound("soul-in.ogg");
@@ -94,16 +101,10 @@ void loadSounds(bool musictoggle)
 	gSampleSet[bounce2sound] = loadSound("bounce2.ogg");
 	gSampleSet[explosionsound] = loadSound("explosion.ogg");
 	gSampleSet[headlandsound] = loadSound("headland.ogg");
-	gSampleSet[rainsound] = loadSound("rain.ogg");
 	gSampleSet[losesound] = loadSound("Lose.ogg");
 	gSampleSet[disguisekillsound] = loadSound("disguise-kill.ogg");
-	if (musictoggle) {
-		gSampleSet[mainmenusong] = loadSound("music/menu.opus");
-		gSampleSet[assassinsong] = loadSound("music/assassin.opus");
-		gSampleSet[zombiesong] = loadSound("music/zombie.opus");
-	}
 
-	alGenSources(33, gSourceID);
+	alGenSources(34, gSourceID);
 	alSourcei(gSourceID[visionsound], AL_BUFFER, gSampleSet[visionsound]);
 	alSourcei(gSourceID[soulinsound], AL_BUFFER, gSampleSet[soulinsound]);
 	alSourcei(gSourceID[souloutsound], AL_BUFFER, gSampleSet[souloutsound]);
@@ -132,6 +133,7 @@ void loadSounds(bool musictoggle)
 	alSourcei(gSourceID[bounce2sound], AL_BUFFER, gSampleSet[bounce2sound]);
 	alSourcei(gSourceID[explosionsound], AL_BUFFER, gSampleSet[explosionsound]);
 	alSourcei(gSourceID[bodywhacksound], AL_BUFFER, gSampleSet[bodywhacksound]);
+	alSourcei(gSourceID[munchsound], AL_BUFFER, gSampleSet[munchsound]);
 	alSourcei(gSourceID[rainsound], AL_BUFFER, gSampleSet[rainsound]);
 	alSourcei(gSourceID[rainsound], AL_LOOPING, 1);
 	alSourcei(gSourceID[losesound], AL_BUFFER, gSampleSet[losesound]);
@@ -139,7 +141,7 @@ void loadSounds(bool musictoggle)
 	alSourcei(gSourceID[knifeslashsound], AL_BUFFER, gSampleSet[knifeslashsound]);
 	alSourcei(gSourceID[shotgunsound], AL_BUFFER, gSampleSet[shotgunsound]);
 	if (musictoggle) {
-		alGenSources(4, gSourceID + 33);
+		alGenSources(3, gSourceID + 34);
 		alSourcei(gSourceID[mainmenusong], AL_BUFFER, gSampleSet[mainmenusong]);
 		alSourcei(gSourceID[mainmenusong], AL_LOOPING, 1);
 		alSourcei(gSourceID[assassinsong], AL_BUFFER, gSampleSet[assassinsong]);
@@ -795,8 +797,8 @@ void closeGame(Game* game)
 		game->flaretextureptr,
 	};
 	glDeleteTextures(5, textures);
-	alDeleteSources(33 + game->musictoggle * 4, gSourceID);
-	alDeleteBuffers(33 + game->musictoggle * 4, gSampleSet);
+	alDeleteSources(34 + game->musictoggle * 3, gSourceID);
+	alDeleteBuffers(34 + game->musictoggle * 3, gSampleSet);
 	destroyModels(game);
 	destroyDecals(&decals);
 }
diff --git a/src/Person.cpp b/src/Person.cpp
index aa99852..fc47b81 100644
--- a/src/Person.cpp
+++ b/src/Person.cpp
@@ -218,7 +218,7 @@ void Person::DoAnimations(int who)
 			auto soundsrc = (rotate(head_joint.position,
 				0, playerrotation, 0) + playercoords
 				- camera.position) / soundscalefactor;
-			playSound(gSourceID[bodyhitsound],
+			playSound(gSourceID[munchsound],
 				soundsrc.x, soundsrc.y, soundsrc.z);
 			bleeding = 1;
 			bleeddelay = 1;
@@ -561,7 +561,7 @@ void Person::DoAnimationslite(int who)
 			auto soundsrc = (rotate(head_joint.position,
 				0, playerrotation, 0) + playercoords
 				- camera.position) / soundscalefactor;
-			playSound(gSourceID[bodyhitsound],
+			playSound(gSourceID[munchsound],
 				soundsrc.x, soundsrc.y, soundsrc.z);
 			bleeding = 1;
 			bleeddelay = 1;