From f401d4bb445064ee647ca28c3ecab0407c55b230 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 1 Nov 2021 08:40:32 +0100 Subject: [PATCH] - SW: don't spawn sprites to play wall sounds. This function isn't really necessary because we got a sound playing variant that takes a world coordinate, which is far more practical here. Worse, this was leaking sprites. --- source/games/sw/src/jsector.cpp | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/source/games/sw/src/jsector.cpp b/source/games/sw/src/jsector.cpp index 9b5bc1a33..f240c98cd 100644 --- a/source/games/sw/src/jsector.cpp +++ b/source/games/sw/src/jsector.cpp @@ -80,25 +80,14 @@ extern ParentalStruct aVoxelArray[MAXTILES]; ///////////////////////////////////////////////////// void SpawnWallSound(short sndnum, short i) { - short SpriteNum; vec3_t mid; - SPRITEp sp; - SpriteNum = COVERinsertsprite(0, STAT_DEFAULT); - if (SpriteNum < 0) - return; - - sp = &sprite[SpriteNum]; - sp->cstat = 0; - sp->extra = 0; // Get wall midpoint for offset in mirror view mid.x = (wall[i].x + wall[wall[i].point2].x) / 2; mid.y = (wall[i].y + wall[wall[i].point2].y) / 2; mid.z = (sector[wall[i].nextsector].ceilingz + sector[wall[i].nextsector].floorz) / 2; - setspritez(SpriteNum, &mid); - sp = &sprite[SpriteNum]; - PlaySound(sndnum, sp, v3df_dontpan | v3df_doppler); + PlaySound(sndnum, &mid, v3df_dontpan | v3df_doppler); } short