Skip to content

Commit 51d8717

Browse files
committed
Remove GetAudio (addendum to 1ed90f2)
See 1ed90f2 The refactor there was not completed
1 parent 6c74580 commit 51d8717

File tree

6 files changed

+18
-24
lines changed

6 files changed

+18
-24
lines changed

Client/game_sa/CAudioEngineSA.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ __declspec(noinline) bool _cdecl IsAmbientSoundGeneralEnabled(void)
430430
{
431431
if (pGame)
432432
{
433-
return pGame->GetAudio()->IsAmbientSoundEnabled(AMBIENT_SOUND_GENERAL);
433+
return pGame->GetAudioEngine()->IsAmbientSoundEnabled(AMBIENT_SOUND_GENERAL);
434434
}
435435
return false;
436436
}

Client/game_sa/CGameSA.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -227,11 +227,6 @@ class CGameSA : public CGame
227227
return m_pAEAudioHardware;
228228
};
229229
CAESoundManager* GetAESoundManager() override { return m_pAESoundManager; }
230-
CAudioEngine* GetAudio()
231-
{
232-
DEBUG_TRACE("CAudio * GetAudioEngine()");
233-
return m_pAudioEngine;
234-
};
235230
CAudioContainer* GetAudioContainer()
236231
{
237232
DEBUG_TRACE("CAudio * GetAudioContainer()");

Client/mods/deathmatch/ClientCommands.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -982,7 +982,7 @@ float fTest = 0;
982982
#include <crtdbg.h>
983983
void COMMAND_Debug2(const char* szCmdLine)
984984
{
985-
g_pGame->GetAudio()->StopRadio();
985+
g_pGame->GetAudioEngine()->StopRadio();
986986
}
987987

988988
CClientPed* pTest = NULL;
@@ -998,8 +998,8 @@ void COMMAND_Debug3(const char* szCmdLine)
998998
call eax
999999
popad
10001000
}
1001-
g_pGame->GetAudio()->StopRadio();
1002-
g_pGame->GetAudio()->StartRadio(1);
1001+
g_pGame->GetAudioEngine()->StopRadio();
1002+
g_pGame->GetAudioEngine()->StartRadio(1);
10031003
return;
10041004
}
10051005

Client/mods/deathmatch/logic/CClientGame.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -360,8 +360,8 @@ CClientGame::~CClientGame(void)
360360
// playing these special IDS.
361361
if (m_bGameLoaded)
362362
{
363-
g_pGame->GetAudio()->PlayFrontEndSound(35);
364-
g_pGame->GetAudio()->PlayFrontEndSound(48);
363+
g_pGame->GetAudioEngine()->PlayFrontEndSound(35);
364+
g_pGame->GetAudioEngine()->PlayFrontEndSound(48);
365365
}
366366

367367
// Reset the GUI input mode
@@ -442,7 +442,7 @@ CClientGame::~CClientGame(void)
442442
g_pGame->SetPreWeaponFireHandler(NULL);
443443
g_pGame->SetPostWeaponFireHandler(NULL);
444444
g_pGame->SetTaskSimpleBeHitHandler(NULL);
445-
g_pGame->GetAudio()->SetWorldSoundHandler(NULL);
445+
g_pGame->GetAudioEngine()->SetWorldSoundHandler(NULL);
446446
g_pCore->SetMessageProcessor(NULL);
447447
g_pCore->GetKeyBinds()->SetKeyStrokeHandler(NULL);
448448
g_pCore->GetKeyBinds()->SetCharacterKeyHandler(NULL);
@@ -733,8 +733,8 @@ void CClientGame::DoPulsePreHUDRender(bool bDidUnminimize, bool bDidRecreateRend
733733
m_bWasMinimized = false;
734734

735735
// Reverse any mute on minimize effects
736-
g_pGame->GetAudio()->SetEffectsMasterVolume(g_pGame->GetSettings()->GetSFXVolume());
737-
g_pGame->GetAudio()->SetMusicMasterVolume(g_pGame->GetSettings()->GetRadioVolume());
736+
g_pGame->GetAudioEngine()->SetEffectsMasterVolume(g_pGame->GetSettings()->GetSFXVolume());
737+
g_pGame->GetAudioEngine()->SetMusicMasterVolume(g_pGame->GetSettings()->GetRadioVolume());
738738
m_pManager->GetSoundManager()->SetMinimizeMuted(false);
739739
}
740740

