Skip to content

Commit

Permalink
libcommon: Employ the enhanced S_StopSound2() in S_SectorStopSounds()
Browse files Browse the repository at this point in the history
Switched sector sound stopping to use the sector origin chains on
engine side.

Let us see how this goes with tomorrow's build #479 before we switch
over to using sidedef sound origins for switches.
  • Loading branch information
danij-deng committed Apr 22, 2012
1 parent 3b49c2d commit e5dbd90
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
5 changes: 4 additions & 1 deletion doomsday/engine/api/doomsday.h
Expand Up @@ -701,7 +701,10 @@ int S_StartSound(int soundId, struct mobj_s* origin);
int S_StartSoundEx(int soundId, struct mobj_s* origin);
int S_StartSoundAtVolume(int soundID, struct mobj_s* origin, float volume);
int S_ConsoleSound(int soundID, struct mobj_s* origin, int targetConsole);
void S_StopSound(int soundID, struct mobj_s* origin);

void S_StopSound2(int soundID, struct mobj_s* origin, int flags);
void S_StopSound(int soundID, struct mobj_s* origin/*,flags=0*/);

int S_IsPlaying(int soundID, struct mobj_s* origin);
int S_StartMusic(const char* musicID, boolean looped);
int S_StartMusicNum(int id, boolean looped);
Expand Down
2 changes: 1 addition & 1 deletion doomsday/plugins/common/src/d_net.c
Expand Up @@ -394,7 +394,7 @@ int D_NetWorldEvent(int type, int parm, void* data)
if(parm & 0xffff)
S_SectorSound(P_ToPtr(DMU_SECTOR, parm >> 16), parm & 0xffff);
else
S_StopSound(0, (mobj_t*) P_GetPtr(DMU_SECTOR, parm >> 16, DMU_BASE));
S_SectorStopSounds(P_ToPtr(DMU_SECTOR, parm >> 16));

break;

Expand Down
5 changes: 1 addition & 4 deletions doomsday/plugins/common/src/p_sound.c
Expand Up @@ -75,12 +75,9 @@ void S_SectorStopSounds(Sector* sec)
{
if(!sec) return;

S_StopSound(0, (mobj_t*) P_GetPtrp(sec, DMU_BASE));

// Stop other sounds playing from origins in this sector.
/// @todo Add a compatibility option allowing origins to work independently?
S_StopSound(0, (mobj_t*) P_GetPtrp(sec, DMU_FLOOR_BASE));
S_StopSound(0, (mobj_t*) P_GetPtrp(sec, DMU_CEILING_BASE));
S_StopSound2(0, (mobj_t*) P_GetPtrp(sec, DMU_BASE), SSF_ALL_SECTOR);
}

void S_PlaneSound(Plane* pln, int id)
Expand Down

0 comments on commit e5dbd90

Please sign in to comment.