letter 'c' is done

This commit is contained in:
Roman Masanin 2020-10-02 04:59:06 +03:00
parent e5a48faf89
commit 064f2e66e1
2 changed files with 29 additions and 23 deletions

View File

@ -411,11 +411,11 @@ cAudioManager::SetDynamicAcousticModelingStatus(uint8 status)
m_bDynamicAcousticModelingStatus = status!=0; m_bDynamicAcousticModelingStatus = status!=0;
} }
bool //bool
cAudioManager::CheckForAnAudioFileOnCD() const //cAudioManager::CheckForAnAudioFileOnCD() const
{ //{
return SampleManager.CheckForAnAudioFileOnCD(); // return SampleManager.CheckForAnAudioFileOnCD();
} //}
uint8 uint8
cAudioManager::GetCDAudioDriveLetter() const cAudioManager::GetCDAudioDriveLetter() const
@ -483,12 +483,18 @@ uint8
cAudioManager::ComputeVolume(uint8 emittingVolume, float soundIntensity, float distance) const cAudioManager::ComputeVolume(uint8 emittingVolume, float soundIntensity, float distance) const
{ {
float newSoundIntensity; float newSoundIntensity;
float newEmittingVolume;
if (soundIntensity <= 0.0f) if (soundIntensity <= 0.0f)
return 0; return 0;
newSoundIntensity = soundIntensity / 5.0f; newSoundIntensity = soundIntensity / 5.0f;
if (newSoundIntensity <= distance) if (newSoundIntensity > distance)
emittingVolume = sq((soundIntensity - newSoundIntensity - (distance - newSoundIntensity)) / (soundIntensity - newSoundIntensity)) * emittingVolume;
return emittingVolume; return emittingVolume;
newEmittingVolume = emittingVolume * SQR((soundIntensity - newSoundIntensity - (distance - newSoundIntensity))
/ (soundIntensity - newSoundIntensity));
return Min(127u, newEmittingVolume);
} }
void void
@ -502,8 +508,7 @@ cAudioManager::ComputePan(float dist, CVector *vec)
{ {
const uint8 PanTable[64] = { 0, 3, 8, 12, 16, 19, 22, 24, 26, 28, 30, 31, 33, 34, 36, 37, 39, 40, 41, 42, 44, 45, 46, 47, 48, 49, 49, 50, 51, 52, 53, 53, const uint8 PanTable[64] = { 0, 3, 8, 12, 16, 19, 22, 24, 26, 28, 30, 31, 33, 34, 36, 37, 39, 40, 41, 42, 44, 45, 46, 47, 48, 49, 49, 50, 51, 52, 53, 53,
54, 55, 55, 56, 56, 57, 57, 58, 58, 58, 59, 59, 59, 60, 60, 61, 61, 61, 61, 62, 62, 62, 62, 62, 63, 63, 63, 63, 63, 63, 63, 63}; 54, 55, 55, 56, 56, 57, 57, 58, 58, 58, 59, 59, 59, 60, 60, 61, 61, 61, 61, 62, 62, 62, 62, 62, 63, 63, 63, 63, 63, 63, 63, 63};
int32 index = Min(63, Abs(int32(vec->x / (dist / 64.f))));
int32 index = Min(63, Abs(vec->x / (dist / 64.f)));
if (vec->x > 0.f) if (vec->x > 0.f)
return Max(20, 63 - PanTable[index]); return Max(20, 63 - PanTable[index]);
@ -940,6 +945,8 @@ void
cAudioManager::ClearRequestedQueue() cAudioManager::ClearRequestedQueue()
{ {
for (int32 i = 0; i < m_nActiveSamples; i++) { for (int32 i = 0; i < m_nActiveSamples; i++) {
if (i >= m_nActiveSamples)
break;
m_abSampleQueueIndexTable[m_nActiveSampleQueue][i] = m_nActiveSamples; m_abSampleQueueIndexTable[m_nActiveSampleQueue][i] = m_nActiveSamples;
} }
m_SampleRequestQueuesStatus[m_nActiveSampleQueue] = 0; m_SampleRequestQueuesStatus[m_nActiveSampleQueue] = 0;

View File

@ -248,14 +248,13 @@ public:
void AgeCrimes(); // done (inlined in vc) void AgeCrimes(); // done (inlined in vc)
void CalculateDistance(bool &condition, float dist); // done void CalculateDistance(bool &condition, float dist); // done
bool CheckForAnAudioFileOnCD() const; //bool CheckForAnAudioFileOnCD() const; // not exists in v1.0 and android
void ClearActiveSamples(); // done void ClearActiveSamples(); // done
void ClearMissionAudio(uint8 slot); // done void ClearMissionAudio(uint8 slot); // done
void ClearRequestedQueue(); void ClearRequestedQueue(); // done (inlined in vc)
uint32 ComputeDopplerEffectedFrequency(uint32 oldFreq, float position1, float position2, uint32 ComputeDopplerEffectedFrequency(uint32 oldFreq, float position1, float position2, float speedMultiplier) const; // done
float speedMultiplier) const; //done int32 ComputePan(float, CVector *); // done
int32 ComputePan(float, CVector *); uint8 ComputeVolume(uint8 emittingVolume, float soundIntensity, float distance) const; // done
uint8 ComputeVolume(uint8 emittingVolume, float soundIntensity, float distance) const;
int32 CreateEntity(eAudioType type, void *entity); // done int32 CreateEntity(eAudioType type, void *entity); // done
void DestroyAllGameCreatedEntities(); void DestroyAllGameCreatedEntities();
@ -290,7 +289,7 @@ public:
void Initialise(); // done void Initialise(); // done
void InitialisePoliceRadio(); void InitialisePoliceRadio();
void InitialisePoliceRadioZones(); void InitialisePoliceRadioZones();
void InterrogateAudioEntities(); void InterrogateAudioEntities(); // done
bool IsAudioInitialised() const; bool IsAudioInitialised() const;
bool IsMissionAudioSampleFinished(uint8 slot); bool IsMissionAudioSampleFinished(uint8 slot);
bool IsMP3RadioChannelAvailable() const; // done bool IsMP3RadioChannelAvailable() const; // done