diff options
author | Sergeanur <s.anureev@yandex.ua> | 2021-08-11 15:33:50 +0300 |
---|---|---|
committer | Sergeanur <s.anureev@yandex.ua> | 2021-08-12 11:39:34 +0300 |
commit | ce78081a7f61fed79281fa252da6f29d9f1030dc (patch) | |
tree | d07c8d9eed074a2c41898eb9cd28ed8f960e1171 | |
parent | 6c2d179aadd9e54afc010c7f8b79d663017d168c (diff) |
Put more things under ifdef
-rw-r--r-- | src/audio/AudioCollision.cpp | 4 | ||||
-rw-r--r-- | src/audio/AudioLogic.cpp | 163 | ||||
-rw-r--r-- | src/audio/AudioManager.cpp | 22 | ||||
-rw-r--r-- | src/audio/AudioManager.h | 9 | ||||
-rw-r--r-- | src/audio/PolRadio.cpp | 2 | ||||
-rw-r--r-- | src/audio/sampman.h | 6 | ||||
-rw-r--r-- | src/audio/sampman_miles.cpp | 125 | ||||
-rw-r--r-- | src/core/Frontend.cpp | 2 | ||||
-rw-r--r-- | src/core/MenuScreens.cpp | 2 | ||||
-rw-r--r-- | src/core/MenuScreensCustom.cpp | 2 | ||||
-rw-r--r-- | src/core/config.h | 10 | ||||
-rw-r--r-- | src/core/re3.cpp | 4 |
12 files changed, 213 insertions, 138 deletions
diff --git a/src/audio/AudioCollision.cpp b/src/audio/AudioCollision.cpp index bc470c49..0cfa4103 100644 --- a/src/audio/AudioCollision.cpp +++ b/src/audio/AudioCollision.cpp @@ -263,7 +263,7 @@ cAudioManager::SetUpOneShotCollisionSound(const cAudioCollision &col) m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_nReleasingVolumeModificator = 11; m_sQueueSample.m_nLoopCount = 1; - m_sQueueSample.m_nEmittingVolume = emittingVol; + SET_EMITTING_VOLUME(emittingVol); RESET_LOOP_OFFSETS m_sQueueSample.m_fSpeedMultiplier = 4.0f; m_sQueueSample.m_fSoundIntensity = CollisionSoundIntensity; @@ -292,7 +292,7 @@ cAudioManager::SetUpLoopingCollisionSound(const cAudioCollision &col, uint8 coun m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_nReleasingVolumeModificator = 7; m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_nEmittingVolume = emittingVol; + SET_EMITTING_VOLUME(emittingVol); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_fSpeedMultiplier = 4.0f; m_sQueueSample.m_fSoundIntensity = CollisionSoundIntensity; diff --git a/src/audio/AudioLogic.cpp b/src/audio/AudioLogic.cpp index e9ce7777..cf54ce53 100644 --- a/src/audio/AudioLogic.cpp +++ b/src/audio/AudioLogic.cpp @@ -228,6 +228,7 @@ cAudioManager::ResetAudioLogicTimers(uint32 timer) void cAudioManager::ProcessReverb() { +#ifdef EXTERNAL_3D_SOUND if (SampleManager.UpdateReverb() && m_bDynamicAcousticModelingStatus) { #ifndef GTA_PS2 for (uint32 i = 0; i < @@ -243,6 +244,10 @@ cAudioManager::ProcessReverb() } #endif } +#else + // TODO: PS2 code + SampleManager.UpdateReverb(); +#endif } float @@ -681,7 +686,7 @@ cAudioManager::ProcessRainOnVehicle(cVehicleParams& params) m_sQueueSample.m_nReleasingVolumeModificator = 9; m_sQueueSample.m_nFrequency = m_anRandomTable[1] % 4000 + 28000; m_sQueueSample.m_nLoopCount = 1; - m_sQueueSample.m_nEmittingVolume = (uint8)emittingVol; + SET_EMITTING_VOLUME((uint8)emittingVol); RESET_LOOP_OFFSETS m_sQueueSample.m_fSpeedMultiplier = 0.0f; m_sQueueSample.m_fSoundIntensity = rainOnVehicleIntensity; @@ -733,7 +738,7 @@ cAudioManager::ProcessReverseGear(cVehicleParams& params) m_sQueueSample.m_nReleasingVolumeModificator = 3; m_sQueueSample.m_nFrequency = (6000.f * modificator) + 7000; m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_nEmittingVolume = emittingVol; + SET_EMITTING_VOLUME(emittingVol); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 3.0f; m_sQueueSample.m_fSoundIntensity = reverseGearIntensity; @@ -783,7 +788,7 @@ cAudioManager::ProcessModelCarEngine(cVehicleParams& params) m_sQueueSample.m_nReleasingVolumeModificator = 1; m_sQueueSample.m_nFrequency = (11025.f * velocityChange / params.m_pTransmission->fMaxVelocity + 11025.f); m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_nEmittingVolume = emittingVol; + SET_EMITTING_VOLUME(emittingVol); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 3.0f; m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; @@ -835,7 +840,7 @@ cAudioManager::ProcessVehicleRoadNoise(cVehicleParams& params) } m_sQueueSample.m_nFrequency = freq; m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_nEmittingVolume = emittingVol; + SET_EMITTING_VOLUME(emittingVol); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 6.0f; m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; @@ -886,7 +891,7 @@ cAudioManager::ProcessWetRoadNoise(cVehicleParams& params) freq = SampleManager.GetSampleBaseFrequency(SFX_ROAD_NOISE); m_sQueueSample.m_nFrequency = freq + freq * multiplier; m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_nEmittingVolume = emittingVol; + SET_EMITTING_VOLUME(emittingVol); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 6.0f; m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; @@ -1032,7 +1037,7 @@ cAudioManager::ProcessVehicleEngine(cVehicleParams& params) if (m_sQueueSample.m_nSampleIndex == SFX_CAR_IDLE_6 || m_sQueueSample.m_nSampleIndex == SFX_CAR_REV_6) m_sQueueSample.m_nFrequency /= 2; m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_nEmittingVolume = emittingVol; + SET_EMITTING_VOLUME(emittingVol); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 6.0f; m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; @@ -1092,7 +1097,7 @@ cAudioManager::AddPlayerCarSample(uint8 emittingVolume, uint32 freq, uint32 samp } else { m_sQueueSample.m_nLoopCount = 1; } - m_sQueueSample.m_nEmittingVolume = emittingVolume; + SET_EMITTING_VOLUME(emittingVolume); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 6.0f; m_sQueueSample.m_fSoundIntensity = 50.0f; @@ -1135,7 +1140,7 @@ cAudioManager::ProcessCesna(cVehicleParams& params) m_sQueueSample.m_nFrequency = 12500; m_sQueueSample.m_nLoopCount = 0; m_sQueueSample.m_nReleasingVolumeDivider = 8; - m_sQueueSample.m_nEmittingVolume = 80; + SET_EMITTING_VOLUME(80); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 8.0f; m_sQueueSample.m_fSoundIntensity = 200.0f; @@ -1155,7 +1160,7 @@ cAudioManager::ProcessCesna(cVehicleParams& params) m_sQueueSample.m_nFrequency = 25000; m_sQueueSample.m_nLoopCount = 0; m_sQueueSample.m_nReleasingVolumeDivider = 4; - m_sQueueSample.m_nEmittingVolume = 80; + SET_EMITTING_VOLUME(80); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 8.0f; m_sQueueSample.m_fSoundIntensity = 90.0f; @@ -1480,7 +1485,7 @@ cAudioManager::ProcessVehicleSkidding(cVehicleParams& params) m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_nReleasingVolumeModificator = 8; m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_nEmittingVolume = emittingVol; + SET_EMITTING_VOLUME(emittingVol); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 3.0f; m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; @@ -1570,7 +1575,7 @@ cAudioManager::ProcessVehicleHorn(cVehicleParams& params) m_sQueueSample.m_nReleasingVolumeModificator = 2; m_sQueueSample.m_nFrequency = aVehicleSettings[params.m_nIndex].m_nHornFrequency; m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_nEmittingVolume = 80; + SET_EMITTING_VOLUME(80); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 5.0f; m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; @@ -1651,7 +1656,7 @@ cAudioManager::ProcessVehicleSirenOrAlarm(cVehicleParams& params) m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_nReleasingVolumeModificator = 1; m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_nEmittingVolume = 80; + SET_EMITTING_VOLUME(80); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 7.0f; m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; @@ -1694,7 +1699,7 @@ cAudioManager::ProcessVehicleReverseWarning(cVehicleParams& params) m_sQueueSample.m_nReleasingVolumeModificator = 2; m_sQueueSample.m_nFrequency = (100 * m_sQueueSample.m_nEntityIndex & 1023) + SampleManager.GetSampleBaseFrequency(SFX_REVERSE_WARNING); m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_nEmittingVolume = 60; + SET_EMITTING_VOLUME(60); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 3.0f; m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; @@ -1739,7 +1744,7 @@ cAudioManager::ProcessVehicleDoors(cVehicleParams& params) m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_nReleasingVolumeModificator = 10; m_sQueueSample.m_nLoopCount = 1; - m_sQueueSample.m_nEmittingVolume = emittingVol; + SET_EMITTING_VOLUME(emittingVol); RESET_LOOP_OFFSETS m_sQueueSample.m_fSpeedMultiplier = 1.0f; m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; @@ -1783,7 +1788,7 @@ cAudioManager::ProcessAirBrakes(cVehicleParams& params) m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_nReleasingVolumeModificator = 10; m_sQueueSample.m_nLoopCount = 1; - m_sQueueSample.m_nEmittingVolume = rand; + SET_EMITTING_VOLUME(rand); RESET_LOOP_OFFSETS m_sQueueSample.m_fSpeedMultiplier = 0.0f; m_sQueueSample.m_fSoundIntensity = 30.0f; @@ -1836,7 +1841,7 @@ cAudioManager::ProcessEngineDamage(cVehicleParams& params) m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_nEmittingVolume = emittingVolume; + SET_EMITTING_VOLUME(emittingVolume); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 2.0f; m_sQueueSample.m_fSoundIntensity = engineDamageIntensity; @@ -1869,7 +1874,7 @@ cAudioManager::ProcessCarBombTick(cVehicleParams& params) m_sQueueSample.m_nReleasingVolumeModificator = 0; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_COUNTDOWN); m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_nEmittingVolume = 60; + SET_EMITTING_VOLUME(60); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 2.0f; m_sQueueSample.m_fSoundIntensity = 40.0f; @@ -2307,7 +2312,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams& params) m_sQueueSample.m_bReleasingSoundFlag = TRUE; } SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) - m_sQueueSample.m_nEmittingVolume = emittingVol; + SET_EMITTING_VOLUME(emittingVol); m_sQueueSample.m_bReverbFlag = TRUE; m_sQueueSample.m_bIs2D = FALSE; AddSampleToRequestedQueue(); @@ -2343,7 +2348,7 @@ cAudioManager::ProcessTrainNoise(cVehicleParams& params) m_sQueueSample.m_nReleasingVolumeModificator = 2; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_TRAIN_FAR); m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_nEmittingVolume = emittingVol; + SET_EMITTING_VOLUME(emittingVol); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 3.0f; m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; @@ -2365,7 +2370,7 @@ cAudioManager::ProcessTrainNoise(cVehicleParams& params) m_sQueueSample.m_nReleasingVolumeModificator = 5; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_TRAIN_NEAR) + 100 * m_sQueueSample.m_nEntityIndex % 987; m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_nEmittingVolume = emittingVol; + SET_EMITTING_VOLUME(emittingVol); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 6.0f; m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; @@ -2409,7 +2414,7 @@ cAudioManager::ProcessBoatEngine(cVehicleParams& params) m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_nReleasingVolumeModificator = 3; m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_nEmittingVolume = 80; + SET_EMITTING_VOLUME(80); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 2.0f; m_sQueueSample.m_fSoundIntensity = intensity; @@ -2448,7 +2453,7 @@ cAudioManager::ProcessBoatEngine(cVehicleParams& params) m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_nReleasingVolumeModificator = 3; m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_nEmittingVolume = emittingVol; + SET_EMITTING_VOLUME(emittingVol); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 2.0f; m_sQueueSample.m_fSoundIntensity = intensity; @@ -2503,7 +2508,7 @@ cAudioManager::ProcessBoatEngine(cVehicleParams& params) m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_nReleasingVolumeModificator = 3; m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_nEmittingVolume = emittingVol; + SET_EMITTING_VOLUME(emittingVol); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 2.0f; m_sQueueSample.m_fSoundIntensity = intensity; @@ -2545,7 +2550,7 @@ cAudioManager::ProcessBoatMovingOverWater(cVehicleParams& params) m_sQueueSample.m_nReleasingVolumeModificator = 3; m_sQueueSample.m_nFrequency = (6050.f * multiplier) + 16000; m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_nEmittingVolume = vol; + SET_EMITTING_VOLUME(vol); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 2.0f; m_sQueueSample.m_fSoundIntensity = 50.0f; @@ -2600,7 +2605,7 @@ cAudioManager::ProcessHelicopter(cVehicleParams& params) m_sQueueSample.m_nReleasingVolumeModificator = 0; m_sQueueSample.m_nFrequency = 1200 * heli->m_nHeliId + SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_nEmittingVolume = emittingVol; + SET_EMITTING_VOLUME(emittingVol); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 6.0f; m_sQueueSample.m_fSoundIntensity = gHeliSfxRanges[i].m_fMaxDistance; @@ -2774,7 +2779,7 @@ cAudioManager::SetupJumboTaxiSound(uint8 vol) m_sQueueSample.m_nReleasingVolumeModificator = 1; m_sQueueSample.m_nFrequency = GetJumboTaxiFreq(); m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_nEmittingVolume = emittingVol; + SET_EMITTING_VOLUME(emittingVol); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 4.0f; m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; @@ -2805,7 +2810,7 @@ cAudioManager::SetupJumboWhineSound(uint8 emittingVol, uint32 freq) m_sQueueSample.m_nReleasingVolumeModificator = 1; m_sQueueSample.m_nFrequency = freq; m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_nEmittingVolume = emittingVol; + SET_EMITTING_VOLUME(emittingVol); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 4.0f; m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; @@ -2835,7 +2840,7 @@ cAudioManager::SetupJumboEngineSound(uint8 vol, uint32 freq) m_sQueueSample.m_nReleasingVolumeModificator = 1; m_sQueueSample.m_nFrequency = freq; m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_nEmittingVolume = emittingVol; + SET_EMITTING_VOLUME(emittingVol); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 4.0f; m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; @@ -2865,7 +2870,7 @@ cAudioManager::SetupJumboFlySound(uint8 emittingVol) m_sQueueSample.m_nReleasingVolumeModificator = 1; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_JUMBO_DIST_FLY); m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_nEmittingVolume = emittingVol; + SET_EMITTING_VOLUME(emittingVol); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 4.0f; m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; @@ -2895,7 +2900,7 @@ cAudioManager::SetupJumboRumbleSound(uint8 emittingVol) m_sQueueSample.m_nReleasingVolumeModificator = 1; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_JUMBO_RUMBLE); m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_nEmittingVolume = emittingVol; + SET_EMITTING_VOLUME(emittingVol); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 4.0f; m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; @@ -2975,7 +2980,7 @@ cAudioManager::ProcessPedHeadphones(cPedParams ¶ms) m_sQueueSample.m_nReleasingVolumeModificator = 5; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_HEADPHONES); m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_nEmittingVolume = emittingVol; + SET_EMITTING_VOLUME(emittingVol); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 4.0f; m_sQueueSample.m_fSoundIntensity = 7.0f; @@ -3085,7 +3090,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_fSoundIntensity = 20.0f; m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS - m_sQueueSample.m_nEmittingVolume = emittingVol; + SET_EMITTING_VOLUME(emittingVol); m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_bReleasingSoundFlag = TRUE; m_sQueueSample.m_bRequireReflection = TRUE; @@ -3112,7 +3117,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_fSoundIntensity = 30.0f; m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS - m_sQueueSample.m_nEmittingVolume = emittingVol; + SET_EMITTING_VOLUME(emittingVol); m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_bReleasingSoundFlag = TRUE; m_sQueueSample.m_bRequireReflection = TRUE; @@ -3176,7 +3181,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS emittingVol = m_anRandomTable[3] % 26 + 100; - m_sQueueSample.m_nEmittingVolume = emittingVol; + SET_EMITTING_VOLUME(emittingVol); m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_bReleasingSoundFlag = TRUE; m_sQueueSample.m_bRequireReflection = TRUE; @@ -3194,7 +3199,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS emittingVol = m_anRandomTable[2] % 20 + 100; - m_sQueueSample.m_nEmittingVolume = emittingVol; + SET_EMITTING_VOLUME(emittingVol); m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_bReleasingSoundFlag = TRUE; if (m_bDynamicAcousticModelingStatus) @@ -3219,7 +3224,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS emittingVol = m_anRandomTable[1] % 10 + 90; - m_sQueueSample.m_nEmittingVolume = emittingVol; + SET_EMITTING_VOLUME(emittingVol); m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_bReleasingSoundFlag = TRUE; if (m_bDynamicAcousticModelingStatus) @@ -3241,7 +3246,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS emittingVol = m_anRandomTable[3] % 15 + 70; - m_sQueueSample.m_nEmittingVolume = emittingVol; + SET_EMITTING_VOLUME(emittingVol); m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_bReleasingSoundFlag = TRUE; break; @@ -3259,7 +3264,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS emittingVol = m_anRandomTable[2] % 10 + 100; - m_sQueueSample.m_nEmittingVolume = emittingVol; + SET_EMITTING_VOLUME(emittingVol); m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_bReleasingSoundFlag = TRUE; if (m_bDynamicAcousticModelingStatus) @@ -3281,7 +3286,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS emittingVol = m_anRandomTable[1] % 15 + 70; - m_sQueueSample.m_nEmittingVolume = emittingVol; + SET_EMITTING_VOLUME(emittingVol); m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_bReleasingSoundFlag = TRUE; break; @@ -3299,7 +3304,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS emittingVol = m_anRandomTable[4] % 15 + 70; - m_sQueueSample.m_nEmittingVolume = emittingVol; + SET_EMITTING_VOLUME(emittingVol); m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_bReleasingSoundFlag = TRUE; break; @@ -3317,7 +3322,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS emittingVol = m_anRandomTable[4] % 10 + 110; - m_sQueueSample.m_nEmittingVolume = emittingVol; + SET_EMITTING_VOLUME(emittingVol); m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_bReleasingSoundFlag = TRUE; if (m_bDynamicAcousticModelingStatus) @@ -3339,7 +3344,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS emittingVol = m_anRandomTable[0] % 20 + 80; - m_sQueueSample.m_nEmittingVolume = emittingVol; + SET_EMITTING_VOLUME(emittingVol); m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_bReleasingSoundFlag = TRUE; if (m_bDynamicAcousticModelingStatus) @@ -3359,7 +3364,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) maxDist = SQR(60); m_sQueueSample.m_nLoopCount = 0; SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) - m_sQueueSample.m_nEmittingVolume = 90; + SET_EMITTING_VOLUME(90); m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_nReleasingVolumeDivider = 6; @@ -3418,7 +3423,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) maxDist = SQR(30); m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS - m_sQueueSample.m_nEmittingVolume = 75; + SET_EMITTING_VOLUME(75); m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_bReleasingSoundFlag = TRUE; m_sQueueSample.m_bRequireReflection = TRUE; @@ -3439,7 +3444,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS emittingVol = m_anRandomTable[4] % 10 + 40; - m_sQueueSample.m_nEmittingVolume = emittingVol; + SET_EMITTING_VOLUME(emittingVol); m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_bReleasingSoundFlag = TRUE; if (m_bDynamicAcousticModelingStatus) @@ -3460,7 +3465,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS emittingVol = 70; - m_sQueueSample.m_nEmittingVolume = 70; + SET_EMITTING_VOLUME(70); m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_bReleasingSoundFlag = TRUE; break; @@ -3478,7 +3483,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS emittingVol = m_anRandomTable[0] % 20 + 90; - m_sQueueSample.m_nEmittingVolume = emittingVol; + SET_EMITTING_VOLUME(emittingVol); m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_bReleasingSoundFlag = TRUE; break; @@ -3495,7 +3500,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS emittingVol = m_anRandomTable[2] % 30 + 70; - m_sQueueSample.m_nEmittingVolume = emittingVol; + SET_EMITTING_VOLUME(emittingVol); m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_bReleasingSoundFlag = TRUE; m_sQueueSample.m_bRequireReflection = TRUE; @@ -6052,7 +6057,9 @@ cPedComments::Process() AudioManager.m_sQueueSample.m_nLoopStart = 0; AudioManager.m_sQueueSample.m_nLoopEnd = -1; #endif // !GTA_PS2 +#ifdef EXTERNAL_3D_SOUND AudioManager.m_sQueueSample.m_nEmittingVolume = MAX_VOLUME; +#endif // !EXTERNAL_3D_SOUND AudioManager.m_sQueueSample.m_fSpeedMultiplier = 3.0f; switch (sampleIndex) { case SFX_POLICE_HELI_1: @@ -6170,7 +6177,7 @@ cAudioManager::ProcessExplosions(int32 explosion) m_sQueueSample.m_nLoopCount = 1; m_sQueueSample.m_bReleasingSoundFlag = TRUE; m_sQueueSample.m_bReverbFlag = TRUE; - m_sQueueSample.m_nEmittingVolume = MAX_VOLUME; + SET_EMITTING_VOLUME(MAX_VOLUME); RESET_LOOP_OFFSETS m_sQueueSample.m_bReverbFlag = TRUE; m_sQueueSample.m_bRequireReflection = TRUE; @@ -6238,7 +6245,7 @@ cAudioManager::ProcessFires(int32) m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_nLoopCount = 0; m_sQueueSample.m_bReleasingSoundFlag = FALSE; - m_sQueueSample.m_nEmittingVolume = emittingVol; + SET_EMITTING_VOLUME(emittingVol); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_bReverbFlag = TRUE; m_sQueueSample.m_bRequireReflection = FALSE; @@ -6281,7 +6288,7 @@ cAudioManager::ProcessWaterCannon(int32) m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_nLoopCount = 0; m_sQueueSample.m_bReleasingSoundFlag = FALSE; - m_sQueueSample.m_nEmittingVolume = 50; + SET_EMITTING_VOLUME(50); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_bReverbFlag = TRUE; m_sQueueSample.m_bRequireReflection = FALSE; @@ -6531,7 +6538,7 @@ cAudioManager::ProcessOneShotScriptObject(uint8 sound) m_sQueueSample.m_nCounter = iSound++; m_sQueueSample.m_nLoopCount = 1; m_sQueueSample.m_bReleasingSoundFlag = TRUE; - m_sQueueSample.m_nEmittingVolume = emittingVolume; + SET_EMITTING_VOLUME(emittingVolume); RESET_LOOP_OFFSETS m_sQueueSample.m_bReverbFlag = TRUE; AddSampleToRequestedQueue(); @@ -7138,7 +7145,7 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) m_sQueueSample.m_nLoopCount = 0; m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_bReverbFlag = TRUE; - m_sQueueSample.m_nEmittingVolume = emittingVolume; + SET_EMITTING_VOLUME(emittingVolume); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_bRequireReflection = FALSE; AddSampleToRequestedQueue(); @@ -7210,7 +7217,7 @@ cAudioManager::ProcessPornCinema(uint8 sound) m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_nReleasingVolumeModificator = 3; m_sQueueSample.m_fSpeedMultiplier = 2.0f; - m_sQueueSample.m_nEmittingVolume = MAX_VOLUME; + SET_EMITTING_VOLUME(MAX_VOLUME); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_bReverbFlag = TRUE; m_sQueueSample.m_bRequireReflection = FALSE; @@ -7233,7 +7240,7 @@ cAudioManager::ProcessPornCinema(uint8 sound) m_sQueueSample.m_nReleasingVolumeModificator = 6; m_sQueueSample.m_fSpeedMultiplier = 0.0f; #ifdef FIX_BUGS - m_sQueueSample.m_nEmittingVolume = 90; + SET_EMITTING_VOLUME(90); #endif RESET_LOOP_OFFSETS m_sQueueSample.m_bReverbFlag = TRUE; @@ -7272,7 +7279,7 @@ cAudioManager::ProcessWorkShopScriptObject(uint8 sound) m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_nReleasingVolumeModificator = 5; m_sQueueSample.m_fSpeedMultiplier = 2.0f; - m_sQueueSample.m_nEmittingVolume = 30; + SET_EMITTING_VOLUME(30); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_bReverbFlag = TRUE; m_sQueueSample.m_bRequireReflection = FALSE; @@ -7310,7 +7317,7 @@ cAudioManager::ProcessSawMillScriptObject(uint8 sound) m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_nReleasingVolumeModificator = 5; m_sQueueSample.m_fSpeedMultiplier = 2.0f; - m_sQueueSample.m_nEmittingVolume = 30; + SET_EMITTING_VOLUME(30); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_bReverbFlag = TRUE; m_sQueueSample.m_bRequireReflection = FALSE; @@ -7330,7 +7337,7 @@ cAudioManager::ProcessSawMillScriptObject(uint8 sound) m_sQueueSample.m_nReleasingVolumeModificator = 3; m_sQueueSample.m_fSpeedMultiplier = 2.0f; #ifdef FIX_BUGS - m_sQueueSample.m_nEmittingVolume = 70; + SET_EMITTING_VOLUME(70); #endif RESET_LOOP_OFFSETS m_sQueueSample.m_bReverbFlag = TRUE; @@ -7367,7 +7374,7 @@ cAudioManager::ProcessLaunderetteScriptObject(uint8 sound) m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_nReleasingVolumeModificator = 5; m_sQueueSample.m_fSpeedMultiplier = 2.0f; - m_sQueueSample.m_nEmittingVolume = 45; + SET_EMITTING_VOLUME(45); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_bReverbFlag = TRUE; m_sQueueSample.m_bRequireReflection = FALSE; @@ -7384,7 +7391,7 @@ cAudioManager::ProcessLaunderetteScriptObject(uint8 sound) m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_nReleasingVolumeModificator = 3; m_sQueueSample.m_fSpeedMultiplier = 2.0f; - m_sQueueSample.m_nEmittingVolume = 110; + SET_EMITTING_VOLUME(110); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_bReverbFlag = TRUE; m_sQueueSample.m_bRequireReflection = FALSE; @@ -7422,7 +7429,7 @@ cAudioManager::ProcessShopScriptObject(uint8 sound) m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_nReleasingVolumeModificator = 5; m_sQueueSample.m_fSpeedMultiplier = 2.0f; - m_sQueueSample.m_nEmittingVolume = 30; + SET_EMITTING_VOLUME(30); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_bReverbFlag = TRUE; m_sQueueSample.m_bRequireReflection = FALSE; @@ -7442,7 +7449,7 @@ cAudioManager::ProcessShopScriptObject(uint8 sound) m_sQueueSample.m_bReleasingSoundFlag = TRUE; m_sQueueSample.m_nReleasingVolumeModificator = 3; m_sQueueSample.m_fSpeedMultiplier = 2.0f; - m_sQueueSample.m_nEmittingVolume = 70; + SET_EMITTING_VOLUME(70); RESET_LOOP_OFFSETS m_sQueueSample.m_bReverbFlag = TRUE; m_sQueueSample.m_bRequireReflection = FALSE; @@ -7484,7 +7491,7 @@ cAudioManager::ProcessAirportScriptObject(uint8 sound) m_sQueueSample.m_bReleasingSoundFlag = TRUE; m_sQueueSample.m_nReleasingVolumeModificator = 3; m_sQueueSample.m_fSpeedMultiplier = 2.0f; - m_sQueueSample.m_nEmittingVolume = 110; + SET_EMITTING_VOLUME(110); RESET_LOOP_OFFSETS m_sQueueSample.m_bReverbFlag = TRUE; m_sQueueSample.m_bRequireReflection = FALSE; @@ -7530,7 +7537,7 @@ cAudioManager::ProcessCinemaScriptObject(uint8 sound) m_sQueueSample.m_bReleasingSoundFlag = TRUE; m_sQueueSample.m_nReleasingVolumeModificator = 3; m_sQueueSample.m_fSpeedMultiplier = 2.0f; - m_sQueueSample.m_nEmittingVolume = rand; + SET_EMITTING_VOLUME(rand); RESET_LOOP_OFFSETS m_sQueueSample.m_bReverbFlag = TRUE; m_sQueueSample.m_bRequireReflection = FALSE; @@ -7578,7 +7585,7 @@ cAudioManager::ProcessDocksScriptObject(uint8 sound) m_sQueueSample.m_bReleasingSoundFlag = TRUE; m_sQueueSample.m_nReleasingVolumeModificator = 3; m_sQueueSample.m_fSpeedMultiplier = 2.0f; - m_sQueueSample.m_nEmittingVolume = rand; + SET_EMITTING_VOLUME(rand); RESET_LOOP_OFFSETS m_sQueueSample.m_bReverbFlag = TRUE; m_sQueueSample.m_bRequireReflection = FALSE; @@ -7625,7 +7632,7 @@ cAudioManager::ProcessHomeScriptObject(uint8 sound) m_sQueueSample.m_bReleasingSoundFlag = TRUE; m_sQueueSample.m_nReleasingVolumeModificator = 3; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_nEmittingVolume = rand; + SET_EMITTING_VOLUME(rand); RESET_LOOP_OFFSETS m_sQueueSample.m_bReverbFlag = TRUE; m_sQueueSample.m_bRequireReflection = TRUE; @@ -7676,7 +7683,7 @@ cAudioManager::ProcessPoliceCellBeatingScriptObject(uint8 sound) m_sQueueSample.m_bReleasingSoundFlag = TRUE; m_sQueueSample.m_nReleasingVolumeModificator = 3; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_nEmittingVolume = emittingVol; + SET_EMITTING_VOLUME(emittingVol); RESET_LOOP_OFFSETS m_sQueueSample.m_bReverbFlag = TRUE; m_sQueueSample.m_bRequireReflection = FALSE; @@ -7721,7 +7728,7 @@ cAudioManager::ProcessWeather(int32 id) m_sQueueSample.m_bIs2D = TRUE; m_sQueueSample.m_nLoopCount = 1; m_sQueueSample.m_bReleasingSoundFlag = TRUE; - m_sQueueSample.m_nEmittingVolume = m_sQueueSample.m_nVolume; + SET_EMITTING_VOLUME(m_sQueueSample.m_nVolume); RESET_LOOP_OFFSETS m_sQueueSample.m_bReverbFlag = FALSE; m_sQueueSample.m_bRequireReflection = FALSE; @@ -7740,7 +7747,7 @@ cAudioManager::ProcessWeather(int32 id) m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_nReleasingVolumeDivider = 30; m_sQueueSample.m_bReverbFlag = FALSE; - m_sQueueSample.m_nEmittingVolume = m_sQueueSample.m_nVolume; + SET_EMITTING_VOLUME(m_sQueueSample.m_nVolume); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_bRequireReflection = FALSE; AddSampleToRequestedQueue(); @@ -7914,7 +7921,7 @@ cAudioManager::ProcessFrontEnd() m_sQueueSample.m_nBankIndex = frontendBank ? SFX_BANK_FRONT_END_MENU : SFX_BANK_0; m_sQueueSample.m_nReleasingVolumeModificator = 0; m_sQueueSample.m_bIs2D = TRUE; - m_sQueueSample.m_nEmittingVolume = m_sQueueSample.m_nVolume; + SET_EMITTING_VOLUME(m_sQueueSample.m_nVolume); RESET_LOOP_OFFSETS if (stereo) m_sQueueSample.m_nOffset = m_anRandomTable[0] & 31; @@ -7956,7 +7963,7 @@ cAudioManager::ProcessCrane() m_sQueueSample.m_nReleasingVolumeModificator = 2; m_sQueueSample.m_nFrequency = 6000; m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_nEmittingVolume = 100; + SET_EMITTING_VOLUME(100); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 4.0f; m_sQueueSample.m_fSoundIntensity = intensity; @@ -8023,7 +8030,7 @@ cAudioManager::ProcessProjectiles() m_sQueueSample.m_nCounter = i; m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_nEmittingVolume = emittingVol; + SET_EMITTING_VOLUME(emittingVol); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_bReverbFlag = TRUE; @@ -8103,7 +8110,7 @@ cAudioManager::ProcessGarages() m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_nReleasingVolumeModificator = 3; - m_sQueueSample.m_nEmittingVolume = 90; + SET_EMITTING_VOLUME(90); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 2.0f; m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; @@ -8134,7 +8141,7 @@ cAudioManager::ProcessGarages() } m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_nReleasingVolumeModificator = 4; - m_sQueueSample.m_nEmittingVolume = 60; + SET_EMITTING_VOLUME(60); m_sQueueSample.m_fSpeedMultiplier = 0.0f; m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; m_sQueueSample.m_bReverbFlag = TRUE; @@ -8177,7 +8184,7 @@ cAudioManager::ProcessFireHydrant() m_sQueueSample.m_nReleasingVolumeModificator = 4; m_sQueueSample.m_nFrequency = 15591; m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_nEmittingVolume = 40; + SET_EMITTING_VOLUME(40); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 2.0f; m_sQueueSample.m_fSoundIntensity = intensity; @@ -8236,7 +8243,7 @@ cAudioManager::ProcessBridgeWarning() m_sQueueSample.m_nReleasingVolumeModificator = 1; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_BRIDGE_OPEN_WARNING); m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_nEmittingVolume = 100; + SET_EMITTING_VOLUME(100); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 2.0f; m_sQueueSample.m_fSoundIntensity = 450.0f; @@ -8262,7 +8269,7 @@ cAudioManager::ProcessBridgeMotor() m_sQueueSample.m_nReleasingVolumeModificator = 1; m_sQueueSample.m_nFrequency = 5500; m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_nEmittingVolume = MAX_VOLUME; + SET_EMITTING_VOLUME(MAX_VOLUME); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 2.0f; m_sQueueSample.m_fSoundIntensity = bridgeIntensity; @@ -8296,7 +8303,7 @@ cAudioManager::ProcessBridgeOneShots() m_sQueueSample.m_nReleasingVolumeModificator = 1; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_nLoopCount = 1; - m_sQueueSample.m_nEmittingVolume = MAX_VOLUME; + SET_EMITTING_VOLUME(MAX_VOLUME); RESET_LOOP_OFFSETS m_sQueueSample.m_fSpeedMultiplier = 2.0f; m_sQueueSample.m_fSoundIntensity = bridgeIntensity; diff --git a/src/audio/AudioManager.cpp b/src/audio/AudioManager.cpp index b5836a6e..7345ceb1 100644 --- a/src/audio/AudioManager.cpp +++ b/src/audio/AudioManager.cpp @@ -335,14 +335,19 @@ cAudioManager::DestroyAllGameCreatedEntities() uint8 cAudioManager::GetNum3DProvidersAvailable() { +#ifdef EXTERNAL_3D_SOUND if (m_bIsInitialised) return SampleManager.GetNum3DProvidersAvailable(); +#endif return 0; } char * cAudioManager::Get3DProviderName(uint8 id) { +#ifndef EXTERNAL_3D_SOUND + return nil; +#else if (!m_bIsInitialised) return nil; #ifdef AUDIO_OAL @@ -353,13 +358,16 @@ cAudioManager::Get3DProviderName(uint8 id) return nil; #endif return SampleManager.Get3DProviderName(id); +#endif } int8 cAudioManager::GetCurrent3DProviderIndex() { +#ifdef EXTERNAL_3D_SOUND if (m_bIsInitialised) return SampleManager.GetCurrent3DProviderIndex(); +#endif return -1; } @@ -367,6 +375,9 @@ cAudioManager::GetCurrent3DProviderIndex() int8 cAudioManager::SetCurrent3DProvider(uint8 which) { +#ifndef EXTERNAL_3D_SOUND + return -1; +#else if (!m_bIsInitialised) return -1; for (uint8 i = 0; i < m_nActiveSamples + 1; ++i) @@ -387,12 +398,15 @@ cAudioManager::SetCurrent3DProvider(uint8 which) #endif } return current; +#endif } void cAudioManager::SetSpeakerConfig(int32 conf) { +#ifdef EXTERNAL_3D_SOUND SampleManager.SetSpeakerConfig(conf); +#endif } bool8 @@ -482,7 +496,7 @@ cAudioManager::ServiceSoundEffects() ServiceCollisions(); AddReleasingSounds(); ProcessMissionAudio(); -#ifdef GTA_PC +#ifdef EXTERNAL_3D_SOUND AdjustSamplesVolume(); #endif ProcessActiveQueues(); @@ -660,7 +674,7 @@ cAudioManager::AddReflectionsToRequestedQueue() m_sQueueSample.m_nLoopsRemaining = (reflectionDistance * 500.f / 1029.f); if (m_sQueueSample.m_nLoopsRemaining > 5) { m_sQueueSample.m_fDistance = m_afReflectionsDistances[i]; - m_sQueueSample.m_nEmittingVolume = emittingVolume; + SET_EMITTING_VOLUME(emittingVolume); m_sQueueSample.m_nVolume = ComputeVolume(emittingVolume, m_sQueueSample.m_fSoundIntensity, m_sQueueSample.m_fDistance); if (m_sQueueSample.m_nVolume > emittingVolume / 16) { m_sQueueSample.m_nCounter += (i + 1) * 256; @@ -1038,7 +1052,9 @@ cAudioManager::ClearActiveSamples() m_asActiveSamples[i].m_nReleasingVolumeModificator = 5; m_asActiveSamples[i].m_nFrequency = 0; m_asActiveSamples[i].m_nVolume = 0; +#ifdef EXTERNAL_3D_SOUND m_asActiveSamples[i].m_nEmittingVolume = 0; +#endif m_asActiveSamples[i].m_fDistance = 0.0f; m_asActiveSamples[i].m_bIsProcessed = FALSE; m_asActiveSamples[i].m_bLoopEnded = FALSE; @@ -1076,7 +1092,7 @@ cAudioManager::GenerateIntegerRandomNumberTable() } } -#ifdef GTA_PC +#ifdef EXTERNAL_3D_SOUND void cAudioManager::AdjustSamplesVolume() { diff --git a/src/audio/AudioManager.h b/src/audio/AudioManager.h index 187a71a8..d217c87a 100644 --- a/src/audio/AudioManager.h +++ b/src/audio/AudioManager.h @@ -20,6 +20,8 @@ public: #ifndef GTA_PS2 int32 m_nLoopStart; int32 m_nLoopEnd; +#endif +#ifdef EXTERNAL_3D_SOUND uint8 m_nEmittingVolume; #endif float m_fSpeedMultiplier; @@ -285,7 +287,7 @@ public: void GenerateIntegerRandomNumberTable(); // inlined on PS2 void LoadBankIfNecessary(uint8 bank); // this is used only on PS2 but technically not a platform code -#ifdef GTA_PC +#ifdef EXTERNAL_3D_SOUND // actually must have been && AUDIO_MSS as well void AdjustSamplesVolume(); uint8 ComputeEmittingVolume(uint8 emittingVolume, float intensity, float dist); #endif @@ -525,6 +527,11 @@ public: #define RESET_LOOP_OFFSETS #define SET_LOOP_OFFSETS(sample) #endif +#ifdef EXTERNAL_3D_SOUND +#define SET_EMITTING_VOLUME(vol) m_sQueueSample.m_nEmittingVolume = vol +#else +#define SET_EMITTING_VOLUME(vol) +#endif #if defined(AUDIO_MSS) && !defined(PS2_AUDIO_CHANNELS) static_assert(sizeof(cAudioManager) == 19220, "cAudioManager: error"); diff --git a/src/audio/PolRadio.cpp b/src/audio/PolRadio.cpp index d6079191..742e5ea5 100644 --- a/src/audio/PolRadio.cpp +++ b/src/audio/PolRadio.cpp @@ -133,7 +133,7 @@ cAudioManager::DoPoliceRadioCrackle() m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_POLICE_RADIO_CRACKLE); m_sQueueSample.m_nVolume = m_anRandomTable[2] % 20 + 15; m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_nEmittingVolume = m_sQueueSample.m_nVolume; + SET_EMITTING_VOLUME(m_sQueueSample.m_nVolume); SET_LOOP_OFFSETS(SFX_POLICE_RADIO_CRACKLE) m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_bReverbFlag = FALSE; diff --git a/src/audio/sampman.h b/src/audio/sampman.h index 2c64fdef..16e1a1bb 100644 --- a/src/audio/sampman.h +++ b/src/audio/sampman.h @@ -144,7 +144,8 @@ public: cSampleManager(void); ~cSampleManager(void); - + +#ifdef EXTERNAL_3D_SOUND void SetSpeakerConfig(int32 nConfig); uint32 GetMaximumSupportedChannels(void); @@ -156,6 +157,7 @@ public: int8 GetCurrent3DProviderIndex(void); int8 SetCurrent3DProvider(uint8 which); +#endif bool8 IsMP3RadioChannelAvailable(void); @@ -195,9 +197,11 @@ public: void SetChannelReverbFlag (uint32 nChannel, bool8 nReverbFlag); bool8 InitialiseChannel (uint32 nChannel, uint32 nSfx, uint8 nBank); +#ifdef EXTERNAL_3D_SOUND void SetChannelEmittingVolume(uint32 nChannel, uint32 nVolume); void SetChannel3DPosition (uint32 nChannel, float fX, float fY, float fZ); void SetChannel3DDistances (uint32 nChannel, float fMax, float fMin); +#endif void SetChannelVolume (uint32 nChannel, uint32 nVolume); void SetChannelPan (uint32 nChannel, uint32 nPan); void SetChannelFrequency (uint32 nChannel, uint32 nFreq); diff --git a/src/audio/sampman_miles.cpp b/src/audio/sampman_miles.cpp index d0c7992c..0ba6b544 100644 --- a/src/audio/sampman_miles.cpp +++ b/src/audio/sampman_miles.cpp @@ -73,7 +73,7 @@ char _aHDDPath[MAX_PATH]; bool8 _bSampmanInitialised = FALSE; - +#ifdef EXTERNAL_3D_SOUND // // Miscellaneous globals / defines @@ -92,11 +92,12 @@ S32 curprovider=-1; S32 usingEAX=0; S32 usingEAX3=0; HPROVIDER opened_provider=0; -H3DSAMPLE opened_samples[MAXCHANNELS ? MAXCHANNELS : 1] = {0}; +H3DSAMPLE opened_samples[MAXCHANNELS] = {0}; +#endif HSAMPLE opened_2dsamples[MAX2DCHANNELS] = {0}; HDIGDRIVER DIG; +#ifdef EXTERNAL_3D_SOUND S32 speaker_type=0; - U32 _maxSamples; float _fPrevEaxRatioDestination; bool8 _usingMilesFast2D; @@ -263,6 +264,7 @@ set_new_provider(S32 index) return FALSE; } +#endif cSampleManager::cSampleManager(void) : m_nNumberOfProviders(0) @@ -275,6 +277,7 @@ cSampleManager::~cSampleManager(void) } +#ifdef EXTERNAL_3D_SOUND void cSampleManager::SetSpeakerConfig(int32 which) { @@ -353,6 +356,7 @@ cSampleManager::SetCurrent3DProvider(uint8 nProvider) else return curprovider; } +#endif static bool8 _ResolveLink(char const *path, char *out) @@ -823,9 +827,11 @@ cSampleManager::ReleaseDigitalHandle(void) { if ( DIG ) { +#ifdef EXTERNAL_3D_SOUND prevprovider = curprovider; release_existing(); curprovider = -1; +#endif AIL_digital_handle_release(DIG); } } @@ -836,8 +842,10 @@ cSampleManager::ReacquireDigitalHandle(void) if ( DIG ) { AIL_digital_handle_reacquire(DIG); +#ifdef EXTERNAL_3D_SOUND if ( prevprovider != -1 ) set_new_provider(prevprovider); +#endif } } @@ -866,7 +874,8 @@ cSampleManager::Initialise(void) m_nMonoMode = 0; } - + +#ifdef EXTERNAL_3D_SOUND // miles TRACE("MILES"); { @@ -887,6 +896,7 @@ cSampleManager::Initialise(void) for ( int32 i = 0; i < MAXCHANNELS; i++ ) opened_samples[i] = NULL; } +#endif // banks TRACE("banks"); @@ -939,8 +949,10 @@ cSampleManager::Initialise(void) Terminate(); return FALSE; } - + +#ifdef EXTERNAL_3D_SOUND add_providers(); +#endif if ( !InitialiseSampleBanks() ) { @@ -1188,7 +1200,8 @@ cSampleManager::Initialise(void) TRACE("providerset"); { _bSampmanInitialised = TRUE; - + +#ifdef EXTERNAL_3D_SOUND U32 n = 0; while ( n < m_nNumberOfProviders ) @@ -1206,6 +1219,7 @@ cSampleManager::Initialise(void) Terminate(); return FALSE; } +#endif } TRACE("bank"); @@ -1300,8 +1314,10 @@ cSampleManager::Terminate(void) opened_2dsamples[i] = NULL; } } - + +#ifdef EXTERNAL_3D_SOUND release_existing(); +#endif _DeleteMP3Entries(); @@ -1411,6 +1427,7 @@ cSampleManager::UpdateEffectsVolume(void) //[Y], cSampleManager::UpdateSoundBuff { for ( int32 i = 0; i < MAXCHANNELS+MAX2DCHANNELS; i++ ) { +#ifdef EXTERNAL_3D_SOUND if ( i < MAXCHANNELS ) { if ( opened_samples[i] && GetChannelUsedFlag(i) ) @@ -1423,6 +1440,7 @@ cSampleManager::UpdateEffectsVolume(void) //[Y], cSampleManager::UpdateSoundBuff } } else +#endif { if ( opened_2dsamples[i - MAXCHANNELS] ) { @@ -1628,6 +1646,7 @@ cSampleManager::GetSampleLength(uint32 nSample) bool8 cSampleManager::UpdateReverb(void) { +#ifdef EXTERNAL_3D_SOUND if ( !usingEAX ) return FALSE; @@ -1700,20 +1719,19 @@ cSampleManager::UpdateReverb(void) _fPrevEaxRatioDestination = fRatio; return TRUE; +#endif + return FALSE; } void cSampleManager::SetChannelReverbFlag(uint32 nChannel, bool8 nReverbFlag) { +#ifdef EXTERNAL_3D_SOUND bool8 b2d = FALSE; switch ( nChannel ) { -#ifdef EXTERNAL_3D_SOUND case CHANNEL_POLICE_RADIO: -#else - default: -#endif { b2d = TRUE; break; @@ -1733,25 +1751,24 @@ cSampleManager::SetChannelReverbFlag(uint32 nChannel, bool8 nReverbFlag) AIL_set_3D_sample_effects_level(opened_samples[nChannel], 0.0f); } } +#endif } bool8 cSampleManager::InitialiseChannel(uint32 nChannel, uint32 nSfx, uint8 nBank) { +#ifdef EXTERNAL_3D_SOUND bool8 b2d = FALSE; switch ( nChannel ) { -#ifdef EXTERNAL_3D_SOUND case CHANNEL_POLICE_RADIO: -#else - default: -#endif { b2d = TRUE; break; } } +#endif int32 addr; @@ -1771,9 +1788,11 @@ cSampleManager::InitialiseChannel(uint32 nChannel, uint32 nSfx, uint8 nBank) addr = nPedSlotSfxAddr[slot]; } - + +#ifdef EXTERNAL_3D_SOUND if ( b2d ) { +#endif if ( opened_2dsamples[nChannel - MAXCHANNELS] ) { AIL_set_sample_address(opened_2dsamples[nChannel - MAXCHANNELS], (void *)addr, m_aSamples[nSfx].nSize); @@ -1781,6 +1800,7 @@ cSampleManager::InitialiseChannel(uint32 nChannel, uint32 nSfx, uint8 nBank) } else return FALSE; +#ifdef EXTERNAL_3D_SOUND } else { @@ -1801,8 +1821,10 @@ cSampleManager::InitialiseChannel(uint32 nChannel, uint32 nSfx, uint8 nBank) return TRUE; } +#endif } +#ifdef EXTERNAL_3D_SOUND void cSampleManager::SetChannelEmittingVolume(uint32 nChannel, uint32 nVolume) { @@ -1837,21 +1859,20 @@ cSampleManager::SetChannel3DDistances(uint32 nChannel, float fMax, float fMin) if ( opened_samples[nChannel] ) AIL_set_3D_sample_distances(opened_samples[nChannel], fMax, fMin); } +#endif void cSampleManager::SetChannelVolume(uint32 nChannel, uint32 nVolume) { uint32 vol = nVolume; if ( vol > MAX_VOLUME ) vol = MAX_VOLUME; - + +#ifdef EXTERNAL_3D_SOUND switch ( nChannel ) { -#ifdef EXTERNAL_3D_SOUND case CHANNEL_POLICE_RADIO: -#else - default: -#endif { +#endif nChannelVolume[nChannel] = vol; // increase the volume for JB.MP3 and S4_BDBD.MP3 @@ -1867,47 +1888,46 @@ cSampleManager::SetChannelVolume(uint32 nChannel, uint32 nVolume) AIL_set_sample_volume(opened_2dsamples[nChannel - MAXCHANNELS], m_nEffectsFadeVolume*vol*m_nEffectsVolume >> 14); } - + +#ifdef EXTERNAL_3D_SOUND break; } } +#endif } void cSampleManager::SetChannelPan(uint32 nChannel, uint32 nPan) { +#ifdef EXTERNAL_3D_SOUND switch ( nChannel ) { -#ifdef EXTERNAL_3D_SOUND case CHANNEL_POLICE_RADIO: -#else - default: -#endif { -#ifndef FIX_BUGS +#endif +#if !defined(FIX_BUGS) && defined(EXTERNAL_3D_SOUND) if ( opened_samples[nChannel - MAXCHANNELS] ) // BUG #else if ( opened_2dsamples[nChannel - MAXCHANNELS] ) #endif AIL_set_sample_pan(opened_2dsamples[nChannel - MAXCHANNELS], nPan); +#ifdef EXTERNAL_3D_SOUND break; } } +#endif } void cSampleManager::SetChannelFrequency(uint32 nChannel, uint32 nFreq) { +#ifdef EXTERNAL_3D_SOUND bool8 b2d = FALSE; switch ( nChannel ) { -#ifdef EXTERNAL_3D_SOUND case CHANNEL_POLICE_RADIO: -#else - default: -#endif { b2d = TRUE; break; @@ -1916,28 +1936,28 @@ cSampleManager::SetChannelFrequency(uint32 nChannel, uint32 nFreq) if ( b2d ) { +#endif if ( opened_2dsamples[nChannel - MAXCHANNELS] ) AIL_set_sample_playback_rate(opened_2dsamples[nChannel - MAXCHANNELS], nFreq); +#ifdef EXTERNAL_3D_SOUND } else { if ( opened_samples[nChannel] ) AIL_set_3D_sample_playback_rate(opened_samples[nChannel], nFreq); } +#endif } void cSampleManager::SetChannelLoopPoints(uint32 nChannel, uint32 nLoopStart, int32 nLoopEnd) { +#ifdef EXTERNAL_3D_SOUND bool8 b2d = FALSE; switch ( nChannel ) { -#ifdef EXTERNAL_3D_SOUND case CHANNEL_POLICE_RADIO: -#else - default: -#endif { b2d = TRUE; break; @@ -1946,28 +1966,28 @@ cSampleManager::SetChannelLoopPoints(uint32 nChannel, uint32 nLoopStart, int32 n if ( b2d ) { +#endif if ( opened_2dsamples[nChannel - MAXCHANNELS] ) AIL_set_sample_loop_block(opened_2dsamples[nChannel - MAXCHANNELS], nLoopStart, nLoopEnd); +#ifdef EXTERNAL_3D_SOUND } else { if ( opened_samples[nChannel] ) AIL_set_3D_sample_loop_block(opened_samples[nChannel], nLoopStart, nLoopEnd); } +#endif } void cSampleManager::SetChannelLoopCount(uint32 nChannel, uint32 nLoopCount) { +#ifdef EXTERNAL_3D_SOUND bool8 b2d = FALSE; switch ( nChannel ) { -#ifdef EXTERNAL_3D_SOUND case CHANNEL_POLICE_RADIO: -#else - default: -#endif { b2d = TRUE; break; @@ -1976,28 +1996,28 @@ cSampleManager::SetChannelLoopCount(uint32 nChannel, uint32 nLoopCount) if ( b2d ) { +#endif if ( opened_2dsamples[nChannel - MAXCHANNELS] ) AIL_set_sample_loop_count(opened_2dsamples[nChannel - MAXCHANNELS], nLoopCount); +#ifdef EXTERNAL_3D_SOUND } else { if ( opened_samples[nChannel] ) AIL_set_3D_sample_loop_count(opened_samples[nChannel], nLoopCount); } +#endif } bool8 cSampleManager::GetChannelUsedFlag(uint32 nChannel) { +#ifdef EXTERNAL_3D_SOUND bool8 b2d = FALSE; switch ( nChannel ) { -#ifdef EXTERNAL_3D_SOUND case CHANNEL_POLICE_RADIO: -#else - default: -#endif { b2d = TRUE; break; @@ -2006,10 +2026,12 @@ cSampleManager::GetChannelUsedFlag(uint32 nChannel) if ( b2d ) { +#endif if ( opened_2dsamples[nChannel - MAXCHANNELS] ) return AIL_sample_status(opened_2dsamples[nChannel - MAXCHANNELS]) == SMP_PLAYING; else return FALSE; +#ifdef EXTERNAL_3D_SOUND } else { @@ -2018,21 +2040,19 @@ cSampleManager::GetChannelUsedFlag(uint32 nChannel) else return FALSE; } +#endif } void cSampleManager::StartChannel(uint32 nChannel) { +#ifdef EXTERNAL_3D_SOUND bool8 b2d = FALSE; switch ( nChannel ) { -#ifdef EXTERNAL_3D_SOUND case CHANNEL_POLICE_RADIO: -#else - default: -#endif { b2d = TRUE; break; @@ -2041,28 +2061,28 @@ cSampleManager::StartChannel(uint32 nChannel) if ( b2d ) { +#endif if ( opened_2dsamples[nChannel - MAXCHANNELS] ) AIL_start_sample(opened_2dsamples[nChannel - MAXCHANNELS]); +#ifdef EXTERNAL_3D_SOUND } else { if ( opened_samples[nChannel] ) AIL_start_3D_sample(opened_samples[nChannel]); } +#endif } void cSampleManager::StopChannel(uint32 nChannel) { +#ifdef EXTERNAL_3D_SOUND bool8 b2d = FALSE; switch ( nChannel ) { -#ifdef EXTERNAL_3D_SOUND case CHANNEL_POLICE_RADIO: -#else - default: -#endif { b2d = TRUE; break; @@ -2071,8 +2091,10 @@ cSampleManager::StopChannel(uint32 nChannel) if ( b2d ) { +#endif if ( opened_2dsamples[nChannel - MAXCHANNELS] ) AIL_end_sample(opened_2dsamples[nChannel - MAXCHANNELS]); +#ifdef EXTERNAL_3D_SOUND } else { @@ -2082,6 +2104,7 @@ cSampleManager::StopChannel(uint32 nChannel) AIL_end_3D_sample(opened_samples[nChannel]); } } +#endif } void diff --git a/src/core/Frontend.cpp b/src/core/Frontend.cpp index 8358298f..62c16cd9 100644 --- a/src/core/Frontend.cpp +++ b/src/core/Frontend.cpp @@ -447,7 +447,7 @@ CMenuManager::ThingsToDoBeforeGoingBack() if ((m_nCurrScreen == MENUPAGE_SKIN_SELECT) && strcmp(m_aSkinName, m_PrefsSkinFile) != 0) { CWorld::Players[0].SetPlayerSkin(m_PrefsSkinFile); #ifdef CUSTOM_FRONTEND_OPTIONS - } else if (ScreenHasOption(m_nCurrScreen, "FEA_3DH")) { + } else if (ScreenHasOption(m_nCurrScreen, "FEA_RSS")) { #else } else if (m_nCurrScreen == MENUPAGE_SOUND_SETTINGS) { #endif diff --git a/src/core/MenuScreens.cpp b/src/core/MenuScreens.cpp index 3bd9adf4..0a149f27 100644 --- a/src/core/MenuScreens.cpp +++ b/src/core/MenuScreens.cpp @@ -40,8 +40,10 @@ CMenuScreen aScreens[MENUPAGES] = { { "FET_AUD", 1, MENUPAGE_OPTIONS, MENUPAGE_OPTIONS, 1, 1, MENUACTION_MUSICVOLUME, "FEA_MUS", SAVESLOT_NONE, MENUPAGE_SOUND_SETTINGS, MENUACTION_SFXVOLUME, "FEA_SFX", SAVESLOT_NONE, MENUPAGE_SOUND_SETTINGS, +#ifdef EXTERNAL_3D_SOUND MENUACTION_AUDIOHW, "FEA_3DH", SAVESLOT_NONE, MENUPAGE_SOUND_SETTINGS, MENUACTION_SPEAKERCONF, "FEA_SPK", SAVESLOT_NONE, MENUPAGE_SOUND_SETTINGS, +#endif MENUACTION_DYNAMICACOUSTIC, "FET_DAM", SAVESLOT_NONE, MENUPAGE_SOUND_SETTINGS, MENUACTION_RADIO, "FEA_RSS", SAVESLOT_NONE, MENUPAGE_SOUND_SETTINGS, MENUACTION_RESTOREDEF, "FET_DEF", SAVESLOT_NONE, MENUPAGE_SOUND_SETTINGS, diff --git a/src/core/MenuScreensCustom.cpp b/src/core/MenuScreensCustom.cpp index 033ed9b9..c22b2e3a 100644 --- a/src/core/MenuScreensCustom.cpp +++ b/src/core/MenuScreensCustom.cpp @@ -435,8 +435,10 @@ CMenuScreenCustom aScreens[MENUPAGES] = { { "FET_AUD", MENUPAGE_OPTIONS, MENUPAGE_OPTIONS, nil, nil, MENUACTION_MUSICVOLUME, "FEA_MUS", { nil, SAVESLOT_NONE, MENUPAGE_SOUND_SETTINGS }, MENUACTION_SFXVOLUME, "FEA_SFX", { nil, SAVESLOT_NONE, MENUPAGE_SOUND_SETTINGS }, +#ifdef EXTERNAL_3D_SOUND MENUACTION_AUDIOHW, "FEA_3DH", { nil, SAVESLOT_NONE, MENUPAGE_SOUND_SETTINGS }, MENUACTION_SPEAKERCONF, "FEA_SPK", { nil, SAVESLOT_NONE, MENUPAGE_SOUND_SETTINGS }, +#endif MENUACTION_DYNAMICACOUSTIC, "FET_DAM", { nil, SAVESLOT_NONE, MENUPAGE_SOUND_SETTINGS }, MENUACTION_RADIO, "FEA_RSS", { nil, SAVESLOT_NONE, MENUPAGE_SOUND_SETTINGS }, MENUACTION_RESTOREDEF, "FET_DEF", { nil, SAVESLOT_NONE, MENUPAGE_SOUND_SETTINGS }, diff --git a/src/core/config.h b/src/core/config.h index 21a8b738..782ad99f 100644 --- a/src/core/config.h +++ b/src/core/config.h @@ -166,6 +166,7 @@ enum Config { # define ANIM_COMPRESSION # define PS2_MENU #elif defined GTA_PC +# define EXTERNAL_3D_SOUND # define PC_PLAYER_CONTROLS // mouse player/cam mode # define GTA_REPLAY # define GTA_SCENE_EDIT @@ -420,6 +421,8 @@ enum Config { #define FREE_CAM // Rotating cam // Audio +#define EXTERNAL_3D_SOUND // use external engine to simulate 3d audio spatialization. OpenAL would not work without it (because it works in a 3d space + // originally and making it work in 2d only requires more resource). Will not work on PS2 #define RADIO_SCROLL_TO_PREV_STATION #define AUDIO_CACHE #define PS2_AUDIO_CHANNELS // increases the maximum number of audio channels to PS2 value of 44 (PC has 28 originally) @@ -466,3 +469,10 @@ enum Config { #endif #endif // VANILLA_DEFINES + +#if defined(AUDIO_OAL) && !defined(EXTERNAL_3D_SOUND) +static_assert(false, "AUDIO_OAL cannot work without EXTERNAL_3D_SOUND"); +#endif +#if defined(GTA_PS2) && defined(EXTERNAL_3D_SOUND) +static_assert(false, "EXTERNAL_3D_SOUND cannot work on PS2"); +#endif diff --git a/src/core/re3.cpp b/src/core/re3.cpp index b7d89363..4914cd9c 100644 --- a/src/core/re3.cpp +++ b/src/core/re3.cpp @@ -493,8 +493,10 @@ bool LoadINISettings() ReadIniIfExists("Audio", "SfxVolume", &FrontEndMenuManager.m_PrefsSfxVolume); ReadIniIfExists("Audio", "MusicVolume", &FrontEndMenuManager.m_PrefsMusicVolume); ReadIniIfExists("Audio", "Radio", &FrontEndMenuManager.m_PrefsRadioStation); +#ifdef EXTERNAL_3D_SOUND ReadIniIfExists("Audio", "SpeakerType", &FrontEndMenuManager.m_PrefsSpeakers); ReadIniIfExists("Audio", "Provider", &FrontEndMenuManager.m_nPrefsAudio3DProviderIndex); +#endif ReadIniIfExists("Audio", "DynamicAcoustics", &FrontEndMenuManager.m_PrefsDMA); ReadIniIfExists("Display", "Brightness", &FrontEndMenuManager.m_PrefsBrightness); ReadIniIfExists("Display", "DrawDistance", &FrontEndMenuManager.m_PrefsLOD); @@ -593,8 +595,10 @@ void SaveINISettings() StoreIni("Audio", "SfxVolume", FrontEndMenuManager.m_PrefsSfxVolume); StoreIni("Audio", "MusicVolume", FrontEndMenuManager.m_PrefsMusicVolume); StoreIni("Audio", "Radio", FrontEndMenuManager.m_PrefsRadioStation); +#ifdef EXTERNAL_3D_SOUND StoreIni("Audio", "SpeakerType", FrontEndMenuManager.m_PrefsSpeakers); StoreIni("Audio", "Provider", FrontEndMenuManager.m_nPrefsAudio3DProviderIndex); +#endif StoreIni("Audio", "DynamicAcoustics", FrontEndMenuManager.m_PrefsDMA); StoreIni("Display", "Brightness", FrontEndMenuManager.m_PrefsBrightness); StoreIni("Display", "DrawDistance", FrontEndMenuManager.m_PrefsLOD); |