1
0
Fork 0
mirror of https://github.com/halpz/re3.git synced 2024-12-22 17:35:29 +00:00

A few small audio changes

This commit is contained in:
Sergeanur 2021-08-20 14:28:18 +03:00
parent c168786b42
commit ef0b5f857d
2 changed files with 7 additions and 7 deletions

View file

@ -1113,12 +1113,12 @@ cAudioManager::AdjustSamplesVolume()
} }
uint8 uint8
cAudioManager::ComputeEmittingVolume(uint8 emittingVolume, float intensity, float dist) cAudioManager::ComputeEmittingVolume(uint8 emittingVolume, float maxDistance, float distance)
{ {
float quatIntensity = intensity / 4.0f; float minDistance = maxDistance / 4.0f;
float diffIntensity = intensity - quatIntensity; float diffDistance = maxDistance - minDistance;
if (dist > diffIntensity) if (distance > diffDistance)
return (quatIntensity - (dist - diffIntensity)) * (float)emittingVolume / quatIntensity; return (minDistance - (distance - diffDistance)) * (float)emittingVolume / minDistance;
return emittingVolume; return emittingVolume;
} }
#endif #endif

View file

@ -59,7 +59,7 @@ public:
// Default value is -3 for whatever reason // Default value is -3 for whatever reason
#endif #endif
uint32 m_nFinalPriority; // Actual value used to compare priority, calculated using volume and m_nPriority. Lesser value means higher priority uint32 m_nFinalPriority; // Actual value used to compare priority, calculated using volume and m_nPriority. Lesser value means higher priority
int8 m_nVolumeChange; // How much m_nVolume should reduce per each frame. Has no effect with EXTERNAL_3D_SOUND int8 m_nVolumeChange; // How much m_nVolume should reduce per each frame.
}; };
VALIDATE_SIZE(tSound, 92); VALIDATE_SIZE(tSound, 92);
@ -319,7 +319,7 @@ public:
#ifdef EXTERNAL_3D_SOUND // actually must have been && AUDIO_MSS as well #ifdef EXTERNAL_3D_SOUND // actually must have been && AUDIO_MSS as well
void AdjustSamplesVolume(); void AdjustSamplesVolume();
uint8 ComputeEmittingVolume(uint8 emittingVolume, float maxDistance, float dist); uint8 ComputeEmittingVolume(uint8 emittingVolume, float maxDistance, float distance);
#endif #endif
// audio logic // audio logic