From a0cc798c9c4fda99e07e9bb649fbd26c0687da22 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 25 Jul 2020 09:32:54 +0200 Subject: [PATCH] - cleaned up the sound system interface to have consistent naming and no aliases. --- source/games/duke/src/2d_d.cpp | 4 +- source/games/duke/src/2d_r.cpp | 4 +- source/games/duke/src/actors.cpp | 52 ++-- source/games/duke/src/actors_d.cpp | 116 ++++---- source/games/duke/src/actors_lava.cpp | 8 +- source/games/duke/src/actors_r.cpp | 86 +++--- source/games/duke/src/gameexec.cpp | 26 +- source/games/duke/src/hudweapon_r.cpp | 2 +- source/games/duke/src/input.cpp | 36 +-- source/games/duke/src/player.cpp | 28 +- source/games/duke/src/player_d.cpp | 90 +++---- source/games/duke/src/player_r.cpp | 302 ++++++++++----------- source/games/duke/src/player_w.cpp | 32 +-- source/games/duke/src/sectors.cpp | 16 +- source/games/duke/src/sectors_d.cpp | 94 +++---- source/games/duke/src/sectors_r.cpp | 366 +++++++++++++------------- source/games/duke/src/sounds.cpp | 14 +- source/games/duke/src/sounds.h | 54 ++-- 18 files changed, 660 insertions(+), 670 deletions(-) diff --git a/source/games/duke/src/2d_d.cpp b/source/games/duke/src/2d_d.cpp index d4b27a2e5..a61fae369 100644 --- a/source/games/duke/src/2d_d.cpp +++ b/source/games/duke/src/2d_d.cpp @@ -671,7 +671,7 @@ public: DDukeMultiplayerBonusScreen(int pws) : DScreenJob(fadein|fadeout) { playerswhenstarted = pws; - PlayBonusMusic(); + S_PlayBonusMusic(); } int Frame(uint64_t clock, bool skiprequest) @@ -779,7 +779,7 @@ public: int vol = volfromlevelnum(currentLevel->levelNumber); gfx_offset = BONUSSCREEN + ((vol == 1) ? 5 : 0); lastmapname = currentLevel->DisplayName(); - PlayBonusMusic(); + S_PlayBonusMusic(); } void FormatTime(int time, char* tempbuf) diff --git a/source/games/duke/src/2d_r.cpp b/source/games/duke/src/2d_r.cpp index 228454b2b..132a743de 100644 --- a/source/games/duke/src/2d_r.cpp +++ b/source/games/duke/src/2d_r.cpp @@ -262,7 +262,7 @@ public: DRRMultiplayerBonusScreen(int pws) : DScreenJob(fadein | fadeout) { playerswhenstarted = pws; - PlayBonusMusic(); + S_PlayBonusMusic(); } int Frame(uint64_t clock, bool skiprequest) @@ -366,7 +366,7 @@ class DRRLevelSummaryScreen : public DScreenJob public: DRRLevelSummaryScreen(bool dofadeout = true) : DScreenJob(dofadeout? (fadein | fadeout) : fadein) { - PlayBonusMusic(); + S_PlayBonusMusic(); if (currentLevel->flags & MI_USERMAP) gfx_offset = RRTILE403; else if (!isRRRA()) diff --git a/source/games/duke/src/actors.cpp b/source/games/duke/src/actors.cpp index ea121b021..816d5e796 100644 --- a/source/games/duke/src/actors.cpp +++ b/source/games/duke/src/actors.cpp @@ -72,7 +72,7 @@ void RANDOMSCRAP(spritetype *s, int i) void deletesprite(int num) { if (sprite[num].picnum == MUSICANDSFX && hittype[num].temp_data[0] == 1) - S_StopEnvSound(sprite[num].lotag, num); + S_StopSound(sprite[num].lotag, num); ::deletesprite(num); } @@ -636,13 +636,13 @@ void movefx(void) if (x < ht && hittype[i].temp_data[0] == 0) { // Start playing an ambience sound. - A_PlaySound(s->lotag, i, CHAN_AUTO, CHANF_LOOP); + S_PlayActorSound(s->lotag, i, CHAN_AUTO, CHANF_LOOP); hittype[i].temp_data[0] = 1; // AMBIENT_SFX_PLAYING } else if (x >= ht && hittype[i].temp_data[0] == 1) { // Stop playing ambience sound because we're out of its range. - S_StopEnvSound(s->lotag, i); + S_StopSound(s->lotag, i); } } @@ -737,7 +737,7 @@ void movecrane(int i, int crane) if (s->owner == -2) { auto p = findplayer(s, &x); - spritesound(isRR() ? 390 : DUKE_GRUNT, ps[p].i); + S_PlayActorSound(isRR() ? 390 : DUKE_GRUNT, ps[p].i); if (ps[p].on_crane == i) ps[p].on_crane = -1; } @@ -757,7 +757,7 @@ void movecrane(int i, int crane) { s->owner = -2; ps[p].on_crane = i; - spritesound(isRR() ? 390 : DUKE_GRUNT, ps[p].i); + S_PlayActorSound(isRR() ? 390 : DUKE_GRUNT, ps[p].i); ps[p].setang(s->ang + 1024, true); } else @@ -986,7 +986,7 @@ void detonate(int i, int explosion) int x = s->extra; fi.spawn(i, explosion); fi.hitradius(i, seenineblastradius, x >> 2, x - (x >> 1), x - (x >> 2), x); - spritesound(PIPEBOMB_EXPLODE, i); + S_PlayActorSound(PIPEBOMB_EXPLODE, i); } if (s->xrepeat) @@ -1095,7 +1095,7 @@ void movewaterdrip(int i, int drip) s->cstat |= 32768; if (s->pal != 2 && (isRR() || s->hitag == 0)) - spritesound(SOMETHING_DRIPPING, i); + S_PlayActorSound(SOMETHING_DRIPPING, i); if (sprite[s->owner].picnum != drip) { @@ -1305,7 +1305,7 @@ void movecanwithsomething(int i) int j = fi.ifhitbyweapon(i); if (j >= 0) { - spritesound(VENT_BUST, i); + S_PlayActorSound(VENT_BUST, i); for (j = 0; j < 10; j++) RANDOMSCRAP(s, i); @@ -1445,7 +1445,7 @@ bool rat(int i, bool makesound) makeitfall(i); if (ssp(i, CLIPMASK0)) { - if (makesound && (krand() & 255) == 0) spritesound(RATTY, i); + if (makesound && (krand() & 255) == 0) S_PlayActorSound(RATTY, i); s->ang += (krand() & 31) - 15 + (sintable[(hittype[i].temp_data[0] << 8) & 2047] >> 11); } else @@ -1660,7 +1660,7 @@ void recon(int i, int explosion, int firelaser, int attacksnd, int painsnd, int t[0] = -1; s->extra = 0; } - if (painsnd >= 0) spritesound(painsnd, i); + if (painsnd >= 0) S_PlayActorSound(painsnd, i); RANDOMSCRAP(s, i); } @@ -1677,7 +1677,7 @@ void recon(int i, int explosion, int firelaser, int attacksnd, int painsnd, int { for (int l = 0; l < 16; l++) RANDOMSCRAP(s, i); - spritesound(LASERTRIP_EXPLODE, i); + S_PlayActorSound(LASERTRIP_EXPLODE, i); int sp = getspawn(i); if (sp >= 0) fi.spawn(i, sp); ps[myconnectindex].actors_killed++; @@ -1704,7 +1704,7 @@ void recon(int i, int explosion, int firelaser, int attacksnd, int painsnd, int { a = s->ang; s->ang = hittype[i].tempang; - if (attacksnd >= 0) spritesound(attacksnd, i); + if (attacksnd >= 0) S_PlayActorSound(attacksnd, i); fi.shoot(i, firelaser); s->ang = a; } @@ -1738,7 +1738,7 @@ void recon(int i, int explosion, int firelaser, int attacksnd, int painsnd, int } else if ((t[2] & 15) == 0 && attacksnd >= 0) { - spritesound(attacksnd, i); + S_PlayActorSound(attacksnd, i); fi.shoot(i, firelaser); } } @@ -1810,7 +1810,7 @@ void recon(int i, int explosion, int firelaser, int attacksnd, int painsnd, int } if (roamsnd >= 0 && S_CheckSoundPlaying(roamsnd) < 2) - A_PlaySound(roamsnd, i); + S_PlayActorSound(roamsnd, i); ssp(i, CLIPMASK0); } @@ -1897,9 +1897,9 @@ void reactor(int i, int REACTOR, int REACTOR2, int REACTORBURNT, int REACTOR2BUR if ((krand() & 255) < 16) { if (!S_CheckSoundPlaying(DUKE_LONGTERM_PAIN)) - spritesound(DUKE_LONGTERM_PAIN, ps[p].i); + S_PlayActorSound(DUKE_LONGTERM_PAIN, ps[p].i); - spritesound(SHORT_CIRCUIT, i); + S_PlayActorSound(SHORT_CIRCUIT, i); sprite[ps[p].i].extra--; SetPlayerPal(&ps[p], PalEntry(32, 32, 0, 0)); @@ -2090,7 +2090,7 @@ void watersplash2(int i) return; } if (!S_CheckSoundPlaying(ITEM_SPLASH)) - spritesound(ITEM_SPLASH, i); + S_PlayActorSound(ITEM_SPLASH, i); } if (t[0] == 3) { @@ -2373,7 +2373,7 @@ bool bloodpool(int i, bool puke, int TIRE) else { if (!S_CheckSoundPlaying(DUKE_LONGTERM_PAIN)) - spritesound(DUKE_LONGTERM_PAIN, ps[p].i); + S_PlayActorSound(DUKE_LONGTERM_PAIN, ps[p].i); sprite[ps[p].i].extra--; SetPlayerPal(&ps[p], PalEntry(32, 16, 0, 0)); } @@ -2814,7 +2814,7 @@ void handle_se14(int i, bool checkstat, int RPG, int JIBS6) if (statstate) { if (!S_CheckSoundPlaying(hittype[i].lastvx)) - spritesound(hittype[i].lastvx, i); + S_PlayActorSound(hittype[i].lastvx, i); } if ((!checkstat || !statstate) && (ud.monsters_off == 0 && sc->floorpal == 0 && (sc->floorstat & 1) && rnd(8))) { @@ -2830,7 +2830,7 @@ void handle_se14(int i, bool checkstat, int RPG, int JIBS6) } if (s->xvel <= 64 && statstate) - S_StopEnvSound(hittype[i].lastvx, i); + S_StopSound(hittype[i].lastvx, i); if ((sc->floorz - sc->ceilingz) < (108 << 8)) { @@ -2944,7 +2944,7 @@ void handle_se14(int i, bool checkstat, int RPG, int JIBS6) if (sprite[j].extra >= 0 && k == s->sectnum) { fi.gutsdir(&sprite[j], JIBS6, 72, myconnectindex); - spritesound(SQUISHED, i); + S_PlayActorSound(SQUISHED, i); deletesprite(j); } } @@ -3130,7 +3130,7 @@ void handle_se30(int i, int JIBS6) if (sprite[j].extra >= 0 && k == s->sectnum) { fi.gutsdir(&sprite[j], JIBS6, 24, myconnectindex); - spritesound(SQUISHED, j); + S_PlayActorSound(SQUISHED, j); deletesprite(j); } } @@ -3181,7 +3181,7 @@ void handle_se02(int i) if ((t[0] & 31) == 8) { earthquaketime = 48; - spritesound(EARTHQUAKE, ps[screenpeek].i); + S_PlayActorSound(EARTHQUAKE, ps[screenpeek].i); } if (abs(sc->floorheinum - t[5]) < 8) @@ -5052,12 +5052,12 @@ void fall_common(int g_i, int g_p, int JIBS6, int DRONE, int BLOODPOOL, int SHOT if (sphit) { fi.guts(g_sp, JIBS6, 5, g_p); - spritesound(squished, g_i); + S_PlayActorSound(squished, g_i); } else { fi.guts(g_sp, JIBS6, 15, g_p); - spritesound(squished, g_i); + S_PlayActorSound(squished, g_i); fi.spawn(g_i, BLOODPOOL); } } @@ -5078,7 +5078,7 @@ void fall_common(int g_i, int g_p, int JIBS6, int DRONE, int BLOODPOOL, int SHOT if (j != g_sp->sectnum && j >= 0 && j < MAXSECTORS) changespritesect(g_i, j); - spritesound(thud, g_i); + S_PlayActorSound(thud, g_i); } } if (sector[g_sp->sectnum].lotag == 1) diff --git a/source/games/duke/src/actors_d.cpp b/source/games/duke/src/actors_d.cpp index 6e7dd6374..462ff28c2 100644 --- a/source/games/duke/src/actors_d.cpp +++ b/source/games/duke/src/actors_d.cpp @@ -154,56 +154,56 @@ void check_fta_sounds_d(int i) case LIZTROOPDUCKING: case LIZTROOPRUNNING: case LIZTROOP: - spritesound(PRED_RECOG, i); + S_PlayActorSound(PRED_RECOG, i); break; case LIZMAN: case LIZMANSPITTING: case LIZMANFEEDING: case LIZMANJUMP: - spritesound(CAPT_RECOG, i); + S_PlayActorSound(CAPT_RECOG, i); break; case PIGCOP: case PIGCOPDIVE: - spritesound(PIG_RECOG, i); + S_PlayActorSound(PIG_RECOG, i); break; case RECON: - spritesound(RECO_RECOG, i); + S_PlayActorSound(RECO_RECOG, i); break; case DRONE: - spritesound(DRON_RECOG, i); + S_PlayActorSound(DRON_RECOG, i); break; case COMMANDER: case COMMANDERSTAYPUT: - spritesound(COMM_RECOG, i); + S_PlayActorSound(COMM_RECOG, i); break; case ORGANTIC: - spritesound(TURR_RECOG, i); + S_PlayActorSound(TURR_RECOG, i); break; case OCTABRAIN: case OCTABRAINSTAYPUT: - spritesound(OCTA_RECOG, i); + S_PlayActorSound(OCTA_RECOG, i); break; case BOSS1: - sound(BOS1_RECOG); + S_PlaySound(BOS1_RECOG); break; case BOSS2: if (sprite[i].pal == 1) - sound(BOS2_RECOG); - else sound(WHIPYOURASS); + S_PlaySound(BOS2_RECOG); + else S_PlaySound(WHIPYOURASS); break; case BOSS3: if (sprite[i].pal == 1) - sound(BOS3_RECOG); - else sound(RIPHEADNECK); + S_PlaySound(BOS3_RECOG); + else S_PlaySound(RIPHEADNECK); break; case BOSS4: case BOSS4STAYPUT: if (sprite[i].pal == 1) - sound(BOS4_RECOG); - sound(BOSS4_FIRSTSEE); + S_PlaySound(BOS4_RECOG); + S_PlaySound(BOSS4_FIRSTSEE); break; case GREENSLIME: - spritesound(SLIM_RECOG, i); + S_PlayActorSound(SLIM_RECOG, i); break; } } @@ -273,13 +273,13 @@ void addweapon_d(struct player_struct *p, int weapon) case HANDBOMB_WEAPON: break; case SHOTGUN_WEAPON: - spritesound(SHOTGUN_COCK, p->i); + S_PlayActorSound(SHOTGUN_COCK, p->i); break; case PISTOL_WEAPON: - spritesound(INSERT_CLIP, p->i); + S_PlayActorSound(INSERT_CLIP, p->i); break; default: - spritesound(SELECT_WEAPON, p->i); + S_PlayActorSound(SELECT_WEAPON, p->i); break; } } @@ -1111,7 +1111,7 @@ static void movetripbomb(int i) if (s->extra == 0) { hittype[i].temp_data[2] = 16; - spritesound(LASERTRIP_ARMING, i); + S_PlayActorSound(LASERTRIP_ARMING, i); } } } @@ -1120,7 +1120,7 @@ static void movetripbomb(int i) hittype[i].temp_data[2]--; if (hittype[i].temp_data[2] == 8) { - spritesound(LASERTRIP_EXPLODE, i); + S_PlayActorSound(LASERTRIP_EXPLODE, i); for (j = 0; j < 5; j++) RANDOMSCRAP(s, i); x = s->extra; fi.hitradius(i, tripbombblastradius, x >> 2, x >> 1, x - (x >> 2), x); @@ -1211,7 +1211,7 @@ static void movetripbomb(int i) if (m >= 0 && lTripBombControl & TRIPBOMB_TRIPWIRE) { hittype[i].temp_data[2] = 13; - spritesound(LASERTRIP_ARMING, i); + S_PlayActorSound(LASERTRIP_ARMING, i); } else hittype[i].temp_data[2] = 0; } @@ -1236,7 +1236,7 @@ static void movetripbomb(int i) if (hittype[i].lastvx != x && lTripBombControl & TRIPBOMB_TRIPWIRE) { hittype[i].temp_data[2] = 13; - spritesound(LASERTRIP_ARMING, i); + S_PlayActorSound(LASERTRIP_ARMING, i); } } } @@ -1298,8 +1298,8 @@ static void movefireext(int i) } fi.spawn(i, EXPLOSION2); - spritesound(PIPEBOMB_EXPLODE, i); - spritesound(GLASS_HEAVYBREAK, i); + S_PlayActorSound(PIPEBOMB_EXPLODE, i); + S_PlayActorSound(GLASS_HEAVYBREAK, i); if (s->hitag > 0) { @@ -1315,7 +1315,7 @@ static void movefireext(int i) int x = s->extra; fi.spawn(i, EXPLOSION2); fi.hitradius(i, pipebombblastradius, x >> 2, x - (x >> 1), x - (x >> 2), x); - spritesound(PIPEBOMB_EXPLODE, i); + S_PlayActorSound(PIPEBOMB_EXPLODE, i); detonate(i, EXPLOSION2); } else @@ -1399,7 +1399,7 @@ CLEAR_THE_BOLT2: #endif if ((krand() & 1) && sector[sect].floorpicnum == HURTRAIL) - spritesound(SHORT_CIRCUIT, i); + S_PlayActorSound(SHORT_CIRCUIT, i); if (s->picnum == SIDEBOLT1 + 4) s->picnum = SIDEBOLT1; } @@ -1452,7 +1452,7 @@ CLEAR_THE_BOLT: if (l & 1) s->cstat ^= 2; if (s->picnum == (BOLT1+1) && (krand()&7) == 0 && sector[sect].floorpicnum == HURTRAIL) - spritesound(SHORT_CIRCUIT,i); + S_PlayActorSound(SHORT_CIRCUIT,i); if (s->picnum==BOLT1+4) s->picnum=BOLT1; @@ -1659,7 +1659,7 @@ void moveweapons_d(void) if (s->picnum == COOLEXPLOSION1) if (!S_CheckSoundPlaying(i, WIERDSHOT_FLY)) - A_PlaySound(WIERDSHOT_FLY, i); + S_PlayActorSound(WIERDSHOT_FLY, i); p = -1; @@ -1829,7 +1829,7 @@ void moveweapons_d(void) ps[p].numloogs = -1 - sprite[i].yvel; } - spritesound(PISTOL_BODYHIT,j); + S_PlayActorSound(PISTOL_BODYHIT,j); if (s->picnum == SPIT) { @@ -1838,8 +1838,8 @@ void moveweapons_d(void) if (ps[p].loogcnt == 0) { - if (!A_CheckSoundPlaying(ps[p].i, DUKE_LONGTERM_PAIN)) - A_PlaySound(DUKE_LONGTERM_PAIN, ps[p].i); + if (!S_CheckActorSoundPlaying(ps[p].i, DUKE_LONGTERM_PAIN)) + S_PlayActorSound(DUKE_LONGTERM_PAIN, ps[p].i); j = 3+(krand()&3); ps[p].numloogs = j; @@ -1955,7 +1955,7 @@ void moveweapons_d(void) else if (s->picnum == SHRINKSPARK) { fi.spawn(i,SHRINKEREXPLOSION); - spritesound(SHRINKER_HIT,i); + S_PlayActorSound(SHRINKER_HIT,i); fi.hitradius(i,shrinkerblastradius,0,0,0,0); } else if (s->picnum != COOLEXPLOSION1 && s->picnum != FREEZEBLAST && s->picnum != FIRELASER && (!isWorldTour() || s->picnum != FIREBALL)) @@ -1972,7 +1972,7 @@ void moveweapons_d(void) } if (s->picnum == RPG) { - spritesound(RPG_EXPLODE,i); + S_PlayActorSound(RPG_EXPLODE,i); if (s->xrepeat >= 10) { @@ -2069,7 +2069,7 @@ void movetransports_d(void) if (sprite[i].pal == 0) { fi.spawn(i, TRANSPORTERBEAM); - spritesound(TELEPORTER, i); + S_PlayActorSound(TELEPORTER, i); } for (k = connecthead; k >= 0; k = connectpoint2[k]) @@ -2098,7 +2098,7 @@ void movetransports_d(void) if (sprite[i].pal == 0) { k = fi.spawn(sprite[i].owner, TRANSPORTERBEAM); - spritesound(TELEPORTER, k); + S_PlayActorSound(TELEPORTER, k); } break; @@ -2139,7 +2139,7 @@ void movetransports_d(void) FX_StopAllSounds(); } if (sprite[ps[p].i].extra > 0) - spritesound(DUKE_UNDERWATER, j); + S_PlayActorSound(DUKE_UNDERWATER, j); ps[p].oposz = ps[p].posz = sector[sprite[sprite[i].owner].sectnum].ceilingz + (7 << 8); @@ -2156,7 +2156,7 @@ void movetransports_d(void) { FX_StopAllSounds(); } - spritesound(DUKE_GASP, j); + S_PlayActorSound(DUKE_GASP, j); ps[p].oposz = ps[p].posz = sector[sprite[sprite[i].owner].sectnum].floorz - (7 << 8); @@ -2292,10 +2292,10 @@ void movetransports_d(void) if (sprite[i].pal == 0) { k = fi.spawn(i, TRANSPORTERBEAM); - spritesound(TELEPORTER, k); + S_PlayActorSound(TELEPORTER, k); k = fi.spawn(sprite[i].owner, TRANSPORTERBEAM); - spritesound(TELEPORTER, k); + S_PlayActorSound(TELEPORTER, k); } if (sprite[sprite[i].owner].owner != sprite[i].owner) @@ -2429,7 +2429,7 @@ static void greenslime(int i) int k = EGS(sprite[i].sectnum, sprite[i].x, sprite[i].y, sprite[i].z, GLASSPIECES + (j % 3), -32, 36, 36, krand() & 2047, 32 + (krand() & 63), 1024 - (krand() & 1023), i, 5); sprite[k].pal = 1; } - spritesound(GLASS_BREAKING, i); + S_PlayActorSound(GLASS_BREAKING, i); deletesprite(i); } else if (x < 1024 && ps[p].quick_kick == 0) @@ -2467,8 +2467,8 @@ static void greenslime(int i) sprite[j].pal = 6; } - spritesound(SLIM_DYING, i); - spritesound(SQUISHED, i); + S_PlayActorSound(SLIM_DYING, i); + S_PlayActorSound(SQUISHED, i); if ((krand() & 255) < 32) { j = fi.spawn(i, BLOODPOOL); @@ -2520,7 +2520,7 @@ static void greenslime(int i) if (t[3] == 5) { sprite[ps[p].i].extra += -(5 + (krand() & 3)); - spritesound(SLIM_ATTACK, i); + S_PlayActorSound(SLIM_ATTACK, i); } if (t[3] < 7) t[3]++; @@ -2557,7 +2557,7 @@ static void greenslime(int i) j = fi.ifhitbyweapon(i); if (j >= 0) { - spritesound(SLIM_DYING, i); + S_PlayActorSound(SLIM_DYING, i); ps[p].actors_killed++; if (ps[p].somethingonplayer == i) @@ -2565,7 +2565,7 @@ static void greenslime(int i) if (j == FREEZEBLAST) { - spritesound(SOMETHINGFROZE, i); t[0] = -5; t[3] = 0; + S_PlayActorSound(SOMETHINGFROZE, i); t[0] = -5; t[3] = 0; return; } @@ -2674,7 +2674,7 @@ static void greenslime(int i) s->picnum = GREENSLIME; if ((krand() & 511) == 0) - spritesound(SLIM_ROAM, i); + S_PlayActorSound(SLIM_ROAM, i); if (t[0] == 2) { @@ -2839,7 +2839,7 @@ static void flamethrowerflame(int i) j &= (MAXSPRITES - 1); fi.checkhitsprite((short)j, i); if (sprite[j].picnum == APLAYER) - spritesound(j, PISTOL_BODYHIT); + S_PlayActorSound(j, PISTOL_BODYHIT); } else if ((j & kHitTypeMask) == kHitWall) { @@ -2885,7 +2885,7 @@ static void heavyhbomb(int i) t[2]--; if (t[2] <= 0) { - spritesound(TELEPORTER, i); + S_PlayActorSound(TELEPORTER, i); fi.spawn(i, TRANSPORTERSTAR); s->cstat = 257; } @@ -2917,7 +2917,7 @@ static void heavyhbomb(int i) if (sector[sect].lotag != 1 && s->z >= hittype[i].floorz - (FOURSLEIGHT) && s->yvel < 3) { if (s->yvel > 0 || (s->yvel == 0 && hittype[i].floorz == sector[sect].floorz)) - spritesound(PIPEBOMB_BOUNCE, i); + S_PlayActorSound(PIPEBOMB_BOUNCE, i); s->zvel = -((4 - s->yvel) << 8); if (sector[s->sectnum].lotag == 2) s->zvel >>= 2; @@ -3014,7 +3014,7 @@ DETONATEB: fi.spawn(i, EXPLOSION2); if (s->zvel == 0) fi.spawn(i, EXPLOSION2BOT); - spritesound(PIPEBOMB_EXPLODE, i); + S_PlayActorSound(PIPEBOMB_EXPLODE, i); for (x = 0; x < 8; x++) RANDOMSCRAP(s, i); } @@ -3057,7 +3057,7 @@ DETONATEB: } addammo(HANDBOMB_WEAPON, &ps[p], 1); - spritesound(DUKE_GET, ps[p].i); + S_PlayActorSound(DUKE_GET, ps[p].i); if (ps[p].gotweapon[HANDBOMB_WEAPON] == 0 || s->owner == ps[p].i) fi.addweapon(&ps[p], HANDBOMB_WEAPON); @@ -3187,11 +3187,11 @@ void moveactors_d(void) s->z += s->zvel; t[0]++; - if (t[0] == 4) spritesound(WAR_AMBIENCE2, i); + if (t[0] == 4) S_PlayActorSound(WAR_AMBIENCE2, i); if (t[0] > (26 * 8)) { - sound(RPG_EXPLODE); + S_PlaySound(RPG_EXPLODE); for (j = 0; j < 32; j++) RANDOMSCRAP(s, i); earthquaketime = 16; @@ -3829,9 +3829,9 @@ void moveeffectors_d(void) //STATNUM 3 break; } else if (hittype[i].temp_data[2] == (hittype[i].temp_data[1] >> 1)) - spritesound(THUNDER, i); + S_PlayActorSound(THUNDER, i); else if (hittype[i].temp_data[2] == (hittype[i].temp_data[1] >> 3)) - spritesound(LIGHTNING_SLAP, i); + S_PlayActorSound(LIGHTNING_SLAP, i); else if (hittype[i].temp_data[2] == (hittype[i].temp_data[1] >> 2)) { j = headspritestat[0]; @@ -3871,8 +3871,8 @@ void moveeffectors_d(void) //STATNUM 3 if (x < 768) { if (S_CheckSoundPlaying(ps[p].i, DUKE_LONGTERM_PAIN) < 1) - spritesound(DUKE_LONGTERM_PAIN, ps[p].i); - spritesound(SHORT_CIRCUIT, ps[p].i); + S_PlayActorSound(DUKE_LONGTERM_PAIN, ps[p].i); + S_PlayActorSound(SHORT_CIRCUIT, ps[p].i); sprite[ps[p].i].extra -= 8 + (krand() & 7); SetPlayerPal(&ps[p], PalEntry(32, 16, 0, 0)); } diff --git a/source/games/duke/src/actors_lava.cpp b/source/games/duke/src/actors_lava.cpp index 78f12c46f..fcff35f76 100644 --- a/source/games/duke/src/actors_lava.cpp +++ b/source/games/duke/src/actors_lava.cpp @@ -536,14 +536,14 @@ void operatejaildoors(int hitag) jaildooropen[i] = 1; jaildoordrag[i] = jaildoordist[i]; if (!isRRRA() || jaildoorsound[i] != 0) - spritesound(jaildoorsound[i], ps[screenpeek].i); + S_PlayActorSound(jaildoorsound[i], ps[screenpeek].i); } if (jaildooropen[i] == 2) { jaildooropen[i] = 3; jaildoordrag[i] = jaildoordist[i]; if (!isRRRA() || jaildoorsound[i] != 0) - spritesound(jaildoorsound[i], ps[screenpeek].i); + S_PlayActorSound(jaildoorsound[i], ps[screenpeek].i); } } } @@ -568,7 +568,7 @@ void thunder(void) { thunderflash = 1; thundertime = 256; - sound(351 + (rand() % 3)); + S_PlaySound(351 + (rand() % 3)); } } else @@ -597,7 +597,7 @@ void thunder(void) { winderflash = 1; windertime = 128; - sound(351 + (rand() % 3)); + S_PlaySound(351 + (rand() % 3)); } } } diff --git a/source/games/duke/src/actors_r.cpp b/source/games/duke/src/actors_r.cpp index 95414d22a..fc713f97b 100644 --- a/source/games/duke/src/actors_r.cpp +++ b/source/games/duke/src/actors_r.cpp @@ -97,12 +97,12 @@ void check_fta_sounds_r(int i) { case COOT: // LIZTROOP if (!isRRRA() && (krand() & 3) == 2) - spritesound(PRED_RECOG, i); + S_PlayActorSound(PRED_RECOG, i); break; case BILLYCOCK: case BILLYRAY: case BRAYSNIPER: // PIGCOP - spritesound(PIG_RECOG, i); + S_PlayActorSound(PIG_RECOG, i); break; } } @@ -191,13 +191,13 @@ void addweapon_r(struct player_struct* p, int weapon) case THROWINGDYNAMITE_WEAPON: break; case SHOTGUN_WEAPON: - spritesound(SHOTGUN_COCK, p->i); + S_PlayActorSound(SHOTGUN_COCK, p->i); break; case PISTOL_WEAPON: - spritesound(INSERT_CLIP, p->i); + S_PlayActorSound(INSERT_CLIP, p->i); break; default: - spritesound(EJECT_CLIP, p->i); + S_PlayActorSound(EJECT_CLIP, p->i); break; } } @@ -1026,7 +1026,7 @@ CLEAR_THE_BOLT: if (l & 1) s->cstat ^= 2; if (s->picnum == (BOLT1 + 1) && (krand() & 1) && sector[sect].floorpicnum == HURTRAIL) - spritesound(SHORT_CIRCUIT, i); + S_PlayActorSound(SHORT_CIRCUIT, i); if (s->picnum == BOLT1 + 4) s->picnum = BOLT1; @@ -1363,7 +1363,7 @@ void moveweapons_r(void) && (s->picnum == RPG || s->picnum == RPG2) && sprite[j].pal == 19) { - spritesound(RPG_EXPLODE, i); + S_PlayActorSound(RPG_EXPLODE, i); k = fi.spawn(i, EXPLOSION2); sprite[k].x = dax; sprite[k].y = day; @@ -1388,7 +1388,7 @@ void moveweapons_r(void) if (sprite[j].picnum == APLAYER) { p = sprite[j].yvel; - spritesound(PISTOL_BODYHIT,j); + S_PlayActorSound(PISTOL_BODYHIT,j); if (s->picnum == SPIT) { @@ -1403,8 +1403,8 @@ void moveweapons_r(void) if (ps[p].loogcnt == 0) { - if (!A_CheckSoundPlaying(ps[p].i, DUKE_LONGTERM_PAIN)) - A_PlaySound(DUKE_LONGTERM_PAIN, ps[p].i); + if (!S_CheckActorSoundPlaying(ps[p].i, DUKE_LONGTERM_PAIN)) + S_PlayActorSound(DUKE_LONGTERM_PAIN, ps[p].i); j = 3 + (krand() & 3); ps[p].numloogs = j; @@ -1606,7 +1606,7 @@ void moveweapons_r(void) } if (s->picnum == RPG) { - spritesound(RPG_EXPLODE, i); + S_PlayActorSound(RPG_EXPLODE, i); if (s->xrepeat >= 10) { @@ -1622,7 +1622,7 @@ void moveweapons_r(void) else if (isRRRA() && s->picnum == RPG2) { s->extra = 150; - spritesound(247, i); + S_PlayActorSound(247, i); if (s->xrepeat >= 10) { @@ -1638,7 +1638,7 @@ void moveweapons_r(void) else if (isRRRA() && s->picnum == RRTILE1790) { s->extra = 160; - spritesound(RPG_EXPLODE, i); + S_PlayActorSound(RPG_EXPLODE, i); if (s->xrepeat >= 10) { @@ -1722,7 +1722,7 @@ void movetransports_r(void) if (ps[p].on_ground && sectlotag == 0 && onfloorz && ps[p].jetpack_on == 0) { fi.spawn(i, TRANSPORTERBEAM); - spritesound(TELEPORTER, i); + S_PlayActorSound(TELEPORTER, i); for (k = connecthead; k >= 0; k = connectpoint2[k])// connectpoinhittype[i].temp_data[1][k]) if (ps[k].cursectnum == sprite[OW].sectnum) @@ -1748,7 +1748,7 @@ void movetransports_r(void) ps[p].cursectnum = sprite[j].sectnum; k = fi.spawn(OW, TRANSPORTERBEAM); - spritesound(TELEPORTER, k); + S_PlayActorSound(TELEPORTER, k); break; } @@ -1802,7 +1802,7 @@ void movetransports_r(void) { FX_StopAllSounds(); } - spritesound(DUKE_UNDERWATER, ps[p].i); + S_PlayActorSound(DUKE_UNDERWATER, ps[p].i); ps[p].oposz = ps[p].posz = sector[sprite[OW].sectnum].ceilingz + (7 << 8); if (ps[p].OnMotorcycle) @@ -1817,7 +1817,7 @@ void movetransports_r(void) { FX_StopAllSounds(); } - spritesound(DUKE_GASP, ps[p].i); + S_PlayActorSound(DUKE_GASP, ps[p].i); ps[p].oposz = ps[p].posz = sector[sprite[OW].sectnum].floorz - (7 << 8); @@ -1965,10 +1965,10 @@ void movetransports_r(void) hittype[j].bposz = sprite[j].z; k = fi.spawn(i, TRANSPORTERBEAM); - spritesound(TELEPORTER, k); + S_PlayActorSound(TELEPORTER, k); k = fi.spawn(OW, TRANSPORTERBEAM); - spritesound(TELEPORTER, k); + S_PlayActorSound(TELEPORTER, k); if (sprite[OW].owner != OW) { @@ -2261,7 +2261,7 @@ static void rrra_specialstats() if (sprite[i].extra) { if (sprite[i].extra == sprite[i].lotag) - sound(183); + S_PlaySound(183); sprite[i].extra--; j = fi.movesprite(i, (sprite[i].hitag * sintable[(sprite[i].ang + 512) & 2047]) >> 14, @@ -2269,12 +2269,12 @@ static void rrra_specialstats() sprite[i].hitag << 1, CLIPMASK0); if (j > 0) { - spritesound(PIPEBOMB_EXPLODE, i); + S_PlayActorSound(PIPEBOMB_EXPLODE, i); deletesprite(i); } if (sprite[i].extra == 0) { - sound(215); + S_PlaySound(215); deletesprite(i); earthquaketime = 32; SetPlayerPal(&ps[myconnectindex], PalEntry(32, 32, 32, 48)); @@ -2311,7 +2311,7 @@ static void rrra_specialstats() sprite[i].picnum = RRTILE8162 + 2; fi.spawn(i, BATTERYAMMO); ps[screenpeek].SlotWin |= 1; - spritesound(52, i); + S_PlayActorSound(52, i); } } else if (rvar < 120) @@ -2325,7 +2325,7 @@ static void rrra_specialstats() sprite[i].picnum = RRTILE8162 + 6; fi.spawn(i, HEAVYHBOMB); ps[screenpeek].SlotWin |= 2; - spritesound(52, i); + S_PlayActorSound(52, i); } } else if (rvar < 126) @@ -2339,7 +2339,7 @@ static void rrra_specialstats() sprite[i].picnum = RRTILE8162 + 5; fi.spawn(i, SIXPAK); ps[screenpeek].SlotWin |= 4; - spritesound(52, i); + S_PlayActorSound(52, i); } } else @@ -2353,7 +2353,7 @@ static void rrra_specialstats() sprite[i].picnum = RRTILE8162 + 4; fi.spawn(i, ATOMICHEALTH); ps[screenpeek].SlotWin |= 8; - spritesound(52, i); + S_PlayActorSound(52, i); } } } @@ -2389,7 +2389,7 @@ static void rrra_specialstats() sprite[i].picnum = RRTILE8589 + 5; fi.spawn(i, BATTERYAMMO); ps[screenpeek].SlotWin |= 1; - spritesound(342, i); + S_PlayActorSound(342, i); } } else if (rvar < 120) @@ -2403,7 +2403,7 @@ static void rrra_specialstats() sprite[i].picnum = RRTILE8589 + 6; fi.spawn(i, HEAVYHBOMB); ps[screenpeek].SlotWin |= 2; - spritesound(342, i); + S_PlayActorSound(342, i); } } else if (rvar < 126) @@ -2417,7 +2417,7 @@ static void rrra_specialstats() sprite[i].picnum = RRTILE8589 + 2; fi.spawn(i, SIXPAK); ps[screenpeek].SlotWin |= 4; - spritesound(342, i); + S_PlayActorSound(342, i); } } else @@ -2431,7 +2431,7 @@ static void rrra_specialstats() sprite[i].picnum = RRTILE8589 + 3; fi.spawn(i, ATOMICHEALTH); ps[screenpeek].SlotWin |= 8; - spritesound(342, i); + S_PlayActorSound(342, i); } } } @@ -2445,7 +2445,7 @@ static void rrra_specialstats() nexti = nextspritestat[i]; if (sprite[i].lotag == 5) if (!S_CheckSoundPlaying(330)) - spritesound(330, i); + S_PlayActorSound(330, i); i = nexti; } } @@ -2538,7 +2538,7 @@ void rr_specialstats() { j = fi.spawn(i, RRTILE3132); sprite[i].lotag = 96; - if (!isRRRA()) spritesound(472, j); + if (!isRRRA()) S_PlayActorSound(472, j); } break; case RRTILE289: @@ -2646,7 +2646,7 @@ void rr_specialstats() pi = ps[p].i; changespritesect(pi, sprite[j].sectnum); ps[p].cursectnum = sprite[pi].sectnum; - spritesound(70, j); + S_PlayActorSound(70, j); deletesprite(j); } j = nextj; @@ -2675,7 +2675,7 @@ static void heavyhbomb(int i) t[2]--; if (t[2] <= 0) { - spritesound(TELEPORTER, i); + S_PlayActorSound(TELEPORTER, i); fi.spawn(i, TRANSPORTERSTAR); s->cstat = 257; } @@ -2707,7 +2707,7 @@ static void heavyhbomb(int i) if (s->yvel > 0 || (s->yvel == 0 && hittype[i].floorz == sector[sect].floorz)) { if (s->picnum != CHEERBOMB) - spritesound(PIPEBOMB_BOUNCE, i); + S_PlayActorSound(PIPEBOMB_BOUNCE, i); else { t[3] = 1; @@ -2825,7 +2825,7 @@ DETONATEB: fi.spawn(i, EXPLOSION2); if (s->picnum == CHEERBOMB) fi.spawn(i, BURNING); - spritesound(PIPEBOMB_EXPLODE, i); + S_PlayActorSound(PIPEBOMB_EXPLODE, i); for (x = 0; x < 8; x++) RANDOMSCRAP(s, i); } @@ -2866,7 +2866,7 @@ DETONATEB: addammo(DYNAMITE_WEAPON, &ps[p], 1); addammo(CROSSBOW_WEAPON, &ps[p], 1); - spritesound(DUKE_GET, ps[p].i); + S_PlayActorSound(DUKE_GET, ps[p].i); if (ps[p].gotweapon[DYNAMITE_WEAPON] == 0 || s->owner == ps[p].i) fi.addweapon(&ps[p], DYNAMITE_WEAPON); @@ -3139,7 +3139,7 @@ void moveactors_r(void) if (s->xvel) { if(!S_CheckSoundPlaying(356)) - spritesound(356,i); + S_PlayActorSound(356,i); } else { @@ -3149,7 +3149,7 @@ void moveactors_r(void) } if (sector[s->sectnum].lotag == 900) { - S_StopEnvSound(356, -1); + S_StopSound(356, -1); } case RRTILE3440: case RRTILE3440+1: @@ -3348,7 +3348,7 @@ void moveexplosions_r(void) // STATNUM 5 continue; } if (S_CheckSoundPlaying(22)) - spritesound(22, i); + S_PlayActorSound(22, i); } if (t[0] == 3) { @@ -3841,7 +3841,7 @@ void moveeffectors_r(void) //STATNUM 3 { sc->ceilingz = sc->floorz; if (isRRRA() && pistonsound) - spritesound(371, i); + S_PlayActorSound(371, i); } } else @@ -3851,7 +3851,7 @@ void moveeffectors_r(void) //STATNUM 3 { sc->ceilingz = t[4]; if (isRRRA() && pistonsound) - spritesound(167, i); + S_PlayActorSound(167, i); } } @@ -4413,7 +4413,7 @@ static int fallspecial(int g_i, int g_p) if (g_sp->picnum != APLAYER && badguy(g_sp) && g_sp->z == hittype[g_i].floorz - FOURSLEIGHT) { fi.guts(g_sp, JIBS6, 5, g_p); - spritesound(SQUISHED, g_i); + S_PlayActorSound(SQUISHED, g_i); addspritetodelete(g_i); } return 0; diff --git a/source/games/duke/src/gameexec.cpp b/source/games/duke/src/gameexec.cpp index 76bdb9734..1e43dc797 100644 --- a/source/games/duke/src/gameexec.cpp +++ b/source/games/duke/src/gameexec.cpp @@ -403,15 +403,15 @@ int ParseState::parse(void) { banjosound = 273; } - A_PlaySound(banjosound, g_i, CHAN_WEAPON); + S_PlayActorSound(banjosound, g_i, CHAN_WEAPON); } else if (!S_CheckSoundPlaying(g_i, banjosound)) - A_PlaySound(banjosound, g_i, CHAN_WEAPON); + S_PlayActorSound(banjosound, g_i, CHAN_WEAPON); insptr++; break; case concmd_motoloopsnd: if (!S_CheckSoundPlaying(g_i, 411)) - A_PlaySound(411, g_i, CHAN_VOICE); + S_PlayActorSound(411, g_i, CHAN_VOICE); insptr++; break; case concmd_ifgotweaponce: @@ -452,7 +452,7 @@ int ParseState::parse(void) case concmd_mikesnd: insptr++; if (!S_CheckSoundPlaying(g_i, g_sp->yvel)) - A_PlaySound(g_sp->yvel, g_i, CHAN_VOICE); + S_PlayActorSound(g_sp->yvel, g_i, CHAN_VOICE); break; case concmd_pkick: insptr++; @@ -512,17 +512,17 @@ int ParseState::parse(void) break; case concmd_soundtag: insptr++; - spritesound(ambientlotag[g_sp->ang], g_i); + S_PlayActorSound(ambientlotag[g_sp->ang], g_i); break; case concmd_soundtagonce: insptr++; if (!S_CheckSoundPlaying(g_i, ambientlotag[g_sp->ang])) - A_PlaySound(ambientlotag[g_sp->ang], g_i); + S_PlayActorSound(ambientlotag[g_sp->ang], g_i); break; case concmd_soundonce: insptr++; if (!S_CheckSoundPlaying(g_i, *insptr++)) - A_PlaySound(*(insptr - 1), g_i); + S_PlayActorSound(*(insptr - 1), g_i); break; case concmd_stopsound: insptr++; @@ -533,7 +533,7 @@ int ParseState::parse(void) case concmd_globalsound: insptr++; if (g_p == screenpeek || ud.coop == 1) - spritesound((int)*insptr, ps[screenpeek].i); + S_PlayActorSound((int)*insptr, ps[screenpeek].i); insptr++; break; case concmd_smackbubba: @@ -558,7 +558,7 @@ int ParseState::parse(void) break; case concmd_sound: insptr++; - spritesound((short) *insptr,g_i); + S_PlayActorSound((short) *insptr,g_i); insptr++; break; case concmd_tip: @@ -693,7 +693,7 @@ int ParseState::parse(void) { if ((j - *insptr) < (max_player_health >> 2) && j >= (max_player_health >> 2)) - spritesound(DUKE_GOTHEALTHATLOW, ps[g_p].i); + S_PlayActorSound(DUKE_GOTHEALTHATLOW, ps[g_p].i); ps[g_p].last_extra = j; } @@ -769,7 +769,7 @@ int ParseState::parse(void) { if ((j - *insptr) < (max_player_health >> 2) && j >= (max_player_health >> 2)) - spritesound(229, ps[g_p].i); + S_PlayActorSound(229, ps[g_p].i); ps[g_p].last_extra = j; } @@ -835,7 +835,7 @@ int ParseState::parse(void) { if( ( j - *insptr ) < (max_player_health>>2) && j >= (max_player_health>>2) ) - spritesound(isRR()? 229 : DUKE_GOTHEALTHATLOW,ps[g_p].i); + S_PlayActorSound(isRR()? 229 : DUKE_GOTHEALTHATLOW,ps[g_p].i); ps[g_p].last_extra = j; } @@ -1580,7 +1580,7 @@ int ParseState::parse(void) break; case concmd_ifnosounds: - parseifelse(!A_CheckAnySoundPlaying(g_i) ); + parseifelse(!S_CheckAnyActorSoundPlaying(g_i) ); break; case concmd_ifplaybackon: //Twentieth Anniversary World Tour diff --git a/source/games/duke/src/hudweapon_r.cpp b/source/games/duke/src/hudweapon_r.cpp index a4bf685f8..6dea3b4c4 100644 --- a/source/games/duke/src/hudweapon_r.cpp +++ b/source/games/duke/src/hudweapon_r.cpp @@ -471,7 +471,7 @@ void displayweapon_r(int snum) } else if ((krand() & 15) == 5) { - spritesound(327, p->i); + S_PlayActorSound(327, p->i); rdmyospal((weapon_xoffset + 210) - (p->getlookang() >> 1), looking_arc + 222 - gun_pos, RPGGUN2 + 7, gs, o | pin, pal); chickenphase = 6; diff --git a/source/games/duke/src/input.cpp b/source/games/duke/src/input.cpp index f2345eb6f..fea5e7570 100644 --- a/source/games/duke/src/input.cpp +++ b/source/games/duke/src/input.cpp @@ -271,7 +271,7 @@ void hud_input(int snum) { p->last_pissed_time = 4000; if (!adult_lockout) - spritesound(437, p->i); + S_PlayActorSound(437, p->i); if (sprite[p->i].extra <= max_player_health - max_player_health / 10) { sprite[p->i].extra += 2; @@ -334,7 +334,7 @@ void hud_input(int snum) p->heat_on = !p->heat_on; setpal(p); p->inven_icon = 5; - spritesound(NITEVISION_ONOFF, p->i); + S_PlayActorSound(NITEVISION_ONOFF, p->i); FTA(106 + (!p->heat_on), p); } } @@ -348,7 +348,7 @@ void hud_input(int snum) if (p->steroids_amount == 400) { p->steroids_amount--; - spritesound(DUKE_TAKEPILLS, p->i); + S_PlayActorSound(DUKE_TAKEPILLS, p->i); p->inven_icon = ICON_STEROIDS; FTA(12, p); } @@ -495,12 +495,12 @@ void hud_input(int snum) FTA(47, p); } else FTA(QUOTE_HOLODUKE_ON, p); - spritesound(TELEPORTER, p->holoduke_on); + S_PlayActorSound(TELEPORTER, p->holoduke_on); } else { - spritesound(TELEPORTER, p->holoduke_on); + S_PlayActorSound(TELEPORTER, p->holoduke_on); p->holoduke_on = -1; FTA(QUOTE_HOLODUKE_NOT_FOUND, p); } @@ -519,8 +519,8 @@ void hud_input(int snum) if (p->holoduke_amount == 0) checkavailinven(p); - if (p->drink_amt < 99 && !A_CheckSoundPlaying(p->i, 425)) - spritesound(425, p->i); + if (p->drink_amt < 99 && !S_CheckActorSoundPlaying(p->i, 425)) + S_PlayActorSound(425, p->i); } } } @@ -535,7 +535,7 @@ void hud_input(int snum) if (p->yehaa_timer == 0) { p->yehaa_timer = 126; - spritesound(390, p->i); + S_PlayActorSound(390, p->i); p->noise_radius = 16384; madenoise(snum); if (sector[p->cursectnum].lotag == 857) @@ -582,7 +582,7 @@ void hud_input(int snum) p->firstaid_amount = 0; checkavailinven(p); } - spritesound(DUKE_USEMEDKIT, p->i); + S_PlayActorSound(DUKE_USEMEDKIT, p->i); } else { @@ -604,8 +604,8 @@ void hud_input(int snum) if (sprite[p->i].extra > max_player_health) sprite[p->i].extra = max_player_health; p->drink_amt += 10; - if (p->drink_amt <= 100 && !A_CheckSoundPlaying(p->i, DUKE_USEMEDKIT)) - spritesound(DUKE_USEMEDKIT, p->i); + if (p->drink_amt <= 100 && !S_CheckActorSoundPlaying(p->i, DUKE_USEMEDKIT)) + S_PlayActorSound(DUKE_USEMEDKIT, p->i); } } } @@ -626,17 +626,17 @@ void hud_input(int snum) { p->inven_icon = 4; - S_StopEnvSound(-1, p->i, CHAN_VOICE); // this will stop the falling scream - A_PlaySound(DUKE_JETPACK_ON, p->i); + S_StopSound(-1, p->i, CHAN_VOICE); // this will stop the falling scream + S_PlayActorSound(DUKE_JETPACK_ON, p->i); FTA(QUOTE_JETPACK_ON, p); } else { p->hard_landing = 0; p->poszv = 0; - spritesound(DUKE_JETPACK_OFF, p->i); - S_StopEnvSound(DUKE_JETPACK_IDLE, p->i); - S_StopEnvSound(DUKE_JETPACK_ON, p->i); + S_PlayActorSound(DUKE_JETPACK_OFF, p->i); + S_StopSound(DUKE_JETPACK_IDLE, p->i); + S_StopSound(DUKE_JETPACK_ON, p->i); FTA(QUOTE_JETPACK_OFF, p); } } @@ -647,8 +647,8 @@ void hud_input(int snum) // eat cow pie if (p->jetpack_amount > 0 && sprite[p->i].extra < max_player_health) { - if (!A_CheckSoundPlaying(p->i, 429)) - A_PlaySound(429, p->i); + if (!S_CheckActorSoundPlaying(p->i, 429)) + S_PlayActorSound(429, p->i); p->jetpack_amount -= 100; if (p->drink_amt > 0) diff --git a/source/games/duke/src/player.cpp b/source/games/duke/src/player.cpp index e627287f1..d6a27bc36 100644 --- a/source/games/duke/src/player.cpp +++ b/source/games/duke/src/player.cpp @@ -401,7 +401,7 @@ void dokneeattack(int snum, int pi, const std::initializer_list & respawnli { fi.guts(&sprite[p->actorsqu], TILE_JIBS6, 7, myconnectindex); fi.spawn(p->actorsqu, TILE_BLOODPOOL); - spritesound(SQUISHED, p->actorsqu); + S_PlayActorSound(SQUISHED, p->actorsqu); if (isIn(sprite[p->actorsqu].picnum, respawnlist)) { if (sprite[p->actorsqu].yvel) @@ -448,12 +448,12 @@ int makepainsounds(int snum, int type) k = 1; else { - if (!A_CheckSoundPlaying(pi, DUKE_LONGTERM_PAIN)) - spritesound(DUKE_LONGTERM_PAIN, pi); + if (!S_CheckActorSoundPlaying(pi, DUKE_LONGTERM_PAIN)) + S_PlayActorSound(DUKE_LONGTERM_PAIN, pi); SetPlayerPal(p, PalEntry(32, 64, 64, 64)); s->extra -= 1 + (krand() & 3); - if (!A_CheckSoundPlaying(pi, SHORT_CIRCUIT)) - spritesound(SHORT_CIRCUIT, pi); + if (!S_CheckActorSoundPlaying(pi, SHORT_CIRCUIT)) + S_PlayActorSound(SHORT_CIRCUIT, pi); } } break; @@ -464,8 +464,8 @@ int makepainsounds(int snum, int type) k = 1; else { - if (!A_CheckSoundPlaying(pi, DUKE_LONGTERM_PAIN)) - spritesound(DUKE_LONGTERM_PAIN, pi); + if (!S_CheckActorSoundPlaying(pi, DUKE_LONGTERM_PAIN)) + S_PlayActorSound(DUKE_LONGTERM_PAIN, pi); SetPlayerPal(p, PalEntry(32, 0, 8, 0)); s->extra -= 1 + (krand() & 3); } @@ -478,8 +478,8 @@ int makepainsounds(int snum, int type) k = 1; else { - if (!A_CheckSoundPlaying(pi, DUKE_LONGTERM_PAIN)) - spritesound(DUKE_LONGTERM_PAIN, pi); + if (!S_CheckActorSoundPlaying(pi, DUKE_LONGTERM_PAIN)) + S_PlayActorSound(DUKE_LONGTERM_PAIN, pi); SetPlayerPal(p, PalEntry(32, 8, 0, 0)); s->extra -= 1 + (krand() & 3); } @@ -493,7 +493,7 @@ int makepainsounds(int snum, int type) s->extra -= 2; else s->extra -= 4; - spritesound(DUKE_LONGTERM_PAIN, pi); + S_PlayActorSound(DUKE_LONGTERM_PAIN, pi); } break; } @@ -572,8 +572,8 @@ void playerisdead(int snum, int psectlotag, int fz, int cz) p->jetpack_on = 0; p->holoduke_on = -1; - if (!isRR())S_StopEnvSound(DUKE_JETPACK_IDLE, pi); - S_StopEnvSound(-1, pi, CHAN_VOICE); + if (!isRR())S_StopSound(DUKE_JETPACK_IDLE, pi); + S_StopSound(-1, pi, CHAN_VOICE); if (s->pal != 1 && (s->cstat & 32768) == 0) s->cstat = 0; @@ -667,7 +667,7 @@ int endoflevel(int snum) #if 0 if (ud.recstat == 1) closedemowrite(); #endif - sound(PIPEBOMB_EXPLODE); + S_PlaySound(PIPEBOMB_EXPLODE); SetPlayerPal(p, PalEntry(48, 64, 64, 64)); } if (p->fist_incs > 42) @@ -693,7 +693,7 @@ int timedexit(int snum) FX_StopAllSounds(); if (p->customexitsound >= 0) { - sound(p->customexitsound); + S_PlaySound(p->customexitsound); FTA(102, p); } } diff --git a/source/games/duke/src/player_d.cpp b/source/games/duke/src/player_d.cpp index ca6f6af4d..34efd56bd 100644 --- a/source/games/duke/src/player_d.cpp +++ b/source/games/duke/src/player_d.cpp @@ -364,7 +364,7 @@ void shoot_d(int i, int atwith) { k = fi.spawn(j, SMALLSMOKE); sprite[k].z -= (8 << 8); - spritesound(KICK_HIT, j); + S_PlayActorSound(KICK_HIT, j); } if (p >= 0 && ps[p].steroids_amount > 0 && ps[p].steroids_amount < 400) @@ -767,7 +767,7 @@ void shoot_d(int i, int atwith) } else zvel = (100 - ps[p].gethorizsum()) * 81; if (atwith == RPG) - spritesound(RPG_SHOOT, i); + S_PlayActorSound(RPG_SHOOT, i); } else @@ -934,7 +934,7 @@ void shoot_d(int i, int atwith) } sprite[k].hitag = k; - spritesound(LASERTRIP_ONWALL, k); + S_PlayActorSound(LASERTRIP_ONWALL, k); sprite[k].xvel = -20; ssp(k, CLIPMASK0); sprite[k].cstat = 16; @@ -1334,9 +1334,9 @@ int doincrements_d(struct player_struct* p) if (p->last_pissed_time == (26 * 219)) { - spritesound(FLUSH_TOILET, p->i); + S_PlayActorSound(FLUSH_TOILET, p->i); if (snum == screenpeek || ud.coop == 1) - spritesound(DUKE_PISSRELIEF, p->i); + S_PlayActorSound(DUKE_PISSRELIEF, p->i); } if (p->last_pissed_time == (26 * 218)) @@ -1363,7 +1363,7 @@ int doincrements_d(struct player_struct* p) checkavailinven(p); if (!(p->steroids_amount & 7)) if (snum == screenpeek || ud.coop == 1) - spritesound(DUKE_HARTBEAT, p->i); + S_PlayActorSound(DUKE_HARTBEAT, p->i); } if (p->heat_on && p->heat_amount > 0) @@ -1373,7 +1373,7 @@ int doincrements_d(struct player_struct* p) { p->heat_on = 0; checkavailinven(p); - spritesound(NITEVISION_ONOFF, p->i); + S_PlayActorSound(NITEVISION_ONOFF, p->i); setpal(p); } } @@ -1383,7 +1383,7 @@ int doincrements_d(struct player_struct* p) p->holoduke_amount--; if (p->holoduke_amount <= 0) { - spritesound(TELEPORTER, p->i); + S_PlayActorSound(TELEPORTER, p->i); p->holoduke_on = -1; checkavailinven(p); } @@ -1396,9 +1396,9 @@ int doincrements_d(struct player_struct* p) { p->jetpack_on = 0; checkavailinven(p); - spritesound(DUKE_JETPACK_OFF, p->i); - S_StopEnvSound(DUKE_JETPACK_IDLE, p->i); - S_StopEnvSound(DUKE_JETPACK_ON, p->i); + S_PlayActorSound(DUKE_JETPACK_OFF, p->i); + S_StopSound(DUKE_JETPACK_IDLE, p->i); + S_StopSound(DUKE_JETPACK_ON, p->i); } } @@ -1463,7 +1463,7 @@ int doincrements_d(struct player_struct* p) { p->extra_extra8 += 32; if (p->last_extra < (max_player_health >> 1) && (p->last_extra & 3) == 0) - spritesound(DUKE_LONGTERM_PAIN, p->i); + S_PlayActorSound(DUKE_LONGTERM_PAIN, p->i); } } } @@ -1486,10 +1486,10 @@ int doincrements_d(struct player_struct* p) if (snum == screenpeek || ud.coop == 1) { if (rand() & 1) - spritesound(DUKE_CRACK, p->i); - else spritesound(DUKE_CRACK2, p->i); + S_PlayActorSound(DUKE_CRACK, p->i); + else S_PlayActorSound(DUKE_CRACK2, p->i); } - spritesound(DUKE_CRACK_FIRST, p->i); + S_PlayActorSound(DUKE_CRACK_FIRST, p->i); } else if (p->knuckle_incs == 22 || PlayerInput(snum, SKB_FIRE)) p->knuckle_incs = 0; @@ -1564,8 +1564,8 @@ static void operateJetpack(int snum, ESyncBits sb_snum, int psectlotag, int fz, p->jetpack_on++; p->posz -= (p->jetpack_on << 7); //Goin up } - else if (p->jetpack_on == 11 && !A_CheckSoundPlaying(pi, DUKE_JETPACK_IDLE)) - spritesound(DUKE_JETPACK_IDLE, pi); + else if (p->jetpack_on == 11 && !S_CheckActorSoundPlaying(pi, DUKE_JETPACK_IDLE)) + S_PlayActorSound(DUKE_JETPACK_IDLE, pi); if (shrunk) j = 512; else j = 2048; @@ -1677,7 +1677,7 @@ static void movement(int snum, ESyncBits sb_snum, int psect, int fz, int cz, int { p->falling_counter++; if (p->falling_counter == 38) - p->scream_voice = spritesound(DUKE_SCREAM, pi); + p->scream_voice = S_PlayActorSound(DUKE_SCREAM, pi); } if ((p->posz + p->poszv) >= (fz - (i << 8))) // hit the ground @@ -1691,18 +1691,18 @@ static void movement(int snum, ESyncBits sb_snum, int psect, int fz, int cz, int sprite[pi].extra -= j - (krand() & 3); if (sprite[pi].extra <= 0) { - spritesound(SQUISHED, pi); + S_PlayActorSound(SQUISHED, pi); SetPlayerPal(p, PalEntry(63, 63, 0, 0)); } else { - spritesound(DUKE_LAND, pi); - spritesound(DUKE_LAND_HURT, pi); + S_PlayActorSound(DUKE_LAND, pi); + S_PlayActorSound(DUKE_LAND_HURT, pi); } SetPlayerPal(p, PalEntry(32, 16, 0, 0)); } - else if (p->poszv > 2048) spritesound(DUKE_LAND, pi); + else if (p->poszv > 2048) S_PlayActorSound(DUKE_LAND, pi); } } } @@ -1710,7 +1710,7 @@ static void movement(int snum, ESyncBits sb_snum, int psect, int fz, int cz, int else { p->falling_counter = 0; - S_StopEnvSound(-1, pi, CHAN_VOICE); + S_StopSound(-1, pi, CHAN_VOICE); if (psectlotag != 1 && psectlotag != 2 && p->on_ground == 0 && p->poszv > (6144 >> 1)) p->hard_landing = p->poszv >> 10; @@ -1815,8 +1815,8 @@ static void underwater(int snum, ESyncBits sb_snum, int psect, int fz, int cz) p->pycount &= 2047; p->pyoff = sintable[p->pycount] >> 7; - if (!A_CheckSoundPlaying(pi, DUKE_UNDERWATER)) - A_PlaySound(DUKE_UNDERWATER, pi); + if (!S_CheckActorSoundPlaying(pi, DUKE_UNDERWATER)) + S_PlayActorSound(DUKE_UNDERWATER, pi); if (sb_snum & SKB_JUMP) { @@ -1993,13 +1993,13 @@ static void fireweapon(int snum) if (p->ammo_amount[GROW_WEAPON] > 0) { p->kickback_pic = 1; - spritesound(EXPANDERSHOOT, pi); + S_PlayActorSound(EXPANDERSHOOT, pi); } } else if (p->ammo_amount[SHRINKER_WEAPON] > 0) { p->kickback_pic = 1; - spritesound(SHRINKER_FIRE, pi); + S_PlayActorSound(SHRINKER_FIRE, pi); } break; @@ -2007,7 +2007,7 @@ static void fireweapon(int snum) if (p->ammo_amount[FREEZE_WEAPON] > 0) { p->kickback_pic = 1; - spritesound(CAT_FIRE, pi); + S_PlayActorSound(CAT_FIRE, pi); } break; case DEVISTATOR_WEAPON: @@ -2015,7 +2015,7 @@ static void fireweapon(int snum) { p->kickback_pic = 1; p->hbomb_hold_delay = !p->hbomb_hold_delay; - spritesound(CAT_FIRE, pi); + S_PlayActorSound(CAT_FIRE, pi); } break; @@ -2031,7 +2031,7 @@ static void fireweapon(int snum) { p->kickback_pic = 1; if (sector[p->cursectnum].lotag != 2) - spritesound(FLAMETHROWER_INTRO, pi); + S_PlayActorSound(FLAMETHROWER_INTRO, pi); } break; @@ -2153,7 +2153,7 @@ static void operateweapon(int snum, ESyncBits sb_snum, int psect) if (p->kickback_pic == 1) { fi.shoot(pi, SHOTSPARK1); - spritesound(PISTOL_FIRE, pi); + S_PlayActorSound(PISTOL_FIRE, pi); lastvisinc = (int)totalclock + 32; p->visibility = 0; } @@ -2175,14 +2175,14 @@ static void operateweapon(int snum, ESyncBits sb_snum, int psect) switch (p->kickback_pic) { case 5: - spritesound(EJECT_CLIP, pi); + S_PlayActorSound(EJECT_CLIP, pi); break; //#ifdef NAM // case WEAPON2_RELOAD_TIME - 15: //#else case 8: //#endif - spritesound(INSERT_CLIP, pi); + S_PlayActorSound(INSERT_CLIP, pi); break; } } @@ -2211,7 +2211,7 @@ static void operateweapon(int snum, ESyncBits sb_snum, int psect) fi.shoot(pi, SHOTGUN); p->ammo_amount[SHOTGUN_WEAPON]--; - spritesound(SHOTGUN_FIRE, pi); + S_PlayActorSound(SHOTGUN_FIRE, pi); lastvisinc = (int)totalclock + 32; p->visibility = 0; @@ -2224,7 +2224,7 @@ static void operateweapon(int snum, ESyncBits sb_snum, int psect) checkavailweapon(p); break; case 15: - spritesound(SHOTGUN_COCK, pi); + S_PlayActorSound(SHOTGUN_COCK, pi); break; case 17: case 20: @@ -2264,7 +2264,7 @@ static void operateweapon(int snum, ESyncBits sb_snum, int psect) ssp(j, CLIPMASK0); } - spritesound(CHAINGUN_FIRE, pi); + S_PlayActorSound(CHAINGUN_FIRE, pi); fi.shoot(pi, CHAINGUN); lastvisinc = (int)totalclock + 32; p->visibility = 0; @@ -2413,7 +2413,7 @@ static void operateweapon(int snum, ESyncBits sb_snum, int psect) if (sb_snum & SKB_FIRE) { p->kickback_pic = 1; - spritesound(CAT_FIRE, pi); + S_PlayActorSound(CAT_FIRE, pi); } else p->kickback_pic = 0; } @@ -2439,7 +2439,7 @@ static void operateweapon(int snum, ESyncBits sb_snum, int psect) if ((sb_snum & SKB_FIRE) != 0) { p->kickback_pic = 1; - spritesound(FLAMETHROWER_INTRO, pi); + S_PlayActorSound(FLAMETHROWER_INTRO, pi); } else p->kickback_pic = 0; @@ -2611,7 +2611,7 @@ void processinput_d(int snum) if (s->extra > 0 && ud.clipping == 0) { quickkill(p); - spritesound(SQUISHED, pi); + S_PlayActorSound(SQUISHED, pi); } psect = 0; } @@ -2824,8 +2824,8 @@ void processinput_d(int snum) } else { - if (!A_CheckSoundPlaying(p->i, DUKE_LONGTERM_PAIN)) - A_PlaySound(DUKE_LONGTERM_PAIN, p->i); + if (!S_CheckActorSoundPlaying(p->i, DUKE_LONGTERM_PAIN)) + S_PlayActorSound(DUKE_LONGTERM_PAIN, p->i); SetPlayerPal(p, PalEntry(32, 0, 8, 0)); s->extra--; } @@ -2870,14 +2870,14 @@ void processinput_d(int snum) { case PANNEL1: case PANNEL2: - spritesound(DUKE_WALKINDUCTS, pi); + S_PlayActorSound(DUKE_WALKINDUCTS, pi); p->walking_snd_toggle = 1; break; } break; case 1: if ((krand() & 1) == 0) - spritesound(DUKE_ONWATER, pi); + S_PlayActorSound(DUKE_ONWATER, pi); p->walking_snd_toggle = 1; break; } @@ -2987,8 +2987,8 @@ HORIZONLY: } if (truefdist < PHEIGHT && p->on_ground && psectlotag != 1 && shrunk == 0 && sector[p->cursectnum].lotag == 1) - if (!A_CheckSoundPlaying(pi, DUKE_ONWATER)) - spritesound(DUKE_ONWATER, pi); + if (!S_CheckActorSoundPlaying(pi, DUKE_ONWATER)) + S_PlayActorSound(DUKE_ONWATER, pi); if (p->cursectnum != s->sectnum) changespritesect(pi, p->cursectnum); diff --git a/source/games/duke/src/player_r.cpp b/source/games/duke/src/player_r.cpp index ad0450306..80409b05d 100644 --- a/source/games/duke/src/player_r.cpp +++ b/source/games/duke/src/player_r.cpp @@ -262,9 +262,9 @@ void shoot_r(int i, int atwith) k = fi.spawn(j, SMALLSMOKE); sprite[k].z -= (8 << 8); if (atwith == KNEE) - spritesound(KICK_HIT, j); + S_PlayActorSound(KICK_HIT, j); else if (isRRRA() && atwith == SLINGBLADE) - spritesound(260, j); + S_PlayActorSound(260, j); } if (p >= 0 && ps[p].steroids_amount > 0 && ps[p].steroids_amount < 400) @@ -798,13 +798,13 @@ void shoot_r(int i, int atwith) } else zvel = (100 - ps[p].gethorizsum()) * 81; if (atwith == RPG) - spritesound(RPG_SHOOT, i); + S_PlayActorSound(RPG_SHOOT, i); else if (isRRRA()) { if (atwith == RPG2) - spritesound(244, i); + S_PlayActorSound(244, i); else if (atwith == RRTILE1790) - spritesound(94, i); + S_PlayActorSound(94, i); } } @@ -1074,7 +1074,7 @@ void selectweapon_r(int snum, int j) case SLINGBLADE_WEAPON: if (isRRRA()) { - spritesound(496, ps[screenpeek].i); + S_PlayActorSound(496, ps[screenpeek].i); fi.addweapon(p, j); } break; @@ -1205,8 +1205,8 @@ int doincrements_r(struct player_struct* p) } if (p->drink_amt >= 100) { - if (!A_CheckSoundPlaying(p->i, 420)) - spritesound(420, p->i); + if (!S_CheckActorSoundPlaying(p->i, 420)) + S_PlayActorSound(420, p->i); p->drink_amt -= 9; p->eat >>= 1; } @@ -1220,16 +1220,16 @@ int doincrements_r(struct player_struct* p) switch (krand() & 3) { case 0: - spritesound(404, p->i); + S_PlayActorSound(404, p->i); break; case 1: - spritesound(422, p->i); + S_PlayActorSound(422, p->i); break; case 2: - spritesound(423, p->i); + S_PlayActorSound(423, p->i); break; case 3: - spritesound(424, p->i); + S_PlayActorSound(424, p->i); break; } if (numplayers < 2) @@ -1259,17 +1259,17 @@ int doincrements_r(struct player_struct* p) if (adult_lockout == 0) { if (p->last_pissed_time == 5662) - spritesound(434, p->i); + S_PlayActorSound(434, p->i); else if (p->last_pissed_time == 5567) - spritesound(434, p->i); + S_PlayActorSound(434, p->i); else if (p->last_pissed_time == 5472) - spritesound(433, p->i); + S_PlayActorSound(433, p->i); else if (p->last_pissed_time == 5072) - spritesound(435, p->i); + S_PlayActorSound(435, p->i); else if (p->last_pissed_time == 5014) - spritesound(434, p->i); + S_PlayActorSound(434, p->i); else if (p->last_pissed_time == 4919) - spritesound(433, p->i); + S_PlayActorSound(433, p->i); } if (p->last_pissed_time == 5668) @@ -1300,7 +1300,7 @@ int doincrements_r(struct player_struct* p) } if (!(p->steroids_amount & 14)) if (snum == screenpeek || ud.coop == 1) - spritesound(DUKE_TAKEPILLS, p->i); + S_PlayActorSound(DUKE_TAKEPILLS, p->i); } if (p->access_incs && sprite[p->i].pal != 1) @@ -1357,7 +1357,7 @@ int doincrements_r(struct player_struct* p) { p->extra_extra8 += 32; if (p->last_extra < (max_player_health >> 1) && (p->last_extra & 3) == 0) - spritesound(DUKE_LONGTERM_PAIN, p->i); + S_PlayActorSound(DUKE_LONGTERM_PAIN, p->i); } } } @@ -1398,14 +1398,14 @@ int doincrements_r(struct player_struct* p) case levelnum(1, 5): snd = 255; break; case levelnum(1, 6): snd = 283; break; } - spritesound(snd, p->i); + S_PlayActorSound(snd, p->i); } else if (totalclock > 1024) if (snum == screenpeek || ud.coop == 1) { if (rand() & 1) - spritesound(DUKE_CRACK, p->i); - else spritesound(DUKE_CRACK2, p->i); + S_PlayActorSound(DUKE_CRACK, p->i); + else S_PlayActorSound(DUKE_CRACK2, p->i); } } else if (p->knuckle_incs == 22 || PlayerInput(snum, SKB_FIRE)) @@ -1536,42 +1536,42 @@ static void onMotorcycle(int snum, ESyncBits &sb_snum) { if (p->MotoSpeed == 0 && var64) { - if (!A_CheckSoundPlaying(pi, 187)) - spritesound(187, pi); + if (!S_CheckActorSoundPlaying(pi, 187)) + S_PlayActorSound(187, pi); } - else if (p->MotoSpeed == 0 && !A_CheckSoundPlaying(pi, 214)) + else if (p->MotoSpeed == 0 && !S_CheckActorSoundPlaying(pi, 214)) { - if (A_CheckSoundPlaying(pi, 187)) - S_StopEnvSound(187, pi); - spritesound(214, pi); + if (S_CheckActorSoundPlaying(pi, 187)) + S_StopSound(187, pi); + S_PlayActorSound(214, pi); } - else if (p->MotoSpeed >= 50 && !A_CheckSoundPlaying(pi, 188)) + else if (p->MotoSpeed >= 50 && !S_CheckActorSoundPlaying(pi, 188)) { - A_PlaySound(188, pi); + S_PlayActorSound(188, pi); } - else if (!A_CheckSoundPlaying(pi, 188) && !A_CheckSoundPlaying(pi, 214)) + else if (!S_CheckActorSoundPlaying(pi, 188) && !S_CheckActorSoundPlaying(pi, 214)) { - A_PlaySound(188, pi); + S_PlayActorSound(188, pi); } } } else { var68 = 0; - if (A_CheckSoundPlaying(pi, 214)) + if (S_CheckActorSoundPlaying(pi, 214)) { - S_StopEnvSound(214, pi); - if (!A_CheckSoundPlaying(pi, 189)) - A_PlaySound(189, pi); + S_StopSound(214, pi); + if (!S_CheckActorSoundPlaying(pi, 189)) + S_PlayActorSound(189, pi); } - if (A_CheckSoundPlaying(pi, 188)) + if (S_CheckActorSoundPlaying(pi, 188)) { - S_StopEnvSound(188, pi); - if (!A_CheckSoundPlaying(pi, 189)) - A_PlaySound(189, pi); + S_StopSound(188, pi); + if (!S_CheckActorSoundPlaying(pi, 189)) + S_PlayActorSound(189, pi); } - if (!A_CheckSoundPlaying(pi, 189) && !A_CheckSoundPlaying(pi, 187)) - A_PlaySound(187, pi); + if (!S_CheckActorSoundPlaying(pi, 189) && !S_CheckActorSoundPlaying(pi, 187)) + S_PlayActorSound(187, pi); } if (sb_snum & SKB_AIM_UP) { @@ -1761,8 +1761,8 @@ static void onMotorcycle(int snum, ESyncBits &sb_snum) p->posxv += (var8c >> 5) * (sintable[(var94 * -51 + var90 + 512) & 2047] << 4); p->posyv += (var8c >> 5) * (sintable[(var94 * -51 + var90) & 2047] << 4); p->setang((var90 - (var98 >> 4)) & 2047); - if (!A_CheckSoundPlaying(pi, 220)) - A_PlaySound(220, pi); + if (!S_CheckActorSoundPlaying(pi, 220)) + S_PlayActorSound(220, pi); } else { @@ -1811,13 +1811,13 @@ static void onBoat(int snum, ESyncBits& sb_snum) { if (p->MotoSpeed > 0) { - if (!A_CheckSoundPlaying(pi, 88)) - A_PlaySound(88, pi); + if (!S_CheckActorSoundPlaying(pi, 88)) + S_PlayActorSound(88, pi); } else { - if (!A_CheckSoundPlaying(pi, 87)) - A_PlaySound(87, pi); + if (!S_CheckActorSoundPlaying(pi, 87)) + S_PlayActorSound(87, pi); } } if (p->MotoSpeed < 0) @@ -1835,34 +1835,34 @@ static void onBoat(int snum, ESyncBits& sb_snum) { varac = 1; sb_snum &= ~SKB_JUMP; - if (p->MotoSpeed == 0 && !A_CheckSoundPlaying(pi, 89)) + if (p->MotoSpeed == 0 && !S_CheckActorSoundPlaying(pi, 89)) { - if (A_CheckSoundPlaying(pi, 87)) - S_StopEnvSound(pi, 87); - A_PlaySound(89, pi); + if (S_CheckActorSoundPlaying(pi, 87)) + S_StopSound(pi, 87); + S_PlayActorSound(89, pi); } - else if (p->MotoSpeed >= 50 && !A_CheckSoundPlaying(pi, 88)) - A_PlaySound(88, pi); - else if (!A_CheckSoundPlaying(pi, 88) && !A_CheckSoundPlaying(pi, 89)) - A_PlaySound(88, pi); + else if (p->MotoSpeed >= 50 && !S_CheckActorSoundPlaying(pi, 88)) + S_PlayActorSound(88, pi); + else if (!S_CheckActorSoundPlaying(pi, 88) && !S_CheckActorSoundPlaying(pi, 89)) + S_PlayActorSound(88, pi); } else { varac = 0; - if (A_CheckSoundPlaying(pi, 89)) + if (S_CheckActorSoundPlaying(pi, 89)) { - S_StopEnvSound(pi, 89); - if (!A_CheckSoundPlaying(pi, 90)) - A_PlaySound(90, pi); + S_StopSound(pi, 89); + if (!S_CheckActorSoundPlaying(pi, 90)) + S_PlayActorSound(90, pi); } - if (A_CheckSoundPlaying(pi, 88)) + if (S_CheckActorSoundPlaying(pi, 88)) { - S_StopEnvSound(pi, 88); - if (!A_CheckSoundPlaying(pi, 90)) - A_PlaySound(90, pi); + S_StopSound(pi, 88); + if (!S_CheckActorSoundPlaying(pi, 90)) + S_PlayActorSound(90, pi); } - if (!A_CheckSoundPlaying(pi, 90) && !A_CheckSoundPlaying(pi, 87)) - A_PlaySound(87, pi); + if (!S_CheckActorSoundPlaying(pi, 90) && !S_CheckActorSoundPlaying(pi, 87)) + S_PlayActorSound(87, pi); } if (sb_snum & SKB_CROUCH) @@ -1883,8 +1883,8 @@ static void onBoat(int snum, ESyncBits& sb_snum) varb8 = 1; varbc = 1; sb_snum &= ~SKB_AIM_DOWN; - if (!A_CheckSoundPlaying(pi, 91) && p->MotoSpeed > 30 && !p->NotOnWater) - A_PlaySound(91, pi); + if (!S_CheckActorSoundPlaying(pi, 91) && p->MotoSpeed > 30 && !p->NotOnWater) + S_PlayActorSound(91, pi); } else { @@ -1896,8 +1896,8 @@ static void onBoat(int snum, ESyncBits& sb_snum) varc0 = 1; varc4 = 1; sb_snum &= ~SKB_LOOK_LEFT; - if (!A_CheckSoundPlaying(pi, 91) && p->MotoSpeed > 30 && !p->NotOnWater) - A_PlaySound(91, pi); + if (!S_CheckActorSoundPlaying(pi, 91) && p->MotoSpeed > 30 && !p->NotOnWater) + S_PlayActorSound(91, pi); } else { @@ -1931,8 +1931,8 @@ static void onBoat(int snum, ESyncBits& sb_snum) if (p->MotoSpeed <= 25) { p->MotoSpeed++; - if (!A_CheckSoundPlaying(pi, 182)) - A_PlaySound(182, pi); + if (!S_CheckActorSoundPlaying(pi, 182)) + S_PlayActorSound(182, pi); } else { @@ -2152,15 +2152,15 @@ static void movement(int snum, ESyncBits sb_snum, int psect, int fz, int cz, int p->moto_bump_fast = 1; p->poszv -= gc * (p->MotoSpeed >> 4); p->MotoOnGround = 0; - if (A_CheckSoundPlaying(pi, 188)) - S_StopEnvSound(188, pi); - spritesound(189, pi); + if (S_CheckActorSoundPlaying(pi, 188)) + S_StopSound(188, pi); + S_PlayActorSound(189, pi); } else { p->poszv += gc - 80 + (120 - p->MotoSpeed); - if (!A_CheckSoundPlaying(pi, 189) && !A_CheckSoundPlaying(pi, 190)) - A_PlaySound(190, pi); + if (!S_CheckActorSoundPlaying(pi, 189) && !S_CheckActorSoundPlaying(pi, 190)) + S_PlayActorSound(190, pi); } } else @@ -2171,7 +2171,7 @@ static void movement(int snum, ESyncBits sb_snum, int psect, int fz, int cz, int { p->falling_counter++; if (p->falling_counter == 38) - p->scream_voice = spritesound(DUKE_SCREAM, pi); + p->scream_voice = S_PlayActorSound(DUKE_SCREAM, pi); } if ((p->posz + p->poszv) >= (fz - (i << 8))) // hit the ground @@ -2187,12 +2187,12 @@ static void movement(int snum, ESyncBits sb_snum, int psect, int fz, int cz, int s->extra -= j - (krand() & 3); if (s->extra <= 0) { - spritesound(SQUISHED, pi); + S_PlayActorSound(SQUISHED, pi); } else { - spritesound(DUKE_LAND, pi); - spritesound(DUKE_LAND_HURT, pi); + S_PlayActorSound(DUKE_LAND, pi); + S_PlayActorSound(DUKE_LAND_HURT, pi); } SetPlayerPal(p, PalEntry(32, 16, 0, 0)); @@ -2201,16 +2201,16 @@ static void movement(int snum, ESyncBits sb_snum, int psect, int fz, int cz, int { if (p->OnMotorcycle) { - if (A_CheckSoundPlaying(pi, 190)) - S_StopEnvSound(pi, 190); - spritesound(191, pi); + if (S_CheckActorSoundPlaying(pi, 190)) + S_StopSound(pi, 190); + S_PlayActorSound(191, pi); p->TurbCount = 12; } - else spritesound(DUKE_LAND, pi); + else S_PlayActorSound(DUKE_LAND, pi); } else if (p->poszv > 1024 && p->OnMotorcycle) { - spritesound(DUKE_LAND, pi); + S_PlayActorSound(DUKE_LAND, pi); p->TurbCount = 12; } } @@ -2220,7 +2220,7 @@ static void movement(int snum, ESyncBits sb_snum, int psect, int fz, int cz, int else { p->falling_counter = 0; - S_StopEnvSound(-1, pi, CHAN_VOICE); + S_StopSound(-1, pi, CHAN_VOICE); if (psectlotag != ST_1_ABOVE_WATER && psectlotag != ST_2_UNDERWATER && p->on_ground == 0 && p->poszv > (6144 >> 1)) p->hard_landing = p->poszv >> 10; @@ -2320,8 +2320,8 @@ static void underwater(int snum, ESyncBits sb_snum, int psect, int fz, int cz) p->pycount &= 2047; p->pyoff = sintable[p->pycount] >> 7; - if (!A_CheckSoundPlaying(pi, DUKE_UNDERWATER)) - A_PlaySound(DUKE_UNDERWATER, pi); + if (!S_CheckActorSoundPlaying(pi, DUKE_UNDERWATER)) + S_PlayActorSound(DUKE_UNDERWATER, pi); if ((sb_snum & SKB_JUMP) && !p->OnMotorcycle) { @@ -2410,38 +2410,38 @@ void onMotorcycleMove(int snum, int psect, int j) { var104 = (p->MotoSpeed * p->MotoSpeed) >> 8; p->MotoSpeed = 0; - if (A_CheckSoundPlaying(pi, 238) == 0) - A_PlaySound(238, pi); + if (S_CheckActorSoundPlaying(pi, 238) == 0) + S_PlayActorSound(238, pi); } else if (var10c >= 311 && var10c <= 711) { var104 = (p->MotoSpeed * p->MotoSpeed) >> 11; p->MotoSpeed -= (p->MotoSpeed >> 1) + (p->MotoSpeed >> 2); - if (A_CheckSoundPlaying(pi, 238) == 0) - A_PlaySound(238, pi); + if (S_CheckActorSoundPlaying(pi, 238) == 0) + S_PlayActorSound(238, pi); } else if (var10c >= 111 && var10c <= 911) { var104 = (p->MotoSpeed * p->MotoSpeed) >> 14; p->MotoSpeed -= (p->MotoSpeed >> 1); - if (A_CheckSoundPlaying(pi, 239) == 0) - A_PlaySound(239, pi); + if (S_CheckActorSoundPlaying(pi, 239) == 0) + S_PlayActorSound(239, pi); } else { var104 = (p->MotoSpeed * p->MotoSpeed) >> 15; p->MotoSpeed -= (p->MotoSpeed >> 3); - if (A_CheckSoundPlaying(pi, 240) == 0) - A_PlaySound(240, pi); + if (S_CheckActorSoundPlaying(pi, 240) == 0) + S_PlayActorSound(240, pi); } s->extra -= var104; if (s->extra <= 0) { - spritesound(SQUISHED, pi); + S_PlayActorSound(SQUISHED, pi); SetPlayerPal(p, PalEntry(63, 63, 0, 0)); } else if (var104) - spritesound(DUKE_LAND_HURT, pi); + S_PlayActorSound(DUKE_LAND_HURT, pi); } @@ -2475,29 +2475,29 @@ void onBoatMove(int snum, int psect, int j) { p->MotoSpeed = ((p->MotoSpeed >> 1) + (p->MotoSpeed >> 2)) >> 2; if (psectlotag == 1) - if (A_CheckSoundPlaying(pi, 178) == 0) - A_PlaySound(178, pi); + if (S_CheckActorSoundPlaying(pi, 178) == 0) + S_PlayActorSound(178, pi); } else if (var118 >= 311 && var118 <= 711) { p->MotoSpeed -= ((p->MotoSpeed >> 1) + (p->MotoSpeed >> 2)) >> 3; if (psectlotag == 1) - if (A_CheckSoundPlaying(pi, 179) == 0) - A_PlaySound(179, pi); + if (S_CheckActorSoundPlaying(pi, 179) == 0) + S_PlayActorSound(179, pi); } else if (var118 >= 111 && var118 <= 911) { p->MotoSpeed -= (p->MotoSpeed >> 4); if (psectlotag == 1) - if (A_CheckSoundPlaying(pi, 180) == 0) - A_PlaySound(180, pi); + if (S_CheckActorSoundPlaying(pi, 180) == 0) + S_PlayActorSound(180, pi); } else { p->MotoSpeed -= (p->MotoSpeed >> 6); if (psectlotag == 1) - if (A_CheckSoundPlaying(pi, 181) == 0) - A_PlaySound(181, pi); + if (S_CheckActorSoundPlaying(pi, 181) == 0) + S_PlayActorSound(181, pi); } } @@ -2532,7 +2532,7 @@ void onMotorcycleHit(int snum, int var60) else if ((sprite[var60].picnum == RRTILE2431 || sprite[var60].picnum == RRTILE2443 || sprite[var60].picnum == RRTILE2451 || sprite[var60].picnum == RRTILE2455) && sprite[var60].picnum != ACTIVATORLOCKED && p->MotoSpeed > 45) { - spritesound(SQUISHED, var60); + S_PlayActorSound(SQUISHED, var60); if (sprite[var60].picnum == RRTILE2431 || sprite[var60].picnum == RRTILE2451) { if (sprite[var60].lotag != 0) @@ -2659,13 +2659,13 @@ static void fireweapon(int snum) if (p->ammo_amount[BUZZSAW_WEAPON] > 0) { p->kickback_pic = 1; - spritesound(431, pi); + S_PlayActorSound(431, pi); } } else if (p->ammo_amount[THROWSAW_WEAPON] > 0) { p->kickback_pic = 1; - spritesound(SHRINKER_FIRE, pi); + S_PlayActorSound(SHRINKER_FIRE, pi); } break; @@ -2740,7 +2740,7 @@ static void operateweapon(int snum, ESyncBits sb_snum, int psect) case DYNAMITE_WEAPON: if (p->kickback_pic == 1) - sound(401); + S_PlaySound(401); if (p->kickback_pic == 6 && (sb_snum & SKB_FIRE)) p->rapid_fire_hold = 1; p->kickback_pic++; @@ -2752,7 +2752,7 @@ static void operateweapon(int snum, ESyncBits sb_snum, int psect) p->weapon_pos = 10; p->detonate_time = 45; p->detonate_count = 1; - sound(402); + S_PlaySound(402); } break; @@ -2834,7 +2834,7 @@ static void operateweapon(int snum, ESyncBits sb_snum, int psect) if (p->kickback_pic == 1) { fi.shoot(pi, SHOTSPARK1); - spritesound(PISTOL_FIRE, pi); + S_PlayActorSound(PISTOL_FIRE, pi); p->noise_radius = 8192; madenoise(snum); @@ -2868,10 +2868,10 @@ static void operateweapon(int snum, ESyncBits sb_snum, int psect) switch (p->kickback_pic) { case 24: - spritesound(EJECT_CLIP, pi); + S_PlayActorSound(EJECT_CLIP, pi); break; case 30: - spritesound(INSERT_CLIP, pi); + S_PlayActorSound(INSERT_CLIP, pi); break; } } @@ -2912,7 +2912,7 @@ static void operateweapon(int snum, ESyncBits sb_snum, int psect) p->ammo_amount[SHOTGUN_WEAPON]--; - spritesound(SHOTGUN_FIRE, pi); + S_PlayActorSound(SHOTGUN_FIRE, pi); p->noise_radius = 8192; madenoise(snum); @@ -2938,7 +2938,7 @@ static void operateweapon(int snum, ESyncBits sb_snum, int psect) p->ammo_amount[SHOTGUN_WEAPON]--; - spritesound(SHOTGUN_FIRE, pi); + S_PlayActorSound(SHOTGUN_FIRE, pi); if (psectlotag != 857) { @@ -2961,7 +2961,7 @@ static void operateweapon(int snum, ESyncBits sb_snum, int psect) checkavailweapon(p); break; case 17: - spritesound(SHOTGUN_COCK, pi); + S_PlayActorSound(SHOTGUN_COCK, pi); break; case 28: p->kickback_pic = 0; @@ -2978,7 +2978,7 @@ static void operateweapon(int snum, ESyncBits sb_snum, int psect) checkavailweapon(p); break; case 27: - spritesound(SHOTGUN_COCK, pi); + S_PlayActorSound(SHOTGUN_COCK, pi); break; case 38: p->kickback_pic = 0; @@ -3024,7 +3024,7 @@ static void operateweapon(int snum, ESyncBits sb_snum, int psect) ssp(j, CLIPMASK0); } - spritesound(CHAINGUN_FIRE, pi); + S_PlayActorSound(CHAINGUN_FIRE, pi); fi.shoot(pi, CHAINGUN); p->noise_radius = 8192; madenoise(snum); @@ -3085,7 +3085,7 @@ static void operateweapon(int snum, ESyncBits sb_snum, int psect) { p->visibility = 0; lastvisinc = (int)totalclock + 32; - spritesound(CHAINGUN_FIRE, pi); + S_PlayActorSound(CHAINGUN_FIRE, pi); fi.shoot(pi, SHOTSPARK1); p->noise_radius = 16384; madenoise(snum); @@ -3112,7 +3112,7 @@ static void operateweapon(int snum, ESyncBits sb_snum, int psect) { p->visibility = 0; lastvisinc = (int)totalclock + 32; - spritesound(CHAINGUN_FIRE, pi); + S_PlayActorSound(CHAINGUN_FIRE, pi); fi.shoot(pi, CHAINGUN); p->noise_radius = 16384; madenoise(snum); @@ -3161,7 +3161,7 @@ static void operateweapon(int snum, ESyncBits sb_snum, int psect) if (p->kickback_pic == 5) { - spritesound(CAT_FIRE, pi); + S_PlayActorSound(CAT_FIRE, pi); p->noise_radius = 2048; madenoise(snum); } @@ -3217,7 +3217,7 @@ static void operateweapon(int snum, ESyncBits sb_snum, int psect) if (p->kickback_pic == 30) { p->ammo_amount[BOWLING_WEAPON]--; - spritesound(354, pi); + S_PlayActorSound(354, pi); fi.shoot(pi, BOWLINGBALL); p->noise_radius = 1024; madenoise(snum); @@ -3239,7 +3239,7 @@ static void operateweapon(int snum, ESyncBits sb_snum, int psect) case KNEE_WEAPON: p->kickback_pic++; if (p->kickback_pic == 3) - spritesound(426, pi); + S_PlayActorSound(426, pi); if (p->kickback_pic == 12) { fi.shoot(pi, KNEE); @@ -3257,7 +3257,7 @@ static void operateweapon(int snum, ESyncBits sb_snum, int psect) case SLINGBLADE_WEAPON: p->kickback_pic++; if (p->kickback_pic == 3) - spritesound(252, pi); + S_PlayActorSound(252, pi); if (p->kickback_pic == 8) { fi.shoot(pi, SLINGBLADE); @@ -3286,7 +3286,7 @@ static void operateweapon(int snum, ESyncBits sb_snum, int psect) checkavailweapon(p); } else if (p->kickback_pic == 16) - spritesound(450, pi); + S_PlayActorSound(450, pi); else if (p->kickback_pic == 34) p->kickback_pic = 0; break; @@ -3304,7 +3304,7 @@ static void operateweapon(int snum, ESyncBits sb_snum, int psect) checkavailweapon(p); } else if (p->kickback_pic == 16) - spritesound(450, pi); + S_PlayActorSound(450, pi); else if (p->kickback_pic == 34) p->kickback_pic = 0; break; @@ -3340,7 +3340,7 @@ static void processweapon(int snum, ESyncBits sb_snum, int psect) } else if (p->detonate_time <= 0 && p->kickback_pic < 5) { - sound(14); + S_PlaySound(14); quickkill(p); } } @@ -3416,7 +3416,7 @@ void processinput_r(int snum) if (s->extra > 0 && ud.clipping == 0) { quickkill(p); - spritesound(SQUISHED, pi); + S_PlayActorSound(SQUISHED, pi); } psect = 0; } @@ -3558,7 +3558,7 @@ void processinput_r(int snum) if ((sb_snum & SKB_CROUCH) && !p->OnMotorcycle) //if (Sound[436].num == 0) { - spritesound(436, p->i); + S_PlayActorSound(436, p->i); p->last_pissed_time = 4000; p->eat = 0; } @@ -3670,10 +3670,10 @@ void processinput_r(int snum) if (tmp >= 0) { if (!S_CheckSoundPlaying(p->i, 432)) - spritesound(432, pi); + S_PlayActorSound(432, pi); } else - stopsound(432); + S_StopSound(432); } if (isRRRA() && p->sea_sick_stat) { @@ -3777,7 +3777,7 @@ void processinput_r(int snum) case 1: if ((krand() & 1) == 0) if (!isRRRA() || (!p->OnBoat && !p->OnMotorcycle && sector[p->cursectnum].hitag != 321)) - spritesound(DUKE_ONWATER, pi); + S_PlayActorSound(DUKE_ONWATER, pi); p->walking_snd_toggle = 1; break; } @@ -3941,7 +3941,7 @@ HORIZONLY: { hittype[var60].timetosleep = 0; if (sprite[var60].picnum == BILLYRAY) - spritesound(404, var60); + S_PlayActorSound(404, var60); else fi.check_fta_sounds(var60); changespritestat(var60, 1); @@ -3951,7 +3951,7 @@ HORIZONLY: if (sprite[var60].picnum == RRTILE3410) { quickkill(p); - spritesound(446, pi); + S_PlayActorSound(446, pi); } else if (isRRRA() && sprite[var60].picnum == RRTILE2443 && sprite[var60].pal == 19) { @@ -4002,9 +4002,9 @@ HORIZONLY: } if (truefdist < PHEIGHT && p->on_ground && psectlotag != 1 && shrunk == 0 && sector[p->cursectnum].lotag == 1) - if (!A_CheckSoundPlaying(pi, DUKE_ONWATER)) + if (!S_CheckActorSoundPlaying(pi, DUKE_ONWATER)) if (!isRRRA() || (!p->OnBoat && !p->OnMotorcycle && sector[p->cursectnum].hitag != 321)) - spritesound(DUKE_ONWATER, pi); + S_PlayActorSound(DUKE_ONWATER, pi); if (p->cursectnum != s->sectnum) changespritesect(pi, p->cursectnum); @@ -4172,8 +4172,8 @@ void OnMotorcycle(struct player_struct *p, int motosprite) p->posyv = 0; p->sethoriz(100); } - if (!A_CheckSoundPlaying(p->i,186)) - A_PlaySound(186, p->i); + if (!S_CheckActorSoundPlaying(p->i,186)) + S_PlayActorSound(186, p->i); } //--------------------------------------------------------------------------- @@ -4187,16 +4187,16 @@ void OffMotorcycle(struct player_struct *p) short j; if (p->OnMotorcycle) { - if (A_CheckSoundPlaying(p->i,188)) - S_StopEnvSound(188,p->i); - if (A_CheckSoundPlaying(p->i,187)) - S_StopEnvSound(187,p->i); - if (A_CheckSoundPlaying(p->i,186)) - S_StopEnvSound(186,p->i); - if (A_CheckSoundPlaying(p->i,214)) - S_StopEnvSound(214,p->i); - if (!A_CheckSoundPlaying(p->i,42)) - A_PlaySound(42, p->i); + if (S_CheckActorSoundPlaying(p->i,188)) + S_StopSound(188,p->i); + if (S_CheckActorSoundPlaying(p->i,187)) + S_StopSound(187,p->i); + if (S_CheckActorSoundPlaying(p->i,186)) + S_StopSound(186,p->i); + if (S_CheckActorSoundPlaying(p->i,214)) + S_StopSound(214,p->i); + if (!S_CheckActorSoundPlaying(p->i,42)) + S_PlayActorSound(42, p->i); p->OnMotorcycle = 0; p->gotweapon.Clear(MOTORCYCLE_WEAPON); p->curr_weapon = p->last_full_weapon; diff --git a/source/games/duke/src/player_w.cpp b/source/games/duke/src/player_w.cpp index ef41f65ae..b65eb92f3 100644 --- a/source/games/duke/src/player_w.cpp +++ b/source/games/duke/src/player_w.cpp @@ -59,7 +59,7 @@ void DoFire(struct player_struct *p, short snum) if(aplWeaponFireSound[p->curr_weapon][snum]) { - spritesound(aplWeaponFireSound[p->curr_weapon][snum],p->i); + S_PlayActorSound(aplWeaponFireSound[p->curr_weapon][snum],p->i); } SetGameVarID(g_iWeaponVarID,p->curr_weapon,p->i,snum); @@ -172,7 +172,7 @@ void fireweapon_ww(int snum) p->kickback_pic = 1; if (aplWeaponInitialSound[p->curr_weapon][snum]) { - spritesound(aplWeaponInitialSound[p->curr_weapon][snum], pi); + S_PlayActorSound(aplWeaponInitialSound[p->curr_weapon][snum], pi); } } break; @@ -181,7 +181,7 @@ void fireweapon_ww(int snum) p->kickback_pic = 1; if (aplWeaponInitialSound[p->curr_weapon][snum]) { - spritesound(aplWeaponInitialSound[p->curr_weapon][snum], pi); + S_PlayActorSound(aplWeaponInitialSound[p->curr_weapon][snum], pi); } break; @@ -192,7 +192,7 @@ void fireweapon_ww(int snum) p->kickback_pic = 1; if (aplWeaponInitialSound[p->curr_weapon][snum]) { - spritesound(aplWeaponInitialSound[p->curr_weapon][snum], pi); + S_PlayActorSound(aplWeaponInitialSound[p->curr_weapon][snum], pi); } } break; @@ -204,7 +204,7 @@ void fireweapon_ww(int snum) p->kickback_pic = 1; if (aplWeaponInitialSound[p->curr_weapon][snum]) { - spritesound(aplWeaponInitialSound[p->curr_weapon][snum], pi); + S_PlayActorSound(aplWeaponInitialSound[p->curr_weapon][snum], pi); } } break; @@ -215,7 +215,7 @@ void fireweapon_ww(int snum) p->kickback_pic = 1; if (aplWeaponInitialSound[p->curr_weapon][snum]) { - spritesound(aplWeaponInitialSound[p->curr_weapon][snum], pi); + S_PlayActorSound(aplWeaponInitialSound[p->curr_weapon][snum], pi); } } break; @@ -225,7 +225,7 @@ void fireweapon_ww(int snum) p->kickback_pic = 1; if (aplWeaponInitialSound[p->curr_weapon][snum]) { - spritesound(aplWeaponInitialSound[p->curr_weapon][snum], pi); + S_PlayActorSound(aplWeaponInitialSound[p->curr_weapon][snum], pi); } } break; @@ -236,7 +236,7 @@ void fireweapon_ww(int snum) p->kickback_pic = 1; if (aplWeaponInitialSound[p->curr_weapon][snum]) { - spritesound(aplWeaponInitialSound[p->curr_weapon][snum], pi); + S_PlayActorSound(aplWeaponInitialSound[p->curr_weapon][snum], pi); } } break; @@ -247,7 +247,7 @@ void fireweapon_ww(int snum) p->kickback_pic = 1; if (aplWeaponInitialSound[p->curr_weapon][snum]) { - spritesound(aplWeaponInitialSound[p->curr_weapon][snum], pi); + S_PlayActorSound(aplWeaponInitialSound[p->curr_weapon][snum], pi); } } break; @@ -258,7 +258,7 @@ void fireweapon_ww(int snum) p->kickback_pic = 1; if (aplWeaponInitialSound[p->curr_weapon][snum]) { - spritesound(aplWeaponInitialSound[p->curr_weapon][snum], pi); + S_PlayActorSound(aplWeaponInitialSound[p->curr_weapon][snum], pi); } } break; @@ -269,7 +269,7 @@ void fireweapon_ww(int snum) p->hbomb_hold_delay = !p->hbomb_hold_delay; if (aplWeaponInitialSound[p->curr_weapon][snum]) { - spritesound(aplWeaponInitialSound[p->curr_weapon][snum], pi); + S_PlayActorSound(aplWeaponInitialSound[p->curr_weapon][snum], pi); } } break; @@ -280,7 +280,7 @@ void fireweapon_ww(int snum) p->kickback_pic = 1; if (aplWeaponInitialSound[p->curr_weapon][snum]) { - spritesound(aplWeaponInitialSound[p->curr_weapon][snum], pi); + S_PlayActorSound(aplWeaponInitialSound[p->curr_weapon][snum], pi); } } break; @@ -291,7 +291,7 @@ void fireweapon_ww(int snum) p->kickback_pic = 1; if (aplWeaponInitialSound[p->curr_weapon][snum]) { - spritesound(aplWeaponInitialSound[p->curr_weapon][snum], pi); + S_PlayActorSound(aplWeaponInitialSound[p->curr_weapon][snum], pi); } } break; @@ -443,7 +443,7 @@ void operateweapon_ww(int snum, ESyncBits sb_snum, int psect) { if (aplWeaponSound2Sound[p->curr_weapon][snum]) { - spritesound(aplWeaponSound2Sound[p->curr_weapon][snum], pi); + S_PlayActorSound(aplWeaponSound2Sound[p->curr_weapon][snum], pi); } } if (p->kickback_pic == aplWeaponSpawnTime[p->curr_weapon][snum]) @@ -500,12 +500,12 @@ void operateweapon_ww(int snum, ESyncBits sb_snum, int psect) if (p->kickback_pic == (aplWeaponTotalTime[p->curr_weapon][snum] + 1)) { // eject shortly after 'total time' - spritesound(EJECT_CLIP, pi); + S_PlayActorSound(EJECT_CLIP, pi); } else if (p->kickback_pic == (aplWeaponReload[p->curr_weapon][snum] - (i / 3))) { // insert occurs 2/3 of way through reload delay - spritesound(INSERT_CLIP, pi); + S_PlayActorSound(INSERT_CLIP, pi); } if (p->kickback_pic >= (aplWeaponReload[p->curr_weapon][snum])) diff --git a/source/games/duke/src/sectors.cpp b/source/games/duke/src/sectors.cpp index 81f3a786d..9016eb5e4 100644 --- a/source/games/duke/src/sectors.cpp +++ b/source/games/duke/src/sectors.cpp @@ -73,8 +73,8 @@ int callsound(int sn, int whatsprite) if (snum) { if (sprite[i].hitag && snum != sprite[i].hitag) - S_StopEnvSound(sprite[i].hitag, hittype[i].temp_data[5]); // changed to only stop the sound on the same actor, not all of them. - spritesound(snum, whatsprite); + S_StopSound(sprite[i].hitag, hittype[i].temp_data[5]); // changed to only stop the sound on the same actor, not all of them. + S_PlayActorSound(snum, whatsprite); hittype[i].temp_data[5] = whatsprite; } @@ -85,8 +85,8 @@ int callsound(int sn, int whatsprite) else if (S_IsSoundValid(sprite[i].hitag)) { if ((flags & SF_LOOP) || (sprite[i].hitag && sprite[i].hitag != sprite[i].lotag)) - S_StopEnvSound(sprite[i].lotag, hittype[i].temp_data[5]); // changed to only stop the sound on the same actor, not all of them. - if (sprite[i].hitag) spritesound(sprite[i].hitag, whatsprite); + S_StopSound(sprite[i].lotag, hittype[i].temp_data[5]); // changed to only stop the sound on the same actor, not all of them. + if (sprite[i].hitag) S_PlayActorSound(sprite[i].hitag, whatsprite); hittype[i].temp_data[0] = 0; hittype[i].temp_data[5] = whatsprite; } @@ -451,8 +451,8 @@ bool activatewarpelevators(int s, int d) //Parm = sectoreffectornum else { if (d == 0) - spritesound(ELEVATOR_OFF, s); - else spritesound(ELEVATOR_ON, s); + S_PlayActorSound(ELEVATOR_OFF, s); + else S_PlayActorSound(ELEVATOR_ON, s); } @@ -1087,8 +1087,8 @@ void operateforcefields_common(int s, int low, const std::initializer_list void breakwall(short newpn, short spr, short dawallnum) { wall[dawallnum].picnum = newpn; - spritesound(VENT_BUST, spr); - spritesound(GLASS_HEAVYBREAK, spr); + S_PlayActorSound(VENT_BUST, spr); + S_PlayActorSound(GLASS_HEAVYBREAK, spr); lotsofglass(spr, dawallnum, 10); } diff --git a/source/games/duke/src/sectors_d.cpp b/source/games/duke/src/sectors_d.cpp index 2b9af50dd..8a99725bb 100644 --- a/source/games/duke/src/sectors_d.cpp +++ b/source/games/duke/src/sectors_d.cpp @@ -600,7 +600,7 @@ bool checkhitswitch_d(int snum, int w, int switchtype) if (switchtype == SWITCH_SPRITE && (flags & SF_TALK) == 0) S_PlaySound3D(hitag, w, &v); else - A_PlaySound(hitag, ps[snum].i); + S_PlayActorSound(hitag, ps[snum].i); } return 1; @@ -663,7 +663,7 @@ void checkhitwall_d(int spr, int dawallnum, int x, int y, int z, int atwith) lotsofglass(spr, dawallnum, 70); wal->cstat &= ~16; wal->overpicnum = MIRRORBROKE; - spritesound(GLASS_HEAVYBREAK, spr); + S_PlayActorSound(GLASS_HEAVYBREAK, spr); return; } } @@ -694,7 +694,7 @@ void checkhitwall_d(int spr, int dawallnum, int x, int y, int z, int atwith) sprite[i].ang = getangle(wal->x - wall[wal->point2].x, wal->y - wall[wal->point2].y) - 512; - spritesound(SOMETHINGHITFORCE, i); + S_PlayActorSound(SOMETHINGHITFORCE, i); return; @@ -706,8 +706,8 @@ void checkhitwall_d(int spr, int dawallnum, int x, int y, int z, int atwith) wall[wal->nextwall].overpicnum = FANSPRITEBROKE; wall[wal->nextwall].cstat &= 65535 - 65; } - spritesound(VENT_BUST, spr); - spritesound(GLASS_BREAKING, spr); + S_PlayActorSound(VENT_BUST, spr); + S_PlayActorSound(GLASS_BREAKING, spr); return; case GLASS: @@ -721,7 +721,7 @@ void checkhitwall_d(int spr, int dawallnum, int x, int y, int z, int atwith) i = EGS(sn, x, y, z, SECTOREFFECTOR, 0, 0, 0, ps[0].getang(), 0, 0, spr, 3); sprite[i].lotag = 128; hittype[i].temp_data[1] = 5; hittype[i].temp_data[2] = dawallnum; - spritesound(GLASS_BREAKING, i); + S_PlayActorSound(GLASS_BREAKING, i); return; case STAINGLASS1: updatesector(x, y, &sn); if (sn < 0) return; @@ -729,8 +729,8 @@ void checkhitwall_d(int spr, int dawallnum, int x, int y, int z, int atwith) wal->cstat = 0; if (wal->nextwall >= 0) wall[wal->nextwall].cstat = 0; - spritesound(VENT_BUST, spr); - spritesound(GLASS_BREAKING, spr); + S_PlayActorSound(VENT_BUST, spr); + S_PlayActorSound(GLASS_BREAKING, spr); return; } @@ -739,7 +739,7 @@ void checkhitwall_d(int spr, int dawallnum, int x, int y, int z, int atwith) case COLAMACHINE: case VENDMACHINE: breakwall(wal->picnum + 2, spr, dawallnum); - spritesound(VENT_BUST, spr); + S_PlayActorSound(VENT_BUST, spr); return; case OJ: @@ -771,7 +771,7 @@ void checkhitwall_d(int spr, int dawallnum, int x, int y, int z, int atwith) lotsofglass(spr, dawallnum, 30); wal->picnum = W_SCREENBREAK + (krand() % 3); - spritesound(GLASS_HEAVYBREAK, spr); + S_PlayActorSound(GLASS_HEAVYBREAK, spr); return; case W_TECHWALL5: @@ -820,7 +820,7 @@ void checkhitwall_d(int spr, int dawallnum, int x, int y, int z, int atwith) case ATM: wal->picnum = ATMBROKE; fi.lotsofmoney(&sprite[spr], 1 + (krand() & 7)); - spritesound(GLASS_HEAVYBREAK, spr); + S_PlayActorSound(GLASS_HEAVYBREAK, spr); break; case WALLLIGHT1: @@ -831,8 +831,8 @@ void checkhitwall_d(int spr, int dawallnum, int x, int y, int z, int atwith) case TECHLIGHT4: if (rnd(128)) - spritesound(GLASS_HEAVYBREAK, spr); - else spritesound(GLASS_BREAKING, spr); + S_PlayActorSound(GLASS_HEAVYBREAK, spr); + else S_PlayActorSound(GLASS_BREAKING, spr); lotsofglass(spr, dawallnum, 30); if (wal->picnum == WALLLIGHT1) @@ -900,7 +900,7 @@ void checkplayerhurt_d(struct player_struct* p, int j) sprite[p->i].extra -= 5; p->hurt_delay = 16; SetPlayerPal(p, PalEntry(32, 32, 0, 0)); - spritesound(DUKE_LONGTERM_PAIN, p->i); + S_PlayActorSound(DUKE_LONGTERM_PAIN, p->i); } break; } @@ -923,7 +923,7 @@ void checkplayerhurt_d(struct player_struct* p, int j) p->posxv = -(sintable[(p->getang() + 512) & 2047] << 8); p->posyv = -(sintable[(p->getang()) & 2047] << 8); - spritesound(DUKE_LONGTERM_PAIN, p->i); + S_PlayActorSound(DUKE_LONGTERM_PAIN, p->i); fi.checkhitwall(p->i, j, p->posx + (sintable[(p->getang() + 512) & 2047] >> 9), @@ -963,7 +963,7 @@ bool checkhitceiling_d(int sn) case TECHLIGHT4: ceilingglass(ps[myconnectindex].i, sn, 10); - spritesound(GLASS_BREAKING, ps[screenpeek].i); + S_PlayActorSound(GLASS_BREAKING, ps[screenpeek].i); if (sector[sn].ceilingpicnum == WALLLIGHT1) sector[sn].ceilingpicnum = WALLLIGHTBUST1; @@ -1041,7 +1041,7 @@ void checkhitsprite_d(int i, int sn) case WTGLASS2: if (!isWorldTour()) break; - A_PlaySound(GLASS_BREAKING, i); + S_PlayActorSound(GLASS_BREAKING, i); lotsofglass(i, -1, 10); deletesprite(i); return; @@ -1062,7 +1062,7 @@ void checkhitsprite_d(int i, int sn) sprite[sn].ang -= (sprite[i].ang << 1) + 1024; sprite[i].ang = getangle(sprite[i].x - sprite[sn].x, sprite[i].y - sprite[sn].y) - 512; if (S_CheckSoundPlaying(POOLBALLHIT) < 2) - spritesound(POOLBALLHIT, i); + S_PlayActorSound(POOLBALLHIT, i); } else { @@ -1126,7 +1126,7 @@ void checkhitsprite_d(int i, int sn) case GENERICPOLE2: for (k = 0; k < 6; k++) EGS(sprite[i].sectnum, sprite[i].x, sprite[i].y, sprite[i].z - (8 << 8), SCRAP1 + (krand() & 15), -8, 48, 48, krand() & 2047, (krand() & 63) + 64, -(krand() & 4095) - (sprite[i].zvel >> 2), i, 5); - spritesound(GLASS_HEAVYBREAK, i); + S_PlayActorSound(GLASS_HEAVYBREAK, i); deletesprite(i); break; @@ -1137,7 +1137,7 @@ void checkhitsprite_d(int i, int sn) if (sector[sprite[i].sectnum].floorpicnum == FANSHADOW) sector[sprite[i].sectnum].floorpicnum = FANSHADOWBROKE; - spritesound(GLASS_HEAVYBREAK, i); + S_PlayActorSound(GLASS_HEAVYBREAK, i); s = &sprite[i]; for (j = 0; j < 16; j++) RANDOMSCRAP(s, i); @@ -1195,19 +1195,19 @@ void checkhitsprite_d(int i, int sn) else if (sprite[i].picnum == STATUE || sprite[i].picnum == STATUEFLASH) { lotsofcolourglass(i, -1, 40); - spritesound(GLASS_HEAVYBREAK, i); + S_PlayActorSound(GLASS_HEAVYBREAK, i); } else if (sprite[i].picnum == VASE) lotsofglass(i, -1, 40); - spritesound(GLASS_BREAKING, i); + S_PlayActorSound(GLASS_BREAKING, i); sprite[i].ang = krand() & 2047; lotsofglass(i, -1, 8); deletesprite(i); break; case FETUS: sprite[i].picnum = FETUSBROKE; - spritesound(GLASS_BREAKING, i); + S_PlayActorSound(GLASS_BREAKING, i); lotsofglass(i, -1, 10); break; case FETUSBROKE: @@ -1216,16 +1216,16 @@ void checkhitsprite_d(int i, int sn) fi.shoot(i, BLOODSPLAT1); sprite[i].ang += 333; } - spritesound(GLASS_HEAVYBREAK, i); - spritesound(SQUISHED, i); + S_PlayActorSound(GLASS_HEAVYBREAK, i); + S_PlayActorSound(SQUISHED, i); case BOTTLE7: - spritesound(GLASS_BREAKING, i); + S_PlayActorSound(GLASS_BREAKING, i); lotsofglass(i, -1, 10); deletesprite(i); break; case HYDROPLANT: sprite[i].picnum = BROKEHYDROPLANT; - spritesound(GLASS_BREAKING, i); + S_PlayActorSound(GLASS_BREAKING, i); lotsofglass(i, -1, 10); break; @@ -1240,7 +1240,7 @@ void checkhitsprite_d(int i, int sn) case BROKEHYDROPLANT: if (sprite[i].cstat & 1) { - spritesound(GLASS_BREAKING, i); + S_PlayActorSound(GLASS_BREAKING, i); sprite[i].z += 16 << 8; sprite[i].cstat = 0; lotsofglass(i, -1, 5); @@ -1252,7 +1252,7 @@ void checkhitsprite_d(int i, int sn) sprite[i].cstat |= (krand() & 1) << 2; sprite[i].cstat &= ~257; fi.spawn(i, TOILETWATER); - spritesound(GLASS_BREAKING, i); + S_PlayActorSound(GLASS_BREAKING, i); break; case STALL: @@ -1260,7 +1260,7 @@ void checkhitsprite_d(int i, int sn) sprite[i].cstat |= (krand() & 1) << 2; sprite[i].cstat &= ~257; fi.spawn(i, TOILETWATER); - spritesound(GLASS_HEAVYBREAK, i); + S_PlayActorSound(GLASS_HEAVYBREAK, i); break; case HYDRENT: @@ -1272,30 +1272,30 @@ void checkhitsprite_d(int i, int sn) // j = EGS(sprite[i].sectnum,sprite[i].x,sprite[i].y,sprite[i].z-(krand()%(48<<8)),SCRAP3+(krand()&3),-8,48,48,krand()&2047,(krand()&63)+64,-(krand()&4095)-(sprite[i].zvel>>2),i,5); // sprite[j].pal = 2; // } - spritesound(GLASS_HEAVYBREAK, i); + S_PlayActorSound(GLASS_HEAVYBREAK, i); break; case GRATE1: sprite[i].picnum = BGRATE1; sprite[i].cstat &= (65535 - 256 - 1); - spritesound(VENT_BUST, i); + S_PlayActorSound(VENT_BUST, i); break; case CIRCLEPANNEL: sprite[i].picnum = CIRCLEPANNELBROKE; sprite[i].cstat &= (65535 - 256 - 1); - spritesound(VENT_BUST, i); + S_PlayActorSound(VENT_BUST, i); break; case PANNEL1: case PANNEL2: sprite[i].picnum = BPANNEL1; sprite[i].cstat &= (65535 - 256 - 1); - spritesound(VENT_BUST, i); + S_PlayActorSound(VENT_BUST, i); break; case PANNEL3: sprite[i].picnum = BPANNEL3; sprite[i].cstat &= (65535 - 256 - 1); - spritesound(VENT_BUST, i); + S_PlayActorSound(VENT_BUST, i); break; case PIPE1: case PIPE2: @@ -1321,7 +1321,7 @@ void checkhitsprite_d(int i, int sn) case LUKE: case INDY: case JURYGUY: - spritesound(sprite[i].lotag, i); + S_PlayActorSound(sprite[i].lotag, i); fi.spawn(i, sprite[i].hitag); case SPACEMARINE: sprite[i].extra -= sprite[sn].extra; @@ -1348,7 +1348,7 @@ void checkhitsprite_d(int i, int sn) fi.guts(&sprite[i], JIBS4, 4, myconnectindex); fi.guts(&sprite[i], JIBS5, 1, myconnectindex); fi.guts(&sprite[i], JIBS3, 6, myconnectindex); - sound(SQUISHED); + S_PlaySound(SQUISHED); deletesprite(i); break; case CHAIR1: @@ -1366,7 +1366,7 @@ void checkhitsprite_d(int i, int sn) case POT2: case POT3: case TRIPODCAMERA: - spritesound(GLASS_HEAVYBREAK, i); + S_PlayActorSound(GLASS_HEAVYBREAK, i); s = &sprite[i]; for (j = 0; j < 16; j++) RANDOMSCRAP(s, i); deletesprite(i); @@ -1509,7 +1509,7 @@ void checksectors_d(int snum) if (sector[p->cursectnum].lotag >= 10000 && sector[p->cursectnum].lotag < 16383) { if (snum == screenpeek || ud.coop == 1) - spritesound(sector[p->cursectnum].lotag - 10000, p->i); + S_PlayActorSound(sector[p->cursectnum].lotag - 10000, p->i); sector[p->cursectnum].lotag = 0; } break; @@ -1558,7 +1558,7 @@ void checksectors_d(int snum) if (i < 1280 && hitscanwall >= 0 && wall[hitscanwall].overpicnum == MIRROR) if (wall[hitscanwall].lotag > 0 && S_CheckSoundPlaying(wall[hitscanwall].lotag) == 0 && snum == screenpeek) { - spritesound(wall[hitscanwall].lotag, p->i); + S_PlayActorSound(wall[hitscanwall].lotag, p->i); return; } @@ -1630,7 +1630,7 @@ void checksectors_d(int snum) case STALL: if (p->last_pissed_time == 0) { - if (adult_lockout == 0) spritesound(DUKE_URINATE, p->i); + if (adult_lockout == 0) S_PlayActorSound(DUKE_URINATE, p->i); p->last_pissed_time = 26 * 220; p->transporter_hold = 29 * 2; @@ -1648,7 +1648,7 @@ void checksectors_d(int snum) sprite[p->i].extra = max_player_health; } else if (S_CheckSoundPlaying(neartagsprite, FLUSH_TOILET) == 0) - spritesound(FLUSH_TOILET, neartagsprite); + S_PlayActorSound(FLUSH_TOILET, neartagsprite); return; case NUKEBUTTON: @@ -1674,12 +1674,12 @@ void checksectors_d(int snum) if (sprite[p->i].extra < max_player_health) { sprite[p->i].extra++; - spritesound(DUKE_DRINKING, p->i); + S_PlayActorSound(DUKE_DRINKING, p->i); } } return; case PLUG: - spritesound(SHORT_CIRCUIT, p->i); + S_PlayActorSound(SHORT_CIRCUIT, p->i); sprite[p->i].extra -= 2 + (krand() & 3); SetPlayerPal(p, PalEntry(32, 48, 48, 64)); break; @@ -1693,7 +1693,7 @@ void checksectors_d(int snum) if (sprite[i].picnum == CAMERA1 && sprite[i].yvel == 0 && sprite[neartagsprite].hitag == sprite[i].lotag) { sprite[i].yvel = 1; //Using this camera - spritesound(MONITOR_ACTIVE, neartagsprite); + S_PlayActorSound(MONITOR_ACTIVE, neartagsprite); sprite[neartagsprite].owner = i; sprite[neartagsprite].yvel = 1; @@ -1748,8 +1748,8 @@ void checksectors_d(int snum) if (abs(hits(p->i)) < 512) { if ((krand() & 255) < 16) - spritesound(DUKE_SEARCH2, p->i); - else spritesound(DUKE_SEARCH, p->i); + S_PlayActorSound(DUKE_SEARCH2, p->i); + else S_PlayActorSound(DUKE_SEARCH, p->i); return; } diff --git a/source/games/duke/src/sectors_r.cpp b/source/games/duke/src/sectors_r.cpp index e8b8b9d06..7c46fdaa7 100644 --- a/source/games/duke/src/sectors_r.cpp +++ b/source/games/duke/src/sectors_r.cpp @@ -393,7 +393,7 @@ bool checkhitswitch_r(int snum, int w, int switchtype) else { FTA(70, &ps[snum]); - if (isRRRA()) spritesound(99, w); + if (isRRRA()) S_PlayActorSound(99, w); } } @@ -404,7 +404,7 @@ bool checkhitswitch_r(int snum, int w, int switchtype) else { FTA(71, &ps[snum]); - if (isRRRA()) spritesound(99, w); + if (isRRRA()) S_PlayActorSound(99, w); } } @@ -415,7 +415,7 @@ bool checkhitswitch_r(int snum, int w, int switchtype) else { FTA(72, &ps[snum]); - if (isRRRA()) spritesound(99, w); + if (isRRRA()) S_PlayActorSound(99, w); } } @@ -554,7 +554,7 @@ bool checkhitswitch_r(int snum, int w, int switchtype) sprite[j].picnum++; sprite[j].hitag = 100; sprite[j].extra = 0; - spritesound(474, j); + S_PlayActorSound(474, j); } else if (sprite[j].picnum == RRTILE295) deletesprite(j); @@ -768,7 +768,7 @@ bool checkhitswitch_r(int snum, int w, int switchtype) ps[snum].SeaSick = 350; operateactivators(668, ps[snum].i); operatemasterswitches(668); - spritesound(328, ps[snum].i); + S_PlayActorSound(328, ps[snum].i); return 1; } } @@ -878,7 +878,7 @@ bool checkhitswitch_r(int snum, int w, int switchtype) if (switchtype == SWITCH_SPRITE && (flags & SF_TALK) == 0) S_PlaySound3D(hitag, w, &v); else - A_PlaySound(hitag, ps[snum].i); + S_PlayActorSound(hitag, ps[snum].i); } return 1; @@ -997,7 +997,7 @@ void checkhitwall_r(int spr, int dawallnum, int x, int y, int z, int atwith) lotsofglass(spr, dawallnum, 70); wal->cstat &= ~16; wal->overpicnum = MIRRORBROKE; - spritesound(GLASS_HEAVYBREAK, spr); + S_PlayActorSound(GLASS_HEAVYBREAK, spr); return; } } @@ -1015,8 +1015,8 @@ void checkhitwall_r(int spr, int dawallnum, int x, int y, int z, int atwith) wall[wal->nextwall].overpicnum = FANSPRITEBROKE; wall[wal->nextwall].cstat &= 65535 - 65; } - spritesound(VENT_BUST, spr); - spritesound(GLASS_BREAKING, spr); + S_PlayActorSound(VENT_BUST, spr); + S_PlayActorSound(GLASS_BREAKING, spr); return; case RRTILE1973: @@ -1030,7 +1030,7 @@ void checkhitwall_r(int spr, int dawallnum, int x, int y, int z, int atwith) i = EGS(sn, x, y, z, SECTOREFFECTOR, 0, 0, 0, ps[0].getang(), 0, 0, spr, 3); sprite[i].lotag = 128; hittype[i].temp_data[1] = 2; hittype[i].temp_data[2] = dawallnum; - spritesound(GLASS_BREAKING, i); + S_PlayActorSound(GLASS_BREAKING, i); return; case GLASS: @@ -1044,7 +1044,7 @@ void checkhitwall_r(int spr, int dawallnum, int x, int y, int z, int atwith) i = EGS(sn, x, y, z, SECTOREFFECTOR, 0, 0, 0, ps[0].getang(), 0, 0, spr, 3); sprite[i].lotag = 128; hittype[i].temp_data[1] = 2; hittype[i].temp_data[2] = dawallnum; - spritesound(GLASS_BREAKING, i); + S_PlayActorSound(GLASS_BREAKING, i); return; case STAINGLASS1: updatesector(x, y, &sn); if (sn < 0) return; @@ -1052,8 +1052,8 @@ void checkhitwall_r(int spr, int dawallnum, int x, int y, int z, int atwith) wal->cstat = 0; if (wal->nextwall >= 0) wall[wal->nextwall].cstat = 0; - spritesound(VENT_BUST, spr); - spritesound(GLASS_BREAKING, spr); + S_PlayActorSound(VENT_BUST, spr); + S_PlayActorSound(GLASS_BREAKING, spr); return; } @@ -1089,8 +1089,8 @@ void checkhitwall_r(int spr, int dawallnum, int x, int y, int z, int atwith) for (i = startwall; i < endwall; i++) sector[wall[i].nextsector].lotag = 0; sector[s->sectnum].lotag = 0; - stopsound(sprite[jj].lotag); - spritesound(400, jj); + S_StopSound(sprite[jj].lotag); + S_PlayActorSound(400, jj); deletesprite(jj); } } @@ -1101,82 +1101,82 @@ void checkhitwall_r(int spr, int dawallnum, int x, int y, int z, int atwith) case RRTILE7555: if (!isRRRA()) break; wal->picnum = SBMOVE; - spritesound(GLASS_HEAVYBREAK, spr); + S_PlayActorSound(GLASS_HEAVYBREAK, spr); return; case RRTILE7441: if (!isRRRA()) break; wal->picnum = RRTILE5016; - spritesound(GLASS_HEAVYBREAK, spr); + S_PlayActorSound(GLASS_HEAVYBREAK, spr); return; case RRTILE7559: if (!isRRRA()) break; wal->picnum = RRTILE5017; - spritesound(GLASS_HEAVYBREAK, spr); + S_PlayActorSound(GLASS_HEAVYBREAK, spr); return; case RRTILE7433: if (!isRRRA()) break; wal->picnum = RRTILE5018; - spritesound(GLASS_HEAVYBREAK, spr); + S_PlayActorSound(GLASS_HEAVYBREAK, spr); return; case RRTILE7557: if (!isRRRA()) break; wal->picnum = RRTILE5019; - spritesound(GLASS_HEAVYBREAK, spr); + S_PlayActorSound(GLASS_HEAVYBREAK, spr); return; case RRTILE7553: if (!isRRRA()) break; wal->picnum = RRTILE5020; - spritesound(GLASS_HEAVYBREAK, spr); + S_PlayActorSound(GLASS_HEAVYBREAK, spr); return; case RRTILE7552: if (!isRRRA()) break; wal->picnum = RRTILE5021; - spritesound(GLASS_HEAVYBREAK, spr); + S_PlayActorSound(GLASS_HEAVYBREAK, spr); return; case RRTILE7568: if (!isRRRA()) break; wal->picnum = RRTILE5022; - spritesound(GLASS_HEAVYBREAK, spr); + S_PlayActorSound(GLASS_HEAVYBREAK, spr); return; case RRTILE7540: if (!isRRRA()) break; wal->picnum = RRTILE5023; - spritesound(GLASS_HEAVYBREAK, spr); + S_PlayActorSound(GLASS_HEAVYBREAK, spr); return; case RRTILE7558: if (!isRRRA()) break; wal->picnum = RRTILE5024; - spritesound(GLASS_HEAVYBREAK, spr); + S_PlayActorSound(GLASS_HEAVYBREAK, spr); return; case RRTILE7554: if (!isRRRA()) break; wal->picnum = RRTILE5025; - spritesound(GLASS_HEAVYBREAK, spr); + S_PlayActorSound(GLASS_HEAVYBREAK, spr); return; case RRTILE7579: if (!isRRRA()) break; wal->picnum = RRTILE5026; - spritesound(GLASS_HEAVYBREAK, spr); + S_PlayActorSound(GLASS_HEAVYBREAK, spr); return; case RRTILE7561: if (!isRRRA()) break; wal->picnum = RRTILE5027; - spritesound(GLASS_HEAVYBREAK, spr); + S_PlayActorSound(GLASS_HEAVYBREAK, spr); return; case RRTILE7580: if (!isRRRA()) break; wal->picnum = RRTILE5037; - spritesound(GLASS_HEAVYBREAK, spr); + S_PlayActorSound(GLASS_HEAVYBREAK, spr); return; case RRTILE8227: if (!isRRRA()) break; wal->picnum = RRTILE5070; - spritesound(GLASS_HEAVYBREAK, spr); + S_PlayActorSound(GLASS_HEAVYBREAK, spr); return; case RRTILE8503: if (!isRRRA()) break; wal->picnum = RRTILE5079; - spritesound(GLASS_HEAVYBREAK, spr); + S_PlayActorSound(GLASS_HEAVYBREAK, spr); return; case RRTILE8567: case RRTILE8568: @@ -1185,56 +1185,56 @@ void checkhitwall_r(int spr, int dawallnum, int x, int y, int z, int atwith) case RRTILE8571: if (!isRRRA()) break; wal->picnum = RRTILE5082; - spritesound(GLASS_HEAVYBREAK, spr); + S_PlayActorSound(GLASS_HEAVYBREAK, spr); return; case RRTILE7859: if (!isRRRA()) break; wal->picnum = RRTILE5081; - spritesound(GLASS_HEAVYBREAK, spr); + S_PlayActorSound(GLASS_HEAVYBREAK, spr); return; case RRTILE8496: if (!isRRRA()) break; wal->picnum = RRTILE5061; - spritesound(GLASS_HEAVYBREAK, spr); + S_PlayActorSound(GLASS_HEAVYBREAK, spr); return; case RRTILE8617: if (!isRRRA()) break; if (numplayers < 2) { wal->picnum = RRTILE8618; - spritesound(47, spr); + S_PlayActorSound(47, spr); } return; case RRTILE8620: if (!isRRRA()) break; wal->picnum = RRTILE8621; - spritesound(47, spr); + S_PlayActorSound(47, spr); return; case RRTILE8622: if (!isRRRA()) break; wal->picnum = RRTILE8623; - spritesound(495, spr); + S_PlayActorSound(495, spr); return; case RRTILE7657: if (!isRRRA()) break; wal->picnum = RRTILE7659; - spritesound(GLASS_HEAVYBREAK, spr); + S_PlayActorSound(GLASS_HEAVYBREAK, spr); return; case RRTILE8497: if (!isRRRA()) break; wal->picnum = RRTILE5076; - spritesound(495, spr); + S_PlayActorSound(495, spr); return; case RRTILE7533: if (!isRRRA()) break; wal->picnum = RRTILE5035; - spritesound(495, spr); + S_PlayActorSound(495, spr); return; case COLAMACHINE: case VENDMACHINE: breakwall(wal->picnum + 2, spr, dawallnum); - spritesound(GLASS_BREAKING, spr); + S_PlayActorSound(GLASS_BREAKING, spr); return; case OJ: @@ -1245,13 +1245,13 @@ void checkhitwall_r(int spr, int dawallnum, int x, int y, int z, int atwith) lotsofglass(spr, dawallnum, 30); wal->picnum = W_SCREENBREAK + (krand() % (isRRRA() ? 2 : 3)); - spritesound(GLASS_HEAVYBREAK, spr); + S_PlayActorSound(GLASS_HEAVYBREAK, spr); return; case ATM: wal->picnum = ATMBROKE; fi.lotsofmoney(&sprite[spr], 1 + (krand() & 7)); - spritesound(GLASS_HEAVYBREAK, spr); + S_PlayActorSound(GLASS_HEAVYBREAK, spr); break; case WALLLIGHT1: @@ -1275,8 +1275,8 @@ void checkhitwall_r(int spr, int dawallnum, int x, int y, int z, int atwith) case RRTILE3208: if (rnd(128)) - spritesound(GLASS_HEAVYBREAK, spr); - else spritesound(GLASS_BREAKING, spr); + S_PlayActorSound(GLASS_HEAVYBREAK, spr); + else S_PlayActorSound(GLASS_BREAKING, spr); lotsofglass(spr, dawallnum, 30); if (wal->picnum == RRTILE1814) @@ -1389,7 +1389,7 @@ void checkplayerhurt_r(struct player_struct* p, int j) sprite[p->i].extra -= 2; p->hurt_delay2 = 16; SetPlayerPal(p, PalEntry(32, 32, 0, 0)); - spritesound(DUKE_LONGTERM_PAIN, p->i); + S_PlayActorSound(DUKE_LONGTERM_PAIN, p->i); } break; case CACTUS: @@ -1398,7 +1398,7 @@ void checkplayerhurt_r(struct player_struct* p, int j) sprite[p->i].extra -= 5; p->hurt_delay = 16; SetPlayerPal(p, PalEntry(32, 32, 0, 0)); - spritesound(DUKE_LONGTERM_PAIN, p->i); + S_PlayActorSound(DUKE_LONGTERM_PAIN, p->i); } break; } @@ -1449,7 +1449,7 @@ bool checkhitceiling_r(int sn) ceilingglass(ps[myconnectindex].i, sn, 10); - spritesound(GLASS_BREAKING, ps[screenpeek].i); + S_PlayActorSound(GLASS_BREAKING, ps[screenpeek].i); if (sector[sn].ceilingpicnum == WALLLIGHT1) sector[sn].ceilingpicnum = WALLLIGHTBUST1; @@ -1545,7 +1545,7 @@ void checkhitsprite_r(int i, int sn) break; case RRTILE8487: case RRTILE8489: - spritesound(471, i); + S_PlayActorSound(471, i); sprite[i].picnum++; break; case RRTILE7638: @@ -1559,11 +1559,11 @@ void checkhitsprite_r(int i, int sn) case RRTILE7881: case RRTILE7883: sprite[i].picnum++; - spritesound(VENT_BUST, i); + S_PlayActorSound(VENT_BUST, i); break; case RRTILE7879: sprite[i].picnum++; - spritesound(495, i); + S_PlayActorSound(495, i); fi.hitradius(i, 10, 0, 0, 1, 1); break; case RRTILE7648: @@ -1572,120 +1572,120 @@ void checkhitsprite_r(int i, int sn) case RRTILE7702: case RRTILE7711: sprite[i].picnum++; - spritesound(47, i); + S_PlayActorSound(47, i); break; case RRTILE7636: sprite[i].picnum += 3; - spritesound(VENT_BUST, i); + S_PlayActorSound(VENT_BUST, i); break; case RRTILE7875: sprite[i].picnum += 3; - spritesound(VENT_BUST, i); + S_PlayActorSound(VENT_BUST, i); break; case RRTILE7640: sprite[i].picnum += 2; - spritesound(VENT_BUST, i); + S_PlayActorSound(VENT_BUST, i); break; case RRTILE7595: case RRTILE7704: sprite[i].picnum = RRTILE7705; - spritesound(495, i); + S_PlayActorSound(495, i); break; case RRTILE8579: sprite[i].picnum = RRTILE5014; - spritesound(GLASS_HEAVYBREAK, i); + S_PlayActorSound(GLASS_HEAVYBREAK, i); break; case RRTILE7441: sprite[i].picnum = RRTILE5016; - spritesound(GLASS_HEAVYBREAK, i); + S_PlayActorSound(GLASS_HEAVYBREAK, i); break; case RRTILE7534: sprite[i].picnum = RRTILE5029; - spritesound(GLASS_HEAVYBREAK, i); + S_PlayActorSound(GLASS_HEAVYBREAK, i); break; case RRTILE7545: sprite[i].picnum = RRTILE5030; - spritesound(GLASS_HEAVYBREAK, i); + S_PlayActorSound(GLASS_HEAVYBREAK, i); break; case RRTILE7547: sprite[i].picnum = RRTILE5031; - spritesound(GLASS_HEAVYBREAK, i); + S_PlayActorSound(GLASS_HEAVYBREAK, i); break; case RRTILE7574: sprite[i].picnum = RRTILE5032; - spritesound(GLASS_HEAVYBREAK, i); + S_PlayActorSound(GLASS_HEAVYBREAK, i); break; case RRTILE7575: sprite[i].picnum = RRTILE5033; - spritesound(GLASS_HEAVYBREAK, i); + S_PlayActorSound(GLASS_HEAVYBREAK, i); break; case RRTILE7578: sprite[i].picnum = RRTILE5034; - spritesound(GLASS_HEAVYBREAK, i); + S_PlayActorSound(GLASS_HEAVYBREAK, i); break; case RRTILE7478: sprite[i].picnum = RRTILE5035; - spritesound(GLASS_HEAVYBREAK, i); + S_PlayActorSound(GLASS_HEAVYBREAK, i); break; case RRTILE8525: sprite[i].picnum = RRTILE5036; - spritesound(GLASS_HEAVYBREAK, i); + S_PlayActorSound(GLASS_HEAVYBREAK, i); break; case RRTILE8537: sprite[i].picnum = RRTILE5062; - spritesound(GLASS_HEAVYBREAK, i); + S_PlayActorSound(GLASS_HEAVYBREAK, i); break; case RRTILE8215: sprite[i].picnum = RRTILE5064; - spritesound(GLASS_HEAVYBREAK, i); + S_PlayActorSound(GLASS_HEAVYBREAK, i); break; case RRTILE8216: sprite[i].picnum = RRTILE5065; - spritesound(GLASS_HEAVYBREAK, i); + S_PlayActorSound(GLASS_HEAVYBREAK, i); break; case RRTILE8217: sprite[i].picnum = RRTILE5066; - spritesound(GLASS_HEAVYBREAK, i); + S_PlayActorSound(GLASS_HEAVYBREAK, i); break; case RRTILE8218: sprite[i].picnum = RRTILE5067; - spritesound(GLASS_HEAVYBREAK, i); + S_PlayActorSound(GLASS_HEAVYBREAK, i); break; case RRTILE8220: sprite[i].picnum = RRTILE5068; - spritesound(GLASS_HEAVYBREAK, i); + S_PlayActorSound(GLASS_HEAVYBREAK, i); break; case RRTILE8221: sprite[i].picnum = RRTILE5069; - spritesound(GLASS_HEAVYBREAK, i); + S_PlayActorSound(GLASS_HEAVYBREAK, i); break; case RRTILE8312: sprite[i].picnum = RRTILE5071; - spritesound(472, i); + S_PlayActorSound(472, i); break; case RRTILE8395: sprite[i].picnum = RRTILE5072; - spritesound(GLASS_HEAVYBREAK, i); + S_PlayActorSound(GLASS_HEAVYBREAK, i); break; case RRTILE8423: sprite[i].picnum = RRTILE5073; - spritesound(GLASS_HEAVYBREAK, i); + S_PlayActorSound(GLASS_HEAVYBREAK, i); break; case RRTILE3462: sprite[i].picnum = RRTILE5074; - spritesound(GLASS_HEAVYBREAK, i); + S_PlayActorSound(GLASS_HEAVYBREAK, i); break; case UWHIP: sprite[i].picnum = RRTILE5075; - spritesound(GLASS_HEAVYBREAK, i); + S_PlayActorSound(GLASS_HEAVYBREAK, i); break; case RRTILE8608: sprite[i].picnum = RRTILE5083; - spritesound(GLASS_HEAVYBREAK, i); + S_PlayActorSound(GLASS_HEAVYBREAK, i); break; case RRTILE8609: sprite[i].picnum = RRTILE5084; - spritesound(GLASS_HEAVYBREAK, i); + S_PlayActorSound(GLASS_HEAVYBREAK, i); break; case RRTILE8567: case RRTILE8568: @@ -1693,23 +1693,23 @@ void checkhitsprite_r(int i, int sn) case RRTILE8570: case RRTILE8571: sprite[i].picnum = RRTILE5082; - spritesound(GLASS_HEAVYBREAK, i); + S_PlayActorSound(GLASS_HEAVYBREAK, i); break; case RRTILE8640: sprite[i].picnum = RRTILE5085; - spritesound(GLASS_HEAVYBREAK, i); + S_PlayActorSound(GLASS_HEAVYBREAK, i); break; case RRTILE8611: sprite[i].picnum = RRTILE5086; - spritesound(GLASS_HEAVYBREAK, i); + S_PlayActorSound(GLASS_HEAVYBREAK, i); break; case TECHLIGHTBUST2: sprite[i].picnum = TECHLIGHTBUST4; - spritesound(GLASS_HEAVYBREAK, i); + S_PlayActorSound(GLASS_HEAVYBREAK, i); break; case RRTILE8497: sprite[i].picnum = RRTILE5076; - spritesound(GLASS_HEAVYBREAK, i); + S_PlayActorSound(GLASS_HEAVYBREAK, i); break; case RRTILE8162: case RRTILE8163: @@ -1720,7 +1720,7 @@ void checkhitsprite_r(int i, int sn) case RRTILE8168: changespritestat(i, 5); sprite[i].picnum = RRTILE5063; - spritesound(GLASS_HEAVYBREAK, i); + S_PlayActorSound(GLASS_HEAVYBREAK, i); break; case RRTILE8589: case RRTILE8590: @@ -1731,188 +1731,188 @@ void checkhitsprite_r(int i, int sn) case RRTILE8595: changespritestat(i, 5); sprite[i].picnum = RRTILE8588; - spritesound(GLASS_HEAVYBREAK, i); + S_PlayActorSound(GLASS_HEAVYBREAK, i); break; case RRTILE3497: sprite[i].picnum = RRTILE5076; - spritesound(GLASS_HEAVYBREAK, i); + S_PlayActorSound(GLASS_HEAVYBREAK, i); break; case RRTILE3498: sprite[i].picnum = RRTILE5077; - spritesound(GLASS_HEAVYBREAK, i); + S_PlayActorSound(GLASS_HEAVYBREAK, i); break; case RRTILE3499: sprite[i].picnum = RRTILE5078; - spritesound(GLASS_HEAVYBREAK, i); + S_PlayActorSound(GLASS_HEAVYBREAK, i); break; case RRTILE8503: sprite[i].picnum = RRTILE5079; - spritesound(GLASS_HEAVYBREAK, i); + S_PlayActorSound(GLASS_HEAVYBREAK, i); break; case RRTILE7901: sprite[i].picnum = RRTILE5080; - spritesound(GLASS_HEAVYBREAK, i); + S_PlayActorSound(GLASS_HEAVYBREAK, i); break; case RRTILE7696: sprite[i].picnum = RRTILE7697; - spritesound(DUKE_SHUCKS, i); + S_PlayActorSound(DUKE_SHUCKS, i); break; case RRTILE7806: sprite[i].picnum = RRTILE5043; - spritesound(GLASS_HEAVYBREAK, i); + S_PlayActorSound(GLASS_HEAVYBREAK, i); break; case RRTILE7885: case RRTILE7890: sprite[i].picnum = RRTILE5045; - spritesound(495, i); + S_PlayActorSound(495, i); fi.hitradius(i, 10, 0, 0, 1, 1); break; case RRTILE7886: sprite[i].picnum = RRTILE5046; - spritesound(495, i); + S_PlayActorSound(495, i); fi.hitradius(i, 10, 0, 0, 1, 1); break; case RRTILE7887: sprite[i].picnum = RRTILE5044; - spritesound(GLASS_HEAVYBREAK, i); + S_PlayActorSound(GLASS_HEAVYBREAK, i); fi.hitradius(i, 10, 0, 0, 1, 1); break; case RRTILE7900: sprite[i].picnum = RRTILE5047; - spritesound(GLASS_HEAVYBREAK, i); + S_PlayActorSound(GLASS_HEAVYBREAK, i); break; case RRTILE7906: sprite[i].picnum = RRTILE5048; - spritesound(GLASS_HEAVYBREAK, i); + S_PlayActorSound(GLASS_HEAVYBREAK, i); break; case RRTILE7912: case RRTILE7913: sprite[i].picnum = RRTILE5049; - spritesound(GLASS_HEAVYBREAK, i); + S_PlayActorSound(GLASS_HEAVYBREAK, i); break; case RRTILE8047: sprite[i].picnum = RRTILE5050; - spritesound(GLASS_HEAVYBREAK, i); + S_PlayActorSound(GLASS_HEAVYBREAK, i); break; case RRTILE8596: sprite[i].picnum = RRTILE8598; - spritesound(GLASS_HEAVYBREAK, i); + S_PlayActorSound(GLASS_HEAVYBREAK, i); break; case RRTILE8059: sprite[i].picnum = RRTILE5051; - spritesound(GLASS_HEAVYBREAK, i); + S_PlayActorSound(GLASS_HEAVYBREAK, i); break; case RRTILE8060: sprite[i].picnum = RRTILE5052; - spritesound(GLASS_HEAVYBREAK, i); + S_PlayActorSound(GLASS_HEAVYBREAK, i); break; case RRTILE8222: sprite[i].picnum = RRTILE5053; - spritesound(GLASS_HEAVYBREAK, i); + S_PlayActorSound(GLASS_HEAVYBREAK, i); break; case RRTILE8223: sprite[i].picnum = RRTILE5054; - spritesound(GLASS_HEAVYBREAK, i); + S_PlayActorSound(GLASS_HEAVYBREAK, i); break; case RRTILE8224: sprite[i].picnum = RRTILE5055; - spritesound(GLASS_HEAVYBREAK, i); + S_PlayActorSound(GLASS_HEAVYBREAK, i); break; case RRTILE8370: sprite[i].picnum = RRTILE5056; - spritesound(GLASS_HEAVYBREAK, i); + S_PlayActorSound(GLASS_HEAVYBREAK, i); break; case RRTILE8371: sprite[i].picnum = RRTILE5057; - spritesound(GLASS_HEAVYBREAK, i); + S_PlayActorSound(GLASS_HEAVYBREAK, i); break; case RRTILE8372: sprite[i].picnum = RRTILE5058; - spritesound(GLASS_HEAVYBREAK, i); + S_PlayActorSound(GLASS_HEAVYBREAK, i); break; case RRTILE8373: sprite[i].picnum = RRTILE5059; - spritesound(GLASS_HEAVYBREAK, i); + S_PlayActorSound(GLASS_HEAVYBREAK, i); break; case RRTILE8396: sprite[i].picnum = RRTILE5038; - spritesound(GLASS_HEAVYBREAK, i); + S_PlayActorSound(GLASS_HEAVYBREAK, i); break; case RRTILE8397: sprite[i].picnum = RRTILE5039; - spritesound(GLASS_HEAVYBREAK, i); + S_PlayActorSound(GLASS_HEAVYBREAK, i); break; case RRTILE8398: sprite[i].picnum = RRTILE5040; - spritesound(GLASS_HEAVYBREAK, i); + S_PlayActorSound(GLASS_HEAVYBREAK, i); break; case RRTILE8399: sprite[i].picnum = RRTILE5041; - spritesound(GLASS_HEAVYBREAK, i); + S_PlayActorSound(GLASS_HEAVYBREAK, i); break; case RRTILE8385: sprite[i].picnum = RRTILE8386; - spritesound(GLASS_HEAVYBREAK, i); + S_PlayActorSound(GLASS_HEAVYBREAK, i); break; case RRTILE8387: sprite[i].picnum = RRTILE8388; - spritesound(GLASS_HEAVYBREAK, i); + S_PlayActorSound(GLASS_HEAVYBREAK, i); break; case RRTILE8389: sprite[i].picnum = RRTILE8390; - spritesound(GLASS_HEAVYBREAK, i); + S_PlayActorSound(GLASS_HEAVYBREAK, i); break; case RRTILE8391: sprite[i].picnum = RRTILE8392; - spritesound(GLASS_HEAVYBREAK, i); + S_PlayActorSound(GLASS_HEAVYBREAK, i); break; case RRTILE7553: sprite[i].picnum = RRTILE5035; - spritesound(GLASS_HEAVYBREAK, i); + S_PlayActorSound(GLASS_HEAVYBREAK, i); break; case RRTILE8475: sprite[i].picnum = RRTILE5075; - spritesound(GLASS_HEAVYBREAK, i); + S_PlayActorSound(GLASS_HEAVYBREAK, i); break; case RRTILE8498: sprite[i].picnum = RRTILE5077; - spritesound(GLASS_HEAVYBREAK, i); + S_PlayActorSound(GLASS_HEAVYBREAK, i); break; case RRTILE8499: sprite[i].picnum = RRTILE5078; - spritesound(GLASS_HEAVYBREAK, i); + S_PlayActorSound(GLASS_HEAVYBREAK, i); break; case RRTILE2445: sprite[i].picnum = RRTILE2450; - spritesound(GLASS_HEAVYBREAK, i); + S_PlayActorSound(GLASS_HEAVYBREAK, i); break; case RRTILE2123: sprite[i].picnum = RRTILE2124; - spritesound(GLASS_BREAKING, i); + S_PlayActorSound(GLASS_BREAKING, i); lotsofglass(i, -1, 10); break; case RRTILE3773: sprite[i].picnum = RRTILE8651; - spritesound(GLASS_BREAKING, i); + S_PlayActorSound(GLASS_BREAKING, i); lotsofglass(i, -1, 10); break; case RRTILE7533: sprite[i].picnum = RRTILE5035; - spritesound(495, i); + S_PlayActorSound(495, i); fi.hitradius(i, 10, 0, 0, 1, 1); break; case RRTILE8394: sprite[i].picnum = RRTILE5072; - spritesound(495, i); + S_PlayActorSound(495, i); break; case RRTILE8461: case RRTILE8462: sprite[i].picnum = RRTILE5074; - spritesound(GLASS_HEAVYBREAK, i); + S_PlayActorSound(GLASS_HEAVYBREAK, i); break; case RRTILE8679: sprite[i].picnum = RRTILE8680; - spritesound(DUKE_SHUCKS, i); + S_PlayActorSound(DUKE_SHUCKS, i); fi.hitradius(i, 10, 0, 0, 1, 1); if (sprite[i].lotag != 0) { @@ -1929,12 +1929,12 @@ void checkhitsprite_r(int i, int sn) break; case RRTILE3584: sprite[i].picnum = RRTILE8681; - spritesound(495, i); + S_PlayActorSound(495, i); fi.hitradius(i, 250, 0, 0, 1, 1); break; case RRTILE8682: sprite[i].picnum = RRTILE8683; - spritesound(GLASS_HEAVYBREAK, i); + S_PlayActorSound(GLASS_HEAVYBREAK, i); break; case RRTILE8099: if (sprite[i].lotag == 5) @@ -1942,7 +1942,7 @@ void checkhitsprite_r(int i, int sn) short j; sprite[i].lotag = 0; sprite[i].picnum = RRTILE5087; - spritesound(340, i); + S_PlayActorSound(340, i); for (j = 0; j < MAXSPRITES; j++) { if (sprite[j].picnum == RRTILE8094) @@ -1973,14 +1973,14 @@ void checkhitsprite_r(int i, int sn) sprite[i].picnum = RRTILE2455; break; case RRTILE2455: - spritesound(SQUISHED, i); + S_PlayActorSound(SQUISHED, i); fi.guts(&sprite[i], RRTILE2465, 3, myconnectindex); deletesprite(i); break; case RRTILE2451: if (sprite[i].pal != 4) { - spritesound(SQUISHED, i); + S_PlayActorSound(SQUISHED, i); if (sprite[i].lotag != 0) { short j; @@ -2010,7 +2010,7 @@ void checkhitsprite_r(int i, int sn) } break; case RRTILE2437: - spritesound(439, i); + S_PlayActorSound(439, i); break; } @@ -2030,7 +2030,7 @@ void checkhitsprite_r(int i, int sn) break; case RRTILE2030: sprite[i].picnum = RRTILE2034; - spritesound(GLASS_BREAKING, i); + S_PlayActorSound(GLASS_BREAKING, i); lotsofglass(i, -1, 10); break; case RRTILE2893: @@ -2052,7 +2052,7 @@ void checkhitsprite_r(int i, int sn) sprite[i].picnum = RRTILE3216; break; } - spritesound(GLASS_BREAKING, i); + S_PlayActorSound(GLASS_BREAKING, i); lotsofglass(i, -1, 10); break; case RRTILE2156: @@ -2060,13 +2060,13 @@ void checkhitsprite_r(int i, int sn) case RRTILE2160: case RRTILE2175: sprite[i].picnum++; - spritesound(GLASS_BREAKING, i); + S_PlayActorSound(GLASS_BREAKING, i); lotsofglass(i, -1, 10); break; case RRTILE2137: case RRTILE2151: case RRTILE2152: - spritesound(GLASS_BREAKING, i); + S_PlayActorSound(GLASS_BREAKING, i); lotsofglass(i, -1, 10); sprite[i].picnum++; for (k = 0; k < 6; k++) @@ -2075,7 +2075,7 @@ void checkhitsprite_r(int i, int sn) case BOWLINGBALL: sprite[sn].xvel = (sprite[i].xvel >> 1) + (sprite[i].xvel >> 2); sprite[sn].ang -= (krand() & 16); - spritesound(355, i); + S_PlayActorSound(355, i); break; case STRIPEBALL: @@ -2090,21 +2090,21 @@ void checkhitsprite_r(int i, int sn) sprite[sn].ang -= (sprite[i].ang << 1) + 1024; sprite[i].ang = getangle(sprite[i].x - sprite[sn].x, sprite[i].y - sprite[sn].y) - 512; if (S_CheckSoundPlaying(POOLBALLHIT) < 2) - spritesound(POOLBALLHIT, i); + S_PlayActorSound(POOLBALLHIT, i); } else if (sprite[sn].picnum == RRTILE3440 || sprite[sn].picnum == RRTILE3440 + 1) { sprite[sn].xvel = (sprite[i].xvel >> 1) + (sprite[i].xvel >> 2); sprite[sn].ang -= ((sprite[i].ang << 1) + krand()) & 64; sprite[i].ang = (sprite[i].ang + krand()) & 16; - spritesound(355, i); + S_PlayActorSound(355, i); } else if (sprite[sn].picnum == HENSTAND || sprite[sn].picnum == HENSTAND + 1) { sprite[sn].xvel = (sprite[i].xvel >> 1) + (sprite[i].xvel >> 2); sprite[sn].ang -= ((sprite[i].ang << 1) + krand()) & 16; sprite[i].ang = (sprite[i].ang + krand()) & 16; - spritesound(355, i); + S_PlayActorSound(355, i); } else { @@ -2176,7 +2176,7 @@ void checkhitsprite_r(int i, int sn) case FANSPRITE: sprite[i].picnum = FANSPRITEBROKE; sprite[i].cstat &= (65535 - 257); - spritesound(GLASS_HEAVYBREAK, i); + S_PlayActorSound(GLASS_HEAVYBREAK, i); s = &sprite[i]; for (j = 0; j < 16; j++) RANDOMSCRAP(s, i); @@ -2234,12 +2234,12 @@ void checkhitsprite_r(int i, int sn) else if (sprite[i].picnum == STATUE || sprite[i].picnum == STATUEFLASH) { lotsofcolourglass(i, -1, 40); - spritesound(GLASS_HEAVYBREAK, i); + S_PlayActorSound(GLASS_HEAVYBREAK, i); } else if (sprite[i].picnum == VASE) lotsofglass(i, -1, 40); - spritesound(GLASS_BREAKING, i); + S_PlayActorSound(GLASS_BREAKING, i); sprite[i].ang = krand() & 2047; lotsofglass(i, -1, 8); deletesprite(i); @@ -2249,7 +2249,7 @@ void checkhitsprite_r(int i, int sn) case RRTILE3172: if (!isRRRA()) break; case BOTTLE7: - spritesound(GLASS_BREAKING, i); + S_PlayActorSound(GLASS_BREAKING, i); lotsofglass(i, -1, 10); deletesprite(i); break; @@ -2265,7 +2265,7 @@ void checkhitsprite_r(int i, int sn) sprite[i].cstat |= (krand() & 1) << 2; sprite[i].cstat &= ~257; fi.spawn(i, TOILETWATER); - spritesound(GLASS_BREAKING, i); + S_PlayActorSound(GLASS_BREAKING, i); break; case STALL: @@ -2273,7 +2273,7 @@ void checkhitsprite_r(int i, int sn) sprite[i].cstat |= (krand() & 1) << 2; sprite[i].cstat &= ~257; fi.spawn(i, TOILETWATER); - spritesound(GLASS_HEAVYBREAK, i); + S_PlayActorSound(GLASS_HEAVYBREAK, i); break; case HYDRENT: @@ -2285,19 +2285,19 @@ void checkhitsprite_r(int i, int sn) // j = EGS(sprite[i].sectnum,sprite[i].x,sprite[i].y,sprite[i].z-(krand()%(48<<8)),SCRAP3+(krand()&3),-8,48,48,krand()&2047,(krand()&63)+64,-(krand()&4095)-(sprite[i].zvel>>2),i,5); // sprite[j].pal = 2; // } - spritesound(GLASS_HEAVYBREAK, i); + S_PlayActorSound(GLASS_HEAVYBREAK, i); break; case GRATE1: sprite[i].picnum = BGRATE1; sprite[i].cstat &= (65535 - 256 - 1); - spritesound(VENT_BUST, i); + S_PlayActorSound(VENT_BUST, i); break; case CIRCLEPANNEL: sprite[i].picnum = CIRCLEPANNELBROKE; sprite[i].cstat &= (65535 - 256 - 1); - spritesound(VENT_BUST, i); + S_PlayActorSound(VENT_BUST, i); break; case PIPE1: @@ -2334,7 +2334,7 @@ void checkhitsprite_r(int i, int sn) case POT1: case POT2: case POT3: - spritesound(GLASS_HEAVYBREAK, i); + S_PlayActorSound(GLASS_HEAVYBREAK, i); s = &sprite[i]; for (j = 0; j < 16; j++) RANDOMSCRAP(s, i); deletesprite(i); @@ -2468,7 +2468,7 @@ void checksectors_r(int snum) if (sector[p->cursectnum].lotag >= 10000) { if (snum == screenpeek || ud.coop == 1) - spritesound(sector[p->cursectnum].lotag - 10000, p->i); + S_PlayActorSound(sector[p->cursectnum].lotag - 10000, p->i); sector[p->cursectnum].lotag = 0; } break; @@ -2499,20 +2499,20 @@ void checksectors_r(int snum) if (hitscanwall >= 0 && wall[hitscanwall].overpicnum == MIRROR && snum == screenpeek) if (numplayers == 1) { - if (A_CheckSoundPlaying(p->i, 27) == 0 && A_CheckSoundPlaying(p->i, 28) == 0 && A_CheckSoundPlaying(p->i, 29) == 0 - && A_CheckSoundPlaying(p->i, 257) == 0 && A_CheckSoundPlaying(p->i, 258) == 0) + if (S_CheckActorSoundPlaying(p->i, 27) == 0 && S_CheckActorSoundPlaying(p->i, 28) == 0 && S_CheckActorSoundPlaying(p->i, 29) == 0 + && S_CheckActorSoundPlaying(p->i, 257) == 0 && S_CheckActorSoundPlaying(p->i, 258) == 0) { short snd = krand() % 5; if (snd == 0) - spritesound(27, p->i); + S_PlayActorSound(27, p->i); else if (snd == 1) - spritesound(28, p->i); + S_PlayActorSound(28, p->i); else if (snd == 2) - spritesound(29, p->i); + S_PlayActorSound(29, p->i); else if (snd == 3) - spritesound(257, p->i); + S_PlayActorSound(257, p->i); else if (snd == 4) - spritesound(258, p->i); + S_PlayActorSound(258, p->i); } return; } @@ -2520,9 +2520,9 @@ void checksectors_r(int snum) else { if (hitscanwall >= 0 && wall[hitscanwall].overpicnum == MIRROR) - if (wall[hitscanwall].lotag > 0 && A_CheckSoundPlaying(p->i, wall[hitscanwall].lotag) == 0 && snum == screenpeek) + if (wall[hitscanwall].lotag > 0 && S_CheckActorSoundPlaying(p->i, wall[hitscanwall].lotag) == 0 && snum == screenpeek) { - spritesound(wall[hitscanwall].lotag, p->i); + S_PlayActorSound(wall[hitscanwall].lotag, p->i); return; } } @@ -2609,8 +2609,8 @@ void checksectors_r(int snum) { case RRTILE8448: if (!isRRRA()) return; - if (!A_CheckSoundPlaying(neartagsprite, 340)) - A_PlaySound(340, neartagsprite); + if (!S_CheckActorSoundPlaying(neartagsprite, 340)) + S_PlayActorSound(340, neartagsprite); return; case RRTILE8704: if (!isRRRA()) return; @@ -2622,14 +2622,14 @@ void checksectors_r(int snum) if (!S_CheckSoundPlaying(neartagsprite, 445) && !S_CheckSoundPlaying(neartagsprite, 446) && !S_CheckSoundPlaying(neartagsprite, 447) && sound445done != 0) { if ((krand() % 2) == 1) - spritesound(446, neartagsprite); + S_PlayActorSound(446, neartagsprite); else - spritesound(447, neartagsprite); + S_PlayActorSound(447, neartagsprite); } } else { - spritesound(445, neartagsprite); + S_PlayActorSound(445, neartagsprite); sound445done = 1; } } @@ -2654,7 +2654,7 @@ void checksectors_r(int snum) case RRTILE8595: if (!isRRRA()) return; sprite[neartagsprite].extra = 60; - spritesound(235, neartagsprite); + S_PlayActorSound(235, neartagsprite); return; case TOILET: @@ -2663,7 +2663,7 @@ void checksectors_r(int snum) case RRTILE2122: if (p->last_pissed_time == 0) { - if (adult_lockout == 0) spritesound(435, p->i); + if (adult_lockout == 0) S_PlayActorSound(435, p->i); p->last_pissed_time = 26 * 220; p->transporter_hold = 29 * 2; @@ -2680,8 +2680,8 @@ void checksectors_r(int snum) else if (sprite[p->i].extra < max_player_health) sprite[p->i].extra = max_player_health; } - else if (A_CheckSoundPlaying(p->i, DUKE_GRUNT) == 0) - spritesound(DUKE_GRUNT, p->i); + else if (S_CheckActorSoundPlaying(p->i, DUKE_GRUNT) == 0) + S_PlayActorSound(DUKE_GRUNT, p->i); return; case WATERFOUNTAIN: if (hittype[neartagsprite].temp_data[0] != 1) @@ -2692,12 +2692,12 @@ void checksectors_r(int snum) if (sprite[p->i].extra < max_player_health) { sprite[p->i].extra++; - spritesound(DUKE_DRINKING, p->i); + S_PlayActorSound(DUKE_DRINKING, p->i); } } return; case PLUG: - spritesound(SHORT_CIRCUIT, p->i); + S_PlayActorSound(SHORT_CIRCUIT, p->i); sprite[p->i].extra -= 2 + (krand() & 3); SetPlayerPal(p, PalEntry(32, 48, 48, 64)); break; @@ -2710,8 +2710,8 @@ void checksectors_r(int snum) if (abs(hits(p->i)) < 512) { if ((krand() & 255) < 16) - spritesound(DUKE_SEARCH2, p->i); - else spritesound(DUKE_SEARCH, p->i); + S_PlayActorSound(DUKE_SEARCH2, p->i); + else S_PlayActorSound(DUKE_SEARCH, p->i); return; } @@ -2740,9 +2740,9 @@ void checksectors_r(int snum) else { if (hittype[neartagsprite].spriteextra > 3) - spritesound(99, p->i); + S_PlayActorSound(99, p->i); else - spritesound(419, p->i); + S_PlayActorSound(419, p->i); FTA(41, p); } } @@ -2761,9 +2761,9 @@ void checksectors_r(int snum) else { if (hittype[neartagsprite].spriteextra > 3) - spritesound(99, p->i); + S_PlayActorSound(99, p->i); else - spritesound(419, p->i); + S_PlayActorSound(419, p->i); FTA(41, p); } } @@ -2834,8 +2834,8 @@ void dofurniture(int wl, int sect, int snum) var_C = 0; if (var_C) { - if (A_CheckSoundPlaying(ps[snum].i, 389) == 0) - spritesound(389, ps[snum].i); + if (S_CheckActorSoundPlaying(ps[snum].i, 389) == 0) + S_PlayActorSound(389, ps[snum].i); for (i = startwall; i < endwall; i++) { x = wall[i].x; diff --git a/source/games/duke/src/sounds.cpp b/source/games/duke/src/sounds.cpp index 6e04aadb1..f01314931 100644 --- a/source/games/duke/src/sounds.cpp +++ b/source/games/duke/src/sounds.cpp @@ -106,7 +106,7 @@ void S_PauseSounds(bool paused) // //========================================================================== -void cacheAllSounds(void) +void S_CacheAllSounds(void) { auto& sfx = soundEngine->GetSounds(); int i = 0; @@ -430,7 +430,7 @@ int S_PlaySound3D(int sndnum, int spriteNum, const vec3_t* pos, int channel, ECh bool is_playing = soundEngine->GetSoundPlayingInfo(SOURCE_Any, nullptr, sndnum+1); if (is_playing && sp->picnum != MUSICANDSFX) - S_StopEnvSound(sndnum, spriteNum); + S_StopSound(sndnum, spriteNum); int const repeatp = (userflags & SF_LOOP); @@ -478,13 +478,13 @@ int S_PlaySound(int sndnum, int channel, EChanFlags flags) // //========================================================================== -int A_PlaySound(int soundNum, int spriteNum, int channel, EChanFlags flags) +int S_PlayActorSound(int soundNum, int spriteNum, int channel, EChanFlags flags) { return (unsigned)spriteNum >= MAXSPRITES ? S_PlaySound(soundNum, channel, flags) : S_PlaySound3D(soundNum, spriteNum, &sprite[spriteNum].pos, channel, flags); } -void S_StopEnvSound(int sndNum, int sprNum, int channel) +void S_StopSound(int sndNum, int sprNum, int channel) { if (sprNum < -1 || sprNum >= MAXSPRITES) return; @@ -520,7 +520,7 @@ void S_ChangeSoundPitch(int soundNum, int spriteNum, int pitchoffset) // //========================================================================== -int A_CheckSoundPlaying(int spriteNum, int soundNum, int channel) +int S_CheckActorSoundPlaying(int spriteNum, int soundNum, int channel) { if (spriteNum == -1) return soundEngine->GetSoundPlayingInfo(SOURCE_Any, nullptr, soundNum+1); if ((unsigned)spriteNum >= MAXSPRITES) return false; @@ -528,7 +528,7 @@ int A_CheckSoundPlaying(int spriteNum, int soundNum, int channel) } // Check if actor is playing any sound. -int A_CheckAnySoundPlaying(int spriteNum) +int S_CheckAnyActorSoundPlaying(int spriteNum) { if ((unsigned)spriteNum >= MAXSPRITES) return false; return soundEngine->IsSourcePlayingSomething(SOURCE_Actor, &sprite[spriteNum], CHAN_AUTO, 0); @@ -625,7 +625,7 @@ void S_PlayRRMusic(int newTrack) } -void PlayBonusMusic() +void S_PlayBonusMusic() { if (MusicEnabled() && mus_enabled) S_PlaySound(BONUSMUSIC, CHAN_AUTO, CHANF_UI); diff --git a/source/games/duke/src/sounds.h b/source/games/duke/src/sounds.h index 1b150af7d..f28d9a2c7 100644 --- a/source/games/duke/src/sounds.h +++ b/source/games/duke/src/sounds.h @@ -35,49 +35,39 @@ enum esound_t kMaxUserData }; -int A_CheckSoundPlaying(int spriteNum, int soundNum, int channel = 0); -int A_PlaySound(int soundNum, int spriteNum, int channel = CHAN_AUTO, EChanFlags flags = 0); -inline int spritesound(int soundnum, int spritenum) -{ - return A_PlaySound(soundnum, spritenum); -} -int A_CheckAnySoundPlaying(int spriteNum); +void S_InitSound(); +void S_Update(void); +void S_CacheAllSounds(void); +int S_DefineSound(unsigned index, const char* filename, int ps, int pe, int pr, int m, int vo, float vol); + +int S_PlaySound(int num, int channel = CHAN_AUTO, EChanFlags flags = 0); +int S_PlaySound3D(int num, int spriteNum, const vec3_t* pos, int channel = CHAN_AUTO, EChanFlags flags = 0); +int S_PlayActorSound(int soundNum, int spriteNum, int channel = CHAN_AUTO, EChanFlags flags = 0); +void S_MenuSound(void); + +void S_StopSound(int sndNum, int sprNum = -1, int flags = -1); + int S_CheckSoundPlaying(int soundNum); inline int S_CheckSoundPlaying(int sprnum, int soundNum) { return S_CheckSoundPlaying(soundNum); } -void cacheAllSounds(void); -void S_MenuSound(void); -void S_PauseMusic(bool paused); -void S_PauseSounds(bool paused); -void S_PlayLevelMusic(MapRecord* mi); -void S_PlaySpecialMusic(unsigned int); -void S_ContinueLevelMusic(void); -int S_PlaySound(int num, int channel = CHAN_AUTO, EChanFlags flags = 0); -inline int sound(int num) -{ - return S_PlaySound(num); -} -int S_PlaySound3D(int num, int spriteNum, const vec3_t *pos, int channel = CHAN_AUTO, EChanFlags flags = 0); -void S_StopEnvSound(int sndNum,int sprNum, int flags = -1); -inline void stopsound(int snd) -{ - S_StopEnvSound(snd, -1); -} -#define S_StopSound(num) S_StopEnvSound(num, -1) +int S_CheckActorSoundPlaying(int spriteNum, int soundNum, int channel = 0); +int S_CheckAnyActorSoundPlaying(int spriteNum); -void S_Update(void); +void S_PauseSounds(bool paused); void S_ChangeSoundPitch(int soundNum, int spriteNum, int pitchoffset); int S_GetUserFlags(int sndnum); -int S_DefineSound(unsigned index, const char* filename, int ps, int pe, int pr, int m, int vo, float vol); -void S_InitSound(); -void S_PlayRRMusic(int newTrack = -1); -void PlayBonusMusic(); inline bool S_IsSoundValid(int num) { return (!soundEngine->isValidSoundId(num + 1)); - } + +void S_PlayRRMusic(int newTrack = -1); +void S_PlayBonusMusic(); +void S_PlayLevelMusic(MapRecord* mi); +void S_PlaySpecialMusic(unsigned int); +void S_ContinueLevelMusic(void); + // Placeholders. inline void StopCommentary() {}