aboutsummaryrefslogtreecommitdiff
path: root/src/Skeleton.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/Skeleton.cpp
parent0ce03e65978dd1e0d4fdf590fc4eadd639d1a57d (diff)
downloadblackshades-3f12f26560fc04a5a9ccc2964e900f79a61e510c.tar.gz
Replace a few sound effects
Diffstat (limited to 'src/Skeleton.cpp')
-rw-r--r--src/Skeleton.cpp24
1 files changed, 4 insertions, 20 deletions
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);
}
}
}