From 3f12f26560fc04a5a9ccc2964e900f79a61e510c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Gia=20Phong?= Date: Fri, 24 Sep 2021 15:59:13 +0700 Subject: Replace a few sound effects --- src/GameLoop.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/GameLoop.cpp') diff --git a/src/GameLoop.cpp b/src/GameLoop.cpp index b3810c6..e89eb2e 100644 --- a/src/GameLoop.cpp +++ b/src/GameLoop.cpp @@ -20,6 +20,7 @@ // along with Black Shades. If not, see . #include "Game.h" +#include "misc.h" extern float multiplier; extern int thirdperson; @@ -95,11 +96,9 @@ void handleKey(Game* game, int key, int action, int mods) person.averageloc) > 200) continue; - auto soundsrc = (player.playercoords - - camera.position) / soundscalefactor; - float gLoc[] {soundsrc.x, soundsrc.y, soundsrc.z}; - alSourcefv(gSourceID[clicksound], AL_POSITION, gLoc); - alSourcePlay(gSourceID[clicksound]); + auto soundpos = player.playercoords - camera.position; + playSound(gSourceID[clicksound], + soundpos.x, soundpos.y, soundpos.z); auto tmp_gun = player.whichgun; player.whichgun = person.whichgun; -- cgit v1.2.3