From 1d51903a9e6329dcf317158702cead102ad44df6 Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Sat, 1 Jan 2022 08:36:56 +1100 Subject: [PATCH] - SW: Eliminated `Voc3D_Flags` typedef. --- source/games/sw/src/game.h | 10 +++++----- source/games/sw/src/sounds.cpp | 6 +++--- source/games/sw/src/sounds.h | 5 ++--- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/source/games/sw/src/game.h b/source/games/sw/src/game.h index 6a03e926a..b4985f0c8 100644 --- a/source/games/sw/src/game.h +++ b/source/games/sw/src/game.h @@ -1613,18 +1613,18 @@ enum short SoundDist(int x, int y, int z, int basedist); short SoundAngle(int x, int y); //void PlaySound(int num, short angle, short vol); -int _PlaySound(int num, DSWActor* sprite, PLAYER* player, vec3_t *pos, Voc3D_Flags flags, int channel, EChanFlags sndflags); +int _PlaySound(int num, DSWActor* sprite, PLAYER* player, vec3_t *pos, int flags, int channel, EChanFlags sndflags); void InitAmbient(int num, DSWActor* actor); -inline void PlaySound(int num, PLAYER* player, Voc3D_Flags flags, int channel = 8, EChanFlags sndflags = CHANF_NONE) +inline void PlaySound(int num, PLAYER* player, int flags, int channel = 8, EChanFlags sndflags = CHANF_NONE) { _PlaySound(num, nullptr, player, nullptr, flags, channel, sndflags); } -inline void PlaySound(int num, Voc3D_Flags flags, int channel = 8, EChanFlags sndflags = CHANF_NONE) +inline void PlaySound(int num, int flags, int channel = 8, EChanFlags sndflags = CHANF_NONE) { _PlaySound(num, nullptr, nullptr, nullptr, flags, channel, sndflags); } -inline void PlaySound(int num, vec3_t *pos, Voc3D_Flags flags, int channel = 8, EChanFlags sndflags = CHANF_NONE) +inline void PlaySound(int num, vec3_t *pos, int flags, int channel = 8, EChanFlags sndflags = CHANF_NONE) { _PlaySound(num, nullptr, nullptr, pos, flags, channel, sndflags); } @@ -2102,7 +2102,7 @@ inline bool PLAYER_MOVING(PLAYER* pp) return (pp->vect.X | pp->vect.Y); } -inline void PlaySound(int num, DSWActor* actor, Voc3D_Flags flags, int channel = 8, EChanFlags sndflags = CHANF_NONE) +inline void PlaySound(int num, DSWActor* actor, int flags, int channel = 8, EChanFlags sndflags = CHANF_NONE) { _PlaySound(num, actor, nullptr, nullptr, flags, channel, sndflags); } diff --git a/source/games/sw/src/sounds.cpp b/source/games/sw/src/sounds.cpp index aaeee0823..23a4bd4bd 100644 --- a/source/games/sw/src/sounds.cpp +++ b/source/games/sw/src/sounds.cpp @@ -627,7 +627,7 @@ void GameInterface::UpdateSounds(void) // //========================================================================== -int _PlaySound(int num, DSWActor* actor, PLAYER* pp, vec3_t* pos, Voc3D_Flags flags, int channel, EChanFlags cflags) +int _PlaySound(int num, DSWActor* actor, PLAYER* pp, vec3_t* pos, int flags, int channel, EChanFlags cflags) { if (Prediction || !SoundEnabled() || !soundEngine->isValidSoundId(num)) return -1; @@ -771,7 +771,7 @@ void Terminate3DSounds(void) // //========================================================================== -void PlaySpriteSound(DSWActor* actor, int attrib_ndx, Voc3D_Flags flags) +void PlaySpriteSound(DSWActor* actor, int attrib_ndx, int flags) { if (actor->hasU()) PlaySound(actor->user.Attrib->Sounds[attrib_ndx], actor, flags); @@ -979,7 +979,7 @@ DEFINE_ACTION_FUNCTION(_SW, PlaySound) PARAM_INT(vflags); PARAM_INT(channel); PARAM_INT(cflags); - PlaySound(sound, Voc3D_Flags(vflags), channel, EChanFlags::FromInt(cflags)); + PlaySound(sound, vflags, channel, EChanFlags::FromInt(cflags)); return 0; } diff --git a/source/games/sw/src/sounds.h b/source/games/sw/src/sounds.h index d62dca896..9efb1792e 100644 --- a/source/games/sw/src/sounds.h +++ b/source/games/sw/src/sounds.h @@ -58,7 +58,6 @@ enum // This is mainly used for intermittent sounds v3df_nolookup = 128, // don't use ambient table lookup }; -typedef int Voc3D_Flags; struct VOCstruct; @@ -66,7 +65,7 @@ void Terminate3DSounds(void); class DSWActor; -void PlaySpriteSound(DSWActor* actor, int attrib_ndx, Voc3D_Flags flags); +void PlaySpriteSound(DSWActor* actor, int attrib_ndx, int flags); void DeleteNoSoundOwner(DSWActor* actor); void DeleteNoFollowSoundOwner(DSWActor*); @@ -86,7 +85,7 @@ struct AMB_INFO { int16_t name; int16_t diginame; - Voc3D_Flags ambient_flags; + int ambient_flags; int maxtics; // When tics reaches this number next // sound happens };