aboutsummaryrefslogtreecommitdiff
path: root/src/GameLoop.cpp
diff options
context:
space:
mode:
authorNguyễn Gia Phong <mcsinyx@disroot.org>2021-09-24 15:59:13 +0700
committerNguyễn Gia Phong <mcsinyx@disroot.org>2021-09-24 15:59:13 +0700
commit3f12f26560fc04a5a9ccc2964e900f79a61e510c (patch)
tree3ae078546287ccad3f03499b5043f49c59c7b962 /src/GameLoop.cpp
parent0ce03e65978dd1e0d4fdf590fc4eadd639d1a57d (diff)
downloadblackshades-3f12f26560fc04a5a9ccc2964e900f79a61e510c.tar.gz
Replace a few sound effects
Diffstat (limited to 'src/GameLoop.cpp')
-rw-r--r--src/GameLoop.cpp9
1 files changed, 4 insertions, 5 deletions
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 <https://www.gnu.org/licenses/>.
#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;