diff options
author | Sergeanur <s.anureev@yandex.ua> | 2021-08-16 09:00:10 +0200 |
---|---|---|
committer | Sergeanur <s.anureev@yandex.ua> | 2021-08-16 09:00:10 +0200 |
commit | c7e05c74b9b38c90bdb6d3c85c5ffc73bdf88f66 (patch) | |
tree | be74ff00397d85ecdec1ec65198fed0516b82935 /src | |
parent | Fix CW build (diff) | |
download | re3-c7e05c74b9b38c90bdb6d3c85c5ffc73bdf88f66.tar re3-c7e05c74b9b38c90bdb6d3c85c5ffc73bdf88f66.tar.gz re3-c7e05c74b9b38c90bdb6d3c85c5ffc73bdf88f66.tar.bz2 re3-c7e05c74b9b38c90bdb6d3c85c5ffc73bdf88f66.tar.lz re3-c7e05c74b9b38c90bdb6d3c85c5ffc73bdf88f66.tar.xz re3-c7e05c74b9b38c90bdb6d3c85c5ffc73bdf88f66.tar.zst re3-c7e05c74b9b38c90bdb6d3c85c5ffc73bdf88f66.zip |
Diffstat (limited to '')
-rw-r--r-- | src/audio/AudioCollision.cpp | 4 | ||||
-rw-r--r-- | src/audio/AudioLogic.cpp | 700 | ||||
-rw-r--r-- | src/audio/AudioManager.cpp | 37 | ||||
-rw-r--r-- | src/audio/AudioManager.h | 12 |
4 files changed, 377 insertions, 376 deletions
diff --git a/src/audio/AudioCollision.cpp b/src/audio/AudioCollision.cpp index 0a3c1edd..4bf6a404 100644 --- a/src/audio/AudioCollision.cpp +++ b/src/audio/AudioCollision.cpp @@ -268,7 +268,7 @@ cAudioManager::SetUpOneShotCollisionSound(const cAudioCollision &col) SET_EMITTING_VOLUME(emittingVol); RESET_LOOP_OFFSETS m_sQueueSample.m_fSpeedMultiplier = 4.0f; - m_sQueueSample.m_fSoundIntensity = CollisionSoundIntensity; + m_sQueueSample.m_SoundIntensity = CollisionSoundIntensity; m_sQueueSample.m_bReleasingSoundFlag = TRUE; m_sQueueSample.m_bReverbFlag = TRUE; m_sQueueSample.m_bRequireReflection = FALSE; @@ -297,7 +297,7 @@ cAudioManager::SetUpLoopingCollisionSound(const cAudioCollision &col, uint8 coun SET_EMITTING_VOLUME(emittingVol); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 4.0f; - m_sQueueSample.m_fSoundIntensity = CollisionSoundIntensity; + m_sQueueSample.m_SoundIntensity = CollisionSoundIntensity; m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_nReleasingVolumeDivider = 5; m_sQueueSample.m_bReverbFlag = TRUE; diff --git a/src/audio/AudioLogic.cpp b/src/audio/AudioLogic.cpp index 329358a5..eb14963c 100644 --- a/src/audio/AudioLogic.cpp +++ b/src/audio/AudioLogic.cpp @@ -914,7 +914,7 @@ cAudioManager::ProcessCarHeli(cVehicleParams& params) SET_EMITTING_VOLUME(emittingVol); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 6.0f; - m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_nReleasingVolumeDivider = 5; m_sQueueSample.m_bReverbFlag = TRUE; @@ -965,7 +965,7 @@ cAudioManager::ProcessCarHeli(cVehicleParams& params) SET_EMITTING_VOLUME(emittingVol); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 6.0f; - m_sQueueSample.m_fSoundIntensity = 140.0f; + m_sQueueSample.m_SoundIntensity = 140.0f; m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_nReleasingVolumeDivider = 5; m_sQueueSample.m_bReverbFlag = TRUE; @@ -990,7 +990,7 @@ cAudioManager::ProcessCarHeli(cVehicleParams& params) SET_EMITTING_VOLUME(emittingVol); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 6.0f; - m_sQueueSample.m_fSoundIntensity = 140.0f; + m_sQueueSample.m_SoundIntensity = 140.0f; m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_nReleasingVolumeDivider = 5; m_sQueueSample.m_bReverbFlag = TRUE; @@ -1006,7 +1006,7 @@ cAudioManager::ProcessCarHeli(cVehicleParams& params) SET_EMITTING_VOLUME(emittingVol); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 6.0f; - m_sQueueSample.m_fSoundIntensity = 140.0f; + m_sQueueSample.m_SoundIntensity = 140.0f; m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_nReleasingVolumeDivider = 5; m_sQueueSample.m_bReverbFlag = TRUE; @@ -1050,7 +1050,7 @@ cAudioManager::ProcessCarHeli(cVehicleParams& params) SET_EMITTING_VOLUME(emittingVol); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 6.0f; - m_sQueueSample.m_fSoundIntensity = 140.0f; + m_sQueueSample.m_SoundIntensity = 140.0f; m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_nReleasingVolumeDivider = 5; m_sQueueSample.m_bReverbFlag = TRUE; @@ -1083,7 +1083,7 @@ cAudioManager::ProcessCarHeli(cVehicleParams& params) SET_EMITTING_VOLUME(emittingVol); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 6.0f; - m_sQueueSample.m_fSoundIntensity = 30.0f; + m_sQueueSample.m_SoundIntensity = 30.0f; m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_nReleasingVolumeDivider = 30; m_sQueueSample.m_bReverbFlag = TRUE; @@ -1118,7 +1118,7 @@ cAudioManager::ProcessCarHeli(cVehicleParams& params) SET_EMITTING_VOLUME(propellerSpeed * 100.0f); SET_LOOP_OFFSETS(SFX_SEAPLANE_PRO4) m_sQueueSample.m_fSpeedMultiplier = 5.0f; - m_sQueueSample.m_fSoundIntensity = 20.0f; + m_sQueueSample.m_SoundIntensity = 20.0f; m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_nReleasingVolumeDivider = 7; m_sQueueSample.m_bReverbFlag = TRUE; @@ -1149,7 +1149,7 @@ cAudioManager::ProcessCarHeli(cVehicleParams& params) SET_EMITTING_VOLUME(volumeModifier * 25.0f); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 6.0f; - m_sQueueSample.m_fSoundIntensity = 27.0f; + m_sQueueSample.m_SoundIntensity = 27.0f; m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_nReleasingVolumeDivider = 5; m_sQueueSample.m_bReverbFlag = TRUE; @@ -1195,7 +1195,7 @@ cAudioManager::ProcessRainOnVehicle(cVehicleParams& params) SET_EMITTING_VOLUME(emittingVol); RESET_LOOP_OFFSETS m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; m_sQueueSample.m_bReleasingSoundFlag = TRUE; m_sQueueSample.m_bReverbFlag = FALSE; m_sQueueSample.m_bRequireReflection = FALSE; @@ -1247,7 +1247,7 @@ cAudioManager::ProcessReverseGear(cVehicleParams& params) SET_EMITTING_VOLUME(emittingVolume); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 3.0f; - m_sQueueSample.m_fSoundIntensity = reverseGearIntensity; + m_sQueueSample.m_SoundIntensity = reverseGearIntensity; m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_nReleasingVolumeDivider = 5; m_sQueueSample.m_bReverbFlag = TRUE; @@ -1290,7 +1290,7 @@ cAudioManager::ProcessModelHeliVehicle(cVehicleParams& params) } if (acceletateState < brakeState) acceletateState = brakeState; - freq = Clamp2(5 * acceletateState + 22050, prevFreq, 30); + 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) { @@ -1304,7 +1304,7 @@ cAudioManager::ProcessModelHeliVehicle(cVehicleParams& params) SET_EMITTING_VOLUME(70); SET_LOOP_OFFSETS(SFX_CAR_RC_HELI) m_sQueueSample.m_fSpeedMultiplier = 3.0f; - m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_nReleasingVolumeDivider = 4; m_sQueueSample.m_bReverbFlag = TRUE; @@ -1367,7 +1367,7 @@ cAudioManager::ProcessModelVehicle(cVehicleParams& params) SET_EMITTING_VOLUME(volume); SET_LOOP_OFFSETS(SFX_RC_REV) m_sQueueSample.m_fSpeedMultiplier = 3.0f; - m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_nReleasingVolumeDivider = 4; m_sQueueSample.m_bReverbFlag = TRUE; @@ -1431,7 +1431,7 @@ cAudioManager::ProcessModelVehicle(cVehicleParams& params) SET_EMITTING_VOLUME(volume); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 3.0f; - m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_bReverbFlag = TRUE; m_sQueueSample.m_bRequireReflection = FALSE; @@ -1500,7 +1500,7 @@ cAudioManager::ProcessVehicleFlatTyre(cVehicleParams& params) SET_EMITTING_VOLUME(emittingVol); SET_LOOP_OFFSETS(SFX_TYRE_BURST_L) m_sQueueSample.m_fSpeedMultiplier = 2.0f; - m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_nReleasingVolumeDivider = 3; m_sQueueSample.m_bReverbFlag = TRUE; @@ -1565,7 +1565,7 @@ cAudioManager::ProcessVehicleRoadNoise(cVehicleParams& params) SET_EMITTING_VOLUME(emittingVol); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 6.0f; - m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_nReleasingVolumeDivider = 4; m_sQueueSample.m_bReverbFlag = TRUE; @@ -1624,7 +1624,7 @@ cAudioManager::ProcessWetRoadNoise(cVehicleParams& params) SET_EMITTING_VOLUME(emittingVol); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 6.0f; - m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_nReleasingVolumeDivider = 4; m_sQueueSample.m_bReverbFlag = TRUE; @@ -1636,7 +1636,7 @@ cAudioManager::ProcessWetRoadNoise(cVehicleParams& params) return TRUE; } -void +bool8 cAudioManager::ProcessVehicleEngine(cVehicleParams& params) { const float SOUND_INTENSITY = 50.0f; @@ -1664,197 +1664,199 @@ cAudioManager::ProcessVehicleEngine(cVehicleParams& params) isMoped = FALSE; caddyBool = FALSE; traction = 0.0f; - if (params.m_fDistance >= SQR(SOUND_INTENSITY)) - return; - playerVeh = FindPlayerVehicle(); - veh = params.m_pVehicle; - if (playerVeh == veh && veh->GetStatus() == STATUS_WRECKED) { - SampleManager.StopChannel(CHANNEL_PLAYER_VEHICLE_ENGINE); - return; - } - if (!veh->bEngineOn) - return; - CalculateDistance(params.m_bDistanceCalculated, params.m_fDistance); - if (playerVeh == veh && veh->m_modelIndex != MI_CADDY) { - ProcessPlayersVehicleEngine(params, params.m_pVehicle); - return; - } - transmission = params.m_pTransmission; - if (transmission != nil) { - switch (veh->m_modelIndex) { - case MI_PIZZABOY: - case MI_FAGGIO: - isMoped = TRUE; - currentGear = transmission->nNumberOfGears; - break; - case MI_CADDY: - currentGear = transmission->nNumberOfGears; - caddyBool = TRUE; - break; - default: - currentGear = veh->m_nCurrentGear; - break; - } - switch (params.m_VehicleType) { - case VEHICLE_TYPE_CAR: - automobile = (CAutomobile*)veh; - wheelsOnGround = automobile->m_nDriveWheelsOnGround; - wheelsOnGroundPrev = automobile->m_nDriveWheelsOnGroundPrev; - wheelState = automobile->m_aWheelState; - gasPedalAudioPtr = &automobile->m_fGasPedalAudio; - break; - case VEHICLE_TYPE_BIKE: - bike = (CBike*)veh; - wheelsOnGround = bike->m_nDriveWheelsOnGround; - wheelsOnGroundPrev = bike->m_nDriveWheelsOnGroundPrev; - wheelState = bike->m_aWheelState; - gasPedalAudioPtr = &bike->m_fGasPedalAudio; - break; - default: - debug(" ** AUDIOLOG: Unrecognised vehicle type %d in ProcessVehicleEngine() * \n", params.m_VehicleType); - return; + if (params.m_fDistance < SQR(SOUND_INTENSITY)) { + playerVeh = FindPlayerVehicle(); + veh = params.m_pVehicle; + if (playerVeh == veh && veh->GetStatus() == STATUS_WRECKED) { + SampleManager.StopChannel(CHANNEL_PLAYER_VEHICLE_ENGINE); + return TRUE; } + if (veh->bEngineOn) { + CalculateDistance(params.m_bDistanceCalculated, params.m_fDistance); + if (playerVeh == veh && veh->m_modelIndex != MI_CADDY) { + ProcessPlayersVehicleEngine(params, params.m_pVehicle); + return TRUE; + } + transmission = params.m_pTransmission; + if (transmission != nil) { + switch (veh->m_modelIndex) { + case MI_PIZZABOY: + case MI_FAGGIO: + isMoped = TRUE; + currentGear = transmission->nNumberOfGears; + break; + case MI_CADDY: + currentGear = transmission->nNumberOfGears; + caddyBool = TRUE; + break; + default: + currentGear = veh->m_nCurrentGear; + break; + } + switch (params.m_VehicleType) { + case VEHICLE_TYPE_CAR: + automobile = (CAutomobile*)veh; + wheelsOnGround = automobile->m_nDriveWheelsOnGround; + wheelsOnGroundPrev = automobile->m_nDriveWheelsOnGroundPrev; + wheelState = automobile->m_aWheelState; + gasPedalAudioPtr = &automobile->m_fGasPedalAudio; + break; + case VEHICLE_TYPE_BIKE: + bike = (CBike*)veh; + wheelsOnGround = bike->m_nDriveWheelsOnGround; + wheelsOnGroundPrev = bike->m_nDriveWheelsOnGroundPrev; + wheelState = bike->m_aWheelState; + gasPedalAudioPtr = &bike->m_fGasPedalAudio; + break; + default: + debug(" ** AUDIOLOG: Unrecognised vehicle type %d in ProcessVehicleEngine() * \n", params.m_VehicleType); + return TRUE; + } - if (wheelsOnGround != 0) { - if (!veh->bIsHandbrakeOn || isMoped && caddyBool) { //mb bug, bcs it's can't be TRUE together - if (veh->GetStatus() == STATUS_SIMPLE || isMoped || caddyBool) { - traction = 0.0f; - } else { - switch (transmission->nDriveType) { - case '4': - if (params.m_VehicleType == VEHICLE_TYPE_BIKE) { - for (int i = 0; i < 2; i++) - if (wheelState[i] == WHEEL_STATE_SPINNING) - traction += 0.1f; - } else { - for (int i = 0; i < 4; i++) - if (wheelState[i] == WHEEL_STATE_SPINNING) - traction += 0.05f; - } - break; - case 'F': - if (params.m_VehicleType == VEHICLE_TYPE_BIKE) { - if (wheelState[BIKEWHEEL_FRONT] == WHEEL_STATE_SPINNING) - traction += 0.2f; + if (wheelsOnGround != 0) { + if (!veh->bIsHandbrakeOn || isMoped && caddyBool) { //mb bug, bcs it's can't be TRUE together + if (veh->GetStatus() == STATUS_SIMPLE || isMoped || caddyBool) { + traction = 0.0f; } else { - if (wheelState[CARWHEEL_FRONT_LEFT] == WHEEL_STATE_SPINNING) - traction += 0.1f; - if (wheelState[CARWHEEL_FRONT_RIGHT] == WHEEL_STATE_SPINNING) - traction += 0.1f; + switch (transmission->nDriveType) { + case '4': + if (params.m_VehicleType == VEHICLE_TYPE_BIKE) { + for (int i = 0; i < 2; i++) + if (wheelState[i] == WHEEL_STATE_SPINNING) + traction += 0.1f; + } else { + for (int i = 0; i < 4; i++) + if (wheelState[i] == WHEEL_STATE_SPINNING) + traction += 0.05f; + } + break; + case 'F': + if (params.m_VehicleType == VEHICLE_TYPE_BIKE) { + if (wheelState[BIKEWHEEL_FRONT] == WHEEL_STATE_SPINNING) + traction += 0.2f; + } else { + if (wheelState[CARWHEEL_FRONT_LEFT] == WHEEL_STATE_SPINNING) + traction += 0.1f; + if (wheelState[CARWHEEL_FRONT_RIGHT] == WHEEL_STATE_SPINNING) + traction += 0.1f; + } + break; + case 'R': + if (params.m_VehicleType == VEHICLE_TYPE_BIKE) { + if (wheelState[BIKEWHEEL_REAR] == WHEEL_STATE_SPINNING) + traction += 0.2f; + } else { + if (wheelState[CARWHEEL_REAR_LEFT] == WHEEL_STATE_SPINNING) + traction += 0.1f; + if (wheelState[CARWHEEL_REAR_RIGHT] == WHEEL_STATE_SPINNING) + traction += 0.1f; + } + break; + default: + break; + } } - break; - case 'R': - if (params.m_VehicleType == VEHICLE_TYPE_BIKE) { - if (wheelState[BIKEWHEEL_REAR] == WHEEL_STATE_SPINNING) - traction += 0.2f; + } else if (params.m_fVelocityChange == 0.0f) { + traction = 0.9f; + } + if (transmission->fMaxVelocity <= 0.0f) { + relativeChange = 0.0f; + modificator = 0.0f; + } else { + if (!isMoped && !caddyBool) { + if (currentGear != 0) { + relativeGearChange = Min(1.0f, + params.m_fVelocityChange - transmission->Gears[currentGear].fShiftDownVelocity) / transmission->fMaxVelocity * 2.5f; + if (traction == 0.0f && veh->GetStatus() != STATUS_SIMPLE && + params.m_fVelocityChange < transmission->Gears[1].fShiftUpVelocity) + traction = 0.7f; + relativeChange = traction * *gasPedalAudioPtr * 0.95f + (1.0f - traction) * relativeGearChange; + } else { + relativeChange = Min(1.0f, + 1.0f - Abs((params.m_fVelocityChange - transmission->Gears[0].fShiftDownVelocity) / transmission->fMaxReverseVelocity)); + } + modificator = relativeChange; } else { - if (wheelState[CARWHEEL_REAR_LEFT] == WHEEL_STATE_SPINNING) - traction += 0.1f; - if (wheelState[CARWHEEL_REAR_RIGHT] == WHEEL_STATE_SPINNING) - traction += 0.1f; + modificator = Min(1.0f, Abs(params.m_fVelocityChange / transmission->fMaxVelocity > 1.0f)); } - break; - default: - break; } + } else { + if (wheelsOnGroundPrev != 0) + *gasPedalAudioPtr *= 0.4f; + relativeChange = *gasPedalAudioPtr; + modificator = relativeChange; } - } else if (params.m_fVelocityChange == 0.0f) { - traction = 0.9f; - } - if (transmission->fMaxVelocity <= 0.0f) { - relativeChange = 0.0f; - modificator = 0.0f; + if (currentGear != 0 || wheelsOnGround == 0) + freq = 1200 * currentGear + 18000.0f * modificator + 14000; + else if (params.m_VehicleType == VEHICLE_TYPE_BIKE) + freq = 22050; + else + freq = 13000.0f * modificator + 14000; + if (modificator >= 0.75f) + emittingVol = 90; + else + emittingVol = modificator * (4.0f / 3.0f) * 15.0f + 75; } else { - if (!isMoped && !caddyBool) { - if (currentGear != 0) { - relativeGearChange = Min(1.0f, - params.m_fVelocityChange - transmission->Gears[currentGear].fShiftDownVelocity) / transmission->fMaxVelocity * 2.5f; - if (traction == 0.0f && veh->GetStatus() != STATUS_SIMPLE && - params.m_fVelocityChange < transmission->Gears[1].fShiftUpVelocity) - traction = 0.7f; - relativeChange = traction * *gasPedalAudioPtr * 0.95f + (1.0f - traction) * relativeGearChange; + modificator = 0.0f; + emittingVol = 75; + } + if (veh->bIsDrowning) + emittingVol /= 4; + if (caddyBool) { + emittingVol = 100.0f * modificator; + freq = 2130.0f * modificator + 4270; + m_sQueueSample.m_nCounter = 2; + } + m_sQueueSample.m_nVolume = ComputeVolume(emittingVol, SOUND_INTENSITY, m_sQueueSample.m_fDistance); + if (m_sQueueSample.m_nVolume != 0) { + if (!caddyBool) { + if (veh->GetStatus() == STATUS_SIMPLE) { + if (modificator < 0.02f) { + m_sQueueSample.m_nSampleIndex = aVehicleSettings[params.m_nIndex].m_nBank - CAR_SFX_BANKS_OFFSET + SFX_CAR_IDLE_1; + m_sQueueSample.m_nCounter = 52; + freq = 10000.0f * modificator + 22050; + } else { + m_sQueueSample.m_nSampleIndex = aVehicleSettings[params.m_nIndex].m_nAccelerationSampleIndex; + m_sQueueSample.m_nCounter = 2; + } } else { - relativeChange = Min(1.0f, - 1.0f - Abs((params.m_fVelocityChange - transmission->Gears[0].fShiftDownVelocity) / transmission->fMaxReverseVelocity)); + if (veh->m_fGasPedal < 0.02f) { + m_sQueueSample.m_nSampleIndex = aVehicleSettings[params.m_nIndex].m_nBank - CAR_SFX_BANKS_OFFSET + SFX_CAR_IDLE_1; + m_sQueueSample.m_nCounter = 52; + freq = 10000.0f * modificator + 22050; + } else { + m_sQueueSample.m_nSampleIndex = aVehicleSettings[params.m_nIndex].m_nAccelerationSampleIndex; + m_sQueueSample.m_nCounter = 2; + } } - modificator = relativeChange; - } else { - modificator = Min(1.0f, Abs(params.m_fVelocityChange / transmission->fMaxVelocity > 1.0f)); - } - } - } else { - if (wheelsOnGroundPrev != 0) - *gasPedalAudioPtr *= 0.4f; - relativeChange = *gasPedalAudioPtr; - modificator = relativeChange; - } - if (currentGear != 0 || wheelsOnGround == 0) - freq = 1200 * currentGear + 18000.0f * modificator + 14000; - else if (params.m_VehicleType == VEHICLE_TYPE_BIKE) - freq = 22050; - else - freq = 13000.0f * modificator + 14000; - if (modificator >= 0.75f) - emittingVol = 90; - else - emittingVol = modificator * (4.0f / 3.0f) * 15.0f + 75; - } else { - modificator = 0.0f; - emittingVol = 75; - } - if (veh->bIsDrowning) - emittingVol /= 4; - if (caddyBool) { - emittingVol = 100.0f * modificator; - freq = 2130.0f * modificator + 4270; - m_sQueueSample.m_nCounter = 2; - } - m_sQueueSample.m_nVolume = ComputeVolume(emittingVol, SOUND_INTENSITY, m_sQueueSample.m_fDistance); - if (m_sQueueSample.m_nVolume != 0) { - if (!caddyBool) { - if (veh->GetStatus() == STATUS_SIMPLE) { - if (modificator < 0.02f) { - m_sQueueSample.m_nSampleIndex = aVehicleSettings[params.m_nIndex].m_nBank - CAR_SFX_BANKS_OFFSET + SFX_CAR_IDLE_1; - m_sQueueSample.m_nCounter = 52; - freq = 10000.0f * modificator + 22050; - } else { - m_sQueueSample.m_nSampleIndex = aVehicleSettings[params.m_nIndex].m_nAccelerationSampleIndex; - m_sQueueSample.m_nCounter = 2; - } - } else { - if (veh->m_fGasPedal < 0.02f) { - m_sQueueSample.m_nSampleIndex = aVehicleSettings[params.m_nIndex].m_nBank - CAR_SFX_BANKS_OFFSET + SFX_CAR_IDLE_1; - m_sQueueSample.m_nCounter = 52; - freq = 10000.0f * modificator + 22050; + m_sQueueSample.m_nFrequency = freq + 100 * m_sQueueSample.m_nBankIndex % 1000; } else { - m_sQueueSample.m_nSampleIndex = aVehicleSettings[params.m_nIndex].m_nAccelerationSampleIndex; - m_sQueueSample.m_nCounter = 2; + if (FindVehicleOfPlayer() == params.m_pVehicle) + m_sQueueSample.m_nSampleIndex = SFX_CAR_AFTER_ACCEL_12; + else + m_sQueueSample.m_nSampleIndex = SFX_CAR_REV_12; + m_sQueueSample.m_nFrequency = freq + 20 * m_sQueueSample.m_nBankIndex % 100; } + m_sQueueSample.m_nBankIndex = SFX_BANK_0; + m_sQueueSample.m_bIs2D = FALSE; + m_sQueueSample.m_nReleasingVolumeModificator = 3; + if (m_sQueueSample.m_nSampleIndex == SFX_CAR_IDLE_5 || m_sQueueSample.m_nSampleIndex == SFX_CAR_REV_5) + m_sQueueSample.m_nFrequency /= 2; + m_sQueueSample.m_nLoopCount = 0; + SET_EMITTING_VOLUME(emittingVol); + SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) + m_sQueueSample.m_fSpeedMultiplier = 6.0f; + m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_bReleasingSoundFlag = FALSE; + m_sQueueSample.m_nReleasingVolumeDivider = 8; + m_sQueueSample.m_bReverbFlag = TRUE; + m_sQueueSample.m_bRequireReflection = FALSE; + AddSampleToRequestedQueue(); } - m_sQueueSample.m_nFrequency = freq + 100 * m_sQueueSample.m_nBankIndex % 1000; - } else { - if (FindVehicleOfPlayer() == params.m_pVehicle) - m_sQueueSample.m_nSampleIndex = SFX_CAR_AFTER_ACCEL_12; - else - m_sQueueSample.m_nSampleIndex = SFX_CAR_REV_12; - m_sQueueSample.m_nFrequency = freq + 20 * m_sQueueSample.m_nBankIndex % 100; } - m_sQueueSample.m_nBankIndex = SFX_BANK_0; - m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_nReleasingVolumeModificator = 3; - if (m_sQueueSample.m_nSampleIndex == SFX_CAR_IDLE_5 || m_sQueueSample.m_nSampleIndex == SFX_CAR_REV_5) - m_sQueueSample.m_nFrequency /= 2; - m_sQueueSample.m_nLoopCount = 0; - SET_EMITTING_VOLUME(emittingVol); - SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) - m_sQueueSample.m_fSpeedMultiplier = 6.0f; - m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; - m_sQueueSample.m_bReleasingSoundFlag = FALSE; - m_sQueueSample.m_nReleasingVolumeDivider = 8; - m_sQueueSample.m_bReverbFlag = TRUE; - m_sQueueSample.m_bRequireReflection = FALSE; - AddSampleToRequestedQueue(); + return TRUE; } + return FALSE; } void @@ -1911,7 +1913,7 @@ cAudioManager::AddPlayerCarSample(uint8 emittingVolume, uint32 freq, uint32 samp SET_EMITTING_VOLUME(emittingVolume); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 6.0f; - m_sQueueSample.m_fSoundIntensity = 50.0f; + m_sQueueSample.m_SoundIntensity = 50.0f; m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_bReverbFlag = TRUE; m_sQueueSample.m_bRequireReflection = FALSE; @@ -1937,7 +1939,7 @@ cAudioManager::ProcessCesna(cVehicleParams ¶ms) SET_EMITTING_VOLUME(80); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 4.0f; - m_sQueueSample.m_fSoundIntensity = 200.0f; + m_sQueueSample.m_SoundIntensity = 200.0f; m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_bReverbFlag = TRUE; m_sQueueSample.m_bRequireReflection = FALSE; @@ -1957,7 +1959,7 @@ cAudioManager::ProcessCesna(cVehicleParams ¶ms) SET_EMITTING_VOLUME(80); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 4.0f; - m_sQueueSample.m_fSoundIntensity = 90.0f; + m_sQueueSample.m_SoundIntensity = 90.0f; m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_bReverbFlag = TRUE; m_sQueueSample.m_bRequireReflection = FALSE; @@ -2491,7 +2493,7 @@ cAudioManager::ProcessVehicleSkidding(cVehicleParams& params) SET_EMITTING_VOLUME(emittingVol); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 3.0f; - m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_nReleasingVolumeDivider = 3; m_sQueueSample.m_bReverbFlag = TRUE; @@ -2597,7 +2599,7 @@ cAudioManager::ProcessVehicleHorn(cVehicleParams& params) #endif SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 5.0f; - m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_nReleasingVolumeDivider = 4; m_sQueueSample.m_bReverbFlag = TRUE; @@ -2678,7 +2680,7 @@ cAudioManager::ProcessVehicleSirenOrAlarm(cVehicleParams& params) SET_EMITTING_VOLUME(volume); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 7.0f; - m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_nReleasingVolumeDivider = 5; m_sQueueSample.m_bReverbFlag = TRUE; @@ -2724,7 +2726,7 @@ cAudioManager::ProcessVehicleReverseWarning(cVehicleParams& params) #endif SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 3.0f; - m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_nReleasingVolumeDivider = 3; m_sQueueSample.m_bReverbFlag = TRUE; @@ -2769,7 +2771,7 @@ cAudioManager::ProcessVehicleDoors(cVehicleParams& params) SET_EMITTING_VOLUME(emittingVol); RESET_LOOP_OFFSETS m_sQueueSample.m_fSpeedMultiplier = 1.0f; - m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; m_sQueueSample.m_bReleasingSoundFlag = TRUE; m_sQueueSample.m_bReverbFlag = TRUE; m_sQueueSample.m_bRequireReflection = TRUE; @@ -2814,7 +2816,7 @@ cAudioManager::ProcessAirBrakes(cVehicleParams& params) SET_EMITTING_VOLUME(volume); RESET_LOOP_OFFSETS m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; m_sQueueSample.m_bReleasingSoundFlag = TRUE; m_sQueueSample.m_bReverbFlag = TRUE; m_sQueueSample.m_bRequireReflection = FALSE; @@ -2870,7 +2872,7 @@ cAudioManager::ProcessEngineDamage(cVehicleParams& params) SET_EMITTING_VOLUME(emittingVolume); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 2.0f; - m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_nReleasingVolumeDivider = 3; m_sQueueSample.m_bReverbFlag = TRUE; @@ -2918,7 +2920,7 @@ cAudioManager::ProcessCarBombTick(cVehicleParams& params) SET_EMITTING_VOLUME(EMITTING_VOLUME); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 2.0f; - m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_nReleasingVolumeDivider = 3; m_sQueueSample.m_bReverbFlag = TRUE; @@ -2942,7 +2944,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams& params) float maxDist; static uint8 GunIndex = 53; - for (int i = 0; i < m_asAudioEntities[m_sQueueSample.m_nEntityIndex].m_AudioEvents; i++) { + for (uint16 i = 0; i < m_asAudioEntities[m_sQueueSample.m_nEntityIndex].m_AudioEvents; i++) { noReflections = FALSE; isHeli = FALSE; m_sQueueSample.m_bRequireReflection = FALSE; @@ -2987,7 +2989,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams& params) m_sQueueSample.m_nFrequency += RandomDisplacement(m_sQueueSample.m_nFrequency / 32); m_sQueueSample.m_nReleasingVolumeModificator = 3; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; m_sQueueSample.m_bRequireReflection = TRUE; break; } @@ -3027,7 +3029,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams& params) m_sQueueSample.m_nFrequency += RandomDisplacement(m_sQueueSample.m_nFrequency / 32); m_sQueueSample.m_nReleasingVolumeModificator = 3; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; m_sQueueSample.m_bRequireReflection = TRUE; break; } @@ -3041,7 +3043,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams& params) m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_GLASS_CRACK); m_sQueueSample.m_nReleasingVolumeModificator = 5; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; } break; case SOUND_CAR_JUMP: case SOUND_CAR_JUMP_2: { @@ -3069,7 +3071,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams& params) m_sQueueSample.m_nFrequency *= 2; m_sQueueSample.m_nReleasingVolumeModificator = 6; m_sQueueSample.m_fSpeedMultiplier = 2.0f; - m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; break; } case SOUND_CAR_TYRE_POP: { @@ -3084,7 +3086,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams& params) m_sQueueSample.m_nFrequency += RandomDisplacement(2000); m_sQueueSample.m_nReleasingVolumeModificator = 2; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; maxDist = SQR(SOUND_INTENSITY); emittingVol = m_anRandomTable[4] % 10 + 117; break; @@ -3102,7 +3104,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams& params) m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_CAR_STARTER); m_sQueueSample.m_nReleasingVolumeModificator = 1; m_sQueueSample.m_fSpeedMultiplier = 2.0f; - m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; m_sQueueSample.m_bRequireReflection = TRUE; break; } @@ -3115,7 +3117,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams& params) m_sQueueSample.m_nFrequency += RandomDisplacement(m_sQueueSample.m_nFrequency / 8); m_sQueueSample.m_nReleasingVolumeModificator = 5; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; maxDist = SQR(SOUND_INTENSITY); emittingVol = m_anRandomTable[4] % 10 + 30; break; @@ -3133,7 +3135,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams& params) m_sQueueSample.m_nFrequency += RandomDisplacement(m_sQueueSample.m_nFrequency / 8); m_sQueueSample.m_nReleasingVolumeModificator = 5; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; maxDist = SQR(SOUND_INTENSITY); emittingVol = m_anRandomTable[0] % 15 + 55; break; @@ -3146,7 +3148,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams& params) m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_SUSPENSION_SLOW_MOVE_LOOP); m_sQueueSample.m_nReleasingVolumeModificator = 5; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; m_sQueueSample.m_nReleasingVolumeDivider = 7; noReflections = TRUE; maxDist = SQR(SOUND_INTENSITY); @@ -3162,7 +3164,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams& params) m_sQueueSample.m_nFrequency += RandomDisplacement(m_sQueueSample.m_nFrequency / 8); m_sQueueSample.m_nReleasingVolumeModificator = 5; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; maxDist = SQR(SOUND_INTENSITY); emittingVol = m_anRandomTable[1] % 15 + 55; break; @@ -3184,7 +3186,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams& params) m_sQueueSample.m_nFrequency = (7000.0f * relVol) + 6000; m_sQueueSample.m_nReleasingVolumeModificator = 3; m_sQueueSample.m_fSpeedMultiplier = 2.0f; - m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; emittingVol = (35.0f * relVol); maxDist = SQR(SOUND_INTENSITY); break; @@ -3212,7 +3214,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams& params) m_sQueueSample.m_nFrequency = RandomDisplacement(1000) + 11025; m_sQueueSample.m_nReleasingVolumeModificator = 5; m_sQueueSample.m_fSpeedMultiplier = 5.0f; - m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; maxDist = SQR(SOUND_INTENSITY); emittingVol = m_anRandomTable[1] % 20 + 70; break; @@ -3230,7 +3232,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams& params) m_sQueueSample.m_nReleasingVolumeModificator = 2; m_sQueueSample.m_fSpeedMultiplier = 2.0f; m_sQueueSample.m_nReleasingVolumeDivider = 3; - m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; emittingVol = (37.0f * vol * 625.0f / 24.0f) + 90; maxDist = SQR(SOUND_INTENSITY); noReflections = TRUE; @@ -3244,7 +3246,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams& params) m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_BOMB_BEEP); m_sQueueSample.m_nReleasingVolumeModificator = 3; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; maxDist = SQR(SOUND_INTENSITY); m_sQueueSample.m_bRequireReflection = TRUE; emittingVol = 60; @@ -3258,7 +3260,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams& params) m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_JUMBO_LAND_WHEELS); m_sQueueSample.m_nReleasingVolumeModificator = 2; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; maxDist = SQR(SOUND_INTENSITY); emittingVol = m_anRandomTable[4] % 25 + 75; break; @@ -3280,7 +3282,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams& params) m_sQueueSample.m_nFrequency += RandomDisplacement(m_sQueueSample.m_nFrequency / 32); m_sQueueSample.m_nReleasingVolumeModificator = 2; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; break; } case SOUND_WEAPON_SHOT_FIRED: { @@ -3327,7 +3329,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams& params) m_sQueueSample.m_nFrequency += RandomDisplacement(m_sQueueSample.m_nFrequency / 16); m_sQueueSample.m_nReleasingVolumeModificator = 2; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; m_sQueueSample.m_bRequireReflection = TRUE; isHeli = TRUE; break; @@ -3381,7 +3383,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams& params) #endif m_sQueueSample.m_nReleasingVolumeModificator = 3; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; m_sQueueSample.m_bRequireReflection = TRUE; break; } @@ -3397,7 +3399,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams& params) m_sQueueSample.m_nFrequency += RandomDisplacement(m_sQueueSample.m_nFrequency / 32); m_sQueueSample.m_nReleasingVolumeModificator = 7; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; maxDist = SQR(SOUND_INTENSITY); emittingVol = m_anRandomTable[3] % 20 + 90; break; @@ -3413,7 +3415,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams& params) m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_ARM_BOMB); m_sQueueSample.m_nReleasingVolumeModificator = 0; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; m_sQueueSample.m_bRequireReflection = TRUE; emittingVol = 50; maxDist = SQR(SOUND_INTENSITY); @@ -3453,7 +3455,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams& params) m_sQueueSample.m_nFrequency = RandomDisplacement(1000) + 16000; m_sQueueSample.m_nReleasingVolumeModificator = 1; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; maxDist = SQR(SOUND_INTENSITY); m_sQueueSample.m_bRequireReflection = TRUE; emittingVol = m_anRandomTable[4] % 20 + 90; @@ -3468,7 +3470,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams& params) m_sQueueSample.m_nFrequency = RandomDisplacement(6000) + 16000; m_sQueueSample.m_nReleasingVolumeModificator = 1; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; ++CrunchOffset; maxDist = SQR(SOUND_INTENSITY); emittingVol = m_anRandomTable[4] % 20 + 55; @@ -3490,7 +3492,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams& params) m_sQueueSample.m_nFrequency += RandomDisplacement(m_sQueueSample.m_nFrequency / 16); m_sQueueSample.m_nReleasingVolumeModificator = 1; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; maxDist = SQR(SOUND_INTENSITY); break; } @@ -3499,7 +3501,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_fSoundIntensity, m_sQueueSample.m_fDistance); + m_sQueueSample.m_nVolume = ComputeVolume(emittingVol, m_sQueueSample.m_SoundIntensity, m_sQueueSample.m_fDistance); if (m_sQueueSample.m_nVolume != 0) { if (noReflections) { m_sQueueSample.m_nLoopCount = 0; @@ -3512,7 +3514,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams& params) SET_EMITTING_VOLUME(emittingVol); m_sQueueSample.m_bReverbFlag = TRUE; if (isHeli) { - if (0.2f * m_sQueueSample.m_fSoundIntensity > m_sQueueSample.m_fDistance) { + if (0.2f * m_sQueueSample.m_SoundIntensity > m_sQueueSample.m_fDistance) { m_sQueueSample.m_bIs2D = TRUE; m_sQueueSample.m_nOffset = 0; #ifdef THIS_IS_STUPID @@ -3585,7 +3587,7 @@ cAudioManager::ProcessTrainNoise(cVehicleParams& params) SET_EMITTING_VOLUME(emittingVol); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 3.0f; - m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_nReleasingVolumeDivider = 3; m_sQueueSample.m_bReverbFlag = TRUE; @@ -3607,7 +3609,7 @@ cAudioManager::ProcessTrainNoise(cVehicleParams& params) SET_EMITTING_VOLUME(emittingVol); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 6.0f; - m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_nReleasingVolumeDivider = 3; m_sQueueSample.m_bReverbFlag = TRUE; @@ -3729,7 +3731,7 @@ cAudioManager::ProcessBoatEngine(cVehicleParams& params) SET_EMITTING_VOLUME(Vol); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 2.0f; - m_sQueueSample.m_fSoundIntensity = intensity; + m_sQueueSample.m_SoundIntensity = intensity; m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_nReleasingVolumeDivider = 7; m_sQueueSample.m_bReverbFlag = TRUE; @@ -3753,7 +3755,7 @@ cAudioManager::ProcessBoatEngine(cVehicleParams& params) SET_EMITTING_VOLUME(80); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 2.0f; - m_sQueueSample.m_fSoundIntensity = intensity; + m_sQueueSample.m_SoundIntensity = intensity; m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_nReleasingVolumeDivider = 7; m_sQueueSample.m_bReverbFlag = TRUE; @@ -3800,7 +3802,7 @@ cAudioManager::ProcessBoatMovingOverWater(cVehicleParams& params) SET_EMITTING_VOLUME(vol); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 2.0f; - m_sQueueSample.m_fSoundIntensity = 50.0f; + m_sQueueSample.m_SoundIntensity = 50.0f; m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_nReleasingVolumeDivider = 6; m_sQueueSample.m_bReverbFlag = TRUE; @@ -3967,7 +3969,7 @@ cAudioManager::SetupJumboTaxiSound(uint8 vol) SET_EMITTING_VOLUME(emittingVol); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 4.0f; - m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_nReleasingVolumeDivider = 4; m_sQueueSample.m_bReverbFlag = TRUE; @@ -3998,7 +4000,7 @@ cAudioManager::SetupJumboWhineSound(uint8 emittingVol, uint32 freq) SET_EMITTING_VOLUME(emittingVol); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 4.0f; - m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_nReleasingVolumeDivider = 4; m_sQueueSample.m_bReverbFlag = TRUE; @@ -4028,7 +4030,7 @@ cAudioManager::SetupJumboEngineSound(uint8 vol, uint32 freq) SET_EMITTING_VOLUME(emittingVol); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 4.0f; - m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_nReleasingVolumeDivider = 4; m_sQueueSample.m_bReverbFlag = TRUE; @@ -4057,7 +4059,7 @@ cAudioManager::SetupJumboFlySound(uint8 emittingVol) SET_EMITTING_VOLUME(emittingVol); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 4.0f; - m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_nReleasingVolumeDivider = 5; m_sQueueSample.m_bReverbFlag = TRUE; @@ -4087,7 +4089,7 @@ cAudioManager::SetupJumboRumbleSound(uint8 emittingVol) SET_EMITTING_VOLUME(emittingVol); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 4.0f; - m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_nReleasingVolumeDivider = 12; m_sQueueSample.m_nOffset = 0; @@ -4220,7 +4222,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) } m_sQueueSample.m_nReleasingVolumeModificator = 5; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_fSoundIntensity = 20.0f; + m_sQueueSample.m_SoundIntensity = 20.0f; m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS SET_EMITTING_VOLUME(emittingVol); @@ -4247,7 +4249,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_nFrequency += RandomDisplacement(m_sQueueSample.m_nFrequency / 17); m_sQueueSample.m_nReleasingVolumeModificator = 2; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_fSoundIntensity = 30.0f; + m_sQueueSample.m_SoundIntensity = 30.0f; m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS SET_EMITTING_VOLUME(emittingVol); @@ -4340,7 +4342,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) ++iSound; m_sQueueSample.m_nReleasingVolumeModificator = 3; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_fSoundIntensity = 30.0f; + m_sQueueSample.m_SoundIntensity = 30.0f; maxDist = SQR(30); m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS @@ -4395,7 +4397,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) narrowSoundRange = TRUE; m_sQueueSample.m_nReleasingVolumeModificator = 3; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_fSoundIntensity = 30.0f; + m_sQueueSample.m_SoundIntensity = 30.0f; maxDist = SQR(30); m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS @@ -4419,7 +4421,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_nFrequency = 27000; m_sQueueSample.m_nReleasingVolumeModificator = 3; m_sQueueSample.m_fSpeedMultiplier = 3.0f; - m_sQueueSample.m_fSoundIntensity = 50.0f; + m_sQueueSample.m_SoundIntensity = 50.0f; maxDist = SQR(50); m_sQueueSample.m_nLoopCount = 0; emittingVol = 100; @@ -4442,7 +4444,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_nFrequency = 27000; m_sQueueSample.m_nReleasingVolumeModificator = 2; m_sQueueSample.m_fSpeedMultiplier = 3.0f; - m_sQueueSample.m_fSoundIntensity = 60.0f; + m_sQueueSample.m_SoundIntensity = 60.0f; maxDist = SQR(60); m_sQueueSample.m_nLoopCount = 0; emittingVol = 100; @@ -4467,7 +4469,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_nFrequency = RandomDisplacement(500) + 22000; m_sQueueSample.m_nReleasingVolumeModificator = 2; m_sQueueSample.m_fSpeedMultiplier = 3.0f; - m_sQueueSample.m_fSoundIntensity = 60.0f; + m_sQueueSample.m_SoundIntensity = 60.0f; maxDist = SQR(60); m_sQueueSample.m_nLoopCount = 0; emittingVol = 100; @@ -4492,7 +4494,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_nFrequency += RandomDisplacement(m_sQueueSample.m_nFrequency / 32); m_sQueueSample.m_nReleasingVolumeModificator = 1; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_fSoundIntensity = 120.0f; + m_sQueueSample.m_SoundIntensity = 120.0f; maxDist = SQR(120); m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS @@ -4512,7 +4514,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_nFrequency += RandomDisplacement(m_sQueueSample.m_nFrequency / 32); m_sQueueSample.m_nReleasingVolumeModificator = 3; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_fSoundIntensity = 120.0f; + m_sQueueSample.m_SoundIntensity = 120.0f; maxDist = SQR(120); m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS @@ -4532,7 +4534,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_nFrequency += RandomDisplacement(m_sQueueSample.m_nFrequency / 32); m_sQueueSample.m_nReleasingVolumeModificator = 3; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_fSoundIntensity = 120.0f; + m_sQueueSample.m_SoundIntensity = 120.0f; maxDist = SQR(120); m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS @@ -4553,7 +4555,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_nFrequency += RandomDisplacement(m_sQueueSample.m_nFrequency / 32); m_sQueueSample.m_nReleasingVolumeModificator = 3; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_fSoundIntensity = 120.0f; + m_sQueueSample.m_SoundIntensity = 120.0f; maxDist = SQR(120); m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS @@ -4573,7 +4575,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_nFrequency += RandomDisplacement(m_sQueueSample.m_nFrequency / 32); m_sQueueSample.m_nReleasingVolumeModificator = 3; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_fSoundIntensity = 120.0f; + m_sQueueSample.m_SoundIntensity = 120.0f; maxDist = SQR(120); m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS @@ -4592,7 +4594,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_nFrequency = RandomDisplacement(500) + 17000; m_sQueueSample.m_nReleasingVolumeModificator = 3; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_fSoundIntensity = 120.0f; + m_sQueueSample.m_SoundIntensity = 120.0f; maxDist = SQR(120); m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS @@ -4612,7 +4614,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_nFrequency += RandomDisplacement(m_sQueueSample.m_nFrequency / 32); m_sQueueSample.m_nReleasingVolumeModificator = 3; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_fSoundIntensity = 120.0f; + m_sQueueSample.m_SoundIntensity = 120.0f; maxDist = SQR(120); m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS @@ -4630,7 +4632,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_nFrequency = RandomDisplacement(1000) + 34000; m_sQueueSample.m_nReleasingVolumeModificator = 3; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_fSoundIntensity = 120.0f; + m_sQueueSample.m_SoundIntensity = 120.0f; maxDist = SQR(120); m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS @@ -4649,7 +4651,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_nFrequency += RandomDisplacement(m_sQueueSample.m_nFrequency / 32); m_sQueueSample.m_nReleasingVolumeModificator = 3; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_fSoundIntensity = 120.0f; + m_sQueueSample.m_SoundIntensity = 120.0f; maxDist = SQR(120); m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS @@ -4667,7 +4669,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_nFrequency = RandomDisplacement(1000) + 43150; m_sQueueSample.m_nReleasingVolumeModificator = 3; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_fSoundIntensity = 120.0f; + m_sQueueSample.m_SoundIntensity = 120.0f; maxDist = SQR(120); m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS @@ -4686,7 +4688,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_nFrequency += RandomDisplacement(m_sQueueSample.m_nFrequency / 32); m_sQueueSample.m_nReleasingVolumeModificator = 3; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_fSoundIntensity = 120.0f; + m_sQueueSample.m_SoundIntensity = 120.0f; maxDist = SQR(120); m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS @@ -4709,7 +4711,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_nFrequency += RandomDisplacement(m_sQueueSample.m_nFrequency / 32); m_sQueueSample.m_nReleasingVolumeModificator = 3; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_fSoundIntensity = 120.0f; + m_sQueueSample.m_SoundIntensity = 120.0f; maxDist = SQR(120); m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS @@ -4728,7 +4730,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_nFrequency = (10 * m_sQueueSample.m_nEntityIndex & 2047) + SampleManager.GetSampleBaseFrequency(SFX_FLAMETHROWER_LEFT); m_sQueueSample.m_nReleasingVolumeModificator = 3; m_sQueueSample.m_fSpeedMultiplier = 4.0f; - m_sQueueSample.m_fSoundIntensity = 60.0f; + m_sQueueSample.m_SoundIntensity = 60.0f; maxDist = SQR(60); m_sQueueSample.m_nLoopCount = 0; SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) @@ -4748,7 +4750,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_nFrequency += RandomDisplacement(m_sQueueSample.m_nFrequency / 32); m_sQueueSample.m_nReleasingVolumeModificator = 3; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_fSoundIntensity = 120.0f; + m_sQueueSample.m_SoundIntensity = 120.0f; maxDist = SQR(120); m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS @@ -4806,7 +4808,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_nReleasingVolumeModificator = 5; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_fSoundIntensity = 30.0f; + m_sQueueSample.m_SoundIntensity = 30.0f; maxDist = SQR(30); m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS @@ -4869,7 +4871,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_nFrequency += RandomDisplacement(m_sQueueSample.m_nFrequency / 16); m_sQueueSample.m_nReleasingVolumeModificator = 3; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_fSoundIntensity = 120.0f; + m_sQueueSample.m_SoundIntensity = 120.0f; maxDist = SQR(120); m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS @@ -4888,7 +4890,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_nFrequency += RandomDisplacement(m_sQueueSample.m_nFrequency / 16); m_sQueueSample.m_nReleasingVolumeModificator = 3; m_sQueueSample.m_fSpeedMultiplier = 4.0f; - m_sQueueSample.m_fSoundIntensity = 60.0f; + m_sQueueSample.m_SoundIntensity = 60.0f; maxDist = SQR(60); m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS @@ -4906,7 +4908,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_nFrequency += RandomDisplacement(m_sQueueSample.m_nFrequency / 8); m_sQueueSample.m_nReleasingVolumeModificator = 7; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_fSoundIntensity = 30.0f; + m_sQueueSample.m_SoundIntensity = 30.0f; maxDist = SQR(30); m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS @@ -4926,7 +4928,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_nFrequency = RandomDisplacement(1400) + 20000; m_sQueueSample.m_nReleasingVolumeModificator = 1; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_fSoundIntensity = 40.0f; + m_sQueueSample.m_SoundIntensity = 40.0f; maxDist = SQR(40); m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS @@ -4959,7 +4961,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_nFrequency += RandomDisplacement(m_sQueueSample.m_nFrequency / 16); m_sQueueSample.m_nReleasingVolumeModificator = 3; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_fSoundIntensity = 30.0f; + m_sQueueSample.m_SoundIntensity = 30.0f; if (weaponType == WEAPONTYPE_UNARMED || weaponType == WEAPONTYPE_BRASSKNUCKLE) emittingVol = m_anRandomTable[1] % 10 + 35; else @@ -4988,7 +4990,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_nFrequency = (3 * m_sQueueSample.m_nFrequency) / 4; m_sQueueSample.m_nReleasingVolumeModificator = 6; m_sQueueSample.m_fSpeedMultiplier = 3.0f; - m_sQueueSample.m_fSoundIntensity = 20.0f; + m_sQueueSample.m_SoundIntensity = 20.0f; maxDist = SQR(20); m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS @@ -5006,7 +5008,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_MINIGUN_FIRE_LEFT); m_sQueueSample.m_nReleasingVolumeModificator = 2; m_sQueueSample.m_fSpeedMultiplier = 3.0f; - m_sQueueSample.m_fSoundIntensity = 150.0f; + m_sQueueSample.m_SoundIntensity = 150.0f; emittingVol = 127; maxDist = SQR(150); m_sQueueSample.m_nLoopCount = 0; @@ -5023,7 +5025,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_nFrequency = 18569; m_sQueueSample.m_nReleasingVolumeModificator = 2; m_sQueueSample.m_fSpeedMultiplier = 3.0f; - m_sQueueSample.m_fSoundIntensity = 150.0f; + m_sQueueSample.m_SoundIntensity = 150.0f; emittingVol = 127.0f * m_asAudioEntities[m_sQueueSample.m_nEntityIndex].m_afVolume[i]; maxDist = SQR(150); m_sQueueSample.m_nLoopCount = 0; @@ -5040,7 +5042,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_MINIGUN_STOP); m_sQueueSample.m_nReleasingVolumeModificator = 4; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_fSoundIntensity = 150.0f; + m_sQueueSample.m_SoundIntensity = 150.0f; maxDist = SQR(150); m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS @@ -5083,7 +5085,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_nReleasingVolumeModificator = 3; m_sQueueSample.m_fSpeedMultiplier = 3.0f; - m_sQueueSample.m_fSoundIntensity = 15.0f; + m_sQueueSample.m_SoundIntensity = 15.0f; maxDist = SQR(15); m_sQueueSample.m_nLoopCount = 0; SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) @@ -5103,10 +5105,10 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) iSound = 21; if (params.m_fDistance < maxDist) { CalculateDistance(params.m_bDistanceCalculated, params.m_fDistance); - m_sQueueSample.m_nVolume = ComputeVolume(emittingVol, m_sQueueSample.m_fSoundIntensity, m_sQueueSample.m_fDistance); + m_sQueueSample.m_nVolume = ComputeVolume(emittingVol, m_sQueueSample.m_SoundIntensity, m_sQueueSample.m_fDistance); if (m_sQueueSample.m_nVolume != 0) { if (stereo) { - if (m_sQueueSample.m_fDistance < 0.2f * m_sQueueSample.m_fSoundIntensity) { + if (m_sQueueSample.m_fDistance < 0.2f * m_sQueueSample.m_SoundIntensity) { m_sQueueSample.m_bIs2D = TRUE; m_sQueueSample.m_nOffset = 0; } else { @@ -7906,7 +7908,7 @@ cPedComments::Process() AudioManager.m_sQueueSample.m_nEmittingVolume = MAX_VOLUME; #endif AudioManager.m_sQueueSample.m_fSpeedMultiplier = 3.0f; - AudioManager.m_sQueueSample.m_fSoundIntensity = 40.0f; + AudioManager.m_sQueueSample.m_SoundIntensity = 40.0f; 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; @@ -7980,7 +7982,7 @@ cAudioManager::ProcessExplosions(int32 explosion) case EXPLOSION_ROCKET: case EXPLOSION_BARREL: case EXPLOSION_TANK_GRENADE: - m_sQueueSample.m_fSoundIntensity = 200.0f; + m_sQueueSample.m_SoundIntensity = 200.0f; m_sQueueSample.m_nSampleIndex = SFX_EXPLOSION_2; m_sQueueSample.m_nFrequency = RandomDisplacement(1000) + 19000; m_sQueueSample.m_nReleasingVolumeModificator = 0; @@ -7988,7 +7990,7 @@ cAudioManager::ProcessExplosions(int32 explosion) m_sQueueSample.m_bRequireReflection = TRUE; break; case EXPLOSION_MOLOTOV: - m_sQueueSample.m_fSoundIntensity = 150.0f; + m_sQueueSample.m_SoundIntensity = 150.0f; m_sQueueSample.m_nSampleIndex = SFX_EXPLOSION_3; m_sQueueSample.m_nFrequency = RandomDisplacement(1000) + 19000; m_sQueueSample.m_nReleasingVolumeModificator = 0; @@ -7997,7 +7999,7 @@ cAudioManager::ProcessExplosions(int32 explosion) break; case EXPLOSION_MINE: case EXPLOSION_HELI_BOMB: - m_sQueueSample.m_fSoundIntensity = 200.0f; + m_sQueueSample.m_SoundIntensity = 200.0f; m_sQueueSample.m_nSampleIndex = SFX_ROCKET_LEFT; m_sQueueSample.m_nFrequency = RandomDisplacement(1000) + 12347; m_sQueueSample.m_nReleasingVolumeModificator = 0; @@ -8005,7 +8007,7 @@ cAudioManager::ProcessExplosions(int32 explosion) m_sQueueSample.m_bRequireReflection = TRUE; break; default: - m_sQueueSample.m_fSoundIntensity = 200.0f; + m_sQueueSample.m_SoundIntensity = 200.0f; m_sQueueSample.m_nSampleIndex = SFX_EXPLOSION_1; m_sQueueSample.m_nFrequency = RandomDisplacement(1000) + 19500; if (type == EXPLOSION_HELI) @@ -8016,9 +8018,9 @@ cAudioManager::ProcessExplosions(int32 explosion) } m_sQueueSample.m_vecPos = *CExplosion::GetExplosionPosition(i); distSquared = GetDistanceSquared(m_sQueueSample.m_vecPos); - if (distSquared < SQR(m_sQueueSample.m_fSoundIntensity)) { + if (distSquared < SQR(m_sQueueSample.m_SoundIntensity)) { m_sQueueSample.m_fDistance = Sqrt(distSquared); - m_sQueueSample.m_nVolume = ComputeVolume(MAX_VOLUME, m_sQueueSample.m_fSoundIntensity, m_sQueueSample.m_fDistance); + m_sQueueSample.m_nVolume = ComputeVolume(MAX_VOLUME, m_sQueueSample.m_SoundIntensity, m_sQueueSample.m_fDistance); if (m_sQueueSample.m_nVolume != 0) { m_sQueueSample.m_nCounter = i; m_sQueueSample.m_fSpeedMultiplier = 2.0f; @@ -8048,7 +8050,7 @@ cAudioManager::ProcessFires(int32) if (entity) { switch (entity->GetType()) { case ENTITY_TYPE_BUILDING: - m_sQueueSample.m_fSoundIntensity = 80.0f; + m_sQueueSample.m_SoundIntensity = 80.0f; m_sQueueSample.m_nSampleIndex = SFX_CAR_ON_FIRE; emittingVol = 100; m_sQueueSample.m_nFrequency = 8 * SampleManager.GetSampleBaseFrequency(SFX_CAR_ON_FIRE) / 10; @@ -8056,7 +8058,7 @@ cAudioManager::ProcessFires(int32) m_sQueueSample.m_nReleasingVolumeModificator = 6; break; case ENTITY_TYPE_PED: - m_sQueueSample.m_fSoundIntensity = 25.0f; + m_sQueueSample.m_SoundIntensity = 25.0f; m_sQueueSample.m_nSampleIndex = SFX_PED_ON_FIRE; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_PED_ON_FIRE); emittingVol = 60; @@ -8064,7 +8066,7 @@ cAudioManager::ProcessFires(int32) m_sQueueSample.m_nReleasingVolumeModificator = 10; break; default: - m_sQueueSample.m_fSoundIntensity = 80.0f; + m_sQueueSample.m_SoundIntensity = 80.0f; m_sQueueSample.m_nSampleIndex = SFX_CAR_ON_FIRE; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_CAR_ON_FIRE); m_sQueueSample.m_nFrequency += i * (m_sQueueSample.m_nFrequency / 64); @@ -8072,7 +8074,7 @@ cAudioManager::ProcessFires(int32) m_sQueueSample.m_nReleasingVolumeModificator = 8; } } else { - m_sQueueSample.m_fSoundIntensity = 80.0f; + m_sQueueSample.m_SoundIntensity = 80.0f; m_sQueueSample.m_nSampleIndex = SFX_CAR_ON_FIRE; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_CAR_ON_FIRE); emittingVol = 80; @@ -8080,9 +8082,9 @@ cAudioManager::ProcessFires(int32) } m_sQueueSample.m_vecPos = gFireManager.m_aFires[i].m_vecPos; distSquared = GetDistanceSquared(m_sQueueSample.m_vecPos); - if (distSquared < SQR(m_sQueueSample.m_fSoundIntensity)) { + if (distSquared < SQR(m_sQueueSample.m_SoundIntensity)) { m_sQueueSample.m_fDistance = Sqrt(distSquared); - m_sQueueSample.m_nVolume = ComputeVolume(emittingVol, m_sQueueSample.m_fSoundIntensity, m_sQueueSample.m_fDistance); + m_sQueueSample.m_nVolume = ComputeVolume(emittingVol, m_sQueueSample.m_SoundIntensity, m_sQueueSample.m_fDistance); if (m_sQueueSample.m_nVolume != 0) { m_sQueueSample.m_nCounter = i; m_sQueueSample.m_nBankIndex = SFX_BANK_0; @@ -8101,7 +8103,7 @@ cAudioManager::ProcessFires(int32) if (gFireManager.m_aFires[i].m_bExtinguishedWithWater) { 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_fSoundIntensity, m_sQueueSample.m_fDistance); + m_sQueueSample.m_nVolume = ComputeVolume(emittingVol, m_sQueueSample.m_SoundIntensity, m_sQueueSample.m_fDistance); if (m_sQueueSample.m_nVolume != 0) { m_sQueueSample.m_nSampleIndex = SFX_JUMBO_TAXI; m_sQueueSample.m_nFrequency = 19591; @@ -8138,7 +8140,7 @@ cAudioManager::ProcessWaterCannon(int32) m_sQueueSample.m_fDistance = Sqrt(distSquared); m_sQueueSample.m_nVolume = ComputeVolume(50, SOUND_INTENSITY, m_sQueueSample.m_fDistance); if (m_sQueueSample.m_nVolume != 0) { - m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; m_sQueueSample.m_nSampleIndex = SFX_JUMBO_TAXI; m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_nFrequency = 15591; @@ -8190,7 +8192,7 @@ cAudioManager::ProcessOneShotScriptObject(uint8 sound) switch (sound) { case SCRIPT_SOUND_POLICE_CELL_DOOR_CLUNK: - m_sQueueSample.m_fSoundIntensity = 40.0f; + m_sQueueSample.m_SoundIntensity = 40.0f; m_sQueueSample.m_nSampleIndex = SFX_COL_GATE; m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_nFrequency = 10600; @@ -8202,7 +8204,7 @@ cAudioManager::ProcessOneShotScriptObject(uint8 sound) m_sQueueSample.m_bRequireReflection = TRUE; break; case SCRIPT_SOUND_GARAGE_DOOR_CLUNK: - m_sQueueSample.m_fSoundIntensity = 80.0f; + m_sQueueSample.m_SoundIntensity = 80.0f; m_sQueueSample.m_nSampleIndex = SFX_COL_CAR_PANEL_2; // huh? m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_nFrequency = 22000; @@ -8217,7 +8219,7 @@ cAudioManager::ProcessOneShotScriptObject(uint8 sound) case SCRIPT_SOUND_BULLET_HIT_GROUND_1: case SCRIPT_SOUND_BULLET_HIT_GROUND_2: case SCRIPT_SOUND_BULLET_HIT_GROUND_3: - m_sQueueSample.m_fSoundIntensity = 50.0f; + m_sQueueSample.m_SoundIntensity = 50.0f; m_sQueueSample.m_nSampleIndex = m_anRandomTable[iSound % 5] % 3 + SFX_BULLET_WALL_1; m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex); @@ -8229,7 +8231,7 @@ cAudioManager::ProcessOneShotScriptObject(uint8 sound) break; case SCRIPT_SOUND_WILLIE_CARD_SWIPE: emittingVolume = 70; - m_sQueueSample.m_fSoundIntensity = 40.0f; + m_sQueueSample.m_SoundIntensity = 40.0f; m_sQueueSample.m_nSampleIndex = SFX_BOMB_BEEP; m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_nFrequency = 20159; @@ -8253,7 +8255,7 @@ cAudioManager::ProcessOneShotScriptObject(uint8 sound) return; } case SCRIPT_SOUND_SEAPLANE_LOW_FUEL: - m_sQueueSample.m_fSoundIntensity = 1000.0f; + m_sQueueSample.m_SoundIntensity = 1000.0f; m_sQueueSample.m_nSampleIndex = SFX_SEAPLANE_LOW; m_sQueueSample.m_nBankIndex = SFX_BANK_0; emittingVolume = 100; @@ -8264,7 +8266,7 @@ cAudioManager::ProcessOneShotScriptObject(uint8 sound) m_sQueueSample.m_bRequireReflection = FALSE; break; case SCRIPT_SOUND_PAYPHONE_RINGING: - m_sQueueSample.m_fSoundIntensity = 80.0f; + m_sQueueSample.m_SoundIntensity = 80.0f; m_sQueueSample.m_nSampleIndex = SFX_PHONE_RING; m_sQueueSample.m_nBankIndex = SFX_BANK_0; emittingVolume = 80; @@ -8275,7 +8277,7 @@ cAudioManager::ProcessOneShotScriptObject(uint8 sound) m_sQueueSample.m_bRequireReflection = FALSE; break; case SCRIPT_SOUND_GLASS_BREAK_L: - m_sQueueSample.m_fSoundIntensity = 60.0f; + m_sQueueSample.m_SoundIntensity = 60.0f; m_sQueueSample.m_nSampleIndex = SFX_GLASS_SMASH; m_sQueueSample.m_nBankIndex = SFX_BANK_0; emittingVolume = 70; @@ -8285,7 +8287,7 @@ cAudioManager::ProcessOneShotScriptObject(uint8 sound) m_sQueueSample.m_bIs2D = FALSE; break; case SCRIPT_SOUND_GLASS_BREAK_S: - m_sQueueSample.m_fSoundIntensity = 60.0f; + m_sQueueSample.m_SoundIntensity = 60.0f; m_sQueueSample.m_nSampleIndex = SFX_GLASS_SMASH; m_sQueueSample.m_nBankIndex = SFX_BANK_0; emittingVolume = 60; @@ -8295,7 +8297,7 @@ cAudioManager::ProcessOneShotScriptObject(uint8 sound) m_sQueueSample.m_bIs2D = FALSE; break; case SCRIPT_SOUND_GLASS_CRACK: - m_sQueueSample.m_fSoundIntensity = 60.0f; + m_sQueueSample.m_SoundIntensity = 60.0f; m_sQueueSample.m_nSampleIndex = SFX_GLASS_CRACK; m_sQueueSample.m_nBankIndex = SFX_BANK_0; emittingVolume = 70; @@ -8306,7 +8308,7 @@ cAudioManager::ProcessOneShotScriptObject(uint8 sound) m_sQueueSample.m_bRequireReflection = TRUE; break; case SCRIPT_SOUND_GLASS_LIGHT_BREAK: - m_sQueueSample.m_fSoundIntensity = 55.0f; + m_sQueueSample.m_SoundIntensity = 55.0f; m_sQueueSample.m_nSampleIndex = (m_anRandomTable[4] & 3) + SFX_GLASS_SHARD_1; m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_nFrequency = RandomDisplacement(2000) + 19000; @@ -8316,7 +8318,7 @@ cAudioManager::ProcessOneShotScriptObject(uint8 sound) emittingVolume = RandomDisplacement(11) + 25; break; case SCRIPT_SOUND_BOX_DESTROYED_1: - m_sQueueSample.m_fSoundIntensity = 60.0f; + m_sQueueSample.m_SoundIntensity = 60.0f; m_sQueueSample.m_nSampleIndex = SFX_WOODEN_BOX_SMASH; m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_nFrequency = RandomDisplacement(1500) + 18600; @@ -8327,7 +8329,7 @@ cAudioManager::ProcessOneShotScriptObject(uint8 sound) emittingVolume = m_anRandomTable[2] % 20 + 80; break; case SCRIPT_SOUND_BOX_DESTROYED_2: - m_sQueueSample.m_fSoundIntensity = 60.0f; + m_sQueueSample.m_SoundIntensity = 60.0f; m_sQueueSample.m_nSampleIndex = SFX_CARDBOARD_BOX_SMASH; m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_nFrequency = RandomDisplacement(1500) + 18600; @@ -8338,7 +8340,7 @@ cAudioManager::ProcessOneShotScriptObject(uint8 sound) emittingVolume = m_anRandomTable[2] % 20 + 80; break; case SCRIPT_SOUND_METAL_COLLISION: - m_sQueueSample.m_fSoundIntensity = 60.0f; + m_sQueueSample.m_SoundIntensity = 60.0f; m_sQueueSample.m_nSampleIndex = m_anRandomTable[3] % 5 + SFX_COL_CAR_1; m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex); @@ -8350,7 +8352,7 @@ cAudioManager::ProcessOneShotScriptObject(uint8 sound) emittingVolume = m_anRandomTable[2] % 30 + 70; break; case SCRIPT_SOUND_TIRE_COLLISION: - m_sQueueSample.m_fSoundIntensity = 60.0f; + m_sQueueSample.m_SoundIntensity = 60.0f; m_sQueueSample.m_nSampleIndex = SFX_TYRE_BUMP; m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex); @@ -8362,7 +8364,7 @@ cAudioManager::ProcessOneShotScriptObject(uint8 sound) emittingVolume = m_anRandomTable[2] % 30 + 60; break; case SCRIPT_SOUND_HIT_BALL: - m_sQueueSample.m_fSoundIntensity = 60.0f; + m_sQueueSample.m_SoundIntensity = 60.0f; m_sQueueSample.m_nSampleIndex = SFX_HIT_BALL; m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex); @@ -8403,7 +8405,7 @@ cAudioManager::ProcessOneShotScriptObject(uint8 sound) m_sQueueSample.m_nFrequency = RandomDisplacement(1500) + 30000; m_sQueueSample.m_nReleasingVolumeModificator = 15; } - m_sQueueSample.m_fSoundIntensity = 20.0f; + m_sQueueSample.m_SoundIntensity = 20.0f; m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_fSpeedMultiplier = 0.0f; m_sQueueSample.m_bIs2D = FALSE; @@ -8413,7 +8415,7 @@ cAudioManager::ProcessOneShotScriptObject(uint8 sound) m_sQueueSample.m_nSampleIndex = SFX_BULLET_SHELL_HIT_GROUND_2; m_sQueueSample.m_nFrequency = RandomDisplacement(500) + 11000; m_sQueueSample.m_nReleasingVolumeModificator = 18; - m_sQueueSample.m_fSoundIntensity = 20.0f; + m_sQueueSample.m_SoundIntensity = 20.0f; m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_fSpeedMultiplier = 0.0f; m_sQueueSample.m_bIs2D = FALSE; @@ -8424,9 +8426,9 @@ cAudioManager::ProcessOneShotScriptObject(uint8 sound) } distSquared = GetDistanceSquared(m_sQueueSample.m_vecPos); - if (distSquared < SQR(m_sQueueSample.m_fSoundIntensity)) { + if (distSquared < SQR(m_sQueueSample.m_SoundIntensity)) { m_sQueueSample.m_fDistance = Sqrt(distSquared); - m_sQueueSample.m_nVolume = ComputeVolume(emittingVolume, m_sQueueSample.m_fSoundIntensity, m_sQueueSample.m_fDistance); + m_sQueueSample.m_nVolume = ComputeVolume(emittingVolume, m_sQueueSample.m_SoundIntensity, m_sQueueSample.m_fDistance); if (m_sQueueSample.m_nVolume != 0) { m_sQueueSample.m_nCounter = iSound++; m_sQueueSample.m_nLoopCount = 1; @@ -8447,7 +8449,7 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) switch(sound) { case SCRIPT_SOUND_BANK_ALARM_LOOP: - m_sQueueSample.m_fSoundIntensity = 80.0f; + m_sQueueSample.m_SoundIntensity = 80.0f; m_sQueueSample.m_nSampleIndex = SFX_BUILDINGS_BANK_ALARM; m_sQueueSample.m_nBankIndex = SFX_BANK_BUILDING_BANK_ALARM; emittingVolume = 90; @@ -8459,7 +8461,7 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) break; case SCRIPT_SOUND_POLICE_CELL_DOOR_SLIDING_LOOP: case SCRIPT_SOUND_GARAGE_DOOR_SLIDING_LOOP: - m_sQueueSample.m_fSoundIntensity = 80.0f; + m_sQueueSample.m_SoundIntensity = 80.0f; m_sQueueSample.m_nSampleIndex = SFX_GARAGE_DOOR_LOOP; m_sQueueSample.m_nBankIndex = SFX_BANK_0; emittingVolume = 90; @@ -8470,7 +8472,7 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) m_sQueueSample.m_bIs2D = FALSE; break; case SCRIPT_SOUND_SNORING_LOOP: - m_sQueueSample.m_fSoundIntensity = 6.0f; + m_sQueueSample.m_SoundIntensity = 6.0f; m_sQueueSample.m_nSampleIndex = SFX_BUILDING_SNORE; m_sQueueSample.m_nBankIndex = SFX_BANK_BUILDING_SNORING; emittingVolume = 25; @@ -8481,7 +8483,7 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) m_sQueueSample.m_bIs2D = FALSE; break; case SCRIPT_SOUND_SHOOTING_RANGE_TARGET_MOVING_LOOP: - m_sQueueSample.m_fSoundIntensity = 40.0f; + m_sQueueSample.m_SoundIntensity = 40.0f; m_sQueueSample.m_nSampleIndex = SFX_TANK_TURRET; m_sQueueSample.m_nBankIndex = SFX_BANK_0; emittingVolume = 60; @@ -8494,7 +8496,7 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) case SCRIPT_SOUND_NEW_BUILDING_BAR_1: m_sQueueSample.m_nSampleIndex = SFX_BUILDING_BAR_1; m_sQueueSample.m_nBankIndex = SFX_BANK_BUILDING_BAR_1; - m_sQueueSample.m_fSoundIntensity = 80.0f; + m_sQueueSample.m_SoundIntensity = 80.0f; emittingVolume = 127; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_nReleasingVolumeModificator = 3; @@ -8505,7 +8507,7 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) case SCRIPT_SOUND_NEW_BUILDING_BAR_2: m_sQueueSample.m_nSampleIndex = SFX_BUILDING_BAR_2; m_sQueueSample.m_nBankIndex = SFX_BANK_BUILDING_BAR_2; - m_sQueueSample.m_fSoundIntensity = 80.0f; + m_sQueueSample.m_SoundIntensity = 80.0f; emittingVolume = 127; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_nReleasingVolumeModificator = 3; @@ -8516,7 +8518,7 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) case SCRIPT_SOUND_NEW_BUILDING_BAR_3: m_sQueueSample.m_nSampleIndex = SFX_BUILDING_BAR_3; m_sQueueSample.m_nBankIndex = SFX_BANK_BUILDING_BAR_3; - m_sQueueSample.m_fSoundIntensity = 80.0f; + m_sQueueSample.m_SoundIntensity = 80.0f; emittingVolume = 127; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_nReleasingVolumeModificator = 3; @@ -8527,7 +8529,7 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) case SCRIPT_SOUND_NEW_BUILDING_BAR_4: m_sQueueSample.m_nSampleIndex = SFX_BUILDING_BAR_4; m_sQueueSample.m_nBankIndex = SFX_BANK_BUILDING_BAR_4; - m_sQueueSample.m_fSoundIntensity = 80.0f; + m_sQueueSample.m_SoundIntensity = 80.0f; emittingVolume = 127; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_nReleasingVolumeModificator = 3; @@ -8540,7 +8542,7 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) m_sQueueSample.m_nSampleIndex = SFX_BUILDING_MAL1; m_sQueueSample.m_nBankIndex = SFX_BANK_BUILDING_MALIBU_1; MusicManager.SetMalibuClubTrackPos(SCRIPT_SOUND_NEW_BUILDING_MALIBU_1); - m_sQueueSample.m_fSoundIntensity = 80.0f; + m_sQueueSample.m_SoundIntensity = 80.0f; emittingVolume = 127; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_nReleasingVolumeModificator = 3; @@ -8553,7 +8555,7 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) m_sQueueSample.m_nSampleIndex = SFX_BUILDING_MAL2; m_sQueueSample.m_nBankIndex = SFX_BANK_BUILDING_MALIBU_2; MusicManager.SetMalibuClubTrackPos(SCRIPT_SOUND_NEW_BUILDING_MALIBU_2); - m_sQueueSample.m_fSoundIntensity = 80.0f; + m_sQueueSample.m_SoundIntensity = 80.0f; emittingVolume = 127; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_nReleasingVolumeModificator = 3; @@ -8566,7 +8568,7 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) m_sQueueSample.m_nSampleIndex = SFX_BUILDING_MAL3; m_sQueueSample.m_nBankIndex = SFX_BANK_BUILDING_MALIBU_3; MusicManager.SetMalibuClubTrackPos(SCRIPT_SOUND_NEW_BUILDING_MALIBU_3); - m_sQueueSample.m_fSoundIntensity = 80.0f; + m_sQueueSample.m_SoundIntensity = 80.0f; emittingVolume = 127; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_nReleasingVolumeModificator = 3; @@ -8579,7 +8581,7 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) m_sQueueSample.m_nSampleIndex = SFX_BUILDING_STR1; m_sQueueSample.m_nBankIndex = SFX_BANK_BUILDING_STRIP_1; MusicManager.SetStripClubTrackPos(SCRIPT_SOUND_NEW_BUILDING_STRIP_1); - m_sQueueSample.m_fSoundIntensity = 80.0f; + m_sQueueSample.m_SoundIntensity = 80.0f; emittingVolume = 127; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_nReleasingVolumeModificator = 3; @@ -8592,7 +8594,7 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) m_sQueueSample.m_nSampleIndex = SFX_BUILDING_STR2; m_sQueueSample.m_nBankIndex = SFX_BANK_BUILDING_STRIP_2; MusicManager.SetStripClubTrackPos(SCRIPT_SOUND_NEW_BUILDING_STRIP_2); - m_sQueueSample.m_fSoundIntensity = 80.0f; + m_sQueueSample.m_SoundIntensity = 80.0f; emittingVolume = 127; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_nReleasingVolumeModificator = 3; @@ -8605,7 +8607,7 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) m_sQueueSample.m_nSampleIndex = SFX_BUILDING_STR3; m_sQueueSample.m_nBankIndex = SFX_BANK_BUILDING_STRIP_3; MusicManager.SetStripClubTrackPos(SCRIPT_SOUND_NEW_BUILDING_STRIP_3); - m_sQueueSample.m_fSoundIntensity = 80.0f; + m_sQueueSample.m_SoundIntensity = 80.0f; emittingVolume = 127; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_nReleasingVolumeModificator = 3; @@ -8616,7 +8618,7 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) case SCRIPT_SOUND_NEW_BUILDING_CHURCH: m_sQueueSample.m_nSampleIndex = SFX_BUILDING_CHURCH; m_sQueueSample.m_nBankIndex = SFX_BANK_BUILDING_CHURCH; - m_sQueueSample.m_fSoundIntensity = 80.0f; + m_sQueueSample.m_SoundIntensity = 80.0f; emittingVolume = 127; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_nReleasingVolumeModificator = 3; @@ -8626,7 +8628,7 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) break; case SCRIPT_SOUND_NEW_WATERFALL: emittingVolume = 30; - m_sQueueSample.m_fSoundIntensity = 80.0f; + m_sQueueSample.m_SoundIntensity = 80.0f; m_sQueueSample.m_nSampleIndex = SFX_BOAT_WATER_LOOP; m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_nFrequency = 20812; @@ -8639,9 +8641,9 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) } distSquared = GetDistanceSquared(m_sQueueSample.m_vecPos); - if(distSquared < SQR(m_sQueueSample.m_fSoundIntensity)) { + if(distSquared < SQR(m_sQueueSample.m_SoundIntensity)) { m_sQueueSample.m_fDistance = Sqrt(distSquared); - m_sQueueSample.m_nVolume = ComputeVolume(emittingVolume, m_sQueueSample.m_fSoundIntensity, m_sQueueSample.m_fDistance); + m_sQueueSample.m_nVolume = ComputeVolume(emittingVolume, m_sQueueSample.m_SoundIntensity, m_sQueueSample.m_fDistance); if(m_sQueueSample.m_nVolume != 0) { m_sQueueSample.m_nCounter = 0; m_sQueueSample.m_bIs2D = FALSE; @@ -8668,21 +8670,23 @@ cAudioManager::ProcessWeather(int32 id) static uint8 iSound = 0; - if (m_asAudioEntities[id].m_AudioEvents != 0 && m_asAudioEntities[id].m_awAudioEvent[0] == SOUND_LIGHTNING) { - if (m_asAudioEntities[id].m_afVolume[0] >= 10.f) { - m_sQueueSample.m_nSampleIndex = SFX_EXPLOSION_1; - m_sQueueSample.m_nBankIndex = SFX_BANK_GENERIC_EXTRA; - m_sQueueSample.m_nFrequency = RandomDisplacement(500) + 4000; - vol = (m_asAudioEntities[id].m_afVolume[0] - 10.0f) + 40; - } else { + if (m_asAudioEntities[id].m_AudioEvents > 0 && m_asAudioEntities[id].m_awAudioEvent[0] == SOUND_LIGHTNING) { + if (m_asAudioEntities[id].m_afVolume[0] < 10.0f) { m_sQueueSample.m_nSampleIndex = SFX_EXPLOSION_2; m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_nFrequency = RandomDisplacement(500) + 4000; - vol = (m_asAudioEntities[id].m_afVolume[0]) + 35; + vol = (m_asAudioEntities[id].m_afVolume[0] * 10.0f * 0.1f) + 35; + vol += 35; + } else { + m_sQueueSample.m_nSampleIndex = SFX_EXPLOSION_1; + m_sQueueSample.m_nBankIndex = SFX_BANK_GENERIC_EXTRA; + m_sQueueSample.m_nFrequency = RandomDisplacement(500) + 4000; + vol = ((m_asAudioEntities[id].m_afVolume[0] - 10.0f) * 10.0f * 0.1f); + vol += 40; } m_sQueueSample.m_nVolume = vol; if (TheCamera.SoundDistUp < 20.0f) - m_sQueueSample.m_nVolume /= 2; + m_sQueueSample.m_nVolume <<= 1; if (iSound == 4) iSound = 0; m_sQueueSample.m_nCounter = iSound++; @@ -9029,7 +9033,7 @@ cAudioManager::ProcessProjectiles() switch (CProjectileInfo::GetProjectileInfo(i)->m_eWeaponType) { case WEAPONTYPE_TEARGAS: emittingVol = 80; - m_sQueueSample.m_fSoundIntensity = 40.0f; + m_sQueueSample.m_SoundIntensity = 40.0f; m_sQueueSample.m_nSampleIndex = SFX_PALM_TREE_LO; m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_nFrequency = 13879; @@ -9037,7 +9041,7 @@ cAudioManager::ProcessProjectiles() break; case WEAPONTYPE_MOLOTOV: emittingVol = 50; - m_sQueueSample.m_fSoundIntensity = 30.0f; + m_sQueueSample.m_SoundIntensity = 30.0f; m_sQueueSample.m_nSampleIndex = SFX_PED_ON_FIRE; m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_nFrequency = 32 * SampleManager.GetSampleBaseFrequency(SFX_PED_ON_FIRE) / 25; @@ -9045,7 +9049,7 @@ cAudioManager::ProcessProjectiles() break; case WEAPONTYPE_ROCKET: emittingVol = 127; - m_sQueueSample.m_fSoundIntensity = 90.0f; + m_sQueueSample.m_SoundIntensity = 90.0f; m_sQueueSample.m_nSampleIndex = SFX_ROCKET_FLY; m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_ROCKET_FLY); @@ -9058,9 +9062,9 @@ cAudioManager::ProcessProjectiles() m_sQueueSample.m_nReleasingVolumeDivider = 3; m_sQueueSample.m_vecPos = CProjectileInfo::ms_apProjectile[i]->GetPosition(); distSquared = GetDistanceSquared(m_sQueueSample.m_vecPos); - if (distSquared < SQR(m_sQueueSample.m_fSoundIntensity)) { + if (distSquared < SQR(m_sQueueSample.m_SoundIntensity)) { m_sQueueSample.m_fDistance = Sqrt(distSquared); - m_sQueueSample.m_nVolume = ComputeVolume(emittingVol, m_sQueueSample.m_fSoundIntensity, m_sQueueSample.m_fDistance); + m_sQueueSample.m_nVolume = ComputeVolume(emittingVol, m_sQueueSample.m_SoundIntensity, m_sQueueSample.m_fDistance); if (m_sQueueSample.m_nVolume != 0) { m_sQueueSample.m_nCounter = i; m_sQueueSample.m_bIs2D = FALSE; @@ -9100,7 +9104,7 @@ cAudioManager::ProcessEscalators() m_sQueueSample.m_nReleasingVolumeModificator = 3; m_sQueueSample.m_fSpeedMultiplier = 3.0f; m_sQueueSample.m_nReleasingVolumeDivider = 5; - m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; m_sQueueSample.m_nCounter = i; m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_nLoopCount = 0; @@ -9145,7 +9149,7 @@ cAudioManager::ProcessExtraSounds() SET_EMITTING_VOLUME(EMITTING_VOLUME); SET_LOOP_OFFSETS(SFX_ARCADE) m_sQueueSample.m_bReverbFlag = TRUE; - m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; m_sQueueSample.m_bRequireReflection = FALSE; m_sQueueSample.m_nReleasingVolumeDivider = 3; AddSampleToRequestedQueue(); @@ -9225,7 +9229,7 @@ cAudioManager::ProcessGarages() SET_EMITTING_VOLUME(90); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 2.0f; - m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; m_sQueueSample.m_bReverbFlag = TRUE; m_sQueueSample.m_bRequireReflection = FALSE; AddSampleToRequestedQueue(); @@ -9255,7 +9259,7 @@ cAudioManager::ProcessGarages() m_sQueueSample.m_nReleasingVolumeModificator = 4; SET_EMITTING_VOLUME(60); m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; m_sQueueSample.m_bReverbFlag = TRUE; m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_bReleasingSoundFlag = TRUE; @@ -9299,7 +9303,7 @@ cAudioManager::ProcessFireHydrant() m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_nLoopCount = 0; SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) - m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_bRequireReflection = FALSE; m_sQueueSample.m_nReleasingVolumeDivider = 3; @@ -9358,7 +9362,7 @@ cAudioManager::ProcessBridgeWarning() SET_EMITTING_VOLUME(100); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 2.0f; - m_sQueueSample.m_fSoundIntensity = 450.0f; + m_sQueueSample.m_SoundIntensity = 450.0f; m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_nReleasingVolumeDivider = 8; m_sQueueSample.m_bReverbFlag = FALSE; @@ -9384,7 +9388,7 @@ cAudioManager::ProcessBridgeMotor() SET_EMITTING_VOLUME(MAX_VOLUME); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 2.0f; - m_sQueueSample.m_fSoundIntensity = bridgeIntensity; + m_sQueueSample.m_SoundIntensity = bridgeIntensity; m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_nReleasingVolumeDivider = 3; m_sQueueSample.m_bReverbFlag = FALSE; @@ -9418,7 +9422,7 @@ cAudioManager::ProcessBridgeOneShots() SET_EMITTING_VOLUME(MAX_VOLUME); RESET_LOOP_OFFSETS m_sQueueSample.m_fSpeedMultiplier = 2.0f; - m_sQueueSample.m_fSoundIntensity = bridgeIntensity; + m_sQueueSample.m_SoundIntensity = bridgeIntensity; m_sQueueSample.m_bReleasingSoundFlag = TRUE; m_sQueueSample.m_bReverbFlag = FALSE; m_sQueueSample.m_bRequireReflection = FALSE; diff --git a/src/audio/AudioManager.cpp b/src/audio/AudioManager.cpp index 8e6ef4ff..92569f03 100644 --- a/src/audio/AudioManager.cpp +++ b/src/audio/AudioManager.cpp @@ -687,7 +687,6 @@ cAudioManager::AddDetailsToRequestedOrderList(uint8 sample) m_abSampleQueueIndexTable[m_nActiveSampleQueue][i] = sample; } -#ifdef GTA_PC void cAudioManager::AddReflectionsToRequestedQueue() { @@ -709,7 +708,7 @@ cAudioManager::AddReflectionsToRequestedQueue() } else { emittingVolume = (9 * m_sQueueSample.m_nVolume) / 16; } - m_sQueueSample.m_fSoundIntensity /= 2.f; + m_sQueueSample.m_SoundIntensity /= 2.f; int halfOldFreq = oldFreq >> 1; @@ -718,12 +717,12 @@ cAudioManager::AddReflectionsToRequestedQueue() m_afReflectionsDistances[i] = (m_anRandomTable[i % 4] % 3) * 100.f / 8.f; reflectionDistance = m_afReflectionsDistances[i]; - if (reflectionDistance > 0.0f && reflectionDistance < 100.f && reflectionDistance < m_sQueueSample.m_fSoundIntensity) { + if (reflectionDistance > 0.0f && reflectionDistance < 100.f && reflectionDistance < m_sQueueSample.m_SoundIntensity) { m_sQueueSample.m_nLoopsRemaining = CTimer::GetIsSlowMotionActive() ? (reflectionDistance * 800.f / 1029.f) : (reflectionDistance * 500.f / 1029.f); if (m_sQueueSample.m_nLoopsRemaining > 3) { m_sQueueSample.m_fDistance = m_afReflectionsDistances[i]; SET_EMITTING_VOLUME(emittingVolume); - m_sQueueSample.m_nVolume = ComputeVolume(emittingVolume, m_sQueueSample.m_fSoundIntensity, m_sQueueSample.m_fDistance); + m_sQueueSample.m_nVolume = ComputeVolume(emittingVolume, m_sQueueSample.m_SoundIntensity, m_sQueueSample.m_fDistance); if (m_sQueueSample.m_nVolume > emittingVolume / 16) { m_sQueueSample.m_nCounter = oldCounter + (i + 1) * 256; @@ -752,43 +751,44 @@ cAudioManager::AddReflectionsToRequestedQueue() void cAudioManager::UpdateReflections() { - CVector camPos = TheCamera.GetPosition(); + CVector camPos; CColPoint colpoint; CEntity *ent; if (m_FrameCounter % 8 == 0) { + camPos = TheCamera.GetPosition(); m_avecReflectionsPos[0] = camPos; m_avecReflectionsPos[0].y += 100.f; if (CWorld::ProcessLineOfSight(camPos, m_avecReflectionsPos[0], colpoint, ent, true, false, false, true, false, true, true)) m_afReflectionsDistances[0] = Distance(camPos, colpoint.point); else m_afReflectionsDistances[0] = 100.0f; - } else if ((m_FrameCounter + 1) % 8 == 0) { + camPos = TheCamera.GetPosition(); m_avecReflectionsPos[1] = camPos; m_avecReflectionsPos[1].y -= 100.0f; if (CWorld::ProcessLineOfSight(camPos, m_avecReflectionsPos[1], colpoint, ent, true, false, false, true, false, true, true)) m_afReflectionsDistances[1] = Distance(camPos, colpoint.point); else m_afReflectionsDistances[1] = 100.0f; - } else if ((m_FrameCounter + 2) % 8 == 0) { + camPos = TheCamera.GetPosition(); m_avecReflectionsPos[2] = camPos; m_avecReflectionsPos[2].x -= 100.0f; if (CWorld::ProcessLineOfSight(camPos, m_avecReflectionsPos[2], colpoint, ent, true, false, false, true, false, true, true)) m_afReflectionsDistances[2] = Distance(camPos, colpoint.point); else m_afReflectionsDistances[2] = 100.0f; - } else if ((m_FrameCounter + 3) % 8 == 0) { + camPos = TheCamera.GetPosition(); m_avecReflectionsPos[3] = camPos; m_avecReflectionsPos[3].x += 100.0f; if (CWorld::ProcessLineOfSight(camPos, m_avecReflectionsPos[3], colpoint, ent, true, false, false, true, false, true, true)) m_afReflectionsDistances[3] = Distance(camPos, colpoint.point); else m_afReflectionsDistances[3] = 100.0f; - } else if ((m_FrameCounter + 4) % 8 == 0) { + camPos = TheCamera.GetPosition(); camPos.y += 1.0f; m_avecReflectionsPos[4] = camPos; m_avecReflectionsPos[4].z += 100.0f; @@ -796,8 +796,8 @@ cAudioManager::UpdateReflections() m_afReflectionsDistances[4] = colpoint.point.z - camPos.z; else m_afReflectionsDistances[4] = 100.0f; - } else if ((m_FrameCounter + 5) % 8 == 0) { + camPos = TheCamera.GetPosition(); camPos.y -= 1.0f; m_avecReflectionsPos[5] = camPos; m_avecReflectionsPos[5].z += 100.0f; @@ -805,8 +805,8 @@ cAudioManager::UpdateReflections() m_afReflectionsDistances[5] = colpoint.point.z - camPos.z; else m_afReflectionsDistances[5] = 100.0f; - } else if ((m_FrameCounter + 6) % 8 == 0) { + camPos = TheCamera.GetPosition(); camPos.x -= 1.0f; m_avecReflectionsPos[6] = camPos; m_avecReflectionsPos[6].z += 100.0f; @@ -814,8 +814,8 @@ cAudioManager::UpdateReflections() m_afReflectionsDistances[6] = colpoint.point.z - camPos.z; else m_afReflectionsDistances[6] = 100.0f; - } else if ((m_FrameCounter + 7) % 8 == 0) { + camPos = TheCamera.GetPosition(); camPos.x += 1.0f; m_avecReflectionsPos[7] = camPos; m_avecReflectionsPos[7].z += 100.0f; @@ -825,7 +825,6 @@ cAudioManager::UpdateReflections() m_afReflectionsDistances[7] = 100.0f; } } -#endif // GTA_PC void cAudioManager::AddReleasingSounds() @@ -853,7 +852,7 @@ cAudioManager::AddReleasingSounds() } } if (!toProcess[i]) { - if (sample.m_nCounter <= 255 || !sample.m_nLoopsRemaining) { + if (sample.m_nCounter <= 255 || sample.m_nLoopsRemaining == 0) { if (sample.m_nReleasingVolumeDivider == 0) continue; if (sample.m_nLoopCount == 0) { @@ -995,7 +994,7 @@ cAudioManager::ProcessActiveQueues() TranslateEntity(&sample.m_vecPos, &position); #ifdef EXTERNAL_3D_SOUND SampleManager.SetChannel3DPosition(j, position.x, position.y, position.z); - SampleManager.SetChannel3DDistances(j, sample.m_fSoundIntensity, 0.25f * sample.m_fSoundIntensity); + SampleManager.SetChannel3DDistances(j, sample.m_SoundIntensity, 0.25f * sample.m_SoundIntensity); #else sample.m_nOffset = ComputePan(sample.m_fDistance, &position); SampleManager.SetChannelPan(j, sample.m_nOffset); @@ -1084,14 +1083,14 @@ cAudioManager::ProcessActiveQueues() usedX = x; usedY = 0.0f; usedZ = 0.0f; - m_asActiveSamples[k].m_fSoundIntensity = 100000.0f; + m_asActiveSamples[k].m_SoundIntensity = 100000.0f; } else { usedX = position.x; usedY = position.y; usedZ = position.z; } SampleManager.SetChannel3DPosition(k, usedX, usedY, usedZ); - SampleManager.SetChannel3DDistances(k, m_asActiveSamples[k].m_fSoundIntensity, 0.25f * m_asActiveSamples[k].m_fSoundIntensity); + SampleManager.SetChannel3DDistances(k, m_asActiveSamples[k].m_SoundIntensity, 0.25f * m_asActiveSamples[k].m_SoundIntensity); #endif SampleManager.StartChannel(k); } @@ -1140,7 +1139,7 @@ cAudioManager::ClearActiveSamples() m_asActiveSamples[i].m_nLoopEnd = -1; #endif m_asActiveSamples[i].m_fSpeedMultiplier = 0.0f; - m_asActiveSamples[i].m_fSoundIntensity = 200.0f; + m_asActiveSamples[i].m_SoundIntensity = 200.0f; m_asActiveSamples[i].m_nOffset = 63; m_asActiveSamples[i].m_bReleasingSoundFlag = FALSE; m_asActiveSamples[i].m_nCalculatedVolume = 0; @@ -1176,7 +1175,7 @@ cAudioManager::AdjustSamplesVolume() tSound *pSample = &m_asSamples[m_nActiveSampleQueue][m_abSampleQueueIndexTable[m_nActiveSampleQueue][i]]; if (!pSample->m_bIs2D) - pSample->m_nEmittingVolume = ComputeEmittingVolume(pSample->m_nEmittingVolume, pSample->m_fSoundIntensity, pSample->m_fDistance); + pSample->m_nEmittingVolume = ComputeEmittingVolume(pSample->m_nEmittingVolume, pSample->m_SoundIntensity, pSample->m_fDistance); } } diff --git a/src/audio/AudioManager.h b/src/audio/AudioManager.h index 526df1f8..383644e0 100644 --- a/src/audio/AudioManager.h +++ b/src/audio/AudioManager.h @@ -27,10 +27,12 @@ public: uint8 m_nEmittingVolume; #endif float m_fSpeedMultiplier; - float m_fSoundIntensity; + float m_SoundIntensity; bool8 m_bReleasingSoundFlag; CVector m_vecPos; - bool8 m_bReverbFlag; +#ifndef GTA_PS2 + bool8 m_bReverbFlag; // TODO: ifdef all the occurrences +#endif uint8 m_nLoopsRemaining; bool8 m_bRequireReflection; // Used for oneshots uint8 m_nOffset; @@ -219,10 +221,8 @@ public: tAudioEntity m_asAudioEntities[NUM_AUDIOENTITIES]; int32 m_anAudioEntityIndices[NUM_AUDIOENTITIES]; int32 m_nAudioEntitiesTotal; -#ifdef GTA_PC CVector m_avecReflectionsPos[NUM_AUDIO_REFLECTIONS]; float m_afReflectionsDistances[NUM_AUDIO_REFLECTIONS]; -#endif cAudioScriptObjectManager m_sAudioScriptObjectManager; // miami @@ -301,10 +301,8 @@ public: void InterrogateAudioEntities(); // inlined void AddSampleToRequestedQueue(); void AddDetailsToRequestedOrderList(uint8 sample); // inlined in vc -#ifdef GTA_PC void AddReflectionsToRequestedQueue(); void UpdateReflections(); -#endif void AddReleasingSounds(); void ProcessActiveQueues(); void ClearRequestedQueue(); // inlined in vc @@ -341,7 +339,7 @@ public: void ProcessVehicleFlatTyre(cVehicleParams ¶ms); bool8 ProcessVehicleRoadNoise(cVehicleParams ¶ms); bool8 ProcessWetRoadNoise(cVehicleParams ¶ms); - void ProcessVehicleEngine(cVehicleParams ¶ms); + bool8 ProcessVehicleEngine(cVehicleParams ¶ms); void UpdateGasPedalAudio(CVehicle *veh, int vehType); void PlayerJustGotInCar(); void PlayerJustLeftCar(); |