Skip to content

Commit

Permalink
Hexen: Fixed missing pottery explode sound
Browse files Browse the repository at this point in the history
The pottery explode sound was using the pottery mobj
as origin, which meant that because the origin was
immediately destroyed, the sound was also stopped
right away.

The sf_dontstop flag prevents the sound from being
stopped in this situation.
  • Loading branch information
skyjake committed Jan 3, 2012
1 parent 15f3801 commit a01e999
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
10 changes: 7 additions & 3 deletions doomsday/engine/portable/src/s_sfx.c
Expand Up @@ -696,6 +696,9 @@ int Sfx_StartSound(sfxsample_t* sample, float volume, float freq,
* The new sound can't be played because we were unable to
* stop enough channels to accommodate the limitation.
*/
#ifdef _DEBUG
Con_Message("Sfx_StartSound: Not playing %i because channels are busy.\n", sample->id);
#endif
return false;
}

Expand Down Expand Up @@ -782,6 +785,9 @@ int Sfx_StartSound(sfxsample_t* sample, float volume, float freq,
if(!selCh)
{ // A suitable channel was not found.
END_COP;
#ifdef _DEBUG
Con_Message("Sfx_StartSound: Failed to find suitable channel for sample %i.\n", sample->id);
#endif
return false;
}

Expand All @@ -804,8 +810,7 @@ int Sfx_StartSound(sfxsample_t* sample, float volume, float freq,
selCh->buffer->flags |= SFXBF_DONT_STOP;

// Init the channel information.
selCh->flags &=
~(SFXCF_NO_ORIGIN | SFXCF_NO_ATTENUATION | SFXCF_NO_UPDATE);
selCh->flags &= ~(SFXCF_NO_ORIGIN | SFXCF_NO_ATTENUATION | SFXCF_NO_UPDATE);
selCh->volume = volume;
selCh->frequency = freq;
if(!emitter && !fixedPos)
Expand All @@ -825,7 +830,6 @@ int Sfx_StartSound(sfxsample_t* sample, float volume, float freq,
selCh->flags |= SFXCF_NO_ATTENUATION;
}


/**
* Load in the sample. Must load prior to setting properties, because
* the audioDriver might actually create the real buffer only upon loading.
Expand Down
4 changes: 2 additions & 2 deletions doomsday/engine/portable/src/sv_sound.c
Expand Up @@ -127,8 +127,8 @@ void Sv_SoundAtVolume(int soundIDAndFlags, mobj_t *origin, float volume,
}

#ifdef _DEBUG
VERBOSE( Con_Message("Sv_SoundAtVolume: Id=%i, vol=%g, targets=%x\n",
soundID, volume, targetPlayers) );
VERBOSE2( Con_Message("Sv_SoundAtVolume: Id=%i, vol=%g, targets=%x\n",
soundID, volume, targetPlayers) );
#endif

Sv_NewSoundDelta(soundID, origin, sector, poly, volume,
Expand Down
2 changes: 2 additions & 0 deletions doomsday/plugins/fmod/fmod.pro
Expand Up @@ -9,6 +9,8 @@ TARGET = dsfmod

VERSION = $$FMOD_VERSION

#DEFINES += DENG_DSFMOD_DEBUG

INCLUDEPATH += include

HEADERS += \
Expand Down
2 changes: 1 addition & 1 deletion doomsday/plugins/jhexen/defs/audio.ded
Expand Up @@ -744,7 +744,7 @@ Sound {
Name = "PotteryExplode";
Priority = 32;
Max channels = 2;
Flags = "sf_shift";
Flags = "sf_shift sf_dontstop";
}

Sound {
Expand Down

0 comments on commit a01e999

Please sign in to comment.