Move sound processors to AudioLogic.cpp, plus small fixes

This commit is contained in:
Sergeanur 2020-05-16 20:29:13 +03:00
parent dc5ece8327
commit 13a0bf1c43
5 changed files with 9476 additions and 9448 deletions

8838
src/audio/AudioLogic.cpp Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -75,7 +75,18 @@ public:
uint8 m_nCommentsInBank[NUM_PED_COMMENTS_BANKS]; uint8 m_nCommentsInBank[NUM_PED_COMMENTS_BANKS];
uint8 m_nActiveBank; uint8 m_nActiveBank;
cPedComments(); cPedComments()
{
for (int i = 0; i < NUM_PED_COMMENTS_SLOTS; i++)
for (int j = 0; j < NUM_PED_COMMENTS_BANKS; j++) {
m_asPedComments[j][i].m_nProcess = -1;
m_nIndexMap[j][i] = NUM_PED_COMMENTS_SLOTS;
}
for (int i = 0; i < NUM_PED_COMMENTS_BANKS; i++)
m_nCommentsInBank[i] = 0;
m_nActiveBank = 0;
}
void Add(tPedComment *com); void Add(tPedComment *com);
void Process(); void Process();
}; };
@ -222,11 +233,10 @@ public:
float speedMultiplier) const; float speedMultiplier) const;
int32 ComputePan(float, CVector *); int32 ComputePan(float, CVector *);
uint8 ComputeVolume(uint8 emittingVolume, float soundIntensity, float distance) const; uint8 ComputeVolume(uint8 emittingVolume, float soundIntensity, float distance) const;
int32 CreateEntity(int32 type, void *entity); int32 CreateEntity(eAudioType type, void *entity);
void DestroyAllGameCreatedEntities(); void DestroyAllGameCreatedEntities();
void DestroyEntity(int32 id); void DestroyEntity(int32 id);
void DoJumboVolOffset() const;
void DoPoliceRadioCrackle(); void DoPoliceRadioCrackle();
// functions returning talk sfx, // functions returning talk sfx,
@ -434,14 +444,14 @@ public:
void ServiceSoundEffects(); void ServiceSoundEffects();
int8 SetCurrent3DProvider(uint8 which); int8 SetCurrent3DProvider(uint8 which);
void SetDynamicAcousticModelingStatus(bool status); void SetDynamicAcousticModelingStatus(bool status);
void SetEffectsFadeVolume(uint8 volume) const; void SetEffectsFadeVol(uint8 volume) const;
void SetEffectsMasterVolume(uint8 volume) const; void SetEffectsMasterVolume(uint8 volume) const;
void SetEntityStatus(int32 id, uint8 status); void SetEntityStatus(int32 id, uint8 status);
uint32 SetLoopingCollisionRequestedSfxFreqAndGetVol(const cAudioCollision &audioCollision); uint32 SetLoopingCollisionRequestedSfxFreqAndGetVol(const cAudioCollision &audioCollision);
void SetMissionAudioLocation(float x, float y, float z); void SetMissionAudioLocation(float x, float y, float z);
void SetMissionScriptPoliceAudio(int32 sfx) const; void SetMissionScriptPoliceAudio(int32 sfx) const;
void SetMonoMode(uint8); // todo (mobile) void SetMonoMode(uint8); // todo (mobile)
void SetMusicFadeVolume(uint8 volume) const; void SetMusicFadeVol(uint8 volume) const;
void SetMusicMasterVolume(uint8 volume) const; void SetMusicMasterVolume(uint8 volume) const;
void SetSpeakerConfig(int32 conf) const; void SetSpeakerConfig(int32 conf) const;
void SetUpLoopingCollisionSound(const cAudioCollision &col, uint8 counter); void SetUpLoopingCollisionSound(const cAudioCollision &col, uint8 counter);
@ -464,9 +474,11 @@ public:
bool UsesSiren(int32 model) const; bool UsesSiren(int32 model) const;
bool UsesSirenSwitching(int32 model) const; bool UsesSirenSwitching(int32 model) const;
#ifdef GTA_PC
// only used in pc // only used in pc
void AdjustSamplesVolume(); void AdjustSamplesVolume();
uint8 ComputeEmittingVolume(uint8 emittingVolume, float intensity, float dist); uint8 ComputeEmittingVolume(uint8 emittingVolume, float intensity, float dist);
#endif
}; };
#ifdef AUDIO_MSS #ifdef AUDIO_MSS

View File

@ -29,7 +29,7 @@ cDMAudio::Service(void)
} }
int32 int32
cDMAudio::CreateEntity(int32 type, void *UID) cDMAudio::CreateEntity(eAudioType type, void *UID)
{ {
return AudioManager.CreateEntity(type, (CPhysical *)UID); return AudioManager.CreateEntity(type, (CPhysical *)UID);
} }
@ -82,7 +82,7 @@ cDMAudio::SetEffectsFadeVol(uint8 volume)
uint8 vol = volume; uint8 vol = volume;
if ( vol > MAX_VOLUME ) vol = MAX_VOLUME; if ( vol > MAX_VOLUME ) vol = MAX_VOLUME;
AudioManager.SetEffectsFadeVolume(vol); AudioManager.SetEffectsFadeVol(vol);
} }
void void
@ -91,7 +91,7 @@ cDMAudio::SetMusicFadeVol(uint8 volume)
uint8 vol = volume; uint8 vol = volume;
if ( vol > MAX_VOLUME ) vol = MAX_VOLUME; if ( vol > MAX_VOLUME ) vol = MAX_VOLUME;
AudioManager.SetMusicFadeVolume(vol); AudioManager.SetMusicFadeVol(vol);
} }
uint8 uint8

View File

@ -20,7 +20,7 @@ public:
void Terminate(void); void Terminate(void);
void Service(void); void Service(void);
int32 CreateEntity(int32 type, void *UID); int32 CreateEntity(eAudioType type, void *UID);
void DestroyEntity(int32 audioEntity); void DestroyEntity(int32 audioEntity);
void SetEntityStatus(int32 audioEntity, uint8 status); void SetEntityStatus(int32 audioEntity, uint8 status);
void PlayOneShot(int32 audioEntity, uint16 oneShot, float volume); void PlayOneShot(int32 audioEntity, uint16 oneShot, float volume);