Skip to content

Commit

Permalink
- fixed sprite changing logic for developer commentaries and attenuat…
Browse files Browse the repository at this point in the history
…e the music while commentaries are playing.
  • Loading branch information
coelckers committed Sep 27, 2020
1 parent 392c9ec commit a5984dd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions source/games/duke/src/sectors_d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -267,16 +267,16 @@ 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;
case DEVELOPERCOMMENTARY: //Twentieth Anniversary World Tour
if (switchtype == 1)
{
if (StartCommentary(lotag, w))
sprite[w].picnum++;
sprite[w].picnum = DEVELOPERCOMMENTARY+1;
return true;
}
return false;
Expand Down
6 changes: 5 additions & 1 deletion source/games/duke/src/sounds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit a5984dd

Please sign in to comment.