Add AUDIO_REVERB define

This commit is contained in:
Sergeanur 2021-08-19 10:53:14 +03:00
parent 51ba90dd52
commit 71e0895dc6
8 changed files with 110 additions and 87 deletions

View File

@ -270,7 +270,7 @@ cAudioManager::SetUpOneShotCollisionSound(const cAudioCollision &col)
m_sQueueSample.m_fSpeedMultiplier = 4.0f; m_sQueueSample.m_fSpeedMultiplier = 4.0f;
m_sQueueSample.m_SoundIntensity = CollisionSoundIntensity; m_sQueueSample.m_SoundIntensity = CollisionSoundIntensity;
m_sQueueSample.m_bReleasingSoundFlag = TRUE; m_sQueueSample.m_bReleasingSoundFlag = TRUE;
m_sQueueSample.m_bReverbFlag = TRUE; SET_SOUND_REVERB(TRUE);
SET_SOUND_REFLECTION(FALSE); SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue(); AddSampleToRequestedQueue();
} }
@ -300,7 +300,7 @@ cAudioManager::SetUpLoopingCollisionSound(const cAudioCollision &col, uint8 coun
m_sQueueSample.m_SoundIntensity = CollisionSoundIntensity; m_sQueueSample.m_SoundIntensity = CollisionSoundIntensity;
m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_nReleasingVolumeDivider = 5; m_sQueueSample.m_nReleasingVolumeDivider = 5;
m_sQueueSample.m_bReverbFlag = TRUE; SET_SOUND_REVERB(TRUE);
SET_SOUND_REFLECTION(FALSE); SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue(); AddSampleToRequestedQueue();
} }

View File

