summaryrefslogtreecommitdiffstats
path: root/src/audio/AudioLogic.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/audio/AudioLogic.cpp')
-rw-r--r--src/audio/AudioLogic.cpp355
1 files changed, 173 insertions, 182 deletions
diff --git a/src/audio/AudioLogic.cpp b/src/audio/AudioLogic.cpp
index 564881b8..699dec79 100644
--- a/src/audio/AudioLogic.cpp
+++ b/src/audio/AudioLogic.cpp
@@ -894,7 +894,7 @@ cAudioManager::ProcessCarHeli(cVehicleParams& params)
emittingVol = 0;
if (emittingVol != 0) {
m_sQueueSample.m_nVolume = ComputeVolume(emittingVol, SOUND_INTENSITY, m_sQueueSample.m_fDistance);
- if (m_sQueueSample.m_nVolume != 0) {
+ if (m_sQueueSample.m_nVolume > 0) {
m_sQueueSample.m_nCounter = 88;
if (boat != nil) {
m_sQueueSample.m_nSampleIndex = SFX_SEAPLANE_PRO3;
@@ -918,7 +918,7 @@ cAudioManager::ProcessCarHeli(cVehicleParams& params)
m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_nReleasingVolumeDivider = 5;
m_sQueueSample.m_bReverbFlag = TRUE;
- m_sQueueSample.m_bRequireReflection = FALSE;
+ SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue();
}
}
@@ -953,7 +953,7 @@ cAudioManager::ProcessCarHeli(cVehicleParams& params)
//sound from front of helicopter
emittingVol = (1.0f - cameraAngle) * volumeModifier * 127.0f;
m_sQueueSample.m_nVolume = ComputeVolume(emittingVol, 140.0f, m_sQueueSample.m_fDistance);
- if (m_sQueueSample.m_nVolume != 0) {
+ if (m_sQueueSample.m_nVolume > 0) {
m_sQueueSample.m_nCounter = 3;
if (hunterBool) {
m_sQueueSample.m_nSampleIndex = SFX_HELI_APACHE_1;
@@ -969,7 +969,7 @@ cAudioManager::ProcessCarHeli(cVehicleParams& params)
m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_nReleasingVolumeDivider = 5;
m_sQueueSample.m_bReverbFlag = TRUE;
- m_sQueueSample.m_bRequireReflection = FALSE;
+ SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue();
} else if (boat != nil) {
m_sQueueSample.m_nSampleIndex = SFX_SEAPLANE_PRO1;
@@ -994,7 +994,7 @@ cAudioManager::ProcessCarHeli(cVehicleParams& params)
m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_nReleasingVolumeDivider = 5;
m_sQueueSample.m_bReverbFlag = TRUE;
- m_sQueueSample.m_bRequireReflection = FALSE;
+ SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue();
} else {
m_sQueueSample.m_nSampleIndex = SFX_CAR_HELI_MAI;
@@ -1010,7 +1010,7 @@ cAudioManager::ProcessCarHeli(cVehicleParams& params)
m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_nReleasingVolumeDivider = 5;
m_sQueueSample.m_bReverbFlag = TRUE;
- m_sQueueSample.m_bRequireReflection = FALSE;
+ SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue();
}
}
@@ -1019,7 +1019,7 @@ cAudioManager::ProcessCarHeli(cVehicleParams& params)
//after accel rotor sound
emittingVol = ((cameraAngle + 1.0f) * volumeModifier * 127.0f) / 2.0f;
m_sQueueSample.m_nVolume = ComputeVolume(emittingVol, 140.0f, m_sQueueSample.m_fDistance);
- if (m_sQueueSample.m_nVolume != 0) {
+ if (m_sQueueSample.m_nVolume > 0) {
m_sQueueSample.m_nCounter = 1;
if (hunterBool) {
m_sQueueSample.m_nSampleIndex = SFX_HELI_APACHE_2;
@@ -1054,7 +1054,7 @@ cAudioManager::ProcessCarHeli(cVehicleParams& params)
m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_nReleasingVolumeDivider = 5;
m_sQueueSample.m_bReverbFlag = TRUE;
- m_sQueueSample.m_bRequireReflection = FALSE;
+ SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue();
}
@@ -1065,7 +1065,7 @@ cAudioManager::ProcessCarHeli(cVehicleParams& params)
if (propellerSpeed < 1.0f) {
emittingVol = (1.0f - propellerSpeed / 2.0f) * 70.0f;
m_sQueueSample.m_nVolume = ComputeVolume(emittingVol, 30.0f, m_sQueueSample.m_fDistance);
- if (m_sQueueSample.m_nVolume) {
+ if (m_sQueueSample.m_nVolume > 0) {
if (hunterBool) {
m_sQueueSample.m_nSampleIndex = SFX_HELI_APACHE_4;
m_sQueueSample.m_nBankIndex = SFX_BANK_0;
@@ -1087,7 +1087,7 @@ cAudioManager::ProcessCarHeli(cVehicleParams& params)
m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_nReleasingVolumeDivider = 30;
m_sQueueSample.m_bReverbFlag = TRUE;
- m_sQueueSample.m_bRequireReflection = FALSE;
+ SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue();
}
}
@@ -1098,7 +1098,7 @@ cAudioManager::ProcessCarHeli(cVehicleParams& params)
if (boat) {
if (TheCamera.Cams[TheCamera.ActiveCam].Mode == CCam::MODE_FIXED && m_sQueueSample.m_fDistance < 20.0f && propellerSpeed > 0.0f) {
m_sQueueSample.m_nVolume = ComputeVolume(propellerSpeed * 100.0f, 20.0f, m_sQueueSample.m_fDistance);
- if (m_sQueueSample.m_nVolume) {
+ if (m_sQueueSample.m_nVolume > 0) {
if (accelerateState > 0 || brakeState > 0)
m_sQueueSample.m_nFrequency = 18000 + Min(1.0f, (Max(accelerateState, brakeState) / 255.0f) * freqModifier) * 2204;
@@ -1122,7 +1122,7 @@ cAudioManager::ProcessCarHeli(cVehicleParams& params)
m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_nReleasingVolumeDivider = 7;
m_sQueueSample.m_bReverbFlag = TRUE;
- m_sQueueSample.m_bRequireReflection = FALSE;
+ SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue();
}
}
@@ -1138,7 +1138,7 @@ cAudioManager::ProcessCarHeli(cVehicleParams& params)
if (params.m_fDistance < SQR(27.0f)) {
CalculateDistance(params.m_bDistanceCalculated, params.m_fDistance);
m_sQueueSample.m_nVolume = ComputeVolume(volumeModifier * 25.0f, 27.0f, m_sQueueSample.m_fDistance);
- if (m_sQueueSample.m_nVolume) {
+ if (m_sQueueSample.m_nVolume > 0) {
m_sQueueSample.m_nCounter = 2;
m_sQueueSample.m_nSampleIndex = hunterBool ? SFX_HELI_APACHE_3 : SFX_CAR_HELI_REA;
m_sQueueSample.m_nBankIndex = SFX_BANK_0;
@@ -1153,7 +1153,7 @@ cAudioManager::ProcessCarHeli(cVehicleParams& params)
m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_nReleasingVolumeDivider = 5;
m_sQueueSample.m_bReverbFlag = TRUE;
- m_sQueueSample.m_bRequireReflection = FALSE;
+ SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue();
}
}
@@ -1182,7 +1182,7 @@ cAudioManager::ProcessRainOnVehicle(cVehicleParams& params)
CalculateDistance(params.m_bDistanceCalculated, params.m_fDistance);
emittingVol = 30.0f * CWeather::Rain;
m_sQueueSample.m_nVolume = ComputeVolume(emittingVol, SOUND_INTENSITY, m_sQueueSample.m_fDistance);
- if (m_sQueueSample.m_nVolume != 0) {
+ if (m_sQueueSample.m_nVolume > 0) {
m_sQueueSample.m_nCounter = veh->m_bRainSamplesCounter++;
if (veh->m_bRainSamplesCounter > 4)
veh->m_bRainSamplesCounter = 68;
@@ -1198,7 +1198,7 @@ cAudioManager::ProcessRainOnVehicle(cVehicleParams& params)
m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY;
m_sQueueSample.m_bReleasingSoundFlag = TRUE;
m_sQueueSample.m_bReverbFlag = FALSE;
- m_sQueueSample.m_bRequireReflection = FALSE;
+ SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue();
}
}
@@ -1231,7 +1231,7 @@ cAudioManager::ProcessReverseGear(cVehicleParams& params)
emittingVolume = modificator * 24.0f;
m_sQueueSample.m_nVolume = ComputeVolume(emittingVolume, reverseGearIntensity, m_sQueueSample.m_fDistance);
- if (m_sQueueSample.m_nVolume != 0) {
+ if (m_sQueueSample.m_nVolume > 0) {
if (params.m_pVehicle->m_fGasPedal >= 0.0f) {
m_sQueueSample.m_nCounter = 62;
m_sQueueSample.m_nSampleIndex = SFX_REVERSE_GEAR_2;
@@ -1251,7 +1251,7 @@ cAudioManager::ProcessReverseGear(cVehicleParams& params)
m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_nReleasingVolumeDivider = 5;
m_sQueueSample.m_bReverbFlag = TRUE;
- m_sQueueSample.m_bRequireReflection = FALSE;
+ SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue();
}
}
@@ -1293,7 +1293,7 @@ cAudioManager::ProcessModelHeliVehicle(cVehicleParams& params)
freq = Clamp2(5 * acceletateState + 22050, (int)prevFreq, 30);
CalculateDistance(params.m_bDistanceCalculated, params.m_fDistance);
m_sQueueSample.m_nVolume = ComputeVolume(70, SOUND_INTENSITY, m_sQueueSample.m_fDistance);
- if (m_sQueueSample.m_nVolume != 0) {
+ if (m_sQueueSample.m_nVolume > 0) {
m_sQueueSample.m_nCounter = 2;
m_sQueueSample.m_nSampleIndex = SFX_CAR_RC_HELI;
m_sQueueSample.m_nBankIndex = SFX_BANK_0;
@@ -1308,7 +1308,7 @@ cAudioManager::ProcessModelHeliVehicle(cVehicleParams& params)
m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_nReleasingVolumeDivider = 4;
m_sQueueSample.m_bReverbFlag = TRUE;
- m_sQueueSample.m_bRequireReflection = FALSE;
+ SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue();
}
if (isPlayerVeh)
@@ -1356,7 +1356,7 @@ cAudioManager::ProcessModelVehicle(cVehicleParams& params)
if (volume > 0) {
CalculateDistance(params.m_bDistanceCalculated, params.m_fDistance);
m_sQueueSample.m_nVolume = ComputeVolume(volume, SOUND_INTENSITY, m_sQueueSample.m_fDistance);
- if (m_sQueueSample.m_nVolume != 0) {
+ if (m_sQueueSample.m_nVolume > 0) {
m_sQueueSample.m_nCounter = 2;
m_sQueueSample.m_nSampleIndex = SFX_RC_REV;
m_sQueueSample.m_nBankIndex = SFX_BANK_0;
@@ -1371,7 +1371,7 @@ cAudioManager::ProcessModelVehicle(cVehicleParams& params)
m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_nReleasingVolumeDivider = 4;
m_sQueueSample.m_bReverbFlag = TRUE;
- m_sQueueSample.m_bRequireReflection = FALSE;
+ SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue();
}
}
@@ -1413,7 +1413,7 @@ cAudioManager::ProcessModelVehicle(cVehicleParams& params)
if (volume > 0) {
CalculateDistance(params.m_bDistanceCalculated, params.m_fDistance);
m_sQueueSample.m_nVolume = ComputeVolume(volume, SOUND_INTENSITY, m_sQueueSample.m_fDistance);
- if (m_sQueueSample.m_nVolume != 0) {
+ if (m_sQueueSample.m_nVolume > 0) {
if (vehSlowdown) {
m_sQueueSample.m_nCounter = 0;
m_sQueueSample.m_nSampleIndex = SFX_RC_IDLE;
@@ -1434,7 +1434,7 @@ cAudioManager::ProcessModelVehicle(cVehicleParams& params)
m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY;
m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_bReverbFlag = TRUE;
- m_sQueueSample.m_bRequireReflection = FALSE;
+ SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue();
}
}
@@ -1489,7 +1489,7 @@ cAudioManager::ProcessVehicleFlatTyre(cVehicleParams& params)
emittingVol = (100.0f * modifier);
CalculateDistance(params.m_bDistanceCalculated, params.m_fDistance);
m_sQueueSample.m_nVolume = ComputeVolume(emittingVol, SOUND_INTENSITY, m_sQueueSample.m_fDistance);
- if (m_sQueueSample.m_nVolume) {
+ if (m_sQueueSample.m_nVolume > 0) {
m_sQueueSample.m_nCounter = 95;
m_sQueueSample.m_nBankIndex = SFX_BANK_0;
m_sQueueSample.m_bIs2D = FALSE;
@@ -1504,7 +1504,7 @@ cAudioManager::ProcessVehicleFlatTyre(cVehicleParams& params)
m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_nReleasingVolumeDivider = 3;
m_sQueueSample.m_bReverbFlag = TRUE;
- m_sQueueSample.m_bRequireReflection = FALSE;
+ SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue();
}
}
@@ -1546,7 +1546,7 @@ cAudioManager::ProcessVehicleRoadNoise(cVehicleParams& params)
CalculateDistance(params.m_bDistanceCalculated, params.m_fDistance);
emittingVol = 30.f * Min(1.f, velocity / (0.5f * params.m_pTransmission->fMaxVelocity));
m_sQueueSample.m_nVolume = ComputeVolume(emittingVol, SOUND_INTENSITY, m_sQueueSample.m_fDistance);
- if (m_sQueueSample.m_nVolume != 0) {
+ if (m_sQueueSample.m_nVolume > 0) {
m_sQueueSample.m_nCounter = 0;
m_sQueueSample.m_nBankIndex = SFX_BANK_0;
m_sQueueSample.m_bIs2D = FALSE;
@@ -1569,7 +1569,7 @@ cAudioManager::ProcessVehicleRoadNoise(cVehicleParams& params)
m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_nReleasingVolumeDivider = 4;
m_sQueueSample.m_bReverbFlag = TRUE;
- m_sQueueSample.m_bRequireReflection = FALSE;
+ SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue();
}
}
@@ -1611,7 +1611,7 @@ cAudioManager::ProcessWetRoadNoise(cVehicleParams& params)
relativeVelocity = Min(1.0f, velocity / (0.5f * params.m_pTransmission->fMaxVelocity));
emittingVol = 23.0f * relativeVelocity * CWeather::WetRoads;
m_sQueueSample.m_nVolume = ComputeVolume(emittingVol, SOUND_INTENSITY, m_sQueueSample.m_fDistance);
- if (m_sQueueSample.m_nVolume != 0) {
+ if (m_sQueueSample.m_nVolume > 0) {
m_sQueueSample.m_nCounter = 1;
m_sQueueSample.m_nSampleIndex = SFX_ROAD_NOISE;
m_sQueueSample.m_nBankIndex = SFX_BANK_0;
@@ -1628,7 +1628,7 @@ cAudioManager::ProcessWetRoadNoise(cVehicleParams& params)
m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_nReleasingVolumeDivider = 4;
m_sQueueSample.m_bReverbFlag = TRUE;
- m_sQueueSample.m_bRequireReflection = FALSE;
+ SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue();
}
}
@@ -1808,7 +1808,7 @@ cAudioManager::ProcessVehicleEngine(cVehicleParams& params)
m_sQueueSample.m_nCounter = 2;
}
m_sQueueSample.m_nVolume = ComputeVolume(emittingVol, SOUND_INTENSITY, m_sQueueSample.m_fDistance);
- if (m_sQueueSample.m_nVolume != 0) {
+ if (m_sQueueSample.m_nVolume > 0) {
if (!caddyBool) {
if (veh->GetStatus() == STATUS_SIMPLE) {
if (modificator < 0.02f) {
@@ -1850,7 +1850,7 @@ cAudioManager::ProcessVehicleEngine(cVehicleParams& params)
m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_nReleasingVolumeDivider = 8;
m_sQueueSample.m_bReverbFlag = TRUE;
- m_sQueueSample.m_bRequireReflection = FALSE;
+ SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue();
}
}
@@ -1893,7 +1893,7 @@ void
cAudioManager::AddPlayerCarSample(uint8 emittingVolume, uint32 freq, uint32 sample, uint8 bank, uint8 counter, bool8 notLooping)
{
m_sQueueSample.m_nVolume = ComputeVolume(emittingVolume, 50.f, m_sQueueSample.m_fDistance);
- if (m_sQueueSample.m_nVolume != 0) {
+ if (m_sQueueSample.m_nVolume > 0) {
m_sQueueSample.m_nCounter = counter;
m_sQueueSample.m_nSampleIndex = sample;
#ifdef GTA_PS2
@@ -1916,7 +1916,7 @@ cAudioManager::AddPlayerCarSample(uint8 emittingVolume, uint32 freq, uint32 samp
m_sQueueSample.m_SoundIntensity = 50.0f;
m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_bReverbFlag = TRUE;
- m_sQueueSample.m_bRequireReflection = FALSE;
+ SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue();
}
}
@@ -1927,7 +1927,7 @@ cAudioManager::ProcessCesna(cVehicleParams &params)
if(params.m_fDistance < SQR(200)) {
CalculateDistance(params.m_bDistanceCalculated, params.m_fDistance);
m_sQueueSample.m_nVolume = ComputeVolume(80, 200.f, m_sQueueSample.m_fDistance);
- if(m_sQueueSample.m_nVolume != 0) {
+ if (m_sQueueSample.m_nVolume > 0) {
m_sQueueSample.m_nCounter = 52;
m_sQueueSample.m_nSampleIndex = SFX_CESNA_IDLE;
m_sQueueSample.m_nBankIndex = SFX_BANK_0;
@@ -1942,12 +1942,12 @@ cAudioManager::ProcessCesna(cVehicleParams &params)
m_sQueueSample.m_SoundIntensity = 200.0f;
m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_bReverbFlag = TRUE;
- m_sQueueSample.m_bRequireReflection = FALSE;
+ SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue();
}
if(params.m_fDistance < SQR(90)) {
m_sQueueSample.m_nVolume = ComputeVolume(80, 90.f, m_sQueueSample.m_fDistance);
- if(m_sQueueSample.m_nVolume != 0) {
+ if (m_sQueueSample.m_nVolume > 0) {
m_sQueueSample.m_nCounter = 2;
m_sQueueSample.m_nSampleIndex = SFX_CESNA_REV;
m_sQueueSample.m_nBankIndex = SFX_BANK_0;
@@ -1962,7 +1962,7 @@ cAudioManager::ProcessCesna(cVehicleParams &params)
m_sQueueSample.m_SoundIntensity = 90.0f;
m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_bReverbFlag = TRUE;
- m_sQueueSample.m_bRequireReflection = FALSE;
+ SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue();
}
}
@@ -2457,7 +2457,7 @@ cAudioManager::ProcessVehicleSkidding(cVehicleParams& params)
if (skidVal > 0.0f) {
emittingVol = 50.f * skidVal;
m_sQueueSample.m_nVolume = ComputeVolume(emittingVol, SOUND_INTENSITY, m_sQueueSample.m_fDistance);
- if (m_sQueueSample.m_nVolume != 0) {
+ if (m_sQueueSample.m_nVolume > 0) {
m_sQueueSample.m_nCounter = 3;
switch (params.m_pVehicle->m_nSurfaceTouched) {
case SURFACE_GRASS:
@@ -2497,7 +2497,7 @@ cAudioManager::ProcessVehicleSkidding(cVehicleParams& params)
m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_nReleasingVolumeDivider = 3;
m_sQueueSample.m_bReverbFlag = TRUE;
- m_sQueueSample.m_bRequireReflection = FALSE;
+ SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue();
}
}
@@ -2584,7 +2584,7 @@ cAudioManager::ProcessVehicleHorn(cVehicleParams& params)
CalculateDistance(params.m_bDistanceCalculated, params.m_fDistance);
volume = veh->bIsDrowning ? 20 : 80;
m_sQueueSample.m_nVolume = ComputeVolume(volume, SOUND_INTENSITY, m_sQueueSample.m_fDistance);
- if (m_sQueueSample.m_nVolume != 0) {
+ if (m_sQueueSample.m_nVolume > 0) {
m_sQueueSample.m_nCounter = 4;
m_sQueueSample.m_nSampleIndex = aVehicleSettings[params.m_nIndex].m_nHornSample;
m_sQueueSample.m_nBankIndex = SFX_BANK_0;
@@ -2603,7 +2603,7 @@ cAudioManager::ProcessVehicleHorn(cVehicleParams& params)
m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_nReleasingVolumeDivider = 4;
m_sQueueSample.m_bReverbFlag = TRUE;
- m_sQueueSample.m_bRequireReflection = FALSE;
+ SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue();
}
}
@@ -2650,7 +2650,7 @@ cAudioManager::ProcessVehicleSirenOrAlarm(cVehicleParams& params)
CalculateDistance(params.m_bDistanceCalculated, params.m_fDistance);
volume = veh->bIsDrowning ? 20 : 80;
m_sQueueSample.m_nVolume = ComputeVolume(volume, SOUND_INTENSITY, m_sQueueSample.m_fDistance);
- if (m_sQueueSample.m_nVolume != 0) {
+ if (m_sQueueSample.m_nVolume > 0) {
m_sQueueSample.m_nCounter = 5;
if (UsesSiren(params)) {
if (params.m_pVehicle->GetStatus() == STATUS_ABANDONED)
@@ -2684,7 +2684,7 @@ cAudioManager::ProcessVehicleSirenOrAlarm(cVehicleParams& params)
m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_nReleasingVolumeDivider = 5;
m_sQueueSample.m_bReverbFlag = TRUE;
- m_sQueueSample.m_bRequireReflection = FALSE;
+ SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue();
}
return TRUE;
@@ -2711,7 +2711,7 @@ cAudioManager::ProcessVehicleReverseWarning(cVehicleParams& params)
CalculateDistance(params.m_bDistanceCalculated, params.m_fDistance);
volume = veh->bIsDrowning ? 15 : 60;
m_sQueueSample.m_nVolume = ComputeVolume(volume, SOUND_INTENSITY, m_sQueueSample.m_fDistance);
- if (m_sQueueSample.m_nVolume != 0) {
+ if (m_sQueueSample.m_nVolume > 0) {
m_sQueueSample.m_nCounter = 12;
m_sQueueSample.m_nSampleIndex = SFX_REVERSE_WARNING;
m_sQueueSample.m_nBankIndex = SFX_BANK_0;
@@ -2730,7 +2730,7 @@ cAudioManager::ProcessVehicleReverseWarning(cVehicleParams& params)
m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_nReleasingVolumeDivider = 3;
m_sQueueSample.m_bReverbFlag = TRUE;
- m_sQueueSample.m_bRequireReflection = FALSE;
+ SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue();
}
}
@@ -2760,7 +2760,7 @@ cAudioManager::ProcessVehicleDoors(cVehicleParams& params)
if (velocity > 0.0035f) {
emittingVol = (100.0f * velocity * 10.0f / 3.0f);
m_sQueueSample.m_nVolume = ComputeVolume(emittingVol, SOUND_INTENSITY, m_sQueueSample.m_fDistance);
- if (m_sQueueSample.m_nVolume != 0) {
+ if (m_sQueueSample.m_nVolume > 0) {
m_sQueueSample.m_nCounter = i + 6;
m_sQueueSample.m_nSampleIndex = m_anRandomTable[1] % 6 + SFX_COL_CAR_PANEL_1;
m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex) + RandomDisplacement(1000);
@@ -2774,7 +2774,7 @@ cAudioManager::ProcessVehicleDoors(cVehicleParams& params)
m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY;
m_sQueueSample.m_bReleasingSoundFlag = TRUE;
m_sQueueSample.m_bReverbFlag = TRUE;
- m_sQueueSample.m_bRequireReflection = TRUE;
+ SET_SOUND_REFLECTION(TRUE);
AddSampleToRequestedQueue();
}
}
@@ -2804,7 +2804,7 @@ cAudioManager::ProcessAirBrakes(cVehicleParams& params)
CalculateDistance(params.m_bDistanceCalculated, params.m_fDistance);
volume = m_anRandomTable[0] % 10 + 70;
m_sQueueSample.m_nVolume = ComputeVolume(volume, SOUND_INTENSITY, m_sQueueSample.m_fDistance);
- if (m_sQueueSample.m_nVolume != 0) {
+ if (m_sQueueSample.m_nVolume > 0) {
m_sQueueSample.m_nCounter = 13;
m_sQueueSample.m_nSampleIndex = SFX_AIR_BRAKES;
m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_AIR_BRAKES);
@@ -2819,7 +2819,7 @@ cAudioManager::ProcessAirBrakes(cVehicleParams& params)
m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY;
m_sQueueSample.m_bReleasingSoundFlag = TRUE;
m_sQueueSample.m_bReverbFlag = TRUE;
- m_sQueueSample.m_bRequireReflection = FALSE;
+ SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue();
}
@@ -2864,7 +2864,7 @@ cAudioManager::ProcessEngineDamage(cVehicleParams& params)
if (params.m_pVehicle->bIsDrowning)
emittingVolume /= 2;
m_sQueueSample.m_nVolume = ComputeVolume(emittingVolume, SOUND_INTENSITY, m_sQueueSample.m_fDistance);
- if (m_sQueueSample.m_nVolume != 0) {
+ if (m_sQueueSample.m_nVolume > 0) {
m_sQueueSample.m_nCounter = 28;
m_sQueueSample.m_nBankIndex = SFX_BANK_0;
m_sQueueSample.m_bIs2D = FALSE;
@@ -2876,7 +2876,7 @@ cAudioManager::ProcessEngineDamage(cVehicleParams& params)
m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_nReleasingVolumeDivider = 3;
m_sQueueSample.m_bReverbFlag = TRUE;
- m_sQueueSample.m_bRequireReflection = FALSE;
+ SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue();
}
}
@@ -2909,7 +2909,7 @@ cAudioManager::ProcessCarBombTick(cVehicleParams& params)
if (bombType == CARBOMB_TIMEDACTIVE) {
CalculateDistance(params.m_bDistanceCalculated, params.m_fDistance);
m_sQueueSample.m_nVolume = ComputeVolume(EMITTING_VOLUME, SOUND_INTENSITY, m_sQueueSample.m_fDistance);
- if (m_sQueueSample.m_nVolume != 0) {
+ if (m_sQueueSample.m_nVolume > 0) {
m_sQueueSample.m_nCounter = 35;
m_sQueueSample.m_nSampleIndex = SFX_COUNTDOWN;
m_sQueueSample.m_nBankIndex = SFX_BANK_0;
@@ -2924,7 +2924,7 @@ cAudioManager::ProcessCarBombTick(cVehicleParams& params)
m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_nReleasingVolumeDivider = 3;
m_sQueueSample.m_bReverbFlag = TRUE;
- m_sQueueSample.m_bRequireReflection = FALSE;
+ SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue();
}
}
@@ -2940,14 +2940,14 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams& params)
float relVol;
float vol;
bool8 noReflections;
- bool8 isHeli;
+ bool8 stereo;
float maxDist;
static uint8 GunIndex = 53;
for (uint16 i = 0; i < m_asAudioEntities[m_sQueueSample.m_nEntityIndex].m_AudioEvents; i++) {
noReflections = FALSE;
- isHeli = FALSE;
- m_sQueueSample.m_bRequireReflection = FALSE;
+ stereo = FALSE;
+ SET_SOUND_REFLECTION(FALSE);
event = m_asAudioEntities[m_sQueueSample.m_nEntityIndex].m_awAudioEvent[i];
switch (event) {
case SOUND_CAR_DOOR_CLOSE_BONNET:
@@ -2990,7 +2990,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams& params)
m_sQueueSample.m_nReleasingVolumeModificator = 3;
m_sQueueSample.m_fSpeedMultiplier = 0.0f;
m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY;
- m_sQueueSample.m_bRequireReflection = TRUE;
+ SET_SOUND_REFLECTION(TRUE);
break;
}
case SOUND_CAR_DOOR_OPEN_BONNET:
@@ -3030,7 +3030,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams& params)
m_sQueueSample.m_nReleasingVolumeModificator = 3;
m_sQueueSample.m_fSpeedMultiplier = 0.0f;
m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY;
- m_sQueueSample.m_bRequireReflection = TRUE;
+ SET_SOUND_REFLECTION(TRUE);
break;
}
case SOUND_CAR_WINDSHIELD_CRACK: {
@@ -3105,7 +3105,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams& params)
m_sQueueSample.m_nReleasingVolumeModificator = 1;
m_sQueueSample.m_fSpeedMultiplier = 2.0f;
m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY;
- m_sQueueSample.m_bRequireReflection = TRUE;
+ SET_SOUND_REFLECTION(TRUE);
break;
}
case SOUND_CAR_LIGHT_BREAK: {
@@ -3248,7 +3248,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams& params)
m_sQueueSample.m_fSpeedMultiplier = 0.0f;
m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY;
maxDist = SQR(SOUND_INTENSITY);
- m_sQueueSample.m_bRequireReflection = TRUE;
+ SET_SOUND_REFLECTION(TRUE);
emittingVol = 60;
break;
}
@@ -3330,8 +3330,8 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams& params)
m_sQueueSample.m_nReleasingVolumeModificator = 2;
m_sQueueSample.m_fSpeedMultiplier = 0.0f;
m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY;
- m_sQueueSample.m_bRequireReflection = TRUE;
- isHeli = TRUE;
+ SET_SOUND_REFLECTION(TRUE);
+ stereo = TRUE;
break;
default:
{
@@ -3384,7 +3384,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams& params)
m_sQueueSample.m_nReleasingVolumeModificator = 3;
m_sQueueSample.m_fSpeedMultiplier = 0.0f;
m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY;
- m_sQueueSample.m_bRequireReflection = TRUE;
+ SET_SOUND_REFLECTION(TRUE);
break;
}
}
@@ -3416,7 +3416,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams& params)
m_sQueueSample.m_nReleasingVolumeModificator = 0;
m_sQueueSample.m_fSpeedMultiplier = 0.0f;
m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY;
- m_sQueueSample.m_bRequireReflection = TRUE;
+ SET_SOUND_REFLECTION(TRUE);
emittingVol = 50;
maxDist = SQR(SOUND_INTENSITY);
break;
@@ -3457,7 +3457,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams& params)
m_sQueueSample.m_fSpeedMultiplier = 0.0f;
m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY;
maxDist = SQR(SOUND_INTENSITY);
- m_sQueueSample.m_bRequireReflection = TRUE;
+ SET_SOUND_REFLECTION(TRUE);
emittingVol = m_anRandomTable[4] % 20 + 90;
break;
}
@@ -3475,7 +3475,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams& params)
maxDist = SQR(SOUND_INTENSITY);
emittingVol = m_anRandomTable[4] % 20 + 55;
CrunchOffset %= 2;
- m_sQueueSample.m_bRequireReflection = TRUE;
+ SET_SOUND_REFLECTION(TRUE);
break;
}
case SOUND_CAR_PED_COLLISION: {
@@ -3502,7 +3502,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams& params)
if (params.m_fDistance < maxDist) {
CalculateDistance(params.m_bDistanceCalculated, params.m_fDistance);
m_sQueueSample.m_nVolume = ComputeVolume(emittingVol, m_sQueueSample.m_SoundIntensity, m_sQueueSample.m_fDistance);
- if (m_sQueueSample.m_nVolume != 0) {
+ if (m_sQueueSample.m_nVolume > 0) {
if (noReflections) {
m_sQueueSample.m_nLoopCount = 0;
m_sQueueSample.m_bReleasingSoundFlag = FALSE;
@@ -3513,42 +3513,25 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams& params)
SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex)
SET_EMITTING_VOLUME(emittingVol);
m_sQueueSample.m_bReverbFlag = TRUE;
- if (isHeli) {
- if (0.2f * m_sQueueSample.m_SoundIntensity > m_sQueueSample.m_fDistance) {
+ if (stereo) {
+ if(m_sQueueSample.m_fDistance < 0.2f * m_sQueueSample.m_SoundIntensity) {
m_sQueueSample.m_bIs2D = TRUE;
m_sQueueSample.m_nOffset = 0;
-#ifdef THIS_IS_STUPID
- goto AddSample;
-#else
- AddSampleToRequestedQueue();
- m_sQueueSample.m_nOffset = 127;
- m_sQueueSample.m_nSampleIndex++;
- m_sQueueSample.m_nCounter = GunIndex++;
- if (GunIndex > 58)
- GunIndex = 53;
- m_sQueueSample.m_bRequireReflection = FALSE;
- AddSampleToRequestedQueue();
- continue;
-#endif
+ } else {
+ stereo = FALSE;
+ m_sQueueSample.m_bIs2D = FALSE;
}
- isHeli = FALSE;
- }
- m_sQueueSample.m_bIs2D = FALSE;
-#ifdef THIS_IS_STUPID
-AddSample:
+ } else m_sQueueSample.m_bIs2D = FALSE;
AddSampleToRequestedQueue();
- if (isHeli) {
+ if (stereo) {
m_sQueueSample.m_nOffset = 127;
m_sQueueSample.m_nSampleIndex++;
m_sQueueSample.m_nCounter = GunIndex++;
if (GunIndex > 58)
GunIndex = 53;
- m_sQueueSample.m_bRequireReflection = 0;
+ SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue();
}
-#else
- AddSampleToRequestedQueue();
-#endif
continue;
}
@@ -3576,7 +3559,7 @@ cAudioManager::ProcessTrainNoise(cVehicleParams& params)
emittingVol = (75.f * speedMultipler);
if (train->m_fWagonPosition == 0.0f) {
m_sQueueSample.m_nVolume = ComputeVolume(emittingVol, SOUND_INTENSITY, m_sQueueSample.m_fDistance);
- if (m_sQueueSample.m_nVolume != 0) {
+ if (m_sQueueSample.m_nVolume > 0) {
m_sQueueSample.m_nCounter = 32;
m_sQueueSample.m_nSampleIndex = SFX_TRAIN_FAR;
m_sQueueSample.m_nBankIndex = SFX_BANK_0;
@@ -3591,14 +3574,14 @@ cAudioManager::ProcessTrainNoise(cVehicleParams& params)
m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_nReleasingVolumeDivider = 3;
m_sQueueSample.m_bReverbFlag = TRUE;
- m_sQueueSample.m_bRequireReflection = FALSE;
+ SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue();
}
}
const float SOUND_INTENSITY = 70.0f;
if (params.m_fDistance < SQR(SOUND_INTENSITY)) {
m_sQueueSample.m_nVolume = ComputeVolume(emittingVol, SOUND_INTENSITY, m_sQueueSample.m_fDistance);
- if (m_sQueueSample.m_nVolume != 0) {
+ if (m_sQueueSample.m_nVolume > 0) {
m_sQueueSample.m_nCounter = 33;
m_sQueueSample.m_nSampleIndex = SFX_TRAIN_NEAR;
m_sQueueSample.m_nBankIndex = SFX_BANK_0;
@@ -3613,7 +3596,7 @@ cAudioManager::ProcessTrainNoise(cVehicleParams& params)
m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_nReleasingVolumeDivider = 3;
m_sQueueSample.m_bReverbFlag = TRUE;
- m_sQueueSample.m_bRequireReflection = FALSE;
+ SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue();
}
}
@@ -3717,7 +3700,7 @@ cAudioManager::ProcessBoatEngine(cVehicleParams& params)
if (Vol > 0) {
CalculateDistance(params.m_bDistanceCalculated, params.m_fDistance);
m_sQueueSample.m_nVolume = ComputeVolume(Vol, intensity, m_sQueueSample.m_fDistance);
- if (m_sQueueSample.m_nVolume != 0) {
+ if (m_sQueueSample.m_nVolume > 0) {
m_sQueueSample.m_nFrequency = Freq;
m_sQueueSample.m_nCounter = 40;
if (isV12)
@@ -3735,7 +3718,7 @@ cAudioManager::ProcessBoatEngine(cVehicleParams& params)
m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_nReleasingVolumeDivider = 7;
m_sQueueSample.m_bReverbFlag = TRUE;
- m_sQueueSample.m_bRequireReflection = FALSE;
+ SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue();
}
}
@@ -3743,7 +3726,7 @@ cAudioManager::ProcessBoatEngine(cVehicleParams& params)
if(boat->GetModelIndex() == MI_REEFER) {
CalculateDistance(params.m_bDistanceCalculated, params.m_fDistance);
m_sQueueSample.m_nVolume = ComputeVolume(80, intensity, m_sQueueSample.m_fDistance);
- if (m_sQueueSample.m_nVolume != 0) {
+ if (m_sQueueSample.m_nVolume > 0) {
m_sQueueSample.m_nFrequency = 6000;
m_sQueueSample.m_nCounter = 39;
m_sQueueSample.m_nSampleIndex = SFX_FISHING_BOAT_IDLE;
@@ -3759,7 +3742,7 @@ cAudioManager::ProcessBoatEngine(cVehicleParams& params)
m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_nReleasingVolumeDivider = 7;
m_sQueueSample.m_bReverbFlag = TRUE;
- m_sQueueSample.m_bRequireReflection = FALSE;
+ SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue();
}
}
@@ -3791,7 +3774,7 @@ cAudioManager::ProcessBoatMovingOverWater(cVehicleParams& params)
CalculateDistance(params.m_bDistanceCalculated, params.m_fDistance);
vol = (30.f * multiplier);
m_sQueueSample.m_nVolume = ComputeVolume(vol, 50.f, m_sQueueSample.m_fDistance);
- if (m_sQueueSample.m_nVolume != 0) {
+ if (m_sQueueSample.m_nVolume > 0) {
m_sQueueSample.m_nCounter = 38;
m_sQueueSample.m_nSampleIndex = SFX_BOAT_WATER_LOOP;
m_sQueueSample.m_nBankIndex = SFX_BANK_0;
@@ -3806,7 +3789,7 @@ cAudioManager::ProcessBoatMovingOverWater(cVehicleParams& params)
m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_nReleasingVolumeDivider = 6;
m_sQueueSample.m_bReverbFlag = TRUE;
- m_sQueueSample.m_bRequireReflection = FALSE;
+ SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue();
}
@@ -3958,7 +3941,7 @@ cAudioManager::SetupJumboTaxiSound(uint8 vol)
emittingVol -= emittingVol * gJumboVolOffsetPercentage / 100;
m_sQueueSample.m_nVolume = ComputeVolume(emittingVol, SOUND_INTENSITY, m_sQueueSample.m_fDistance);
- if (m_sQueueSample.m_nVolume != 0) {
+ if (m_sQueueSample.m_nVolume > 0) {
m_sQueueSample.m_nCounter = 1;
m_sQueueSample.m_nSampleIndex = SFX_JUMBO_TAXI;
m_sQueueSample.m_nBankIndex = SFX_BANK_0;
@@ -3973,7 +3956,7 @@ cAudioManager::SetupJumboTaxiSound(uint8 vol)
m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_nReleasingVolumeDivider = 4;
m_sQueueSample.m_bReverbFlag = TRUE;
- m_sQueueSample.m_bRequireReflection = FALSE;
+ SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue();
}
return TRUE;
@@ -3989,7 +3972,7 @@ cAudioManager::SetupJumboWhineSound(uint8 emittingVol, uint32 freq)
m_sQueueSample.m_nVolume = ComputeVolume(emittingVol, SOUND_INTENSITY, m_sQueueSample.m_fDistance);
- if (m_sQueueSample.m_nVolume != 0) {
+ if (m_sQueueSample.m_nVolume > 0) {
m_sQueueSample.m_nCounter = 2;
m_sQueueSample.m_nSampleIndex = SFX_JUMBO_WHINE;
m_sQueueSample.m_nBankIndex = SFX_BANK_0;
@@ -4004,7 +3987,7 @@ cAudioManager::SetupJumboWhineSound(uint8 emittingVol, uint32 freq)
m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_nReleasingVolumeDivider = 4;
m_sQueueSample.m_bReverbFlag = TRUE;
- m_sQueueSample.m_bRequireReflection = FALSE;
+ SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue();
}
return TRUE;
@@ -4019,7 +4002,7 @@ cAudioManager::SetupJumboEngineSound(uint8 vol, uint32 freq)
uint8 emittingVol = vol - gJumboVolOffsetPercentage / 100;
m_sQueueSample.m_nVolume = ComputeVolume(emittingVol, SOUND_INTENSITY, m_sQueueSample.m_fDistance);
- if (m_sQueueSample.m_nVolume != 0) {
+ if (m_sQueueSample.m_nVolume > 0) {
m_sQueueSample.m_nCounter = 3;
m_sQueueSample.m_nSampleIndex = SFX_JUMBO_ENGINE;
m_sQueueSample.m_nBankIndex = SFX_BANK_0;
@@ -4034,7 +4017,7 @@ cAudioManager::SetupJumboEngineSound(uint8 vol, uint32 freq)
m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_nReleasingVolumeDivider = 4;
m_sQueueSample.m_bReverbFlag = TRUE;
- m_sQueueSample.m_bRequireReflection = FALSE;
+ SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue();
}
return TRUE;
@@ -4048,7 +4031,7 @@ cAudioManager::SetupJumboFlySound(uint8 emittingVol)
int32 vol = ComputeVolume(emittingVol, SOUND_INTENSITY, m_sQueueSample.m_fDistance);
m_sQueueSample.m_nVolume = vol;
- if(m_sQueueSample.m_nVolume != 0) {
+ if (m_sQueueSample.m_nVolume > 0) {
m_sQueueSample.m_nCounter = 0;
m_sQueueSample.m_nSampleIndex = SFX_JUMBO_DIST_FLY;
m_sQueueSample.m_nBankIndex = SFX_BANK_0;
@@ -4063,7 +4046,7 @@ cAudioManager::SetupJumboFlySound(uint8 emittingVol)
m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_nReleasingVolumeDivider = 5;
m_sQueueSample.m_bReverbFlag = TRUE;
- m_sQueueSample.m_bRequireReflection = FALSE; // todo port fix to re3
+ SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue();
}
return TRUE;
@@ -4078,7 +4061,7 @@ cAudioManager::SetupJumboRumbleSound(uint8 emittingVol)
m_sQueueSample.m_nVolume = ComputeVolume(emittingVol, SOUND_INTENSITY, m_sQueueSample.m_fDistance);
- if (m_sQueueSample.m_nVolume != 0) {
+ if (m_sQueueSample.m_nVolume > 0) {
m_sQueueSample.m_nCounter = 5;
m_sQueueSample.m_nSampleIndex = SFX_JUMBO_RUMBLE;
m_sQueueSample.m_nBankIndex = SFX_BANK_0;
@@ -4094,7 +4077,7 @@ cAudioManager::SetupJumboRumbleSound(uint8 emittingVol)
m_sQueueSample.m_nReleasingVolumeDivider = 12;
m_sQueueSample.m_nOffset = 0;
m_sQueueSample.m_bReverbFlag = TRUE;
- m_sQueueSample.m_bRequireReflection = FALSE;
+ SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue();
m_sQueueSample.m_nCounter = 6;
m_sQueueSample.m_nSampleIndex = SFX_JUMBO_RUMBLE;
@@ -4150,7 +4133,7 @@ cAudioManager::ProcessPedOneShots(cPedParams &params)
for (uint32 i = 0; i < m_asAudioEntities[m_sQueueSample.m_nEntityIndex].m_AudioEvents; i++) {
stereo = FALSE;
narrowSoundRange = FALSE;
- m_sQueueSample.m_bRequireReflection = FALSE;
+ SET_SOUND_REFLECTION(FALSE);
sound = m_asAudioEntities[m_sQueueSample.m_nEntityIndex].m_awAudioEvent[i];
switch (sound) {
case SOUND_STEP_START:
@@ -4228,7 +4211,7 @@ cAudioManager::ProcessPedOneShots(cPedParams &params)
SET_EMITTING_VOLUME(emittingVol);
m_sQueueSample.m_bIs2D = FALSE;
m_sQueueSample.m_bReleasingSoundFlag = TRUE;
- m_sQueueSample.m_bRequireReflection = TRUE;
+ SET_SOUND_REFLECTION(TRUE);
break;
case SOUND_FALL_LAND:
case SOUND_FALL_COLLAPSE:
@@ -4255,7 +4238,7 @@ cAudioManager::ProcessPedOneShots(cPedParams &params)
SET_EMITTING_VOLUME(emittingVol);
m_sQueueSample.m_bIs2D = FALSE;
m_sQueueSample.m_bReleasingSoundFlag = TRUE;
- m_sQueueSample.m_bRequireReflection = TRUE;
+ SET_SOUND_REFLECTION(TRUE);
break;
case SOUND_FIGHT_37:
m_sQueueSample.m_nSampleIndex = SFX_FIGHT_1;
@@ -4350,7 +4333,7 @@ cAudioManager::ProcessPedOneShots(cPedParams &params)
SET_EMITTING_VOLUME(emittingVol);
m_sQueueSample.m_bIs2D = FALSE;
m_sQueueSample.m_bReleasingSoundFlag = TRUE;
- m_sQueueSample.m_bRequireReflection = TRUE;
+ SET_SOUND_REFLECTION(TRUE);
break;
case SOUND_WEAPON_BAT_ATTACK:
case SOUND_WEAPON_KNIFE_ATTACK:
@@ -4405,7 +4388,7 @@ cAudioManager::ProcessPedOneShots(cPedParams &params)
SET_EMITTING_VOLUME(emittingVol);
m_sQueueSample.m_bIs2D = FALSE;
m_sQueueSample.m_bReleasingSoundFlag = TRUE;
- m_sQueueSample.m_bRequireReflection = TRUE;
+ SET_SOUND_REFLECTION(TRUE);
break;
}
case SOUND_WEAPON_CHAINSAW_IDLE:
@@ -4502,7 +4485,7 @@ cAudioManager::ProcessPedOneShots(cPedParams &params)
SET_EMITTING_VOLUME(emittingVol);
m_sQueueSample.m_bIs2D = FALSE;
m_sQueueSample.m_bReleasingSoundFlag = TRUE;
- m_sQueueSample.m_bRequireReflection = TRUE;
+ SET_SOUND_REFLECTION(TRUE);
stereo = TRUE;
break;
case WEAPONTYPE_COLT45:
@@ -4522,7 +4505,7 @@ cAudioManager::ProcessPedOneShots(cPedParams &params)
SET_EMITTING_VOLUME(emittingVol);
m_sQueueSample.m_bIs2D = FALSE;
m_sQueueSample.m_bReleasingSoundFlag = TRUE;
- m_sQueueSample.m_bRequireReflection = TRUE;
+ SET_SOUND_REFLECTION(TRUE);
stereo = TRUE;
break;
case WEAPONTYPE_PYTHON:
@@ -4542,7 +4525,7 @@ cAudioManager::ProcessPedOneShots(cPedParams &params)
SET_EMITTING_VOLUME(emittingVol);
m_sQueueSample.m_bIs2D = FALSE;
m_sQueueSample.m_bReleasingSoundFlag = TRUE;
- m_sQueueSample.m_bRequireReflection = TRUE;
+ SET_SOUND_REFLECTION(TRUE);
stereo = TRUE;
break;
case WEAPONTYPE_SHOTGUN:
@@ -4563,7 +4546,7 @@ cAudioManager::ProcessPedOneShots(cPedParams &params)
SET_EMITTING_VOLUME(emittingVol);
m_sQueueSample.m_bIs2D = FALSE;
m_sQueueSample.m_bReleasingSoundFlag = TRUE;
- m_sQueueSample.m_bRequireReflection = TRUE;
+ SET_SOUND_REFLECTION(TRUE);
stereo = TRUE;
break;
case WEAPONTYPE_SPAS12_SHOTGUN:
@@ -4583,7 +4566,7 @@ cAudioManager::ProcessPedOneShots(cPedParams &params)
SET_EMITTING_VOLUME(emittingVol);
m_sQueueSample.m_bIs2D = FALSE;
m_sQueueSample.m_bReleasingSoundFlag = TRUE;
- m_sQueueSample.m_bRequireReflection = TRUE;
+ SET_SOUND_REFLECTION(TRUE);
stereo = TRUE;
break;
case WEAPONTYPE_TEC9:
@@ -4719,7 +4702,7 @@ cAudioManager::ProcessPedOneShots(cPedParams &params)
SET_EMITTING_VOLUME(emittingVol);
m_sQueueSample.m_bIs2D = FALSE;
m_sQueueSample.m_bReleasingSoundFlag = TRUE;
- m_sQueueSample.m_bRequireReflection = TRUE;
+ SET_SOUND_REFLECTION(TRUE);
stereo = TRUE;
break;
case WEAPONTYPE_FLAMETHROWER:
@@ -4815,7 +4798,7 @@ cAudioManager::ProcessPedOneShots(cPedParams &params)
SET_EMITTING_VOLUME(75);
m_sQueueSample.m_bIs2D = FALSE;
m_sQueueSample.m_bReleasingSoundFlag = TRUE;
- m_sQueueSample.m_bRequireReflection = TRUE;
+ SET_SOUND_REFLECTION(TRUE);
break;
case SOUND_WEAPON_AK47_BULLET_ECHO:
{
@@ -4879,7 +4862,7 @@ cAudioManager::ProcessPedOneShots(cPedParams &params)
SET_EMITTING_VOLUME(emittingVol);
m_sQueueSample.m_bIs2D = FALSE;
m_sQueueSample.m_bReleasingSoundFlag = TRUE;
- m_sQueueSample.m_bRequireReflection = TRUE;
+ SET_SOUND_REFLECTION(TRUE);
break;
}
case SOUND_WEAPON_FLAMETHROWER_FIRE:
@@ -4936,7 +4919,7 @@ cAudioManager::ProcessPedOneShots(cPedParams &params)
SET_EMITTING_VOLUME(emittingVol);
m_sQueueSample.m_bIs2D = FALSE;
m_sQueueSample.m_bReleasingSoundFlag = TRUE;
- m_sQueueSample.m_bRequireReflection = TRUE;
+ SET_SOUND_REFLECTION(TRUE);
break;
case SOUND_MELEE_ATTACK_START:
{
@@ -4972,7 +4955,7 @@ cAudioManager::ProcessPedOneShots(cPedParams &params)
SET_EMITTING_VOLUME(emittingVol);
m_sQueueSample.m_bIs2D = FALSE;
m_sQueueSample.m_bReleasingSoundFlag = TRUE;
- m_sQueueSample.m_bRequireReflection = TRUE;
+ SET_SOUND_REFLECTION(TRUE);
break;
}
case SOUND_SKATING:
@@ -4998,7 +4981,7 @@ cAudioManager::ProcessPedOneShots(cPedParams &params)
SET_EMITTING_VOLUME(emittingVol);
m_sQueueSample.m_bIs2D = FALSE;
m_sQueueSample.m_bReleasingSoundFlag = TRUE;
- m_sQueueSample.m_bRequireReflection = TRUE;
+ SET_SOUND_REFLECTION(TRUE);
break;
}
case SOUND_WEAPON_MINIGUN_ATTACK:
@@ -5050,7 +5033,7 @@ cAudioManager::ProcessPedOneShots(cPedParams &params)
SET_EMITTING_VOLUME(127);
m_sQueueSample.m_bIs2D = FALSE;
m_sQueueSample.m_bReleasingSoundFlag = TRUE;
- m_sQueueSample.m_bRequireReflection = TRUE;
+ SET_SOUND_REFLECTION(TRUE);
break;
case SOUND_SHIRT_WIND_FLAP:
if (params.m_pPed->IsPlayer() && params.m_pPed->m_pMyVehicle) {
@@ -5106,7 +5089,7 @@ cAudioManager::ProcessPedOneShots(cPedParams &params)
if (params.m_fDistance < maxDist) {
CalculateDistance(params.m_bDistanceCalculated, params.m_fDistance);
m_sQueueSample.m_nVolume = ComputeVolume(emittingVol, m_sQueueSample.m_SoundIntensity, m_sQueueSample.m_fDistance);
- if (m_sQueueSample.m_nVolume != 0) {
+ if (m_sQueueSample.m_nVolume > 0) {
if (stereo) {
if (m_sQueueSample.m_fDistance < 0.2f * m_sQueueSample.m_SoundIntensity) {
m_sQueueSample.m_bIs2D = TRUE;
@@ -5239,7 +5222,7 @@ cAudioManager::SetupPedComments(cPedParams &params, uint16 sound)
emittingVol = 31;
m_sQueueSample.m_nVolume = ComputeVolume(emittingVol, soundIntensity, m_sQueueSample.m_fDistance);
pedComment.m_nProcess = 10;
- if(m_sQueueSample.m_nVolume != 0) {
+ if (m_sQueueSample.m_nVolume > 0) {
pedComment.m_nEntityIndex = m_sQueueSample.m_nEntityIndex;
pedComment.m_vecPos = m_sQueueSample.m_vecPos;
pedComment.m_fDistance = m_sQueueSample.m_fDistance;
@@ -7879,7 +7862,7 @@ cPedComments::Process()
static uint8 counter = 0;
static int32 prevSamples[10];
- if(AudioManager.m_nUserPause != 0) return;
+ if(AudioManager.m_nUserPause) return;
if(m_nCommentsInBank[m_nActiveBank]) {
for(int i = 0; i < ARRAY_SIZE(prevSamples); i++) {
@@ -7922,10 +7905,15 @@ cPedComments::Process()
AudioManager.m_sQueueSample.m_bReleasingSoundFlag = TRUE;
AudioManager.m_sQueueSample.m_vecPos = m_asPedComments[m_nActiveBank][m_nIndexMap[m_nActiveBank][0]].m_vecPos;
AudioManager.m_sQueueSample.m_bReverbFlag = TRUE;
+#ifdef AUDIO_REFLECTIONS
AudioManager.m_sQueueSample.m_bRequireReflection = TRUE;
+#endif // AUDIO_REFLECTIONS
AudioManager.m_sQueueSample.m_bIs2D = FALSE;
#ifdef FIX_BUGS
- if (sampleIndex >= SFX_PLAYER_ANGRY_BUSTED_1 && sampleIndex < TOTAL_AUDIO_SAMPLES) { // check if player sfx
+ if((sampleIndex >= SFX_POLICE_BOAT_1 && sampleIndex <= SFX_POLICE_BOAT_23) ||
+ (sampleIndex >= SFX_POLICE_HELI_1 && sampleIndex <= SFX_POLICE_HELI_20))
+ AudioManager.m_sQueueSample.m_SoundIntensity = 400.0f;
+ else if (sampleIndex >= SFX_PLAYER_ANGRY_BUSTED_1 && sampleIndex <= SFX_PLAYER_ON_FIRE_16) { // check if player sfx
AudioManager.m_sQueueSample.m_bIs2D = TRUE;
AudioManager.m_sQueueSample.m_nOffset = 63;
}
@@ -7997,7 +7985,7 @@ cAudioManager::ProcessExplosions(int32 explosion)
m_sQueueSample.m_nFrequency = RandomDisplacement(1000) + 19000;
m_sQueueSample.m_nReleasingVolumeModificator = 0;
m_sQueueSample.m_nBankIndex = SFX_BANK_0;
- m_sQueueSample.m_bRequireReflection = TRUE;
+ SET_SOUND_REFLECTION(TRUE);
break;
case EXPLOSION_MOLOTOV:
m_sQueueSample.m_SoundIntensity = 150.0f;
@@ -8005,7 +7993,7 @@ cAudioManager::ProcessExplosions(int32 explosion)
m_sQueueSample.m_nFrequency = RandomDisplacement(1000) + 19000;
m_sQueueSample.m_nReleasingVolumeModificator = 0;
m_sQueueSample.m_nBankIndex = SFX_BANK_0;
- m_sQueueSample.m_bRequireReflection = FALSE;
+ SET_SOUND_REFLECTION(FALSE);
break;
case EXPLOSION_MINE:
case EXPLOSION_HELI_BOMB:
@@ -8014,7 +8002,7 @@ cAudioManager::ProcessExplosions(int32 explosion)
m_sQueueSample.m_nFrequency = RandomDisplacement(1000) + 12347;
m_sQueueSample.m_nReleasingVolumeModificator = 0;
m_sQueueSample.m_nBankIndex = SFX_BANK_0;
- m_sQueueSample.m_bRequireReflection = TRUE;
+ SET_SOUND_REFLECTION(TRUE);
break;
default:
m_sQueueSample.m_SoundIntensity = 200.0f;
@@ -8024,6 +8012,9 @@ cAudioManager::ProcessExplosions(int32 explosion)
m_sQueueSample.m_nFrequency = 8 * m_sQueueSample.m_nFrequency / 10; //same *= 8 / 10;
m_sQueueSample.m_nReleasingVolumeModificator = 0;
m_sQueueSample.m_nBankIndex = SFX_BANK_GENERIC_EXTRA;
+#ifdef FIX_BUGS
+ SET_SOUND_REFLECTION(TRUE);
+#endif
break;
}
m_sQueueSample.m_vecPos = *CExplosion::GetExplosionPosition(i);
@@ -8031,7 +8022,7 @@ cAudioManager::ProcessExplosions(int32 explosion)
if (distSquared < SQR(m_sQueueSample.m_SoundIntensity)) {
m_sQueueSample.m_fDistance = Sqrt(distSquared);
m_sQueueSample.m_nVolume = ComputeVolume(MAX_VOLUME, m_sQueueSample.m_SoundIntensity, m_sQueueSample.m_fDistance);
- if (m_sQueueSample.m_nVolume != 0) {
+ if (m_sQueueSample.m_nVolume > 0) {
m_sQueueSample.m_nCounter = i;
m_sQueueSample.m_fSpeedMultiplier = 2.0f;
m_sQueueSample.m_bIs2D = FALSE;
@@ -8095,7 +8086,7 @@ cAudioManager::ProcessFires(int32)
if (distSquared < SQR(m_sQueueSample.m_SoundIntensity)) {
m_sQueueSample.m_fDistance = Sqrt(distSquared);
m_sQueueSample.m_nVolume = ComputeVolume(emittingVol, m_sQueueSample.m_SoundIntensity, m_sQueueSample.m_fDistance);
- if (m_sQueueSample.m_nVolume != 0) {
+ if (m_sQueueSample.m_nVolume > 0) {
m_sQueueSample.m_nCounter = i;
m_sQueueSample.m_nBankIndex = SFX_BANK_0;
m_sQueueSample.m_fSpeedMultiplier = 2.0f;
@@ -8106,7 +8097,7 @@ cAudioManager::ProcessFires(int32)
SET_EMITTING_VOLUME(emittingVol);
SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex)
m_sQueueSample.m_bReverbFlag = TRUE;
- m_sQueueSample.m_bRequireReflection = FALSE;
+ SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue();
}
}
@@ -8114,7 +8105,7 @@ cAudioManager::ProcessFires(int32)
gFireManager.m_aFires[i].m_bExtinguishedWithWater = FALSE;
emittingVol = 100.0f * gFireManager.m_aFires[i].m_fWaterExtinguishCountdown;
m_sQueueSample.m_nVolume = ComputeVolume(emittingVol, m_sQueueSample.m_SoundIntensity, m_sQueueSample.m_fDistance);
- if (m_sQueueSample.m_nVolume != 0) {
+ if (m_sQueueSample.m_nVolume > 0) {
m_sQueueSample.m_nSampleIndex = SFX_JUMBO_TAXI;
m_sQueueSample.m_nFrequency = 19591;
m_sQueueSample.m_nFrequency += i * (m_sQueueSample.m_nFrequency / 64);
@@ -8129,7 +8120,7 @@ cAudioManager::ProcessFires(int32)
SET_EMITTING_VOLUME(emittingVol);
SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex)
m_sQueueSample.m_bReverbFlag = TRUE;
- m_sQueueSample.m_bRequireReflection = FALSE;
+ SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue();
}
}
@@ -8149,7 +8140,7 @@ cAudioManager::ProcessWaterCannon(int32)
if (distSquared < SQR(SOUND_INTENSITY)) {
m_sQueueSample.m_fDistance = Sqrt(distSquared);
m_sQueueSample.m_nVolume = ComputeVolume(50, SOUND_INTENSITY, m_sQueueSample.m_fDistance);
- if (m_sQueueSample.m_nVolume != 0) {
+ if (m_sQueueSample.m_nVolume > 0) {
m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY;
m_sQueueSample.m_nSampleIndex = SFX_JUMBO_TAXI;
m_sQueueSample.m_nBankIndex = SFX_BANK_0;
@@ -8164,7 +8155,7 @@ cAudioManager::ProcessWaterCannon(int32)
SET_EMITTING_VOLUME(50);
SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex)
m_sQueueSample.m_bReverbFlag = TRUE;
- m_sQueueSample.m_bRequireReflection = FALSE;
+ SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue();
}
}
@@ -8211,7 +8202,7 @@ cAudioManager::ProcessOneShotScriptObject(uint8 sound)
emittingVolume = 60;
m_sQueueSample.m_fSpeedMultiplier = 0.0f;
m_sQueueSample.m_bIs2D = FALSE;
- m_sQueueSample.m_bRequireReflection = TRUE;
+ SET_SOUND_REFLECTION(TRUE);
break;
case SCRIPT_SOUND_GARAGE_DOOR_CLUNK:
m_sQueueSample.m_SoundIntensity = 80.0f;
@@ -8223,7 +8214,7 @@ cAudioManager::ProcessOneShotScriptObject(uint8 sound)
emittingVolume = 60;
m_sQueueSample.m_fSpeedMultiplier = 0.0f;
m_sQueueSample.m_bIs2D = FALSE;
- m_sQueueSample.m_bRequireReflection = TRUE;
+ SET_SOUND_REFLECTION(TRUE);
break;
case SCRIPT_SOUND_SHOOTING_RANGE_TARGET_HIT:
case SCRIPT_SOUND_BULLET_HIT_GROUND_1:
@@ -8248,7 +8239,7 @@ cAudioManager::ProcessOneShotScriptObject(uint8 sound)
m_sQueueSample.m_nReleasingVolumeModificator = 1;
m_sQueueSample.m_fSpeedMultiplier = 1.0f;
m_sQueueSample.m_bIs2D = FALSE;
- m_sQueueSample.m_bRequireReflection = FALSE;
+ SET_SOUND_REFLECTION(FALSE);
break;
case SCRIPT_SOUND_MALE_AMBULANCE_OUCH:
{
@@ -8273,7 +8264,7 @@ cAudioManager::ProcessOneShotScriptObject(uint8 sound)
m_sQueueSample.m_nReleasingVolumeModificator = 1;
m_sQueueSample.m_fSpeedMultiplier = 0.0f;
m_sQueueSample.m_bIs2D = TRUE;
- m_sQueueSample.m_bRequireReflection = FALSE;
+ SET_SOUND_REFLECTION(FALSE);
break;
case SCRIPT_SOUND_PAYPHONE_RINGING:
m_sQueueSample.m_SoundIntensity = 80.0f;
@@ -8284,7 +8275,7 @@ cAudioManager::ProcessOneShotScriptObject(uint8 sound)
m_sQueueSample.m_nReleasingVolumeModificator = 1;
m_sQueueSample.m_fSpeedMultiplier = 2.0f;
m_sQueueSample.m_bIs2D = FALSE;
- m_sQueueSample.m_bRequireReflection = FALSE;
+ SET_SOUND_REFLECTION(FALSE);
break;
case SCRIPT_SOUND_GLASS_BREAK_L:
m_sQueueSample.m_SoundIntensity = 60.0f;
@@ -8315,7 +8306,7 @@ cAudioManager::ProcessOneShotScriptObject(uint8 sound)
m_sQueueSample.m_nReleasingVolumeModificator = 3;
m_sQueueSample.m_fSpeedMultiplier = 0.0f;
m_sQueueSample.m_bIs2D = FALSE;
- m_sQueueSample.m_bRequireReflection = TRUE;
+ SET_SOUND_REFLECTION(TRUE);
break;
case SCRIPT_SOUND_GLASS_LIGHT_BREAK:
m_sQueueSample.m_SoundIntensity = 55.0f;
@@ -8335,7 +8326,7 @@ cAudioManager::ProcessOneShotScriptObject(uint8 sound)
m_sQueueSample.m_nReleasingVolumeModificator = 3;
m_sQueueSample.m_fSpeedMultiplier = 0.0f;
m_sQueueSample.m_bIs2D = FALSE;
- m_sQueueSample.m_bRequireReflection = TRUE;
+ SET_SOUND_REFLECTION(TRUE);
emittingVolume = m_anRandomTable[2] % 20 + 80;
break;
case SCRIPT_SOUND_BOX_DESTROYED_2:
@@ -8346,7 +8337,7 @@ cAudioManager::ProcessOneShotScriptObject(uint8 sound)
m_sQueueSample.m_nReleasingVolumeModificator = 3;
m_sQueueSample.m_fSpeedMultiplier = 0.0f;
m_sQueueSample.m_bIs2D = FALSE;
- m_sQueueSample.m_bRequireReflection = TRUE;
+ SET_SOUND_REFLECTION(TRUE);
emittingVolume = m_anRandomTable[2] % 20 + 80;
break;
case SCRIPT_SOUND_METAL_COLLISION:
@@ -8358,7 +8349,7 @@ cAudioManager::ProcessOneShotScriptObject(uint8 sound)
m_sQueueSample.m_nReleasingVolumeModificator = 3;
m_sQueueSample.m_fSpeedMultiplier = 0.0f;
m_sQueueSample.m_bIs2D = FALSE;
- m_sQueueSample.m_bRequireReflection = TRUE;
+ SET_SOUND_REFLECTION(TRUE);
emittingVolume = m_anRandomTable[2] % 30 + 70;
break;
case SCRIPT_SOUND_TIRE_COLLISION:
@@ -8370,7 +8361,7 @@ cAudioManager::ProcessOneShotScriptObject(uint8 sound)
m_sQueueSample.m_nReleasingVolumeModificator = 3;
m_sQueueSample.m_fSpeedMultiplier = 0.0f;
m_sQueueSample.m_bIs2D = FALSE;
- m_sQueueSample.m_bRequireReflection = TRUE;
+ SET_SOUND_REFLECTION(TRUE);
emittingVolume = m_anRandomTable[2] % 30 + 60;
break;
case SCRIPT_SOUND_HIT_BALL:
@@ -8382,7 +8373,7 @@ cAudioManager::ProcessOneShotScriptObject(uint8 sound)
m_sQueueSample.m_nReleasingVolumeModificator = 5;
m_sQueueSample.m_fSpeedMultiplier = 0.0f;
m_sQueueSample.m_bIs2D = FALSE;
- m_sQueueSample.m_bRequireReflection = TRUE;
+ SET_SOUND_REFLECTION(TRUE);
emittingVolume = m_anRandomTable[2] % 30 + 60;
break;
case SCRIPT_SOUND_GUNSHELL_DROP:
@@ -8439,7 +8430,7 @@ cAudioManager::ProcessOneShotScriptObject(uint8 sound)
if (distSquared < SQR(m_sQueueSample.m_SoundIntensity)) {
m_sQueueSample.m_fDistance = Sqrt(distSquared);
m_sQueueSample.m_nVolume = ComputeVolume(emittingVolume, m_sQueueSample.m_SoundIntensity, m_sQueueSample.m_fDistance);
- if (m_sQueueSample.m_nVolume != 0) {
+ if (m_sQueueSample.m_nVolume > 0) {
m_sQueueSample.m_nCounter = iSound++;
m_sQueueSample.m_nLoopCount = 1;
m_sQueueSample.m_bReleasingSoundFlag = TRUE;
@@ -8654,7 +8645,7 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound)
if(distSquared < SQR(m_sQueueSample.m_SoundIntensity)) {
m_sQueueSample.m_fDistance = Sqrt(distSquared);
m_sQueueSample.m_nVolume = ComputeVolume(emittingVolume, m_sQueueSample.m_SoundIntensity, m_sQueueSample.m_fDistance);
- if(m_sQueueSample.m_nVolume != 0) {
+ if (m_sQueueSample.m_nVolume > 0) {
m_sQueueSample.m_nCounter = 0;
m_sQueueSample.m_bIs2D = FALSE;
m_sQueueSample.m_nLoopCount = 0;
@@ -8662,7 +8653,7 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound)
m_sQueueSample.m_bReverbFlag = TRUE;
SET_EMITTING_VOLUME(emittingVolume);
SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex)
- m_sQueueSample.m_bRequireReflection = FALSE;
+ SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue();
}
}
@@ -8708,7 +8699,7 @@ cAudioManager::ProcessWeather(int32 id)
SET_EMITTING_VOLUME(m_sQueueSample.m_nVolume);
RESET_LOOP_OFFSETS
m_sQueueSample.m_bReverbFlag = FALSE;
- m_sQueueSample.m_bRequireReflection = FALSE;
+ SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue();
}
if (CWeather::Rain > 0.0f && (!CCullZones::CamNoRain() || !CCullZones::PlayerNoRain())) {
@@ -8726,7 +8717,7 @@ cAudioManager::ProcessWeather(int32 id)
m_sQueueSample.m_bReverbFlag = FALSE;
SET_EMITTING_VOLUME(m_sQueueSample.m_nVolume);
SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex)
- m_sQueueSample.m_bRequireReflection = FALSE;
+ SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue();
}
x = 0.0f;
@@ -8750,7 +8741,7 @@ cAudioManager::ProcessWeather(int32 id)
m_sQueueSample.m_bReverbFlag = FALSE;
SET_EMITTING_VOLUME(m_sQueueSample.m_nVolume);
SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex)
- m_sQueueSample.m_bRequireReflection = FALSE;
+ SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue();
CObject::fDistToNearestTree = 999999.9f;
}
@@ -8964,7 +8955,7 @@ cAudioManager::ProcessFrontEnd()
}
}
m_sQueueSample.m_bReverbFlag = FALSE;
- m_sQueueSample.m_bRequireReflection = FALSE;
+ SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue();
if (stereo) {
++m_sQueueSample.m_nSampleIndex;
@@ -8998,7 +8989,7 @@ cAudioManager::ProcessCrane()
if (distSquared < SQR(intensity)) {
CalculateDistance(distCalculated, distSquared);
m_sQueueSample.m_nVolume = ComputeVolume(100, 80.f, m_sQueueSample.m_fDistance);
- if (m_sQueueSample.m_nVolume != 0) {
+ if (m_sQueueSample.m_nVolume > 0) {
m_sQueueSample.m_nCounter = 0;
m_sQueueSample.m_nSampleIndex = SFX_CRANE_MAGNET;
m_sQueueSample.m_nBankIndex = SFX_BANK_0;
@@ -9013,7 +9004,7 @@ cAudioManager::ProcessCrane()
m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_nReleasingVolumeDivider = 3;
m_sQueueSample.m_bReverbFlag = TRUE;
- m_sQueueSample.m_bRequireReflection = FALSE;
+ SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue();
}
if (m_asAudioEntities[m_sQueueSample.m_nEntityIndex].m_AudioEvents) {
@@ -9023,7 +9014,7 @@ cAudioManager::ProcessCrane()
m_sQueueSample.m_nLoopCount = 1;
m_sQueueSample.m_bReleasingSoundFlag = TRUE;
m_sQueueSample.m_bReverbFlag = TRUE;
- m_sQueueSample.m_bRequireReflection = TRUE;
+ SET_SOUND_REFLECTION(TRUE);
AddSampleToRequestedQueue();
}
}
@@ -9075,7 +9066,7 @@ cAudioManager::ProcessProjectiles()
if (distSquared < SQR(m_sQueueSample.m_SoundIntensity)) {
m_sQueueSample.m_fDistance = Sqrt(distSquared);
m_sQueueSample.m_nVolume = ComputeVolume(emittingVol, m_sQueueSample.m_SoundIntensity, m_sQueueSample.m_fDistance);
- if (m_sQueueSample.m_nVolume != 0) {
+ if (m_sQueueSample.m_nVolume > 0) {
m_sQueueSample.m_nCounter = i;
m_sQueueSample.m_bIs2D = FALSE;
m_sQueueSample.m_nLoopCount = 0;
@@ -9083,7 +9074,7 @@ cAudioManager::ProcessProjectiles()
SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex)
m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_bReverbFlag = TRUE;
- m_sQueueSample.m_bRequireReflection = FALSE;
+ SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue();
}
}
@@ -9107,7 +9098,7 @@ cAudioManager::ProcessEscalators()
if (distance < SQR(SOUND_INTENSITY)) {
m_sQueueSample.m_fDistance = Sqrt(distance);
m_sQueueSample.m_nVolume = ComputeVolume(EMITTING_VOLUME, SOUND_INTENSITY, m_sQueueSample.m_fDistance);
- if (m_sQueueSample.m_nVolume != 0) {
+ if (m_sQueueSample.m_nVolume > 0) {
m_sQueueSample.m_nSampleIndex = SFX_BOAT_V12_LOOP;
m_sQueueSample.m_nBankIndex = SFX_BANK_0;
m_sQueueSample.m_nFrequency = i * 50 % 250 + 3973;
@@ -9122,7 +9113,7 @@ cAudioManager::ProcessEscalators()
SET_LOOP_OFFSETS(SFX_BOAT_V12_LOOP)
m_sQueueSample.m_bReverbFlag = TRUE;
m_sQueueSample.m_bReleasingSoundFlag = FALSE;
- m_sQueueSample.m_bRequireReflection = FALSE;
+ SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue();
}
}
@@ -9146,7 +9137,7 @@ cAudioManager::ProcessExtraSounds()
if (distance < SQR(SOUND_INTENSITY)) {
m_sQueueSample.m_fDistance = Sqrt(distance);
m_sQueueSample.m_nVolume = ComputeVolume(EMITTING_VOLUME, SOUND_INTENSITY, m_sQueueSample.m_fDistance);
- if (m_sQueueSample.m_nVolume != 0) {
+ if (m_sQueueSample.m_nVolume > 0) {
m_sQueueSample.m_nCounter = i;
m_sQueueSample.m_nSampleIndex = SFX_ARCADE;
m_sQueueSample.m_nBankIndex = SFX_BANK_0;
@@ -9160,7 +9151,7 @@ cAudioManager::ProcessExtraSounds()
SET_LOOP_OFFSETS(SFX_ARCADE)
m_sQueueSample.m_bReverbFlag = TRUE;
m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY;
- m_sQueueSample.m_bRequireReflection = FALSE;
+ SET_SOUND_REFLECTION(FALSE);
m_sQueueSample.m_nReleasingVolumeDivider = 3;
AddSampleToRequestedQueue();
}
@@ -9197,7 +9188,7 @@ cAudioManager::ProcessGarages()
while (state == GS_OPENING || state == GS_CLOSING || state == GS_AFTERDROPOFF) {
CalculateDistance(distCalculated, distSquared);
m_sQueueSample.m_nVolume = ComputeVolume(90, SOUND_INTENSITY, m_sQueueSample.m_fDistance);
- if (m_sQueueSample.m_nVolume != 0) {
+ if (m_sQueueSample.m_nVolume > 0) {
if (CGarages::aGarages[i].m_eGarageType == GARAGE_CRUSHER) {
if (CGarages::aGarages[i].m_eGarageState == GS_AFTERDROPOFF) {
if (m_FrameCounter & 1) {
@@ -9241,7 +9232,7 @@ cAudioManager::ProcessGarages()
m_sQueueSample.m_fSpeedMultiplier = 2.0f;
m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY;
m_sQueueSample.m_bReverbFlag = TRUE;
- m_sQueueSample.m_bRequireReflection = FALSE;
+ SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue();
}
break;
@@ -9254,7 +9245,7 @@ cAudioManager::ProcessGarages()
if (distSquared < SQR(SOUND_INTENSITY)) {
CalculateDistance(distCalculated, distSquared);
m_sQueueSample.m_nVolume = ComputeVolume(60, SOUND_INTENSITY, m_sQueueSample.m_fDistance);
- if (m_sQueueSample.m_nVolume != 0) {
+ if (m_sQueueSample.m_nVolume > 0) {
if (CGarages::aGarages[i].m_eGarageType == GARAGE_CRUSHER) {
m_sQueueSample.m_nSampleIndex = SFX_COL_CAR_PANEL_2;
m_sQueueSample.m_nFrequency = 6735;
@@ -9278,7 +9269,7 @@ cAudioManager::ProcessGarages()
m_sQueueSample.m_nCounter = iSound++;
if (iSound < 32)
iSound = 32;
- m_sQueueSample.m_bRequireReflection = TRUE;
+ SET_SOUND_REFLECTION(TRUE);
AddSampleToRequestedQueue();
}
}
@@ -9303,7 +9294,7 @@ cAudioManager::ProcessFireHydrant()
if (distSquared < SQR(SOUND_INTENSITY)) {
CalculateDistance(distCalculated, distSquared);
m_sQueueSample.m_nVolume = ComputeVolume(40, 35.0f, m_sQueueSample.m_fDistance);
- if (m_sQueueSample.m_nVolume != 0) {
+ if (m_sQueueSample.m_nVolume > 0) {
m_sQueueSample.m_nSampleIndex = SFX_JUMBO_TAXI;
m_sQueueSample.m_nReleasingVolumeModificator = 4;
m_sQueueSample.m_nFrequency = 15591;
@@ -9315,7 +9306,7 @@ cAudioManager::ProcessFireHydrant()
SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex)
m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY;
m_sQueueSample.m_bReleasingSoundFlag = FALSE;
- m_sQueueSample.m_bRequireReflection = FALSE;
+ SET_SOUND_REFLECTION(FALSE);
m_sQueueSample.m_nReleasingVolumeDivider = 3;
m_sQueueSample.m_fSpeedMultiplier = 2.0f;
AddSampleToRequestedQueue();
@@ -9361,7 +9352,7 @@ cAudioManager::ProcessBridgeWarning()
{
if (CStats::CommercialPassed && m_sQueueSample.m_fDistance < 450.f) {
m_sQueueSample.m_nVolume = ComputeVolume(100, 450.f, m_sQueueSample.m_fDistance);
- if (m_sQueueSample.m_nVolume != 0) {
+ if (m_sQueueSample.m_nVolume > 0) {
m_sQueueSample.m_nCounter = 0;
m_sQueueSample.m_nSampleIndex = SFX_BRIDGE_OPEN_WARNING;
m_sQueueSample.m_nBankIndex = SAMPLEBANK_EXTRAS;
@@ -9376,7 +9367,7 @@ cAudioManager::ProcessBridgeWarning()
m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_nReleasingVolumeDivider = 8;
m_sQueueSample.m_bReverbFlag = FALSE;
- m_sQueueSample.m_bRequireReflection = FALSE;
+ SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue();
}
}
@@ -9387,7 +9378,7 @@ cAudioManager::ProcessBridgeMotor()
{
if (m_sQueueSample.m_fDistance < bridgeIntensity) {
m_sQueueSample.m_nVolume = ComputeVolume(MAX_VOLUME, bridgeIntensity, m_sQueueSample.m_fDistance);
- if (m_sQueueSample.m_nVolume != 0) {
+ if (m_sQueueSample.m_nVolume > 0) {
m_sQueueSample.m_nCounter = 1;
m_sQueueSample.m_nSampleIndex = SFX_FISHING_BOAT_IDLE; // todo check sfx name
m_sQueueSample.m_nBankIndex = SFX_BANK_0;
@@ -9422,7 +9413,7 @@ cAudioManager::ProcessBridgeOneShots()
if (m_sQueueSample.m_fDistance < bridgeIntensity) {
m_sQueueSample.m_nVolume = ComputeVolume(MAX_VOLUME, bridgeIntensity, m_sQueueSample.m_fDistance);
- if (m_sQueueSample.m_nVolume != 0) {
+ if (m_sQueueSample.m_nVolume > 0) {
m_sQueueSample.m_nCounter = 2;
m_sQueueSample.m_nBankIndex = SFX_BANK_0;
m_sQueueSample.m_bIs2D = FALSE;
@@ -9435,7 +9426,7 @@ cAudioManager::ProcessBridgeOneShots()
m_sQueueSample.m_SoundIntensity = bridgeIntensity;
m_sQueueSample.m_bReleasingSoundFlag = TRUE;
m_sQueueSample.m_bReverbFlag = FALSE;
- m_sQueueSample.m_bRequireReflection = FALSE;
+ SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue();
}
}