From ca740ad709d9f0b69f9dd670ffec2e6e982e5c16 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 10 Aug 2020 20:59:04 +0200 Subject: [PATCH] - increase volume for summary screen's speeches in Duke. Fixes #125 --- source/games/duke/src/2d_d.cpp | 2 +- source/games/duke/src/sounds.cpp | 4 ++-- source/games/duke/src/sounds.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/source/games/duke/src/2d_d.cpp b/source/games/duke/src/2d_d.cpp index aaf2de654..174375b87 100644 --- a/source/games/duke/src/2d_d.cpp +++ b/source/games/duke/src/2d_d.cpp @@ -906,7 +906,7 @@ public: bonuscnt++; S_PlaySound(SHOTGUN_COCK, CHAN_AUTO, CHANF_UI); static const uint16_t speeches[] = { BONUS_SPEECH1, BONUS_SPEECH2, BONUS_SPEECH3, BONUS_SPEECH4}; - S_PlaySound(speeches[(rand() & 3)], CHAN_AUTO, CHANF_UI); + S_PlaySound(speeches[(rand() & 3)], CHAN_AUTO, CHANF_UI, 1); } case 1: case 4: diff --git a/source/games/duke/src/sounds.cpp b/source/games/duke/src/sounds.cpp index ca58426b7..76740b076 100644 --- a/source/games/duke/src/sounds.cpp +++ b/source/games/duke/src/sounds.cpp @@ -455,7 +455,7 @@ int S_PlaySound3D(int sndnum, int spriteNum, const vec3_t* pos, int channel, ECh // //========================================================================== -int S_PlaySound(int sndnum, int channel, EChanFlags flags) +int S_PlaySound(int sndnum, int channel, EChanFlags flags, float vol) { if (!soundEngine->isValidSoundId(sndnum+1) || !SoundEnabled()) return -1; @@ -466,7 +466,7 @@ int S_PlaySound(int sndnum, int channel, EChanFlags flags) int const pitch = S_GetPitch(sndnum); if (userflags & SF_LOOP) flags |= CHANF_LOOP; - auto chan = soundEngine->StartSound(SOURCE_None, nullptr, nullptr, channel, flags, sndnum + 1, 0.8f, ATTN_NONE, nullptr, S_ConvertPitch(pitch)); + auto chan = soundEngine->StartSound(SOURCE_None, nullptr, nullptr, channel, flags, sndnum + 1, vol, ATTN_NONE, nullptr, S_ConvertPitch(pitch)); return chan ? 0 : -1; } diff --git a/source/games/duke/src/sounds.h b/source/games/duke/src/sounds.h index 99f94bf25..2412d73f0 100644 --- a/source/games/duke/src/sounds.h +++ b/source/games/duke/src/sounds.h @@ -40,7 +40,7 @@ void S_Update(void); void S_CacheAllSounds(void); int S_DefineSound(unsigned index, const char* filename, int ps, int pe, int pr, int m, int vo, float vol); -int S_PlaySound(int num, int channel = CHAN_AUTO, EChanFlags flags = 0); +int S_PlaySound(int num, int channel = CHAN_AUTO, EChanFlags flags = 0, float vol =0.8f); int S_PlaySound3D(int num, int spriteNum, const vec3_t* pos, int channel = CHAN_AUTO, EChanFlags flags = 0); int S_PlayActorSound(int soundNum, int spriteNum, int channel = CHAN_AUTO, EChanFlags flags = 0); void S_MenuSound(void);