@ -249,6 +249,7 @@ cAudioManager::ResetAudioLogicTimers(uint32 timer)
void void
cAudioManager::ProcessReverb() cAudioManager::ProcessReverb()
{ {
#ifdef AUDIO_REVERB
#ifdef FIX_BUGS #ifdef FIX_BUGS
const uint32 numChannels = NUM_CHANNELS_GENERIC; const uint32 numChannels = NUM_CHANNELS_GENERIC;
#else #else
@ -263,6 +264,7 @@ cAudioManager::ProcessReverb()
} }
#endif #endif
} }
#endif // AUDIO_REVERB
} }
float float
@ -327,56 +329,56 @@ cAudioManager::ProcessEntity(int32 id)
switch (m_asAudioEntities[id].m_nType) { switch (m_asAudioEntities[id].m_nType) {
case AUDIOTYPE_PHYSICAL: case AUDIOTYPE_PHYSICAL:
if (!m_nUserPause) { if (!m_nUserPause) {
m_sQueueSample.m_bReverbFlag = TRUE; SET_SOUND_REVERB(TRUE);
ProcessPhysical(id); ProcessPhysical(id);
} }
break; break;
case AUDIOTYPE_EXPLOSION: case AUDIOTYPE_EXPLOSION:
if (!m_nUserPause) { if (!m_nUserPause) {
m_sQueueSample.m_bReverbFlag = TRUE; SET_SOUND_REVERB(TRUE);
ProcessExplosions(id); ProcessExplosions(id);
} }
break; break;
case AUDIOTYPE_FIRE: case AUDIOTYPE_FIRE:
if (!m_nUserPause) { if (!m_nUserPause) {
m_sQueueSample.m_bReverbFlag = TRUE; SET_SOUND_REVERB(TRUE);
ProcessFires(id); ProcessFires(id);
} }
break; break;
case AUDIOTYPE_WEATHER: case AUDIOTYPE_WEATHER:
if (!m_nUserPause) { if (!m_nUserPause) {
m_sQueueSample.m_bReverbFlag = TRUE; SET_SOUND_REVERB(TRUE);
if(CGame::currArea == AREA_MAIN_MAP || CGame::currArea == AREA_EVERYWHERE) if(CGame::currArea == AREA_MAIN_MAP || CGame::currArea == AREA_EVERYWHERE)
ProcessWeather(id); ProcessWeather(id);
} }
break; break;
/* case AUDIOTYPE_CRANE: /* case AUDIOTYPE_CRANE:
if (!m_nUserPause) { if (!m_nUserPause) {
m_sQueueSample.m_bReverbFlag = TRUE; SET_SOUND_REVERB(TRUE);
ProcessCrane(); ProcessCrane();
} }
break;*/ break;*/
case AUDIOTYPE_SCRIPTOBJECT: case AUDIOTYPE_SCRIPTOBJECT:
if (!m_nUserPause) { if (!m_nUserPause) {
m_sQueueSample.m_bReverbFlag = TRUE; SET_SOUND_REVERB(TRUE);
ProcessScriptObject(id); ProcessScriptObject(id);
} }
break; break;
#ifdef GTA_BRIDGE #ifdef GTA_BRIDGE
case AUDIOTYPE_BRIDGE: case AUDIOTYPE_BRIDGE:
if (!m_nUserPause) { if (!m_nUserPause) {
m_sQueueSample.m_bReverbFlag = TRUE; SET_SOUND_REVERB(TRUE);
ProcessBridge(); ProcessBridge();
} }
break; break;
#endif #endif
case AUDIOTYPE_FRONTEND: case AUDIOTYPE_FRONTEND:
m_sQueueSample.m_bReverbFlag = FALSE; SET_SOUND_REVERB(FALSE);
ProcessFrontEnd(); ProcessFrontEnd();
break; break;
case AUDIOTYPE_PROJECTILE: case AUDIOTYPE_PROJECTILE:
if (!m_nUserPause) { if (!m_nUserPause) {
m_sQueueSample.m_bReverbFlag = TRUE; SET_SOUND_REVERB(TRUE);
ProcessProjectiles(); ProcessProjectiles();
} }
break; break;
@ -386,25 +388,25 @@ cAudioManager::ProcessEntity(int32 id)
break; break;
case AUDIOTYPE_FIREHYDRANT: case AUDIOTYPE_FIREHYDRANT:
if (!m_nUserPause) { if (!m_nUserPause) {
m_sQueueSample.m_bReverbFlag = TRUE; SET_SOUND_REVERB(TRUE);
ProcessFireHydrant(); ProcessFireHydrant();
} }
break; break;
case AUDIOTYPE_WATERCANNON: case AUDIOTYPE_WATERCANNON:
if (!m_nUserPause) { if (!m_nUserPause) {
m_sQueueSample.m_bReverbFlag = TRUE; SET_SOUND_REVERB(TRUE);
ProcessWaterCannon(id); ProcessWaterCannon(id);
} }
break; break;
case AUDIOTYPE_ESCALATOR: case AUDIOTYPE_ESCALATOR:
if (!m_nUserPause) { if (!m_nUserPause) {
m_sQueueSample.m_bReverbFlag = TRUE; SET_SOUND_REVERB(TRUE);
ProcessEscalators(); ProcessEscalators();
} }
break; break;
case AUDIOTYPE_EXTRA_SOUNDS: case AUDIOTYPE_EXTRA_SOUNDS:
if (!m_nUserPause) { if (!m_nUserPause) {
m_sQueueSample.m_bReverbFlag = TRUE; SET_SOUND_REVERB(TRUE);
ProcessExtraSounds(); ProcessExtraSounds();
} }
break; break;
@ -917,7 +919,7 @@ cAudioManager::ProcessCarHeli(cVehicleParams& params)
m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY;
m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_nReleasingVolumeDivider = 5; m_sQueueSample.m_nReleasingVolumeDivider = 5;
m_sQueueSample.m_bReverbFlag = TRUE; SET_SOUND_REVERB(TRUE);
SET_SOUND_REFLECTION(FALSE); SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue(); AddSampleToRequestedQueue();
} }
@ -968,7 +970,7 @@ cAudioManager::ProcessCarHeli(cVehicleParams& params)
m_sQueueSample.m_SoundIntensity = 140.0f; m_sQueueSample.m_SoundIntensity = 140.0f;
m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_nReleasingVolumeDivider = 5; m_sQueueSample.m_nReleasingVolumeDivider = 5;
m_sQueueSample.m_bReverbFlag = TRUE; SET_SOUND_REVERB(TRUE);
SET_SOUND_REFLECTION(FALSE); SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue(); AddSampleToRequestedQueue();
} else if (boat != nil) { } else if (boat != nil) {
@ -993,7 +995,7 @@ cAudioManager::ProcessCarHeli(cVehicleParams& params)
m_sQueueSample.m_SoundIntensity = 140.0f; m_sQueueSample.m_SoundIntensity = 140.0f;
m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_nReleasingVolumeDivider = 5; m_sQueueSample.m_nReleasingVolumeDivider = 5;
m_sQueueSample.m_bReverbFlag = TRUE; SET_SOUND_REVERB(TRUE);
SET_SOUND_REFLECTION(FALSE); SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue(); AddSampleToRequestedQueue();
} else { } else {
@ -1009,7 +1011,7 @@ cAudioManager::ProcessCarHeli(cVehicleParams& params)
m_sQueueSample.m_SoundIntensity = 140.0f; m_sQueueSample.m_SoundIntensity = 140.0f;
m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_nReleasingVolumeDivider = 5; m_sQueueSample.m_nReleasingVolumeDivider = 5;
m_sQueueSample.m_bReverbFlag = TRUE; SET_SOUND_REVERB(TRUE);
SET_SOUND_REFLECTION(FALSE); SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue(); AddSampleToRequestedQueue();
} }
@ -1053,7 +1055,7 @@ cAudioManager::ProcessCarHeli(cVehicleParams& params)
m_sQueueSample.m_SoundIntensity = 140.0f; m_sQueueSample.m_SoundIntensity = 140.0f;
m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_nReleasingVolumeDivider = 5; m_sQueueSample.m_nReleasingVolumeDivider = 5;
m_sQueueSample.m_bReverbFlag = TRUE; SET_SOUND_REVERB(TRUE);
SET_SOUND_REFLECTION(FALSE); SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue(); AddSampleToRequestedQueue();
} }
@ -1086,7 +1088,7 @@ cAudioManager::ProcessCarHeli(cVehicleParams& params)
m_sQueueSample.m_SoundIntensity = 30.0f; m_sQueueSample.m_SoundIntensity = 30.0f;
m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_nReleasingVolumeDivider = 30; m_sQueueSample.m_nReleasingVolumeDivider = 30;
m_sQueueSample.m_bReverbFlag = TRUE; SET_SOUND_REVERB(TRUE);
SET_SOUND_REFLECTION(FALSE); SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue(); AddSampleToRequestedQueue();
} }
@ -1121,7 +1123,7 @@ cAudioManager::ProcessCarHeli(cVehicleParams& params)
m_sQueueSample.m_SoundIntensity = 20.0f; m_sQueueSample.m_SoundIntensity = 20.0f;
m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_nReleasingVolumeDivider = 7; m_sQueueSample.m_nReleasingVolumeDivider = 7;
m_sQueueSample.m_bReverbFlag = TRUE; SET_SOUND_REVERB(TRUE);
SET_SOUND_REFLECTION(FALSE); SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue(); AddSampleToRequestedQueue();
} }
@ -1152,7 +1154,7 @@ cAudioManager::ProcessCarHeli(cVehicleParams& params)
m_sQueueSample.m_SoundIntensity = 27.0f; m_sQueueSample.m_SoundIntensity = 27.0f;
m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_nReleasingVolumeDivider = 5; m_sQueueSample.m_nReleasingVolumeDivider = 5;
m_sQueueSample.m_bReverbFlag = TRUE; SET_SOUND_REVERB(TRUE);
SET_SOUND_REFLECTION(FALSE); SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue(); AddSampleToRequestedQueue();
} }
@ -1197,7 +1199,7 @@ cAudioManager::ProcessRainOnVehicle(cVehicleParams& params)
m_sQueueSample.m_fSpeedMultiplier = 0.0f; m_sQueueSample.m_fSpeedMultiplier = 0.0f;
m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY;
m_sQueueSample.m_bReleasingSoundFlag = TRUE; m_sQueueSample.m_bReleasingSoundFlag = TRUE;
m_sQueueSample.m_bReverbFlag = FALSE; SET_SOUND_REVERB(FALSE);
SET_SOUND_REFLECTION(FALSE); SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue(); AddSampleToRequestedQueue();
} }
@ -1250,7 +1252,7 @@ cAudioManager::ProcessReverseGear(cVehicleParams& params)
m_sQueueSample.m_SoundIntensity = reverseGearIntensity; m_sQueueSample.m_SoundIntensity = reverseGearIntensity;
m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_nReleasingVolumeDivider = 5; m_sQueueSample.m_nReleasingVolumeDivider = 5;
m_sQueueSample.m_bReverbFlag = TRUE; SET_SOUND_REVERB(TRUE);
SET_SOUND_REFLECTION(FALSE); SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue(); AddSampleToRequestedQueue();
} }
@ -1307,7 +1309,7 @@ cAudioManager::ProcessModelHeliVehicle(cVehicleParams& params)
m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY;
m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_nReleasingVolumeDivider = 4; m_sQueueSample.m_nReleasingVolumeDivider = 4;
m_sQueueSample.m_bReverbFlag = TRUE; SET_SOUND_REVERB(TRUE);
SET_SOUND_REFLECTION(FALSE); SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue(); AddSampleToRequestedQueue();
} }
@ -1370,7 +1372,7 @@ cAudioManager::ProcessModelVehicle(cVehicleParams& params)
m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY;
m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_nReleasingVolumeDivider = 4; m_sQueueSample.m_nReleasingVolumeDivider = 4;
m_sQueueSample.m_bReverbFlag = TRUE; SET_SOUND_REVERB(TRUE);
SET_SOUND_REFLECTION(FALSE); SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue(); AddSampleToRequestedQueue();
} }
@ -1433,7 +1435,7 @@ cAudioManager::ProcessModelVehicle(cVehicleParams& params)
m_sQueueSample.m_fSpeedMultiplier = 3.0f; m_sQueueSample.m_fSpeedMultiplier = 3.0f;
m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY;
m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_bReverbFlag = TRUE; SET_SOUND_REVERB(TRUE);
SET_SOUND_REFLECTION(FALSE); SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue(); AddSampleToRequestedQueue();
} }
@ -1503,7 +1505,7 @@ cAudioManager::ProcessVehicleFlatTyre(cVehicleParams& params)
m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY;
m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_nReleasingVolumeDivider = 3; m_sQueueSample.m_nReleasingVolumeDivider = 3;
m_sQueueSample.m_bReverbFlag = TRUE; SET_SOUND_REVERB(TRUE);
SET_SOUND_REFLECTION(FALSE); SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue(); AddSampleToRequestedQueue();
} }
@ -1565,7 +1567,7 @@ cAudioManager::ProcessVehicleRoadNoise(cVehicleParams& params)
m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY;
m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_nReleasingVolumeDivider = 4; m_sQueueSample.m_nReleasingVolumeDivider = 4;
m_sQueueSample.m_bReverbFlag = TRUE; SET_SOUND_REVERB(TRUE);
SET_SOUND_REFLECTION(FALSE); SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue(); AddSampleToRequestedQueue();
} }
@ -1624,7 +1626,7 @@ cAudioManager::ProcessWetRoadNoise(cVehicleParams& params)
m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY;
m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_nReleasingVolumeDivider = 4; m_sQueueSample.m_nReleasingVolumeDivider = 4;
m_sQueueSample.m_bReverbFlag = TRUE; SET_SOUND_REVERB(TRUE);
SET_SOUND_REFLECTION(FALSE); SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue(); AddSampleToRequestedQueue();
} }
@ -1846,7 +1848,7 @@ cAudioManager::ProcessVehicleEngine(cVehicleParams& params)
m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY;
m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_nReleasingVolumeDivider = 8; m_sQueueSample.m_nReleasingVolumeDivider = 8;
m_sQueueSample.m_bReverbFlag = TRUE; SET_SOUND_REVERB(TRUE);
SET_SOUND_REFLECTION(FALSE); SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue(); AddSampleToRequestedQueue();
} }
@ -1912,7 +1914,7 @@ cAudioManager::AddPlayerCarSample(uint8 emittingVolume, uint32 freq, uint32 samp
m_sQueueSample.m_fSpeedMultiplier = 6.0f; m_sQueueSample.m_fSpeedMultiplier = 6.0f;
m_sQueueSample.m_SoundIntensity = 50.0f; m_sQueueSample.m_SoundIntensity = 50.0f;
m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_bReverbFlag = TRUE; SET_SOUND_REVERB(TRUE);
SET_SOUND_REFLECTION(FALSE); SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue(); AddSampleToRequestedQueue();
} }
@ -1938,7 +1940,7 @@ cAudioManager::ProcessCesna(cVehicleParams &params)
m_sQueueSample.m_fSpeedMultiplier = 4.0f; m_sQueueSample.m_fSpeedMultiplier = 4.0f;
m_sQueueSample.m_SoundIntensity = 200.0f; m_sQueueSample.m_SoundIntensity = 200.0f;
m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_bReverbFlag = TRUE; SET_SOUND_REVERB(TRUE);
SET_SOUND_REFLECTION(FALSE); SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue(); AddSampleToRequestedQueue();
} }
@ -1958,7 +1960,7 @@ cAudioManager::ProcessCesna(cVehicleParams &params)
m_sQueueSample.m_fSpeedMultiplier = 4.0f; m_sQueueSample.m_fSpeedMultiplier = 4.0f;
m_sQueueSample.m_SoundIntensity = 90.0f; m_sQueueSample.m_SoundIntensity = 90.0f;
m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_bReverbFlag = TRUE; SET_SOUND_REVERB(TRUE);
SET_SOUND_REFLECTION(FALSE); SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue(); AddSampleToRequestedQueue();
} }
@ -2320,7 +2322,9 @@ cAudioManager::ProcessPlayersVehicleEngine(cVehicleParams& params, CVehicle* veh
freq /= 2; freq /= 2;
SampleManager.SetChannelFrequency(nChannel, freq); SampleManager.SetChannelFrequency(nChannel, freq);
if (!channelUsed) { if (!channelUsed) {
#ifdef AUDIO_REVERB
SampleManager.SetChannelReverbFlag(nChannel, m_bDynamicAcousticModelingStatus != FALSE); SampleManager.SetChannelReverbFlag(nChannel, m_bDynamicAcousticModelingStatus != FALSE);
#endif
SampleManager.StartChannel(nChannel); SampleManager.StartChannel(nChannel);
} }
} }
@ -2462,7 +2466,7 @@ cAudioManager::ProcessVehicleSkidding(cVehicleParams& params)
m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY;
m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_nReleasingVolumeDivider = 3; m_sQueueSample.m_nReleasingVolumeDivider = 3;
m_sQueueSample.m_bReverbFlag = TRUE; SET_SOUND_REVERB(TRUE);
SET_SOUND_REFLECTION(FALSE); SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue(); AddSampleToRequestedQueue();
} }
@ -2568,7 +2572,7 @@ cAudioManager::ProcessVehicleHorn(cVehicleParams& params)
m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY;
m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_nReleasingVolumeDivider = 4; m_sQueueSample.m_nReleasingVolumeDivider = 4;
m_sQueueSample.m_bReverbFlag = TRUE; SET_SOUND_REVERB(TRUE);
SET_SOUND_REFLECTION(FALSE); SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue(); AddSampleToRequestedQueue();
} }
@ -2649,7 +2653,7 @@ cAudioManager::ProcessVehicleSirenOrAlarm(cVehicleParams& params)
m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY;
m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_nReleasingVolumeDivider = 5; m_sQueueSample.m_nReleasingVolumeDivider = 5;
m_sQueueSample.m_bReverbFlag = TRUE; SET_SOUND_REVERB(TRUE);
SET_SOUND_REFLECTION(FALSE); SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue(); AddSampleToRequestedQueue();
} }
@ -2695,7 +2699,7 @@ cAudioManager::ProcessVehicleReverseWarning(cVehicleParams& params)
m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY;
m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_nReleasingVolumeDivider = 3; m_sQueueSample.m_nReleasingVolumeDivider = 3;
m_sQueueSample.m_bReverbFlag = TRUE; SET_SOUND_REVERB(TRUE);
SET_SOUND_REFLECTION(FALSE); SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue(); AddSampleToRequestedQueue();
} }
@ -2739,7 +2743,7 @@ cAudioManager::ProcessVehicleDoors(cVehicleParams& params)
m_sQueueSample.m_fSpeedMultiplier = 1.0f; m_sQueueSample.m_fSpeedMultiplier = 1.0f;
m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY;
m_sQueueSample.m_bReleasingSoundFlag = TRUE; m_sQueueSample.m_bReleasingSoundFlag = TRUE;
m_sQueueSample.m_bReverbFlag = TRUE; SET_SOUND_REVERB(TRUE);
SET_SOUND_REFLECTION(TRUE); SET_SOUND_REFLECTION(TRUE);
AddSampleToRequestedQueue(); AddSampleToRequestedQueue();
} }
@ -2784,7 +2788,7 @@ cAudioManager::ProcessAirBrakes(cVehicleParams& params)
m_sQueueSample.m_fSpeedMultiplier = 0.0f; m_sQueueSample.m_fSpeedMultiplier = 0.0f;
m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY;
m_sQueueSample.m_bReleasingSoundFlag = TRUE; m_sQueueSample.m_bReleasingSoundFlag = TRUE;
m_sQueueSample.m_bReverbFlag = TRUE; SET_SOUND_REVERB(TRUE);
SET_SOUND_REFLECTION(FALSE); SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue(); AddSampleToRequestedQueue();
} }
@ -2841,7 +2845,7 @@ cAudioManager::ProcessEngineDamage(cVehicleParams& params)
m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY;
m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_nReleasingVolumeDivider = 3; m_sQueueSample.m_nReleasingVolumeDivider = 3;
m_sQueueSample.m_bReverbFlag = TRUE; SET_SOUND_REVERB(TRUE);
SET_SOUND_REFLECTION(FALSE); SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue(); AddSampleToRequestedQueue();
} }
@ -2889,7 +2893,7 @@ cAudioManager::ProcessCarBombTick(cVehicleParams& params)
m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY;
m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_nReleasingVolumeDivider = 3; m_sQueueSample.m_nReleasingVolumeDivider = 3;
m_sQueueSample.m_bReverbFlag = TRUE; SET_SOUND_REVERB(TRUE);
SET_SOUND_REFLECTION(FALSE); SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue(); AddSampleToRequestedQueue();
} }
@ -3478,7 +3482,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams& params)
} }
SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex)
SET_EMITTING_VOLUME(emittingVol); SET_EMITTING_VOLUME(emittingVol);
m_sQueueSample.m_bReverbFlag = TRUE; SET_SOUND_REVERB(TRUE);
if (stereo) { if (stereo) {
if(m_sQueueSample.m_fDistance < 0.2f * m_sQueueSample.m_SoundIntensity) { if(m_sQueueSample.m_fDistance < 0.2f * m_sQueueSample.m_SoundIntensity) {
m_sQueueSample.m_bIs2D = TRUE; m_sQueueSample.m_bIs2D = TRUE;
@ -3539,7 +3543,7 @@ cAudioManager::ProcessTrainNoise(cVehicleParams& params)
m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY;
m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_nReleasingVolumeDivider = 3; m_sQueueSample.m_nReleasingVolumeDivider = 3;
m_sQueueSample.m_bReverbFlag = TRUE; SET_SOUND_REVERB(TRUE);
SET_SOUND_REFLECTION(FALSE); SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue(); AddSampleToRequestedQueue();
} }
@ -3561,7 +3565,7 @@ cAudioManager::ProcessTrainNoise(cVehicleParams& params)
m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY;
m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_nReleasingVolumeDivider = 3; m_sQueueSample.m_nReleasingVolumeDivider = 3;
m_sQueueSample.m_bReverbFlag = TRUE; SET_SOUND_REVERB(TRUE);
SET_SOUND_REFLECTION(FALSE); SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue(); AddSampleToRequestedQueue();
} }
@ -3683,7 +3687,7 @@ cAudioManager::ProcessBoatEngine(cVehicleParams& params)
m_sQueueSample.m_SoundIntensity = intensity; m_sQueueSample.m_SoundIntensity = intensity;
m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_nReleasingVolumeDivider = 7; m_sQueueSample.m_nReleasingVolumeDivider = 7;
m_sQueueSample.m_bReverbFlag = TRUE; SET_SOUND_REVERB(TRUE);
SET_SOUND_REFLECTION(FALSE); SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue(); AddSampleToRequestedQueue();
} }
@ -3707,7 +3711,7 @@ cAudioManager::ProcessBoatEngine(cVehicleParams& params)
m_sQueueSample.m_SoundIntensity = intensity; m_sQueueSample.m_SoundIntensity = intensity;
m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_nReleasingVolumeDivider = 7; m_sQueueSample.m_nReleasingVolumeDivider = 7;
m_sQueueSample.m_bReverbFlag = TRUE; SET_SOUND_REVERB(TRUE);
SET_SOUND_REFLECTION(FALSE); SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue(); AddSampleToRequestedQueue();
} }
@ -3754,7 +3758,7 @@ cAudioManager::ProcessBoatMovingOverWater(cVehicleParams& params)
m_sQueueSample.m_SoundIntensity = 50.0f; m_sQueueSample.m_SoundIntensity = 50.0f;
m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_nReleasingVolumeDivider = 6; m_sQueueSample.m_nReleasingVolumeDivider = 6;
m_sQueueSample.m_bReverbFlag = TRUE; SET_SOUND_REVERB(TRUE);
SET_SOUND_REFLECTION(FALSE); SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue(); AddSampleToRequestedQueue();
} }
@ -3921,7 +3925,7 @@ cAudioManager::SetupJumboTaxiSound(uint8 vol)
m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY;
m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_nReleasingVolumeDivider = 4; m_sQueueSample.m_nReleasingVolumeDivider = 4;
m_sQueueSample.m_bReverbFlag = TRUE; SET_SOUND_REVERB(TRUE);
SET_SOUND_REFLECTION(FALSE); SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue(); AddSampleToRequestedQueue();
} }
@ -3952,7 +3956,7 @@ cAudioManager::SetupJumboWhineSound(uint8 emittingVol, uint32 freq)
m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY;
m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_nReleasingVolumeDivider = 4; m_sQueueSample.m_nReleasingVolumeDivider = 4;
m_sQueueSample.m_bReverbFlag = TRUE; SET_SOUND_REVERB(TRUE);
SET_SOUND_REFLECTION(FALSE); SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue(); AddSampleToRequestedQueue();
} }
@ -3982,7 +3986,7 @@ cAudioManager::SetupJumboEngineSound(uint8 vol, uint32 freq)
m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY;
m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_nReleasingVolumeDivider = 4; m_sQueueSample.m_nReleasingVolumeDivider = 4;
m_sQueueSample.m_bReverbFlag = TRUE; SET_SOUND_REVERB(TRUE);
SET_SOUND_REFLECTION(FALSE); SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue(); AddSampleToRequestedQueue();
} }
@ -4011,7 +4015,7 @@ cAudioManager::SetupJumboFlySound(uint8 emittingVol)
m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY;
m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_nReleasingVolumeDivider = 5; m_sQueueSample.m_nReleasingVolumeDivider = 5;
m_sQueueSample.m_bReverbFlag = TRUE; SET_SOUND_REVERB(TRUE);
SET_SOUND_REFLECTION(FALSE); SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue(); AddSampleToRequestedQueue();
} }
@ -4042,7 +4046,7 @@ cAudioManager::SetupJumboRumbleSound(uint8 emittingVol)
m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_nReleasingVolumeDivider = 12; m_sQueueSample.m_nReleasingVolumeDivider = 12;
m_sQueueSample.m_nOffset = 0; m_sQueueSample.m_nOffset = 0;
m_sQueueSample.m_bReverbFlag = TRUE; SET_SOUND_REVERB(TRUE);
SET_SOUND_REFLECTION(FALSE); SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue(); AddSampleToRequestedQueue();
m_sQueueSample.m_nCounter = 6; m_sQueueSample.m_nCounter = 6;
@ -5064,7 +5068,7 @@ cAudioManager::ProcessPedOneShots(cPedParams &params)
stereo = FALSE; stereo = FALSE;
} }
} }
m_sQueueSample.m_bReverbFlag = TRUE; SET_SOUND_REVERB(TRUE);
AddSampleToRequestedQueue(); AddSampleToRequestedQueue();
if (stereo) { if (stereo) {
m_sQueueSample.m_nOffset = 127; m_sQueueSample.m_nOffset = 127;
@ -7870,7 +7874,9 @@ cPedComments::Process()
AudioManager.m_sQueueSample.m_SoundIntensity = 40.0f; AudioManager.m_sQueueSample.m_SoundIntensity = 40.0f;
AudioManager.m_sQueueSample.m_bReleasingSoundFlag = TRUE; 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_vecPos = m_asPedComments[m_nActiveBank][m_nIndexMap[m_nActiveBank][0]].m_vecPos;
#ifdef AUDIO_REVERB
AudioManager.m_sQueueSample.m_bReverbFlag = TRUE; AudioManager.m_sQueueSample.m_bReverbFlag = TRUE;
#endif // AUDIO_REVERB
#ifdef AUDIO_REFLECTIONS #ifdef AUDIO_REFLECTIONS
AudioManager.m_sQueueSample.m_bRequireReflection = TRUE; AudioManager.m_sQueueSample.m_bRequireReflection = TRUE;
#endif // AUDIO_REFLECTIONS #endif // AUDIO_REFLECTIONS
@ -7996,7 +8002,7 @@ cAudioManager::ProcessExplosions(int32 explosion)
m_sQueueSample.m_bReleasingSoundFlag = TRUE; m_sQueueSample.m_bReleasingSoundFlag = TRUE;
SET_EMITTING_VOLUME(MAX_VOLUME); SET_EMITTING_VOLUME(MAX_VOLUME);
RESET_LOOP_OFFSETS RESET_LOOP_OFFSETS
m_sQueueSample.m_bReverbFlag = TRUE; SET_SOUND_REVERB(TRUE);
AddSampleToRequestedQueue(); AddSampleToRequestedQueue();
} }
} }
@ -8062,7 +8068,7 @@ cAudioManager::ProcessFires(int32)
m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_bReleasingSoundFlag = FALSE;
SET_EMITTING_VOLUME(emittingVol); SET_EMITTING_VOLUME(emittingVol);
SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex)
m_sQueueSample.m_bReverbFlag = TRUE; SET_SOUND_REVERB(TRUE);
SET_SOUND_REFLECTION(FALSE); SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue(); AddSampleToRequestedQueue();
} }
@ -8085,7 +8091,7 @@ cAudioManager::ProcessFires(int32)
m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_bReleasingSoundFlag = FALSE;
SET_EMITTING_VOLUME(emittingVol); SET_EMITTING_VOLUME(emittingVol);
SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex)
m_sQueueSample.m_bReverbFlag = TRUE; SET_SOUND_REVERB(TRUE);
SET_SOUND_REFLECTION(FALSE); SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue(); AddSampleToRequestedQueue();
} }
@ -8120,7 +8126,7 @@ cAudioManager::ProcessWaterCannon(int32)
m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_bReleasingSoundFlag = FALSE;
SET_EMITTING_VOLUME(50); SET_EMITTING_VOLUME(50);
SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex)
m_sQueueSample.m_bReverbFlag = TRUE; SET_SOUND_REVERB(TRUE);
SET_SOUND_REFLECTION(FALSE); SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue(); AddSampleToRequestedQueue();
} }
@ -8402,7 +8408,7 @@ cAudioManager::ProcessOneShotScriptObject(uint8 sound)
m_sQueueSample.m_bReleasingSoundFlag = TRUE; m_sQueueSample.m_bReleasingSoundFlag = TRUE;
SET_EMITTING_VOLUME(emittingVolume); SET_EMITTING_VOLUME(emittingVolume);
RESET_LOOP_OFFSETS RESET_LOOP_OFFSETS
m_sQueueSample.m_bReverbFlag = TRUE; SET_SOUND_REVERB(TRUE);
AddSampleToRequestedQueue(); AddSampleToRequestedQueue();
} }
} }
@ -8616,7 +8622,7 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound)
m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_bIs2D = FALSE;
m_sQueueSample.m_nLoopCount = 0; m_sQueueSample.m_nLoopCount = 0;
m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_bReverbFlag = TRUE; SET_SOUND_REVERB(TRUE);
SET_EMITTING_VOLUME(emittingVolume); SET_EMITTING_VOLUME(emittingVolume);
SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex)
SET_SOUND_REFLECTION(FALSE); SET_SOUND_REFLECTION(FALSE);
@ -8664,7 +8670,7 @@ cAudioManager::ProcessWeather(int32 id)
m_sQueueSample.m_bReleasingSoundFlag = TRUE; m_sQueueSample.m_bReleasingSoundFlag = TRUE;
SET_EMITTING_VOLUME(m_sQueueSample.m_nVolume); SET_EMITTING_VOLUME(m_sQueueSample.m_nVolume);
RESET_LOOP_OFFSETS RESET_LOOP_OFFSETS
m_sQueueSample.m_bReverbFlag = FALSE; SET_SOUND_REVERB(FALSE);
SET_SOUND_REFLECTION(FALSE); SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue(); AddSampleToRequestedQueue();
} }
@ -8680,7 +8686,7 @@ cAudioManager::ProcessWeather(int32 id)
m_sQueueSample.m_nLoopCount = 0; m_sQueueSample.m_nLoopCount = 0;
m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_nReleasingVolumeDivider = 30; m_sQueueSample.m_nReleasingVolumeDivider = 30;
m_sQueueSample.m_bReverbFlag = FALSE; SET_SOUND_REVERB(FALSE);
SET_EMITTING_VOLUME(m_sQueueSample.m_nVolume); SET_EMITTING_VOLUME(m_sQueueSample.m_nVolume);
SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex)
SET_SOUND_REFLECTION(FALSE); SET_SOUND_REFLECTION(FALSE);
@ -8704,7 +8710,7 @@ cAudioManager::ProcessWeather(int32 id)
m_sQueueSample.m_nLoopCount = 0; m_sQueueSample.m_nLoopCount = 0;
m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_nReleasingVolumeDivider = 7; m_sQueueSample.m_nReleasingVolumeDivider = 7;
m_sQueueSample.m_bReverbFlag = FALSE; SET_SOUND_REVERB(FALSE);
SET_EMITTING_VOLUME(m_sQueueSample.m_nVolume); SET_EMITTING_VOLUME(m_sQueueSample.m_nVolume);
SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex)
SET_SOUND_REFLECTION(FALSE); SET_SOUND_REFLECTION(FALSE);
@ -8920,7 +8926,7 @@ cAudioManager::ProcessFrontEnd()
m_sQueueSample.m_fDistance = 1.0f; m_sQueueSample.m_fDistance = 1.0f;
} }
} }
m_sQueueSample.m_bReverbFlag = FALSE; SET_SOUND_REVERB(FALSE);
SET_SOUND_REFLECTION(FALSE); SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue(); AddSampleToRequestedQueue();
if (stereo) { if (stereo) {
@ -8969,7 +8975,7 @@ cAudioManager::ProcessCrane()
m_sQueueSample.m_fSoundIntensity = intensity; m_sQueueSample.m_fSoundIntensity = intensity;
m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_nReleasingVolumeDivider = 3; m_sQueueSample.m_nReleasingVolumeDivider = 3;
m_sQueueSample.m_bReverbFlag = TRUE; SET_SOUND_REVERB(TRUE);
SET_SOUND_REFLECTION(FALSE); SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue(); AddSampleToRequestedQueue();
} }
@ -8979,7 +8985,7 @@ cAudioManager::ProcessCrane()
m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_COL_CAR_2); m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_COL_CAR_2);
m_sQueueSample.m_nLoopCount = 1; m_sQueueSample.m_nLoopCount = 1;
m_sQueueSample.m_bReleasingSoundFlag = TRUE; m_sQueueSample.m_bReleasingSoundFlag = TRUE;
m_sQueueSample.m_bReverbFlag = TRUE; SET_SOUND_REVERB(TRUE);
SET_SOUND_REFLECTION(TRUE); SET_SOUND_REFLECTION(TRUE);
AddSampleToRequestedQueue(); AddSampleToRequestedQueue();
} }
@ -9039,7 +9045,7 @@ cAudioManager::ProcessProjectiles()
SET_EMITTING_VOLUME(emittingVol); SET_EMITTING_VOLUME(emittingVol);
SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex)
m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_bReverbFlag = TRUE; SET_SOUND_REVERB(TRUE);
SET_SOUND_REFLECTION(FALSE); SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue(); AddSampleToRequestedQueue();
} }
@ -9077,7 +9083,7 @@ cAudioManager::ProcessEscalators()
m_sQueueSample.m_nLoopCount = 0; m_sQueueSample.m_nLoopCount = 0;
SET_EMITTING_VOLUME(EMITTING_VOLUME); SET_EMITTING_VOLUME(EMITTING_VOLUME);
SET_LOOP_OFFSETS(SFX_BOAT_V12_LOOP) SET_LOOP_OFFSETS(SFX_BOAT_V12_LOOP)
m_sQueueSample.m_bReverbFlag = TRUE; SET_SOUND_REVERB(TRUE);
m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_bReleasingSoundFlag = FALSE;
SET_SOUND_REFLECTION(FALSE); SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue(); AddSampleToRequestedQueue();
@ -9115,7 +9121,7 @@ cAudioManager::ProcessExtraSounds()
m_sQueueSample.m_fSpeedMultiplier = 3.0f; m_sQueueSample.m_fSpeedMultiplier = 3.0f;
SET_EMITTING_VOLUME(EMITTING_VOLUME); SET_EMITTING_VOLUME(EMITTING_VOLUME);
SET_LOOP_OFFSETS(SFX_ARCADE) SET_LOOP_OFFSETS(SFX_ARCADE)
m_sQueueSample.m_bReverbFlag = TRUE; SET_SOUND_REVERB(TRUE);
m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY;
SET_SOUND_REFLECTION(FALSE); SET_SOUND_REFLECTION(FALSE);
m_sQueueSample.m_nReleasingVolumeDivider = 3; m_sQueueSample.m_nReleasingVolumeDivider = 3;
@ -9197,7 +9203,7 @@ cAudioManager::ProcessGarages()
SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex)
m_sQueueSample.m_fSpeedMultiplier = 2.0f; m_sQueueSample.m_fSpeedMultiplier = 2.0f;
m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY;
m_sQueueSample.m_bReverbFlag = TRUE; SET_SOUND_REVERB(TRUE);
SET_SOUND_REFLECTION(FALSE); SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue(); AddSampleToRequestedQueue();
} }
@ -9227,7 +9233,7 @@ cAudioManager::ProcessGarages()
SET_EMITTING_VOLUME(60); SET_EMITTING_VOLUME(60);
m_sQueueSample.m_fSpeedMultiplier = 0.0f; m_sQueueSample.m_fSpeedMultiplier = 0.0f;
m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY;
m_sQueueSample.m_bReverbFlag = TRUE; SET_SOUND_REVERB(TRUE);
m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_bIs2D = FALSE;
m_sQueueSample.m_bReleasingSoundFlag = TRUE; m_sQueueSample.m_bReleasingSoundFlag = TRUE;
m_sQueueSample.m_nLoopCount = 1; m_sQueueSample.m_nLoopCount = 1;
@ -9332,7 +9338,7 @@ cAudioManager::ProcessBridgeWarning()
m_sQueueSample.m_SoundIntensity = 450.0f; m_sQueueSample.m_SoundIntensity = 450.0f;
m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_nReleasingVolumeDivider = 8; m_sQueueSample.m_nReleasingVolumeDivider = 8;
m_sQueueSample.m_bReverbFlag = FALSE; SET_SOUND_REVERB(FALSE);
SET_SOUND_REFLECTION(FALSE); SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue(); AddSampleToRequestedQueue();
} }
@ -9358,7 +9364,7 @@ cAudioManager::ProcessBridgeMotor()
m_sQueueSample.m_SoundIntensity = bridgeIntensity; m_sQueueSample.m_SoundIntensity = bridgeIntensity;
m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_nReleasingVolumeDivider = 3; m_sQueueSample.m_nReleasingVolumeDivider = 3;
m_sQueueSample.m_bReverbFlag = FALSE; SET_SOUND_REVERB(FALSE);
AddSampleToRequestedQueue(); AddSampleToRequestedQueue();
} }
} }
@ -9391,7 +9397,7 @@ cAudioManager::ProcessBridgeOneShots()
m_sQueueSample.m_fSpeedMultiplier = 2.0f; m_sQueueSample.m_fSpeedMultiplier = 2.0f;
m_sQueueSample.m_SoundIntensity = bridgeIntensity; m_sQueueSample.m_SoundIntensity = bridgeIntensity;
m_sQueueSample.m_bReleasingSoundFlag = TRUE; m_sQueueSample.m_bReleasingSoundFlag = TRUE;
m_sQueueSample.m_bReverbFlag = FALSE; SET_SOUND_REVERB(FALSE);
SET_SOUND_REFLECTION(FALSE); SET_SOUND_REFLECTION(FALSE);
AddSampleToRequestedQueue(); AddSampleToRequestedQueue();
} }

