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/Person.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/Person.cpp') diff --git a/src/Person.cpp b/src/Person.cpp index ea2280c..7630000 100644 --- a/src/Person.cpp +++ b/src/Person.cpp @@ -20,6 +20,7 @@ #include #include "Person.h" +#include "misc.h" extern float multiplier; extern unsigned int gSourceID[37]; @@ -234,9 +235,8 @@ void Person::DoAnimations(int who) auto soundsrc = (DoRotation(head_joint.position, 0, playerrotation, 0) + playercoords - camera.position) / soundscalefactor; - ALfloat gLoc[] {soundsrc.x, soundsrc.y, soundsrc.z}; - alSourcefv(gSourceID[bodyhitsound], AL_POSITION, gLoc); - alSourcePlay(gSourceID[bodyhitsound]); + playSound(gSourceID[bodyhitsound], + soundsrc.x, soundsrc.y, soundsrc.z); bleeding = 1; bleeddelay = 1; bjoint1 = &head_joint; @@ -614,9 +614,8 @@ void Person::DoAnimationslite(int who) auto soundsrc = (DoRotation(head_joint.position, 0, playerrotation, 0) + playercoords - camera.position) / soundscalefactor; - ALfloat gLoc[] {soundsrc.x, soundsrc.y, soundsrc.z}; - alSourcefv(gSourceID[bodyhitsound], AL_POSITION, gLoc); - alSourcePlay(gSourceID[bodyhitsound]); + playSound(gSourceID[bodyhitsound], + soundsrc.x, soundsrc.y, soundsrc.z); bleeding = 1; bleeddelay = 1; bjoint1 = &head_joint; @@ -629,7 +628,6 @@ void Person::DoAnimationslite(int who) targetframe = 0; else if (targetframe < 0) targetframe = animation[currentanimation].numframes - 1; - target = 0; if ((currentanimation == getupfrontanim -- cgit v1.2.3