From 58253c2d206664d5f2134714558fae595092a0c5 Mon Sep 17 00:00:00 2001 From: Simon Date: Thu, 25 Mar 2021 22:32:07 +0000 Subject: [PATCH] Small tidy up --- .../jni/d3es-multithread-master/neo/game/Entity.cpp | 2 +- .../d3es-multithread-master/neo/sound/snd_world.cpp | 10 +++------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/Projects/Android/jni/d3es-multithread-master/neo/game/Entity.cpp b/Projects/Android/jni/d3es-multithread-master/neo/game/Entity.cpp index 6fb4c43..17df54a 100644 --- a/Projects/Android/jni/d3es-multithread-master/neo/game/Entity.cpp +++ b/Projects/Android/jni/d3es-multithread-master/neo/game/Entity.cpp @@ -1643,7 +1643,7 @@ bool idEntity::StartSoundShader( const idSoundShader *shader, const s_channelTyp directionYaw.Normalize360(); //Pass sound on in case it can trigger a haptic event (like doors) - float intensity = looping ? (100.0f - distance) : + float intensity = looping ? ((distance * 100)/ 150.0f) : 40 + Min((int)(150.0f - distance), 80); common->HapticEvent(shader->GetName(), 4, looping ? 1 : 0, intensity, diff --git a/Projects/Android/jni/d3es-multithread-master/neo/sound/snd_world.cpp b/Projects/Android/jni/d3es-multithread-master/neo/sound/snd_world.cpp index d0c5215..84bdc42 100644 --- a/Projects/Android/jni/d3es-multithread-master/neo/sound/snd_world.cpp +++ b/Projects/Android/jni/d3es-multithread-master/neo/sound/snd_world.cpp @@ -26,7 +26,6 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include #include "sys/platform.h" #include "framework/FileSystem.h" #include "framework/Session.h" @@ -1593,8 +1592,6 @@ void idSoundWorldLocal::CalcEars( int numSpeakers, idVec3 spatializedOrigin, idV } } -extern idGame * game; - /* =============== idSoundWorldLocal::AddChannelContribution @@ -1762,20 +1759,19 @@ void idSoundWorldLocal::AddChannelContribution( idSoundEmitterLocal *sound, idSo float *alignedInputSamples = (float *) ( ( ( (intptr_t)inputSamples ) + 15 ) & ~15 ); if (cvarSystem->GetCVarBool("vr_bhaptics") && - looping && - game != NULL) + looping) { idVec3 direction = (listenerPos / DOOM_TO_METERS) - sound->origin; float distance = direction.Length(); - if (distance <= 100.0F) { + if (distance <= 150.0F) { direction.Normalize(); idAngles bodyAng = listenerAxis.ToAngles(); idAngles directionYaw(0, 180 + (direction.ToYaw() - bodyAng.yaw), 0); directionYaw.Normalize360(); - int intensity = 100 - distance; + int intensity = (int)((distance * 100)/ 150.0f); Doom3Quest_HapticUpdateEvent(shader->GetName(), intensity, directionYaw.yaw); } else{ Doom3Quest_HapticUpdateEvent(shader->GetName(), 0, 0);