View File

@ -509,7 +509,9 @@ cAudioManager::ServiceSoundEffects()
ClearActiveSamples(); ClearActiveSamples();
} }
m_nActiveSampleQueue = m_nActiveSampleQueue == 1 ? 0 : 1; m_nActiveSampleQueue = m_nActiveSampleQueue == 1 ? 0 : 1;
#ifdef AUDIO_REVERB
if(m_bReverb) ProcessReverb(); if(m_bReverb) ProcessReverb();
#endif
ProcessSpecial(); ProcessSpecial();
ClearRequestedQueue(); ClearRequestedQueue();
InterrogateAudioEntities(); InterrogateAudioEntities();
@ -667,9 +669,10 @@ cAudioManager::AddSampleToRequestedQueue()
if ( m_bReverb && m_sQueueSample.m_bIs2D ) if ( m_bReverb && m_sQueueSample.m_bIs2D )
m_sQueueSample.m_nFrontRearOffset = 30; m_sQueueSample.m_nFrontRearOffset = 30;
#ifdef AUDIO_REVERB
if (!m_bDynamicAcousticModelingStatus) if (!m_bDynamicAcousticModelingStatus)
m_sQueueSample.m_bReverbFlag = FALSE; m_sQueueSample.m_bReverbFlag = FALSE;
#endif
#endif #endif
m_asSamples[m_nActiveSampleQueue][sampleIndex] = m_sQueueSample; m_asSamples[m_nActiveSampleQueue][sampleIndex] = m_sQueueSample;
@ -1061,7 +1064,9 @@ cAudioManager::ProcessActiveQueues()
SampleManager.SetChannelPan(j, sample.m_nOffset); SampleManager.SetChannelPan(j, sample.m_nOffset);
#endif #endif
} }
#if !defined(GTA_PS2) || defined(AUDIO_REVERB)
SampleManager.SetChannelReverbFlag(j, sample.m_bReverbFlag); SampleManager.SetChannelReverbFlag(j, sample.m_bReverbFlag);
#endif
break; //continue for i break; //continue for i
} }
sample.m_bIsProcessed = FALSE; sample.m_bIsProcessed = FALSE;
@ -1141,7 +1146,9 @@ cAudioManager::ProcessActiveQueues()
SampleManager.SetChannelLoopPoints(k, m_asActiveSamples[k].m_nLoopStart, m_asActiveSamples[k].m_nLoopEnd); SampleManager.SetChannelLoopPoints(k, m_asActiveSamples[k].m_nLoopStart, m_asActiveSamples[k].m_nLoopEnd);
SampleManager.SetChannelLoopCount(k, m_asActiveSamples[k].m_nLoopCount); SampleManager.SetChannelLoopCount(k, m_asActiveSamples[k].m_nLoopCount);
#endif #endif
#if !defined(GTA_PS2) || defined(AUDIO_REVERB)
SampleManager.SetChannelReverbFlag(k, m_asActiveSamples[k].m_bReverbFlag); SampleManager.SetChannelReverbFlag(k, m_asActiveSamples[k].m_bReverbFlag);
#endif
#ifdef EXTERNAL_3D_SOUND #ifdef EXTERNAL_3D_SOUND
if (m_asActiveSamples[k].m_bIs2D) { if (m_asActiveSamples[k].m_bIs2D) {
uint8 offset = m_asActiveSamples[k].m_nOffset; uint8 offset = m_asActiveSamples[k].m_nOffset;
@ -1217,11 +1224,13 @@ cAudioManager::ClearActiveSamples()
m_asActiveSamples[i].m_nReleasingVolumeDivider = 0; m_asActiveSamples[i].m_nReleasingVolumeDivider = 0;
m_asActiveSamples[i].m_nVolumeChange = -1; m_asActiveSamples[i].m_nVolumeChange = -1;
m_asActiveSamples[i].m_vecPos = CVector(0.0f, 0.0f, 0.0f); m_asActiveSamples[i].m_vecPos = CVector(0.0f, 0.0f, 0.0f);
#ifdef AUDIO_REVERB
m_asActiveSamples[i].m_bReverbFlag = FALSE; m_asActiveSamples[i].m_bReverbFlag = FALSE;
#endif // AUDIO_REVERB
#ifdef AUDIO_REFLECTIONS #ifdef AUDIO_REFLECTIONS
m_asActiveSamples[i].m_nLoopsRemaining = 0; m_asActiveSamples[i].m_nLoopsRemaining = 0;
m_asActiveSamples[i].m_bRequireReflection = FALSE; m_asActiveSamples[i].m_bRequireReflection = FALSE;
#endif #endif // AUDIO_REFLECTIONS
} }
} }

