From a5984ddc7c12634babbd0e01510511028ca9e0b5 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 27 Sep 2020 12:52:26 +0200 Subject: [PATCH] - fixed sprite changing logic for developer commentaries and attenuate the music while commentaries are playing. --- source/games/duke/src/sectors_d.cpp | 4 ++-- source/games/duke/src/sounds.cpp | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/source/games/duke/src/sectors_d.cpp b/source/games/duke/src/sectors_d.cpp index 510b535ca86..2c9bc69b22f 100644 --- a/source/games/duke/src/sectors_d.cpp +++ b/source/games/duke/src/sectors_d.cpp @@ -267,8 +267,8 @@ bool checkhitswitch_d(int snum, int w, int switchtype) case DEVELOPERCOMMENTARY + 1: //Twentieth Anniversary World Tour if (switchtype == 1) { - sprite[w].picnum--; StopCommentary(); + sprite[w].picnum = DEVELOPERCOMMENTARY; return true; } return false; @@ -276,7 +276,7 @@ bool checkhitswitch_d(int snum, int w, int switchtype) if (switchtype == 1) { if (StartCommentary(lotag, w)) - sprite[w].picnum++; + sprite[w].picnum = DEVELOPERCOMMENTARY+1; return true; } return false; diff --git a/source/games/duke/src/sounds.cpp b/source/games/duke/src/sounds.cpp index c3198de2f51..986c7bc2e3b 100644 --- a/source/games/duke/src/sounds.cpp +++ b/source/games/duke/src/sounds.cpp @@ -43,6 +43,8 @@ source as it is released. #include "mapinfo.h" #include "raze_sound.h" #include "gamestate.h" +#include "names_d.h" +#include "i_music.h" CVAR(Bool, wt_forcemidi, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG) // quick hack to disable the oggs, which are of lower quality than playing the MIDIs with a good synth and sound font. CVAR(Bool, wt_forcevoc, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG) // The same for sound effects. The re-recordings are rather poor and disliked @@ -88,7 +90,8 @@ class DukeSoundEngine : public SoundEngine { UnloadSound(schan->SoundID); currentCommentarySound = 0; - sprite[currentCommentarySprite].picnum--; + sprite[currentCommentarySprite].picnum = DEVELOPERCOMMENTARY; + I_SetRelativeVolume(1.0f); } SoundEngine::SoundDone(schan); } @@ -831,6 +834,7 @@ bool StartCommentary(int tag, int sprnum) soundEngine->StartSound(SOURCE_None, nullptr, nullptr, CHAN_VOICE, CHANF_UI | CHANF_TRANSIENT | CHANF_OVERLAP, id, 1.f, 0.f); currentCommentarySound = id; currentCommentarySprite = sprnum; + I_SetRelativeVolume(0.25f); return true; } return false;