From 75c76ccf66bd1bc6684a87bffc4a391c1c61eb74 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 18 Dec 2019 11:09:01 +0100 Subject: [PATCH] - changed SW's PlaySound interface to take pointers to objects instead of pointers to coordinates. With pointers to coordinates the sound engine cannot work, so this had to be changed globally. --- source/blood/src/sfx.cpp | 4 +- source/common/sound/s_sound.cpp | 4 +- source/common/sound/s_soundinternal.h | 2 +- source/duke3d/src/sounds.cpp | 4 +- source/rr/src/sounds.cpp | 4 +- source/sw/src/actor.cpp | 6 +- source/sw/src/anim.cpp | 56 +- source/sw/src/bunny.cpp | 14 +- source/sw/src/cache.cpp | 2 + source/sw/src/cheats.cpp | 4 +- source/sw/src/coolg.cpp | 4 +- source/sw/src/coolie.cpp | 2 +- source/sw/src/d_menu.cpp | 18 +- source/sw/src/game.cpp | 10 +- source/sw/src/game.h | 27 +- source/sw/src/hornet.cpp | 2 +- source/sw/src/inv.cpp | 22 +- source/sw/src/jsector.cpp | 16 +- source/sw/src/jweapon.cpp | 74 +- source/sw/src/miscactr.cpp | 112 +-- source/sw/src/network.cpp | 2 +- source/sw/src/ninja.cpp | 4 +- source/sw/src/panel.cpp | 109 +-- source/sw/src/player.cpp | 62 +- source/sw/src/quake.cpp | 2 +- source/sw/src/ripper2.cpp | 4 +- source/sw/src/save.cpp | 3 - source/sw/src/sector.cpp | 89 +- source/sw/src/skull.cpp | 4 +- source/sw/src/sounds.cpp | 1203 ++++++++++--------------- source/sw/src/sounds.h | 5 +- source/sw/src/sprite.cpp | 98 +- source/sw/src/sumo.cpp | 8 +- source/sw/src/weapon.cpp | 418 +++++---- source/sw/src/zilla.cpp | 10 +- 35 files changed, 1076 insertions(+), 1332 deletions(-) diff --git a/source/blood/src/sfx.cpp b/source/blood/src/sfx.cpp index c66365ed5..21eb4bb69 100644 --- a/source/blood/src/sfx.cpp +++ b/source/blood/src/sfx.cpp @@ -42,7 +42,7 @@ BEGIN_BLD_NS class BloodSoundEngine : public SoundEngine { // client specific parts of the sound engine go in this class. - void CalcPosVel(int type, const void* source, const float pt[3], int channum, int chanflags, FSoundID chanSound, FVector3* pos, FVector3* vel) override; + void CalcPosVel(int type, const void* source, const float pt[3], int channum, int chanflags, FSoundID chanSound, FVector3* pos, FVector3* vel, FSoundChan *channel) override; TArray ReadSound(int lumpnum); public: @@ -75,7 +75,7 @@ TArray BloodSoundEngine::ReadSound(int lumpnum) return wlump.Read(); } -void BloodSoundEngine::CalcPosVel(int type, const void* source, const float pt[3], int channum, int chanflags, FSoundID chanSound, FVector3* pos, FVector3* vel) +void BloodSoundEngine::CalcPosVel(int type, const void* source, const float pt[3], int channum, int chanflags, FSoundID chanSound, FVector3* pos, FVector3* vel, FSoundChan *) { if (pos != nullptr && type != SOURCE_None) { diff --git a/source/common/sound/s_sound.cpp b/source/common/sound/s_sound.cpp index a0a5627a1..c9b011d40 100644 --- a/source/common/sound/s_sound.cpp +++ b/source/common/sound/s_sound.cpp @@ -335,7 +335,7 @@ FString SoundEngine::ListSoundChannels() void SoundEngine::CalcPosVel(FSoundChan *chan, FVector3 *pos, FVector3 *vel) { - CalcPosVel(chan->SourceType, chan->Source, chan->Point, chan->EntChannel, chan->ChanFlags, chan->OrgID, pos, vel); + CalcPosVel(chan->SourceType, chan->Source, chan->Point, chan->EntChannel, chan->ChanFlags, chan->OrgID, pos, vel, chan); } bool SoundEngine::ValidatePosVel(const FSoundChan* const chan, const FVector3& pos, const FVector3& vel) @@ -397,7 +397,7 @@ FSoundChan *SoundEngine::StartSound(int type, const void *source, org_id = sound_id; - CalcPosVel(type, source, &pt->X, channel, chanflags, sound_id, &pos, &vel); + CalcPosVel(type, source, &pt->X, channel, chanflags, sound_id, &pos, &vel, nullptr); if (!ValidatePosVel(type, source, pos, vel)) { diff --git a/source/common/sound/s_soundinternal.h b/source/common/sound/s_soundinternal.h index 0a4afa05b..c16451aa6 100644 --- a/source/common/sound/s_soundinternal.h +++ b/source/common/sound/s_soundinternal.h @@ -257,7 +257,7 @@ private: bool IsChannelUsed(int sourcetype, const void* actor, int channel, int* seen); // This is the actual sound positioning logic which needs to be provided by the client. - virtual void CalcPosVel(int type, const void* source, const float pt[3], int channel, int chanflags, FSoundID chanSound, FVector3* pos, FVector3* vel) = 0; + virtual void CalcPosVel(int type, const void* source, const float pt[3], int channel, int chanflags, FSoundID chanSound, FVector3* pos, FVector3* vel, FSoundChan *chan) = 0; // This can be overridden by the clent to provide some diagnostics. The default lets everything pass. virtual bool ValidatePosVel(int sourcetype, const void* source, const FVector3& pos, const FVector3& vel) { return true; } diff --git a/source/duke3d/src/sounds.cpp b/source/duke3d/src/sounds.cpp index 3dbda3fde..19ff7504b 100644 --- a/source/duke3d/src/sounds.cpp +++ b/source/duke3d/src/sounds.cpp @@ -34,7 +34,7 @@ BEGIN_DUKE_NS class DukeSoundEngine : public SoundEngine { // client specific parts of the sound engine go in this class. - void CalcPosVel(int type, const void* source, const float pt[3], int channum, int chanflags, FSoundID chanSound, FVector3* pos, FVector3* vel) override; + void CalcPosVel(int type, const void* source, const float pt[3], int channum, int chanflags, FSoundID chanSound, FVector3* pos, FVector3* vel, FSoundChan *chan) override; TArray ReadSound(int lumpnum); public: @@ -262,7 +262,7 @@ void S_GetCamera(vec3_t** c, int32_t* ca, int32_t* cs) // //========================================================================= -void DukeSoundEngine::CalcPosVel(int type, const void* source, const float pt[3], int channum, int chanflags, FSoundID chanSound, FVector3* pos, FVector3* vel) +void DukeSoundEngine::CalcPosVel(int type, const void* source, const float pt[3], int channum, int chanflags, FSoundID chanSound, FVector3* pos, FVector3* vel, FSoundChan* ) { if (pos != nullptr) { diff --git a/source/rr/src/sounds.cpp b/source/rr/src/sounds.cpp index 2362f40ca..3dcba9cff 100644 --- a/source/rr/src/sounds.cpp +++ b/source/rr/src/sounds.cpp @@ -33,7 +33,7 @@ BEGIN_RR_NS class DukeSoundEngine : public SoundEngine { // client specific parts of the sound engine go in this class. - void CalcPosVel(int type, const void* source, const float pt[3], int channum, int chanflags, FSoundID chanSound, FVector3* pos, FVector3* vel) override; + void CalcPosVel(int type, const void* source, const float pt[3], int channum, int chanflags, FSoundID chanSound, FVector3* pos, FVector3* vel, FSoundChan* chan) override; TArray ReadSound(int lumpnum); public: @@ -261,7 +261,7 @@ void S_GetCamera(vec3_t** c, int32_t* ca, int32_t* cs) // //========================================================================= -void DukeSoundEngine::CalcPosVel(int type, const void* source, const float pt[3], int channum, int chanflags, FSoundID chanSound, FVector3* pos, FVector3* vel) +void DukeSoundEngine::CalcPosVel(int type, const void* source, const float pt[3], int channum, int chanflags, FSoundID chanSound, FVector3* pos, FVector3* vel, FSoundChan* chan) { if (pos != nullptr) { diff --git a/source/sw/src/actor.cpp b/source/sw/src/actor.cpp index 703467495..ec231b0ec 100644 --- a/source/sw/src/actor.cpp +++ b/source/sw/src/actor.cpp @@ -152,7 +152,7 @@ DoActorDie(short SpriteNum, short weapon) SpawnBlood(SpriteNum, SpriteNum, -1, -1, -1, -1); InitPlasmaFountain(wp, sp); InitPlasmaFountain(wp, sp); - PlaySound(DIGI_NINJAINHALF,&sp->x,&sp->y,&sp->z,v3df_none); + PlaySound(DIGI_NINJAINHALF, sp, v3df_none); if (sw_ninjahack) ChangeState(SpriteNum, &s_NinjaDieSlicedHack[5]); else @@ -830,11 +830,11 @@ DoActorStopFall(short SpriteNum) if (TEST(u->Flags, SPR_DEAD)) { NewStateGroup(SpriteNum, u->ActorActionSet->Dead); - PlaySound(DIGI_ACTORBODYFALL1,&sp->x,&sp->y,&sp->z,v3df_none); + PlaySound(DIGI_ACTORBODYFALL1, sp, v3df_none); } else { - PlaySound(DIGI_ACTORHITGROUND,&sp->x,&sp->y,&sp->z,v3df_none); + PlaySound(DIGI_ACTORHITGROUND, sp, v3df_none); NewStateGroup(SpriteNum, u->ActorActionSet->Run); diff --git a/source/sw/src/anim.cpp b/source/sw/src/anim.cpp index 65f52a614..472318016 100644 --- a/source/sw/src/anim.cpp +++ b/source/sw/src/anim.cpp @@ -77,7 +77,7 @@ void AnimShareIntro(int frame, int numframes) ototalclock += 120; else if (frame == 1) { - PlaySound(DIGI_NOMESSWITHWANG,&zero,&zero,&zero,v3df_none); + PlaySound(DIGI_NOMESSWITHWANG, v3df_none); ototalclock += 120*3; } else @@ -85,11 +85,11 @@ void AnimShareIntro(int frame, int numframes) if (frame == 5) { - PlaySound(DIGI_INTRO_SLASH,&zero,&zero,&zero,v3df_none); + PlaySound(DIGI_INTRO_SLASH, v3df_none); } else if (frame == 15) { - PlaySound(DIGI_INTRO_WHIRL,&zero,&zero,&zero,v3df_none); + PlaySound(DIGI_INTRO_WHIRL, v3df_none); } } @@ -103,26 +103,26 @@ void AnimSerp(int frame, int numframes) if (frame == 1) { - PlaySound(DIGI_SERPTAUNTWANG,&zero,&zero,&zero,v3df_none); + PlaySound(DIGI_SERPTAUNTWANG, v3df_none); } else if (frame == 16) { - PlaySound(DIGI_SHAREND_TELEPORT,&zero,&zero,&zero,v3df_none); + PlaySound(DIGI_SHAREND_TELEPORT, v3df_none); } else if (frame == 35) { SoundState++; - PlaySound(DIGI_WANGTAUNTSERP1,&zero,&zero,&zero,v3df_none); + PlaySound(DIGI_WANGTAUNTSERP1, v3df_none); } else if (frame == 51) { SoundState++; - PlaySound(DIGI_SHAREND_UGLY1,&zero,&zero,&zero,v3df_none); + PlaySound(DIGI_SHAREND_UGLY1, v3df_none); } else if (frame == 64) { SoundState++; - PlaySound(DIGI_SHAREND_UGLY2,&zero,&zero,&zero,v3df_none); + PlaySound(DIGI_SHAREND_UGLY2, v3df_none); } } @@ -140,19 +140,19 @@ void AnimSumo(int frame, int numframes) if (frame == 2) { // hungry - PlaySound(DIGI_JG41012,&zero,&zero,&zero,v3df_none); + PlaySound(DIGI_JG41012, v3df_none); } else if (frame == 30) { - PlaySound(DIGI_HOTHEADSWITCH,&zero,&zero,&zero,v3df_none); + PlaySound(DIGI_HOTHEADSWITCH, v3df_none); } else if (frame == 42) { - PlaySound(DIGI_HOTHEADSWITCH,&zero,&zero,&zero,v3df_none); + PlaySound(DIGI_HOTHEADSWITCH, v3df_none); } else if (frame == 59) { - PlaySound(DIGI_JG41028,&zero,&zero,&zero,v3df_none); + PlaySound(DIGI_JG41028, v3df_none); } } @@ -166,61 +166,61 @@ void AnimZilla(int frame, int numframes) if (frame == 1) { - PlaySound(DIGI_ZC1,&zero,&zero,&zero,v3df_none); + PlaySound(DIGI_ZC1, v3df_none); } else if (frame == 5) { - PlaySound(DIGI_JG94024,&zero,&zero,&zero,v3df_none); + PlaySound(DIGI_JG94024, v3df_none); } else if (frame == 14) { - PlaySound(DIGI_ZC2,&zero,&zero,&zero,v3df_none); + PlaySound(DIGI_ZC2, v3df_none); } else if (frame == 30) { - PlaySound(DIGI_ZC3,&zero,&zero,&zero,v3df_none); + PlaySound(DIGI_ZC3, v3df_none); } else if (frame == 32) { - PlaySound(DIGI_ZC4,&zero,&zero,&zero,v3df_none); + PlaySound(DIGI_ZC4, v3df_none); } else if (frame == 37) { - PlaySound(DIGI_ZC5,&zero,&zero,&zero,v3df_none); + PlaySound(DIGI_ZC5, v3df_none); } else if (frame == 63) { - PlaySound(DIGI_Z16043,&zero,&zero,&zero,v3df_none); - PlaySound(DIGI_ZC6,&zero,&zero,&zero,v3df_none); - PlaySound(DIGI_ZC7,&zero,&zero,&zero,v3df_none); + PlaySound(DIGI_Z16043, v3df_none); + PlaySound(DIGI_ZC6, v3df_none); + PlaySound(DIGI_ZC7, v3df_none); } else if (frame == 72) { - PlaySound(DIGI_ZC7,&zero,&zero,&zero,v3df_none); + PlaySound(DIGI_ZC7, v3df_none); } else if (frame == 73) { - PlaySound(DIGI_ZC4,&zero,&zero,&zero,v3df_none); + PlaySound(DIGI_ZC4, v3df_none); } else if (frame == 77) { - PlaySound(DIGI_ZC5,&zero,&zero,&zero,v3df_none); + PlaySound(DIGI_ZC5, v3df_none); } else if (frame == 87) { - PlaySound(DIGI_ZC8,&zero,&zero,&zero,v3df_none); + PlaySound(DIGI_ZC8, v3df_none); } else if (frame == 103) { - PlaySound(DIGI_ZC7,&zero,&zero,&zero,v3df_none); + PlaySound(DIGI_ZC7, v3df_none); } else if (frame == 108) { - PlaySound(DIGI_ZC9,&zero,&zero,&zero,v3df_none); + PlaySound(DIGI_ZC9, v3df_none); } else if (frame == 120) { - PlaySound(DIGI_JG94039,&zero,&zero,&zero,v3df_none); + PlaySound(DIGI_JG94039, v3df_none); } } diff --git a/source/sw/src/bunny.cpp b/source/sw/src/bunny.cpp index 7f49aa10f..f8495bcb5 100644 --- a/source/sw/src/bunny.cpp +++ b/source/sw/src/bunny.cpp @@ -997,8 +997,8 @@ DoBunnyQuickJump(short SpriteNum) { if (u->spal == PALETTE_PLAYER8 && tu->spal == PALETTE_PLAYER8) { - PlaySound(DIGI_BUNNYATTACK, &sp->x, &sp->y, &sp->z, v3df_follow); - PlaySound(DIGI_BUNNYDIE2, &tsp->x, &tsp->y, &tsp->z, v3df_follow); + PlaySound(DIGI_BUNNYATTACK, sp, v3df_follow); + PlaySound(DIGI_BUNNYDIE2, tsp, v3df_follow); tu->Health = 0; // Blood fountains @@ -1060,7 +1060,7 @@ DoBunnyQuickJump(short SpriteNum) { choose_snd = STD_RANDOM_RANGE(2<<8)>>8; if (FAFcansee(sp->x,sp->y,SPRITEp_TOS(sp),sp->sectnum,pp->posx, pp->posy, pp->posz, pp->cursectnum) && FACING(sp, u->tgt_sp)) - PlayerSound(fagsnds[choose_snd],&pp->posx,&pp->posy,&pp->posz,v3df_doppler|v3df_follow|v3df_dontpan,pp); + PlayerSound(fagsnds[choose_snd], v3df_doppler|v3df_follow|v3df_dontpan,pp); } } } @@ -1076,7 +1076,7 @@ DoBunnyQuickJump(short SpriteNum) { choose_snd = STD_RANDOM_RANGE(3<<8)>>8; if (FAFcansee(sp->x,sp->y,SPRITEp_TOS(sp),sp->sectnum,pp->posx, pp->posy, pp->posz, pp->cursectnum) && FACING(sp, u->tgt_sp)) - PlayerSound(straightsnds[choose_snd],&pp->posx,&pp->posy,&pp->posz,v3df_doppler|v3df_follow|v3df_dontpan,pp); + PlayerSound(straightsnds[choose_snd], v3df_doppler|v3df_follow|v3df_dontpan,pp); } } } @@ -1171,7 +1171,7 @@ int DoBunnyStandKill(short SpriteNum) // Growl like the bad ass bunny you are! if (RANDOM_RANGE(1000) > 800) - PlaySound(DIGI_BUNNYATTACK,&sp->x,&sp->y,&sp->z,v3df_none); + PlaySound(DIGI_BUNNYATTACK, sp, v3df_none); if ((u->WaitTics -= ACTORMOVETICS) <= 0) NewStateGroup(SpriteNum, sg_BunnyRun); @@ -1488,7 +1488,7 @@ DoBunnyScrew(short SpriteNum) if (RANDOM_RANGE(1000) > 990) // Bunny sex sounds { if (!adult_lockout && !Global_PLock) - PlaySound(DIGI_BUNNYATTACK, &sp->x, &sp->y, &sp->z, v3df_follow); + PlaySound(DIGI_BUNNYATTACK, sp, v3df_follow); } u->WaitTics -= ACTORMOVETICS; @@ -1538,7 +1538,7 @@ DoBunnyGrowUp(short SpriteNum) { if (Bunny_Count < 20) { - PlaySound(DIGI_BUNNYDIE2, &sp->x, &sp->y, &sp->z, v3df_follow); + PlaySound(DIGI_BUNNYDIE2, sp, v3df_follow); BunnyHatch(SpriteNum); // Baby time } u->ShellNum = 0; // Not pregnent anymore diff --git a/source/sw/src/cache.cpp b/source/sw/src/cache.cpp index 3ab5fc762..2186bf52b 100644 --- a/source/sw/src/cache.cpp +++ b/source/sw/src/cache.cpp @@ -407,11 +407,13 @@ void PreCacheSoundList(short table[], int num) { short j; +#if 0 for (j = 0; j < num; j++) { CacheSound(table[j], CACHE_SOUND_PRECACHE); AnimateCacheCursor(); } +#endif } void diff --git a/source/sw/src/cheats.cpp b/source/sw/src/cheats.cpp index be1eb4df5..27db405cd 100644 --- a/source/sw/src/cheats.cpp +++ b/source/sw/src/cheats.cpp @@ -397,12 +397,12 @@ void EveryCheatToggle(PLAYERp pp, const char *cheat_string) void GeorgeFunc(PLAYERp pp, char *) { - PlayerSound(DIGI_TAUNTAI9,&pp->posx,&pp->posy,&pp->posz,v3df_dontpan|v3df_doppler|v3df_follow,pp); + PlayerSound(DIGI_TAUNTAI9, v3df_dontpan|v3df_doppler|v3df_follow,pp); } void BlackburnFunc(PLAYERp pp, char *) { - PlayerSound(DIGI_TAUNTAI3,&pp->posx,&pp->posy,&pp->posz,v3df_dontpan|v3df_doppler|v3df_follow,pp); + PlayerSound(DIGI_TAUNTAI3, v3df_dontpan|v3df_doppler|v3df_follow,pp); } int cheatcmp(const char *str1, const char *str2, int len) diff --git a/source/sw/src/coolg.cpp b/source/sw/src/coolg.cpp index 0dc518e22..07a76f86f 100644 --- a/source/sw/src/coolg.cpp +++ b/source/sw/src/coolg.cpp @@ -850,7 +850,7 @@ int DoCoolgMove(short SpriteNum) u->ShellNum = SEC(2); break; case 1: - PlaySound(DIGI_VOID3, &sp->x, &sp->y, &sp->z, v3df_follow); + PlaySound(DIGI_VOID3, sp, v3df_follow); RESET(sp->cstat, CSTAT_SPRITE_TRANSLUCENT); SET(sp->cstat, CSTAT_SPRITE_INVISIBLE); u->ShellNum = SEC(1) + SEC(RANDOM_RANGE(2)); @@ -861,7 +861,7 @@ int DoCoolgMove(short SpriteNum) u->ShellNum = SEC(2); break; case 3: - PlaySound(DIGI_VOID3, &sp->x, &sp->y, &sp->z, v3df_follow); + PlaySound(DIGI_VOID3, sp, v3df_follow); RESET(sp->cstat, CSTAT_SPRITE_TRANSLUCENT); RESET(sp->cstat, CSTAT_SPRITE_INVISIBLE); u->ShellNum = SEC(2) + SEC(RANDOM_RANGE(3)); diff --git a/source/sw/src/coolie.cpp b/source/sw/src/coolie.cpp index 2280b53f1..4d72945a4 100644 --- a/source/sw/src/coolie.cpp +++ b/source/sw/src/coolie.cpp @@ -662,7 +662,7 @@ int InitCoolieCharge(short SpriteNum) USERp u = User[SpriteNum]; if (RANDOM_P2(1024) > 950) - PlaySound(DIGI_COOLIESCREAM, &sp->x, &sp->y, &sp->z, v3df_follow); + PlaySound(DIGI_COOLIESCREAM, sp, v3df_follow); DoActorSetSpeed(SpriteNum, FAST_SPEED); diff --git a/source/sw/src/d_menu.cpp b/source/sw/src/d_menu.cpp index 4291464ba..5fbe45dab 100644 --- a/source/sw/src/d_menu.cpp +++ b/source/sw/src/d_menu.cpp @@ -108,9 +108,9 @@ public: DidOrderSound = true; int choose_snd = STD_RANDOM_RANGE(1000); if (choose_snd > 500) - PlaySound(DIGI_WANGORDER1, &zero, &zero, &zero, v3df_dontpan); + PlaySound(DIGI_WANGORDER1, v3df_dontpan); else - PlaySound(DIGI_WANGORDER2, &zero, &zero, &zero, v3df_dontpan); + PlaySound(DIGI_WANGORDER2, v3df_dontpan); } } }; @@ -178,15 +178,15 @@ void GameInterface::MenuSound(EMenuSounds snd) switch (snd) { case CursorSound: - PlaySound(DIGI_STAR,&zero,&zero,&zero,v3df_dontpan); + PlaySound(DIGI_STAR, v3df_dontpan); break; case AdvanceSound: - PlaySound(DIGI_SWORDSWOOSH,&zero,&zero,&zero,v3df_dontpan); + PlaySound(DIGI_SWORDSWOOSH, v3df_dontpan); break; case CloseSound: - PlaySound(DIGI_STARCLINK,&zero,&zero,&zero,v3df_dontpan); + PlaySound(DIGI_STARCLINK, v3df_dontpan); break; default: @@ -237,13 +237,13 @@ void GameInterface::StartGame(FGameStartup& gs) //InitNewGame(); if (Skill == 0) - handle = PlaySound(DIGI_TAUNTAI3,&zero,&zero,&zero,v3df_none); + handle = PlaySound(DIGI_TAUNTAI3, v3df_none); else if (Skill == 1) - handle = PlaySound(DIGI_NOFEAR,&zero,&zero,&zero,v3df_none); + handle = PlaySound(DIGI_NOFEAR, v3df_none); else if (Skill == 2) - handle = PlaySound(DIGI_WHOWANTSWANG,&zero,&zero,&zero,v3df_none); + handle = PlaySound(DIGI_WHOWANTSWANG, v3df_none); else if (Skill == 3) - handle = PlaySound(DIGI_NOPAIN,&zero,&zero,&zero,v3df_none); + handle = PlaySound(DIGI_NOPAIN, v3df_none); if (handle > FX_Ok) while (FX_SoundActive(handle)) diff --git a/source/sw/src/game.cpp b/source/sw/src/game.cpp index 469e0cb45..489b073eb 100644 --- a/source/sw/src/game.cpp +++ b/source/sw/src/game.cpp @@ -1604,7 +1604,7 @@ void CreditsLevel(void) videoNextPage(); // Lo Wang feel like singing! - handle = PlaySound(DIGI_JG95012,&zero,&zero,&zero,v3df_none); + handle = PlaySound(DIGI_JG95012, v3df_none); if (handle > 0) while (FX_SoundActive(handle)) ; @@ -1614,7 +1614,7 @@ void CreditsLevel(void) { if (!PlaySong(nullptr, nullptr, 2, true)) { - handle = PlaySound(DIGI_NOLIKEMUSIC,&zero,&zero,&zero,v3df_none); + handle = PlaySound(DIGI_NOLIKEMUSIC, v3df_none); if (handle > 0) while (FX_SoundActive(handle)) handleevents(); return; @@ -2003,21 +2003,21 @@ void gStateControl(STATEp *State, int *tics) int BonusPunchSound(short SpriteNum) { PLAYERp pp = Player + myconnectindex; - PlaySound(DIGI_PLAYERYELL3, &pp->posx, &pp->posy, &pp->posz, v3df_none); + PlaySound(DIGI_PLAYERYELL3, pp, v3df_none); return 0; } int BonusKickSound(short SpriteNum) { PLAYERp pp = Player + myconnectindex; - PlaySound(DIGI_PLAYERYELL2, &pp->posx, &pp->posy, &pp->posz, v3df_none); + PlaySound(DIGI_PLAYERYELL2, pp, v3df_none); return 0; } int BonusGrabSound(short SpriteNum) { PLAYERp pp = Player + myconnectindex; - PlaySound(DIGI_BONUS_GRAB, &pp->posx, &pp->posy, &pp->posz, v3df_none); + PlaySound(DIGI_BONUS_GRAB, pp, v3df_none); return 0; } diff --git a/source/sw/src/game.h b/source/sw/src/game.h index 4a1be8660..3de794794 100644 --- a/source/sw/src/game.h +++ b/source/sw/src/game.h @@ -2070,8 +2070,28 @@ SECT_USERp GetSectUser(short sectnum); 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, int *x, int *y, int *z, Voc3D_Flags flags); -void PlayerSound(int num, int *x, int *y, int *z, Voc3D_Flags flags, PLAYERp pp); +int _PlaySound(int num, SPRITEp sprite, PLAYERp player, vec3_t *pos, Voc3D_Flags flags); +inline int PlaySound(int num, SPRITEp sprite, Voc3D_Flags flags) +{ + return _PlaySound(num, sprite, nullptr, nullptr, flags); +} +inline int PlaySound(int num, PLAYERp player, Voc3D_Flags flags) +{ + return _PlaySound(num, nullptr, player, nullptr, flags); +} +inline int PlaySound(int num, Voc3D_Flags flags) +{ + return _PlaySound(num, nullptr, nullptr, nullptr, flags); +} +inline int PlaySound(int num, vec3_t *pos, Voc3D_Flags flags) +{ + return _PlaySound(num, nullptr, nullptr, pos, flags); +} + +int _PlayerSound(int num, PLAYERp pp); +inline int PlayerSound(int num, int flags, PLAYERp pp) { return _PlayerSound(num, pp); } +void StopPlayerSound(PLAYERp pp); + ANIMATOR DoActorBeginJump,DoActorJump,DoActorBeginFall,DoActorFall,DoActorDeathMove; @@ -2274,9 +2294,6 @@ extern void DoPaletteFlash(PLAYERp pp); extern unsigned char palette_data[256][3]; extern SWBOOL NightVision; -int _PlayerSound(int num, PLAYERp pp); -inline int PlayerSound(int num, int x, int y, int z, int flags, PLAYERp pp) { return _PlayerSound(num, pp); } -void StopPlayerSound(PLAYERp pp); #define MAXSO (INT32_MAX) diff --git a/source/sw/src/hornet.cpp b/source/sw/src/hornet.cpp index cf2f77eff..694ea78a8 100644 --- a/source/sw/src/hornet.cpp +++ b/source/sw/src/hornet.cpp @@ -328,7 +328,7 @@ SetupHornet(short SpriteNum) sp->yrepeat = 32; // Special looping buzz sound attached to each hornet spawned - PlaySound(DIGI_HORNETBUZZ,&sp->x,&sp->y,&sp->z,v3df_follow|v3df_init); + PlaySound(DIGI_HORNETBUZZ, sp, v3df_follow|v3df_init); Set3DSoundOwner(SpriteNum); return 0; diff --git a/source/sw/src/inv.cpp b/source/sw/src/inv.cpp index 5e1fc31f6..5e04d15e6 100644 --- a/source/sw/src/inv.cpp +++ b/source/sw/src/inv.cpp @@ -339,9 +339,9 @@ void UseInventoryMedkit(PLAYERp pp) if (pp == Player+myconnectindex) { if (amt >= 30) - PlayerSound(DIGI_GETMEDKIT,&pp->posx,&pp->posy,&pp->posz,v3df_follow|v3df_dontpan,pp); + PlayerSound(DIGI_GETMEDKIT, v3df_follow|v3df_dontpan,pp); else - PlayerSound(DIGI_AHH,&pp->posx,&pp->posy,&pp->posz,v3df_follow|v3df_dontpan,pp); + PlayerSound(DIGI_AHH, v3df_follow|v3df_dontpan,pp); } } @@ -431,13 +431,13 @@ void UseInventoryRepairKit(PLAYERp pp) SPRITEp sp = pp->SpriteP; short inv = INVENTORY_REPAIR_KIT; - //PlaySound(DIGI_TOOLBOX, &pp->posx, &pp->posy, &pp->posz, v3df_none); + //PlaySound(DIGI_TOOLBOX, pp, v3df_none); if (pp == Player + myconnectindex) { if (STD_RANDOM_RANGE(1000) > 500) - PlayerSound(DIGI_NOREPAIRMAN,&pp->posx,&pp->posy,&pp->posz,v3df_follow|v3df_dontpan,pp); + PlayerSound(DIGI_NOREPAIRMAN, v3df_follow|v3df_dontpan,pp); else - PlayerSound(DIGI_NOREPAIRMAN2,&pp->posx,&pp->posy,&pp->posz,v3df_follow|v3df_dontpan,pp); + PlayerSound(DIGI_NOREPAIRMAN2, v3df_follow|v3df_dontpan,pp); } pp->InventoryPercent[inv] = 0; @@ -475,10 +475,10 @@ void UseInventoryCloak(PLAYERp pp) SET(sp->cstat, CSTAT_SPRITE_TRANSLUCENT); sp->shade = 100; - PlaySound(DIGI_GASPOP, &pp->posx, &pp->posy, &pp->posz, v3df_none); + PlaySound(DIGI_GASPOP, pp, v3df_none); //if(RANDOM_RANGE(1000) > 950) if (pp == Player+myconnectindex) - PlayerSound(DIGI_IAMSHADOW,&pp->posx,&pp->posy,&pp->posz,v3df_follow|v3df_dontpan,pp); + PlayerSound(DIGI_IAMSHADOW, v3df_follow|v3df_dontpan,pp); } void StopInventoryCloak(PLAYERp pp, short InventoryNum) @@ -500,7 +500,7 @@ void StopInventoryCloak(PLAYERp pp, short InventoryNum) RESET(sp->cstat, CSTAT_SPRITE_TRANSLUCENT); sp->shade = 0; - PlaySound(DIGI_GASPOP, &pp->posx, &pp->posy, &pp->posz, v3df_none); + PlaySound(DIGI_GASPOP, pp, v3df_none); } ////////////////////////////////////////////////////////////////////// @@ -540,7 +540,7 @@ void StopInventoryEnvironSuit(PLAYERp pp, short InventoryNum) // on/off PlayerUpdateInventory(pp, InventoryNum); - PlaySound(DIGI_SWCLOAKUNCLOAK, &pp->posx, &pp->posy, &pp->posz, v3df_none); + PlaySound(DIGI_SWCLOAKUNCLOAK, pp, v3df_none); } #endif @@ -600,7 +600,7 @@ UseInventoryNightVision(PLAYERp pp) PlayerUpdateInventory(pp, pp->InventoryNum); DoPlayerNightVisionPalette(pp); - PlaySound(DIGI_NIGHTON, &pp->posx, &pp->posy, &pp->posz, v3df_dontpan|v3df_follow); + PlaySound(DIGI_NIGHTON, pp, v3df_dontpan|v3df_follow); } void @@ -624,7 +624,7 @@ StopInventoryNightVision(PLAYERp pp, short InventoryNum) DoPlayerNightVisionPalette(pp); DoPlayerDivePalette(pp); - PlaySound(DIGI_NIGHTOFF, &pp->posx, &pp->posy, &pp->posz, v3df_dontpan|v3df_follow); + PlaySound(DIGI_NIGHTOFF, pp, v3df_dontpan|v3df_follow); } ////////////////////////////////////////////////////////////////////// diff --git a/source/sw/src/jsector.cpp b/source/sw/src/jsector.cpp index 97f4464f1..a440b5ba9 100644 --- a/source/sw/src/jsector.cpp +++ b/source/sw/src/jsector.cpp @@ -99,7 +99,7 @@ void SpawnWallSound(short sndnum, short i) setspritez(SpriteNum, &mid); sp = &sprite[SpriteNum]; - handle = PlaySound(sndnum, &sp->x, &sp->y, &sp->z, v3df_dontpan | v3df_doppler); + handle = PlaySound(sndnum, sp, v3df_dontpan | v3df_doppler); if (handle != -1) Set3DSoundOwner(SpriteNum); } @@ -217,7 +217,7 @@ JS_SpriteSetup(void) else if (tag == AMBIENT_SOUND) { change_sprite_stat(SpriteNum, STAT_AMBIENT); - // PlaySound(sp->lotag, &sp->x, &sp->y, &sp->z, v3df_ambient + // PlaySound(sp->lotag, sp, v3df_ambient // | v3df_init | v3df_doppler); } else if (tag == TAG_ECHO_SOUND) @@ -250,18 +250,18 @@ JS_SpriteSetup(void) case 2720: case 3143: case 3157: - handle = PlaySound(DIGI_FIRE1, &sp->x, &sp->y, &sp->z, v3df_follow|v3df_dontpan|v3df_doppler); + handle = PlaySound(DIGI_FIRE1, sp, v3df_follow|v3df_dontpan|v3df_doppler); if (handle != -1) Set3DSoundOwner(SpriteNum); break; case 795: case 880: - handle = PlaySound(DIGI_WATERFLOW1, &sp->x, &sp->y, &sp->z, v3df_follow|v3df_dontpan|v3df_doppler); + handle = PlaySound(DIGI_WATERFLOW1, sp, v3df_follow|v3df_dontpan|v3df_doppler); if (handle != -1) Set3DSoundOwner(SpriteNum); break; case 460: // Wind Chimes - handle = PlaySound(79, &sp->x, &sp->y, &sp->z, v3df_ambient | v3df_init + handle = PlaySound(79, sp, v3df_ambient | v3df_init | v3df_doppler | v3df_follow); if (handle != -1) Set3DSoundOwner(SpriteNum); @@ -1353,7 +1353,7 @@ UnlockKeyLock(short key_num, short hit_sprite) case SKEL_LOCKED: if (sp->pal == color) { - PlaySound(DIGI_UNLOCK, &sp->x, &sp->y, &sp->z, v3df_doppler | v3df_dontpan); + PlaySound(DIGI_UNLOCK, sp, v3df_doppler | v3df_dontpan); if (SpriteNum == hit_sprite) sp->picnum = SKEL_UNLOCKED; } @@ -1361,14 +1361,14 @@ UnlockKeyLock(short key_num, short hit_sprite) case RAMCARD_LOCKED: if (sp->pal == color) { - PlaySound(DIGI_CARDUNLOCK, &sp->x, &sp->y, &sp->z, v3df_doppler | v3df_dontpan); + PlaySound(DIGI_CARDUNLOCK, sp, v3df_doppler | v3df_dontpan); sp->picnum = RAMCARD_UNLOCKED; } break; case CARD_LOCKED: if (sp->pal == color) { - PlaySound(DIGI_RAMUNLOCK, &sp->x, &sp->y, &sp->z, v3df_doppler | v3df_dontpan); + PlaySound(DIGI_RAMUNLOCK, sp, v3df_doppler | v3df_dontpan); if (SpriteNum == hit_sprite) sp->picnum = CARD_UNLOCKED; else diff --git a/source/sw/src/jweapon.cpp b/source/sw/src/jweapon.cpp index 823169808..a9b309878 100644 --- a/source/sw/src/jweapon.cpp +++ b/source/sw/src/jweapon.cpp @@ -874,7 +874,7 @@ DoChemBomb(int16_t Weapon) SPRITEp hsp; if (!TEST(sp->cstat, CSTAT_SPRITE_INVISIBLE)) - PlaySound(DIGI_CHEMBOUNCE, &sp->x, &sp->y, &sp->z, v3df_dontpan); + PlaySound(DIGI_CHEMBOUNCE, sp, v3df_dontpan); hit_sprite = NORM_SPRITE(u->ret); hsp = &sprite[hit_sprite]; @@ -890,8 +890,8 @@ DoChemBomb(int16_t Weapon) // Canister pops when first smoke starts out if (u->WaitTics == CHEMTICS && !TEST(sp->cstat, CSTAT_SPRITE_INVISIBLE)) { - PlaySound(DIGI_GASPOP, &sp->x, &sp->y, &sp->z, v3df_dontpan | v3df_doppler); - PlaySound(DIGI_CHEMGAS, &sp->x, &sp->y, &sp->z, v3df_dontpan | v3df_doppler); + PlaySound(DIGI_GASPOP, sp, v3df_dontpan | v3df_doppler); + PlaySound(DIGI_CHEMGAS, sp, v3df_dontpan | v3df_doppler); Set3DSoundOwner(Weapon); } u->xchange = u->ychange = 0; @@ -921,7 +921,7 @@ DoChemBomb(int16_t Weapon) } if (!TEST(sp->cstat, CSTAT_SPRITE_INVISIBLE)) - PlaySound(DIGI_CHEMBOUNCE, &sp->x, &sp->y, &sp->z, v3df_dontpan); + PlaySound(DIGI_CHEMBOUNCE, sp, v3df_dontpan); nw = wall[hit_wall].point2; wall_ang = NORM_ANGLE(getangle(wall[nw].x - wph->x, wall[nw].y - wph->y) + 512); @@ -953,7 +953,7 @@ DoChemBomb(int16_t Weapon) if (!TEST(u->Flags, SPR_BOUNCE)) { if (!TEST(sp->cstat, CSTAT_SPRITE_INVISIBLE)) - PlaySound(DIGI_CHEMBOUNCE, &sp->x, &sp->y, &sp->z, v3df_dontpan); + PlaySound(DIGI_CHEMBOUNCE, sp, v3df_dontpan); SET(u->Flags, SPR_BOUNCE); ScaleSpriteVector(Weapon, 32000); // was 18000 u->zchange /= 6; @@ -965,8 +965,8 @@ DoChemBomb(int16_t Weapon) // Canister pops when first smoke starts out if (u->WaitTics == CHEMTICS && !TEST(sp->cstat, CSTAT_SPRITE_INVISIBLE)) { - PlaySound(DIGI_GASPOP, &sp->x, &sp->y, &sp->z, v3df_dontpan | v3df_doppler); - PlaySound(DIGI_CHEMGAS, &sp->x, &sp->y, &sp->z, v3df_dontpan | v3df_doppler); + PlaySound(DIGI_GASPOP, sp, v3df_dontpan | v3df_doppler); + PlaySound(DIGI_CHEMGAS, sp, v3df_dontpan | v3df_doppler); Set3DSoundOwner(Weapon); } SpawnRadiationCloud(Weapon); @@ -1000,7 +1000,7 @@ DoChemBomb(int16_t Weapon) if (!TEST(u->Flags, SPR_BOUNCE)) { if (!TEST(sp->cstat, CSTAT_SPRITE_INVISIBLE)) - PlaySound(DIGI_CHEMBOUNCE, &sp->x, &sp->y, &sp->z, v3df_dontpan); + PlaySound(DIGI_CHEMBOUNCE, sp, v3df_dontpan); SET(u->Flags, SPR_BOUNCE); u->ret = 0; u->Counter = 0; @@ -1013,8 +1013,8 @@ DoChemBomb(int16_t Weapon) // Canister pops when first smoke starts out if (u->WaitTics == CHEMTICS && !TEST(sp->cstat, CSTAT_SPRITE_INVISIBLE)) { - PlaySound(DIGI_GASPOP, &sp->x, &sp->y, &sp->z, v3df_dontpan | v3df_doppler); - PlaySound(DIGI_CHEMGAS, &sp->x, &sp->y, &sp->z, v3df_dontpan | v3df_doppler); + PlaySound(DIGI_GASPOP, sp, v3df_dontpan | v3df_doppler); + PlaySound(DIGI_CHEMGAS, sp, v3df_dontpan | v3df_doppler); Set3DSoundOwner(Weapon); } // WeaponMoveHit(Weapon); @@ -1132,7 +1132,7 @@ DoCaltrops(int16_t Weapon) short hit_sprite; SPRITEp hsp; - PlaySound(DIGI_CALTROPS, &sp->x, &sp->y, &sp->z, v3df_dontpan); + PlaySound(DIGI_CALTROPS, sp, v3df_dontpan); hit_sprite = NORM_SPRITE(u->ret); hsp = &sprite[hit_sprite]; @@ -1168,7 +1168,7 @@ DoCaltrops(int16_t Weapon) break; } - PlaySound(DIGI_CALTROPS, &sp->x, &sp->y, &sp->z, v3df_dontpan); + PlaySound(DIGI_CALTROPS, sp, v3df_dontpan); nw = wall[hit_wall].point2; wall_ang = NORM_ANGLE(getangle(wall[nw].x - wph->x, wall[nw].y - wph->y) + 512); @@ -1199,7 +1199,7 @@ DoCaltrops(int16_t Weapon) // hit a floor if (!TEST(u->Flags, SPR_BOUNCE)) { - PlaySound(DIGI_CALTROPS, &sp->x, &sp->y, &sp->z, v3df_dontpan); + PlaySound(DIGI_CALTROPS, sp, v3df_dontpan); SET(u->Flags, SPR_BOUNCE); ScaleSpriteVector(Weapon, 1000); // was 18000 u->ret = 0; @@ -1236,7 +1236,7 @@ DoCaltrops(int16_t Weapon) if (!TEST(u->Flags, SPR_BOUNCE)) { - PlaySound(DIGI_CALTROPS, &sp->x, &sp->y, &sp->z, v3df_dontpan); + PlaySound(DIGI_CALTROPS, sp, v3df_dontpan); SET(u->Flags, SPR_BOUNCE); u->ret = 0; u->Counter = 0; @@ -1387,7 +1387,7 @@ PlayerInitChemBomb(PLAYERp pp) int dist; - PlaySound(DIGI_THROW, &pp->posx, &pp->posy, &pp->posz, v3df_dontpan | v3df_doppler); + PlaySound(DIGI_THROW, pp, v3df_dontpan | v3df_doppler); if (pp->cursectnum < 0) return 0; @@ -1474,7 +1474,7 @@ InitSpriteChemBomb(int16_t SpriteNum) int dist; - PlaySound(DIGI_THROW, &sp->x, &sp->y, &sp->z, v3df_dontpan | v3df_doppler); + PlaySound(DIGI_THROW, sp, v3df_dontpan | v3df_doppler); nx = sp->x; ny = sp->y; @@ -1606,7 +1606,7 @@ PlayerInitFlashBomb(PLAYERp pp) SPRITEp sp = pp->SpriteP, hp; USERp u = User[pp->PlayerSprite], hu; - PlaySound(DIGI_GASPOP, &pp->posx, &pp->posy, &pp->posz, v3df_dontpan | v3df_doppler); + PlaySound(DIGI_GASPOP, pp, v3df_dontpan | v3df_doppler); // Set it just a little to let player know what he just did SetFadeAmt(pp, -30, 1); // White flash @@ -1650,8 +1650,7 @@ PlayerInitFlashBomb(PLAYERp pp) choosesnd = RANDOM_RANGE(MAX_PAIN); - PlayerSound(PlayerLowHealthPainVocs[choosesnd],&pp->posx, - &pp->posy,&pp->posy,v3df_dontpan|v3df_doppler|v3df_follow,pp); + PlayerSound(PlayerLowHealthPainVocs[choosesnd],v3df_dontpan|v3df_doppler|v3df_follow,pp); } SetFadeAmt(hu->PlayerP, damage, 1); // White flash } @@ -1677,7 +1676,7 @@ InitFlashBomb(int16_t SpriteNum) USERp u = User[SpriteNum], hu; PLAYERp pp = Player + screenpeek; - PlaySound(DIGI_GASPOP, &sp->x, &sp->y, &sp->z, v3df_dontpan | v3df_doppler); + PlaySound(DIGI_GASPOP, sp, v3df_dontpan | v3df_doppler); for (stat = 0; stat < SIZ(StatDamageList); stat++) { @@ -1710,8 +1709,7 @@ InitFlashBomb(int16_t SpriteNum) choosesnd = RANDOM_RANGE(MAX_PAIN); - PlayerSound(PlayerLowHealthPainVocs[choosesnd],&pp->posx, - &pp->posy,&pp->posy,v3df_dontpan|v3df_doppler|v3df_follow,pp); + PlayerSound(PlayerLowHealthPainVocs[choosesnd],v3df_dontpan|v3df_doppler|v3df_follow,pp); } SetFadeAmt(hu->PlayerP, damage, 1); // White flash } @@ -1835,7 +1833,7 @@ PlayerInitCaltrops(PLAYERp pp) int dist; - PlaySound(DIGI_THROW, &pp->posx, &pp->posy, &pp->posz, v3df_dontpan | v3df_doppler); + PlaySound(DIGI_THROW, pp, v3df_dontpan | v3df_doppler); if (pp->cursectnum < 0) return 0; @@ -1920,7 +1918,7 @@ InitCaltrops(int16_t SpriteNum) int dist; - PlaySound(DIGI_THROW, &sp->x, &sp->y, &sp->z, v3df_dontpan | v3df_doppler); + PlaySound(DIGI_THROW, sp, v3df_dontpan | v3df_doppler); nx = sp->x; ny = sp->y; @@ -1973,7 +1971,7 @@ InitPhosphorus(int16_t SpriteNum) int dist; - PlaySound(DIGI_FIREBALL1, &sp->x, &sp->y, &sp->z, v3df_follow); + PlaySound(DIGI_FIREBALL1, sp, v3df_follow); nx = sp->x; ny = sp->y; @@ -2042,11 +2040,11 @@ InitBloodSpray(int16_t SpriteNum, SWBOOL dogib, short velocity) // { rnd = RANDOM_RANGE(1000); if (rnd > 650) - PlaySound(DIGI_GIBS1, &sp->x, &sp->y, &sp->z, v3df_none); + PlaySound(DIGI_GIBS1, sp, v3df_none); else if (rnd > 350) - PlaySound(DIGI_GIBS2, &sp->x, &sp->y, &sp->z, v3df_none); + PlaySound(DIGI_GIBS2, sp, v3df_none); else - PlaySound(DIGI_GIBS3, &sp->x, &sp->y, &sp->z, v3df_none); + PlaySound(DIGI_GIBS3, sp, v3df_none); // } ang = sp->ang; @@ -2265,7 +2263,7 @@ DoCarryFlag(int16_t Weapon) } if (!TEST_BOOL1(fp)) { - PlaySound(DIGI_BIGITEM, &ap->x, &ap->y, &ap->z, v3df_none); + PlaySound(DIGI_BIGITEM, ap, v3df_none); DoFlagScore(ap->pal); if (SP_TAG5(fp) > 0) { @@ -2296,55 +2294,55 @@ DoCarryFlag(int16_t Weapon) case 0: if (u->WaitTics < SEC(30)) { - PlaySound(DIGI_MINEBEEP, &sp->x, &sp->y, &sp->z, v3df_dontpan); + PlaySound(DIGI_MINEBEEP, sp, v3df_dontpan); u->Counter2++; } break; case 1: if (u->WaitTics < SEC(20)) { - PlaySound(DIGI_MINEBEEP, &sp->x, &sp->y, &sp->z, v3df_dontpan); + PlaySound(DIGI_MINEBEEP, sp, v3df_dontpan); u->Counter2++; } break; case 2: if (u->WaitTics < SEC(10)) { - PlaySound(DIGI_MINEBEEP, &sp->x, &sp->y, &sp->z, v3df_dontpan); + PlaySound(DIGI_MINEBEEP, sp, v3df_dontpan); u->Counter2++; } break; case 3: if (u->WaitTics < SEC(5)) { - PlaySound(DIGI_MINEBEEP, &sp->x, &sp->y, &sp->z, v3df_dontpan); + PlaySound(DIGI_MINEBEEP, sp, v3df_dontpan); u->Counter2++; } break; case 4: if (u->WaitTics < SEC(4)) { - PlaySound(DIGI_MINEBEEP, &sp->x, &sp->y, &sp->z, v3df_dontpan); + PlaySound(DIGI_MINEBEEP, sp, v3df_dontpan); u->Counter2++; } break; case 5: if (u->WaitTics < SEC(3)) { - PlaySound(DIGI_MINEBEEP, &sp->x, &sp->y, &sp->z, v3df_dontpan); + PlaySound(DIGI_MINEBEEP, sp, v3df_dontpan); u->Counter2++; } break; case 6: if (u->WaitTics < SEC(2)) { - PlaySound(DIGI_MINEBEEP, &sp->x, &sp->y, &sp->z, v3df_dontpan); + PlaySound(DIGI_MINEBEEP, sp, v3df_dontpan); u->Counter2 = FLAG_DETONATE_STATE; } break; case FLAG_DETONATE_STATE: // start frantic beeping - PlaySound(DIGI_MINEBEEP, &sp->x, &sp->y, &sp->z, v3df_dontpan); + PlaySound(DIGI_MINEBEEP, sp, v3df_dontpan); u->Counter2++; break; case FLAG_DETONATE_STATE + 1: @@ -2406,7 +2404,7 @@ DoCarryFlagNoDet(int16_t Weapon) } if (!TEST_BOOL1(fp)) { - PlaySound(DIGI_BIGITEM, &ap->x, &ap->y, &ap->z, v3df_none); + PlaySound(DIGI_BIGITEM, ap, v3df_none); DoFlagScore(ap->pal); if (SP_TAG5(fp) > 0) { diff --git a/source/sw/src/miscactr.cpp b/source/sw/src/miscactr.cpp index 583cee325..86f47f723 100644 --- a/source/sw/src/miscactr.cpp +++ b/source/sw/src/miscactr.cpp @@ -176,11 +176,11 @@ int DoToiletGirl(short SpriteNum) if (!FX_SoundValidAndActive(handle)) { if (choose_snd > 750) - handle = PlaySound(DIGI_TOILETGIRLFART1,&sp->x,&sp->y,&sp->z,v3df_dontpan); + handle = PlaySound(DIGI_TOILETGIRLFART1, sp, v3df_dontpan); else if (choose_snd > 350) - handle = PlaySound(DIGI_TOILETGIRLFART2,&sp->x,&sp->y,&sp->z,v3df_dontpan); + handle = PlaySound(DIGI_TOILETGIRLFART2, sp, v3df_dontpan); else - handle = PlaySound(DIGI_TOILETGIRLFART3,&sp->x,&sp->y,&sp->z,v3df_dontpan); + handle = PlaySound(DIGI_TOILETGIRLFART3, sp, v3df_dontpan); } } } @@ -191,9 +191,9 @@ int DoToiletGirl(short SpriteNum) if (!FX_SoundValidAndActive(madhandle)) { if (RANDOM_RANGE(1000<<8)>>8 > 500) - madhandle = PlaySound(DIGI_ANIMEMAD1,&sp->x,&sp->y,&sp->z,v3df_dontpan); + madhandle = PlaySound(DIGI_ANIMEMAD1, sp, v3df_dontpan); else - madhandle = PlaySound(DIGI_ANIMEMAD2,&sp->x,&sp->y,&sp->z,v3df_dontpan); + madhandle = PlaySound(DIGI_ANIMEMAD2, sp, v3df_dontpan); } ChangeState(SpriteNum,s_ToiletGirlUzi); u->WaitTics = SEC(1)+SEC(RANDOM_RANGE(3<<8)>>8); @@ -238,9 +238,9 @@ int NullToiletGirl(short SpriteNum) if (!FX_SoundValidAndActive(madhandle)) { if (RANDOM_RANGE(1000<<8)>>8 > 500) - madhandle = PlaySound(DIGI_ANIMEMAD1,&sp->x,&sp->y,&sp->z,v3df_dontpan); + madhandle = PlaySound(DIGI_ANIMEMAD1, sp, v3df_dontpan); else - madhandle = PlaySound(DIGI_ANIMEMAD2,&sp->x,&sp->y,&sp->z,v3df_dontpan); + madhandle = PlaySound(DIGI_ANIMEMAD2, sp, v3df_dontpan); } ChangeState(SpriteNum,s_ToiletGirlUzi); u->WaitTics = SEC(1)+SEC(RANDOM_RANGE(3<<8)>>8); @@ -419,9 +419,9 @@ int DoWashGirl(short SpriteNum) if (!FX_SoundValidAndActive(handle)) { if (RANDOM_P2(1024<<4)>>4 > 500) - handle = PlaySound(DIGI_ANIMESING1,&sp->x,&sp->y,&sp->z,v3df_dontpan); + handle = PlaySound(DIGI_ANIMESING1, sp, v3df_dontpan); else - handle = PlaySound(DIGI_ANIMESING2,&sp->x,&sp->y,&sp->z,v3df_dontpan); + handle = PlaySound(DIGI_ANIMESING2, sp, v3df_dontpan); } ChangeState(SpriteNum,s_WashGirlStandScrub); @@ -449,9 +449,9 @@ int DoWashGirl(short SpriteNum) if (!FX_SoundValidAndActive(madhandle)) { if (RANDOM_RANGE(1000<<8)>>8 > 500) - madhandle = PlaySound(DIGI_ANIMEMAD1,&sp->x,&sp->y,&sp->z,v3df_dontpan); + madhandle = PlaySound(DIGI_ANIMEMAD1, sp, v3df_dontpan); else - madhandle = PlaySound(DIGI_ANIMEMAD2,&sp->x,&sp->y,&sp->z,v3df_dontpan); + madhandle = PlaySound(DIGI_ANIMEMAD2, sp, v3df_dontpan); } ChangeState(SpriteNum,s_WashGirlUzi); u->WaitTics = SEC(1)+SEC(RANDOM_RANGE(3<<8)>>8); @@ -493,9 +493,9 @@ int NullWashGirl(short SpriteNum) if (!FX_SoundValidAndActive(madhandle)) { if (RANDOM_RANGE(1000<<8)>>8 > 500) - madhandle = PlaySound(DIGI_ANIMEMAD1,&sp->x,&sp->y,&sp->z,v3df_dontpan); + madhandle = PlaySound(DIGI_ANIMEMAD1, sp, v3df_dontpan); else - madhandle = PlaySound(DIGI_ANIMEMAD2,&sp->x,&sp->y,&sp->z,v3df_dontpan); + madhandle = PlaySound(DIGI_ANIMEMAD2, sp, v3df_dontpan); } ChangeState(SpriteNum,s_WashGirlUzi); u->WaitTics = SEC(1)+SEC(RANDOM_RANGE(3<<8)>>8); @@ -857,7 +857,7 @@ int PachinkoCheckWin(short SpriteNum) } ActorCoughItem(SpriteNum); // I WON! I WON! - PlaySound(DIGI_PALARM,&sp->x,&sp->y,&sp->z,v3df_none); + PlaySound(DIGI_PALARM, sp, v3df_none); // Can't win any more now! SET_BOOL1(sp); @@ -883,13 +883,13 @@ int PachinkoCheckWin(short SpriteNum) //{ //if(rnd > 950) - // PlayerSound(DIGI_SHISEISI,&pp->posx,&pp->posy,&pp->posz,v3df_follow|v3df_dontpan,pp); + // PlayerSound(DIGI_SHISEISI, pp, v3df_follow|v3df_dontpan,pp); //else //if(rnd > 900) - // PlayerSound(DIGI_YOULOOKSTUPID,&pp->posx,&pp->posy,&pp->posz,v3df_follow|v3df_dontpan,pp); + // PlayerSound(DIGI_YOULOOKSTUPID, pp, v3df_follow|v3df_dontpan,pp); //else //if(rnd > 850) - // PlayerSound(DIGI_HURTBAD5,&pp->posx,&pp->posy,&pp->posz,v3df_follow|v3df_dontpan,pp); + // PlayerSound(DIGI_HURTBAD5, pp, v3df_follow|v3df_dontpan,pp); //} return 0; @@ -907,11 +907,11 @@ int Pachinko1Operate(short SpriteNum) { rnd = RANDOM_RANGE(1000); // TEMP SOUNDS: Need pachinko sounds! if (rnd > 700) - PlaySound(DIGI_PROLL1,&sp->x,&sp->y,&sp->z,v3df_none); + PlaySound(DIGI_PROLL1, sp, v3df_none); else if (rnd > 400) - PlaySound(DIGI_PROLL2,&sp->x,&sp->y,&sp->z,v3df_none); + PlaySound(DIGI_PROLL2, sp, v3df_none); else - PlaySound(DIGI_PROLL3,&sp->x,&sp->y,&sp->z,v3df_none); + PlaySound(DIGI_PROLL3, sp, v3df_none); } return 0; @@ -1311,13 +1311,13 @@ int DoCarGirl(short SpriteNum) choose = RANDOM_RANGE(1000); if (choose > 750) - madhandle = PlaySound(DIGI_LANI049,&sp->x,&sp->y,&sp->z,v3df_dontpan); + madhandle = PlaySound(DIGI_LANI049, sp, v3df_dontpan); else if (choose > 500) - madhandle = PlaySound(DIGI_LANI051,&sp->x,&sp->y,&sp->z,v3df_dontpan); + madhandle = PlaySound(DIGI_LANI051, sp, v3df_dontpan); else if (choose > 250) - madhandle = PlaySound(DIGI_LANI052,&sp->x,&sp->y,&sp->z,v3df_dontpan); + madhandle = PlaySound(DIGI_LANI052, sp, v3df_dontpan); else - madhandle = PlaySound(DIGI_LANI054,&sp->x,&sp->y,&sp->z,v3df_dontpan); + madhandle = PlaySound(DIGI_LANI054, sp, v3df_dontpan); } ChangeState(SpriteNum,s_CarGirlUzi); u->WaitTics = SEC(3)+SEC(RANDOM_RANGE(2<<8)>>8); @@ -1366,13 +1366,13 @@ int NullCarGirl(short SpriteNum) choose = RANDOM_RANGE(1000); if (choose > 750) - madhandle = PlaySound(DIGI_LANI049,&sp->x,&sp->y,&sp->z,v3df_dontpan); + madhandle = PlaySound(DIGI_LANI049, sp, v3df_dontpan); else if (choose > 500) - madhandle = PlaySound(DIGI_LANI051,&sp->x,&sp->y,&sp->z,v3df_dontpan); + madhandle = PlaySound(DIGI_LANI051, sp, v3df_dontpan); else if (choose > 250) - madhandle = PlaySound(DIGI_LANI052,&sp->x,&sp->y,&sp->z,v3df_dontpan); + madhandle = PlaySound(DIGI_LANI052, sp, v3df_dontpan); else - madhandle = PlaySound(DIGI_LANI054,&sp->x,&sp->y,&sp->z,v3df_dontpan); + madhandle = PlaySound(DIGI_LANI054, sp, v3df_dontpan); } ChangeState(SpriteNum,s_CarGirlUzi); u->WaitTics = SEC(3)+SEC(RANDOM_RANGE(2<<8)>>8); @@ -1538,13 +1538,13 @@ int DoMechanicGirl(short SpriteNum) choose = RANDOM_RANGE(1000); if (choose > 750) - madhandle = PlaySound(DIGI_LANI073,&sp->x,&sp->y,&sp->z,v3df_dontpan); + madhandle = PlaySound(DIGI_LANI073, sp, v3df_dontpan); else if (choose > 500) - madhandle = PlaySound(DIGI_LANI075,&sp->x,&sp->y,&sp->z,v3df_dontpan); + madhandle = PlaySound(DIGI_LANI075, sp, v3df_dontpan); else if (choose > 250) - madhandle = PlaySound(DIGI_LANI077,&sp->x,&sp->y,&sp->z,v3df_dontpan); + madhandle = PlaySound(DIGI_LANI077, sp, v3df_dontpan); else - madhandle = PlaySound(DIGI_LANI079,&sp->x,&sp->y,&sp->z,v3df_dontpan); + madhandle = PlaySound(DIGI_LANI079, sp, v3df_dontpan); } ChangeState(SpriteNum,s_MechanicGirlDrill); u->WaitTics = SEC(1)+SEC(RANDOM_RANGE(2<<8)>>8); @@ -1593,13 +1593,13 @@ int NullMechanicGirl(short SpriteNum) choose = RANDOM_RANGE(1000); if (choose > 750) - madhandle = PlaySound(DIGI_LANI073,&sp->x,&sp->y,&sp->z,v3df_dontpan); + madhandle = PlaySound(DIGI_LANI073, sp, v3df_dontpan); else if (choose > 500) - madhandle = PlaySound(DIGI_LANI075,&sp->x,&sp->y,&sp->z,v3df_dontpan); + madhandle = PlaySound(DIGI_LANI075, sp, v3df_dontpan); else if (choose > 250) - madhandle = PlaySound(DIGI_LANI077,&sp->x,&sp->y,&sp->z,v3df_dontpan); + madhandle = PlaySound(DIGI_LANI077, sp, v3df_dontpan); else - madhandle = PlaySound(DIGI_LANI079,&sp->x,&sp->y,&sp->z,v3df_dontpan); + madhandle = PlaySound(DIGI_LANI079, sp, v3df_dontpan); } ChangeState(SpriteNum,s_MechanicGirlDrill); u->WaitTics = SEC(1)+SEC(RANDOM_RANGE(2<<8)>>8); @@ -1769,14 +1769,14 @@ int DoSailorGirl(short SpriteNum) { ActorCoughItem(SpriteNum); alreadythrew++; - madhandle = PlaySound(DIGI_LANI060,&sp->x,&sp->y,&sp->z,v3df_dontpan); + madhandle = PlaySound(DIGI_LANI060, sp, v3df_dontpan); } else if (choose > 500) - madhandle = PlaySound(DIGI_LANI063,&sp->x,&sp->y,&sp->z,v3df_dontpan); + madhandle = PlaySound(DIGI_LANI063, sp, v3df_dontpan); else if (choose > 250) - madhandle = PlaySound(DIGI_LANI065,&sp->x,&sp->y,&sp->z,v3df_dontpan); + madhandle = PlaySound(DIGI_LANI065, sp, v3df_dontpan); else - madhandle = PlaySound(DIGI_LANI066,&sp->x,&sp->y,&sp->z,v3df_dontpan); + madhandle = PlaySound(DIGI_LANI066, sp, v3df_dontpan); } ChangeState(SpriteNum,s_SailorGirlThrow); u->WaitTics = SEC(1)+SEC(RANDOM_RANGE(3<<8)>>8); @@ -1829,14 +1829,14 @@ int NullSailorGirl(short SpriteNum) { ActorCoughItem(SpriteNum); alreadythrew++; - madhandle = PlaySound(DIGI_LANI060,&sp->x,&sp->y,&sp->z,v3df_dontpan); + madhandle = PlaySound(DIGI_LANI060, sp, v3df_dontpan); } else if (choose > 500) - madhandle = PlaySound(DIGI_LANI063,&sp->x,&sp->y,&sp->z,v3df_dontpan); + madhandle = PlaySound(DIGI_LANI063, sp, v3df_dontpan); else if (choose > 250) - madhandle = PlaySound(DIGI_LANI065,&sp->x,&sp->y,&sp->z,v3df_dontpan); + madhandle = PlaySound(DIGI_LANI065, sp, v3df_dontpan); else - madhandle = PlaySound(DIGI_LANI066,&sp->x,&sp->y,&sp->z,v3df_dontpan); + madhandle = PlaySound(DIGI_LANI066, sp, v3df_dontpan); } ChangeState(SpriteNum,s_SailorGirlThrow); u->WaitTics = SEC(1)+SEC(RANDOM_RANGE(3<<8)>>8); @@ -1984,13 +1984,13 @@ int DoPruneGirl(short SpriteNum) choose = STD_RANDOM_RANGE(1000); if (choose > 750) - madhandle = PlaySound(DIGI_LANI089,&sp->x,&sp->y,&sp->z,v3df_dontpan); + madhandle = PlaySound(DIGI_LANI089, sp, v3df_dontpan); else if (choose > 500) - madhandle = PlaySound(DIGI_LANI091,&sp->x,&sp->y,&sp->z,v3df_dontpan); + madhandle = PlaySound(DIGI_LANI091, sp, v3df_dontpan); else if (choose > 250) - madhandle = PlaySound(DIGI_LANI093,&sp->x,&sp->y,&sp->z,v3df_dontpan); + madhandle = PlaySound(DIGI_LANI093, sp, v3df_dontpan); else - madhandle = PlaySound(DIGI_LANI095,&sp->x,&sp->y,&sp->z,v3df_dontpan); + madhandle = PlaySound(DIGI_LANI095, sp, v3df_dontpan); } u->WaitTics = SEC(1)+SEC(RANDOM_RANGE(3<<8)>>8); u->FlagOwner = 0; @@ -2004,13 +2004,13 @@ int DoPruneGirl(short SpriteNum) choose = STD_RANDOM_RANGE(1000); if (choose > 990) - coyhandle = PlaySound(DIGI_PRUNECACKLE,&sp->x,&sp->y,&sp->z,v3df_dontpan); + coyhandle = PlaySound(DIGI_PRUNECACKLE, sp, v3df_dontpan); else if (choose > 985) - coyhandle = PlaySound(DIGI_PRUNECACKLE2,&sp->x,&sp->y,&sp->z,v3df_dontpan); + coyhandle = PlaySound(DIGI_PRUNECACKLE2, sp, v3df_dontpan); else if (choose > 980) - coyhandle = PlaySound(DIGI_PRUNECACKLE3,&sp->x,&sp->y,&sp->z,v3df_dontpan); + coyhandle = PlaySound(DIGI_PRUNECACKLE3, sp, v3df_dontpan); else if (choose > 975) - coyhandle = PlaySound(DIGI_LANI091,&sp->x,&sp->y,&sp->z,v3df_dontpan); + coyhandle = PlaySound(DIGI_LANI091, sp, v3df_dontpan); } } @@ -2055,13 +2055,13 @@ int NullPruneGirl(short SpriteNum) choose = RANDOM_RANGE(1000); if (choose > 750) - madhandle = PlaySound(DIGI_LANI089,&sp->x,&sp->y,&sp->z,v3df_dontpan); + madhandle = PlaySound(DIGI_LANI089, sp, v3df_dontpan); else if (choose > 500) - madhandle = PlaySound(DIGI_LANI091,&sp->x,&sp->y,&sp->z,v3df_dontpan); + madhandle = PlaySound(DIGI_LANI091, sp, v3df_dontpan); else if (choose > 250) - madhandle = PlaySound(DIGI_LANI093,&sp->x,&sp->y,&sp->z,v3df_dontpan); + madhandle = PlaySound(DIGI_LANI093, sp, v3df_dontpan); else - madhandle = PlaySound(DIGI_LANI095,&sp->x,&sp->y,&sp->z,v3df_dontpan); + madhandle = PlaySound(DIGI_LANI095, sp, v3df_dontpan); } u->WaitTics = SEC(1)+SEC(RANDOM_RANGE(3<<8)>>8); u->FlagOwner = 0; diff --git a/source/sw/src/network.cpp b/source/sw/src/network.cpp index d4c5db866..cba519ea4 100644 --- a/source/sw/src/network.cpp +++ b/source/sw/src/network.cpp @@ -1425,7 +1425,7 @@ getpackets(void) break; } - PlaySound(DIGI_PMESSAGE,&tp->posx,&tp->posy,&tp->posz,v3df_dontpan); + PlaySound(DIGI_PMESSAGE,tp,v3df_dontpan); memcpy(ds,&packbuf[3],packbufleng-3); ds[packbufleng-3] = 0; diff --git a/source/sw/src/ninja.cpp b/source/sw/src/ninja.cpp index 7059274c8..5a711fc44 100644 --- a/source/sw/src/ninja.cpp +++ b/source/sw/src/ninja.cpp @@ -1965,7 +1965,7 @@ DoNinjaHariKari(short SpriteNum) SET(sp->extra, SPRX_BREAKABLE); SET(sp->cstat, CSTAT_SPRITE_BREAKABLE); - PlaySound(DIGI_NINJAUZIATTACK,&sp->x,&sp->y,&sp->z,v3df_follow); + PlaySound(DIGI_NINJAUZIATTACK, sp, v3df_follow); SpawnBlood(SpriteNum, SpriteNum, -1, -1, -1, -1); @@ -2005,7 +2005,7 @@ DoNinjaGrabThroat(short SpriteNum) sp->xvel = 0; //u->jump_speed = -300; //DoActorBeginJump(SpriteNum); - PlaySound(DIGI_NINJASCREAM,&sp->x,&sp->y,&sp->z,v3df_follow); + PlaySound(DIGI_NINJASCREAM, sp, v3df_follow); } return 0; diff --git a/source/sw/src/panel.cpp b/source/sw/src/panel.cpp index 378896da2..bc308300e 100644 --- a/source/sw/src/panel.cpp +++ b/source/sw/src/panel.cpp @@ -266,7 +266,7 @@ void DoPlayerChooseYell(PLAYERp pp) choose_snd = STD_RANDOM_RANGE(MAX_YELLSOUNDS); if (pp == Player+myconnectindex) - PlayerSound(PlayerYellVocs[choose_snd],&pp->posx,&pp->posy,&pp->posz,v3df_follow|v3df_dontpan,pp); + PlayerSound(PlayerYellVocs[choose_snd], v3df_follow|v3df_dontpan,pp); } void ArmorCalc(int damage_amt, int *armor_damage, int *player_damage) @@ -353,13 +353,11 @@ void PlayerUpdateHealth(PLAYERp pp, short value) if (u->Health > 50) { - PlayerSound(PlayerPainVocs[choosesnd],&pp->posx, - &pp->posy,&pp->posy,v3df_dontpan|v3df_doppler|v3df_follow,pp); + PlayerSound(PlayerPainVocs[choosesnd],v3df_dontpan|v3df_doppler|v3df_follow,pp); } else { - PlayerSound(PlayerLowHealthPainVocs[choosesnd],&pp->posx, - &pp->posy,&pp->posy,v3df_dontpan|v3df_doppler|v3df_follow,pp); + PlayerSound(PlayerLowHealthPainVocs[choosesnd],v3df_dontpan|v3df_doppler|v3df_follow,pp); } } @@ -884,7 +882,7 @@ int WeaponOperate(PLAYERp pp) if (TEST(pp->Flags, PF_TWO_UZI)) { pp->WpnUziType++; - PlaySound(DIGI_UZI_UP, &pp->posx, &pp->posy, &pp->posz, v3df_follow); + PlaySound(DIGI_UZI_UP, pp, v3df_follow); if (pp->WpnUziType > 1) pp->WpnUziType = 0; } @@ -897,7 +895,7 @@ int WeaponOperate(PLAYERp pp) if (u->WeaponNum == WPN_MICRO) { pp->WpnRocketType++; - PlaySound(DIGI_ROCKET_UP, &pp->posx, &pp->posy, &pp->posz, v3df_follow); + PlaySound(DIGI_ROCKET_UP, pp, v3df_follow); if (pp->WpnRocketType > 2) pp->WpnRocketType = 0; if (pp->WpnRocketType == 2 && pp->WpnRocketNuke == 0) @@ -915,7 +913,7 @@ int WeaponOperate(PLAYERp pp) pp->WpnShotgunType++; if (pp->WpnShotgunType > 1) pp->WpnShotgunType = 0; - PlaySound(DIGI_SHOTGUN_UP, &pp->posx, &pp->posy, &pp->posz, v3df_follow); + PlaySound(DIGI_SHOTGUN_UP, pp, v3df_follow); } InitWeaponShotgun(pp); break; @@ -930,7 +928,7 @@ int WeaponOperate(PLAYERp pp) pp->WpnRailType = 0; } if (pp->WpnRailType == 1) - PlaySound(DIGI_RAIL_UP, &pp->posx, &pp->posy, &pp->posz, v3df_follow); + PlaySound(DIGI_RAIL_UP, pp, v3df_follow); #endif InitWeaponRail(pp); } @@ -951,7 +949,7 @@ int WeaponOperate(PLAYERp pp) pp->WpnFlameType = 0; // if(pp->Wpn[WPN_HOTHEAD]) pHotHeadOverlays(pp->Wpn[WPN_HOTHEAD], pp->WpnFlameType); - PlaySound(DIGI_HOTHEADSWITCH, &pp->posx, &pp->posy, &pp->posz, v3df_dontpan|v3df_follow); + PlaySound(DIGI_HOTHEADSWITCH, pp, v3df_dontpan|v3df_follow); } InitWeaponHothead(pp); @@ -1349,19 +1347,19 @@ InitWeaponSword(PLAYERp pp) psp->RestState = ps_SwordRest; pSetState(psp, psp->PresentState); - PlaySound(DIGI_SWORD_UP, &pp->posx, &pp->posy, &pp->posz, v3df_follow|v3df_dontpan); + PlaySound(DIGI_SWORD_UP, pp, v3df_follow|v3df_dontpan); if (pp == Player+myconnectindex) { rnd_num = STD_RANDOM_RANGE(1024); if (rnd_num > 900) - PlaySound(DIGI_TAUNTAI2, &pp->posx, &pp->posy, &pp->posz, v3df_follow|v3df_dontpan); + PlaySound(DIGI_TAUNTAI2, pp, v3df_follow|v3df_dontpan); else if (rnd_num > 800) - PlaySound(DIGI_PLAYERYELL1, &pp->posx, &pp->posy, &pp->posz, v3df_follow|v3df_dontpan); + PlaySound(DIGI_PLAYERYELL1, pp, v3df_follow|v3df_dontpan); else if (rnd_num > 700) - PlaySound(DIGI_PLAYERYELL2, &pp->posx, &pp->posy, &pp->posz, v3df_follow|v3df_dontpan); + PlaySound(DIGI_PLAYERYELL2, pp, v3df_follow|v3df_dontpan); else if (rnd_num > 600) - PlayerSound(DIGI_ILIKESWORD,&pp->posx,&pp->posy,&pp->posz,v3df_follow|v3df_dontpan,pp); + PlayerSound(DIGI_ILIKESWORD, v3df_follow|v3df_dontpan,pp); } FLAG_KEY_RELEASE(psp->PlayerP, SK_SHOOT); @@ -1820,11 +1818,11 @@ InitWeaponStar(PLAYERp pp) //psp->RestState = ps_ThrowStar; pSetState(psp, psp->PresentState); - PlaySound(DIGI_PULL, &pp->posx, &pp->posy, &pp->posz, v3df_follow|v3df_dontpan); + PlaySound(DIGI_PULL, pp, v3df_follow|v3df_dontpan); if (STD_RANDOM_RANGE(1000) > 900 && pp == Player+myconnectindex) { if (!sw_darts) - PlayerSound(DIGI_ILIKESHURIKEN,&pp->posx,&pp->posy,&pp->posz,v3df_follow|v3df_dontpan,pp); + PlayerSound(DIGI_ILIKESHURIKEN, v3df_follow|v3df_dontpan,pp); } FLAG_KEY_RELEASE(psp->PlayerP, SK_SHOOT); @@ -2196,8 +2194,7 @@ pSpawnUziClip(PANEL_SPRITEp gun) { PANEL_SPRITEp New; - PlaySound(DIGI_REMOVECLIP, &gun->PlayerP->posx, &gun->PlayerP->posy, - &gun->PlayerP->posz,v3df_follow|v3df_dontpan|v3df_doppler|v3df_follow); + PlaySound(DIGI_REMOVECLIP, gun->PlayerP,v3df_follow|v3df_dontpan|v3df_doppler|v3df_follow); if (TEST(gun->flags, PANF_XFLIP)) { @@ -2279,8 +2276,7 @@ pUziReload(PANEL_SPRITEp nclip) { if (nclip->x < gun->x) { - PlaySound(DIGI_REPLACECLIP, &nclip->PlayerP->posx, &nclip->PlayerP->posy, - &nclip->PlayerP->posz,v3df_follow|v3df_dontpan|v3df_doppler); + PlaySound(DIGI_REPLACECLIP, nclip->PlayerP,v3df_follow|v3df_dontpan|v3df_doppler); nclip->x = gun->x - UZI_CLIP_XOFF; nclip->y = gun->y + UZI_CLIP_YOFF; @@ -2294,8 +2290,7 @@ pUziReload(PANEL_SPRITEp nclip) { if (nclip->x > gun->x) { - PlaySound(DIGI_REPLACECLIP, &nclip->PlayerP->posx, &nclip->PlayerP->posy, - &nclip->PlayerP->posz,v3df_follow|v3df_dontpan|v3df_doppler); + PlaySound(DIGI_REPLACECLIP, nclip->PlayerP,v3df_follow|v3df_dontpan|v3df_doppler); nclip->x = gun->x + UZI_CLIP_XOFF; nclip->y = gun->y + UZI_CLIP_YOFF; @@ -2523,7 +2518,7 @@ InitWeaponUzi(PLAYERp pp) InitWeaponUzi2(psp); } - PlaySound(DIGI_UZI_UP, &pp->posx, &pp->posy, &pp->posz, v3df_follow); + PlaySound(DIGI_UZI_UP, pp, v3df_follow); FLAG_KEY_RELEASE(psp->PlayerP, SK_SHOOT); FLAG_KEY_RESET(psp->PlayerP, SK_SHOOT); @@ -3231,7 +3226,7 @@ InitWeaponShotgun(PLAYERp pp) psp->RestState = ps_ShotgunRest; pSetState(psp, psp->PresentState); - PlaySound(DIGI_SHOTGUN_UP, &pp->posx, &pp->posy, &pp->posz, v3df_follow); + PlaySound(DIGI_SHOTGUN_UP, pp, v3df_follow); FLAG_KEY_RELEASE(psp->PlayerP, SK_SHOOT); FLAG_KEY_RESET(psp->PlayerP, SK_SHOOT); @@ -3315,8 +3310,7 @@ pShotgunReloadDown(PANEL_SPRITEp psp) if (psp->y >= SHOTGUN_YOFF + (tilesiz[picnum].y/2)) { - PlaySound(DIGI_ROCKET_UP, &psp->PlayerP->posx, &psp->PlayerP->posy, - &psp->PlayerP->posz,v3df_follow|v3df_dontpan|v3df_doppler); + PlaySound(DIGI_ROCKET_UP, psp->PlayerP,v3df_follow|v3df_dontpan|v3df_doppler); psp->y = SHOTGUN_YOFF + (tilesiz[picnum].y/2); @@ -3333,8 +3327,7 @@ pShotgunReloadUp(PANEL_SPRITEp psp) if (psp->y < SHOTGUN_YOFF) { - PlaySound(DIGI_SHOTGUN_UP, &psp->PlayerP->posx, &psp->PlayerP->posy, - &psp->PlayerP->posz,v3df_follow|v3df_dontpan|v3df_doppler); + PlaySound(DIGI_SHOTGUN_UP, psp->PlayerP,v3df_follow|v3df_dontpan|v3df_doppler); psp->y = SHOTGUN_YOFF; @@ -3746,8 +3739,8 @@ InitWeaponRail(PLAYERp pp) psp->RestState = ps_RailRest; pSetState(psp, psp->PresentState); - PlaySound(DIGI_RAIL_UP, &pp->posx, &pp->posy, &pp->posz, v3df_follow); - railvochandle = PlaySound(DIGI_RAILREADY, &pp->posx, &pp->posy, &pp->posz, v3df_follow|v3df_dontpan); + PlaySound(DIGI_RAIL_UP, pp, v3df_follow); + railvochandle = PlaySound(DIGI_RAILREADY, pp, v3df_follow|v3df_dontpan); Set3DSoundOwner(psp->PlayerP->PlayerSprite); FLAG_KEY_RELEASE(psp->PlayerP, SK_SHOOT); @@ -4206,7 +4199,7 @@ InitWeaponHothead(PLAYERp pp) psp->over[0].xoff = HOTHEAD_FINGER_XOFF; psp->over[0].yoff = HOTHEAD_FINGER_YOFF; - PlaySound(DIGI_GRDALERT, &pp->posx, &pp->posy, &pp->posz, v3df_follow|v3df_dontpan); + PlaySound(DIGI_GRDALERT, pp, v3df_follow|v3df_dontpan); } void @@ -4649,7 +4642,7 @@ InitWeaponMicro(PLAYERp pp) if (pp->WpnRocketType == 2 && !pp->InitingNuke && !pp->NukeInitialized) pp->TestNukeInit = pp->InitingNuke = TRUE; - PlaySound(DIGI_ROCKET_UP, &pp->posx, &pp->posy, &pp->posz, v3df_follow); + PlaySound(DIGI_ROCKET_UP, pp, v3df_follow); FLAG_KEY_RELEASE(psp->PlayerP, SK_SHOOT); FLAG_KEY_RESET(psp->PlayerP, SK_SHOOT); @@ -4892,11 +4885,9 @@ pMicroRest(PANEL_SPRITEp psp) { choose_voc = STD_RANDOM_RANGE(1024); if (choose_voc > 600) - PlayerSound(DIGI_TAUNTAI2,&psp->PlayerP->posx, - &psp->PlayerP->posy,&psp->PlayerP->posy,v3df_dontpan|v3df_follow,psp->PlayerP); + PlayerSound(DIGI_TAUNTAI2,v3df_dontpan|v3df_follow,psp->PlayerP); else if (choose_voc > 300) - PlayerSound(DIGI_TAUNTAI4,&psp->PlayerP->posx, - &psp->PlayerP->posy,&psp->PlayerP->posy,v3df_dontpan|v3df_follow,psp->PlayerP); + PlayerSound(DIGI_TAUNTAI4,v3df_dontpan|v3df_follow,psp->PlayerP); } } @@ -4969,7 +4960,7 @@ pMicroFire(PANEL_SPRITEp psp) InitRocket(psp->PlayerP); break; case 2: - PlaySound(DIGI_WARNING,&psp->PlayerP->posx,&psp->PlayerP->posy,&psp->PlayerP->posz,v3df_dontpan|v3df_follow); + PlaySound(DIGI_WARNING,psp->PlayerP,v3df_dontpan|v3df_follow); InitNuke(psp->PlayerP); psp->PlayerP->NukeInitialized = FALSE; break; @@ -5017,7 +5008,7 @@ pMicroStandBy(PANEL_SPRITEp psp) pMicroOverlays(psp); pp->nukevochandle = - PlaySound(DIGI_NUKESTDBY, &psp->PlayerP->posx, &psp->PlayerP->posy, &psp->PlayerP->posz, v3df_follow|v3df_dontpan); + PlaySound(DIGI_NUKESTDBY, psp->PlayerP, v3df_follow|v3df_dontpan); } void @@ -5026,7 +5017,7 @@ pMicroCount(PANEL_SPRITEp psp) PLAYERp pp = psp->PlayerP; pp->nukevochandle = - PlaySound(DIGI_NUKECDOWN, &psp->PlayerP->posx, &psp->PlayerP->posy, &psp->PlayerP->posz, v3df_follow|v3df_dontpan); + PlaySound(DIGI_NUKECDOWN, pp, v3df_follow|v3df_dontpan); } void @@ -5035,7 +5026,7 @@ pMicroReady(PANEL_SPRITEp psp) PLAYERp pp = psp->PlayerP; pp->nukevochandle = - PlaySound(DIGI_NUKEREADY, &psp->PlayerP->posx, &psp->PlayerP->posy, &psp->PlayerP->posz, v3df_follow|v3df_dontpan); + PlaySound(DIGI_NUKEREADY, pp, v3df_follow|v3df_dontpan); pp->NukeInitialized = TRUE; } @@ -5136,7 +5127,7 @@ InitWeaponHeart(PLAYERp pp) pp->WpnUziType = 2; // Make uzi's go away! RetractCurWpn(pp); - PlaySound(DIGI_HEARTBEAT, &pp->posx, &pp->posy, &pp->posz, v3df_follow|v3df_dontpan|v3df_doppler); + PlaySound(DIGI_HEARTBEAT, pp, v3df_follow|v3df_dontpan|v3df_doppler); // Set up the new Weapon variables psp = pp->CurWpn = pp->Wpn[WPN_HEART]; @@ -5281,9 +5272,9 @@ pHeartAttack(PANEL_SPRITEp psp) //int InitHeartAttack(PLAYERp pp); // CTW MODIFICATION END - PlaySound(DIGI_HEARTFIRE,&pp->posx,&pp->posy,&pp->posz,v3df_follow|v3df_dontpan); + PlaySound(DIGI_HEARTFIRE, pp, v3df_follow|v3df_dontpan); if (RANDOM_RANGE(1000) > 800) - PlayerSound(DIGI_JG9009,&pp->posx,&pp->posy,&pp->posz,v3df_follow|v3df_dontpan,pp); + PlayerSound(DIGI_JG9009, v3df_follow|v3df_dontpan,pp); InitHeartAttack(psp->PlayerP); } @@ -5400,7 +5391,7 @@ SpawnSmallHeartBlood(PANEL_SPRITEp psp) {0, 0, 0, 0, 0, 0, 0, {0,0}}, }; - PlaySound(DIGI_HEARTBEAT, &pp->posx, &pp->posy, &pp->posz, v3df_follow|v3df_dontpan|v3df_doppler); + PlaySound(DIGI_HEARTBEAT, pp, v3df_follow|v3df_dontpan|v3df_doppler); for (hsp = HeartShrap; hsp->lo_jump_speed; hsp++) { @@ -5645,7 +5636,7 @@ InitWeaponGrenade(PLAYERp pp) pGrenadePresentSetup(psp); - PlaySound(DIGI_GRENADE_UP, &pp->posx, &pp->posy, &pp->posz, v3df_follow); + PlaySound(DIGI_GRENADE_UP, pp, v3df_follow); FLAG_KEY_RELEASE(psp->PlayerP, SK_SHOOT); FLAG_KEY_RESET(psp->PlayerP, SK_SHOOT); @@ -5931,7 +5922,7 @@ InitWeaponMine(PLAYERp pp) psp->RestState = ps_MineRest; pSetState(psp, psp->PresentState); - PlaySound(DIGI_PULL, &pp->posx, &pp->posy, &pp->posz, v3df_follow|v3df_dontpan); + PlaySound(DIGI_PULL, pp, v3df_follow|v3df_dontpan); FLAG_KEY_RELEASE(psp->PlayerP, SK_SHOOT); FLAG_KEY_RESET(psp->PlayerP, SK_SHOOT); @@ -5942,7 +5933,7 @@ pMineUpSound(PANEL_SPRITEp psp) { PLAYERp pp = psp->PlayerP; - PlaySound(DIGI_MINE_UP, &pp->posx, &pp->posy, &pp->posz, v3df_follow); + PlaySound(DIGI_MINE_UP, pp, v3df_follow); } void @@ -6191,10 +6182,10 @@ InitChops(PLAYERp pp) psp->RetractState = ps_ChopsRetract; psp->RestState = ps_ChopsAttack1; - PlaySound(DIGI_BUZZZ,&psp->PlayerP->posx,&psp->PlayerP->posy,&psp->PlayerP->posz,v3df_none); + PlaySound(DIGI_BUZZZ, psp->PlayerP,v3df_none); if (RANDOM_RANGE(1000) > 750) - PlayerSound(DIGI_MRFLY,&psp->PlayerP->posx,&psp->PlayerP->posy,&psp->PlayerP->posz,v3df_follow|v3df_dontpan,psp->PlayerP); + PlayerSound(DIGI_MRFLY,v3df_follow|v3df_dontpan,psp->PlayerP); } @@ -6202,15 +6193,15 @@ void pChopsClick(PANEL_SPRITEp psp) { int16_t rnd_rng; - PlaySound(DIGI_CHOP_CLICK,&psp->PlayerP->posx,&psp->PlayerP->posy,&psp->PlayerP->posz,v3df_none); + PlaySound(DIGI_CHOP_CLICK,psp->PlayerP,v3df_none); rnd_rng = RANDOM_RANGE(1000); if (rnd_rng > 950) - PlayerSound(DIGI_SEARCHWALL,&psp->PlayerP->posx,&psp->PlayerP->posy,&psp->PlayerP->posz,v3df_follow|v3df_dontpan,psp->PlayerP); + PlayerSound(DIGI_SEARCHWALL,v3df_follow|v3df_dontpan,psp->PlayerP); else if (rnd_rng > 900) - PlayerSound(DIGI_EVADEFOREVER,&psp->PlayerP->posx,&psp->PlayerP->posy,&psp->PlayerP->posz,v3df_follow|v3df_dontpan,psp->PlayerP); + PlayerSound(DIGI_EVADEFOREVER,v3df_follow|v3df_dontpan,psp->PlayerP); else if (rnd_rng > 800) - PlayerSound(DIGI_SHISEISI,&psp->PlayerP->posx,&psp->PlayerP->posy,&psp->PlayerP->posz,v3df_follow|v3df_dontpan,psp->PlayerP); + PlayerSound(DIGI_SHISEISI,v3df_follow|v3df_dontpan,psp->PlayerP); } void @@ -6273,7 +6264,7 @@ pChopsWait(PANEL_SPRITEp psp) // do a random attack here psp->x = CHOPS_XOFF + (RANDOM_P2(128) - 64); - PlaySound(DIGI_BUZZZ,&psp->PlayerP->posx,&psp->PlayerP->posy,&psp->PlayerP->posz,v3df_none); + PlaySound(DIGI_BUZZZ,psp->PlayerP,v3df_none); pSetState(psp, psp_ChopsAttack[RANDOM_RANGE(SIZ(psp_ChopsAttack))]); } } @@ -6296,7 +6287,7 @@ pChopsRetract(PANEL_SPRITEp psp) if (psp->y >= CHOPS_YOFF + tilesiz[picnum].y) { if (RANDOM_RANGE(1000) > 800) - PlayerSound(DIGI_GETTINGSTIFF,&psp->PlayerP->posx,&psp->PlayerP->posy,&psp->PlayerP->posz,v3df_follow|v3df_dontpan,psp->PlayerP); + PlayerSound(DIGI_GETTINGSTIFF,v3df_follow|v3df_dontpan,psp->PlayerP); psp->PlayerP->Chops = NULL; pKillSprite(psp); } @@ -6604,11 +6595,11 @@ InitWeaponFist(PLAYERp pp) rnd_num = RANDOM_P2(1024); if (rnd_num > 900) - PlaySound(DIGI_TAUNTAI2, &pp->posx, &pp->posy, &pp->posz, v3df_follow|v3df_dontpan); + PlaySound(DIGI_TAUNTAI2, pp, v3df_follow|v3df_dontpan); else if (rnd_num > 800) - PlaySound(DIGI_PLAYERYELL1, &pp->posx, &pp->posy, &pp->posz, v3df_follow|v3df_dontpan); + PlaySound(DIGI_PLAYERYELL1, pp, v3df_follow|v3df_dontpan); else if (rnd_num > 700) - PlaySound(DIGI_PLAYERYELL2, &pp->posx, &pp->posy, &pp->posz, v3df_follow|v3df_dontpan); + PlaySound(DIGI_PLAYERYELL2, pp, v3df_follow|v3df_dontpan); FLAG_KEY_RELEASE(psp->PlayerP, SK_SHOOT); FLAG_KEY_RESET(psp->PlayerP, SK_SHOOT); diff --git a/source/sw/src/player.cpp b/source/sw/src/player.cpp index 7d57ee680..65911f530 100644 --- a/source/sw/src/player.cpp +++ b/source/sw/src/player.cpp @@ -1456,7 +1456,7 @@ DoPlayerWarpTeleporter(PLAYERp pp) default: DoPlayerTeleportToSprite(pp, sp_warp); - PlaySound(DIGI_TELEPORT, &pp->posx, &pp->posy, &pp->posz, v3df_none); + PlaySound(DIGI_TELEPORT, pp, v3df_none); DoPlayerResetMovement(pp); @@ -3637,7 +3637,7 @@ void StackedWaterSplash(PLAYERp pp) if (sectnum >= 0 && SectorIsUnderwaterArea(sectnum)) { - PlaySound(DIGI_SPLASH1, &pp->posx, &pp->posy, &pp->posz, v3df_dontpan); + PlaySound(DIGI_SPLASH1, pp, v3df_dontpan); } } } @@ -3677,8 +3677,7 @@ DoPlayerFall(PLAYERp pp) if (pp->jump_speed > 2000) { - PlayerSound(DIGI_FALLSCREAM, &pp->posx, &pp->posy, &pp->posz, - v3df_dontpan|v3df_doppler|v3df_follow,pp); + PlayerSound(DIGI_FALLSCREAM, v3df_dontpan|v3df_doppler|v3df_follow,pp); } else if (pp->jump_speed > 1300) { @@ -3719,13 +3718,13 @@ DoPlayerFall(PLAYERp pp) if (sectu && (TEST(sectp->extra, SECTFX_LIQUID_MASK) != SECTFX_LIQUID_NONE)) { - PlaySound(DIGI_SPLASH1, &pp->posx, &pp->posy, &pp->posz, v3df_dontpan); + PlaySound(DIGI_SPLASH1, pp, v3df_dontpan); } else { if (pp->jump_speed > 1020) // Feet hitting ground sound - PlaySound(DIGI_HITGROUND, &pp->posx, &pp->posy, &pp->posz, v3df_follow|v3df_dontpan); + PlaySound(DIGI_HITGROUND, pp, v3df_follow|v3df_dontpan); } // i any kind of crawl key get rid of recoil @@ -3748,7 +3747,7 @@ DoPlayerFall(PLAYERp pp) if (pp->jump_speed > 1700 && depth == 0) { - PlayerSound(DIGI_PLAYERPAIN2, &pp->posx, &pp->posy, &pp->posz, v3df_follow|v3df_dontpan,pp); + PlayerSound(DIGI_PLAYERPAIN2, v3df_follow|v3df_dontpan,pp); // PlayerUpdateHealth(pp, -RANDOM_RANGE(PLAYER_FALL_DAMAGE_AMOUNT) - 2); if (pp->jump_speed > 1700 && pp->jump_speed < 4000) @@ -4686,7 +4685,7 @@ PlayerCanDiveNoWarp(PLAYERp pp) pp->z_speed = Z(20); pp->jump_speed = 0; - PlaySound(DIGI_SPLASH1, &pp->posx, &pp->posy, &pp->posz, v3df_dontpan); + PlaySound(DIGI_SPLASH1, pp, v3df_dontpan); DoPlayerBeginDiveNoWarp(pp); return TRUE; } @@ -5152,7 +5151,7 @@ DoPlayerStopDiveNoWarp(PLAYERp pp) StopPlayerSound(pp); // stop diving no warp - PlayerSound(DIGI_SURFACE,&pp->posx,&pp->posy,&pp->posz,v3df_dontpan|v3df_follow|v3df_doppler,pp); + PlayerSound(DIGI_SURFACE, v3df_dontpan|v3df_follow|v3df_doppler,pp); pp->bob_amt = 0; @@ -5183,7 +5182,7 @@ DoPlayerStopDive(PLAYERp pp) StopPlayerSound(pp); // stop diving with warp - PlayerSound(DIGI_SURFACE,&pp->posx,&pp->posy,&pp->posz,v3df_dontpan|v3df_follow|v3df_doppler,pp); + PlayerSound(DIGI_SURFACE, v3df_dontpan|v3df_follow|v3df_doppler,pp); pp->bob_amt = 0; DoPlayerWarpToSurface(pp); @@ -5268,7 +5267,7 @@ DoPlayerDive(PLAYERp pp) { pp->DiveDamageTics = PLAYER_DIVE_DAMAGE_TIME; //PlayerUpdateHealth(pp, PLAYER_DIVE_DAMAGE_AMOUNT); - PlayerSound(DIGI_WANGDROWNING, &pp->posx, &pp->posy, &pp->posz, v3df_dontpan|v3df_follow, pp); + PlayerSound(DIGI_WANGDROWNING, v3df_dontpan|v3df_follow, pp); PlayerUpdateHealth(pp, -3 -(RANDOM_RANGE(7<<8)>>8)); PlayerCheckDeath(pp, -1); if (TEST(pp->Flags, PF_DEAD)) @@ -5407,7 +5406,7 @@ DoPlayerDive(PLAYERp pp) // Random bubble sounds // if((RANDOM_RANGE(1000<<5)>>5) < 100) - // PlaySound(DIGI_BUBBLES, &pp->posx, &pp->posy, &pp->posz, v3df_dontpan|v3df_follow); + // PlaySound(DIGI_BUBBLES, pp, v3df_dontpan|v3df_follow); if ((!Prediction && pp->z_speed && ((RANDOM_P2(1024<<5)>>5) < 64)) || (PLAYER_MOVING(pp) && (RANDOM_P2(1024<<5)>>5) < 64)) @@ -5417,7 +5416,7 @@ DoPlayerDive(PLAYERp pp) SPRITEp bp; int nx,ny; - PlaySound(DIGI_BUBBLES, &pp->posx, &pp->posy, &pp->posz, v3df_none); + PlaySound(DIGI_BUBBLES, pp, v3df_none); bubble = SpawnBubble(pp->SpriteP - sprite); if (bubble >= 0) { @@ -5871,7 +5870,7 @@ DoPlayerBeginOperate(PLAYERp pp) } else { - PlayerSound(DIGI_USEBROKENVEHICLE, &pp->posx, &pp->posy, &pp->posz, v3df_follow|v3df_dontpan,pp); + PlayerSound(DIGI_USEBROKENVEHICLE, v3df_follow|v3df_dontpan,pp); return; } } @@ -5959,7 +5958,7 @@ DoPlayerBeginRemoteOperate(PLAYERp pp, SECTOR_OBJECTp sop) } else { - PlayerSound(DIGI_USEBROKENVEHICLE, &pp->posx, &pp->posy, &pp->posz, v3df_follow|v3df_dontpan,pp); + PlayerSound(DIGI_USEBROKENVEHICLE, v3df_follow|v3df_dontpan,pp); return; } } @@ -6312,9 +6311,9 @@ DoPlayerDeathFall(PLAYERp pp) SpawnSplash(pp->PlayerSprite); if (RANDOM_RANGE(1000) > 500) - PlaySound(DIGI_BODYFALL1, &pp->posx, &pp->posy, &pp->posz, v3df_dontpan); + PlaySound(DIGI_BODYFALL1, pp, v3df_dontpan); else - PlaySound(DIGI_BODYFALL2, &pp->posx, &pp->posy, &pp->posz, v3df_dontpan); + PlaySound(DIGI_BODYFALL2, pp, v3df_dontpan); pp->posz = loz - PLAYER_DEATH_HEIGHT; RESET(pp->Flags, PF_FALLING); @@ -6474,21 +6473,12 @@ DoPlayerBeginDie(PLAYERp pp) if (GodMode) return; - // Override any previous talking, death scream has precedance - if (pp->PlayerTalking) - { - if (FX_SoundValidAndActive(pp->TalkVocHandle)) - FX_StopSound(pp->TalkVocHandle); - pp->PlayerTalking = FALSE; - pp->TalkVocnum = -1; - pp->TalkVocHandle = -1; - } + StopPlayerSound(pp); // Do the death scream choosesnd = RANDOM_RANGE(MAX_PAIN); - PlayerSound(PlayerLowHealthPainVocs[choosesnd],&pp->posx, - &pp->posy,&pp->posy,v3df_dontpan|v3df_doppler|v3df_follow,pp); + PlayerSound(PlayerLowHealthPainVocs[choosesnd],v3df_dontpan|v3df_doppler|v3df_follow,pp); #if 0 if (!CommEnabled && numplayers <= 1 && QuickLoadNum >= 0) @@ -6618,7 +6608,7 @@ DoPlayerBeginDie(PLAYERp pp) case PLAYER_DEATH_FLIP: case PLAYER_DEATH_RIPPER: - //PlaySound(DIGI_SCREAM1, &pp->posx, &pp->posy, &pp->posz, v3df_dontpan|v3df_follow); + //PlaySound(DIGI_SCREAM1, pp, v3df_dontpan|v3df_follow); SET(pp->Flags, PF_JUMPING); u->ID = NINJA_DEAD; @@ -6636,7 +6626,7 @@ DoPlayerBeginDie(PLAYERp pp) break; case PLAYER_DEATH_CRUMBLE: - PlaySound(DIGI_BODYSQUISH1, &pp->posx, &pp->posy, &pp->posz, v3df_dontpan); + PlaySound(DIGI_BODYSQUISH1, pp, v3df_dontpan); SET(pp->Flags, PF_DEAD_HEAD | PF_JUMPING); pp->jump_speed = -300; @@ -6652,7 +6642,7 @@ DoPlayerBeginDie(PLAYERp pp) break; case PLAYER_DEATH_EXPLODE: - PlaySound(DIGI_BODYSQUISH1, &pp->posx, &pp->posy, &pp->posz, v3df_dontpan); + PlaySound(DIGI_BODYSQUISH1, pp, v3df_dontpan); SET(pp->Flags, PF_DEAD_HEAD | PF_JUMPING); pp->jump_speed = -650; @@ -6669,7 +6659,7 @@ DoPlayerBeginDie(PLAYERp pp) break; case PLAYER_DEATH_SQUISH: - PlaySound(DIGI_BODYCRUSHED1, &pp->posx, &pp->posy, &pp->posz, v3df_dontpan); + PlaySound(DIGI_BODYCRUSHED1, pp, v3df_dontpan); SET(pp->Flags, PF_DEAD_HEAD | PF_JUMPING); pp->jump_speed = 200; @@ -6769,7 +6759,7 @@ void DoPlayerDeathHurl(PLAYERp pp) { SpawnShrap(pp->PlayerSprite, -1); if (RANDOM_RANGE(1000) > 400) - PlayerSound(DIGI_DHVOMIT, &pp->posx, &pp->posy, &pp->posz, v3df_dontpan|v3df_follow,pp); + PlayerSound(DIGI_DHVOMIT, v3df_dontpan|v3df_follow,pp); } return; } @@ -6854,7 +6844,7 @@ void DoPlayerDeathCheckKeys(PLAYERp pp) pp->SpriteP->ang = pp->pang; DoSpawnTeleporterEffect(pp->SpriteP); - PlaySound(DIGI_TELEPORT, &pp->posx, &pp->posy, &pp->posz, v3df_none); + PlaySound(DIGI_TELEPORT, pp, v3df_none); DoPlayerZrange(pp); @@ -7006,7 +6996,7 @@ void DoPlayerDeathMoveHead(PLAYERp pp) short hit_sprite = -2; SPRITEp hsp; - //PlaySound(DIGI_DHCLUNK, &pp->posx, &pp->posy, &pp->posz, v3df_dontpan); + //PlaySound(DIGI_DHCLUNK, pp, v3df_dontpan); hit_sprite = NORM_SPRITE(u->ret); hsp = &sprite[hit_sprite]; @@ -7026,7 +7016,7 @@ void DoPlayerDeathMoveHead(PLAYERp pp) { short w,nw,wall_ang,dang; - //PlaySound(DIGI_DHCLUNK, &pp->posx, &pp->posy, &pp->posz, v3df_dontpan); + //PlaySound(DIGI_DHCLUNK, pp, v3df_dontpan); w = NORM_WALL(u->ret); diff --git a/source/sw/src/quake.cpp b/source/sw/src/quake.cpp index 2e4ce0dcd..0c9533b48 100644 --- a/source/sw/src/quake.cpp +++ b/source/sw/src/quake.cpp @@ -273,7 +273,7 @@ int SpawnQuake(short sectnum, int x, int y, int z, QUAKE_AngAmt(sp) = 8; QUAKE_PosAmt(sp) = 0; - PlaySound(DIGI_ERUPTION, &sp->x, &sp->y, &sp->z, v3df_follow|v3df_dontpan); + PlaySound(DIGI_ERUPTION, sp, v3df_follow|v3df_dontpan); Set3DSoundOwner(SpriteNum); return SpriteNum; diff --git a/source/sw/src/ripper2.cpp b/source/sw/src/ripper2.cpp index e8a961a16..57708c100 100644 --- a/source/sw/src/ripper2.cpp +++ b/source/sw/src/ripper2.cpp @@ -1251,7 +1251,7 @@ int DoRipper2StandHeart(short SpriteNum) NullRipper2(SpriteNum); if (!FX_SoundValidAndActive(riphearthandle)) - riphearthandle = PlaySound(DIGI_RIPPER2HEARTOUT,&sp->x,&sp->y,&sp->z,v3df_none); + riphearthandle = PlaySound(DIGI_RIPPER2HEARTOUT, sp, v3df_none); if ((u->WaitTics -= ACTORMOVETICS) <= 0) NewStateGroup(SpriteNum, sg_Ripper2Run); @@ -1375,7 +1375,7 @@ int ChestRipper2(short SpriteNum) { SPRITEp sp = &sprite[SpriteNum]; - PlaySound(DIGI_RIPPER2CHEST,&sp->x,&sp->y,&sp->z,v3df_follow); + PlaySound(DIGI_RIPPER2CHEST, sp, v3df_follow); return 0; } diff --git a/source/sw/src/save.cpp b/source/sw/src/save.cpp index d4ec3501f..2a9ab55ec 100644 --- a/source/sw/src/save.cpp +++ b/source/sw/src/save.cpp @@ -1229,9 +1229,6 @@ bool GameInterface::LoadGame(FSaveGameNode* sv) TRAVERSE_CONNECT(i) { - Player[i].PlayerTalking = FALSE; - Player[i].TalkVocnum = -1; - Player[i].TalkVocHandle = -1; Player[i].StartColor = 0; } diff --git a/source/sw/src/sector.cpp b/source/sw/src/sector.cpp index d393242e2..833ccf04d 100644 --- a/source/sw/src/sector.cpp +++ b/source/sw/src/sector.cpp @@ -861,7 +861,7 @@ DoSpawnActorTrigger(short match) if (ActorSpawn(sp)) { DoSpawnTeleporterEffectPlace(sp); - PlaySound(DIGI_PLAYER_TELEPORT, &sp->x, &sp->y, &sp->z, v3df_none); + PlaySound(DIGI_PLAYER_TELEPORT, sp, v3df_none); spawn_count++; } } @@ -1285,12 +1285,12 @@ DoSoundSpotMatch(short match, short sound_num, short sound_type) if (pp) { if (pp == Player+myconnectindex) - PlayerSound(snd2play,&pp->posx,&pp->posy,&pp->posz,v3df_dontpan|v3df_follow,pp); + PlayerSound(snd2play, v3df_dontpan|v3df_follow,pp); } } else { - PlaySound(snd2play, &sp->x, &sp->y, &sp->z, flags); + PlaySound(snd2play, sp, flags); //if (TEST(flags, v3df_follow)) // Just set it anyway Set3DSoundOwner(sn); @@ -1724,68 +1724,68 @@ OperateSprite(short SpriteNum, short player_is_operating) if (sp->lotag == CARGIRL_R0) { if (choose_snd > 700) - PlayerSound(DIGI_JG44052,&pp->posx,&pp->posy,&pp->posz,v3df_dontpan|v3df_follow,pp); + PlayerSound(DIGI_JG44052, v3df_dontpan|v3df_follow,pp); else if (choose_snd > 500) - PlayerSound(DIGI_JG45014,&pp->posx,&pp->posy,&pp->posz,v3df_dontpan|v3df_follow,pp); + PlayerSound(DIGI_JG45014, v3df_dontpan|v3df_follow,pp); else if (choose_snd > 250) - PlayerSound(DIGI_JG44068,&pp->posx,&pp->posy,&pp->posz,v3df_dontpan|v3df_follow,pp); + PlayerSound(DIGI_JG44068, v3df_dontpan|v3df_follow,pp); else - PlayerSound(DIGI_JG45010,&pp->posx,&pp->posy,&pp->posz,v3df_dontpan|v3df_follow,pp); + PlayerSound(DIGI_JG45010, v3df_dontpan|v3df_follow,pp); } else if (sp->lotag == MECHANICGIRL_R0) { if (choose_snd > 700) - PlayerSound(DIGI_JG44027,&pp->posx,&pp->posy,&pp->posz,v3df_dontpan|v3df_follow,pp); + PlayerSound(DIGI_JG44027, v3df_dontpan|v3df_follow,pp); else if (choose_snd > 500) - PlayerSound(DIGI_JG44038,&pp->posx,&pp->posy,&pp->posz,v3df_dontpan|v3df_follow,pp); + PlayerSound(DIGI_JG44038, v3df_dontpan|v3df_follow,pp); else if (choose_snd > 250) - PlayerSound(DIGI_JG44039,&pp->posx,&pp->posy,&pp->posz,v3df_dontpan|v3df_follow,pp); + PlayerSound(DIGI_JG44039, v3df_dontpan|v3df_follow,pp); else - PlayerSound(DIGI_JG44048,&pp->posx,&pp->posy,&pp->posz,v3df_dontpan|v3df_follow,pp); + PlayerSound(DIGI_JG44048, v3df_dontpan|v3df_follow,pp); } else if (sp->lotag == SAILORGIRL_R0) { if (choose_snd > 700) - PlayerSound(DIGI_JG45018,&pp->posx,&pp->posy,&pp->posz,v3df_dontpan|v3df_follow,pp); + PlayerSound(DIGI_JG45018, v3df_dontpan|v3df_follow,pp); else if (choose_snd > 500) - PlayerSound(DIGI_JG45030,&pp->posx,&pp->posy,&pp->posz,v3df_dontpan|v3df_follow,pp); + PlayerSound(DIGI_JG45030, v3df_dontpan|v3df_follow,pp); else if (choose_snd > 250) - PlayerSound(DIGI_JG45033,&pp->posx,&pp->posy,&pp->posz,v3df_dontpan|v3df_follow,pp); + PlayerSound(DIGI_JG45033, v3df_dontpan|v3df_follow,pp); else - PlayerSound(DIGI_JG45043,&pp->posx,&pp->posy,&pp->posz,v3df_dontpan|v3df_follow,pp); + PlayerSound(DIGI_JG45043, v3df_dontpan|v3df_follow,pp); } else if (sp->lotag == PRUNEGIRL_R0) { if (choose_snd > 700) - PlayerSound(DIGI_JG45053,&pp->posx,&pp->posy,&pp->posz,v3df_dontpan|v3df_follow,pp); + PlayerSound(DIGI_JG45053, v3df_dontpan|v3df_follow,pp); else if (choose_snd > 500) - PlayerSound(DIGI_JG45067,&pp->posx,&pp->posy,&pp->posz,v3df_dontpan|v3df_follow,pp); + PlayerSound(DIGI_JG45067, v3df_dontpan|v3df_follow,pp); else if (choose_snd > 250) - PlayerSound(DIGI_JG46005,&pp->posx,&pp->posy,&pp->posz,v3df_dontpan|v3df_follow,pp); + PlayerSound(DIGI_JG46005, v3df_dontpan|v3df_follow,pp); else - PlayerSound(DIGI_JG46010,&pp->posx,&pp->posy,&pp->posz,v3df_dontpan|v3df_follow,pp); + PlayerSound(DIGI_JG46010, v3df_dontpan|v3df_follow,pp); } else if (sp->lotag == TOILETGIRL_R0) { if (choose_snd > 700) - PlayerSound(DIGI_WHATYOUEATBABY,&pp->posx,&pp->posy,&pp->posz,v3df_dontpan|v3df_follow,pp); + PlayerSound(DIGI_WHATYOUEATBABY, v3df_dontpan|v3df_follow,pp); else if (choose_snd > 500) - PlayerSound(DIGI_WHATDIEDUPTHERE,&pp->posx,&pp->posy,&pp->posz,v3df_dontpan|v3df_follow,pp); + PlayerSound(DIGI_WHATDIEDUPTHERE, v3df_dontpan|v3df_follow,pp); else if (choose_snd > 250) - PlayerSound(DIGI_YOUGOPOOPOO,&pp->posx,&pp->posy,&pp->posz,v3df_dontpan|v3df_follow,pp); + PlayerSound(DIGI_YOUGOPOOPOO, v3df_dontpan|v3df_follow,pp); else - PlayerSound(DIGI_PULLMYFINGER,&pp->posx,&pp->posy,&pp->posz,v3df_dontpan|v3df_follow,pp); + PlayerSound(DIGI_PULLMYFINGER, v3df_dontpan|v3df_follow,pp); } else { if (choose_snd > 700) - PlayerSound(DIGI_SOAPYOUGOOD,&pp->posx,&pp->posy,&pp->posz,v3df_dontpan|v3df_follow,pp); + PlayerSound(DIGI_SOAPYOUGOOD, v3df_dontpan|v3df_follow,pp); else if (choose_snd > 500) - PlayerSound(DIGI_WASHWANG,&pp->posx,&pp->posy,&pp->posz,v3df_dontpan|v3df_follow,pp); + PlayerSound(DIGI_WASHWANG, v3df_dontpan|v3df_follow,pp); else if (choose_snd > 250) - PlayerSound(DIGI_DROPSOAP,&pp->posx,&pp->posy,&pp->posz,v3df_dontpan|v3df_follow,pp); + PlayerSound(DIGI_DROPSOAP, v3df_dontpan|v3df_follow,pp); else - PlayerSound(DIGI_REALTITS,&pp->posx,&pp->posy,&pp->posz,v3df_dontpan|v3df_follow,pp); + PlayerSound(DIGI_REALTITS, v3df_dontpan|v3df_follow,pp); } } return TRUE; @@ -1795,7 +1795,7 @@ OperateSprite(short SpriteNum, short player_is_operating) // Don't mess with it if it's already going if (u->WaitTics > 0) return TRUE; - PlaySound(DIGI_PFLIP,&sp->x,&sp->y,&sp->z,v3df_none); + PlaySound(DIGI_PFLIP, sp, v3df_none); u->WaitTics = SEC(3) + SEC(RANDOM_RANGE(10)); ChangeState(SpriteNum,s_Pachinko1Operate); @@ -1806,7 +1806,7 @@ OperateSprite(short SpriteNum, short player_is_operating) // Don't mess with it if it's already going if (u->WaitTics > 0) return TRUE; - PlaySound(DIGI_PFLIP,&sp->x,&sp->y,&sp->z,v3df_none); + PlaySound(DIGI_PFLIP, sp, v3df_none); u->WaitTics = SEC(3) + SEC(RANDOM_RANGE(10)); ChangeState(SpriteNum,s_Pachinko2Operate); @@ -1817,7 +1817,7 @@ OperateSprite(short SpriteNum, short player_is_operating) // Don't mess with it if it's already going if (u->WaitTics > 0) return TRUE; - PlaySound(DIGI_PFLIP,&sp->x,&sp->y,&sp->z,v3df_none); + PlaySound(DIGI_PFLIP, sp, v3df_none); u->WaitTics = SEC(3) + SEC(RANDOM_RANGE(10)); ChangeState(SpriteNum,s_Pachinko3Operate); @@ -1828,7 +1828,7 @@ OperateSprite(short SpriteNum, short player_is_operating) // Don't mess with it if it's already going if (u->WaitTics > 0) return TRUE; - PlaySound(DIGI_PFLIP,&sp->x,&sp->y,&sp->z,v3df_none); + PlaySound(DIGI_PFLIP, sp, v3df_none); u->WaitTics = SEC(3) + SEC(RANDOM_RANGE(10)); ChangeState(SpriteNum,s_Pachinko4Operate); @@ -1853,7 +1853,7 @@ OperateSprite(short SpriteNum, short player_is_operating) // change the switch state AnimateSwitch(sp, -1); - PlaySound(DIGI_REGULARSWITCH, &sp->x, &sp->y, &sp->z, v3df_none); + PlaySound(DIGI_REGULARSWITCH, sp, v3df_none); if (ComboSwitchTest(TAG_COMBO_SWITCH_EVERYTHING, sp->hitag)) { @@ -1866,7 +1866,7 @@ OperateSprite(short SpriteNum, short player_is_operating) // change the switch state AnimateSwitch(sp, -1); - PlaySound(DIGI_REGULARSWITCH, &sp->x, &sp->y, &sp->z, v3df_none); + PlaySound(DIGI_REGULARSWITCH, sp, v3df_none); if (ComboSwitchTest(TAG_COMBO_SWITCH_EVERYTHING, sp->hitag)) { @@ -1921,7 +1921,7 @@ OperateSprite(short SpriteNum, short player_is_operating) AnimateSwitch(sp, -1); - PlaySound(DIGI_BIGSWITCH, &sp->x, &sp->y, &sp->z, v3df_none); + PlaySound(DIGI_BIGSWITCH, sp, v3df_none); if (sp->hitag) Level = sp->hitag; @@ -1970,7 +1970,7 @@ OperateSprite(short SpriteNum, short player_is_operating) sp->hitag = 0; sp->lotag = 0; - PlaySound(DIGI_REGULARSWITCH, &sp->x, &sp->y, &sp->z, v3df_none); + PlaySound(DIGI_REGULARSWITCH, sp, v3df_none); break; } @@ -1990,7 +1990,7 @@ OperateSprite(short SpriteNum, short player_is_operating) sop->ang_tgt = NORM_ANGLE(sop->ang_tgt + 512); - PlaySound(DIGI_BIGSWITCH, &sp->x, &sp->y, &sp->z, v3df_none); + PlaySound(DIGI_BIGSWITCH, sp, v3df_none); return TRUE; @@ -2140,8 +2140,7 @@ OperateTripTrigger(PLAYERp pp) case TAG_SECRET_AREA_TRIGGER: if (pp == Player+myconnectindex) - PlayerSound(DIGI_ANCIENTSECRET, &pp->posx, &pp->posy, &pp->posz, - v3df_dontpan|v3df_doppler|v3df_follow,pp); + PlayerSound(DIGI_ANCIENTSECRET, v3df_dontpan|v3df_doppler|v3df_follow,pp); sprintf(ds, GStrings("TXTS_SECRET")); SECRET_Trigger(pp->cursectnum); @@ -2244,7 +2243,7 @@ OperateTripTrigger(PLAYERp pp) sector[pp->cursectnum].hitag = 0; sector[pp->cursectnum].lotag = 0; - PlaySound(DIGI_REGULARSWITCH, &pp->posx, &pp->posy, &pp->posz, v3df_none); + PlaySound(DIGI_REGULARSWITCH, pp, v3df_none); break; } } @@ -2351,7 +2350,7 @@ SWBOOL NearThings(PLAYERp pp) if (sector[pp->cursectnum].hitag == PLAYER_SOUNDEVENT_TAG) { if (pp == Player+myconnectindex) - PlayerSound(sector[pp->cursectnum].lotag,&pp->posx,&pp->posy,&pp->posz,v3df_follow|v3df_dontpan,pp); + PlayerSound(sector[pp->cursectnum].lotag, v3df_follow|v3df_dontpan,pp); return FALSE; } @@ -2370,7 +2369,7 @@ SWBOOL NearThings(PLAYERp pp) if (sp->hitag == PLAYER_SOUNDEVENT_TAG) { if (pp == Player+myconnectindex) - PlayerSound(sp->lotag,&pp->posx,&pp->posy,&pp->posz,v3df_follow|v3df_dontpan,pp); + PlayerSound(sp->lotag, v3df_follow|v3df_dontpan,pp); } return FALSE; // Return false so he doesn't grunt } @@ -2381,7 +2380,7 @@ SWBOOL NearThings(PLAYERp pp) if (wall[neartagwall].hitag == PLAYER_SOUNDEVENT_TAG) { if (pp == Player+myconnectindex) - PlayerSound(wall[neartagwall].lotag,&pp->posx,&pp->posy,&pp->posz,v3df_follow|v3df_dontpan,pp); + PlayerSound(wall[neartagwall].lotag, v3df_follow|v3df_dontpan,pp); return FALSE; // We are playing a sound so don't return true } return TRUE; @@ -2420,9 +2419,9 @@ SWBOOL NearThings(PLAYERp pp) if (!TEST(wp->extra, WALLFX_DONT_STICK) && pp == Player+myconnectindex) { if (STD_RANDOM_RANGE(1000) > 970) - PlayerSound(DIGI_HITTINGWALLS,&pp->posx,&pp->posy,&pp->posz,v3df_follow|v3df_dontpan,pp); + PlayerSound(DIGI_HITTINGWALLS, v3df_follow|v3df_dontpan,pp); else - PlayerSound(DIGI_SEARCHWALL,&pp->posx,&pp->posy,&pp->posz,v3df_follow|v3df_dontpan,pp); + PlayerSound(DIGI_SEARCHWALL, v3df_follow|v3df_dontpan,pp); } return TRUE; @@ -2581,7 +2580,7 @@ int DoPlayerGrabStar(PLAYERp pp) { // Pull a star out of wall and up your ammo PlayerUpdateAmmo(pp, WPN_STAR, 1); - PlaySound(DIGI_ITEM, &sp->x, &sp->y, &sp->z, v3df_none); + PlaySound(DIGI_ITEM, sp, v3df_none); KillSprite(StarQueue[i]); StarQueue[i] = -1; if (TEST(pp->WpnFlags, BIT(WPN_STAR))) diff --git a/source/sw/src/skull.cpp b/source/sw/src/skull.cpp index 4ab27072f..137886d5a 100644 --- a/source/sw/src/skull.cpp +++ b/source/sw/src/skull.cpp @@ -472,7 +472,7 @@ int DoSkullWait(short SpriteNum) if ((u->WaitTics -= ACTORMOVETICS) <= 0) { - PlaySound(DIGI_AHSCREAM,&sp->x,&sp->y,&sp->z,v3df_none); + PlaySound(DIGI_AHSCREAM, sp, v3df_none); u->WaitTics = SEC(3) + RANDOM_RANGE(360); } @@ -881,7 +881,7 @@ int DoBettyWait(short SpriteNum) if ((u->WaitTics -= ACTORMOVETICS) <= 0) { - PlaySound(DIGI_MINEBEEP,&sp->x,&sp->y,&sp->z,v3df_none); + PlaySound(DIGI_MINEBEEP, sp, v3df_none); u->WaitTics = SEC(3); } diff --git a/source/sw/src/sounds.cpp b/source/sw/src/sounds.cpp index e8258a5ee..33811db9f 100644 --- a/source/sw/src/sounds.cpp +++ b/source/sw/src/sounds.cpp @@ -57,6 +57,11 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms BEGIN_SW_NS +enum EChanExFlags +{ + CHANEXF_AMBIENT = 0x40000000, +}; + // Parentally locked sounds list int PLocked_Sounds[] = { @@ -171,13 +176,328 @@ extern SWBOOL DemoMode; SWBOOL OpenSound(VOC_INFOp vp, FileReader &handle, int *length); int ReadSound(FileReader & handle, VOC_INFOp vp, int length); -// 3d sound engine function prototype -VOC3D_INFOp Insert3DSound(void); // // Routine called when a sound is finished playing // +//////////////////////////////////////////////////////////////////////////// +// Play a sound +//////////////////////////////////////////////////////////////////////////// + +int RandomizeAmbientSpecials(int handle) +{ +#define MAXRNDAMB 12 + int ambrand[] = + { + 56,57,58,59,60,61,62,63,64,65,66,67 + }; + short i; + + // If ambient sound is found in the array, randomly pick a new sound + for (i = 0; i < MAXRNDAMB; i++) + { + if (handle == ambrand[i]) + return ambrand[STD_RANDOM_RANGE(MAXRNDAMB - 1)]; + } + + return handle; // Give back the sound, no new one was found +} + + +void +DoTimedSound(VOC3D_INFOp p) +{ + p->tics += synctics; + + if (p->tics >= p->maxtics) + { + if (!FX_SoundValidAndActive(p->handle)) + { + // Check for special case ambient sounds + p->num = RandomizeAmbientSpecials(p->num); + + // Sound was bumped from active sounds list, try to play again. + // Don't bother if voices are already maxed out. + if (FX_SoundsPlaying() < snd_numvoices) + { + if (p->flags & v3df_follow) + { + //PlaySound(p->num, p->x, p->y, p->z, p->flags); todo + p->deleted = TRUE; // Mark old sound for deletion + } + else + { + //PlaySound(p->num, &p->fx, &p->fy, &p->fz, p->flags); todo + p->deleted = TRUE; // Mark old sound for deletion + } + } + } + + p->tics = 0; + } +} + + +/////////////////////////////////////////////// +// Main function to update 3D sound array +/////////////////////////////////////////////// +typedef struct +{ + VOC3D_INFOp p; + short dist; + uint8_t priority; +} TVOC_INFO, * TVOC_INFOp; + +void +DoUpdateSounds3D(void) +{ + VOC3D_INFOp p; + SWBOOL looping; + int pitch = 0, pitchmax; + int delta; + short dist, angle; + SWBOOL deletesound = FALSE; + + TVOC_INFO TmpVocArray[32]; + int i; + + if (M_Active()) return; + + // Zero out the temporary array + //memset(&TmpVocArray[0],0,sizeof(TmpVocArray)); + for (i = 0; i < 32; i++) + { + TmpVocArray[i].p = NULL; + TmpVocArray[i].dist = 0; + TmpVocArray[i].priority = 0; + } + + p = nullptr;// voc3dstart; + + while (p) + { + ASSERT(p->num >= 0 && p->num < DIGI_MAX); + + looping = p->vp->voc_flags & vf_loop; + + // //DSPRINTF(ds,"sound %d FX_SoundActive = %d\n,",p->num,FX_SoundActive(p->handle)); + // MONO_PRINT(ds); + + // If sprite owner is dead, kill this sound as long as it isn't ambient + if (looping && p->owner == -1 && !TEST(p->flags, v3df_ambient)) + { + SET(p->flags, v3df_kill); + } + + // Is the sound slated for death? Kill it, otherwise play it. + if (p->flags & v3df_kill) + { + if (FX_SoundValidAndActive(p->handle)) + { + FX_StopSound(p->handle); // Make sure to stop active sounds + p->handle = 0; + } + + //DSPRINTF(ds,"%d had v3df_kill.\n",p->num); + //MONO_PRINT(ds); + p->deleted = TRUE; + } + else + { + if (!FX_SoundValidAndActive(p->handle) && !looping) + { + if (p->flags & v3df_intermit) + { + DoTimedSound(p); + } + else + //if(p->owner == -1 && !TEST(p->flags,v3df_ambient)) + { + //DSPRINTF(ds,"%d is now inactive.\n",p->num); + //MONO_PRINT(ds); + p->deleted = TRUE; + } + } + else if (FX_SoundValidAndActive(p->handle)) + { + if (p->flags & v3df_follow) + { + dist = SoundDist(*p->x, *p->y, *p->z, p->vp->voc_distance); + angle = SoundAngle(*p->x, *p->y); + } + else + { + if (p->fx == 0 && p->fy == 0 && p->fz == 0) + dist = 0; + else + dist = SoundDist(p->fx, p->fy, p->fz, p->vp->voc_distance); + angle = SoundAngle(p->fx, p->fy); + } + + // Can the ambient sound see the player? If not, tone it down some. + if ((p->vp->voc_flags & vf_loop) && p->owner != -1) + { + PLAYERp pp = Player + screenpeek; + SPRITEp sp = &sprite[p->owner]; + + //MONO_PRINT("Checking sound cansee"); + if (!FAFcansee(sp->x, sp->y, sp->z, sp->sectnum, pp->posx, pp->posy, pp->posz, pp->cursectnum)) + { + //MONO_PRINT("Reducing sound distance"); + dist += ((dist / 2) + (dist / 4)); // Play more quietly + if (dist > 255) dist = 255; + + // Special cases + if (p->num == 76 && TEST(p->flags, v3df_ambient)) + { + dist = 255; // Cut off whipping sound, it's secret + } + + } + } + + if (dist >= 255 && p->vp->voc_distance == DIST_NORMAL) + { + FX_StopSound(p->handle); // Make sure to stop active + p->handle = 0; + // sounds + } + else + { + // Handle Panning Left and Right + if (!(p->flags & v3df_dontpan)) + FX_Pan3D(p->handle, angle, dist); + else + FX_Pan3D(p->handle, 0, dist); + + // Handle Doppler Effects +#define DOPPLERMAX 400 + if (!(p->flags & v3df_doppler) && FX_SoundActive(p->handle)) + { + pitch -= (dist - p->doplr_delta); + + if (p->vp->pitch_lo != 0 && p->vp->pitch_hi != 0) + { + if (abs(p->vp->pitch_lo) > abs(p->vp->pitch_hi)) + pitchmax = abs(p->vp->pitch_lo); + else + pitchmax = abs(p->vp->pitch_hi); + + } + else + pitchmax = DOPPLERMAX; + + if (pitch > pitchmax) + pitch = pitchmax; + if (pitch < -pitchmax) + pitch = -pitchmax; + + p->doplr_delta = dist; // Save new distance to + // struct + FX_SetPitch(p->handle, pitch); + } + } + } + else if (!FX_SoundValidAndActive(p->handle) && looping) + { + if (p->flags & v3df_follow) + { + dist = SoundDist(*p->x, *p->y, *p->z, p->vp->voc_distance); + angle = SoundAngle(*p->x, *p->y); + } + else + { + dist = SoundDist(p->fx, p->fy, p->fz, p->vp->voc_distance); + angle = SoundAngle(p->fx, p->fy); + } + + // Sound was bumped from active sounds list, try to play + // again. + // Don't bother if voices are already maxed out. + // Sort looping vocs in order of priority and distance + //if (FX_SoundsPlaying() < snd_numvoices && dist <= 255) + if (dist <= 255) + { + for (i = 0; i < min((int)SIZ(TmpVocArray), *snd_numvoices); i++) + { + if (p->priority >= TmpVocArray[i].priority) + { + if (!TmpVocArray[i].p || dist < TmpVocArray[i].dist) + { + ASSERT(p->num >= 0 && p->num < DIGI_MAX); + TmpVocArray[i].p = p; + TmpVocArray[i].dist = dist; + TmpVocArray[i].priority = p->priority; + break; + } + } + } + } + } // !FX_SoundActive + } // if(p->flags & v3df_kill) + + p = p->next; + } // while(p) + + // Process all the looping sounds that said they wanted to get back in + // Only update these sounds 5x per second! Woo hoo!, aren't we optimized now? + //if(MoveSkip8==0) + // { + for (i = 0; i < min((int)SIZ(TmpVocArray), *snd_numvoices); i++) + { + int handle; + + p = TmpVocArray[i].p; + + //if (FX_SoundsPlaying() >= snd_numvoices || !p) break; + if (!p) break; + + ASSERT(p->num >= 0 && p->num < DIGI_MAX); + + if (p->flags & v3df_follow) + { + if (p->owner == -1) + { + // Terminate the sound without aborting. + continue; + } + + Use_SoundSpriteNum = TRUE; + SoundSpriteNum = p->owner; + + //handle = PlaySound(p->num, p->x, p->y, p->z, p->flags); todo + //if(handle >= 0 || TEST(p->flags,v3df_ambient)) // After a valid PlaySound, it's ok to use voc3dend + //voc3dend->owner = p->owner; // todo Transfer the owner + p->deleted = TRUE; + + Use_SoundSpriteNum = FALSE; + SoundSpriteNum = -1; + + //MONO_PRINT("TmpVocArray playing a follow sound"); + } + else + { + if (p->owner == -1) + { + // Terminate the sound without aborting. + continue; + } + + Use_SoundSpriteNum = TRUE; + SoundSpriteNum = p->owner; + + //handle = PlaySound(p->num, &p->fx, &p->fy, &p->fz, p->flags); todo + //if(handle >= 0 || TEST(p->flags,v3df_ambient)) + //voc3dend->owner = p->owner; // todo Transfer the owner + p->deleted = TRUE; + + Use_SoundSpriteNum = FALSE; + SoundSpriteNum = -1; + } + } + +} void @@ -276,7 +596,7 @@ short SoundAngle(int x, int y) #define SOUND_UNIT MAXLEVLDIST/255 // NOTE: If v3df_follow == 1, x,y,z are considered literal coordinates -int PlaySound(int num, int *x, int *y, int *z, Voc3D_Flags flags) +int _PlaySound(int num, SPRITEp sp, PLAYERp pp, vec3_t *pos, Voc3D_Flags flags) { VOC_INFOp vp; VOC3D_INFOp v3p; @@ -284,7 +604,6 @@ int PlaySound(int num, int *x, int *y, int *z, Voc3D_Flags flags) short angle, sound_dist; int tx, ty, tz; uint8_t priority; - SPRITEp sp=NULL; // Weed out parental lock sounds if PLock is active if (adult_lockout || Global_PLock) @@ -298,74 +617,59 @@ int PlaySound(int num, int *x, int *y, int *z, Voc3D_Flags flags) } } - if (Prediction) + if (Prediction || !SoundEnabled() || num < 0 || num >= DIGI_MAX) return -1; - if (!SoundEnabled()) - return -1; - - PRODUCTION_ASSERT(num >= 0 && num < DIGI_MAX); - - // Reset voice - voice = -1; - - // This is used for updating looping sounds in Update3DSounds - if (Use_SoundSpriteNum && SoundSpriteNum >= 0) - { - ASSERT(SoundSpriteNum >= 0 && SoundSpriteNum < MAXSPRITES); - sp = &sprite[SoundSpriteNum]; - } - - if (snd_ambience && TEST(flags,v3df_ambient) && !TEST(flags,v3df_nolookup)) // Look for invalid ambient numbers + if (TEST(flags,v3df_ambient) && !TEST(flags,v3df_nolookup)) // Look for invalid ambient numbers { + if (!snd_ambience) return -1; if (num < 0 || num > MAX_AMBIENT_SOUNDS) { sprintf(ds,"Invalid or out of range ambient sound number %d\n",num); PutStringInfo(Player+screenpeek, ds); return -1; } + v3p->maxtics = STD_RANDOM_RANGE(ambarray[num].maxtics); + + // If the ambient flag is set, do a name conversion to point to actual + // digital sound entry. + flags |= ambarray[num].ambient_flags; // Add to flags if any + num = ambarray[num].diginame; + if (num < 0 || num >= DIGI_MAX) + { + return -1; + } } + //auto chan = soundEngine->StartSound() - // Call queue management to add sound to play list. - // 3D sound manager will update playing sound 10x per second until - // the sound ends, at which time it is removed from both the 3D - // sound list as well as the actual cache. - v3p = Insert3DSound(); - // If the ambient flag is set, do a name conversion to point to actual - // digital sound entry. v3p->num = num; v3p->priority = 0; v3p->FX_Ok = FALSE; // Hasn't played yet - - if (snd_ambience && TEST(flags,v3df_ambient) && !TEST(flags,v3df_nolookup)) - { - v3p->maxtics = STD_RANDOM_RANGE(ambarray[num].maxtics); - flags |= ambarray[num].ambient_flags; // Add to flags if any - num = ambarray[num].diginame; - } - - PRODUCTION_ASSERT(num >= 0 && num < DIGI_MAX); - + // Reset voice + voice = -1; // Assign voc to voc pointer vp = &voc[num]; - if (M_Active() && *x==0 && *y==0 && *z==0) // Menus sound outdo everything + if (M_Active() && sp == nullptr && pp == nullptr) // Menus sound outdo everything priority = 100; else priority = vp->priority; v3p->vp = vp; // Assign voc info to 3d struct for future reference + /* v3p->x = x; v3p->y = y; v3p->z = z; v3p->fx = *x; v3p->fy = *y; v3p->fz = *z; + */ v3p->flags = flags; + /* if (flags & v3df_follow) { tx = *x; @@ -383,10 +687,13 @@ int PlaySound(int num, int *x, int *y, int *z, Voc3D_Flags flags) ty = v3p->fy; tz = v3p->fz; } + */ // Special case stuff for sounds being played in a level + /* if (*x==0 && *y==0 && *z==0) tx = ty = tz = 0; + */ if ((vp->voc_flags & vf_loop) && Use_SoundSpriteNum && SoundSpriteNum >= 0 && sp) { @@ -510,355 +817,97 @@ int PlaySound(int num, int *x, int *y, int *z, Voc3D_Flags flags) return voice; } +//========================================================================== +// +// +// +//========================================================================== + void PlaySoundRTS(int rts_num) { - char *rtsptr; - int voice=-1; - - if (!RTS_IsInitialized() || !SoundEnabled()) - return; - - rtsptr = (char *)RTS_GetSound(rts_num - 1); - - ASSERT(rtsptr); - - voice = FX_Play3D(rtsptr, RTS_SoundLength(rts_num - 1), FX_ONESHOT, 0, 0, 0, 255, 1.f, -rts_num); // [JM] Float volume here too I bet. !CHECKME! + if (!adult_lockout && SoundEnabled() && RTS_IsInitialized() && snd_speech) + { + auto sid = RTS_GetSoundID(rts_num - 1); + if (sid != -1) + { + soundEngine->StartSound(SOURCE_Unattached, nullptr, nullptr, CHAN_VOICE, 0, sid, 0.8f, ATTN_NONE); + } + } } -/* -=================== -= -= SoundShutdown -= -=================== -*/ - +//========================================================================== +// +// +// +//========================================================================== void COVER_SetReverb(int amt) { - FX_SetReverb_(amt); + FX_SetReverb(amt); } -/////////////////////////////////////////////////////////////////////////////// - -/////////////////////////////////////////////// +//========================================================================== // -// 3D sound engine -// Sound management routines that keep a list of -// all sounds being played in a level. -// Doppler and Panning effects are achieved here. -// -/////////////////////////////////////////////// -// Declare and initialize linked list of vocs. -VOC3D_INFOp voc3dstart = NULL; -VOC3D_INFOp voc3dend = NULL; - -////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////// -// Initialize new vocs in the 3D sound queue -/////////////////////////////////////////////// -VOC3D_INFOp -InitNew3DSound(VOC3D_INFOp v3p) -{ - v3p->handle = -1; // Initialize handle to new sound - // value - v3p->owner = -1; - v3p->deleted = FALSE; // Used for when sound gets deleted - - return v3p; -} - -/////////////////////////////////////////////// -// Inserts new vocs in the 3D sound queue -/////////////////////////////////////////////// -VOC3D_INFOp -Insert3DSound(void) -{ - VOC3D_INFOp vp, old; - - // Allocate memory for new sound - // You can allocate new sounds as long as memory holds out. - // If you run out of memory for sounds, you got problems anyway. - vp = (VOC3D_INFOp) AllocMem(sizeof(VOC3D_INFO)); - ASSERT(vp != NULL); - memset(vp,0xCC,sizeof(VOC3D_INFO)); // Zero out the memory - - if (!voc3dend) // First item in list - { - vp->next = vp->prev = NULL; - voc3dend = vp; - voc3dstart = vp; - InitNew3DSound(vp); - return vp; - } - - old = voc3dend; // Put it on the end - old->next = vp; - vp->next = NULL; - vp->prev = old; - voc3dend = vp; - - InitNew3DSound(vp); - return vp; - -} - -///////////////////////////////////////////////////// // Deletes vocs in the 3D sound queue with no owners -///////////////////////////////////////////////////// -void -DeleteNoSoundOwner(short spritenum) +// +//========================================================================== + +void DeleteNoSoundOwner(short spritenum) { - VOC3D_INFOp vp, dp; - - vp = voc3dstart; - - while (vp) - { - dp = NULL; - if (vp->owner == spritenum && vp->owner >= 0 && (vp->vp->voc_flags & vf_loop)) - { - //DSPRINTF(ds,"Deleting owner %d\n",vp->owner); - //MONO_PRINT(ds); - - // Make sure to stop active - // sounds - if (FX_SoundValidAndActive(vp->handle)) - { - FX_StopSound(vp->handle); - vp->handle = 0; - } - - dp = vp; // Point to sound to be deleted - - if (vp->prev) - { - vp->prev->next = vp->next; - } - else - { - voc3dstart = vp->next; // New first item - if (voc3dstart) - voc3dstart->prev = NULL; - } - - if (vp->next) - { - vp->next->prev = vp->prev; // Middle element - } - else - { - voc3dend = vp->prev; // Delete last element - } - } - - vp = vp->next; - - if (dp != NULL) - FreeMem(dp); // Return memory to heap - } -} - -// This is called from KillSprite to kill a follow sound with no valid sprite owner -// Stops and active sound with the follow bit set, even play once sounds. -void DeleteNoFollowSoundOwner(short spritenum) -{ - VOC3D_INFOp vp, dp; SPRITEp sp = &sprite[spritenum]; - vp = voc3dstart; - - while (vp) - { - dp = NULL; - // If the follow flag is set, compare the x and y addresses. - if ((vp->flags & v3df_follow) && vp->x == &sp->x && vp->y == &sp->y) + soundEngine->EnumerateChannels([=](FSoundChan* chan) { - if (FX_SoundValidAndActive(vp->handle)) + if (chan->Source == sp && chan->ChanFlags & CHANF_LOOP) { - FX_StopSound(vp->handle); - vp->handle = 0; + soundEngine->StopChannel(chan); } - - dp = vp; // Point to sound to be deleted - - if (vp->prev) - { - vp->prev->next = vp->next; - } - else - { - voc3dstart = vp->next; // New first item - if (voc3dstart) - voc3dstart->prev = NULL; - } - - if (vp->next) - { - vp->next->prev = vp->prev; // Middle element - } - else - { - voc3dend = vp->prev; // Delete last element - } - } - - vp = vp->next; - - if (dp != NULL) - FreeMem(dp); // Return memory to heap - } + return false; + }); } -/////////////////////////////////////////////// -// Deletes vocs in the 3D sound queue -/////////////////////////////////////////////// -void -Delete3DSounds(void) +//========================================================================== +// +// This is called from KillSprite to kill a follow sound with no valid sprite owner +// Stops and active sound with the follow bit set, even play once sounds. +// +//========================================================================== + +void DeleteNoFollowSoundOwner(short spritenum) { - VOC3D_INFOp vp, dp; - PLAYERp pp; - int cnt=0; - - - vp = voc3dstart; - - while (vp) - { - dp = NULL; - if (vp->deleted) - { - if (!vp->vp) - { - printf("Delete3DSounds(): NULL vp->vp\n"); - } - - dp = vp; // Point to sound to be deleted - if (vp->prev) - { - vp->prev->next = vp->next; - } - else - { - voc3dstart = vp->next; // New first item - if (voc3dstart) - voc3dstart->prev = NULL; - } - - if (vp->next) - { - vp->next->prev = vp->prev; // Middle element - } - else - { - voc3dend = vp->prev; // Delete last element - } - } - - vp = vp->next; - - if (dp != NULL) - { - FreeMem(dp); // Return memory to heap - } - } + SPRITEp sp = &sprite[spritenum]; + soundEngine->StopSound(SOURCE_Actor, sp, -1); } -//////////////////////////////////////////////////////////////////////////// -// Play a sound -//////////////////////////////////////////////////////////////////////////// +//========================================================================== +// +// +// +//========================================================================== -int -RandomizeAmbientSpecials(int handle) +void StopAmbientSound(void) { -#define MAXRNDAMB 12 - int ambrand[] = - { - 56,57,58,59,60,61,62,63,64,65,66,67 - }; - short i; - - // If ambient sound is found in the array, randomly pick a new sound - for (i=0; itics += synctics; - - if (p->tics >= p->maxtics) - { - if (!FX_SoundValidAndActive(p->handle)) + soundEngine->EnumerateChannels([](FSoundChan* chan) { - // Check for special case ambient sounds - p->num = RandomizeAmbientSpecials(p->num); - - // Sound was bumped from active sounds list, try to play again. - // Don't bother if voices are already maxed out. - if (FX_SoundsPlaying() < snd_numvoices) + if (chan->ChanFlags & EChanFlags::FromInt(CHANEXF_AMBIENT)) { - if (p->flags & v3df_follow) - { - PlaySound(p->num, p->x, p->y, p->z, p->flags); - p->deleted = TRUE; // Mark old sound for deletion - } - else - { - PlaySound(p->num, &p->fx, &p->fy, &p->fz, p->flags); - p->deleted = TRUE; // Mark old sound for deletion - } + soundEngine->StopChannel(chan); } - } - - p->tics = 0; - } + return false; + }); } -void -StopAmbientSound(void) + +//========================================================================== +// +// +// +//========================================================================== + +void StartAmbientSound(void) { VOC3D_INFOp p; - extern SWBOOL InMenuLevel; - - if (InMenuLevel) return; - - p = voc3dstart; - - while (p) - { - // kill ambient sounds if Ambient is off - if (TEST(p->flags,v3df_ambient)) - SET(p->flags, v3df_kill); - - if (p->flags & v3df_kill) - { - if (FX_SoundValidAndActive(p->handle)) - { - FX_StopSound(p->handle); // Make sure to stop active sounds - p->handle = 0; - } - - p->deleted = TRUE; - } - - p = p->next; - } - - Delete3DSounds(); -} - -void -StartAmbientSound(void) -{ - VOC3D_INFOp p; - short i,nexti; + short i, nexti; extern SWBOOL InMenuLevel; if (InMenuLevel) return; // Don't restart ambience if no level is active! Will crash game. @@ -867,345 +916,101 @@ StartAmbientSound(void) { SPRITEp sp = &sprite[i]; - PlaySound(sp->lotag, &sp->x, &sp->y, &sp->z, v3df_ambient | v3df_init - | v3df_doppler | v3df_follow); - Set3DSoundOwner(i); // Ambient sounds need this to get sectnum for later processing + PlaySound(sp->lotag, sp, v3df_ambient | v3df_init | v3df_doppler | v3df_follow); } } -/////////////////////////////////////////////// -// Main function to update 3D sound array -/////////////////////////////////////////////// -typedef struct -{ - VOC3D_INFOp p; - short dist; - uint8_t priority; -} TVOC_INFO, *TVOC_INFOp; - -void -DoUpdateSounds3D(void) -{ - VOC3D_INFOp p; - SWBOOL looping; - int pitch = 0, pitchmax; - int delta; - short dist, angle; - SWBOOL deletesound = FALSE; - - TVOC_INFO TmpVocArray[32]; - int i; - static SWBOOL MoveSkip8 = 0; - - if (M_Active()) return; - - // This function is already only call 10x per sec, this widdles it down even more! - MoveSkip8 = (MoveSkip8 + 1) & 15; - - //CON_Message("Sounds Playing = %d",FX_SoundsPlaying()); - - // Zero out the temporary array - //memset(&TmpVocArray[0],0,sizeof(TmpVocArray)); - for (i=0; i<32; i++) - { - TmpVocArray[i].p = NULL; - TmpVocArray[i].dist = 0; - TmpVocArray[i].priority = 0; - } - - p = voc3dstart; - - while (p) - { - ASSERT(p->num >= 0 && p->num < DIGI_MAX); - - looping = p->vp->voc_flags & vf_loop; - -// //DSPRINTF(ds,"sound %d FX_SoundActive = %d\n,",p->num,FX_SoundActive(p->handle)); -// MONO_PRINT(ds); - - // If sprite owner is dead, kill this sound as long as it isn't ambient - if (looping && p->owner == -1 && !TEST(p->flags,v3df_ambient)) - { - SET(p->flags, v3df_kill); - } - - // Is the sound slated for death? Kill it, otherwise play it. - if (p->flags & v3df_kill) - { - if (FX_SoundValidAndActive(p->handle)) - { - FX_StopSound(p->handle); // Make sure to stop active sounds - p->handle = 0; - } - - //DSPRINTF(ds,"%d had v3df_kill.\n",p->num); - //MONO_PRINT(ds); - p->deleted = TRUE; - } - else - { - if (!FX_SoundValidAndActive(p->handle) && !looping) - { - if (p->flags & v3df_intermit) - { - DoTimedSound(p); - } - else - //if(p->owner == -1 && !TEST(p->flags,v3df_ambient)) - { - //DSPRINTF(ds,"%d is now inactive.\n",p->num); - //MONO_PRINT(ds); - p->deleted = TRUE; - } - } - else if (FX_SoundValidAndActive(p->handle)) - { - if (p->flags & v3df_follow) - { - dist = SoundDist(*p->x, *p->y, *p->z, p->vp->voc_distance); - angle = SoundAngle(*p->x, *p->y); - } - else - { - if (p->fx == 0 && p->fy == 0 && p->fz == 0) - dist = 0; - else - dist = SoundDist(p->fx, p->fy, p->fz, p->vp->voc_distance); - angle = SoundAngle(p->fx, p->fy); - } - - // Can the ambient sound see the player? If not, tone it down some. - if ((p->vp->voc_flags & vf_loop) && p->owner != -1) - { - PLAYERp pp = Player+screenpeek; - SPRITEp sp = &sprite[p->owner]; - - //MONO_PRINT("Checking sound cansee"); - if (!FAFcansee(sp->x, sp->y, sp->z, sp->sectnum,pp->posx, pp->posy, pp->posz, pp->cursectnum)) - { - //MONO_PRINT("Reducing sound distance"); - dist += ((dist/2)+(dist/4)); // Play more quietly - if (dist > 255) dist = 255; - - // Special cases - if (p->num == 76 && TEST(p->flags,v3df_ambient)) - { - dist = 255; // Cut off whipping sound, it's secret - } - - } - } - - if (dist >= 255 && p->vp->voc_distance == DIST_NORMAL) - { - FX_StopSound(p->handle); // Make sure to stop active - p->handle = 0; - // sounds - } - else - { - // Handle Panning Left and Right - if (!(p->flags & v3df_dontpan)) - FX_Pan3D(p->handle, angle, dist); - else - FX_Pan3D(p->handle, 0, dist); - - // Handle Doppler Effects -#define DOPPLERMAX 400 - if (!(p->flags & v3df_doppler) && FX_SoundActive(p->handle)) - { - pitch -= (dist - p->doplr_delta); - - if (p->vp->pitch_lo != 0 && p->vp->pitch_hi != 0) - { - if (abs(p->vp->pitch_lo) > abs(p->vp->pitch_hi)) - pitchmax = abs(p->vp->pitch_lo); - else - pitchmax = abs(p->vp->pitch_hi); - - } - else - pitchmax = DOPPLERMAX; - - if (pitch > pitchmax) - pitch = pitchmax; - if (pitch < -pitchmax) - pitch = -pitchmax; - - p->doplr_delta = dist; // Save new distance to - // struct - FX_SetPitch(p->handle, pitch); - } - } - } - else if (!FX_SoundValidAndActive(p->handle) && looping) - { - if (p->flags & v3df_follow) - { - dist = SoundDist(*p->x, *p->y, *p->z, p->vp->voc_distance); - angle = SoundAngle(*p->x, *p->y); - } - else - { - dist = SoundDist(p->fx, p->fy, p->fz, p->vp->voc_distance); - angle = SoundAngle(p->fx, p->fy); - } - - // Sound was bumped from active sounds list, try to play - // again. - // Don't bother if voices are already maxed out. - // Sort looping vocs in order of priority and distance - //if (FX_SoundsPlaying() < snd_numvoices && dist <= 255) - if (dist <= 255) - { - for (i=0; ipriority >= TmpVocArray[i].priority) - { - if (!TmpVocArray[i].p || dist < TmpVocArray[i].dist) - { - ASSERT(p->num >= 0 && p->num < DIGI_MAX); - TmpVocArray[i].p = p; - TmpVocArray[i].dist = dist; - TmpVocArray[i].priority = p->priority; - break; - } - } - } - } - } // !FX_SoundActive - } // if(p->flags & v3df_kill) - - p = p->next; - } // while(p) - - // Process all the looping sounds that said they wanted to get back in - // Only update these sounds 5x per second! Woo hoo!, aren't we optimized now? - //if(MoveSkip8==0) - // { - for (i=0; i= snd_numvoices || !p) break; - if (!p) break; - - ASSERT(p->num >= 0 && p->num < DIGI_MAX); - - if (p->flags & v3df_follow) - { - if (p->owner == -1) - { - // Terminate the sound without aborting. - continue; - } - - Use_SoundSpriteNum = TRUE; - SoundSpriteNum = p->owner; - - handle = PlaySound(p->num, p->x, p->y, p->z, p->flags); - //if(handle >= 0 || TEST(p->flags,v3df_ambient)) // After a valid PlaySound, it's ok to use voc3dend - voc3dend->owner = p->owner; // Transfer the owner - p->deleted = TRUE; - - Use_SoundSpriteNum = FALSE; - SoundSpriteNum = -1; - - //MONO_PRINT("TmpVocArray playing a follow sound"); - } - else - { - if (p->owner == -1) - { - // Terminate the sound without aborting. - continue; - } - - Use_SoundSpriteNum = TRUE; - SoundSpriteNum = p->owner; - - handle = PlaySound(p->num, &p->fx, &p->fy, &p->fz, p->flags); - //if(handle >= 0 || TEST(p->flags,v3df_ambient)) - voc3dend->owner = p->owner; // Transfer the owner - p->deleted = TRUE; - - Use_SoundSpriteNum = FALSE; - SoundSpriteNum = -1; - } - } - - // Clean out any deleted sounds now - Delete3DSounds(); -} - -////////////////////////////////////////////////// +//========================================================================== +// // Terminate the sounds list -////////////////////////////////////////////////// -void -Terminate3DSounds(void) +// +//========================================================================== + +void Terminate3DSounds(void) { - VOC3D_INFOp vp; - - vp = voc3dstart; - - while (vp) - { - if (vp->handle > 0) - FX_StopSound(vp->handle); // Make sure to stop active sounds - vp->handle = 0; - vp->deleted = TRUE; - vp = vp->next; - } - - Delete3DSounds(); // Now delete all remaining sounds + soundEngine->EnumerateChannels([](FSoundChan* chan) + { + if (chan->SourceType == SOURCE_Actor || chan->SourceType == SOURCE_Unattached || + (chan->SourceType == SOURCE_Player && chan->EntChannel != CHAN_VOICE)) + { + soundEngine->StopChannel(chan); + } + return false; + }); } -////////////////////////////////////////////////// -// Set owner to check when to kill looping sounds -// Must be called immediately after PlaySound call -// since this only assigns value to last sound -// on voc list -////////////////////////////////////////////////// -void -Set3DSoundOwner(short spritenum) +//========================================================================== +// +// no longer needed, only left to avoid changing the game code +// +//========================================================================== + +void Set3DSoundOwner(short spritenum) { - VOC3D_INFOp p; - -// ASSERT(p->handle != -1); // Check for bogus sounds - - p = voc3dend; - if (!p) return; - - // Queue up sounds with ambient flag even if they didn't play right away! - if (p->handle != -1 || TEST(p->flags,v3df_ambient)) - { - p->owner = spritenum; - } - else - { - p->deleted = TRUE; - p->flags = v3df_kill; - } + } -////////////////////////////////////////////////// +//========================================================================== +// // Play a sound using special sprite setup -////////////////////////////////////////////////// -void -PlaySpriteSound(short spritenum, int attrib_ndx, Voc3D_Flags flags) +// +//========================================================================== + +void PlaySpriteSound(short spritenum, int attrib_ndx, Voc3D_Flags flags) { SPRITEp sp = &sprite[spritenum]; USERp u = User[spritenum]; ASSERT(u); - PlaySound(u->Attrib->Sounds[attrib_ndx], &sp->x, &sp->y, &sp->z, flags); + PlaySound(u->Attrib->Sounds[attrib_ndx], sp, flags); } +//========================================================================== +// +// +// +//========================================================================== + +int _PlayerSound(int num, PLAYERp pp) +{ + int handle; + VOC_INFOp vp; + + if (Prediction) + return 0; + + if (pp < Player || pp >= Player + MAX_SW_PLAYERS) + { + return 0; + } + + if (num < 0 || num >= DIGI_MAX || !soundEngine->isValidSoundId(num)) + return 0; + + if (TEST(pp->Flags, PF_DEAD)) return 0; // You're dead, no talking! + + // If this is a player voice and he's already yacking, forget it. + vp = &voc[num]; + + // Not a player voice, bail. + if (vp->priority != PRI_PLAYERVOICE && vp->priority != PRI_PLAYERDEATH) + return 0; + + // He wasn't talking, but he will be now. + if (!soundEngine->IsSourcePlayingSomething(SOURCE_Player, pp, CHAN_VOICE)) + { + soundEngine->StartSound(SOURCE_Player, pp, nullptr, CHAN_VOICE, 0, num, 1.f, ATTN_NORM); + } + + return 0; +} + +void StopPlayerSound(PLAYERp pp) +{ + soundEngine->StopSound(SOURCE_Player, pp, CHAN_VOICE); +} /* @@ -1289,52 +1094,6 @@ int PlayerYellVocs[] = }; - -//========================================================================== -// -// -// -//========================================================================== - -int _PlayerSound(int num, PLAYERp pp) -{ - int handle; - VOC_INFOp vp; - - if (Prediction) - return 0; - - if (pp < Player || pp >= Player + MAX_SW_PLAYERS) - { - return 0; - } - - if (num < 0 || num >= DIGI_MAX || !soundEngine->isValidSoundId(num)) - return 0; - - if (TEST(pp->Flags, PF_DEAD)) return 0; // You're dead, no talking! - - // If this is a player voice and he's already yacking, forget it. - vp = &voc[num]; - - // Not a player voice, bail. - if (vp->priority != PRI_PLAYERVOICE && vp->priority != PRI_PLAYERDEATH) - return 0; - - // He wasn't talking, but he will be now. - if (!soundEngine->IsSourcePlayingSomething(SOURCE_Player, pp, CHAN_VOICE)) - { - soundEngine->StartSound(SOURCE_Player, pp, nullptr, CHAN_VOICE, 0, num, 1.f, ATTN_NORM); - } - - return 0; -} - -void StopPlayerSound(PLAYERp pp) -{ - soundEngine->StopSound(SOURCE_Player, pp, CHAN_VOICE); -} - //========================================================================== // // PLays music diff --git a/source/sw/src/sounds.h b/source/sw/src/sounds.h index 5d9d27635..77b15abfd 100644 --- a/source/sw/src/sounds.h +++ b/source/sw/src/sounds.h @@ -57,7 +57,8 @@ enum v3df_intermit = 32, // 1 = Intermittant sound v3df_init = 64, // 1 = First pass of sound, don't play it. // This is mainly used for intermittent sounds - v3df_nolookup = 128 // don't use ambient table lookup + v3df_nolookup = 128, // don't use ambient table lookup + v3df_listenerz = 256 // ignore height when positioning sound (was mostly hacked by providing bad cooordinates to the code before.) }; typedef int Voc3D_Flags; @@ -80,7 +81,7 @@ void PlaySpriteSound(short spritenum, int attrib_ndx, Voc3D_Flags flags); void DeleteNoSoundOwner(short spritenum); void DeleteNoFollowSoundOwner(short spritenum); -SWBOOL CacheSound(int num, int type); +inline SWBOOL CacheSound(int num, int type) { return false; } void COVER_SetReverb(int amt); void UnInitSound(void); void InitFX(void); diff --git a/source/sw/src/sprite.cpp b/source/sw/src/sprite.cpp index 2264b0838..d10937d93 100644 --- a/source/sw/src/sprite.cpp +++ b/source/sw/src/sprite.cpp @@ -5504,7 +5504,7 @@ void ChoosePlayerGetSound(PLAYERp pp) choose_snd = STD_RANDOM_RANGE((MAX_GETSOUNDS-1)<<8)>>8; - PlayerSound(PlayerGetItemVocs[choose_snd],&pp->posx,&pp->posy,&pp->posz,v3df_follow|v3df_dontpan,pp); + PlayerSound(PlayerGetItemVocs[choose_snd], v3df_follow|v3df_dontpan,pp); } SWBOOL CanGetWeapon(PLAYERp pp, short SpriteNum, int WPN) @@ -5584,7 +5584,7 @@ DoGet(short SpriteNum) u->WaitTics -= ACTORMOVETICS * 2; if (u->WaitTics <= 0) { - PlaySound(DIGI_ITEM_SPAWN, &sp->x, &sp->y, &sp->z, v3df_none); + PlaySound(DIGI_ITEM_SPAWN, sp, v3df_none); DoSpawnItemTeleporterEffect(sp); RESET(sp->cstat, CSTAT_SPRITE_INVISIBLE); } @@ -5674,7 +5674,7 @@ KeyMain: pp->HasKey[key_num] = TRUE; SetFadeAmt(pp,ITEMFLASHAMT,ITEMFLASHCLR); // Flash blue on item pickup if (pp == Player+myconnectindex) - PlaySound(DIGI_KEY, &sp->x, &sp->y, &sp->z, v3df_dontpan); + PlaySound(DIGI_KEY, sp, v3df_dontpan); PlayerUpdateKeys(pp); // don't kill keys in coop @@ -5704,7 +5704,7 @@ KeyMain: } SetFadeAmt(pp,ITEMFLASHAMT,ITEMFLASHCLR); // Flash blue on item pickup if (pp == Player+myconnectindex) - PlaySound(DIGI_BIGITEM, &sp->x, &sp->y, &sp->z, v3df_dontpan); + PlaySound(DIGI_BIGITEM, sp, v3df_dontpan); // override for respawn mode if (gNet.MultiGameType == MULTI_GAME_COMMBAT && gNet.NoRespawn) @@ -5739,7 +5739,7 @@ KeyMain: SetFadeAmt(pp,ITEMFLASHAMT,ITEMFLASHCLR); // Flash blue on item pickup if (pp == Player+myconnectindex) - PlaySound(DIGI_ITEM, &sp->x, &sp->y, &sp->z, v3df_dontpan); + PlaySound(DIGI_ITEM, sp, v3df_dontpan); // override for respawn mode if (gNet.MultiGameType == MULTI_GAME_COMMBAT && gNet.NoRespawn) @@ -5769,7 +5769,7 @@ KeyMain: SetFadeAmt(pp,ITEMFLASHAMT,ITEMFLASHCLR); // Flash blue on item pickup if (pp == Player+myconnectindex) - PlaySound(DIGI_BIGITEM, &sp->x, &sp->y, &sp->z, v3df_dontpan); + PlaySound(DIGI_BIGITEM, sp, v3df_dontpan); // override for respawn mode if (gNet.MultiGameType == MULTI_GAME_COMMBAT && gNet.NoRespawn) @@ -5795,7 +5795,7 @@ KeyMain: PlayerUpdateInventory(pp, INVENTORY_MEDKIT); SetFadeAmt(pp,ITEMFLASHAMT,ITEMFLASHCLR); // Flash blue on item pickup if (pp == Player+myconnectindex) - PlaySound(DIGI_ITEM, &sp->x, &sp->y, &sp->z, v3df_dontpan); + PlaySound(DIGI_ITEM, sp, v3df_dontpan); // override for respawn mode if (gNet.MultiGameType == MULTI_GAME_COMMBAT && gNet.NoRespawn) @@ -5818,7 +5818,7 @@ KeyMain: PlayerUpdateInventory(pp, INVENTORY_CHEMBOMB); SetFadeAmt(pp,ITEMFLASHAMT,ITEMFLASHCLR); // Flash blue on item pickup if (pp == Player+myconnectindex) - PlaySound(DIGI_ITEM, &sp->x, &sp->y, &sp->z, v3df_dontpan); + PlaySound(DIGI_ITEM, sp, v3df_dontpan); KillGet(SpriteNum); } break; @@ -5833,7 +5833,7 @@ KeyMain: PlayerUpdateInventory(pp, INVENTORY_FLASHBOMB); SetFadeAmt(pp,ITEMFLASHAMT,ITEMFLASHCLR); // Flash blue on item pickup if (pp == Player+myconnectindex) - PlaySound(DIGI_ITEM, &sp->x, &sp->y, &sp->z, v3df_dontpan); + PlaySound(DIGI_ITEM, sp, v3df_dontpan); KillGet(SpriteNum); } break; @@ -5850,7 +5850,7 @@ KeyMain: PlayerUpdateInventory(pp, INVENTORY_CALTROPS); SetFadeAmt(pp,ITEMFLASHAMT,ITEMFLASHCLR); // Flash blue on item pickup if (pp == Player+myconnectindex) - PlaySound(DIGI_ITEM, &sp->x, &sp->y, &sp->z, v3df_dontpan); + PlaySound(DIGI_ITEM, sp, v3df_dontpan); KillGet(SpriteNum); } break; @@ -5864,7 +5864,7 @@ KeyMain: PlayerUpdateInventory(pp, INVENTORY_NIGHT_VISION); SetFadeAmt(pp,ITEMFLASHAMT,ITEMFLASHCLR); // Flash blue on item pickup if (pp == Player+myconnectindex) - PlaySound(DIGI_ITEM, &sp->x, &sp->y, &sp->z, v3df_dontpan); + PlaySound(DIGI_ITEM, sp, v3df_dontpan); KillGet(SpriteNum); } break; @@ -5877,7 +5877,7 @@ KeyMain: PlayerUpdateInventory(pp, INVENTORY_REPAIR_KIT); SetFadeAmt(pp,ITEMFLASHAMT,ITEMFLASHCLR); // Flash blue on item pickup if (pp == Player+myconnectindex) - PlaySound(DIGI_ITEM, &sp->x, &sp->y, &sp->z, v3df_dontpan); + PlaySound(DIGI_ITEM, sp, v3df_dontpan); // don't kill repair kit in coop if (gNet.MultiGameType == MULTI_GAME_COOPERATIVE) @@ -5894,7 +5894,7 @@ KeyMain: pp->InventoryAmount[INVENTORY_ENVIRON_SUIT] = 1; PlayerUpdateInventory(pp, INVENTORY_ENVIRON_SUIT); if (pp == Player+myconnectindex) - PlaySound(DIGI_ITEM, &sp->x, &sp->y, &sp->z, v3df_dontpan); + PlaySound(DIGI_ITEM, sp, v3df_dontpan); KillGet(SpriteNum); } break; @@ -5908,7 +5908,7 @@ KeyMain: PlayerUpdateInventory(pp, INVENTORY_CLOAK); SetFadeAmt(pp,ITEMFLASHAMT,ITEMFLASHCLR); // Flash blue on item pickup if (pp == Player+myconnectindex) - PlaySound(DIGI_ITEM, &sp->x, &sp->y, &sp->z, v3df_dontpan); + PlaySound(DIGI_ITEM, sp, v3df_dontpan); KillGet(SpriteNum); } break; @@ -5929,7 +5929,7 @@ KeyMain: PlayerUpdateAmmo(pp, WPN_STAR, DamageData[WPN_STAR].weapon_pickup); SetFadeAmt(pp,ITEMFLASHAMT,ITEMFLASHCLR); // Flash blue on item pickup if (pp == Player+myconnectindex) - PlaySound(DIGI_ITEM, &sp->x, &sp->y, &sp->z, v3df_dontpan); + PlaySound(DIGI_ITEM, sp, v3df_dontpan); KillGetWeapon(SpriteNum); if (TEST(pp->WpnFlags, BIT(WPN_STAR))) break; @@ -5956,7 +5956,7 @@ KeyMain: PlayerUpdateAmmo(pp, WPN_MINE, DamageData[WPN_MINE].weapon_pickup); SetFadeAmt(pp,ITEMFLASHAMT,ITEMFLASHCLR); // Flash blue on item pickup if (pp == Player+myconnectindex) - PlaySound(DIGI_ITEM, &sp->x, &sp->y, &sp->z, v3df_dontpan); + PlaySound(DIGI_ITEM, sp, v3df_dontpan); ChoosePlayerGetSound(pp); KillGetWeapon(SpriteNum); if (TEST(pp->WpnFlags, BIT(WPN_MINE))) @@ -5986,7 +5986,7 @@ KeyMain: PlayerUpdateAmmo(pp, WPN_UZI, DamageData[WPN_UZI].weapon_pickup); SetFadeAmt(pp,ITEMFLASHAMT,ITEMFLASHCLR); // Flash blue on item pickup if (pp == Player+myconnectindex) - PlaySound(DIGI_ITEM, &sp->x, &sp->y, &sp->z, v3df_dontpan); + PlaySound(DIGI_ITEM, sp, v3df_dontpan); KillGetWeapon(SpriteNum); if (TEST(pp->WpnFlags, BIT(WPN_UZI)) && TEST(pp->Flags, PF_TWO_UZI)) @@ -5998,7 +5998,7 @@ KeyMain: SET(pp->Flags, PF_TWO_UZI); pp->WpnUziType = 0; // Let it come up if (pp == Player+myconnectindex) - PlayerSound(DIGI_DOUBLEUZI, &pp->posx, &pp->posy, &pp->posz, v3df_dontpan|v3df_follow, pp); + PlayerSound(DIGI_DOUBLEUZI, v3df_dontpan|v3df_follow, pp); } else { @@ -6023,7 +6023,7 @@ KeyMain: PlayerUpdateAmmo(pp, WPN_UZI, DamageData[WPN_UZI].ammo_pickup); SetFadeAmt(pp,ITEMFLASHAMT,ITEMFLASHCLR); // Flash blue on item pickup if (pp == Player+myconnectindex) - PlaySound(DIGI_ITEM, &sp->x, &sp->y, &sp->z, v3df_dontpan); + PlaySound(DIGI_ITEM, sp, v3df_dontpan); KillGetAmmo(SpriteNum); break; @@ -6042,7 +6042,7 @@ KeyMain: PlayerUpdateAmmo(pp, WPN_MICRO, DamageData[WPN_MICRO].weapon_pickup); SetFadeAmt(pp,ITEMFLASHAMT,ITEMFLASHCLR); // Flash blue on item pickup if (pp == Player+myconnectindex) - PlaySound(DIGI_ITEM, &sp->x, &sp->y, &sp->z, v3df_dontpan); + PlaySound(DIGI_ITEM, sp, v3df_dontpan); ChoosePlayerGetSound(pp); KillGetWeapon(SpriteNum); if (TEST(pp->WpnFlags, BIT(WPN_MICRO))) @@ -6064,7 +6064,7 @@ KeyMain: PlayerUpdateAmmo(pp, WPN_MICRO, DamageData[WPN_MICRO].ammo_pickup); SetFadeAmt(pp,ITEMFLASHAMT,ITEMFLASHCLR); // Flash blue on item pickup if (pp == Player+myconnectindex) - PlaySound(DIGI_ITEM, &sp->x, &sp->y, &sp->z, v3df_dontpan); + PlaySound(DIGI_ITEM, sp, v3df_dontpan); KillGetAmmo(SpriteNum); break; @@ -6076,10 +6076,9 @@ KeyMain: pp->WpnRocketNuke = DamageData[DMG_NUCLEAR_EXP].weapon_pickup; SetFadeAmt(pp,ITEMFLASHAMT,ITEMFLASHCLR); // Flash blue on item pickup if (pp == Player+myconnectindex) - PlaySound(DIGI_ITEM, &sp->x, &sp->y, &sp->z, v3df_dontpan); + PlaySound(DIGI_ITEM, sp, v3df_dontpan); if (STD_RANDOM_RANGE(1000) > 800 && pp == Player+myconnectindex) - PlayerSound(DIGI_ILIKENUKES, &pp->posx, &pp->posy, &pp->posz, - v3df_dontpan|v3df_doppler|v3df_follow,pp); + PlayerSound(DIGI_ILIKENUKES, v3df_dontpan|v3df_doppler|v3df_follow,pp); if (pp->CurWpn == pp->Wpn[WPN_MICRO]) { if (pp->WpnRocketType != 2) @@ -6110,11 +6109,10 @@ KeyMain: PlayerUpdateAmmo(pp, WPN_GRENADE, DamageData[WPN_GRENADE].weapon_pickup); SetFadeAmt(pp,ITEMFLASHAMT,ITEMFLASHCLR); // Flash blue on item pickup if (pp == Player+myconnectindex) - PlaySound(DIGI_ITEM, &sp->x, &sp->y, &sp->z, v3df_dontpan); + PlaySound(DIGI_ITEM, sp, v3df_dontpan); //ChoosePlayerGetSound(pp); if (STD_RANDOM_RANGE(1000) > 800 && pp == Player+myconnectindex) - PlayerSound(DIGI_LIKEBIGWEAPONS, &pp->posx, &pp->posy, &pp->posz, - v3df_dontpan|v3df_doppler|v3df_follow,pp); + PlayerSound(DIGI_LIKEBIGWEAPONS, v3df_dontpan|v3df_doppler|v3df_follow,pp); KillGetWeapon(SpriteNum); if (TEST(pp->WpnFlags, BIT(WPN_GRENADE))) break; @@ -6135,7 +6133,7 @@ KeyMain: PlayerUpdateAmmo(pp, WPN_GRENADE, DamageData[WPN_GRENADE].ammo_pickup); SetFadeAmt(pp,ITEMFLASHAMT,ITEMFLASHCLR); // Flash blue on item pickup if (pp == Player+myconnectindex) - PlaySound(DIGI_ITEM, &sp->x, &sp->y, &sp->z, v3df_dontpan); + PlaySound(DIGI_ITEM, sp, v3df_dontpan); KillGetAmmo(SpriteNum); break; @@ -6143,7 +6141,7 @@ KeyMain: case ICON_ROCKET: pp->WpnAmmo[WPN_ROCKET] += 15; if (pp == Player+myconnectindex) - PlaySound(DIGI_ITEM, &sp->x, &sp->y, &sp->z, v3df_dontpan); + PlaySound(DIGI_ITEM, sp, v3df_dontpan); KillGet(SpriteNum); if (TEST(pp->WpnFlags, BIT(WPN_ROCKET))) break; @@ -6160,7 +6158,7 @@ KeyMain: PlayerUpdateAmmo(pp, WPN_ROCKET, 20); SetFadeAmt(pp,ITEMFLASHAMT,ITEMFLASHCLR); // Flash blue on item pickup if (pp == Player+myconnectindex) - PlaySound(DIGI_ITEM, &sp->x, &sp->y, &sp->z, v3df_dontpan); + PlaySound(DIGI_ITEM, sp, v3df_dontpan); KillGet(SpriteNum); break; #endif @@ -6180,15 +6178,13 @@ KeyMain: PlayerUpdateAmmo(pp, WPN_RAIL, DamageData[WPN_RAIL].weapon_pickup); SetFadeAmt(pp,ITEMFLASHAMT,ITEMFLASHCLR); // Flash blue on item pickup if (pp == Player+myconnectindex) - PlaySound(DIGI_ITEM, &sp->x, &sp->y, &sp->z, v3df_dontpan); + PlaySound(DIGI_ITEM, sp, v3df_dontpan); if (pp == Player+myconnectindex) { if (STD_RANDOM_RANGE(1000) > 700) - PlayerSound(DIGI_LIKEBIGWEAPONS, &pp->posx, &pp->posy, &pp->posz, - v3df_dontpan|v3df_doppler|v3df_follow,pp); + PlayerSound(DIGI_LIKEBIGWEAPONS, v3df_dontpan|v3df_doppler|v3df_follow,pp); else - PlayerSound(DIGI_GOTRAILGUN, &pp->posx, &pp->posy, &pp->posz, - v3df_dontpan|v3df_doppler|v3df_follow,pp); + PlayerSound(DIGI_GOTRAILGUN, v3df_dontpan|v3df_doppler|v3df_follow,pp); } //ChoosePlayerGetSound(pp); KillGetWeapon(SpriteNum); @@ -6213,7 +6209,7 @@ KeyMain: PlayerUpdateAmmo(pp, WPN_RAIL, DamageData[WPN_RAIL].ammo_pickup); SetFadeAmt(pp,ITEMFLASHAMT,ITEMFLASHCLR); // Flash blue on item pickup if (pp == Player+myconnectindex) - PlaySound(DIGI_ITEM, &sp->x, &sp->y, &sp->z, v3df_dontpan); + PlaySound(DIGI_ITEM, sp, v3df_dontpan); KillGetAmmo(SpriteNum); break; @@ -6231,7 +6227,7 @@ KeyMain: PlayerUpdateAmmo(pp, WPN_SHOTGUN, DamageData[WPN_SHOTGUN].weapon_pickup); SetFadeAmt(pp,ITEMFLASHAMT,ITEMFLASHCLR); // Flash blue on item pickup if (pp == Player+myconnectindex) - PlaySound(DIGI_ITEM, &sp->x, &sp->y, &sp->z, v3df_dontpan); + PlaySound(DIGI_ITEM, sp, v3df_dontpan); ChoosePlayerGetSound(pp); KillGetWeapon(SpriteNum); if (TEST(pp->WpnFlags, BIT(WPN_SHOTGUN))) @@ -6253,7 +6249,7 @@ KeyMain: PlayerUpdateAmmo(pp, WPN_SHOTGUN, DamageData[WPN_SHOTGUN].ammo_pickup); SetFadeAmt(pp,ITEMFLASHAMT,ITEMFLASHCLR); // Flash on item pickup if (pp == Player+myconnectindex) - PlaySound(DIGI_ITEM, &sp->x, &sp->y, &sp->z, v3df_dontpan); + PlaySound(DIGI_ITEM, sp, v3df_dontpan); KillGetAmmo(SpriteNum); break; @@ -6266,7 +6262,7 @@ KeyMain: pp->WpnShotgunAuto = 50; SetFadeAmt(pp,ITEMFLASHAMT,ITEMFLASHCLR); // Flash blue on item pickup if (pp == Player+myconnectindex) - PlaySound(DIGI_ITEM, &sp->x, &sp->y, &sp->z, v3df_dontpan); + PlaySound(DIGI_ITEM, sp, v3df_dontpan); KillGet(SpriteNum); if (pp->CurWpn == pp->Wpn[WPN_SHOTGUN]) { @@ -6297,11 +6293,10 @@ KeyMain: PlayerUpdateAmmo(pp, WPN_HOTHEAD, DamageData[WPN_HOTHEAD].weapon_pickup); SetFadeAmt(pp,ITEMFLASHAMT,ITEMFLASHCLR); // Flash blue on item pickup if (pp == Player+myconnectindex) - PlaySound(DIGI_ITEM, &sp->x, &sp->y, &sp->z, v3df_dontpan); + PlaySound(DIGI_ITEM, sp, v3df_dontpan); //ChoosePlayerGetSound(pp); if (STD_RANDOM_RANGE(1000) > 800 && pp == Player+myconnectindex) - PlayerSound(DIGI_LIKEBIGWEAPONS, &pp->posx, &pp->posy, &pp->posz, - v3df_dontpan|v3df_doppler|v3df_follow,pp); + PlayerSound(DIGI_LIKEBIGWEAPONS, v3df_dontpan|v3df_doppler|v3df_follow,pp); KillGetWeapon(SpriteNum); if (TEST(pp->WpnFlags, BIT(WPN_HOTHEAD))) break; @@ -6324,7 +6319,7 @@ KeyMain: PlayerUpdateAmmo(pp, WPN_HOTHEAD, DamageData[WPN_HOTHEAD].ammo_pickup); SetFadeAmt(pp,ITEMFLASHAMT,ITEMFLASHCLR); // Flash blue on item pickup if (pp == Player+myconnectindex) - PlaySound(DIGI_ITEM, &sp->x, &sp->y, &sp->z, v3df_dontpan); + PlaySound(DIGI_ITEM, sp, v3df_dontpan); KillGetAmmo(SpriteNum); break; @@ -6343,11 +6338,10 @@ KeyMain: PlayerUpdateAmmo(pp, WPN_HEART, DamageData[WPN_HEART].weapon_pickup); SetFadeAmt(pp,ITEMFLASHAMT,ITEMFLASHCLR); // Flash blue on item pickup if (pp == Player+myconnectindex) - PlaySound(DIGI_ITEM, &sp->x, &sp->y, &sp->z, v3df_dontpan); + PlaySound(DIGI_ITEM, sp, v3df_dontpan); //ChoosePlayerGetSound(pp); if (STD_RANDOM_RANGE(1000) > 800 && pp == Player+myconnectindex) - PlayerSound(DIGI_LIKEBIGWEAPONS, &pp->posx, &pp->posy, &pp->posz, - v3df_dontpan|v3df_doppler|v3df_follow,pp); + PlayerSound(DIGI_LIKEBIGWEAPONS, v3df_dontpan|v3df_doppler|v3df_follow,pp); KillGetWeapon(SpriteNum); if (TEST(pp->WpnFlags, BIT(WPN_HEART))) break; @@ -6372,7 +6366,7 @@ KeyMain: PlayerUpdateAmmo(pp, WPN_HEART, DamageData[WPN_HEART].ammo_pickup); SetFadeAmt(pp,ITEMFLASHAMT,ITEMFLASHCLR); // Flash blue on item pickup if (pp == Player+myconnectindex) - PlaySound(DIGI_ITEM, &sp->x, &sp->y, &sp->z, v3df_dontpan); + PlaySound(DIGI_ITEM, sp, v3df_dontpan); KillGetAmmo(SpriteNum); break; @@ -6398,7 +6392,7 @@ KeyMain: MNU_MeasureString(SpellName[sp->lotag], &w, &h); PutStringTimer(pp, TEXT_TEST_COL(w), TEXT_SPELL_INFO_LINE, SpellName[sp->lotag], TEXT_TEST_TIME); if (pp == Player+myconnectindex) - PlaySound(DIGI_ITEM, &sp->x, &sp->y, &sp->z, v3df_dontpan); + PlaySound(DIGI_ITEM, sp, v3df_dontpan); KillGet(SpriteNum); break; } @@ -6413,7 +6407,7 @@ KeyMain: pp->WpnRocketHeat = DamageData[DMG_NUCLEAR_EXP].ammo_pickup; SetFadeAmt(pp,ITEMFLASHAMT,ITEMFLASHCLR); // Flash blue on item pickup if (pp == Player+myconnectindex) - PlaySound(DIGI_ITEM, &sp->x, &sp->y, &sp->z, v3df_dontpan); + PlaySound(DIGI_ITEM, sp, v3df_dontpan); KillGet(SpriteNum); if (pp->CurWpn == pp->Wpn[WPN_MICRO]) @@ -6436,7 +6430,7 @@ KeyMain: case ICON_FLAG: if (sp->pal == sprite[pp->PlayerSprite].pal) break; // Can't pick up your own flag! - PlaySound(DIGI_ITEM, &sp->x, &sp->y, &sp->z, v3df_dontpan); + PlaySound(DIGI_ITEM, sp, v3df_dontpan); if (sp->hitag == TAG_NORESPAWN_FLAG) New = SpawnSprite(STAT_ITEM, ICON_FLAG, s_CarryFlagNoDet, sp->sectnum, @@ -7207,7 +7201,7 @@ void MissileWarpType(SPRITEp sp, SPRITEp sp_warp) case 1: break; default: - PlaySound(DIGI_ITEM_SPAWN, &sp->x, &sp->y, &sp->z, v3df_none); + PlaySound(DIGI_ITEM_SPAWN, sp, v3df_none); //DoSpawnTeleporterEffectPlace(sp); DoSpawnItemTeleporterEffect(sp); break; @@ -7221,7 +7215,7 @@ void ActorWarpType(SPRITEp sp, SPRITEp sp_warp) case 1: break; default: - PlaySound(DIGI_ITEM_SPAWN, &sp->x, &sp->y, &sp->z, v3df_none); + PlaySound(DIGI_ITEM_SPAWN, sp, v3df_none); DoSpawnTeleporterEffectPlace(sp); break; } diff --git a/source/sw/src/sumo.cpp b/source/sw/src/sumo.cpp index 565c71312..7427cd95a 100644 --- a/source/sw/src/sumo.cpp +++ b/source/sw/src/sumo.cpp @@ -726,7 +726,7 @@ int InitSumoCharge(short SpriteNum) USERp u = User[SpriteNum]; if (RANDOM_P2(1024) > 950) - PlaySound(DIGI_SUMOALERT, &sp->x, &sp->y, &sp->z, v3df_follow); + PlaySound(DIGI_SUMOALERT, sp, v3df_follow); DoActorSetSpeed(SpriteNum, FAST_SPEED); @@ -754,7 +754,7 @@ int InitSumoFart(short SpriteNum) USERp u = User[SpriteNum]; extern int InitSumoNapalm(short SpriteNum); - PlaySound(DIGI_SUMOFART, &sp->x, &sp->y, &sp->z, v3df_follow); + PlaySound(DIGI_SUMOFART, sp, v3df_follow); InitChemBomb(SpriteNum); @@ -770,7 +770,7 @@ int InitSumoStomp(short SpriteNum) USERp u = User[SpriteNum]; extern int InitSumoStompAttack(short SpriteNum); - PlaySound(DIGI_SUMOSTOMP, &sp->x, &sp->y, &sp->z, v3df_none); + PlaySound(DIGI_SUMOSTOMP, sp, v3df_none); SetSumoQuake(SpriteNum); InitSumoStompAttack(SpriteNum); @@ -795,7 +795,7 @@ int DoSumoDeathMelt(short SpriteNum) SPRITEp sp = &sprite[SpriteNum]; USERp u = User[SpriteNum]; - PlaySound(DIGI_SUMOFART, &sp->x, &sp->y, &sp->z, v3df_follow); + PlaySound(DIGI_SUMOFART, sp, v3df_follow); u->ID = SUMO_RUN_R0; InitChemBomb(SpriteNum); diff --git a/source/sw/src/weapon.cpp b/source/sw/src/weapon.cpp index c5f255cf8..34c83198a 100644 --- a/source/sw/src/weapon.cpp +++ b/source/sw/src/weapon.cpp @@ -3284,7 +3284,7 @@ AutoShrap: return FALSE; case SHRAP_GLASS: - PlaySound(DIGI_BREAKGLASS,&parent->x,&parent->y,&parent->z,v3df_dontpan|v3df_doppler); + PlaySound(DIGI_BREAKGLASS,parent,v3df_dontpan|v3df_doppler); p = GlassShrap; //BreakShrapSetup(GlassShrap, sizeof(GlassShrap), CustomShrap, shrap_amt); if (shrap_amt) @@ -3300,7 +3300,7 @@ AutoShrap: case SHRAP_GENERIC: case SHRAP_STONE: - PlaySound(DIGI_BREAKSTONES,&parent->x,&parent->y,&parent->z,v3df_dontpan|v3df_doppler); + PlaySound(DIGI_BREAKSTONES,parent,v3df_dontpan|v3df_doppler); p = StoneShrap; if (shrap_amt) { @@ -3314,7 +3314,7 @@ AutoShrap: break; case SHRAP_WOOD: - PlaySound(DIGI_BREAKINGWOOD,&parent->x,&parent->y,&parent->z,v3df_dontpan|v3df_doppler); + PlaySound(DIGI_BREAKINGWOOD,parent,v3df_dontpan|v3df_doppler); p = WoodShrap; if (shrap_amt) { @@ -3332,14 +3332,14 @@ AutoShrap: break; case SHRAP_GIBS: - PlaySound(DIGI_GIBS1,&parent->x,&parent->y,&parent->z,v3df_dontpan|v3df_doppler); + PlaySound(DIGI_GIBS1,parent,v3df_dontpan|v3df_doppler); p = SmallGore; shrap_xsize = shrap_ysize = 34; shrap_bounce = FALSE; break; case SHRAP_TREE_BARK: - PlaySound(DIGI_BREAKINGWOOD,&parent->x,&parent->y,&parent->z,v3df_dontpan|v3df_doppler); + PlaySound(DIGI_BREAKINGWOOD,parent,v3df_dontpan|v3df_doppler); p = WoodShrap; if (shrap_amt) { @@ -3365,7 +3365,7 @@ AutoShrap: break; case SHRAP_METAL: - PlaySound(DIGI_BREAKMETAL,&parent->x,&parent->y,&parent->z,v3df_dontpan|v3df_doppler); + PlaySound(DIGI_BREAKMETAL,parent,v3df_dontpan|v3df_doppler); p = MetalShrap; if (shrap_amt) { @@ -3380,7 +3380,7 @@ AutoShrap: case SHRAP_COIN: - PlaySound(DIGI_COINS,&parent->x,&parent->y,&parent->z,v3df_dontpan|v3df_doppler); + PlaySound(DIGI_COINS,parent,v3df_dontpan|v3df_doppler); p = CoinShrap; if (shrap_amt) { @@ -3394,7 +3394,7 @@ AutoShrap: break; case SHRAP_METALMIX: - PlaySound(DIGI_BREAKMETAL,&parent->x,&parent->y,&parent->z,v3df_dontpan|v3df_doppler); + PlaySound(DIGI_BREAKMETAL,parent,v3df_dontpan|v3df_doppler); p = MetalMix; if (shrap_amt) { @@ -3428,7 +3428,7 @@ AutoShrap: ep->xrepeat = ep->yrepeat = size + shrap_delta_size; #endif - //PlaySound(DIGI_BREAKMARBELS,&parent->x,&parent->y,&parent->z,v3df_dontpan|v3df_doppler); + //PlaySound(DIGI_BREAKMARBELS,parent,v3df_dontpan|v3df_doppler); p = Marbels; if (shrap_amt) { @@ -3443,7 +3443,7 @@ AutoShrap: break; case SHRAP_WOODMIX: - PlaySound(DIGI_BREAKINGWOOD,&parent->x,&parent->y,&parent->z,v3df_dontpan|v3df_doppler); + PlaySound(DIGI_BREAKINGWOOD,parent,v3df_dontpan|v3df_doppler); p = WoodMix; if (shrap_amt) { @@ -3457,7 +3457,7 @@ AutoShrap: break; case SHRAP_PAPERMIX: - PlaySound(DIGI_BREAKINGWOOD,&parent->x,&parent->y,&parent->z,v3df_dontpan|v3df_doppler); + PlaySound(DIGI_BREAKINGWOOD,parent,v3df_dontpan|v3df_doppler); p = PaperMix; if (shrap_amt) { @@ -3533,42 +3533,42 @@ AutoShrap: break; case BREAK_BARREL: - PlaySound(DIGI_BREAKDEBRIS,&parent->x,&parent->y,&parent->z,v3df_dontpan|v3df_doppler); + PlaySound(DIGI_BREAKDEBRIS,parent,v3df_dontpan|v3df_doppler); p = WoodShrap; shrap_xsize = shrap_ysize = 24; shrap_bounce = TRUE; ChangeState(parent - sprite, s_BreakBarrel); break; case BREAK_LIGHT: - PlaySound(DIGI_BREAKGLASS,&parent->x,&parent->y,&parent->z,v3df_dontpan|v3df_doppler); + PlaySound(DIGI_BREAKGLASS,parent,v3df_dontpan|v3df_doppler); p = GlassShrap; shrap_xsize = shrap_ysize = 24; shrap_bounce = TRUE; ChangeState(parent - sprite, s_BreakLight); break; case BREAK_PEDISTAL: - PlaySound(DIGI_BREAKSTONES,&parent->x,&parent->y,&parent->z,v3df_dontpan|v3df_doppler); + PlaySound(DIGI_BREAKSTONES,parent,v3df_dontpan|v3df_doppler); p = StoneShrap; shrap_xsize = shrap_ysize = 24; shrap_bounce = TRUE; ChangeState(parent - sprite, s_BreakPedistal); break; case BREAK_BOTTLE1: - PlaySound(DIGI_BREAKGLASS,&parent->x,&parent->y,&parent->z,v3df_dontpan|v3df_doppler); + PlaySound(DIGI_BREAKGLASS,parent,v3df_dontpan|v3df_doppler); p = GlassShrap; shrap_xsize = shrap_ysize = 8; shrap_bounce = TRUE; ChangeState(parent - sprite, s_BreakBottle1); break; case BREAK_BOTTLE2: - PlaySound(DIGI_BREAKGLASS,&parent->x,&parent->y,&parent->z,v3df_dontpan|v3df_doppler); + PlaySound(DIGI_BREAKGLASS,parent,v3df_dontpan|v3df_doppler); p = GlassShrap; shrap_xsize = shrap_ysize = 8; shrap_bounce = TRUE; ChangeState(parent - sprite, s_BreakBottle2); break; case BREAK_MUSHROOM: - PlaySound(DIGI_BREAKDEBRIS,&parent->x,&parent->y,&parent->z,v3df_dontpan|v3df_doppler); + PlaySound(DIGI_BREAKDEBRIS,parent,v3df_dontpan|v3df_doppler); p = StoneShrap; shrap_xsize = shrap_ysize = 4; shrap_bounce = TRUE; @@ -3600,7 +3600,7 @@ AutoShrap: shrap_xsize = shrap_ysize = 10; break; case LAVA_BOULDER: - PlaySound(DIGI_BREAKSTONES,&parent->x,&parent->y,&parent->z,v3df_dontpan|v3df_doppler); + PlaySound(DIGI_BREAKSTONES,parent,v3df_dontpan|v3df_doppler); p = LavaBoulderShrap; shrap_owner = parent->owner; shrap_xsize = shrap_ysize = 24; @@ -3715,7 +3715,7 @@ AutoShrap: case PACHINKO3: case PACHINKO4: case 623: - PlaySound(DIGI_BREAKGLASS,&parent->x,&parent->y,&parent->z,v3df_dontpan|v3df_doppler); + PlaySound(DIGI_BREAKGLASS,parent,v3df_dontpan|v3df_doppler); p = MetalShrap; shrap_xsize = shrap_ysize = 10; break; @@ -4606,8 +4606,8 @@ WeaponMoveHit(short SpriteNum) switch (hu->ID) { case TRASHCAN: - PlaySound(DIGI_TRASHLID, &sp->x, &sp->y, &sp->z, v3df_none); - PlaySound(DIGI_STARCLINK, &sp->x, &sp->y, &sp->z, v3df_none); + PlaySound(DIGI_TRASHLID, sp, v3df_none); + PlaySound(DIGI_STARCLINK, sp, v3df_none); if (hu->WaitTics <= 0) { hu->WaitTics = SEC(2); @@ -4621,7 +4621,7 @@ WeaponMoveHit(short SpriteNum) case ZILLA_RUN_R0: case 623: { - PlaySound(DIGI_STARCLINK, &sp->x, &sp->y, &sp->z, v3df_none); + PlaySound(DIGI_STARCLINK, sp, v3df_none); } break; } @@ -5148,7 +5148,7 @@ ActorChooseDeath(short SpriteNum, short Weapon) PLAYERp pp = wu->PlayerP; if (pp && !TEST(pp->Flags, PF_DIVING)) // JBF: added null test pp->Bloody = TRUE; - PlaySound(DIGI_TOILETGIRLSCREAM, &sp->x, &sp->y, &sp->z, v3df_none); + PlaySound(DIGI_TOILETGIRLSCREAM, sp, v3df_none); } if (SpawnShrap(SpriteNum, Weapon)) SetSuicide(SpriteNum); @@ -5179,17 +5179,17 @@ ActorChooseDeath(short SpriteNum, short Weapon) choosesnd=STD_RANDOM_RANGE(6); if (choosesnd == 0) - PlayerSound(DIGI_KUNGFU,&pp->posx,&pp->posy,&pp->posz,v3df_follow|v3df_dontpan,pp); + PlayerSound(DIGI_KUNGFU, v3df_follow|v3df_dontpan,pp); else if (choosesnd == 1) - PlayerSound(DIGI_PAYINGATTENTION,&pp->posx,&pp->posy,&pp->posz,v3df_follow|v3df_dontpan,pp); + PlayerSound(DIGI_PAYINGATTENTION, v3df_follow|v3df_dontpan,pp); else if (choosesnd == 2) - PlayerSound(DIGI_EATTHIS,&pp->posx,&pp->posy,&pp->posz,v3df_follow|v3df_dontpan,pp); + PlayerSound(DIGI_EATTHIS, v3df_follow|v3df_dontpan,pp); else if (choosesnd == 3) - PlayerSound(DIGI_TAUNTAI4,&pp->posx,&pp->posy,&pp->posz,v3df_follow|v3df_dontpan,pp); + PlayerSound(DIGI_TAUNTAI4, v3df_follow|v3df_dontpan,pp); else if (choosesnd == 4) - PlayerSound(DIGI_TAUNTAI5,&pp->posx,&pp->posy,&pp->posz,v3df_follow|v3df_dontpan,pp); + PlayerSound(DIGI_TAUNTAI5, v3df_follow|v3df_dontpan,pp); else if (choosesnd == 5) - PlayerSound(DIGI_HOWYOULIKEMOVE,&pp->posx,&pp->posy,&pp->posz,v3df_follow|v3df_dontpan,pp); + PlayerSound(DIGI_HOWYOULIKEMOVE, v3df_follow|v3df_dontpan,pp); //PlayerSound(TauntAIVocs[choosesnd],&pp->posx, // &pp->posy,&pp->posy,v3df_dontpan|v3df_follow,pp); } @@ -5199,13 +5199,13 @@ ActorChooseDeath(short SpriteNum, short Weapon) choose_snd = STD_RANDOM_RANGE(1000); if (choose_snd > 750) - PlayerSound(DIGI_SWORDGOTU1,&pp->posx,&pp->posy,&pp->posz,v3df_follow|v3df_dontpan,pp); + PlayerSound(DIGI_SWORDGOTU1, v3df_follow|v3df_dontpan,pp); else if (choose_snd > 575) - PlayerSound(DIGI_SWORDGOTU2,&pp->posx,&pp->posy,&pp->posz,v3df_follow|v3df_dontpan,pp); + PlayerSound(DIGI_SWORDGOTU2, v3df_follow|v3df_dontpan,pp); else if (choose_snd > 250) - PlayerSound(DIGI_SWORDGOTU3,&pp->posx,&pp->posy,&pp->posz,v3df_follow|v3df_dontpan,pp); + PlayerSound(DIGI_SWORDGOTU3, v3df_follow|v3df_dontpan,pp); else - PlayerSound(DIGI_CANBEONLYONE,&pp->posx,&pp->posy,&pp->posz,v3df_follow|v3df_dontpan,pp); + PlayerSound(DIGI_CANBEONLYONE, v3df_follow|v3df_dontpan,pp); } if (!TEST(pp->Flags, PF_DIVING)) pp->Bloody = TRUE; @@ -5293,8 +5293,7 @@ ActorChooseDeath(short SpriteNum, short Weapon) choosesnd=STD_RANDOM_RANGE(MAX_TAUNTAI<<8)>>8; if (pp && pp == Player+myconnectindex) - PlayerSound(TauntAIVocs[choosesnd],&pp->posx, - &pp->posy,&pp->posy,v3df_dontpan|v3df_follow,pp); + PlayerSound(TauntAIVocs[choosesnd],v3df_dontpan|v3df_follow,pp); } } } @@ -5419,7 +5418,7 @@ ActorHealth(short SpriteNum, short amt) SET(u->Flags2, SPR2_DYING); // Only let it check this once! u->WaitTics = SEC(1) + SEC(RANDOM_RANGE(2)); u->Health = 60; - PlaySound(DIGI_NINJACHOKE,&sp->x,&sp->y,&sp->z,v3df_follow); + PlaySound(DIGI_NINJACHOKE, sp, v3df_follow); InitPlasmaFountain(NULL, sp); InitBloodSpray(SpriteNum,FALSE,105); sp->ang = NORM_ANGLE(getangle(u->tgt_sp->x - sp->x, u->tgt_sp->y - sp->y) + 1024); @@ -6012,8 +6011,7 @@ DoDamage(short SpriteNum, short Weapon) if (STD_RANDOM_RANGE(1024) > 512 && pp == Player+myconnectindex) { choosesnd=RANDOM_RANGE(MAX_TAUNTAI); - PlayerSound(TauntAIVocs[choosesnd],&pp->posx, - &pp->posy,&pp->posy,v3df_dontpan|v3df_follow,pp); + PlayerSound(TauntAIVocs[choosesnd],v3df_dontpan|v3df_follow,pp); } SpawnShrap(SpriteNum, Weapon); SetSuicide(SpriteNum); @@ -6079,7 +6077,7 @@ DoDamage(short SpriteNum, short Weapon) damage -= 5 - RANDOM_RANGE(10); break; } - PlaySound(DIGI_CGTHIGHBONE,&wp->x,&wp->y,&wp->z,v3df_follow|v3df_dontpan); + PlaySound(DIGI_CGTHIGHBONE,wp,v3df_follow|v3df_dontpan); } ////DSPRINTF(ds,"got here 3, %d",damage); @@ -6101,7 +6099,7 @@ DoDamage(short SpriteNum, short Weapon) PlayerCheckDeath(u->PlayerP, Weapon); } if (u->PlayerP->Armor) - PlaySound(DIGI_ARMORHIT,&u->PlayerP->posx,&u->PlayerP->posy,&u->PlayerP->posz,v3df_dontpan|v3df_follow|v3df_doppler); + PlaySound(DIGI_ARMORHIT,u->PlayerP,v3df_dontpan|v3df_follow|v3df_doppler); } else { @@ -6147,7 +6145,7 @@ DoDamage(short SpriteNum, short Weapon) break; case HORNET_RUN_R0: - PlaySound(DIGI_HORNETSTING,&sp->x,&sp->y,&sp->z,v3df_follow|v3df_dontpan); + PlaySound(DIGI_HORNETSTING, sp, v3df_follow|v3df_dontpan); damage = GetDamage(SpriteNum, Weapon, DMG_HORNET_STING); if (u->sop_parent) { @@ -6224,8 +6222,7 @@ DoDamage(short SpriteNum, short Weapon) PlayerUpdateHealth(u->PlayerP, damage); if (PlayerCheckDeath(u->PlayerP, Weapon)) { - PlaySound(DIGI_RIPPERHEARTOUT,&u->PlayerP->posx,&u->PlayerP->posy, - &u->PlayerP->posz,v3df_dontpan|v3df_doppler); + PlaySound(DIGI_RIPPERHEARTOUT,u->PlayerP,v3df_dontpan|v3df_doppler); DoRipperRipHeart(Weapon); } @@ -6259,8 +6256,7 @@ DoDamage(short SpriteNum, short Weapon) PlayerUpdateHealth(u->PlayerP, damage); if (PlayerCheckDeath(u->PlayerP, Weapon)) { - PlaySound(DIGI_RIPPERHEARTOUT,&u->PlayerP->posx,&u->PlayerP->posy, - &u->PlayerP->posz,v3df_dontpan|v3df_doppler); + PlaySound(DIGI_RIPPERHEARTOUT,u->PlayerP,v3df_dontpan|v3df_doppler); DoRipper2RipHeart(Weapon); } @@ -6405,7 +6401,7 @@ DoDamage(short SpriteNum, short Weapon) PlayerCheckDeath(u->PlayerP, Weapon); } if (u->PlayerP->Armor) - PlaySound(DIGI_ARMORHIT,&u->PlayerP->posx,&u->PlayerP->posy,&u->PlayerP->posz,v3df_dontpan|v3df_follow|v3df_doppler); + PlaySound(DIGI_ARMORHIT,u->PlayerP,v3df_dontpan|v3df_follow|v3df_doppler); } else { @@ -6439,7 +6435,7 @@ DoDamage(short SpriteNum, short Weapon) PlayerCheckDeath(u->PlayerP, Weapon); } if (u->PlayerP->Armor) - PlaySound(DIGI_ARMORHIT,&u->PlayerP->posx,&u->PlayerP->posy,&u->PlayerP->posz,v3df_dontpan|v3df_follow|v3df_doppler); + PlaySound(DIGI_ARMORHIT,u->PlayerP,v3df_dontpan|v3df_follow|v3df_doppler); } else { @@ -6539,7 +6535,7 @@ DoDamage(short SpriteNum, short Weapon) PlayerCheckDeath(u->PlayerP, Weapon); } if (u->PlayerP->Armor) - PlaySound(DIGI_ARMORHIT,&u->PlayerP->posx,&u->PlayerP->posy,&u->PlayerP->posz,v3df_dontpan|v3df_follow|v3df_doppler); + PlaySound(DIGI_ARMORHIT,u->PlayerP,v3df_dontpan|v3df_follow|v3df_doppler); } else { @@ -6588,7 +6584,7 @@ DoDamage(short SpriteNum, short Weapon) PlayerCheckDeath(u->PlayerP, Weapon); } if (u->PlayerP->Armor) - PlaySound(DIGI_ARMORHIT,&u->PlayerP->posx,&u->PlayerP->posy,&u->PlayerP->posz,v3df_dontpan|v3df_follow|v3df_doppler); + PlaySound(DIGI_ARMORHIT,u->PlayerP,v3df_dontpan|v3df_follow|v3df_doppler); } else { @@ -6723,7 +6719,7 @@ DoDamage(short SpriteNum, short Weapon) PlayerCheckDeath(u->PlayerP, Weapon); } if (u->PlayerP->Armor) - PlaySound(DIGI_ARMORHIT,&u->PlayerP->posx,&u->PlayerP->posy,&u->PlayerP->posz,v3df_dontpan|v3df_follow|v3df_doppler); + PlaySound(DIGI_ARMORHIT,u->PlayerP,v3df_dontpan|v3df_follow|v3df_doppler); } else { @@ -7263,7 +7259,7 @@ DoDamage(short SpriteNum, short Weapon) PlayerCheckDeath(u->PlayerP, Weapon); } if (u->PlayerP->Armor) - PlaySound(DIGI_ARMORHIT,&u->PlayerP->posx,&u->PlayerP->posy,&u->PlayerP->posz,v3df_dontpan|v3df_follow|v3df_doppler); + PlaySound(DIGI_ARMORHIT,u->PlayerP,v3df_dontpan|v3df_follow|v3df_doppler); } else { @@ -7320,7 +7316,7 @@ DoDamage(short SpriteNum, short Weapon) { PLAYERp pp = u->PlayerP; - PlayerSound(DIGI_GASHURT,&pp->posx,&pp->posy,&pp->posz,v3df_dontpan|v3df_follow|v3df_doppler,pp); + PlayerSound(DIGI_GASHURT, v3df_dontpan|v3df_follow|v3df_doppler,pp); PlayerUpdateHealth(u->PlayerP, damage-1000); PlayerCheckDeath(u->PlayerP, Weapon); } @@ -7388,7 +7384,7 @@ DoDamage(short SpriteNum, short Weapon) if (PlayerTakeDamage(u->PlayerP, Weapon)) { if (RANDOM_P2(1024<<4)>>4 < 800) - PlayerSound(DIGI_STEPONCALTROPS, &sp->x, &sp->y, &sp->z, v3df_follow|v3df_dontpan, u->PlayerP); + PlayerSound(DIGI_STEPONCALTROPS, v3df_follow|v3df_dontpan, u->PlayerP); PlayerUpdateHealth(u->PlayerP, damage); PlayerCheckDeath(u->PlayerP, Weapon); } @@ -7446,11 +7442,11 @@ DoDamage(short SpriteNum, short Weapon) if (u && u->PlayerP) { if (damage <= -40 && RANDOM_RANGE(1000) > 700) - PlayerSound(DIGI_SONOFABITCH, &sp->x, &sp->y, &sp->z, v3df_dontpan|v3df_follow, u->PlayerP); + PlayerSound(DIGI_SONOFABITCH, v3df_dontpan|v3df_follow, u->PlayerP); else if (damage <= -40 && RANDOM_RANGE(1000) > 700) - PlayerSound(DIGI_PAINFORWEAK, &sp->x, &sp->y, &sp->z, v3df_dontpan|v3df_follow, u->PlayerP); + PlayerSound(DIGI_PAINFORWEAK, v3df_dontpan|v3df_follow, u->PlayerP); else if (damage <= -10) - PlayerSound(PlayerPainVocs[RANDOM_RANGE(MAX_PAIN)], &sp->x, &sp->y, &sp->z, v3df_dontpan|v3df_follow, u->PlayerP); + PlayerSound(PlayerPainVocs[RANDOM_RANGE(MAX_PAIN)], v3df_dontpan|v3df_follow, u->PlayerP); } return 0; @@ -8216,11 +8212,11 @@ DoStar(int16_t Weapon) { su = User[hit_sprite]; if (su && (su->ID == TRASHCAN || su->ID == ZILLA_RUN_R0)) // JBF: added null test - PlaySound(DIGI_STARCLINK, &sp->x, &sp->y, &sp->z, v3df_none); + PlaySound(DIGI_STARCLINK, sp, v3df_none); } if (TEST(u->ret, HIT_MASK) != HIT_SPRITE) // Don't clank on sprites - PlaySound(DIGI_STARCLINK, &sp->x, &sp->y, &sp->z, v3df_none); + PlaySound(DIGI_STARCLINK, sp, v3df_none); if (WeaponMoveHit(Weapon)) { @@ -8841,7 +8837,7 @@ DoCoolgFire(int16_t Weapon) { if (WeaponMoveHit(Weapon)) { - PlaySound(DIGI_CGMAGICHIT,&sp->x,&sp->y,&sp->z,v3df_follow); + PlaySound(DIGI_CGMAGICHIT, sp, v3df_follow); ChangeState(Weapon, s_CoolgFireDone); if (sp->owner >= 0 && User[sp->owner] && User[sp->owner]->ID != RIPPER_RUN_R0) // JBF: added range check SpawnDemonFist(Weapon); // Just a red magic circle flash @@ -9037,7 +9033,7 @@ DoGrenade(int16_t Weapon) short hit_sprite = -2; SPRITEp hsp; - PlaySound(DIGI_40MMBNCE, &sp->x, &sp->y, &sp->z, v3df_dontpan); + PlaySound(DIGI_40MMBNCE, sp, v3df_dontpan); hit_sprite = NORM_SPRITE(u->ret); hsp = &sprite[hit_sprite]; @@ -9089,7 +9085,7 @@ DoGrenade(int16_t Weapon) break; } - PlaySound(DIGI_40MMBNCE, &sp->x, &sp->y, &sp->z, v3df_dontpan); + PlaySound(DIGI_40MMBNCE, sp, v3df_dontpan); nw = wall[hit_wall].point2; wall_ang = NORM_ANGLE(getangle(wall[nw].x - wph->x, wall[nw].y - wph->y)+512); @@ -9168,7 +9164,7 @@ DoGrenade(int16_t Weapon) u->zchange = -u->zchange; ScaleSpriteVector(Weapon, 40000); // 18000 u->zchange /= 4; - PlaySound(DIGI_40MMBNCE, &sp->x, &sp->y, &sp->z, v3df_dontpan); + PlaySound(DIGI_40MMBNCE, sp, v3df_dontpan); } else { @@ -9191,7 +9187,7 @@ DoGrenade(int16_t Weapon) { u->zchange = -u->zchange; ScaleSpriteVector(Weapon, 22000); - PlaySound(DIGI_40MMBNCE, &sp->x, &sp->y, &sp->z, v3df_dontpan); + PlaySound(DIGI_40MMBNCE, sp, v3df_dontpan); } } break; @@ -9277,7 +9273,7 @@ DoVulcanBoulder(int16_t Weapon) short hit_sprite = -2; SPRITEp hsp; -// PlaySound(DIGI_DHCLUNK, &sp->x, &sp->y, &sp->z, v3df_dontpan); +// PlaySound(DIGI_DHCLUNK, sp, v3df_dontpan); hit_sprite = NORM_SPRITE(u->ret); hsp = &sprite[hit_sprite]; @@ -9315,7 +9311,7 @@ DoVulcanBoulder(int16_t Weapon) break; } -// PlaySound(DIGI_DHCLUNK, &sp->x, &sp->y, &sp->z, v3df_dontpan); +// PlaySound(DIGI_DHCLUNK, sp, v3df_dontpan); nw = wall[hit_wall].point2; wall_ang = NORM_ANGLE(getangle(wall[nw].x - wph->x, wall[nw].y - wph->y)+512); @@ -9517,7 +9513,7 @@ DoMineStuck(int16_t Weapon) { if ((u->Counter2++) > 30) { - PlaySound(DIGI_MINEBEEP, &sp->x, &sp->y, &sp->z, v3df_dontpan); + PlaySound(DIGI_MINEBEEP, sp, v3df_dontpan); u->WaitTics = 32767; // Keep reseting tics to make it stay forever u->Counter2 = 0; } @@ -9549,56 +9545,56 @@ DoMineStuck(int16_t Weapon) case 0: if (u->WaitTics < SEC(45)) { - PlaySound(DIGI_MINEBEEP, &sp->x, &sp->y, &sp->z, v3df_dontpan); + PlaySound(DIGI_MINEBEEP, sp, v3df_dontpan); u->Counter2++; } break; case 1: if (u->WaitTics < SEC(38)) { - PlaySound(DIGI_MINEBEEP, &sp->x, &sp->y, &sp->z, v3df_dontpan); + PlaySound(DIGI_MINEBEEP, sp, v3df_dontpan); u->Counter2++; } break; case 2: if (u->WaitTics < SEC(30)) { - PlaySound(DIGI_MINEBEEP, &sp->x, &sp->y, &sp->z, v3df_dontpan); + PlaySound(DIGI_MINEBEEP, sp, v3df_dontpan); u->Counter2++; } break; case 3: if (u->WaitTics < SEC(20)) { - PlaySound(DIGI_MINEBEEP, &sp->x, &sp->y, &sp->z, v3df_dontpan); + PlaySound(DIGI_MINEBEEP, sp, v3df_dontpan); u->Counter2++; } break; case 4: if (u->WaitTics < SEC(15)) { - PlaySound(DIGI_MINEBEEP, &sp->x, &sp->y, &sp->z, v3df_dontpan); + PlaySound(DIGI_MINEBEEP, sp, v3df_dontpan); u->Counter2++; } break; case 5: if (u->WaitTics < SEC(12)) { - PlaySound(DIGI_MINEBEEP, &sp->x, &sp->y, &sp->z, v3df_dontpan); + PlaySound(DIGI_MINEBEEP, sp, v3df_dontpan); u->Counter2++; } break; case 6: if (u->WaitTics < SEC(10)) { - PlaySound(DIGI_MINEBEEP, &sp->x, &sp->y, &sp->z, v3df_dontpan); + PlaySound(DIGI_MINEBEEP, sp, v3df_dontpan); u->Counter2++; } break; case 7: if (u->WaitTics < SEC(8)) { - PlaySound(DIGI_MINEBEEP, &sp->x, &sp->y, &sp->z, v3df_dontpan); + PlaySound(DIGI_MINEBEEP, sp, v3df_dontpan); u->Counter2++; } break; @@ -9606,7 +9602,7 @@ DoMineStuck(int16_t Weapon) case 30: if (u->WaitTics < SEC(6)) { - PlaySound(DIGI_MINEBEEP, &sp->x, &sp->y, &sp->z, v3df_dontpan); + PlaySound(DIGI_MINEBEEP, sp, v3df_dontpan); u->Counter2 = MINE_DETONATE_STATE; } break; @@ -9614,14 +9610,14 @@ DoMineStuck(int16_t Weapon) // if (u->WaitTics < SEC(5)) // { // start frantic beeping -// PlaySound(DIGI_MINEBEEP, &sp->x, &sp->y, &sp->z, v3df_dontpan); +// PlaySound(DIGI_MINEBEEP, sp, v3df_dontpan); // u->Counter2++; // } // break; case MINE_DETONATE_STATE: if (u->WaitTics < 0) { - PlaySound(DIGI_MINEBEEP, &sp->x, &sp->y, &sp->z, v3df_dontpan); + PlaySound(DIGI_MINEBEEP, sp, v3df_dontpan); SpawnMineExp(Weapon); KillSprite(Weapon); return FALSE; @@ -9720,13 +9716,13 @@ DoMine(int16_t Weapon) pp = uo->PlayerP; if (RANDOM_RANGE(1000) > 800) - PlayerSound(DIGI_STICKYGOTU1,&pp->posx,&pp->posy,&pp->posz,v3df_follow|v3df_dontpan,pp); + PlayerSound(DIGI_STICKYGOTU1, v3df_follow|v3df_dontpan,pp); else if (RANDOM_RANGE(1000) > 800) - PlayerSound(DIGI_STICKYGOTU2,&pp->posx,&pp->posy,&pp->posz,v3df_follow|v3df_dontpan,pp); + PlayerSound(DIGI_STICKYGOTU2, v3df_follow|v3df_dontpan,pp); else if (RANDOM_RANGE(1000) > 800) - PlayerSound(DIGI_STICKYGOTU3,&pp->posx,&pp->posy,&pp->posz,v3df_follow|v3df_dontpan,pp); + PlayerSound(DIGI_STICKYGOTU3, v3df_follow|v3df_dontpan,pp); else if (RANDOM_RANGE(1000) > 800) - PlayerSound(DIGI_STICKYGOTU4,&pp->posx,&pp->posy,&pp->posz,v3df_follow|v3df_dontpan,pp); + PlayerSound(DIGI_STICKYGOTU4, v3df_follow|v3df_dontpan,pp); } } } @@ -10282,7 +10278,7 @@ DoRocket(int16_t Weapon) DISTANCE(sp->x, sp->y, u->tgt_sp->x, u->tgt_sp->y, dist, a, b, c); u->FlagOwner = dist>>6; // Special warn sound attached to each seeker spawned - PlaySound(DIGI_MINEBEEP,&sp->x,&sp->y,&sp->z,v3df_follow); + PlaySound(DIGI_MINEBEEP, sp, v3df_follow); } if (TEST(u->Flags, SPR_FIND_PLAYER)) @@ -10766,7 +10762,7 @@ int SpawnCoolieExp(short SpriteNum) nx = sp->x + MOVEx(64, sp->ang+1024); ny = sp->y + MOVEy(64, sp->ang+1024); - PlaySound(DIGI_COOLIEEXPLODE, &sp->x, &sp->y, &sp->z, v3df_none); + PlaySound(DIGI_COOLIEEXPLODE, sp, v3df_none); explosion = SpawnSprite(STAT_MISSILE, BOLT_EXP, s_BoltExp, sp->sectnum, nx, ny, zh, sp->ang, 0); @@ -10802,7 +10798,7 @@ SpawnBasicExp(int16_t Weapon) if (TEST(u->Flags, SPR_SUICIDE)) return -1; - PlaySound(DIGI_MEDIUMEXP, &sp->x, &sp->y, &sp->z, v3df_none); + PlaySound(DIGI_MEDIUMEXP, sp, v3df_none); explosion = SpawnSprite(STAT_MISSILE, BASIC_EXP, s_BasicExp, sp->sectnum, sp->x, sp->y, sp->z, sp->ang, 0); @@ -10959,7 +10955,7 @@ SpawnFireballFlames(int16_t SpriteNum, int16_t enemy) DoBeginJump(New); } - PlaySound(DIGI_FIRE1,&np->x,&np->y,&np->z,v3df_dontpan|v3df_doppler); + PlaySound(DIGI_FIRE1,np,v3df_dontpan|v3df_doppler); Set3DSoundOwner(New); return New; @@ -11001,7 +10997,7 @@ SpawnBreakFlames(int16_t SpriteNum) nu->jump_speed = 0; DoBeginJump(New); - PlaySound(DIGI_FIRE1,&np->x,&np->y,&np->z,v3df_dontpan|v3df_doppler); + PlaySound(DIGI_FIRE1,np,v3df_dontpan|v3df_doppler); Set3DSoundOwner(New); return New; @@ -11051,7 +11047,7 @@ SpawnBreakStaticFlames(int16_t SpriteNum) //nu->jump_speed = 0; //DoBeginJump(New); - PlaySound(DIGI_FIRE1,&np->x,&np->y,&np->z,v3df_dontpan|v3df_doppler); + PlaySound(DIGI_FIRE1,np,v3df_dontpan|v3df_doppler); Set3DSoundOwner(New); return New; @@ -11072,7 +11068,7 @@ SpawnFireballExp(int16_t Weapon) if (TEST(u->Flags, SPR_SUICIDE)) return -1; - PlaySound(DIGI_SMALLEXP, &sp->x, &sp->y, &sp->z, v3df_none); + PlaySound(DIGI_SMALLEXP, sp, v3df_none); explosion = SpawnSprite(STAT_MISSILE, FIREBALL_EXP, s_FireballExp, sp->sectnum, sp->x, sp->y, sp->z, sp->ang, 0); @@ -11115,7 +11111,7 @@ SpawnGoroFireballExp(int16_t Weapon) if (TEST(u->Flags, SPR_SUICIDE)) return -1; - PlaySound(DIGI_MEDIUMEXP, &sp->x, &sp->y, &sp->z, v3df_none); + PlaySound(DIGI_MEDIUMEXP, sp, v3df_none); explosion = SpawnSprite(STAT_MISSILE, 0, s_FireballExp, sp->sectnum, sp->x, sp->y, sp->z, sp->ang, 0); @@ -11154,7 +11150,7 @@ SpawnBoltExp(int16_t Weapon) if (u && TEST(u->Flags, SPR_SUICIDE)) return -1; - PlaySound(DIGI_BOLTEXPLODE, &sp->x, &sp->y, &sp->z, v3df_none); + PlaySound(DIGI_BOLTEXPLODE, sp, v3df_none); explosion = SpawnSprite(STAT_MISSILE, BOLT_EXP, s_BoltExp, sp->sectnum, sp->x, sp->y, sp->z, sp->ang, 0); @@ -11196,7 +11192,7 @@ SpawnBunnyExp(int16_t Weapon) if (u && TEST(u->Flags, SPR_SUICIDE)) return -1; - PlaySound(DIGI_BUNNYDIE3, &sp->x, &sp->y, &sp->z, v3df_none); + PlaySound(DIGI_BUNNYDIE3, sp, v3df_none); u->ID = BOLT_EXP; // Change id InitBloodSpray(Weapon,TRUE,-1); @@ -11221,7 +11217,7 @@ SpawnTankShellExp(int16_t Weapon) if (u && TEST(u->Flags, SPR_SUICIDE)) return -1; - PlaySound(DIGI_BOLTEXPLODE, &sp->x, &sp->y, &sp->z, v3df_none); + PlaySound(DIGI_BOLTEXPLODE, sp, v3df_none); explosion = SpawnSprite(STAT_MISSILE, TANK_SHELL_EXP, s_TankShellExp, sp->sectnum, sp->x, sp->y, sp->z, sp->ang, 0); @@ -11310,7 +11306,7 @@ SpawnNuclearExp(int16_t Weapon) if (u && TEST(u->Flags, SPR_SUICIDE)) return -1; - PlaySound(DIGI_NUCLEAREXP, &sp->x, &sp->y, &sp->z, v3df_dontpan | v3df_doppler); + PlaySound(DIGI_NUCLEAREXP, sp, v3df_dontpan | v3df_doppler); if (sp->owner) { @@ -11318,11 +11314,11 @@ SpawnNuclearExp(int16_t Weapon) rnd_rng = RANDOM_RANGE(1000); if (rnd_rng > 990) - PlayerSound(DIGI_LIKEHIROSHIMA,&pp->posx,&pp->posy,&pp->posz,v3df_follow|v3df_dontpan,pp); + PlayerSound(DIGI_LIKEHIROSHIMA, v3df_follow|v3df_dontpan,pp); else if (rnd_rng > 980) - PlayerSound(DIGI_LIKENAGASAKI,&pp->posx,&pp->posy,&pp->posz,v3df_follow|v3df_dontpan,pp); + PlayerSound(DIGI_LIKENAGASAKI, v3df_follow|v3df_dontpan,pp); else if (rnd_rng > 970) - PlayerSound(DIGI_LIKEPEARL,&pp->posx,&pp->posy,&pp->posz,v3df_follow|v3df_dontpan,pp); + PlayerSound(DIGI_LIKEPEARL, v3df_follow|v3df_dontpan,pp); } // Spawn big mushroom cloud @@ -11448,7 +11444,7 @@ SpawnMicroExp(int16_t Weapon) if (u && TEST(u->Flags, SPR_SUICIDE)) return -1; -// PlaySound(DIGI_MISSLEXP, &sp->x, &sp->y, &sp->z, v3df_none); +// PlaySound(DIGI_MISSLEXP, sp, v3df_none); explosion = SpawnSprite(STAT_MISSILE, MICRO_EXP, s_MicroExp, sp->sectnum, sp->x, sp->y, sp->z, sp->ang, 0); @@ -11668,14 +11664,14 @@ SpawnGrenadeExp(int16_t Weapon) if (u && TEST(u->Flags, SPR_SUICIDE)) return -1; - PlaySound(DIGI_30MMEXPLODE, &sp->x, &sp->y, &sp->z, v3df_none); + PlaySound(DIGI_30MMEXPLODE, sp, v3df_none); if (RANDOM_RANGE(1000) > 990) { if (sp->owner >= 0 && User[sp->owner] && User[sp->owner]->PlayerP) { PLAYERp pp = User[sp->owner]->PlayerP; - PlayerSound(DIGI_LIKEFIREWORKS,&pp->posx,&pp->posy,&pp->posz,v3df_follow|v3df_dontpan,pp); + PlayerSound(DIGI_LIKEFIREWORKS, v3df_follow|v3df_dontpan,pp); } } @@ -11793,7 +11789,7 @@ SpawnMineExp(int16_t Weapon) change_sprite_stat(Weapon, STAT_MISSILE); - PlaySound(DIGI_MINEBLOW, &sp->x, &sp->y, &sp->z, v3df_none); + PlaySound(DIGI_MINEBLOW, sp, v3df_none); explosion = SpawnSprite(STAT_MISSILE, MINE_EXP, s_MineExp, sp->sectnum, sp->x, sp->y, sp->z, sp->ang, 0); @@ -11919,7 +11915,7 @@ SpawnSectorExp(int16_t Weapon) if (TEST(u->Flags, SPR_SUICIDE)) return -1; - PlaySound(DIGI_30MMEXPLODE, &sp->x, &sp->y, &sp->z, v3df_none); + PlaySound(DIGI_30MMEXPLODE, sp, v3df_none); explosion = SpawnSprite(STAT_MISSILE, GRENADE_EXP, s_SectorExp, sp->sectnum, sp->x, sp->y, sp->z, sp->ang, 0); @@ -11951,7 +11947,7 @@ SpawnLargeExp(int16_t Weapon) USERp eu; short explosion; - PlaySound(DIGI_30MMEXPLODE, &sp->x, &sp->y, &sp->z, v3df_none); + PlaySound(DIGI_30MMEXPLODE, sp, v3df_none); explosion = SpawnSprite(STAT_MISSILE, GRENADE_EXP, s_SectorExp, sp->sectnum, sp->x, sp->y, sp->z, sp->ang, 0); @@ -11997,7 +11993,7 @@ SpawnMeteorExp(int16_t Weapon) } else { - PlaySound(DIGI_MEDIUMEXP, &sp->x, &sp->y, &sp->z, v3df_none); + PlaySound(DIGI_MEDIUMEXP, sp, v3df_none); explosion = SpawnSprite(STAT_MISSILE, METEOR_EXP, s_MeteorExp, sp->sectnum, sp->x, sp->y, sp->z, sp->ang, 0); } @@ -12036,7 +12032,7 @@ SpawnLittleExp(int16_t Weapon) USERp eu; short explosion; - PlaySound(DIGI_HEADSHOTHIT, &sp->x, &sp->y, &sp->z, v3df_none); + PlaySound(DIGI_HEADSHOTHIT, sp, v3df_none); explosion = SpawnSprite(STAT_MISSILE, BOLT_EXP, s_SectorExp, sp->sectnum, sp->x, sp->y, sp->z, sp->ang, 0); exp = &sprite[explosion]; @@ -12335,7 +12331,7 @@ DoNapalm(int16_t Weapon) { USERp eu; - PlaySound(DIGI_NAPPUFF, &sp->x, &sp->y, &sp->z, v3df_none); + PlaySound(DIGI_NAPPUFF, sp, v3df_none); explosion = SpawnSprite(STAT_MISSILE, NAP_EXP, s_NapExp, sp->sectnum, sp->x, sp->y, sp->z, sp->ang, 0); @@ -13026,7 +13022,7 @@ InitSpellRing(PLAYERp pp) ang_start = NORM_ANGLE(pp->pang - DIV2(2048)); if (!SW_SHAREWARE) - PlaySound(DIGI_RFWIZ, &pp->posx, &pp->posy, &pp->posz, v3df_none); + PlaySound(DIGI_RFWIZ, pp, v3df_none); if (pp->cursectnum < 0) return; @@ -13209,7 +13205,7 @@ InitLavaThrow(short SpriteNum) int nx, ny, nz, dist, nang; short w; - //PlaySound(DIGI_NINJAROCKETATTACK, &sp->x, &sp->y, &sp->z, v3df_none); + //PlaySound(DIGI_NINJAROCKETATTACK, sp, v3df_none); // get angle to player and also face player when attacking sp->ang = nang = getangle(u->tgt_sp->x - sp->x, u->tgt_sp->y - sp->y); @@ -13350,7 +13346,7 @@ InitSerpRing(short SpriteNum) ang_start = NORM_ANGLE(sp->ang - DIV2(2048)); if (!SW_SHAREWARE) - PlaySound(DIGI_RFWIZ, &sp->x, &sp->y, &sp->z, v3df_none); + PlaySound(DIGI_RFWIZ, sp, v3df_none); for (missiles = 0, ang = ang_start; missiles < max_missiles; ang += ang_diff, missiles++) { @@ -13414,7 +13410,7 @@ InitSerpRing(short SpriteNum) ang_start = NORM_ANGLE(sp->ang - DIV2(2048)); - PlaySound(DIGI_SERPSUMMONHEADS, &sp->x, &sp->y, &sp->z, v3df_none); + PlaySound(DIGI_SERPSUMMONHEADS, sp, v3df_none); for (missiles = 0, ang = ang_start; missiles < max_missiles; ang += ang_diff, missiles++) { @@ -13485,7 +13481,7 @@ InitSerpRing2(short SpriteNum) static int zpos[NUM_SERP_RING] = {Z(25), Z(130)}; - PlaySound(DIGI_SERPSUMMONHEADS, &sp->x, &sp->y, &sp->z, v3df_none); + PlaySound(DIGI_SERPSUMMONHEADS, sp, v3df_none); for (i = 0; i < NUM_SERP_RING; i++) { @@ -13577,7 +13573,7 @@ InitSpellNapalm(PLAYERp pp) else PlayerUpdateAmmo(pp, WPN_HOTHEAD, -ammo); - PlaySound(DIGI_NAPFIRE, &pp->posx, &pp->posy, &pp->posz, v3df_none); + PlaySound(DIGI_NAPFIRE, pp, v3df_none); if (pp->cursectnum < 0) return; @@ -13594,7 +13590,7 @@ InitSpellNapalm(PLAYERp pp) if (i==0) // Only attach sound to first projectile { - PlaySound(DIGI_NAPWIZ, &sp->x, &sp->y, &sp->z, v3df_follow); + PlaySound(DIGI_NAPWIZ, sp, v3df_follow); Set3DSoundOwner(SpriteNum); } @@ -13667,7 +13663,7 @@ InitEnemyNapalm(short SpriteNum) {600 * 6, 400, -512}, }; - PlaySound(DIGI_NAPFIRE, &sp->x, &sp->y, &sp->z, v3df_none); + PlaySound(DIGI_NAPFIRE, sp, v3df_none); for (i = 0; i < SIZ(mp); i++) { @@ -13680,7 +13676,7 @@ InitEnemyNapalm(short SpriteNum) wp->hitag = LUMINOUS; //Always full brightness if (i==0) // Only attach sound to first projectile { - PlaySound(DIGI_NAPWIZ, &wp->x, &wp->y, &wp->z, v3df_follow); + PlaySound(DIGI_NAPWIZ, wp, v3df_follow); Set3DSoundOwner(w); } @@ -13740,7 +13736,7 @@ InitSpellMirv(PLAYERp pp) short i; short oclipdist; - PlaySound(DIGI_MIRVFIRE, &pp->posx, &pp->posy, &pp->posz, v3df_none); + PlaySound(DIGI_MIRVFIRE, pp, v3df_none); if (pp->cursectnum < 0) return 0; @@ -13751,7 +13747,7 @@ InitSpellMirv(PLAYERp pp) sp = &sprite[SpriteNum]; u = User[SpriteNum]; - PlaySound(DIGI_MIRVWIZ, &sp->x, &sp->y, &sp->z, v3df_follow); + PlaySound(DIGI_MIRVWIZ, sp, v3df_follow); Set3DSoundOwner(SpriteNum); //sp->owner = pp->SpriteP - sprite; @@ -13792,7 +13788,7 @@ InitEnemyMirv(short SpriteNum) short oclipdist; int dist; - PlaySound(DIGI_MIRVFIRE, &sp->x, &sp->y, &sp->z, v3df_none); + PlaySound(DIGI_MIRVFIRE, sp, v3df_none); w = SpawnSprite(STAT_MISSILE, MIRV_METEOR, s_Mirv, sp->sectnum, sp->x, sp->y, SPRITEp_TOS(sp) + DIV4(SPRITEp_SIZE_Z(sp)), sp->ang, MIRV_VELOCITY); @@ -13800,7 +13796,7 @@ InitEnemyMirv(short SpriteNum) wp = &sprite[w]; wu = User[w]; - PlaySound(DIGI_MIRVWIZ, &wp->x, &wp->y, &wp->z, v3df_follow); + PlaySound(DIGI_MIRVWIZ, wp, v3df_follow); Set3DSoundOwner(w); SetOwner(SpriteNum, w); @@ -13841,7 +13837,7 @@ InitSwordAttack(PLAYERp pp) int dist; short reach,face; - PlaySound(DIGI_SWORDSWOOSH, &pp->posx, &pp->posy, &pp->posz, v3df_dontpan|v3df_doppler); + PlaySound(DIGI_SWORDSWOOSH, pp, v3df_dontpan|v3df_doppler); if (TEST(pp->Flags, PF_DIVING)) { @@ -13940,7 +13936,7 @@ InitSwordAttack(PLAYERp pp) { case ZILLA_RUN_R0: SpawnSwordSparks(pp, hitinfo.sect, -1, hitinfo.pos.x, hitinfo.pos.y, hitinfo.pos.z, daang); - PlaySound(DIGI_SWORDCLANK, &hitinfo.pos.x, &hitinfo.pos.y, &hitinfo.pos.z, v3df_none); + PlaySound(DIGI_SWORDCLANK, &hitinfo.pos, v3df_none); break; case TRASHCAN: if (tu->WaitTics <= 0) @@ -13949,8 +13945,8 @@ InitSwordAttack(PLAYERp pp) ChangeState(hitinfo.sprite,s_TrashCanPain); } SpawnSwordSparks(pp, hitinfo.sect, -1, hitinfo.pos.x, hitinfo.pos.y, hitinfo.pos.z, daang); - PlaySound(DIGI_SWORDCLANK, &hitinfo.pos.x, &hitinfo.pos.y, &hitinfo.pos.z, v3df_none); - PlaySound(DIGI_TRASHLID, &sp->x, &sp->y, &sp->z, v3df_none); + PlaySound(DIGI_SWORDCLANK, &hitinfo.pos, v3df_none); + PlaySound(DIGI_TRASHLID, sp, v3df_none); break; case PACHINKO1: case PACHINKO2: @@ -13958,7 +13954,7 @@ InitSwordAttack(PLAYERp pp) case PACHINKO4: case 623: SpawnSwordSparks(pp, hitinfo.sect, -1, hitinfo.pos.x, hitinfo.pos.y, hitinfo.pos.z, daang); - PlaySound(DIGI_SWORDCLANK, &hitinfo.pos.x, &hitinfo.pos.y, &hitinfo.pos.z, v3df_none); + PlaySound(DIGI_SWORDCLANK, &hitinfo.pos, v3df_none); break; } @@ -14002,7 +13998,7 @@ InitSwordAttack(PLAYERp pp) else { SpawnSwordSparks(pp, hitinfo.sect, hitinfo.wall, hitinfo.pos.x, hitinfo.pos.y, hitinfo.pos.z, daang); - PlaySound(DIGI_SWORDCLANK, &hitinfo.pos.x, &hitinfo.pos.y, &hitinfo.pos.z, v3df_none); + PlaySound(DIGI_SWORDCLANK, &hitinfo.pos, v3df_none); } } } @@ -14021,7 +14017,7 @@ InitFistAttack(PLAYERp pp) int dist; short reach,face; - PlaySound(DIGI_STAR, &pp->posx, &pp->posy, &pp->posz, v3df_dontpan|v3df_doppler); + PlaySound(DIGI_STAR, pp, v3df_dontpan|v3df_doppler); if (TEST(pp->Flags, PF_DIVING)) { @@ -14132,7 +14128,7 @@ InitFistAttack(PLAYERp pp) { case ZILLA_RUN_R0: SpawnSwordSparks(pp, hitinfo.sect, -1, hitinfo.pos.x, hitinfo.pos.y, hitinfo.pos.z, daang); - PlaySound(DIGI_ARMORHIT, &hitinfo.pos.x, &hitinfo.pos.y, &hitinfo.pos.z, v3df_none); + PlaySound(DIGI_ARMORHIT, &hitinfo.pos, v3df_none); break; case TRASHCAN: if (tu->WaitTics <= 0) @@ -14141,8 +14137,8 @@ InitFistAttack(PLAYERp pp) ChangeState(hitinfo.sprite,s_TrashCanPain); } SpawnSwordSparks(pp, hitinfo.sect, -1, hitinfo.pos.x, hitinfo.pos.y, hitinfo.pos.z, daang); - PlaySound(DIGI_ARMORHIT, &hitinfo.pos.x, &hitinfo.pos.y, &hitinfo.pos.z, v3df_none); - PlaySound(DIGI_TRASHLID, &sp->x, &sp->y, &sp->z, v3df_none); + PlaySound(DIGI_ARMORHIT, &hitinfo.pos, v3df_none); + PlaySound(DIGI_TRASHLID, sp, v3df_none); break; case PACHINKO1: case PACHINKO2: @@ -14150,7 +14146,7 @@ InitFistAttack(PLAYERp pp) case PACHINKO4: case 623: SpawnSwordSparks(pp, hitinfo.sect, -1, hitinfo.pos.x, hitinfo.pos.y, hitinfo.pos.z, daang); - PlaySound(DIGI_ARMORHIT, &hitinfo.pos.x, &hitinfo.pos.y, &hitinfo.pos.z, v3df_none); + PlaySound(DIGI_ARMORHIT, &hitinfo.pos, v3df_none); break; } @@ -14177,7 +14173,7 @@ InitFistAttack(PLAYERp pp) case 5063: case 4947: SpawnSwordSparks(pp, hitinfo.sect, -1, hitinfo.pos.x, hitinfo.pos.y, hitinfo.pos.z, daang); - PlaySound(DIGI_ARMORHIT, &hitinfo.pos.x, &hitinfo.pos.y, &hitinfo.pos.z, v3df_none); + PlaySound(DIGI_ARMORHIT, &hitinfo.pos, v3df_none); if (RANDOM_RANGE(1000) > 700) PlayerUpdateHealth(pp,1); // Give some health SET(hsp->cstat, CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN); @@ -14207,7 +14203,7 @@ InitFistAttack(PLAYERp pp) else { SpawnSwordSparks(pp, hitinfo.sect, hitinfo.wall, hitinfo.pos.x, hitinfo.pos.y, hitinfo.pos.z, daang); - PlaySound(DIGI_ARMORHIT, &hitinfo.pos.x, &hitinfo.pos.y, &hitinfo.pos.z, v3df_none); + PlaySound(DIGI_ARMORHIT, &hitinfo.pos, v3df_none); if (PlayerTakeDamage(pp, -1)) { PlayerUpdateHealth(pp, -(RANDOM_RANGE(2<<8)>>8)); @@ -14242,7 +14238,7 @@ InitSumoNapalm(short SpriteNum) {0, 1100, 0}, }; - PlaySound(DIGI_NAPFIRE, &sp->x, &sp->y, &sp->z, v3df_none); + PlaySound(DIGI_NAPFIRE, sp, v3df_none); ang = sp->ang; for (j=0; j<4; j++) @@ -14258,7 +14254,7 @@ InitSumoNapalm(short SpriteNum) wp->hitag = LUMINOUS; //Always full brightness if (i==0) // Only attach sound to first projectile { - PlaySound(DIGI_NAPWIZ, &wp->x, &wp->y, &wp->z, v3df_follow); + PlaySound(DIGI_NAPWIZ, wp, v3df_follow); Set3DSoundOwner(w); } @@ -14321,7 +14317,7 @@ InitSumoSkull(short SpriteNum) extern ATTRIBUTE SkullAttrib; - PlaySound(DIGI_SERPSUMMONHEADS, &sp->x, &sp->y, &sp->z, v3df_none); + PlaySound(DIGI_SERPSUMMONHEADS, sp, v3df_none); New = SpawnSprite(STAT_ENEMY, SKULL_R0, &s_SkullWait[0][0], sp->sectnum, sp->x, sp->y, SPRITEp_MID(sp), sp->ang, 0); @@ -14375,7 +14371,7 @@ InitSumoStompAttack(short SpriteNum) short reach,face; - PlaySound(DIGI_30MMEXPLODE, &sp->x, &sp->y, &sp->z, v3df_dontpan|v3df_doppler); + PlaySound(DIGI_30MMEXPLODE, sp, v3df_dontpan|v3df_doppler); for (stat = 0; stat < SIZ(StatDamageList); stat++) { @@ -14427,7 +14423,7 @@ InitMiniSumoClap(short SpriteNum) { if (FAFcansee(u->tgt_sp->x,u->tgt_sp->y,SPRITEp_MID(u->tgt_sp),u->tgt_sp->sectnum,sp->x,sp->y,SPRITEp_MID(sp),sp->sectnum)) { - PlaySound(DIGI_CGTHIGHBONE,&sp->x,&sp->y,&sp->z,v3df_follow|v3df_dontpan); + PlaySound(DIGI_CGTHIGHBONE, sp, v3df_follow|v3df_dontpan); DoDamage(u->tgt_sp - sprite, SpriteNum); } } @@ -14436,7 +14432,7 @@ InitMiniSumoClap(short SpriteNum) { if (FAFcansee(u->tgt_sp->x,u->tgt_sp->y,SPRITEp_MID(u->tgt_sp),u->tgt_sp->sectnum,sp->x,sp->y,SPRITEp_MID(sp),sp->sectnum)) { - PlaySound(DIGI_30MMEXPLODE, &sp->x, &sp->y, &sp->z, v3df_none); + PlaySound(DIGI_30MMEXPLODE, sp, v3df_none); SpawnFireballFlames(SpriteNum, u->tgt_sp - sprite); } } @@ -14756,7 +14752,7 @@ InitStar(PLAYERp pp) PlayerUpdateAmmo(pp, u->WeaponNum, -3); - PlaySound(DIGI_STAR, &pp->posx, &pp->posy, &pp->posz, v3df_dontpan|v3df_doppler); + PlaySound(DIGI_STAR, pp, v3df_dontpan|v3df_doppler); if (pp->cursectnum < 0) return 0; @@ -15107,7 +15103,7 @@ InitShotgun(PLAYERp pp) PlayerUpdateAmmo(pp, u->WeaponNum, -1); - PlaySound(DIGI_RIOTFIRE2, &pp->posx, &pp->posy, &pp->posz, v3df_dontpan|v3df_doppler); + PlaySound(DIGI_RIOTFIRE2, pp, v3df_dontpan|v3df_doppler); // Make sprite shade brighter u->Vis = 128; @@ -15230,7 +15226,7 @@ InitShotgun(PLAYERp pp) { extern STATE s_TrashCanPain[]; - PlaySound(DIGI_TRASHLID, &sp->x, &sp->y, &sp->z, v3df_none); + PlaySound(DIGI_TRASHLID, sp, v3df_none); if (hu->WaitTics <= 0) { hu->WaitTics = SEC(2); @@ -15282,7 +15278,7 @@ InitLaser(PLAYERp pp) PlayerUpdateAmmo(pp, u->WeaponNum, -1); - PlaySound(DIGI_RIOTFIRE, &pp->posx, &pp->posy, &pp->posz, v3df_dontpan|v3df_doppler); + PlaySound(DIGI_RIOTFIRE, pp, v3df_dontpan|v3df_doppler); if (pp->cursectnum < 0) return 0; @@ -15391,7 +15387,7 @@ InitRail(PLAYERp pp) PlayerUpdateAmmo(pp, u->WeaponNum, -1); - PlaySound(DIGI_RAILFIRE, &pp->posx, &pp->posy, &pp->posz, v3df_dontpan|v3df_doppler); + PlaySound(DIGI_RAILFIRE, pp, v3df_dontpan|v3df_doppler); // Make sprite shade brighter u->Vis = 128; @@ -15480,7 +15476,7 @@ InitZillaRail(short SpriteNum) if (SW_SHAREWARE) return FALSE; // JBF: verify - PlaySound(DIGI_RAILFIRE, &sp->x, &sp->y, &sp->z, v3df_dontpan|v3df_doppler); + PlaySound(DIGI_RAILFIRE, sp, v3df_dontpan|v3df_doppler); // Make sprite shade brighter u->Vis = 128; @@ -15590,7 +15586,7 @@ InitRocket(PLAYERp pp) } } - PlaySound(DIGI_RIOTFIRE, &pp->posx, &pp->posy, &pp->posz, v3df_dontpan|v3df_doppler); + PlaySound(DIGI_RIOTFIRE, pp, v3df_dontpan|v3df_doppler); // Make sprite shade brighter u->Vis = 128; @@ -15714,7 +15710,7 @@ InitBunnyRocket(PLAYERp pp) PlayerUpdateAmmo(pp, u->WeaponNum, -1); - PlaySound(DIGI_BUNNYATTACK, &pp->posx, &pp->posy, &pp->posz, v3df_dontpan|v3df_doppler); + PlaySound(DIGI_BUNNYATTACK, pp, v3df_dontpan|v3df_doppler); if (pp->cursectnum < 0) return 0; @@ -15825,7 +15821,7 @@ InitNuke(PLAYERp pp) DoPlayerBeginRecoil(pp, ROCKET_RECOIL_AMT*12); - PlaySound(DIGI_RIOTFIRE, &pp->posx, &pp->posy, &pp->posz, v3df_dontpan|v3df_doppler); + PlaySound(DIGI_RIOTFIRE, pp, v3df_dontpan|v3df_doppler); // Make sprite shade brighter u->Vis = 128; @@ -15923,7 +15919,7 @@ InitEnemyNuke(short SpriteNum) int zvel; - PlaySound(DIGI_RIOTFIRE, &sp->x, &sp->y, &sp->z, v3df_dontpan|v3df_doppler); + PlaySound(DIGI_RIOTFIRE, sp, v3df_dontpan|v3df_doppler); // Make sprite shade brighter u->Vis = 128; @@ -16144,7 +16140,7 @@ InitRipperSlash(short SpriteNum) unsigned stat; int dist, a, b, c; - PlaySound(DIGI_RIPPER2ATTACK, &sp->x, &sp->y, &sp->z, v3df_none); + PlaySound(DIGI_RIPPER2ATTACK, sp, v3df_none); for (stat = 0; stat < SIZ(StatDamageList); stat++) { @@ -16163,7 +16159,7 @@ InitRipperSlash(short SpriteNum) if (dist < CLOSE_RANGE_DIST_FUDGE(sp, hp, 600) && FACING_RANGE(hp, sp, 150)) { -// PlaySound(PlayerPainVocs[RANDOM_RANGE(MAX_PAIN)], &sp->x, &sp->y, &sp->z, v3df_none); +// PlaySound(PlayerPainVocs[RANDOM_RANGE(MAX_PAIN)], sp, v3df_none); DoDamage(i, SpriteNum); } } @@ -16182,7 +16178,7 @@ InitBunnySlash(short SpriteNum) unsigned stat; int dist, a, b, c; - PlaySound(DIGI_BUNNYATTACK, &sp->x, &sp->y, &sp->z, v3df_none); + PlaySound(DIGI_BUNNYATTACK, sp, v3df_none); for (stat = 0; stat < SIZ(StatDamageList); stat++) { @@ -16217,7 +16213,7 @@ InitSerpSlash(short SpriteNum) unsigned stat; int dist, a, b, c; - PlaySound(DIGI_SERPSWORDATTACK, &sp->x, &sp->y, &sp->z, v3df_none); + PlaySound(DIGI_SERPSWORDATTACK, sp, v3df_none); for (stat = 0; stat < SIZ(StatDamageList); stat++) { @@ -16233,7 +16229,7 @@ InitSerpSlash(short SpriteNum) if (dist < CLOSE_RANGE_DIST_FUDGE(sp, hp, 800) && FACING_RANGE(hp, sp, 150)) { -// PlaySound(PlayerPainVocs[RANDOM_RANGE(MAX_PAIN)], &sp->x, &sp->y, &sp->z, v3df_none); +// PlaySound(PlayerPainVocs[RANDOM_RANGE(MAX_PAIN)], sp, v3df_none); DoDamage(i, SpriteNum); } } @@ -16313,7 +16309,7 @@ DoBladeDamage(short SpriteNum) if (WallSpriteInsideSprite(sp, hp)) { DoDamage(i, SpriteNum); -// PlaySound(PlayerPainVocs[RANDOM_RANGE(MAX_PAIN)], &sp->x, &sp->y, &sp->z, v3df_none); +// PlaySound(PlayerPainVocs[RANDOM_RANGE(MAX_PAIN)], sp, v3df_none); } } } @@ -16376,7 +16372,7 @@ InitCoolgBash(short SpriteNum) unsigned stat; int dist, a, b, c; - PlaySound(DIGI_CGTHIGHBONE, &sp->x, &sp->y, &sp->z, v3df_none); + PlaySound(DIGI_CGTHIGHBONE, sp, v3df_none); for (stat = 0; stat < SIZ(StatDamageList); stat++) { @@ -16395,7 +16391,7 @@ InitCoolgBash(short SpriteNum) if (dist < CLOSE_RANGE_DIST_FUDGE(sp, hp, 600) && FACING_RANGE(hp, sp, 150)) { -// PlaySound(PlayerPainVocs[RANDOM_RANGE(MAX_PAIN)], &sp->x, &sp->y, &sp->z, v3df_none); +// PlaySound(PlayerPainVocs[RANDOM_RANGE(MAX_PAIN)], sp, v3df_none); DoDamage(i, SpriteNum); } } @@ -16414,7 +16410,7 @@ InitSkelSlash(short SpriteNum) unsigned stat; int dist, a, b, c; - PlaySound(DIGI_SPBLADE, &sp->x, &sp->y, &sp->z, v3df_none); + PlaySound(DIGI_SPBLADE, sp, v3df_none); for (stat = 0; stat < SIZ(StatDamageList); stat++) { @@ -16429,7 +16425,7 @@ InitSkelSlash(short SpriteNum) if (dist < CLOSE_RANGE_DIST_FUDGE(sp, hp, 600) && FACING_RANGE(hp, sp, 150)) { -// PlaySound(PlayerPainVocs[RANDOM_RANGE(MAX_PAIN)], &sp->x, &sp->y, &sp->z, v3df_none); +// PlaySound(PlayerPainVocs[RANDOM_RANGE(MAX_PAIN)], sp, v3df_none); DoDamage(i, SpriteNum); } } @@ -16448,7 +16444,7 @@ InitGoroChop(short SpriteNum) unsigned stat; int dist, a, b, c; - PlaySound(DIGI_GRDSWINGAXE, &sp->x, &sp->y, &sp->z, v3df_none); + PlaySound(DIGI_GRDSWINGAXE, sp, v3df_none); for (stat = 0; stat < SIZ(StatDamageList); stat++) { @@ -16463,7 +16459,7 @@ InitGoroChop(short SpriteNum) if (dist < CLOSE_RANGE_DIST_FUDGE(sp, hp, 700) && FACING_RANGE(hp, sp, 150)) { - PlaySound(DIGI_GRDAXEHIT, &sp->x, &sp->y, &sp->z, v3df_none); + PlaySound(DIGI_GRDAXEHIT, sp, v3df_none); DoDamage(i, SpriteNum); } } @@ -16523,7 +16519,7 @@ InitSerpSpell(short SpriteNum) //np->owner = SpriteNum; SetOwner(SpriteNum, New); np->shade = -40; - PlaySound(DIGI_SERPMAGICLAUNCH, &sp->x, &sp->y, &sp->z, v3df_none); + PlaySound(DIGI_SERPMAGICLAUNCH, sp, v3df_none); nu->spal = np->pal = 27; // Bright Green np->xrepeat = 64; np->yrepeat = 64; @@ -16576,7 +16572,7 @@ SpawnDemonFist(int16_t Weapon) if (TEST(u->Flags, SPR_SUICIDE)) return -1; - //PlaySound(DIGI_ITEM_SPAWN, &sp->x, &sp->y, &sp->z, v3df_none); + //PlaySound(DIGI_ITEM_SPAWN, sp, v3df_none); explosion = SpawnSprite(STAT_MISSILE, 0, s_TeleportEffect, sp->sectnum, sp->x, sp->y, SPRITEp_MID(sp), sp->ang, 0); @@ -16621,7 +16617,7 @@ InitSerpMonstSpell(short SpriteNum) -10, 10 }; - PlaySound(DIGI_MISSLFIRE, &sp->x, &sp->y, &sp->z, v3df_none); + PlaySound(DIGI_MISSLFIRE, sp, v3df_none); for (i = 0; i < 1; i++) { @@ -16689,7 +16685,7 @@ DoTeleRipper(short SpriteNum) USERp u = User[SpriteNum]; extern void Ripper2Hatch(short Weapon); - PlaySound(DIGI_ITEM_SPAWN,&sp->x,&sp->y,&sp->z,v3df_none); + PlaySound(DIGI_ITEM_SPAWN, sp, v3df_none); Ripper2Hatch(SpriteNum); return 0; @@ -16705,7 +16701,7 @@ InitEnemyRocket(short SpriteNum) short w; - PlaySound(DIGI_NINJARIOTATTACK, &sp->x, &sp->y, &sp->z, v3df_none); + PlaySound(DIGI_NINJARIOTATTACK, sp, v3df_none); // get angle to player and also face player when attacking sp->ang = nang = getangle(u->tgt_sp->x - sp->x, u->tgt_sp->y - sp->y); @@ -16792,7 +16788,7 @@ InitEnemyRail(short SpriteNum) } } - PlaySound(DIGI_RAILFIRE, &sp->x, &sp->y, &sp->z, v3df_dontpan|v3df_doppler); + PlaySound(DIGI_RAILFIRE, sp, v3df_dontpan|v3df_doppler); // get angle to player and also face player when attacking sp->ang = nang = getangle(u->tgt_sp->x - sp->x, u->tgt_sp->y - sp->y); @@ -16881,7 +16877,7 @@ InitZillaRocket(short SpriteNum) {1100 * 6, 400, -512}, }; - PlaySound(DIGI_NINJARIOTATTACK, &sp->x, &sp->y, &sp->z, v3df_none); + PlaySound(DIGI_NINJARIOTATTACK, sp, v3df_none); // get angle to player and also face player when attacking sp->ang = nang = getangle(u->tgt_sp->x - sp->x, u->tgt_sp->y - sp->y); @@ -17000,7 +16996,7 @@ InitEnemyStar(short SpriteNum) USERp nu; short sn; - PlaySound(DIGI_STAR, &sp->x, &sp->y, &sp->z, v3df_none); + PlaySound(DIGI_STAR, sp, v3df_none); for (i = 0; i < SIZ(dang); i++) { sn = SpawnSprite(STAT_MISSILE, STAR1, s_Star, sp->sectnum, wp->x, wp->y, wp->z, NORM_ANGLE(wp->ang + dang[i]), wp->xvel); @@ -17027,7 +17023,7 @@ InitEnemyStar(short SpriteNum) else #endif - PlaySound(DIGI_STAR, &sp->x, &sp->y, &sp->z, v3df_none); + PlaySound(DIGI_STAR, sp, v3df_none); @@ -17094,7 +17090,7 @@ InitEnemyCrossbow(short SpriteNum) USERp nu; short sn; - PlaySound(DIGI_STAR, &sp->x, &sp->y, &sp->z, v3df_none); + PlaySound(DIGI_STAR, sp, v3df_none); for (i = 0; i < SIZ(dang); i++) { sn = SpawnSprite(STAT_MISSILE, CROSSBOLT, s_CrossBolt, sp->sectnum, wp->x, wp->y, wp->z, NORM_ANGLE(wp->ang + dang[i]), wp->xvel); @@ -17121,7 +17117,7 @@ InitEnemyCrossbow(short SpriteNum) else #endif - PlaySound(DIGI_STAR, &sp->x, &sp->y, &sp->z, v3df_none); + PlaySound(DIGI_STAR, sp, v3df_none); @@ -17137,7 +17133,7 @@ InitSkelSpell(short SpriteNum) int nx, ny, nz, dist, nang; short w; - PlaySound(DIGI_SPELEC, &sp->x, &sp->y, &sp->z, v3df_none); + PlaySound(DIGI_SPELEC, sp, v3df_none); // get angle to player and also face player when attacking sp->ang = nang = NORM_ANGLE(getangle(u->tgt_sp->x - sp->x, u->tgt_sp->y - sp->y)); @@ -17197,7 +17193,7 @@ InitCoolgFire(short SpriteNum) // Spawn a shot // Inserting and setting up variables - PlaySound(DIGI_CGMAGIC, &sp->x, &sp->y, &sp->z, v3df_follow); + PlaySound(DIGI_CGMAGIC, sp, v3df_follow); w = SpawnSprite(STAT_MISSILE, COOLG_FIRE, s_CoolgFire, sp->sectnum, nx, ny, nz, u->tgt_sp->ang, COOLG_FIRE_VELOCITY); @@ -17221,7 +17217,7 @@ InitCoolgFire(short SpriteNum) else wu->spal = wp->pal = 25; // Bright Red - PlaySound(DIGI_MAGIC1, &wp->x, &wp->y, &wp->z, v3df_follow|v3df_doppler); + PlaySound(DIGI_MAGIC1, wp, v3df_follow|v3df_doppler); // find the distance to the target (player) dist = Distance(nx, ny, u->tgt_sp->x, u->tgt_sp->y); @@ -17257,7 +17253,7 @@ int DoCoolgDrip(short SpriteNum) sp->yrepeat = sp->xrepeat = 32; ChangeState(SpriteNum, s_GoreFloorSplash); if (u->spal == PALETTE_BLUE_LIGHTING) - PlaySound(DIGI_DRIP, &sp->x, &sp->y, &sp->z, v3df_none); + PlaySound(DIGI_DRIP, sp, v3df_none); } return 0; } @@ -17373,7 +17369,7 @@ InitEelFire(short SpriteNum) if (dist < CLOSE_RANGE_DIST_FUDGE(sp, hp, 600) && FACING_RANGE(hp, sp, 150)) { - PlaySound(DIGI_GIBS1, &sp->x, &sp->y, &sp->z, v3df_none); + PlaySound(DIGI_GIBS1, sp, v3df_none); DoDamage(i, SpriteNum); } else @@ -17392,7 +17388,7 @@ InitFireballTrap(short SpriteNum) int nx, ny, nz, dist; short w; - PlaySound(DIGI_FIREBALL1, &sp->x, &sp->y, &sp->z, v3df_none); + PlaySound(DIGI_FIREBALL1, sp, v3df_none); nx = sp->x; ny = sp->y; @@ -17430,7 +17426,7 @@ InitBoltTrap(short SpriteNum) int nx, ny, nz, dist; short w; - PlaySound(DIGI_RIOTFIRE, &sp->x, &sp->y, &sp->z, v3df_none); + PlaySound(DIGI_RIOTFIRE, sp, v3df_none); nx = sp->x; ny = sp->y; @@ -17509,7 +17505,7 @@ InitEnemyCrossbow(short SpriteNum) if (dist != 0) wu->zchange = wp->zvel = (wp->xvel * (SPRITEp_UPPER(u->tgt_sp) - wp->z)) / dist; - PlaySound(DIGI_STAR, &sp->x, &sp->y, &sp->z, v3df_none); + PlaySound(DIGI_STAR, sp, v3df_none); return w; } @@ -17560,7 +17556,7 @@ InitSpearTrap(short SpriteNum) //if (dist != 0) //wu->zchange = wp->zvel = (wp->xvel * (SPRITEp_UPPER(u->tgt_sp) - wp->z)) / dist; - PlaySound(DIGI_STAR, &sp->x, &sp->y, &sp->z, v3df_none); + PlaySound(DIGI_STAR, sp, v3df_none); return w; } @@ -17978,7 +17974,7 @@ InitUzi(PLAYERp pp) } if (FireSnd) - PlaySound(DIGI_UZIFIRE, &pp->posx, &pp->posy, &pp->posz, v3df_dontpan|v3df_doppler); + PlaySound(DIGI_UZIFIRE, pp, v3df_dontpan|v3df_doppler); // Make sprite shade brighter u->Vis = 128; @@ -18087,7 +18083,7 @@ InitUzi(PLAYERp pp) { extern STATE s_TrashCanPain[]; - PlaySound(DIGI_TRASHLID, &hsp->x, &hsp->y, &hsp->z, v3df_none); + PlaySound(DIGI_TRASHLID, hsp, v3df_none); if (hu->WaitTics <= 0) { hu->WaitTics = SEC(2); @@ -18145,10 +18141,10 @@ InitUzi(PLAYERp pp) if (RANDOM_P2(1024) < 100) { - PlaySound(DIGI_RICHOCHET1,&wp->x, &wp->y, &wp->z, v3df_none); + PlaySound(DIGI_RICHOCHET1,wp, v3df_none); } else if (RANDOM_P2(1024) < 100) - PlaySound(DIGI_RICHOCHET2,&wp->x, &wp->y, &wp->z, v3df_none); + PlaySound(DIGI_RICHOCHET2,wp, v3df_none); return 0; } @@ -18172,7 +18168,7 @@ InitEMP(PLAYERp pp) PlayerUpdateAmmo(pp, u->WeaponNum, -1); - PlaySound(DIGI_RAILFIRE, &pp->posx, &pp->posy, &pp->posz, v3df_dontpan|v3df_doppler); + PlaySound(DIGI_RAILFIRE, pp, v3df_dontpan|v3df_doppler); InitTracerUzi(pp); @@ -18300,7 +18296,7 @@ InitEMP(PLAYERp pp) SetAttach(hitinfo.sprite, j); wu->sz = sprite[hitinfo.sprite].z - wp->z; if (RANDOM_RANGE(1000) > 500) - PlayerSound(DIGI_YOULOOKSTUPID,&pp->posx,&pp->posy,&pp->posz,v3df_follow|v3df_dontpan,pp); + PlayerSound(DIGI_YOULOOKSTUPID, v3df_follow|v3df_dontpan,pp); } else { @@ -18338,7 +18334,7 @@ InitTankShell(short SpriteNum, PLAYERp pp) short w; if (!SW_SHAREWARE) - PlaySound(DIGI_CANNON, &pp->posx, &pp->posy, &pp->posz, v3df_dontpan|v3df_doppler); + PlaySound(DIGI_CANNON, pp, v3df_dontpan|v3df_doppler); w = SpawnSprite(STAT_MISSILE, 0, s_TankShell, sp->sectnum, sp->x, sp->y, sp->z, sp->ang, TANK_SHELL_VELOCITY); @@ -18723,7 +18719,7 @@ InitSobjMachineGun(short SpriteNum, PLAYERp pp) //sound = (++sound)&1; //if (sound == 0) - PlaySound(DIGI_BOATFIRE, &pp->posx, &pp->posy, &pp->posz, v3df_dontpan|v3df_doppler); + PlaySound(DIGI_BOATFIRE, pp, v3df_dontpan|v3df_doppler); nx = sp->x; ny = sp->y; @@ -18970,7 +18966,7 @@ SpawnBoatSparks(PLAYERp pp, short hit_sect, short hit_wall, int hit_x, int hit_y HitscanSpriteAdjust(j, hit_wall); if (RANDOM_P2(1024) < 100) - PlaySound(DIGI_RICHOCHET1,&wp->x, &wp->y, &wp->z, v3df_none); + PlaySound(DIGI_RICHOCHET1,wp, v3df_none); return j; } @@ -19055,7 +19051,7 @@ SpawnTurretSparks(SPRITEp sp, short hit_sect, short hit_wall, int hit_x, int hit HitscanSpriteAdjust(j, hit_wall); if (RANDOM_P2(1024) < 100) - PlaySound(DIGI_RICHOCHET1, &wp->x, &wp->y, &wp->z, v3df_none); + PlaySound(DIGI_RICHOCHET1, wp, v3df_none); return j; } @@ -19117,7 +19113,7 @@ InitTurretMgun(SECTOR_OBJECTp sop) SPRITEp sp,ep; int xvect,yvect,zvect; - PlaySound(DIGI_BOATFIRE, &sop->xmid, &sop->ymid, &sop->zmid, v3df_dontpan|v3df_doppler); + PlaySound(DIGI_BOATFIRE, (vec3_t*)sop, v3df_dontpan|v3df_doppler); for (i = 0; sop->sp_num[i] != -1; i++) { @@ -19342,9 +19338,9 @@ InitEnemyUzi(short SpriteNum) { if (sp->pal == PALETTE_PLAYER3 || sp->pal == PALETTE_PLAYER5 || sp->pal == PAL_XLAT_LT_GREY || sp->pal == PAL_XLAT_LT_TAN) - PlaySound(DIGI_M60, &sp->x, &sp->y, &sp->z, v3df_none); + PlaySound(DIGI_M60, sp, v3df_none); else - PlaySound(DIGI_NINJAUZIATTACK, &sp->x, &sp->y, &sp->z, v3df_none); + PlaySound(DIGI_NINJAUZIATTACK, sp, v3df_none); } if (hitinfo.wall >= 0) @@ -19420,10 +19416,10 @@ InitEnemyUzi(short SpriteNum) if (RANDOM_P2(1024) < 100) { - PlaySound(DIGI_RICHOCHET1,&wp->x, &wp->y, &wp->z, v3df_none); + PlaySound(DIGI_RICHOCHET1,wp, v3df_none); } else if (RANDOM_P2(1024) < 100) - PlaySound(DIGI_RICHOCHET2,&wp->x, &wp->y, &wp->z, v3df_none); + PlaySound(DIGI_RICHOCHET2,wp, v3df_none); return 0; } @@ -19446,7 +19442,7 @@ InitGrenade(PLAYERp pp) PlayerUpdateAmmo(pp, u->WeaponNum, -1); - PlaySound(DIGI_30MMFIRE, &pp->posx, &pp->posy, &pp->posz, v3df_dontpan|v3df_doppler); + PlaySound(DIGI_30MMFIRE, pp, v3df_dontpan|v3df_doppler); // Make sprite shade brighter u->Vis = 128; @@ -19552,7 +19548,7 @@ InitSpriteGrenade(short SpriteNum) int dist; - PlaySound(DIGI_30MMFIRE, &sp->x, &sp->y, &sp->z, v3df_dontpan|v3df_doppler); + PlaySound(DIGI_30MMFIRE, sp, v3df_dontpan|v3df_doppler); nx = sp->x; ny = sp->y; @@ -19620,7 +19616,7 @@ InitMine(PLAYERp pp) PlayerUpdateAmmo(pp, u->WeaponNum, -1); - PlaySound(DIGI_MINETHROW, &pp->posx, &pp->posy, &pp->posz, v3df_dontpan|v3df_doppler); + PlaySound(DIGI_MINETHROW, pp, v3df_dontpan|v3df_doppler); if (pp->cursectnum < 0) return 0; @@ -19692,7 +19688,7 @@ InitEnemyMine(short SpriteNum) int tvel; - PlaySound(DIGI_MINETHROW, &sp->x, &sp->y, &sp->z, v3df_dontpan|v3df_doppler); + PlaySound(DIGI_MINETHROW, sp, v3df_dontpan|v3df_doppler); nx = sp->x; ny = sp->y; @@ -19800,7 +19796,7 @@ InitFireball(PLAYERp pp) PlayerUpdateAmmo(pp, WPN_HOTHEAD, -1); - PlaySound(DIGI_HEADFIRE, &pp->posx, &pp->posy, &pp->posz, v3df_none); + PlaySound(DIGI_HEADFIRE, pp, v3df_none); // Make sprite shade brighter u->Vis = 128; @@ -19891,7 +19887,7 @@ InitEnemyFireball(short SpriteNum) tsp = u->tgt_sp; - PlaySound(DIGI_FIREBALL1, &sp->x, &sp->y, &sp->z, v3df_none); + PlaySound(DIGI_FIREBALL1, sp, v3df_none); // get angle to player and also face player when attacking sp->ang = NORM_ANGLE(getangle(tsp->x - sp->x, tsp->y - sp->y)); @@ -20290,7 +20286,7 @@ SpawnSplash(short SpriteNum) if (sectu && TEST(sectp->floorstat, FLOOR_STAT_PLAX)) return 0; - PlaySound(DIGI_SPLASH1, &sp->x, &sp->y, &sp->z, v3df_none); + PlaySound(DIGI_SPLASH1, sp, v3df_none); DoActorZrange(SpriteNum); MissileWaterAdjust(SpriteNum); @@ -20423,7 +20419,7 @@ MissileHitDiveArea(short SpriteNum) SpriteWarpToUnderwater(sp); //SpawnUnderSplash(sp - sprite); u->ret = 0; - PlaySound(DIGI_PROJECTILEWATERHIT, &sp->x, &sp->y, &sp->z, v3df_none); + PlaySound(DIGI_PROJECTILEWATERHIT, sp, v3df_none); return TRUE; } else if (SpriteInUnderwaterArea(sp)) @@ -20463,7 +20459,7 @@ SpawnBubble(short SpriteNum) bp = &sprite[b]; bu = User[b]; - //PlaySound(DIGI_BUBBLES, &sp->x, &sp->y, &sp->z, v3df_none); + //PlaySound(DIGI_BUBBLES, sp, v3df_none); bp->xrepeat = 8 + (RANDOM_P2(8 << 8) >> 8); bp->yrepeat = bp->xrepeat; @@ -21427,7 +21423,7 @@ DoShrapVelocity(int16_t SpriteNum) short wall_ang, dang; short hit_sprite = -2; SPRITEp hsp; -// PlaySound(DIGI_DHCLUNK, &sp->x, &sp->y, &sp->z, v3df_dontpan); +// PlaySound(DIGI_DHCLUNK, sp, v3df_dontpan); hit_sprite = NORM_SPRITE(u->ret); hsp = &sprite[hit_sprite]; @@ -21449,7 +21445,7 @@ DoShrapVelocity(int16_t SpriteNum) wph = &wall[hit_wall]; -// PlaySound(DIGI_DHCLUNK, &sp->x, &sp->y, &sp->z, v3df_dontpan); +// PlaySound(DIGI_DHCLUNK, sp, v3df_dontpan); nw = wall[hit_wall].point2; wall_ang = NORM_ANGLE(getangle(wall[nw].x - wph->x, wall[nw].y - wph->y)+512); @@ -21523,10 +21519,10 @@ DoShrapVelocity(int16_t SpriteNum) switch (u->ID) { case UZI_SHELL: - PlaySound(DIGI_SHELL, &sp->x, &sp->y, &sp->z, v3df_none); + PlaySound(DIGI_SHELL, sp, v3df_none); break; case SHOT_SHELL: - PlaySound(DIGI_SHOTSHELLSPENT, &sp->x, &sp->y, &sp->z, v3df_none); + PlaySound(DIGI_SHOTSHELLSPENT, sp, v3df_none); break; } } @@ -21623,9 +21619,9 @@ ShrapKillSprite(short SpriteNum) sp->clipdist = SPRITEp_SIZE_X(sp); SpawnFloorSplash(SpriteNum); if (RANDOM_RANGE(1000) < 500) - PlaySound(DIGI_GIBS1,&sp->x,&sp->y,&sp->z,v3df_none); + PlaySound(DIGI_GIBS1, sp, v3df_none); else - PlaySound(DIGI_GIBS2,&sp->x,&sp->y,&sp->z,v3df_none); + PlaySound(DIGI_GIBS2, sp, v3df_none); if (rnd_num > 683) { QueueGeneric(SpriteNum,900); @@ -21645,9 +21641,9 @@ ShrapKillSprite(short SpriteNum) sp->clipdist = SPRITEp_SIZE_X(sp); SpawnFloorSplash(SpriteNum); if (RANDOM_RANGE(1000) < 500) - PlaySound(DIGI_GIBS1,&sp->x,&sp->y,&sp->z,v3df_none); + PlaySound(DIGI_GIBS1, sp, v3df_none); else - PlaySound(DIGI_GIBS2,&sp->x,&sp->y,&sp->z,v3df_none); + PlaySound(DIGI_GIBS2, sp, v3df_none); if (rnd_num > 683) { QueueGeneric(SpriteNum,915); diff --git a/source/sw/src/zilla.cpp b/source/sw/src/zilla.cpp index 6193c911b..5683532be 100644 --- a/source/sw/src/zilla.cpp +++ b/source/sw/src/zilla.cpp @@ -729,13 +729,13 @@ int DoZillaMove(short SpriteNum) { choose = STD_RANDOM_RANGE(1000); if (choose > 990) - handle = PlaySound(DIGI_Z16004,&sp->x,&sp->y,&sp->z,v3df_none); + handle = PlaySound(DIGI_Z16004, sp, v3df_none); else if (choose > 985) - handle = PlaySound(DIGI_Z16004,&sp->x,&sp->y,&sp->z,v3df_none); + handle = PlaySound(DIGI_Z16004, sp, v3df_none); else if (choose > 980) - handle = PlaySound(DIGI_Z16004,&sp->x,&sp->y,&sp->z,v3df_none); + handle = PlaySound(DIGI_Z16004, sp, v3df_none); else if (choose > 975) - handle = PlaySound(DIGI_Z16004,&sp->x,&sp->y,&sp->z,v3df_none); + handle = PlaySound(DIGI_Z16004, sp, v3df_none); } @@ -758,7 +758,7 @@ int DoZillaStomp(short SpriteNum) { SPRITEp sp = &sprite[SpriteNum]; - PlaySound(DIGI_ZILLASTOMP,&sp->x,&sp->y,&sp->z,v3df_follow); + PlaySound(DIGI_ZILLASTOMP, sp, v3df_follow); return 0; }