View File

@ -30,8 +30,8 @@ public:
float m_SoundIntensity; float m_SoundIntensity;
bool8 m_bReleasingSoundFlag; bool8 m_bReleasingSoundFlag;
CVector m_vecPos; CVector m_vecPos;
#ifndef GTA_PS2 #if !defined(GTA_PS2) || defined(AUDIO_REVERB) // GTA_PS2 because this field exists on mobile but not on PS2
bool8 m_bReverbFlag; // TODO: ifdef all the occurrences bool8 m_bReverbFlag;
#endif #endif
#ifdef AUDIO_REFLECTIONS #ifdef AUDIO_REFLECTIONS
uint8 m_nLoopsRemaining; uint8 m_nLoopsRemaining;
@ -616,6 +616,11 @@ public:
#else #else
#define SET_SOUND_REFLECTION(b) #define SET_SOUND_REFLECTION(b)
#endif #endif
#ifdef AUDIO_REVERB
#define SET_SOUND_REVERB(b) m_sQueueSample.m_bReverbFlag = b
#else
#define SET_SOUND_REVERB(b)
#endif
#if defined(AUDIO_MSS) && !defined(PS2_AUDIO_CHANNELS) #if defined(AUDIO_MSS) && !defined(PS2_AUDIO_CHANNELS)
static_assert(sizeof(cAudioManager) == 0x5558, "cAudioManager: error"); static_assert(sizeof(cAudioManager) == 0x5558, "cAudioManager: error");

