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/Skeleton.cpp | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) (limited to 'src/Skeleton.cpp') diff --git a/src/Skeleton.cpp b/src/Skeleton.cpp index 4f2a2a7..7dcdaa1 100644 --- a/src/Skeleton.cpp +++ b/src/Skeleton.cpp @@ -1,7 +1,7 @@ /**> HEADER FILES <**/ #include "Skeleton.h" - #include "Serialize.h" +#include "misc.h" extern float multiplier; extern unsigned int gSourceID[37]; @@ -169,25 +169,9 @@ void Skeleton::DoConstraints(Model *collide, XYZ *move, float rotation) if (playing != AL_PLAYING && (findLengthfast(joints[i].velocity) > 2 || findLengthfast(avgvelocity) > 2)) { - ALfloat gain = - findLengthfast(avgvelocity - + joints[i].velocity) - / findDistancefast(pos, - camera.position) - * soundscalefactor * 4; - alSourcef(gSourceID[landsound], - AL_MIN_GAIN, gain); - alSourcef(gSourceID[landsound], - AL_MAX_GAIN, gain); - - float gLoc[] { - pos.x / soundscalefactor, - pos.y / soundscalefactor, - pos.z / soundscalefactor, - }; - alSourcefv(gSourceID[landsound], - AL_POSITION, gLoc); - alSourcePlay(gSourceID[landsound]); + auto soundpos = pos - camera.position; + playSound(gSourceID[landsound], + soundpos.x, soundpos.y, soundpos.z); } } } -- cgit v1.2.3