@@ -3916,10 +3916,10 @@ void CClientGame::IdleHandler(void)
39163916

39173917
// Apply mute on minimize options
39183918
if (bMuteAll || g_pCore->GetCVars()->GetValue<bool>("mute_radio_when_minimized"))
3919-
g_pGame->GetAudio()->SetMusicMasterVolume(0);
3919+
g_pGame->GetAudioEngine()->SetMusicMasterVolume(0);
39203920

39213921
if (bMuteAll || g_pCore->GetCVars()->GetValue<bool>("mute_sfx_when_minimized"))
3922-
g_pGame->GetAudio()->SetEffectsMasterVolume(0);
3922+
g_pGame->GetAudioEngine()->SetEffectsMasterVolume(0);
39233923

39243924
if (bMuteAll || g_pCore->GetCVars()->GetValue<bool>("mute_mta_when_minimized"))
39253925
m_pManager->GetSoundManager()->SetMinimizeMuted(true);
@@ -5612,10 +5612,10 @@ void CClientGame::ResetMapInfo(void)
56125612
g_pClientGame->SetBirdsEnabled(true);
56135613

56145614
// Ambient sounds
5615-
g_pGame->GetAudio()->ResetAmbientSounds();
5615+
g_pGame->GetAudioEngine()->ResetAmbientSounds();
56165616

56175617
// World sounds
5618-
g_pGame->GetAudio()->ResetWorldSounds();
5618+
g_pGame->GetAudioEngine()->ResetWorldSounds();
56195619

56205620
// Cheats
56215621
g_pGame->ResetCheats();
@@ -6454,9 +6454,9 @@ void CClientGame::SetDevelopmentMode(bool bEnable, bool bEnableWeb)
64546454
m_bDevelopmentMode = bEnable;
64556455

64566456
if (m_bDevelopmentMode)
6457-
g_pGame->GetAudio()->SetWorldSoundHandler(CClientGame::StaticWorldSoundHandler);
6457+
g_pGame->GetAudioEngine()->SetWorldSoundHandler(CClientGame::StaticWorldSoundHandler);
64586458
else
6459-
g_pGame->GetAudio()->SetWorldSoundHandler(NULL);
6459+
g_pGame->GetAudioEngine()->SetWorldSoundHandler(NULL);
64606460

64616461
if (g_pCore->IsWebCoreLoaded())
64626462
g_pCore->GetWebCore()->SetTestModeEnabled(bEnableWeb);

Client/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4264,19 +4264,19 @@ bool CStaticFunctionDefinitions::ResetAmbientSounds(void)
42644264

42654265
bool CStaticFunctionDefinitions::SetWorldSoundEnabled(uint uiGroup, uint uiIndex, bool bMute, bool bImmediate)
42664266
{
4267-
g_pGame->GetAudio()->SetWorldSoundEnabled(uiGroup, uiIndex, bMute, bImmediate);
4267+
g_pGame->GetAudioEngine()->SetWorldSoundEnabled(uiGroup, uiIndex, bMute, bImmediate);
42684268
return true;
42694269
}
42704270

42714271
bool CStaticFunctionDefinitions::IsWorldSoundEnabled(uint uiGroup, uint uiIndex, bool& bOutMute)
42724272
{
4273-
bOutMute = g_pGame->GetAudio()->IsWorldSoundEnabled(uiGroup, uiIndex);
4273+
bOutMute = g_pGame->GetAudioEngine()->IsWorldSoundEnabled(uiGroup, uiIndex);
42744274
return true;
42754275
}
42764276

42774277
bool CStaticFunctionDefinitions::ResetWorldSounds(void)
42784278
{
4279-
g_pGame->GetAudio()->ResetWorldSounds();
4279+
g_pGame->GetAudioEngine()->ResetWorldSounds();
42804280
return true;
42814281
}
42824282

Client/sdk/game/CGame.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@ class __declspec(novtable) CGame
142142
virtual CAudioEngine* GetAudioEngine() = 0;
143143
virtual CAEAudioHardware* GetAEAudioHardware() = 0;
144144
virtual CAESoundManager* GetAESoundManager() = 0;
145-
virtual CAudioEngine* GetAudio() = 0;
146145
virtual CAudioContainer* GetAudioContainer() = 0;
147146
virtual CMenuManager* GetMenuManager() = 0;
148147
virtual CText* GetText() = 0;

0 commit comments

Comments
 (0)