View File

@ -64,8 +64,9 @@ cAudioManager::InitialisePoliceRadio()
m_sPoliceRadioQueue.policeChannelCounterSeconds = 0; m_sPoliceRadioQueue.policeChannelCounterSeconds = 0;
for (int32 i = 0; i < ARRAY_SIZE(m_sPoliceRadioQueue.crimes); i++) for (int32 i = 0; i < ARRAY_SIZE(m_sPoliceRadioQueue.crimes); i++)
m_sPoliceRadioQueue.crimes[i].type = CRIME_NONE; m_sPoliceRadioQueue.crimes[i].type = CRIME_NONE;
#if !defined(GTA_PS2) || defined(AUDIO_REVERB)
SampleManager.SetChannelReverbFlag(CHANNEL_POLICE_RADIO, FALSE); SampleManager.SetChannelReverbFlag(CHANNEL_POLICE_RADIO, FALSE);
#endif
gSpecialSuspectLastSeenReport = FALSE; gSpecialSuspectLastSeenReport = FALSE;
for (int32 i = 0; i < ARRAY_SIZE(gMinTimeToNextReport); i++) for (int32 i = 0; i < ARRAY_SIZE(gMinTimeToNextReport); i++)
gMinTimeToNextReport[i] = m_FrameCounter; gMinTimeToNextReport[i] = m_FrameCounter;
@ -110,7 +111,7 @@ cAudioManager::DoPoliceRadioCrackle()
SET_EMITTING_VOLUME(m_sQueueSample.m_nVolume); SET_EMITTING_VOLUME(m_sQueueSample.m_nVolume);
SET_LOOP_OFFSETS(SFX_POLICE_RADIO_CRACKLE) SET_LOOP_OFFSETS(SFX_POLICE_RADIO_CRACKLE)
m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_bReverbFlag = FALSE; SET_SOUND_REVERB(FALSE);
m_sQueueSample.m_nOffset = 63; m_sQueueSample.m_nOffset = 63;
m_sQueueSample.m_nReleasingVolumeDivider = 3; m_sQueueSample.m_nReleasingVolumeDivider = 3;
SET_SOUND_REFLECTION(FALSE); SET_SOUND_REFLECTION(FALSE);

