Merge branch 'miami' into lcs

This commit is contained in:
Sergeanur 2021-07-27 22:30:45 +03:00
commit fbb42085bd
3 changed files with 67 additions and 53 deletions

View file

@ -349,8 +349,6 @@ cAudioManager::SetLoopingCollisionRequestedSfxFreqAndGetVol(const cAudioCollisio
float
cAudioManager::GetCollisionOneShotRatio(int32 a, float b)
{
float result;
switch(a) {
case SURFACE_DEFAULT:
case SURFACE_TARMAC:

View file

@ -218,41 +218,41 @@ cAudioManager::PlayOneShot(int32 index, uint16 sound, float vol)
}
void
cAudioManager::SetMP3BoostVolume(uint8 volume) const
{
SampleManager.SetMP3BoostVolume(volume);
}
void
cAudioManager::SetEffectsMasterVolume(uint8 volume) const
cAudioManager::SetEffectsMasterVolume(uint8 volume)
{
SampleManager.SetEffectsMasterVolume(volume);
}
void
cAudioManager::SetMusicMasterVolume(uint8 volume) const
cAudioManager::SetMusicMasterVolume(uint8 volume)
{
SampleManager.SetMusicMasterVolume(volume);
}
void
cAudioManager::SetEffectsFadeVol(uint8 volume) const
cAudioManager::SetMP3BoostVolume(uint8 volume)
{
SampleManager.SetMP3BoostVolume(volume);
}
void
cAudioManager::SetEffectsFadeVol(uint8 volume)
{
SampleManager.SetEffectsFadeVolume(volume);
}
void
cAudioManager::SetMusicFadeVol(uint8 volume)
{
SampleManager.SetMusicFadeVolume(volume);
}
void
cAudioManager::SetMonoMode(bool8 mono)
{
SampleManager.SetMonoMode(mono);
}
void
cAudioManager::SetMusicFadeVol(uint8 volume) const
{
SampleManager.SetMusicFadeVolume(volume);
}
void
cAudioManager::ResetTimers(uint32 time)
{
@ -319,8 +319,10 @@ cAudioManager::DestroyAllGameCreatedEntities()
}
}
#ifdef GTA_PC
uint8
cAudioManager::GetNum3DProvidersAvailable() const
cAudioManager::GetNum3DProvidersAvailable()
{
if (m_bIsInitialised)
return SampleManager.GetNum3DProvidersAvailable();
@ -328,7 +330,7 @@ cAudioManager::GetNum3DProvidersAvailable() const
}
char *
cAudioManager::Get3DProviderName(uint8 id) const
cAudioManager::Get3DProviderName(uint8 id)
{
if (!m_bIsInitialised)
return nil;
@ -343,7 +345,7 @@ cAudioManager::Get3DProviderName(uint8 id) const
}
int8
cAudioManager::GetCurrent3DProviderIndex() const
cAudioManager::GetCurrent3DProviderIndex()
{
if (m_bIsInitialised)
return SampleManager.GetCurrent3DProviderIndex();
@ -352,7 +354,7 @@ cAudioManager::GetCurrent3DProviderIndex() const
}
int8
cAudioManager::AutoDetect3DProviders() const
cAudioManager::AutoDetect3DProviders()
{
if (m_bIsInitialised)
return SampleManager.AutoDetect3DProviders();
@ -384,13 +386,13 @@ cAudioManager::SetCurrent3DProvider(uint8 which)
}
void
cAudioManager::SetSpeakerConfig(int32 conf) const
cAudioManager::SetSpeakerConfig(int32 conf)
{
SampleManager.SetSpeakerConfig(conf);
}
bool8
cAudioManager::IsMP3RadioChannelAvailable() const
cAudioManager::IsMP3RadioChannelAvailable()
{
if (m_bIsInitialised)
return SampleManager.IsMP3RadioChannelAvailable();
@ -399,7 +401,7 @@ cAudioManager::IsMP3RadioChannelAvailable() const
}
void
cAudioManager::ReleaseDigitalHandle() const
cAudioManager::ReleaseDigitalHandle()
{
if (m_bIsInitialised) {
SampleManager.ReleaseDigitalHandle();
@ -407,7 +409,7 @@ cAudioManager::ReleaseDigitalHandle() const
}
void
cAudioManager::ReacquireDigitalHandle() const
cAudioManager::ReacquireDigitalHandle()
{
if (m_bIsInitialised) {
SampleManager.ReacquireDigitalHandle();
@ -421,24 +423,26 @@ cAudioManager::SetDynamicAcousticModelingStatus(bool8 status)
}
bool8
cAudioManager::CheckForAnAudioFileOnCD() const
cAudioManager::CheckForAnAudioFileOnCD()
{
return SampleManager.CheckForAnAudioFileOnCD();
}
char
cAudioManager::GetCDAudioDriveLetter() const
cAudioManager::GetCDAudioDriveLetter()
{
if(m_bIsInitialised) return SampleManager.GetCDAudioDriveLetter();
return '\0';
}
bool8
cAudioManager::IsAudioInitialised() const
cAudioManager::IsAudioInitialised()
{
return m_bIsInitialised;
}
#endif // GTA_PC
void
cAudioManager::ServiceSoundEffects()
{
@ -497,7 +501,7 @@ cAudioManager::ServiceSoundEffects()
}
uint8
cAudioManager::ComputeVolume(uint8 emittingVolume, float soundIntensity, float distance) const
cAudioManager::ComputeVolume(uint8 emittingVolume, float soundIntensity, float distance)
{
float newSoundIntensity;
float newEmittingVolume;
@ -515,7 +519,7 @@ cAudioManager::ComputeVolume(uint8 emittingVolume, float soundIntensity, float d
}
void
cAudioManager::TranslateEntity(Const CVector *in, CVector *out) const
cAudioManager::TranslateEntity(Const CVector *in, CVector *out)
{
*out = MultiplyInverse(TheCamera.GetMatrix(), *in);
}
@ -533,7 +537,7 @@ cAudioManager::ComputePan(float dist, CVector *vec)
}
uint32
cAudioManager::ComputeDopplerEffectedFrequency(uint32 oldFreq, float position1, float position2, float speedMultiplier) const
cAudioManager::ComputeDopplerEffectedFrequency(uint32 oldFreq, float position1, float position2, float speedMultiplier)
{
uint32 newFreq = oldFreq;
if (!TheCamera.Get_Just_Switched_Status() && speedMultiplier != 0.0f) {
@ -550,7 +554,7 @@ cAudioManager::ComputeDopplerEffectedFrequency(uint32 oldFreq, float position1,
}
int32
cAudioManager::RandomDisplacement(uint32 seed) const
cAudioManager::RandomDisplacement(uint32 seed)
{
int32 value;
@ -624,6 +628,7 @@ cAudioManager::AddSampleToRequestedQueue()
AddReflectionsToRequestedQueue();
}
}
void
cAudioManager::AddDetailsToRequestedOrderList(uint8 sample)
{
@ -641,6 +646,7 @@ cAudioManager::AddDetailsToRequestedOrderList(uint8 sample)
m_abSampleQueueIndexTable[m_nActiveSampleQueue][i] = sample;
}
#ifdef GTA_PC
void
cAudioManager::AddReflectionsToRequestedQueue()
{
@ -778,6 +784,7 @@ cAudioManager::UpdateReflections()
m_afReflectionsDistances[7] = 100.0f;
}
}
#endif // GTA_PC
void
cAudioManager::AddReleasingSounds()
@ -1073,6 +1080,13 @@ cAudioManager::ClearActiveSamples()
}
}
void
cAudioManager::LoadBankIfNecessary(uint8 bank)
{
if(!SampleManager.IsSampleBankLoaded(bank))
SampleManager.LoadSampleBank(bank);
}
void
cAudioManager::GenerateIntegerRandomNumberTable()
{

View file

@ -22,8 +22,8 @@ public:
#ifndef GTA_PS2
int32 m_nLoopStart;
int32 m_nLoopEnd;
#endif
uint8 m_nEmittingVolume;
#endif
float m_fSpeedMultiplier;
float m_fSoundIntensity;
bool8 m_bReleasingSoundFlag;
@ -267,13 +267,13 @@ public:
void AgeCrimes(); // inlined in vc
void CalculateDistance(bool8 &condition, float dist);
bool8 CheckForAnAudioFileOnCD() const;
bool8 CheckForAnAudioFileOnCD();
void ClearActiveSamples();
void ClearMissionAudio(uint8 slot); // inlined in vc
void ClearRequestedQueue(); // inlined in vc
uint32 ComputeDopplerEffectedFrequency(uint32 oldFreq, float position1, float position2, float speedMultiplier) const;
uint32 ComputeDopplerEffectedFrequency(uint32 oldFreq, float position1, float position2, float speedMultiplier);
int32 ComputePan(float, CVector *);
uint8 ComputeVolume(uint8 emittingVolume, float soundIntensity, float distance) const;
uint8 ComputeVolume(uint8 emittingVolume, float soundIntensity, float distance);
int32 CreateEntity(eAudioType type, void *entity);
void DestroyAllGameCreatedEntities();
@ -383,10 +383,10 @@ public:
// end of functions returning talk sfx
void GenerateIntegerRandomNumberTable();
char *Get3DProviderName(uint8 id) const;
char GetCDAudioDriveLetter() const;
int8 GetCurrent3DProviderIndex() const;
int8 AutoDetect3DProviders() const;
char *Get3DProviderName(uint8 id);
char GetCDAudioDriveLetter();
int8 GetCurrent3DProviderIndex();
int8 AutoDetect3DProviders();
float GetCollisionLoopingRatio(uint32 a, uint32 b, float c); // not used
float GetCollisionOneShotRatio(int32 a, float b);
float GetCollisionRatio(float a, float b, float c, float d); // inlined in vc
@ -394,7 +394,7 @@ public:
int32 GetJumboTaxiFreq() const; // inlined in vc
uint8 GetMissionAudioLoadingStatus(uint8 slot) const;
int8 GetMissionScriptPoliceAudioPlayingStatus() const;
uint8 GetNum3DProvidersAvailable() const;
uint8 GetNum3DProvidersAvailable();
uint32 GetPedCommentSfx(CPed *ped, int32 sound);
void GetPhrase(uint32 &phrase, uint32 &prevPhrase, uint32 sample, uint32 maxOffset) const;
float GetVehicleDriveWheelSkidValue(CVehicle *veh, tWheelState wheelState, float gasPedalAudio, cTransmission *transmission,
@ -407,9 +407,11 @@ public:
void InitialisePoliceRadio();
void InitialisePoliceRadioZones();
void InterrogateAudioEntities(); // inlined
bool8 IsAudioInitialised() const;
bool8 IsAudioInitialised();
bool8 IsMissionAudioSampleFinished(uint8 slot);
bool8 IsMP3RadioChannelAvailable() const;
bool8 IsMP3RadioChannelAvailable();
void LoadBankIfNecessary(uint8 bank); // this is used only on PS2 but technically not a platform code
bool8 MissionScriptAudioUsesPoliceChannel(int32 soundMission) const;
@ -489,9 +491,9 @@ public:
void ProcessEscalators();
void ProcessExtraSounds();
int32 RandomDisplacement(uint32 seed) const;
void ReacquireDigitalHandle() const;
void ReleaseDigitalHandle() const;
int32 RandomDisplacement(uint32 seed);
void ReacquireDigitalHandle();
void ReleaseDigitalHandle();
void ReportCollision(CEntity *entity1, CEntity *entity2, uint8 surface1, uint8 surface2, float collisionPower, float intensity2);
void ReportCrime(eCrimeType crime, const CVector &pos);
void ResetAudioLogicTimers(uint32 timer);
@ -505,17 +507,17 @@ public:
void ServiceSoundEffects();
int8 SetCurrent3DProvider(uint8 which);
void SetDynamicAcousticModelingStatus(bool8 status);
void SetEffectsFadeVol(uint8 volume) const;
void SetEffectsMasterVolume(uint8 volume) const;
void SetMP3BoostVolume(uint8 volume) const;
void SetEffectsFadeVol(uint8 volume);
void SetEffectsMasterVolume(uint8 volume);
void SetMP3BoostVolume(uint8 volume);
void SetEntityStatus(int32 id, bool8 status);
uint32 SetLoopingCollisionRequestedSfxFreqAndGetVol(const cAudioCollision &audioCollision);
void SetMissionAudioLocation(uint8 slot, float x, float y, float z);
void SetMissionScriptPoliceAudio(int32 sfx) const; // inlined and optimized
void SetMonoMode(bool8 mono);
void SetMusicFadeVol(uint8 volume) const;
void SetMusicMasterVolume(uint8 volume) const;
void SetSpeakerConfig(int32 conf) const;
void SetMusicFadeVol(uint8 volume);
void SetMusicMasterVolume(uint8 volume);
void SetSpeakerConfig(int32 conf);
void SetUpLoopingCollisionSound(const cAudioCollision &col, uint8 counter);
void SetUpOneShotCollisionSound(const cAudioCollision &col);
bool8 SetupCrimeReport();
@ -528,7 +530,7 @@ public:
void SetupSuspectLastSeenReport();
void Terminate();
void TranslateEntity(Const CVector *v1, CVector *v2) const;
void TranslateEntity(Const CVector *v1, CVector *v2);
void UpdateGasPedalAudio(CVehicle *veh, int vehType);
void UpdateReflections();