diff options
author | Sergeanur <s.anureev@yandex.ua> | 2021-07-28 23:40:32 +0200 |
---|---|---|
committer | Sergeanur <s.anureev@yandex.ua> | 2021-07-28 23:43:04 +0200 |
commit | cce97588feb5be51b05b157fb0ff845d3ce88066 (patch) | |
tree | e53f174344b30eedf7314026f27f917f9208748c /src/audio | |
parent | cAudioManager declaration reordering (diff) | |
download | re3-cce97588feb5be51b05b157fb0ff845d3ce88066.tar re3-cce97588feb5be51b05b157fb0ff845d3ce88066.tar.gz re3-cce97588feb5be51b05b157fb0ff845d3ce88066.tar.bz2 re3-cce97588feb5be51b05b157fb0ff845d3ce88066.tar.lz re3-cce97588feb5be51b05b157fb0ff845d3ce88066.tar.xz re3-cce97588feb5be51b05b157fb0ff845d3ce88066.tar.zst re3-cce97588feb5be51b05b157fb0ff845d3ce88066.zip |
Diffstat (limited to '')
-rw-r--r-- | src/audio/AudioManager.cpp | 16 | ||||
-rw-r--r-- | src/audio/AudioManager.h | 4 | ||||
-rw-r--r-- | src/audio/DMAudio.cpp | 12 | ||||
-rw-r--r-- | src/audio/DMAudio.h | 4 |
4 files changed, 34 insertions, 2 deletions
diff --git a/src/audio/AudioManager.cpp b/src/audio/AudioManager.cpp index e4f8a023..75af289c 100644 --- a/src/audio/AudioManager.cpp +++ b/src/audio/AudioManager.cpp @@ -160,6 +160,14 @@ cAudioManager::DestroyEntity(int32 id) } } +bool8 +cAudioManager::GetEntityStatus(int32 id) +{ + if (m_bIsInitialised && id >= 0 && id < NUM_AUDIOENTITIES && m_asAudioEntities[id].m_bIsUsed) + return m_asAudioEntities[id].m_bStatus; + return FALSE; +} + void cAudioManager::SetEntityStatus(int32 id, bool8 status) { @@ -167,6 +175,14 @@ cAudioManager::SetEntityStatus(int32 id, bool8 status) m_asAudioEntities[id].m_bStatus = status; } +void * +cAudioManager::GetEntityPointer(int32 id) +{ + if (m_bIsInitialised && id >= 0 && id < NUM_AUDIOENTITIES && m_asAudioEntities[id].m_bIsUsed) + return m_asAudioEntities[id].m_pEntity; + return NULL; +} + void cAudioManager::PlayOneShot(int32 index, uint16 sound, float vol) { diff --git a/src/audio/AudioManager.h b/src/audio/AudioManager.h index f002317a..470909a2 100644 --- a/src/audio/AudioManager.h +++ b/src/audio/AudioManager.h @@ -51,7 +51,7 @@ public: eAudioType m_nType; void *m_pEntity; bool8 m_bIsUsed; - uint8 m_bStatus; + bool8 m_bStatus; int16 m_awAudioEvent[NUM_AUDIOENTITY_EVENTS]; float m_afVolume[NUM_AUDIOENTITY_EVENTS]; uint8 m_AudioEvents; @@ -255,7 +255,9 @@ public: void Service(); int32 CreateEntity(eAudioType type, void *entity); void DestroyEntity(int32 id); // inlined in vc + bool8 GetEntityStatus(int32 id); void SetEntityStatus(int32 id, bool8 status); + void *GetEntityPointer(int32 id); void PlayOneShot(int32 index, uint16 sound, float vol); void SetEffectsMasterVolume(uint8 volume); void SetMusicMasterVolume(uint8 volume); diff --git a/src/audio/DMAudio.cpp b/src/audio/DMAudio.cpp index bc77361f..ad8a12d9 100644 --- a/src/audio/DMAudio.cpp +++ b/src/audio/DMAudio.cpp @@ -38,6 +38,12 @@ cDMAudio::DestroyEntity(int32 audioEntity) AudioManager.DestroyEntity(audioEntity); } +bool8 +cDMAudio::GetEntityStatus(int32 audioEntity) +{ + return AudioManager.GetEntityStatus(audioEntity); +} + void cDMAudio::SetEntityStatus(int32 audioEntity, bool8 status) { @@ -185,6 +191,12 @@ cDMAudio::IsAudioInitialised(void) } void +cDMAudio::ResetPoliceRadio() +{ + AudioManager.ResetPoliceRadio(); +} + +void cDMAudio::ReportCrime(eCrimeType crime, const CVector &pos) { AudioManager.ReportCrime(crime, pos); diff --git a/src/audio/DMAudio.h b/src/audio/DMAudio.h index 5b684fd3..fd2d6c3c 100644 --- a/src/audio/DMAudio.h +++ b/src/audio/DMAudio.h @@ -25,6 +25,7 @@ public: int32 CreateEntity(eAudioType type, void *UID); void DestroyEntity(int32 audioEntity); + bool8 GetEntityStatus(int32 audioEntity); void SetEntityStatus(int32 audioEntity, bool8 status); void PlayOneShot(int32 audioEntity, uint16 oneShot, float volume); void DestroyAllGameCreatedEntities(void); @@ -57,7 +58,8 @@ public: char GetCDAudioDriveLetter(void); bool8 IsAudioInitialised(void); - + + void ResetPoliceRadio(); void ReportCrime(eCrimeType crime, CVector const &pos); int32 CreateLoopingScriptObject(cAudioScriptObject *scriptObject); |