View File

@ -2198,7 +2198,7 @@ cSampleManager::StartPreloadedStreamedFile(uint8 nStream)
bool8 bool8
cSampleManager::StartStreamedFile(uint32 nFile, uint32 nPos, uint8 nStream) cSampleManager::StartStreamedFile(uint32 nFile, uint32 nPos, uint8 nStream)
{ {
int i = 0; uint32 i = 0;
uint32 position = nPos; uint32 position = nPos;
char filename[MAX_PATH]; char filename[MAX_PATH];
@ -2280,7 +2280,7 @@ cSampleManager::StartStreamedFile(uint32 nFile, uint32 nPos, uint8 nStream)
if ( !_pMP3List ) if ( !_pMP3List )
{ {
nFile = 0; nFile = 0;
_bIsMp3Active = 0; _bIsMp3Active = FALSE;
#ifdef PS2_AUDIO_PATHS #ifdef PS2_AUDIO_PATHS
strcpy(filename, m_MiscomPath); strcpy(filename, m_MiscomPath);
strcat(filename, PS2StreamedNameTable[nFile]); strcat(filename, PS2StreamedNameTable[nFile]);
@ -2329,7 +2329,7 @@ cSampleManager::StartStreamedFile(uint32 nFile, uint32 nPos, uint8 nStream)
} }
} }
_bIsMp3Active = 0; _bIsMp3Active = FALSE;
} }
while ( ++i < nNumMP3s ); while ( ++i < nNumMP3s );
position = 0; position = 0;

View File

@ -1680,7 +1680,7 @@ cSampleManager::StartPreloadedStreamedFile(uint8 nStream)
bool8 bool8
cSampleManager::StartStreamedFile(uint32 nFile, uint32 nPos, uint8 nStream) cSampleManager::StartStreamedFile(uint32 nFile, uint32 nPos, uint8 nStream)
{ {
int i = 0; uint32 i = 0;
uint32 position = nPos; uint32 position = nPos;
char filename[MAX_PATH]; char filename[MAX_PATH];
@ -1759,7 +1759,7 @@ cSampleManager::StartStreamedFile(uint32 nFile, uint32 nPos, uint8 nStream)
if ( !_pMP3List ) if ( !_pMP3List )
{ {
nFile = 0; nFile = 0;
_bIsMp3Active = 0; _bIsMp3Active = FALSE;
CStream *stream = aStream[nStream]; CStream *stream = aStream[nStream];
#ifdef PS2_AUDIO_PATHS #ifdef PS2_AUDIO_PATHS
@ -1802,7 +1802,7 @@ cSampleManager::StartStreamedFile(uint32 nFile, uint32 nPos, uint8 nStream)
} }
} }
_bIsMp3Active = 0; _bIsMp3Active = FALSE;
} }
while ( ++i < nNumMP3s ); while ( ++i < nNumMP3s );
position = 0; position = 0;

View File

@ -181,6 +181,7 @@ enum Config {
# define PS2_MENU # define PS2_MENU
#elif defined GTA_PC #elif defined GTA_PC
# define EXTERNAL_3D_SOUND # define EXTERNAL_3D_SOUND
# define AUDIO_REVERB
# ifndef GTA_HANDHELD # ifndef GTA_HANDHELD
# define PC_PLAYER_CONTROLS // mouse player/cam mode # define PC_PLAYER_CONTROLS // mouse player/cam mode
# endif # endif
@ -440,6 +441,7 @@ static_assert(false, "SUPPORT_XBOX_SCRIPT and SUPPORT_MOBILE_SCRIPT are mutually
#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 #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 // originally and making it work in 2d only requires more resource). Will not work on PS2
#define AUDIO_REFLECTIONS // Enable audio reflections. This is enabled in all vanilla versions #define AUDIO_REFLECTIONS // Enable audio reflections. This is enabled in all vanilla versions
#define AUDIO_REVERB // Enable audio reverb. It was disabled in PS2 and mobile versions
#define RADIO_SCROLL_TO_PREV_STATION // Won't work without FIX_BUGS #define RADIO_SCROLL_TO_PREV_STATION // Won't work without FIX_BUGS
#define AUDIO_CACHE // cache sound lengths to speed up the cold boot #define AUDIO_CACHE // cache sound lengths to speed up the cold boot
#define PS2_AUDIO_CHANNELS // increases the maximum number of audio channels to PS2 value of 43 (PC has 28 originally) #define PS2_AUDIO_CHANNELS // increases the maximum number of audio channels to PS2 value of 43 (PC has 28 originally)