diff options
Diffstat (limited to 'src/audio/AudioLogic.cpp')
-rw-r--r-- | src/audio/AudioLogic.cpp | 2137 |
1 files changed, 1098 insertions, 1039 deletions
diff --git a/src/audio/AudioLogic.cpp b/src/audio/AudioLogic.cpp index 5ee5ddd1..329358a5 100644 --- a/src/audio/AudioLogic.cpp +++ b/src/audio/AudioLogic.cpp @@ -47,11 +47,8 @@ #define CHANNEL_PLAYER_VEHICLE_ENGINE m_nActiveSamples #endif -enum PLAY_STATUS { PLAY_STATUS_STOPPED = 0, PLAY_STATUS_PLAYING, PLAY_STATUS_FINISHED }; -enum LOADING_STATUS { LOADING_STATUS_NOT_LOADED = 0, LOADING_STATUS_LOADED, LOADING_STATUS_FAILED }; - void -cAudioManager::PreInitialiseGameSpecificSetup() const +cAudioManager::PreInitialiseGameSpecificSetup() { BankStartOffset[SFX_BANK_0] = SAMPLEBANK_START; #ifdef GTA_PS2 @@ -250,7 +247,7 @@ cAudioManager::ResetAudioLogicTimers(uint32 timer) } void -cAudioManager::ProcessReverb() const +cAudioManager::ProcessReverb() { #ifdef FIX_BUGS const uint32 numChannels = NUM_CHANNELS_GENERIC; @@ -269,7 +266,7 @@ cAudioManager::ProcessReverb() const } float -cAudioManager::GetDistanceSquared(const CVector &v) const +cAudioManager::GetDistanceSquared(const CVector &v) { const CVector &c = TheCamera.GetPosition(); return sq(v.x - c.x) + sq(v.y - c.y) + sq((v.z - c.z) * 0.2f); @@ -284,7 +281,8 @@ cAudioManager::CalculateDistance(bool8 &distCalculated, float dist) } } -CVehicle *cAudioManager::FindVehicleOfPlayer() +CVehicle * +cAudioManager::FindVehicleOfPlayer() { CVehicle* vehicle = FindPlayerVehicle(); CPlayerPed* ped = FindPlayerPed(); @@ -297,41 +295,6 @@ CVehicle *cAudioManager::FindVehicleOfPlayer() } void -cAudioManager::ProcessPlayerMood() -{ - CPlayerPed *playerPed; - uint32& lastMissionPassedTime = CTheScripts::GetLastMissionPassedTime(); - uint32 curTime = CTimer::GetTimeInMilliseconds(); - - if (m_nPlayerMoodTimer <= curTime) { - playerPed = FindPlayerPed(); - if (playerPed != nil) { - - if (playerPed->m_pWanted->GetWantedLevel() > 3) { - m_nPlayerMood = PLAYER_MOOD_ANGRY; - return; - } - if (playerPed->m_pWanted->GetWantedLevel() > 1) { - m_nPlayerMood = PLAYER_MOOD_PISSED_OFF; - return; - } - - if (lastMissionPassedTime != -1) { - if (curTime < lastMissionPassedTime) { - lastMissionPassedTime = curTime; - return; - } - if (curTime < lastMissionPassedTime + 180000) { - m_nPlayerMood = PLAYER_MOOD_WISECRACKING; - return; - } - } - m_nPlayerMood = PLAYER_MOOD_CALM; - } - } -} - -void cAudioManager::ProcessSpecial() { CPlayerPed *playerPed; @@ -719,8 +682,6 @@ const tVehicleSampleData aVehicleSettings[MAX_CARS] = { {SFX_CAR_REV_1, CAR_SFX_BANKS_OFFSET, SFX_CAR_HORN_JEEP, 26513, SFX_CAR_HORN_JEEP, 9300, NEW_DOOR}, {SFX_CAR_REV_1, CAR_SFX_BANKS_OFFSET, SFX_CAR_HORN_JEEP, 26513, SFX_CAR_HORN_JEEP, 9400, NEW_DOOR} }; - - bool8 bPlayerJustEnteredCar; const bool8 hornPatternsArray[8][44] = { @@ -742,7 +703,8 @@ const bool8 hornPatternsArray[8][44] = { FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE}, }; -void cAudioManager::ProcessVehicle(CVehicle* veh) +void +cAudioManager::ProcessVehicle(CVehicle* veh) { CVehicle* playerVeh; cVehicleParams params; @@ -861,6 +823,348 @@ void cAudioManager::ProcessVehicle(CVehicle* veh) } void +cAudioManager::ProcessCarHeli(cVehicleParams& params) +{ + const float SOUND_INTENSITY = 250.0f; + + CVehicle* playerVeh; + CVehicle* veh; + CAutomobile* automobile; + CBoat* boat; + + uint8 emittingVol; + int16 brakeState; + int16 accelerateState; + uint32 freq; + float propellerSpeed; + float freqModifier; //may be relate to angle with horison + float cameraAngle; + bool8 distanceCalculatedOld; + float distanceOld; + CVector vecPosOld; + + float volumeModifier;//TODO find better name + bool8 hunterBool; + + static uint32 freqFrontPrev = 14287; + static uint32 freqPropellerPrev = 7143; + static uint32 freqSkimmerPrev = 14287; + + boat = nil; + automobile = nil; + hunterBool = FALSE; + + if (params.m_fDistance >= SQR(SOUND_INTENSITY)) + return; + + playerVeh = FindPlayerVehicle(); + veh = params.m_pVehicle; + if (playerVeh == veh) { + accelerateState = Pads[0].GetAccelerate(); + brakeState = Pads[0].GetBrake(); + } else { + accelerateState = veh->m_fGasPedal * 255.0f; + brakeState = veh->m_fBrakePedal * 255.0f; + } + freqModifier = Abs(veh->GetUp().y); + cameraAngle = (DotProduct(veh->GetMatrix().GetForward(), TheCamera.GetForward()) + 1.0f) / 2.0f; + if (veh->m_modelIndex == MI_SKIMMER) { + boat = (CBoat*)veh; + propellerSpeed = boat->m_fMovingSpeed * 50.0f / 11.0f; + } else if (params.m_VehicleType == VEHICLE_TYPE_HELI) { + propellerSpeed = 1.0f; + } else { + automobile = (CAutomobile*)veh; + propellerSpeed = automobile->m_aWheelSpeed[1] * 50.0f / 11.0f; + } + + if (propellerSpeed == 0.0f) + return; + + propellerSpeed = Min(1.0f, propellerSpeed); + CalculateDistance(params.m_bDistanceCalculated, params.m_fDistance); + + + //sound on long distances + if (m_sQueueSample.m_fDistance >= 40.0f) + emittingVol = propellerSpeed * 75.0f; + else if (m_sQueueSample.m_fDistance >= 25.0f) + emittingVol = (m_sQueueSample.m_fDistance - 25.0f) * (75.0f * propellerSpeed) / 15.0f; + else + emittingVol = 0; + if (emittingVol != 0) { + m_sQueueSample.m_nVolume = ComputeVolume(emittingVol, SOUND_INTENSITY, m_sQueueSample.m_fDistance); + if (m_sQueueSample.m_nVolume != 0) { + m_sQueueSample.m_nCounter = 88; + if (boat != nil) { + m_sQueueSample.m_nSampleIndex = SFX_SEAPLANE_PRO3; + m_sQueueSample.m_nBankIndex = SFX_BANK_0; + if (accelerateState > 0 || brakeState > 0) + m_sQueueSample.m_nFrequency = 4600 + Min(1.0f, (Max(accelerateState, brakeState) / 255.0f) * freqModifier) * 563; + else + m_sQueueSample.m_nFrequency = 3651 + Min(1.0f, freqModifier) * 949; + } else { + m_sQueueSample.m_nSampleIndex = SFX_HELI_1; + m_sQueueSample.m_nBankIndex = SFX_BANK_0; + m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex); + } + m_sQueueSample.m_bIs2D = FALSE; + m_sQueueSample.m_nReleasingVolumeModificator = 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 = 5; + m_sQueueSample.m_bReverbFlag = TRUE; + m_sQueueSample.m_bRequireReflection = FALSE; + AddSampleToRequestedQueue(); + } + } + + CVector backPropellerPos; + if (automobile != nil) + automobile->GetComponentWorldPosition(CAR_BOOT, backPropellerPos); + else if (params.m_VehicleType == VEHICLE_TYPE_HELI) +#ifdef FIX_BUGS + backPropellerPos = +#endif + params.m_pVehicle->GetMatrix() * CVector(0.0f, -10.0f, 0.0f); + else + backPropellerPos = m_sQueueSample.m_vecPos; + + if (params.m_fDistance >= SQR(140.0f)) + return; + + if (propellerSpeed >= 0.4f) + volumeModifier = (propellerSpeed - 0.4f) * 5.0f / 3.0f; + else + volumeModifier = 0.0f; + if (!boat) { + freq = Min(1300, 7000.0f * freqModifier); + if (playerVeh == veh && (accelerateState > 0 || brakeState > 0) && freq < 1300)//unnesesary freqModifier alredy <= 1300 + freq = 1300; + if (veh->m_modelIndex == MI_HUNTER) + hunterBool = TRUE; + } + + + //sound from front of helicopter + emittingVol = (1.0f - cameraAngle) * volumeModifier * 127.0f; + m_sQueueSample.m_nVolume = ComputeVolume(emittingVol, 140.0f, m_sQueueSample.m_fDistance); + if (m_sQueueSample.m_nVolume != 0) { + m_sQueueSample.m_nCounter = 3; + if (hunterBool) { + m_sQueueSample.m_nSampleIndex = SFX_HELI_APACHE_1; + m_sQueueSample.m_nBankIndex = SFX_BANK_0; + m_sQueueSample.m_nFrequency = (volumeModifier + 1.0f) * 16000 + freq; + m_sQueueSample.m_bIs2D = FALSE; + m_sQueueSample.m_nReleasingVolumeModificator = 1; + 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 = 140.0f; + m_sQueueSample.m_bReleasingSoundFlag = FALSE; + m_sQueueSample.m_nReleasingVolumeDivider = 5; + m_sQueueSample.m_bReverbFlag = TRUE; + m_sQueueSample.m_bRequireReflection = FALSE; + AddSampleToRequestedQueue(); + } else if (boat != nil) { + m_sQueueSample.m_nSampleIndex = SFX_SEAPLANE_PRO1; + m_sQueueSample.m_nBankIndex = SFX_BANK_0; + + if (accelerateState > 0 || brakeState > 0) + m_sQueueSample.m_nFrequency = 18000 + Min(1.0f, freqModifier * (Max(accelerateState, brakeState) / 255.0f)) * 2204; + else + m_sQueueSample.m_nFrequency = 14287 + Min(1.0f, freqModifier) * 3713; + if (propellerSpeed < 1.0f) + m_sQueueSample.m_nFrequency = (propellerSpeed + 1.0f) * (m_sQueueSample.m_nFrequency / 2.0f); + m_sQueueSample.m_nFrequency = Clamp2(m_sQueueSample.m_nFrequency, freqFrontPrev, 197); + freqFrontPrev = m_sQueueSample.m_nFrequency; + + m_sQueueSample.m_bIs2D = FALSE; + m_sQueueSample.m_nReleasingVolumeModificator = 1; + 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 = 140.0f; + m_sQueueSample.m_bReleasingSoundFlag = FALSE; + m_sQueueSample.m_nReleasingVolumeDivider = 5; + m_sQueueSample.m_bReverbFlag = TRUE; + m_sQueueSample.m_bRequireReflection = FALSE; + AddSampleToRequestedQueue(); + } else { + m_sQueueSample.m_nSampleIndex = SFX_CAR_HELI_MAI; + m_sQueueSample.m_nBankIndex = SFX_BANK_0; + m_sQueueSample.m_nFrequency = (volumeModifier + 1) * 16000 + freq; + m_sQueueSample.m_bIs2D = FALSE; + m_sQueueSample.m_nReleasingVolumeModificator = 1; + 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 = 140.0f; + m_sQueueSample.m_bReleasingSoundFlag = FALSE; + m_sQueueSample.m_nReleasingVolumeDivider = 5; + m_sQueueSample.m_bReverbFlag = TRUE; + m_sQueueSample.m_bRequireReflection = FALSE; + AddSampleToRequestedQueue(); + } + } + + + //after accel rotor sound + emittingVol = ((cameraAngle + 1.0f) * volumeModifier * 127.0f) / 2.0f; + m_sQueueSample.m_nVolume = ComputeVolume(emittingVol, 140.0f, m_sQueueSample.m_fDistance); + if (m_sQueueSample.m_nVolume != 0) { + m_sQueueSample.m_nCounter = 1; + if (hunterBool) { + m_sQueueSample.m_nSampleIndex = SFX_HELI_APACHE_2; + m_sQueueSample.m_nBankIndex = SFX_BANK_0; + m_sQueueSample.m_nFrequency = (volumeModifier + 1) * 16000 + freq; + } else if (boat) { + m_sQueueSample.m_nSampleIndex = SFX_SEAPLANE_PRO2; + m_sQueueSample.m_nBankIndex = SFX_BANK_0; + + if (accelerateState > 0 || brakeState > 0) + m_sQueueSample.m_nFrequency = 9000 + Min(1.0f, (Max(accelerateState, brakeState) / 255) * freqModifier) * 1102; + else + m_sQueueSample.m_nFrequency = 7143 + Min(1.0f, freqModifier) * 1857; + + if (propellerSpeed < 1.0f) + m_sQueueSample.m_nFrequency = (propellerSpeed + 1) * (m_sQueueSample.m_nFrequency / 2); + + m_sQueueSample.m_nFrequency = Clamp2(m_sQueueSample.m_nFrequency, freqPropellerPrev, 98); + freqPropellerPrev = m_sQueueSample.m_nFrequency; + } else { + m_sQueueSample.m_nSampleIndex = SFX_CAR_HELI_MAI2; + m_sQueueSample.m_nBankIndex = SFX_BANK_0; + m_sQueueSample.m_nFrequency = (volumeModifier + 1) * 16000 + freq; + } + m_sQueueSample.m_bIs2D = FALSE; + m_sQueueSample.m_nReleasingVolumeModificator = 1; + 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 = 140.0f; + m_sQueueSample.m_bReleasingSoundFlag = FALSE; + m_sQueueSample.m_nReleasingVolumeDivider = 5; + m_sQueueSample.m_bReverbFlag = TRUE; + m_sQueueSample.m_bRequireReflection = FALSE; + AddSampleToRequestedQueue(); + } + + + //engine starting sound + if (boat == nil && params.m_VehicleType != VEHICLE_TYPE_HELI && m_sQueueSample.m_fDistance < 30.0f) { //strange way to check if automobile != nil + if (automobile->bEngineOn) { + if (propellerSpeed < 1.0f) { + emittingVol = (1.0f - propellerSpeed / 2.0f) * 70.0f; + m_sQueueSample.m_nVolume = ComputeVolume(emittingVol, 30.0f, m_sQueueSample.m_fDistance); + if (m_sQueueSample.m_nVolume) { + if (hunterBool) { + m_sQueueSample.m_nSampleIndex = SFX_HELI_APACHE_4; + m_sQueueSample.m_nBankIndex = SFX_BANK_0; + freq = 3000.0f * propellerSpeed + 30000; + } else { + m_sQueueSample.m_nSampleIndex = SFX_CAR_HELI_STA; + m_sQueueSample.m_nBankIndex = SFX_BANK_0; + freq = 3000.0f * propellerSpeed + 6000; + } + m_sQueueSample.m_nFrequency = freq; + m_sQueueSample.m_nCounter = 12; + m_sQueueSample.m_bIs2D = FALSE; + m_sQueueSample.m_nReleasingVolumeModificator = 1; + 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 = 30.0f; + m_sQueueSample.m_bReleasingSoundFlag = FALSE; + m_sQueueSample.m_nReleasingVolumeDivider = 30; + m_sQueueSample.m_bReverbFlag = TRUE; + m_sQueueSample.m_bRequireReflection = FALSE; + AddSampleToRequestedQueue(); + } + } + } + } + + + if (boat) { + if (TheCamera.Cams[TheCamera.ActiveCam].Mode == CCam::MODE_FIXED && m_sQueueSample.m_fDistance < 20.0f && propellerSpeed > 0.0f) { + m_sQueueSample.m_nVolume = ComputeVolume(propellerSpeed * 100.0f, 20.0f, m_sQueueSample.m_fDistance); + if (m_sQueueSample.m_nVolume) { + + if (accelerateState > 0 || brakeState > 0) + m_sQueueSample.m_nFrequency = 18000 + Min(1.0f, (Max(accelerateState, brakeState) / 255.0f) * freqModifier) * 2204; + else + m_sQueueSample.m_nFrequency = 14287 + Min(1.0f, freqModifier) * 3713; + if (propellerSpeed < 1.0f) + m_sQueueSample.m_nFrequency = (propellerSpeed + 1) * (m_sQueueSample.m_nFrequency / 2.0f); + m_sQueueSample.m_nFrequency = Clamp2(m_sQueueSample.m_nFrequency, freqSkimmerPrev, 197); + freqSkimmerPrev = m_sQueueSample.m_nFrequency; + + m_sQueueSample.m_nSampleIndex = SFX_SEAPLANE_PRO4; + m_sQueueSample.m_nBankIndex = SFX_BANK_0; + m_sQueueSample.m_nCounter = 12; + m_sQueueSample.m_bIs2D = FALSE; + m_sQueueSample.m_nReleasingVolumeModificator = 3; + m_sQueueSample.m_nLoopCount = 0; + 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_bReleasingSoundFlag = FALSE; + m_sQueueSample.m_nReleasingVolumeDivider = 7; + m_sQueueSample.m_bReverbFlag = TRUE; + m_sQueueSample.m_bRequireReflection = FALSE; + AddSampleToRequestedQueue(); + } + } + } else { + //vacuum cleaner sound + vecPosOld = m_sQueueSample.m_vecPos; + distanceCalculatedOld = params.m_bDistanceCalculated; + distanceOld = params.m_fDistance; + + m_sQueueSample.m_vecPos = backPropellerPos; + params.m_bDistanceCalculated = FALSE; + params.m_fDistance = GetDistanceSquared(m_sQueueSample.m_vecPos); + if (params.m_fDistance < SQR(27.0f)) { + CalculateDistance(params.m_bDistanceCalculated, params.m_fDistance); + m_sQueueSample.m_nVolume = ComputeVolume(volumeModifier * 25.0f, 27.0f, m_sQueueSample.m_fDistance); + if (m_sQueueSample.m_nVolume) { + m_sQueueSample.m_nCounter = 2; + m_sQueueSample.m_nSampleIndex = hunterBool ? SFX_HELI_APACHE_3 : SFX_CAR_HELI_REA; + m_sQueueSample.m_nBankIndex = SFX_BANK_0; + m_sQueueSample.m_bIs2D = FALSE; + m_sQueueSample.m_nReleasingVolumeModificator = 1; + m_sQueueSample.m_nFrequency = (volumeModifier + 1.0f) * 16000; + m_sQueueSample.m_nLoopCount = 0; + 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_bReleasingSoundFlag = FALSE; + m_sQueueSample.m_nReleasingVolumeDivider = 5; + m_sQueueSample.m_bReverbFlag = TRUE; + m_sQueueSample.m_bRequireReflection = FALSE; + AddSampleToRequestedQueue(); + } + } + + m_sQueueSample.m_vecPos = vecPosOld; + params.m_bDistanceCalculated = distanceCalculatedOld; + params.m_fDistance = distanceOld; + } +} + +void cAudioManager::ProcessRainOnVehicle(cVehicleParams& params) { const int SOUND_INTENSITY = 22.0f; @@ -888,7 +1192,7 @@ cAudioManager::ProcessRainOnVehicle(cVehicleParams& params) m_sQueueSample.m_nReleasingVolumeModificator = 9; m_sQueueSample.m_nFrequency = m_anRandomTable[1] % 4000 + 28000; m_sQueueSample.m_nLoopCount = 1; - m_sQueueSample.m_nEmittingVolume = emittingVol; + SET_EMITTING_VOLUME(emittingVol); RESET_LOOP_OFFSETS m_sQueueSample.m_fSpeedMultiplier = 0.0f; m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; @@ -940,7 +1244,7 @@ cAudioManager::ProcessReverseGear(cVehicleParams& params) m_sQueueSample.m_nReleasingVolumeModificator = 3; m_sQueueSample.m_nFrequency = (6000.0f * modificator) + 7000; m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_nEmittingVolume = emittingVolume; + SET_EMITTING_VOLUME(emittingVolume); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 3.0f; m_sQueueSample.m_fSoundIntensity = reverseGearIntensity; @@ -955,6 +1259,63 @@ cAudioManager::ProcessReverseGear(cVehicleParams& params) } void +cAudioManager::ProcessModelHeliVehicle(cVehicleParams& params) +{ + const float SOUND_INTENSITY = 35.0f; + + static uint32 prevFreq = 22050; + + uint32 freq; + bool8 isPlayerVeh; + int16 acceletateState; + int16 brakeState; + + if (params.m_fDistance >= SQR(SOUND_INTENSITY)) + return; + + if (FindPlayerVehicle() == params.m_pVehicle) + isPlayerVeh = TRUE; + else +#ifdef FIX_BUGS + isPlayerVeh = CWorld::Players[CWorld::PlayerInFocus].m_pRemoteVehicle == params.m_pVehicle; +#else + isPlayerVeh = CWorld::Players[CWorld::PlayerInFocus].m_pRemoteVehicle != nil; +#endif + if (isPlayerVeh) { + brakeState = Pads[0].GetBrake(); + acceletateState = Max(Pads[0].GetAccelerate(), Abs(Pads[0].GetCarGunUpDown()) * 2); + } else { + acceletateState = 255.0f * params.m_pVehicle->m_fGasPedal; + brakeState = 255.0f * params.m_pVehicle->m_fBrakePedal; + } + if (acceletateState < brakeState) + acceletateState = brakeState; + freq = Clamp2(5 * acceletateState + 22050, 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) { + m_sQueueSample.m_nCounter = 2; + m_sQueueSample.m_nSampleIndex = SFX_CAR_RC_HELI; + m_sQueueSample.m_nBankIndex = SFX_BANK_0; + m_sQueueSample.m_bIs2D = FALSE; + m_sQueueSample.m_nReleasingVolumeModificator = 3; + m_sQueueSample.m_nFrequency = freq; + m_sQueueSample.m_nLoopCount = 0; + 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_bReleasingSoundFlag = FALSE; + m_sQueueSample.m_nReleasingVolumeDivider = 4; + m_sQueueSample.m_bReverbFlag = TRUE; + m_sQueueSample.m_bRequireReflection = FALSE; + AddSampleToRequestedQueue(); + } + if (isPlayerVeh) + prevFreq = freq; +} + +void cAudioManager::ProcessModelVehicle(cVehicleParams& params) { const float SOUND_INTENSITY = 35.0f; @@ -1003,7 +1364,7 @@ cAudioManager::ProcessModelVehicle(cVehicleParams& params) m_sQueueSample.m_nReleasingVolumeModificator = 1; m_sQueueSample.m_nFrequency = freq; m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_nEmittingVolume = volume; + SET_EMITTING_VOLUME(volume); SET_LOOP_OFFSETS(SFX_RC_REV) m_sQueueSample.m_fSpeedMultiplier = 3.0f; m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; @@ -1067,7 +1428,7 @@ cAudioManager::ProcessModelVehicle(cVehicleParams& params) m_sQueueSample.m_nReleasingVolumeModificator = 3; m_sQueueSample.m_nFrequency = freq; m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_nEmittingVolume = volume; + SET_EMITTING_VOLUME(volume); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 3.0f; m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; @@ -1087,60 +1448,66 @@ cAudioManager::ProcessModelVehicle(cVehicleParams& params) } void -cAudioManager::ProcessModelHeliVehicle(cVehicleParams& params) +cAudioManager::ProcessVehicleFlatTyre(cVehicleParams& params) { - const float SOUND_INTENSITY = 35.0f; + const float SOUND_INTENSITY = 60.0f; - static uint32 prevFreq = 22050; + CAutomobile* automobile; + CBike* bike; + bool8 wheelBurst; + uint8 emittingVol; - uint32 freq; - bool8 isPlayerVeh; - int16 acceletateState; - int16 brakeState; + float modifier; if (params.m_fDistance >= SQR(SOUND_INTENSITY)) return; - if (FindPlayerVehicle() == params.m_pVehicle) - isPlayerVeh = TRUE; - else -#ifdef FIX_BUGS - isPlayerVeh = CWorld::Players[CWorld::PlayerInFocus].m_pRemoteVehicle == params.m_pVehicle; -#else - isPlayerVeh = CWorld::Players[CWorld::PlayerInFocus].m_pRemoteVehicle != nil; -#endif - if (isPlayerVeh) { - brakeState = Pads[0].GetBrake(); - acceletateState = Max(Pads[0].GetAccelerate(), Abs(Pads[0].GetCarGunUpDown()) * 2); - } else { - acceletateState = 255.0f * params.m_pVehicle->m_fGasPedal; - brakeState = 255.0f * params.m_pVehicle->m_fBrakePedal; + switch (params.m_VehicleType) { + case VEHICLE_TYPE_CAR: + automobile = (CAutomobile*)params.m_pVehicle; + wheelBurst = FALSE; + for (int i = 0; i < 4; i++) + if (automobile->Damage.GetWheelStatus(i) == WHEEL_STATUS_BURST && automobile->m_aWheelTimer[i] > 0.0f) + wheelBurst = TRUE; + if (!wheelBurst) + return; + break; + case VEHICLE_TYPE_BIKE: + bike = (CBike*)params.m_pVehicle; + wheelBurst = FALSE; + for(int i = 0; i < 2; i++) + if (bike->m_wheelStatus[i] == WHEEL_STATUS_BURST && bike->m_aWheelTimer[i] > 0.0f) + wheelBurst = TRUE; + if (!wheelBurst) + return; + break; + default: + return; } - if (acceletateState < brakeState) - acceletateState = brakeState; - freq = Clamp2(5 * acceletateState + 22050, 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) { - m_sQueueSample.m_nCounter = 2; - m_sQueueSample.m_nSampleIndex = SFX_CAR_RC_HELI; - m_sQueueSample.m_nBankIndex = SFX_BANK_0; - m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_nReleasingVolumeModificator = 3; - m_sQueueSample.m_nFrequency = freq; - m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_nEmittingVolume = 70; - SET_LOOP_OFFSETS(SFX_CAR_RC_HELI) - m_sQueueSample.m_fSpeedMultiplier = 3.0f; - m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; - m_sQueueSample.m_bReleasingSoundFlag = FALSE; - m_sQueueSample.m_nReleasingVolumeDivider = 4; - m_sQueueSample.m_bReverbFlag = TRUE; - m_sQueueSample.m_bRequireReflection = FALSE; - AddSampleToRequestedQueue(); + modifier = Min(1.0f, Abs(params.m_fVelocityChange) / (0.3f * params.m_pTransmission->fMaxVelocity)); + if (modifier > 0.01f) { //mb can be replaced by (emittingVol > 1) + emittingVol = (100.0f * modifier); + CalculateDistance(params.m_bDistanceCalculated, params.m_fDistance); + m_sQueueSample.m_nVolume = ComputeVolume(emittingVol, SOUND_INTENSITY, m_sQueueSample.m_fDistance); + if (m_sQueueSample.m_nVolume) { + m_sQueueSample.m_nCounter = 95; + m_sQueueSample.m_nBankIndex = SFX_BANK_0; + m_sQueueSample.m_bIs2D = FALSE; + m_sQueueSample.m_nReleasingVolumeModificator = 5; + m_sQueueSample.m_nSampleIndex = SFX_TYRE_BURST_L; + m_sQueueSample.m_nFrequency = (5500.0f * modifier) + 8000; + m_sQueueSample.m_nLoopCount = 0; + 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_bReleasingSoundFlag = FALSE; + m_sQueueSample.m_nReleasingVolumeDivider = 3; + m_sQueueSample.m_bReverbFlag = TRUE; + m_sQueueSample.m_bRequireReflection = FALSE; + AddSampleToRequestedQueue(); + } } - if (isPlayerVeh) - prevFreq = freq; } bool8 @@ -1195,7 +1562,7 @@ cAudioManager::ProcessVehicleRoadNoise(cVehicleParams& params) } m_sQueueSample.m_nFrequency = freq; m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_nEmittingVolume = emittingVol; + SET_EMITTING_VOLUME(emittingVol); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 6.0f; m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; @@ -1254,7 +1621,7 @@ cAudioManager::ProcessWetRoadNoise(cVehicleParams& params) freq = SampleManager.GetSampleBaseFrequency(SFX_ROAD_NOISE); m_sQueueSample.m_nFrequency = freq + freq * multiplier; m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_nEmittingVolume = emittingVol; + SET_EMITTING_VOLUME(emittingVol); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 6.0f; m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; @@ -1478,7 +1845,7 @@ cAudioManager::ProcessVehicleEngine(cVehicleParams& params) 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; - m_sQueueSample.m_nEmittingVolume = emittingVol; + SET_EMITTING_VOLUME(emittingVol); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 6.0f; m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; @@ -1508,20 +1875,20 @@ cAudioManager::UpdateGasPedalAudio(CVehicle* veh, int vehType) } void -cAudioManager::PlayerJustGotInCar() const +cAudioManager::PlayerJustGotInCar() { if (m_bIsInitialised) bPlayerJustEnteredCar = TRUE; } void -cAudioManager::PlayerJustLeftCar(void) const +cAudioManager::PlayerJustLeftCar(void) { // UNUSED: This is a perfectly empty function. } void -cAudioManager::AddPlayerCarSample(uint8 emittingVolume, int32 freq, uint32 sample, uint8 bank, uint8 counter, bool8 notLooping) +cAudioManager::AddPlayerCarSample(uint8 emittingVolume, uint32 freq, uint32 sample, uint8 bank, uint8 counter, bool8 notLooping) { m_sQueueSample.m_nVolume = ComputeVolume(emittingVolume, 50.f, m_sQueueSample.m_fDistance); if (m_sQueueSample.m_nVolume != 0) { @@ -1541,7 +1908,7 @@ cAudioManager::AddPlayerCarSample(uint8 emittingVolume, int32 freq, uint32 sampl } else { m_sQueueSample.m_nLoopCount = 1; } - m_sQueueSample.m_nEmittingVolume = emittingVolume; + SET_EMITTING_VOLUME(emittingVolume); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 6.0f; m_sQueueSample.m_fSoundIntensity = 50.0f; @@ -1567,7 +1934,7 @@ cAudioManager::ProcessCesna(cVehicleParams ¶ms) m_sQueueSample.m_nFrequency = 12500; m_sQueueSample.m_nLoopCount = 0; m_sQueueSample.m_nReleasingVolumeDivider = 8; - m_sQueueSample.m_nEmittingVolume = 80; + SET_EMITTING_VOLUME(80); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 4.0f; m_sQueueSample.m_fSoundIntensity = 200.0f; @@ -1587,7 +1954,7 @@ cAudioManager::ProcessCesna(cVehicleParams ¶ms) m_sQueueSample.m_nFrequency = 25000; m_sQueueSample.m_nLoopCount = 0; m_sQueueSample.m_nReleasingVolumeDivider = 4; - m_sQueueSample.m_nEmittingVolume = 80; + SET_EMITTING_VOLUME(80); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 4.0f; m_sQueueSample.m_fSoundIntensity = 90.0f; @@ -1909,6 +2276,9 @@ cAudioManager::ProcessPlayersVehicleEngine(cVehicleParams& params, CVehicle* veh AddPlayerCarSample(vol, freq, engineSoundType - CAR_SFX_BANKS_OFFSET + SFX_CAR_REV_1, SFX_BANK_0, 2, TRUE); } else { TranslateEntity(&m_sQueueSample.m_vecPos, &pos); +#ifndef EXTERNAL_3D_SOUND + m_sQueueSample.m_nOffset = ComputePan(m_sQueueSample.m_fDistance, &pos); +#endif if (bAccelSampleStopped) { if (CurrentPretendGear != 1 || currentGear != 2) CurrentPretendGear = Max(1, currentGear - 1); @@ -1916,10 +2286,15 @@ cAudioManager::ProcessPlayersVehicleEngine(cVehicleParams& params, CVehicle* veh bAccelSampleStopped = FALSE; } if (channelUsed) { +#ifdef EXTERNAL_3D_SOUND SampleManager.SetChannelEmittingVolume(CHANNEL_PLAYER_VEHICLE_ENGINE, 120); SampleManager.SetChannel3DPosition(CHANNEL_PLAYER_VEHICLE_ENGINE, pos.x, pos.y, pos.z); - SampleManager.SetChannel3DDistances(CHANNEL_PLAYER_VEHICLE_ENGINE, 50.0f, 12.5f); - freq = (GearFreqAdj[CurrentPretendGear] + freqModifier + 22050) ; + SampleManager.SetChannel3DDistances(CHANNEL_PLAYER_VEHICLE_ENGINE, 50.0f, 50.0f * 0.25f); +#else + SampleManager.SetChannelVolume(CHANNEL_PLAYER_VEHICLE_ENGINE, ComputeVolume(120, 50.0f, m_sQueueSample.m_fDistance)); + SampleManager.SetChannelPan(CHANNEL_PLAYER_VEHICLE_ENGINE, m_sQueueSample.m_nOffset); +#endif + freq = GearFreqAdj[CurrentPretendGear] + freqModifier + 22050; if (engineSoundType == SFX_BANK_TRUCK) freq /= 2; SampleManager.SetChannelFrequency(CHANNEL_PLAYER_VEHICLE_ENGINE, freq); @@ -1935,9 +2310,14 @@ cAudioManager::ProcessPlayersVehicleEngine(cVehicleParams& params, CVehicle* veh SampleManager.SetChannelLoopCount(CHANNEL_PLAYER_VEHICLE_ENGINE, 1); SampleManager.SetChannelLoopPoints(CHANNEL_PLAYER_VEHICLE_ENGINE, 0, -1); +#ifdef EXTERNAL_3D_SOUND SampleManager.SetChannelEmittingVolume(CHANNEL_PLAYER_VEHICLE_ENGINE, 120); SampleManager.SetChannel3DPosition(CHANNEL_PLAYER_VEHICLE_ENGINE, pos.x, pos.y, pos.z); - SampleManager.SetChannel3DDistances(CHANNEL_PLAYER_VEHICLE_ENGINE, 50.0f, 12.5f); + SampleManager.SetChannel3DDistances(CHANNEL_PLAYER_VEHICLE_ENGINE, 50.0f, 50.0f * 0.25f); +#else + SampleManager.SetChannelVolume(CHANNEL_PLAYER_VEHICLE_ENGINE, ComputeVolume(120, 50.0f, m_sQueueSample.m_fDistance)); + SampleManager.SetChannelPan(CHANNEL_PLAYER_VEHICLE_ENGINE, m_sQueueSample.m_nOffset); +#endif freq = (GearFreqAdj[CurrentPretendGear] + freqModifier + 22050); if (engineSoundType == SFX_BANK_TRUCK) freq /= 2; @@ -1955,9 +2335,14 @@ cAudioManager::ProcessPlayersVehicleEngine(cVehicleParams& params, CVehicle* veh SampleManager.SetChannelLoopCount(CHANNEL_PLAYER_VEHICLE_ENGINE, 1); SampleManager.SetChannelLoopPoints(CHANNEL_PLAYER_VEHICLE_ENGINE, 0, -1); +#ifdef EXTERNAL_3D_SOUND SampleManager.SetChannelEmittingVolume(CHANNEL_PLAYER_VEHICLE_ENGINE, 120); SampleManager.SetChannel3DPosition(CHANNEL_PLAYER_VEHICLE_ENGINE, pos.x, pos.y, pos.z); - SampleManager.SetChannel3DDistances(CHANNEL_PLAYER_VEHICLE_ENGINE, 50.0f, 12.5f); + SampleManager.SetChannel3DDistances(CHANNEL_PLAYER_VEHICLE_ENGINE, 50.0f, 50.0f * 0.25f); +#else + SampleManager.SetChannelVolume(CHANNEL_PLAYER_VEHICLE_ENGINE, ComputeVolume(120, 50.0f, m_sQueueSample.m_fDistance)); + SampleManager.SetChannelPan(CHANNEL_PLAYER_VEHICLE_ENGINE, m_sQueueSample.m_nOffset); +#endif freq = (GearFreqAdj[CurrentPretendGear] + freqModifier + 22050); if (engineSoundType == SFX_BANK_TRUCK) freq /= 2; @@ -2103,7 +2488,7 @@ cAudioManager::ProcessVehicleSkidding(cVehicleParams& params) m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_nReleasingVolumeModificator = 8; m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_nEmittingVolume = emittingVol; + SET_EMITTING_VOLUME(emittingVol); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 3.0f; m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; @@ -2206,9 +2591,9 @@ cAudioManager::ProcessVehicleHorn(cVehicleParams& params) m_sQueueSample.m_nFrequency = aVehicleSettings[params.m_nIndex].m_nHornFrequency; m_sQueueSample.m_nLoopCount = 0; #ifdef FIX_BUGS - m_sQueueSample.m_nEmittingVolume = volume; + SET_EMITTING_VOLUME(volume); #else - m_sQueueSample.m_nEmittingVolume = 80; + SET_EMITTING_VOLUME(80); #endif SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 5.0f; @@ -2224,13 +2609,13 @@ cAudioManager::ProcessVehicleHorn(cVehicleParams& params) } bool8 -cAudioManager::UsesSiren(cVehicleParams& params) const +cAudioManager::UsesSiren(cVehicleParams& params) { return params.m_pVehicle->UsesSiren(); } bool8 -cAudioManager::UsesSirenSwitching(cVehicleParams& params) const +cAudioManager::UsesSirenSwitching(cVehicleParams& params) { if (params.m_nIndex == FIRETRUK || params.m_nIndex == MRWHOOP) return FALSE; @@ -2290,7 +2675,7 @@ cAudioManager::ProcessVehicleSirenOrAlarm(cVehicleParams& params) m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_nReleasingVolumeModificator = 1; m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_nEmittingVolume = volume; + SET_EMITTING_VOLUME(volume); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 7.0f; m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; @@ -2304,7 +2689,7 @@ cAudioManager::ProcessVehicleSirenOrAlarm(cVehicleParams& params) } bool8 -cAudioManager::UsesReverseWarning(int32 model) const +cAudioManager::UsesReverseWarning(uint32 model) { return model == LINERUN || model == FIRETRUK || model == BUS || model == COACH || model == PACKER || model == FLATBED; } @@ -2333,9 +2718,9 @@ cAudioManager::ProcessVehicleReverseWarning(cVehicleParams& params) m_sQueueSample.m_nFrequency = (100 * m_sQueueSample.m_nEntityIndex & 1023) + SampleManager.GetSampleBaseFrequency(SFX_REVERSE_WARNING); m_sQueueSample.m_nLoopCount = 0; #ifdef FIX_BUGS - m_sQueueSample.m_nEmittingVolume = volume; + SET_EMITTING_VOLUME(volume); #else - m_sQueueSample.m_nEmittingVolume = 60; + SET_EMITTING_VOLUME(60); #endif SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 3.0f; @@ -2381,7 +2766,7 @@ cAudioManager::ProcessVehicleDoors(cVehicleParams& params) m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_nReleasingVolumeModificator = 10; m_sQueueSample.m_nLoopCount = 1; - m_sQueueSample.m_nEmittingVolume = emittingVol; + SET_EMITTING_VOLUME(emittingVol); RESET_LOOP_OFFSETS m_sQueueSample.m_fSpeedMultiplier = 1.0f; m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; @@ -2426,7 +2811,7 @@ cAudioManager::ProcessAirBrakes(cVehicleParams& params) m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_nReleasingVolumeModificator = 10; m_sQueueSample.m_nLoopCount = 1; - m_sQueueSample.m_nEmittingVolume = volume; + SET_EMITTING_VOLUME(volume); RESET_LOOP_OFFSETS m_sQueueSample.m_fSpeedMultiplier = 0.0f; m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; @@ -2440,7 +2825,7 @@ cAudioManager::ProcessAirBrakes(cVehicleParams& params) } bool8 -cAudioManager::HasAirBrakes(int32 model) const +cAudioManager::HasAirBrakes(uint32 model) { return model == LINERUN || model == FIRETRUK || model == TRASH || model == BUS || model == BARRACKS || model == COACH || model == PACKER || model == FLATBED; @@ -2482,7 +2867,7 @@ cAudioManager::ProcessEngineDamage(cVehicleParams& params) m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_nEmittingVolume = emittingVolume; + SET_EMITTING_VOLUME(emittingVolume); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 2.0f; m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; @@ -2530,7 +2915,7 @@ cAudioManager::ProcessCarBombTick(cVehicleParams& params) m_sQueueSample.m_nReleasingVolumeModificator = 0; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_COUNTDOWN); m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_nEmittingVolume = EMITTING_VOLUME; + SET_EMITTING_VOLUME(EMITTING_VOLUME); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 2.0f; m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; @@ -2652,7 +3037,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams& params) m_sQueueSample.m_nSampleIndex = SFX_GLASS_CRACK; m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_nCounter = 68; - emittingVol = m_anRandomTable[1] % 30 + 80; //GetRandomNumberInRange(1, 80, 109) + emittingVol = m_anRandomTable[1] % 30 + 80; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_GLASS_CRACK); m_sQueueSample.m_nReleasingVolumeModificator = 5; m_sQueueSample.m_fSpeedMultiplier = 0.0f; @@ -2955,7 +3340,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams& params) CPed *pPed = params.m_pVehicle->pDriver; if(!pPed) break; - if(!pPed->HasWeaponSlot(WEAPONSLOT_SUBMACHINEGUN)) { + if(!pPed->HasWeaponSlot(WEAPONSLOT_SUBMACHINEGUN) || (params.m_pVehicle->GetModelIndex() == MI_PREDATOR && !pPed->IsPedDoingDriveByShooting())) { sampleIndex = SFX_UZI_LEFT; frequency = SampleManager.GetSampleBaseFrequency(sampleIndex); frequency += RandomDisplacement(frequency / 32); @@ -3124,7 +3509,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams& params) m_sQueueSample.m_bReleasingSoundFlag = TRUE; } SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) - m_sQueueSample.m_nEmittingVolume = emittingVol; + SET_EMITTING_VOLUME(emittingVol); m_sQueueSample.m_bReverbFlag = TRUE; if (isHeli) { if (0.2f * m_sQueueSample.m_fSoundIntensity > m_sQueueSample.m_fDistance) { @@ -3197,7 +3582,7 @@ cAudioManager::ProcessTrainNoise(cVehicleParams& params) m_sQueueSample.m_nReleasingVolumeModificator = 2; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_TRAIN_FAR); m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_nEmittingVolume = emittingVol; + SET_EMITTING_VOLUME(emittingVol); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 3.0f; m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; @@ -3219,7 +3604,7 @@ cAudioManager::ProcessTrainNoise(cVehicleParams& params) m_sQueueSample.m_nReleasingVolumeModificator = 5; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_TRAIN_NEAR) + 100 * m_sQueueSample.m_nEntityIndex % 987; m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_nEmittingVolume = emittingVol; + SET_EMITTING_VOLUME(emittingVol); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 6.0f; m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; @@ -3341,7 +3726,7 @@ cAudioManager::ProcessBoatEngine(cVehicleParams& params) m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_nReleasingVolumeModificator = 3; m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_nEmittingVolume = Vol; + SET_EMITTING_VOLUME(Vol); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 2.0f; m_sQueueSample.m_fSoundIntensity = intensity; @@ -3365,7 +3750,7 @@ cAudioManager::ProcessBoatEngine(cVehicleParams& params) m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_nReleasingVolumeModificator = 3; m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_nEmittingVolume = 80; + SET_EMITTING_VOLUME(80); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 2.0f; m_sQueueSample.m_fSoundIntensity = intensity; @@ -3412,7 +3797,7 @@ cAudioManager::ProcessBoatMovingOverWater(cVehicleParams& params) m_sQueueSample.m_nReleasingVolumeModificator = 3; m_sQueueSample.m_nFrequency = (6050.f * multiplier) + 16000; m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_nEmittingVolume = vol; + SET_EMITTING_VOLUME(vol); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 2.0f; m_sQueueSample.m_fSoundIntensity = 50.0f; @@ -3427,412 +3812,6 @@ cAudioManager::ProcessBoatMovingOverWater(cVehicleParams& params) } void -cAudioManager::ProcessCarHeli(cVehicleParams& params) -{ - const float SOUND_INTENSITY = 250.0f; - - CVehicle* playerVeh; - CVehicle* veh; - CAutomobile* automobile; - CBoat* boat; - - uint8 emittingVol; - int16 brakeState; - int16 accelerateState; - uint32 freq; - float propellerSpeed; - float freqModifier; //may be relate to angle with horison - float cameraAngle; - bool8 distanceCalculatedOld; - float distanceOld; - CVector vecPosOld; - - float volumeModifier;//TODO find better name - bool8 hunterBool; - - static uint32 freqFrontPrev = 14287; - static uint32 freqPropellerPrev = 7143; - static uint32 freqSkimmerPrev = 14287; - - boat = nil; - automobile = nil; - hunterBool = FALSE; - - if (params.m_fDistance >= SQR(SOUND_INTENSITY)) - return; - - playerVeh = FindPlayerVehicle(); - veh = params.m_pVehicle; - if (playerVeh == veh) { - accelerateState = Pads[0].GetAccelerate(); - brakeState = Pads[0].GetBrake(); - } else { - accelerateState = veh->m_fGasPedal * 255.0f; - brakeState = veh->m_fBrakePedal * 255.0f; - } - freqModifier = Abs(veh->GetUp().y); - cameraAngle = (DotProduct(veh->GetMatrix().GetForward(), TheCamera.GetForward()) + 1.0f) / 2.0f; - if (veh->m_modelIndex == MI_SKIMMER) { - boat = (CBoat*)veh; - propellerSpeed = boat->m_fMovingSpeed * 50.0f / 11.0f; - } else if (params.m_VehicleType == VEHICLE_TYPE_HELI) { - propellerSpeed = 1.0f; - } else { - automobile = (CAutomobile*)veh; - propellerSpeed = automobile->m_aWheelSpeed[1] * 50.0f / 11.0f; - } - - if (propellerSpeed == 0.0f) - return; - - propellerSpeed = Min(1.0f, propellerSpeed); - CalculateDistance(params.m_bDistanceCalculated, params.m_fDistance); - - - //sound on long distances - if (m_sQueueSample.m_fDistance >= 40.0f) - emittingVol = propellerSpeed * 75.0f; - else if (m_sQueueSample.m_fDistance >= 25.0f) - emittingVol = (m_sQueueSample.m_fDistance - 25.0f) * (75.0f * propellerSpeed) / 15.0f; - else - emittingVol = 0; - if (emittingVol != 0) { - m_sQueueSample.m_nVolume = ComputeVolume(emittingVol, SOUND_INTENSITY, m_sQueueSample.m_fDistance); - if (m_sQueueSample.m_nVolume != 0) { - m_sQueueSample.m_nCounter = 88; - if (boat != nil) { - m_sQueueSample.m_nSampleIndex = SFX_SEAPLANE_PRO3; - m_sQueueSample.m_nBankIndex = SFX_BANK_0; - if (accelerateState > 0 || brakeState > 0) - m_sQueueSample.m_nFrequency = 4600 + Min(1.0f, (Max(accelerateState, brakeState) / 255.0f) * freqModifier) * 563; - else - m_sQueueSample.m_nFrequency = 3651 + Min(1.0f, freqModifier) * 949; - } else { - m_sQueueSample.m_nSampleIndex = SFX_HELI_1; - m_sQueueSample.m_nBankIndex = SFX_BANK_0; - m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex); - } - m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_nReleasingVolumeModificator = 2; - m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_nEmittingVolume = 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 = 5; - m_sQueueSample.m_bReverbFlag = TRUE; - m_sQueueSample.m_bRequireReflection = FALSE; - AddSampleToRequestedQueue(); - } - } - - CVector backPropellerPos; - if (automobile != nil) - automobile->GetComponentWorldPosition(CAR_BOOT, backPropellerPos); - else if (params.m_VehicleType == VEHICLE_TYPE_HELI) -#ifdef FIX_BUGS - backPropellerPos = -#endif - params.m_pVehicle->GetMatrix() * CVector(0.0f, -10.0f, 0.0f); - else - backPropellerPos = m_sQueueSample.m_vecPos; - - if (params.m_fDistance >= SQR(140.0f)) - return; - - if (propellerSpeed >= 0.4f) - volumeModifier = (propellerSpeed - 0.4f) * 5.0f / 3.0f; - else - volumeModifier = 0.0f; - if (!boat) { - freq = Min(1300, 7000.0f * freqModifier); - if (playerVeh == veh && (accelerateState > 0 || brakeState > 0) && freq < 1300)//unnesesary freqModifier alredy <= 1300 - freq = 1300; - if (veh->m_modelIndex == MI_HUNTER) - hunterBool = TRUE; - } - - - //sound from front of helicopter - emittingVol = (1.0f - cameraAngle) * volumeModifier * 127.0f; - m_sQueueSample.m_nVolume = ComputeVolume(emittingVol, 140.0f, m_sQueueSample.m_fDistance); - if (m_sQueueSample.m_nVolume != 0) { - m_sQueueSample.m_nCounter = 3; - if (hunterBool) { - m_sQueueSample.m_nSampleIndex = SFX_HELI_APACHE_1; - m_sQueueSample.m_nBankIndex = SFX_BANK_0; - m_sQueueSample.m_nFrequency = (volumeModifier + 1.0f) * 16000 + freq; - m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_nReleasingVolumeModificator = 1; - m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_nEmittingVolume = emittingVol; - SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) - m_sQueueSample.m_fSpeedMultiplier = 6.0f; - m_sQueueSample.m_fSoundIntensity = 140.0f; - m_sQueueSample.m_bReleasingSoundFlag = FALSE; - m_sQueueSample.m_nReleasingVolumeDivider = 5; - m_sQueueSample.m_bReverbFlag = TRUE; - m_sQueueSample.m_bRequireReflection = FALSE; - AddSampleToRequestedQueue(); - } else if (boat != nil) { - m_sQueueSample.m_nSampleIndex = SFX_SEAPLANE_PRO1; - m_sQueueSample.m_nBankIndex = SFX_BANK_0; - - if (accelerateState > 0 || brakeState > 0) - m_sQueueSample.m_nFrequency = 18000 + Min(1.0f, freqModifier * (Max(accelerateState, brakeState) / 255.0f)) * 2204; - else - m_sQueueSample.m_nFrequency = 14287 + Min(1.0f, freqModifier) * 3713; - if (propellerSpeed < 1.0f) - m_sQueueSample.m_nFrequency = (propellerSpeed + 1.0f) * (m_sQueueSample.m_nFrequency / 2.0f); - m_sQueueSample.m_nFrequency = Clamp2(m_sQueueSample.m_nFrequency, freqFrontPrev, 197); - freqFrontPrev = m_sQueueSample.m_nFrequency; - - m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_nReleasingVolumeModificator = 1; - m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_nEmittingVolume = emittingVol; - SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) - m_sQueueSample.m_fSpeedMultiplier = 6.0f; - m_sQueueSample.m_fSoundIntensity = 140.0f; - m_sQueueSample.m_bReleasingSoundFlag = FALSE; - m_sQueueSample.m_nReleasingVolumeDivider = 5; - m_sQueueSample.m_bReverbFlag = TRUE; - m_sQueueSample.m_bRequireReflection = FALSE; - AddSampleToRequestedQueue(); - } else { - m_sQueueSample.m_nSampleIndex = SFX_CAR_HELI_MAI; - m_sQueueSample.m_nBankIndex = SFX_BANK_0; - m_sQueueSample.m_nFrequency = (volumeModifier + 1) * 16000 + freq; - m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_nReleasingVolumeModificator = 1; - m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_nEmittingVolume = emittingVol; - SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) - m_sQueueSample.m_fSpeedMultiplier = 6.0f; - m_sQueueSample.m_fSoundIntensity = 140.0f; - m_sQueueSample.m_bReleasingSoundFlag = FALSE; - m_sQueueSample.m_nReleasingVolumeDivider = 5; - m_sQueueSample.m_bReverbFlag = TRUE; - m_sQueueSample.m_bRequireReflection = FALSE; - AddSampleToRequestedQueue(); - } - } - - - //after accel rotor sound - emittingVol = ((cameraAngle + 1.0f) * volumeModifier * 127.0f) / 2.0f; - m_sQueueSample.m_nVolume = ComputeVolume(emittingVol, 140.0f, m_sQueueSample.m_fDistance); - if (m_sQueueSample.m_nVolume != 0) { - m_sQueueSample.m_nCounter = 1; - if (hunterBool) { - m_sQueueSample.m_nSampleIndex = SFX_HELI_APACHE_2; - m_sQueueSample.m_nBankIndex = SFX_BANK_0; - m_sQueueSample.m_nFrequency = (volumeModifier + 1) * 16000 + freq; - } else if (boat) { - m_sQueueSample.m_nSampleIndex = SFX_SEAPLANE_PRO2; - m_sQueueSample.m_nBankIndex = SFX_BANK_0; - - if (accelerateState > 0 || brakeState > 0) - m_sQueueSample.m_nFrequency = 9000 + Min(1.0f, (Max(accelerateState, brakeState) / 255) * freqModifier) * 1102; - else - m_sQueueSample.m_nFrequency = 7143 + Min(1.0f, freqModifier) * 1857; - - if (propellerSpeed < 1.0f) - m_sQueueSample.m_nFrequency = (propellerSpeed + 1) * (m_sQueueSample.m_nFrequency / 2); - - m_sQueueSample.m_nFrequency = Clamp2(m_sQueueSample.m_nFrequency, freqPropellerPrev, 98); - freqPropellerPrev = m_sQueueSample.m_nFrequency; - } else { - m_sQueueSample.m_nSampleIndex = SFX_CAR_HELI_MAI2; - m_sQueueSample.m_nBankIndex = SFX_BANK_0; - m_sQueueSample.m_nFrequency = (volumeModifier + 1) * 16000 + freq; - } - m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_nReleasingVolumeModificator = 1; - m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_nEmittingVolume = emittingVol; - SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) - m_sQueueSample.m_fSpeedMultiplier = 6.0f; - m_sQueueSample.m_fSoundIntensity = 140.0f; - m_sQueueSample.m_bReleasingSoundFlag = FALSE; - m_sQueueSample.m_nReleasingVolumeDivider = 5; - m_sQueueSample.m_bReverbFlag = TRUE; - m_sQueueSample.m_bRequireReflection = FALSE; - AddSampleToRequestedQueue(); - } - - - //engine starting sound - if (boat == nil && params.m_VehicleType != VEHICLE_TYPE_HELI && m_sQueueSample.m_fDistance < 30.0f) { //strange way to check if automobile != nil - if (automobile->bEngineOn) { - if (propellerSpeed < 1.0f) { - emittingVol = (1.0f - propellerSpeed / 2.0f) * 70.0f; - m_sQueueSample.m_nVolume = ComputeVolume(emittingVol, 30.0f, m_sQueueSample.m_fDistance); - if (m_sQueueSample.m_nVolume) { - if (hunterBool) { - m_sQueueSample.m_nSampleIndex = SFX_HELI_APACHE_4; - m_sQueueSample.m_nBankIndex = SFX_BANK_0; - freq = 3000.0f * propellerSpeed + 30000; - } else { - m_sQueueSample.m_nSampleIndex = SFX_CAR_HELI_STA; - m_sQueueSample.m_nBankIndex = SFX_BANK_0; - freq = 3000.0f * propellerSpeed + 6000; - } - m_sQueueSample.m_nFrequency = freq; - m_sQueueSample.m_nCounter = 12; - m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_nReleasingVolumeModificator = 1; - m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_nEmittingVolume = emittingVol; - SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) - m_sQueueSample.m_fSpeedMultiplier = 6.0f; - m_sQueueSample.m_fSoundIntensity = 30.0f; - m_sQueueSample.m_bReleasingSoundFlag = FALSE; - m_sQueueSample.m_nReleasingVolumeDivider = 30; - m_sQueueSample.m_bReverbFlag = TRUE; - m_sQueueSample.m_bRequireReflection = FALSE; - AddSampleToRequestedQueue(); - } - } - } - } - - - if (boat) { - if (TheCamera.Cams[TheCamera.ActiveCam].Mode == CCam::MODE_FIXED && m_sQueueSample.m_fDistance < 20.0f && propellerSpeed > 0.0f) { - m_sQueueSample.m_nVolume = ComputeVolume(propellerSpeed * 100.0f, 20.0f, m_sQueueSample.m_fDistance); - if (m_sQueueSample.m_nVolume) { - - if (accelerateState > 0 || brakeState > 0) - m_sQueueSample.m_nFrequency = 18000 + Min(1.0f, (Max(accelerateState, brakeState) / 255.0f) * freqModifier) * 2204; - else - m_sQueueSample.m_nFrequency = 14287 + Min(1.0f, freqModifier) * 3713; - if (propellerSpeed < 1.0f) - m_sQueueSample.m_nFrequency = (propellerSpeed + 1) * (m_sQueueSample.m_nFrequency / 2.0f); - m_sQueueSample.m_nFrequency = Clamp2(m_sQueueSample.m_nFrequency, freqSkimmerPrev, 197); - freqSkimmerPrev = m_sQueueSample.m_nFrequency; - - m_sQueueSample.m_nSampleIndex = SFX_SEAPLANE_PRO4; - m_sQueueSample.m_nBankIndex = SFX_BANK_0; - m_sQueueSample.m_nCounter = 12; - m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_nReleasingVolumeModificator = 3; - m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_nEmittingVolume = propellerSpeed * 100.0f; - SET_LOOP_OFFSETS(SFX_SEAPLANE_PRO4) - m_sQueueSample.m_fSpeedMultiplier = 5.0f; - m_sQueueSample.m_fSoundIntensity = 20.0f; - m_sQueueSample.m_bReleasingSoundFlag = FALSE; - m_sQueueSample.m_nReleasingVolumeDivider = 7; - m_sQueueSample.m_bReverbFlag = TRUE; - m_sQueueSample.m_bRequireReflection = FALSE; - AddSampleToRequestedQueue(); - } - } - } else { - //vacuum cleaner sound - vecPosOld = m_sQueueSample.m_vecPos; - distanceCalculatedOld = params.m_bDistanceCalculated; - distanceOld = params.m_fDistance; - - m_sQueueSample.m_vecPos = backPropellerPos; - params.m_bDistanceCalculated = FALSE; - params.m_fDistance = GetDistanceSquared(m_sQueueSample.m_vecPos); - if (params.m_fDistance < SQR(27.0f)) { - CalculateDistance(params.m_bDistanceCalculated, params.m_fDistance); - m_sQueueSample.m_nVolume = ComputeVolume(volumeModifier * 25.0f, 27.0f, m_sQueueSample.m_fDistance); - if (m_sQueueSample.m_nVolume) { - m_sQueueSample.m_nCounter = 2; - m_sQueueSample.m_nSampleIndex = hunterBool ? SFX_HELI_APACHE_3 : SFX_CAR_HELI_REA; - m_sQueueSample.m_nBankIndex = SFX_BANK_0; - m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_nReleasingVolumeModificator = 1; - m_sQueueSample.m_nFrequency = (volumeModifier + 1.0f) * 16000; - m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_nEmittingVolume = 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_bReleasingSoundFlag = FALSE; - m_sQueueSample.m_nReleasingVolumeDivider = 5; - m_sQueueSample.m_bReverbFlag = TRUE; - m_sQueueSample.m_bRequireReflection = FALSE; - AddSampleToRequestedQueue(); - } - } - - m_sQueueSample.m_vecPos = vecPosOld; - params.m_bDistanceCalculated = distanceCalculatedOld; - params.m_fDistance = distanceOld; - } -} - -void -cAudioManager::ProcessVehicleFlatTyre(cVehicleParams& params) -{ - const float SOUND_INTENSITY = 60.0f; - - CAutomobile* automobile; - CBike* bike; - bool8 wheelBurst; - uint8 emittingVol; - - float modifier; - - if (params.m_fDistance >= SQR(SOUND_INTENSITY)) - return; - - switch (params.m_VehicleType) { - case VEHICLE_TYPE_CAR: - automobile = (CAutomobile*)params.m_pVehicle; - wheelBurst = FALSE; - for (int i = 0; i < 4; i++) - if (automobile->Damage.GetWheelStatus(i) == WHEEL_STATUS_BURST && automobile->m_aWheelTimer[i] > 0.0f) - wheelBurst = TRUE; - if (!wheelBurst) - return; - break; - case VEHICLE_TYPE_BIKE: - bike = (CBike*)params.m_pVehicle; - wheelBurst = FALSE; - for(int i = 0; i < 2; i++) - if (bike->m_wheelStatus[i] == WHEEL_STATUS_BURST && bike->m_aWheelTimer[i] > 0.0f) - wheelBurst = TRUE; - if (!wheelBurst) - return; - break; - default: - return; - } - modifier = Min(1.0f, Abs(params.m_fVelocityChange) / (0.3f * params.m_pTransmission->fMaxVelocity)); - if (modifier > 0.01f) { //mb can be replaced by (emittingVol > 1) - emittingVol = (100.0f * modifier); - CalculateDistance(params.m_bDistanceCalculated, params.m_fDistance); - m_sQueueSample.m_nVolume = ComputeVolume(emittingVol, SOUND_INTENSITY, m_sQueueSample.m_fDistance); - if (m_sQueueSample.m_nVolume) { - m_sQueueSample.m_nCounter = 95; - m_sQueueSample.m_nBankIndex = SFX_BANK_0; - m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_nReleasingVolumeModificator = 5; - m_sQueueSample.m_nSampleIndex = SFX_TYRE_BURST_L; - m_sQueueSample.m_nFrequency = (5500.0f * modifier) + 8000; - m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_nEmittingVolume = emittingVol; - SET_LOOP_OFFSETS(SFX_TYRE_BURST_L) - m_sQueueSample.m_fSpeedMultiplier = 2.0f; - m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; - m_sQueueSample.m_bReleasingSoundFlag = FALSE; - m_sQueueSample.m_nReleasingVolumeDivider = 3; - m_sQueueSample.m_bReverbFlag = TRUE; - m_sQueueSample.m_bRequireReflection = FALSE; - AddSampleToRequestedQueue(); - } - } -} - -//TODO use it in ProcessVehicle -void cAudioManager::ProcessPlane(cVehicleParams& params) { switch (params.m_nIndex) { @@ -3853,8 +3832,8 @@ uint8 gJumboVolOffsetPercentage; void DoJumboVolOffset() { - if (!(AudioManager.GetFrameCounter() % (AudioManager.GetRandomNumber(0) % 6 + 3))) - gJumboVolOffsetPercentage = AudioManager.GetRandomNumber(1) % 60; + if (!(AudioManager.m_FrameCounter % (AudioManager.m_anRandomTable[0] % 6 + 3))) + gJumboVolOffsetPercentage = AudioManager.m_anRandomTable[1] % 60; } void @@ -3985,7 +3964,7 @@ cAudioManager::SetupJumboTaxiSound(uint8 vol) m_sQueueSample.m_nReleasingVolumeModificator = 1; m_sQueueSample.m_nFrequency = GetJumboTaxiFreq(); m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_nEmittingVolume = emittingVol; + SET_EMITTING_VOLUME(emittingVol); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 4.0f; m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; @@ -4016,7 +3995,7 @@ cAudioManager::SetupJumboWhineSound(uint8 emittingVol, uint32 freq) m_sQueueSample.m_nReleasingVolumeModificator = 1; m_sQueueSample.m_nFrequency = freq; m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_nEmittingVolume = emittingVol; + SET_EMITTING_VOLUME(emittingVol); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 4.0f; m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; @@ -4046,7 +4025,7 @@ cAudioManager::SetupJumboEngineSound(uint8 vol, uint32 freq) m_sQueueSample.m_nReleasingVolumeModificator = 1; m_sQueueSample.m_nFrequency = freq; m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_nEmittingVolume = emittingVol; + SET_EMITTING_VOLUME(emittingVol); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 4.0f; m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; @@ -4075,7 +4054,7 @@ cAudioManager::SetupJumboFlySound(uint8 emittingVol) m_sQueueSample.m_nReleasingVolumeModificator = 1; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_JUMBO_DIST_FLY); m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_nEmittingVolume = emittingVol; + SET_EMITTING_VOLUME(emittingVol); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 4.0f; m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; @@ -4105,7 +4084,7 @@ cAudioManager::SetupJumboRumbleSound(uint8 emittingVol) m_sQueueSample.m_nReleasingVolumeModificator = 1; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_JUMBO_RUMBLE); m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_nEmittingVolume = emittingVol; + SET_EMITTING_VOLUME(emittingVol); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 4.0f; m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; @@ -4118,14 +4097,14 @@ cAudioManager::SetupJumboRumbleSound(uint8 emittingVol) m_sQueueSample.m_nCounter = 6; m_sQueueSample.m_nSampleIndex = SFX_JUMBO_RUMBLE; m_sQueueSample.m_nFrequency += 200; - m_sQueueSample.m_nOffset = MAX_VOLUME; + m_sQueueSample.m_nOffset = 127; AddSampleToRequestedQueue(); } return TRUE; } int32 -cAudioManager::GetJumboTaxiFreq() const +cAudioManager::GetJumboTaxiFreq() { return (1.f / 180 * 10950 * m_sQueueSample.m_fDistance) + 22050; // todo port fix to re3 } @@ -4244,7 +4223,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_fSoundIntensity = 20.0f; m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS - m_sQueueSample.m_nEmittingVolume = emittingVol; + SET_EMITTING_VOLUME(emittingVol); m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_bReleasingSoundFlag = TRUE; m_sQueueSample.m_bRequireReflection = TRUE; @@ -4271,7 +4250,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_fSoundIntensity = 30.0f; m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS - m_sQueueSample.m_nEmittingVolume = emittingVol; + SET_EMITTING_VOLUME(emittingVol); m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_bReleasingSoundFlag = TRUE; m_sQueueSample.m_bRequireReflection = TRUE; @@ -4289,6 +4268,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_nFrequency = 20000; goto AddFightSound; case SOUND_FIGHT_40: + case SOUND_186: m_sQueueSample.m_nSampleIndex = SFX_FIGHT_2; m_sQueueSample.m_nFrequency = 18000; goto AddFightSound; @@ -4365,7 +4345,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS emittingVol = m_anRandomTable[3] % 26 + 100; - m_sQueueSample.m_nEmittingVolume = emittingVol; + SET_EMITTING_VOLUME(emittingVol); m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_bReleasingSoundFlag = TRUE; m_sQueueSample.m_bRequireReflection = TRUE; @@ -4420,7 +4400,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS emittingVol = m_anRandomTable[2] % 20 + 100; - m_sQueueSample.m_nEmittingVolume = emittingVol; + SET_EMITTING_VOLUME(emittingVol); m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_bReleasingSoundFlag = TRUE; m_sQueueSample.m_bRequireReflection = TRUE; @@ -4444,7 +4424,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_nLoopCount = 0; emittingVol = 100; SET_LOOP_OFFSETS(SFX_CAR_CHAINSAW_IDLE) - m_sQueueSample.m_nEmittingVolume = 100; + SET_EMITTING_VOLUME(100); m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_nReleasingVolumeDivider = 5; @@ -4467,7 +4447,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_nLoopCount = 0; emittingVol = 100; SET_LOOP_OFFSETS(SFX_CAR_CHAINSAW_ATTACK) - m_sQueueSample.m_nEmittingVolume = 100; + SET_EMITTING_VOLUME(100); m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_nReleasingVolumeDivider = 5; @@ -4492,7 +4472,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_nLoopCount = 0; emittingVol = 100; SET_LOOP_OFFSETS(SFX_CAR_CHAINSAW_ATTACK) - m_sQueueSample.m_nEmittingVolume = 100; + SET_EMITTING_VOLUME(100); m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_nReleasingVolumeDivider = 5; @@ -4517,7 +4497,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS emittingVol = m_anRandomTable[0] % 20 + 80; - m_sQueueSample.m_nEmittingVolume = emittingVol; + SET_EMITTING_VOLUME(emittingVol); m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_bReleasingSoundFlag = TRUE; m_sQueueSample.m_bRequireReflection = TRUE; @@ -4537,7 +4517,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS emittingVol = m_anRandomTable[1] % 10 + 90; - m_sQueueSample.m_nEmittingVolume = emittingVol; + SET_EMITTING_VOLUME(emittingVol); m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_bReleasingSoundFlag = TRUE; m_sQueueSample.m_bRequireReflection = TRUE; @@ -4557,7 +4537,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS emittingVol = 127; - m_sQueueSample.m_nEmittingVolume = emittingVol; + SET_EMITTING_VOLUME(emittingVol); m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_bReleasingSoundFlag = TRUE; m_sQueueSample.m_bRequireReflection = TRUE; @@ -4578,7 +4558,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS emittingVol = m_anRandomTable[2] % 10 + 100; - m_sQueueSample.m_nEmittingVolume = emittingVol; + SET_EMITTING_VOLUME(emittingVol); m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_bReleasingSoundFlag = TRUE; m_sQueueSample.m_bRequireReflection = TRUE; @@ -4598,7 +4578,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS emittingVol = m_anRandomTable[2] % 10 + 100; - m_sQueueSample.m_nEmittingVolume = emittingVol; + SET_EMITTING_VOLUME(emittingVol); m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_bReleasingSoundFlag = TRUE; m_sQueueSample.m_bRequireReflection = TRUE; @@ -4617,7 +4597,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS emittingVol = m_anRandomTable[3] % 15 + 70; - m_sQueueSample.m_nEmittingVolume = emittingVol; + SET_EMITTING_VOLUME(emittingVol); m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_bReleasingSoundFlag = TRUE; stereo = TRUE; @@ -4637,7 +4617,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS emittingVol = m_anRandomTable[3] % 15 + 70; - m_sQueueSample.m_nEmittingVolume = emittingVol; + SET_EMITTING_VOLUME(emittingVol); m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_bReleasingSoundFlag = TRUE; stereo = TRUE; @@ -4655,7 +4635,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS emittingVol = m_anRandomTable[3] % 15 + 70; - m_sQueueSample.m_nEmittingVolume = emittingVol; + SET_EMITTING_VOLUME(emittingVol); m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_bReleasingSoundFlag = TRUE; stereo = TRUE; @@ -4674,7 +4654,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS emittingVol = m_anRandomTable[3] % 15 + 70; - m_sQueueSample.m_nEmittingVolume = emittingVol; + SET_EMITTING_VOLUME(emittingVol); m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_bReleasingSoundFlag = TRUE; stereo = TRUE; @@ -4692,7 +4672,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS emittingVol = m_anRandomTable[3] % 15 + 90; - m_sQueueSample.m_nEmittingVolume = emittingVol; + SET_EMITTING_VOLUME(emittingVol); m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_bReleasingSoundFlag = TRUE; stereo = TRUE; @@ -4711,7 +4691,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS emittingVol = m_anRandomTable[3] % 15 + 90; - m_sQueueSample.m_nEmittingVolume = emittingVol; + SET_EMITTING_VOLUME(emittingVol); m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_bReleasingSoundFlag = TRUE; stereo = TRUE; @@ -4734,7 +4714,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS emittingVol = m_anRandomTable[4] % 10 + 110; - m_sQueueSample.m_nEmittingVolume = emittingVol; + SET_EMITTING_VOLUME(emittingVol); m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_bReleasingSoundFlag = TRUE; m_sQueueSample.m_bRequireReflection = TRUE; @@ -4752,7 +4732,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) maxDist = SQR(60); m_sQueueSample.m_nLoopCount = 0; SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) - m_sQueueSample.m_nEmittingVolume = 90; + SET_EMITTING_VOLUME(90); m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_nReleasingVolumeDivider = 6; @@ -4773,7 +4753,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS emittingVol = 127; - m_sQueueSample.m_nEmittingVolume = 127; + SET_EMITTING_VOLUME(127); m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_bReleasingSoundFlag = TRUE; stereo = TRUE; @@ -4830,7 +4810,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) maxDist = SQR(30); m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS - m_sQueueSample.m_nEmittingVolume = 75; + SET_EMITTING_VOLUME(75); m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_bReleasingSoundFlag = TRUE; m_sQueueSample.m_bRequireReflection = TRUE; @@ -4894,7 +4874,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS emittingVol = m_anRandomTable[4] % 10 + 80; - m_sQueueSample.m_nEmittingVolume = emittingVol; + SET_EMITTING_VOLUME(emittingVol); m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_bReleasingSoundFlag = TRUE; m_sQueueSample.m_bRequireReflection = TRUE; @@ -4913,7 +4893,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS emittingVol = 70; - m_sQueueSample.m_nEmittingVolume = 70; + SET_EMITTING_VOLUME(70); m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_bReleasingSoundFlag = TRUE; break; @@ -4931,7 +4911,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS emittingVol = m_anRandomTable[0] % 20 + 90; - m_sQueueSample.m_nEmittingVolume = emittingVol; + SET_EMITTING_VOLUME(emittingVol); m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_bReleasingSoundFlag = TRUE; break; @@ -4951,7 +4931,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS emittingVol = m_anRandomTable[2] % 30 + 70; - m_sQueueSample.m_nEmittingVolume = emittingVol; + SET_EMITTING_VOLUME(emittingVol); m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_bReleasingSoundFlag = TRUE; m_sQueueSample.m_bRequireReflection = TRUE; @@ -4987,7 +4967,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) maxDist = SQR(30); m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS - m_sQueueSample.m_nEmittingVolume = emittingVol; + SET_EMITTING_VOLUME(emittingVol); m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_bReleasingSoundFlag = TRUE; m_sQueueSample.m_bRequireReflection = TRUE; @@ -5013,7 +4993,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS emittingVol = (m_anRandomTable[2] % 20 + 70) * param1 / 127; - m_sQueueSample.m_nEmittingVolume = emittingVol; + SET_EMITTING_VOLUME(emittingVol); m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_bReleasingSoundFlag = TRUE; m_sQueueSample.m_bRequireReflection = TRUE; @@ -5031,7 +5011,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) maxDist = SQR(150); m_sQueueSample.m_nLoopCount = 0; SET_LOOP_OFFSETS(SFX_MINIGUN_FIRE_LEFT) - m_sQueueSample.m_nEmittingVolume = 127; + SET_EMITTING_VOLUME(127); m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_nReleasingVolumeDivider = 3; @@ -5048,7 +5028,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) maxDist = SQR(150); m_sQueueSample.m_nLoopCount = 0; SET_LOOP_OFFSETS(SFX_MINIGUN_FIRE_RIGHT) - m_sQueueSample.m_nEmittingVolume = emittingVol; + SET_EMITTING_VOLUME(emittingVol); m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_nReleasingVolumeDivider = 3; @@ -5065,7 +5045,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS emittingVol = 127; - m_sQueueSample.m_nEmittingVolume = 127; + SET_EMITTING_VOLUME(127); m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_bReleasingSoundFlag = TRUE; m_sQueueSample.m_bRequireReflection = TRUE; @@ -5107,7 +5087,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) maxDist = SQR(15); m_sQueueSample.m_nLoopCount = 0; SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) - m_sQueueSample.m_nEmittingVolume = emittingVol; + SET_EMITTING_VOLUME(emittingVol); m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_nReleasingVolumeDivider = 3; @@ -5173,6 +5153,41 @@ cAudioManager::SetPlayersMood(uint8 mood, uint32 time) } void +cAudioManager::ProcessPlayerMood() +{ + CPlayerPed *playerPed; + uint32& lastMissionPassedTime = CTheScripts::GetLastMissionPassedTime(); + uint32 curTime = CTimer::GetTimeInMilliseconds(); + + if (m_nPlayerMoodTimer <= curTime) { + playerPed = FindPlayerPed(); + if (playerPed != nil) { + + if (playerPed->m_pWanted->GetWantedLevel() > 3) { + m_nPlayerMood = PLAYER_MOOD_ANGRY; + return; + } + if (playerPed->m_pWanted->GetWantedLevel() > 1) { + m_nPlayerMood = PLAYER_MOOD_PISSED_OFF; + return; + } + + if (lastMissionPassedTime != -1) { + if (curTime < lastMissionPassedTime) { + lastMissionPassedTime = curTime; + return; + } + if (curTime < lastMissionPassedTime + 180000) { + m_nPlayerMood = PLAYER_MOOD_WISECRACKING; + return; + } + } + m_nPlayerMood = PLAYER_MOOD_CALM; + } + } +} + +void cAudioManager::SetupPedComments(cPedParams ¶ms, uint16 sound) { CPed *ped = params.m_pPed; @@ -5191,7 +5206,7 @@ cAudioManager::SetupPedComments(cPedParams ¶ms, uint16 sound) switch(sound) { case SOUND_PED_HELI_PLAYER_FOUND: soundIntensity = 400.0f; - pedComment.m_nSampleIndex = GetRandomNumberInRange(m_sQueueSample.m_nEntityIndex % 4, SFX_POLICE_HELI_1, SFX_POLICE_HELI_20); + pedComment.m_nSampleIndex = m_anRandomTable[m_sQueueSample.m_nEntityIndex % 4] % 20 + SFX_POLICE_HELI_1; break; case SOUND_PED_VCPA_PLAYER_FOUND: soundIntensity = 400.0f; @@ -5203,11 +5218,11 @@ cAudioManager::SetupPedComments(cPedParams ¶ms, uint16 sound) break; case SOUND_INJURED_PED_MALE_OUCH: soundIntensity = 40.0f; - pedComment.m_nSampleIndex = GetRandomNumberInRange(m_sQueueSample.m_nEntityIndex % 4, SFX_GENERIC_MALE_GRUNT_1, SFX_GENERIC_MALE_GRUNT_41); + pedComment.m_nSampleIndex = m_anRandomTable[m_sQueueSample.m_nEntityIndex % 4] % 41 + SFX_GENERIC_MALE_GRUNT_1; break; case SOUND_INJURED_PED_FEMALE: soundIntensity = 40.0f; - pedComment.m_nSampleIndex = GetRandomNumberInRange(m_sQueueSample.m_nEntityIndex % 4, SFX_GENERIC_FEMALE_GRUNT_1, SFX_GENERIC_FEMALE_GRUNT_33); + pedComment.m_nSampleIndex = m_anRandomTable[m_sQueueSample.m_nEntityIndex % 4] % 33 + SFX_GENERIC_FEMALE_GRUNT_1; break; default: return; @@ -5233,9 +5248,9 @@ cAudioManager::SetupPedComments(cPedParams ¶ms, uint16 sound) } uint32 -cAudioManager::GetPedCommentSfx(CPed *ped, int32 sound) +cAudioManager::GetPedCommentSfx(CPed *ped, uint16 sound) { - if(ped->m_nPedState != PED_FALL || sound == MI_VICE8 || sound == MI_WFYG1 || sound == MI_WFYG2) { + if(ped->m_nPedState != PED_FALL || sound == SOUND_PED_DAMAGE || sound == SOUND_PED_HIT || sound == SOUND_PED_LAND) { if(ped->m_getUpTimer == UINT32_MAX || ped->m_getUpTimer > CTimer::GetTimeInMilliseconds()) { if(sound != SOUND_PED_DAMAGE && sound != SOUND_PED_HIT && sound != SOUND_PED_LAND) return NO_SAMPLE; } @@ -5245,7 +5260,7 @@ cAudioManager::GetPedCommentSfx(CPed *ped, int32 sound) case MI_COP: return GetCopTalkSfx(ped, sound); case MI_SWAT: return GetSwatTalkSfx(ped, sound); case MI_FBI: return GetFBITalkSfx(ped, sound); - case MI_ARMY: return GetGenericMaleTalkSfx(ped, sound); + case MI_ARMY: return GetArmyTalkSfx(ped, sound); case MI_MEDIC: return GetMedicTalkSfx(ped, sound); case MI_FIREMAN: return GetFiremanTalkSfx(ped, sound); case MI_MALE01: return GetDefaultTalkSfx(ped, sound); @@ -5342,9 +5357,9 @@ cAudioManager::GetPedCommentSfx(CPed *ped, int32 sound) case MI_VICE3: case MI_VICE4: case MI_VICE5: - case MI_VICE6: case MI_VICE7: - case MI_VICE8: return GetVICETalkSfx(ped, sound, ped->GetModelIndex()); + case MI_VICE8: return GetViceWhiteTalkSfx(ped, sound); + case MI_VICE6: return GetViceBlackTalkSfx(ped, sound); case MI_WFYG1: return GetWFYG1TalkSfx(ped, sound); case MI_WFYG2: return GetWFYG2TalkSfx(ped, sound); case MI_SPECIAL01: @@ -5367,7 +5382,7 @@ cAudioManager::GetPedCommentSfx(CPed *ped, int32 sound) case MI_SPECIAL18: case MI_SPECIAL19: case MI_SPECIAL20: - case MI_SPECIAL21: return NO_SAMPLE; + case MI_SPECIAL21: return GetSpecialCharacterTalkSfx(ped, ped->GetModelIndex(), sound); default: return GetGenericMaleTalkSfx(ped, sound); } } @@ -5376,7 +5391,7 @@ cAudioManager::GetPedCommentSfx(CPed *ped, int32 sound) } void -cAudioManager::GetPhrase(uint32 &phrase, uint32 &prevPhrase, uint32 sample, uint32 maxOffset) const +cAudioManager::GetPhrase(uint32 &phrase, uint32 &prevPhrase, uint32 sample, uint32 maxOffset) { phrase = sample + m_anRandomTable[m_sQueueSample.m_nEntityIndex & 3] % maxOffset; @@ -5397,7 +5412,7 @@ if (cooldown != 0) {\ cooldown = 1; uint32 -cAudioManager::GetPlayerTalkSfx(CPed *ped, int16 sound) +cAudioManager::GetPlayerTalkSfx(CPed *ped, uint16 sound) { uint32 sfx; @@ -5604,7 +5619,74 @@ cAudioManager::GetPlayerTalkSfx(CPed *ped, int16 sound) } uint32 -cAudioManager::GetCopTalkSfx(CPed *ped, int16 sound) +cAudioManager::GetGenericMaleTalkSfx(CPed *ped, uint16 sound) +{ + uint32 sfx; + + m_bGenericSfx = TRUE; + switch(sound) { + case SOUND_PED_DEATH: GetPhrase(sfx, ped->m_lastComment, SFX_GENERIC_MALE_DEATH_1, 41); break; + case SOUND_PED_BULLET_HIT: + case SOUND_PED_DEFEND: GetPhrase(sfx, ped->m_lastComment, SFX_GENERIC_MALE_GRUNT_1, 41); break; + case SOUND_PED_BURNING: GetPhrase(sfx, ped->m_lastComment, SFX_GENERIC_MALE_FIRE_1, 32); break; + case SOUND_PED_FLEE_SPRINT: GetPhrase(sfx, ped->m_lastComment, SFX_GENERIC_MALE_PANIC_1, 35); break; + default: return NO_SAMPLE; + } + return sfx; +} + +uint32 +cAudioManager::GetGenericFemaleTalkSfx(CPed *ped, uint16 sound) +{ + uint32 sfx; + m_bGenericSfx = TRUE; + switch(sound) { + case SOUND_PED_DEATH: GetPhrase(sfx, ped->m_lastComment, SFX_GENERIC_FEMALE_DEATH_1, 22); break; + case SOUND_PED_BULLET_HIT: + case SOUND_PED_DEFEND: GetPhrase(sfx, ped->m_lastComment, SFX_GENERIC_FEMALE_GRUNT_1, 33); break; + case SOUND_PED_BURNING: GetPhrase(sfx, ped->m_lastComment, SFX_GENERIC_FEMALE_FIRE_1, 17); break; + case SOUND_PED_FLEE_SPRINT: GetPhrase(sfx, ped->m_lastComment, SFX_GENERIC_FEMALE_PANIC_1, 27); break; + default: return NO_SAMPLE; + } + return sfx; +} + +uint32 +cAudioManager::GetDefaultTalkSfx(CPed *ped, uint16 sound) +{ + uint32 sfx; + + switch(sound) { + case SOUND_PED_HANDS_COWER: GetPhrase(sfx, ped->m_lastComment, SFX_DEFAULT_VOICE_GUN_PANIC_1, 12); break; + case SOUND_PED_CAR_JACKED: GetPhrase(sfx, ped->m_lastComment, SFX_DEFAULT_VOICE_JACKED_1, 12); break; +#ifdef FIX_BUGS + case SOUND_PED_CAR_JACKING: GetPhrase(sfx, ped->m_lastComment, SFX_DEFAULT_VOICE_JACKING_1, 13); break; +#endif + case SOUND_PED_ROBBED: GetPhrase(sfx, ped->m_lastComment, SFX_DEFAULT_VOICE_MUGGED_1, 4); break; + case SOUND_PED_ACCIDENTREACTION1: GetPhrase(sfx, ped->m_lastComment, SFX_DEFAULT_VOICE_SAVED_1, 4); break; + case SOUND_PED_TAXI_WAIT: GetPhrase(sfx, ped->m_lastComment, SFX_DEFAULT_VOICE_TAXI_1, 5); break; + case SOUND_PED_ATTACK: GetPhrase(sfx, ped->m_lastComment, SFX_DEFAULT_VOICE_FIGHT_1, 16); break; + case SOUND_PED_EVADE: GetPhrase(sfx, ped->m_lastComment, SFX_DEFAULT_VOICE_DODGE_1, 19); break; + case SOUND_PED_FLEE_RUN: GetPhrase(sfx, ped->m_lastComment, SFX_DEFAULT_VOICE_RUN_1, 19); break; + case SOUND_PED_CRASH_VEHICLE: GetPhrase(sfx, ped->m_lastComment, SFX_DEFAULT_VOICE_GENERIC_CRASH_1, 13); break; + case SOUND_PED_CRASH_CAR: GetPhrase(sfx, ped->m_lastComment, SFX_DEFAULT_VOICE_CAR_CRASH_1, 15); break; + case SOUND_PED_ANNOYED_DRIVER: GetPhrase(sfx, ped->m_lastComment, SFX_DEFAULT_VOICE_BLOCKED_1, 16); break; + case SOUND_PED_WAIT_DOUBLEBACK: GetPhrase(sfx, ped->m_lastComment, SFX_DEFAULT_VOICE_LOST_1, 5); break; +#ifdef FIX_BUGS + case SOUND_PED_CHAT_SEXY_MALE: GetPhrase(sfx, ped->m_lastComment, SFX_DEFAULT_VOICE_EYEING_1, 6); break; +#else + case SOUND_PED_CHAT_SEXY_FEMALE: GetPhrase(sfx, ped->m_lastComment, SFX_DEFAULT_VOICE_EYEING_1, 6); break; +#endif + case SOUND_PED_CHAT_EVENT: GetPhrase(sfx, ped->m_lastComment, SFX_DEFAULT_VOICE_SHOCKED_1, 6); break; + case SOUND_PED_PED_COLLISION: GetPhrase(sfx, ped->m_lastComment, SFX_DEFAULT_VOICE_BUMP_1, 25); break; + case SOUND_PED_CHAT: GetPhrase(sfx, ped->m_lastComment, SFX_DEFAULT_VOICE_CHAT_1, 25); break; + default: return GetGenericMaleTalkSfx(ped, sound); + } + return sfx; +} + +uint32 +cAudioManager::GetCopTalkSfx(CPed *ped, uint16 sound) { uint32 sfx; PedState objective; @@ -5644,7 +5726,7 @@ cAudioManager::GetCopTalkSfx(CPed *ped, int16 sound) } uint32 -cAudioManager::GetSwatTalkSfx(CPed *ped, int16 sound) +cAudioManager::GetSwatTalkSfx(CPed *ped, uint16 sound) { uint32 sfx; switch(sound) { @@ -5658,7 +5740,7 @@ cAudioManager::GetSwatTalkSfx(CPed *ped, int16 sound) } uint32 -cAudioManager::GetFBITalkSfx(CPed *ped, int16 sound) +cAudioManager::GetFBITalkSfx(CPed *ped, uint16 sound) { uint32 sfx; switch(sound) { @@ -5683,13 +5765,13 @@ cAudioManager::GetFBITalkSfx(CPed *ped, int16 sound) } uint32 -cAudioManager::GetArmyTalkSfx(CPed *ped, int16 sound) +cAudioManager::GetArmyTalkSfx(CPed *ped, uint16 sound) { return GetGenericMaleTalkSfx(ped, sound); } uint32 -cAudioManager::GetMedicTalkSfx(CPed *ped, int16 sound) +cAudioManager::GetMedicTalkSfx(CPed *ped, uint16 sound) { uint32 sfx; switch(sound) { @@ -5703,47 +5785,71 @@ cAudioManager::GetMedicTalkSfx(CPed *ped, int16 sound) } uint32 -cAudioManager::GetFiremanTalkSfx(CPed *ped, int16 sound) +cAudioManager::GetFiremanTalkSfx(CPed *ped, uint16 sound) { return GetGenericMaleTalkSfx(ped, sound); } uint32 -cAudioManager::GetDefaultTalkSfx(CPed *ped, int16 sound) +cAudioManager::GetWFYG1TalkSfx(CPed *ped, uint16 sound) { uint32 sfx; switch(sound) { - case SOUND_PED_HANDS_COWER: GetPhrase(sfx, ped->m_lastComment, SFX_DEFAULT_VOICE_GUN_PANIC_1, 12); break; - case SOUND_PED_CAR_JACKED: GetPhrase(sfx, ped->m_lastComment, SFX_DEFAULT_VOICE_JACKED_1, 12); break; -#ifdef FIX_BUGS - case SOUND_PED_CAR_JACKING: GetPhrase(sfx, ped->m_lastComment, SFX_DEFAULT_VOICE_JACKING_1, 13); break; -#endif - case SOUND_PED_ROBBED: GetPhrase(sfx, ped->m_lastComment, SFX_DEFAULT_VOICE_MUGGED_1, 4); break; - case SOUND_PED_ACCIDENTREACTION1: GetPhrase(sfx, ped->m_lastComment, SFX_DEFAULT_VOICE_SAVED_1, 4); break; - case SOUND_PED_TAXI_WAIT: GetPhrase(sfx, ped->m_lastComment, SFX_DEFAULT_VOICE_TAXI_1, 5); break; - case SOUND_PED_ATTACK: GetPhrase(sfx, ped->m_lastComment, SFX_DEFAULT_VOICE_FIGHT_1, 16); break; - case SOUND_PED_EVADE: GetPhrase(sfx, ped->m_lastComment, SFX_DEFAULT_VOICE_DODGE_1, 19); break; - case SOUND_PED_FLEE_RUN: GetPhrase(sfx, ped->m_lastComment, SFX_DEFAULT_VOICE_RUN_1, 19); break; - case SOUND_PED_CRASH_VEHICLE: GetPhrase(sfx, ped->m_lastComment, SFX_DEFAULT_VOICE_GENERIC_CRASH_1, 13); break; - case SOUND_PED_CRASH_CAR: GetPhrase(sfx, ped->m_lastComment, SFX_DEFAULT_VOICE_CAR_CRASH_1, 15); break; - case SOUND_PED_ANNOYED_DRIVER: GetPhrase(sfx, ped->m_lastComment, SFX_DEFAULT_VOICE_BLOCKED_1, 16); break; - case SOUND_PED_WAIT_DOUBLEBACK: GetPhrase(sfx, ped->m_lastComment, SFX_DEFAULT_VOICE_LOST_1, 5); break; + case SOUND_PED_HANDS_UP: GetPhrase(sfx, ped->m_lastComment, SFX_WFYG1_GUN_COOL_1, 6); break; + case SOUND_PED_MUGGING: GetPhrase(sfx, ped->m_lastComment, SFX_WFYG1_MUGGING_1, 2); break; + case SOUND_PED_CAR_JACKED: GetPhrase(sfx, ped->m_lastComment, SFX_WFYG1_JACKED_1, 5); break; + case SOUND_PED_ROBBED: GetPhrase(sfx, ped->m_lastComment, SFX_WFYG1_MUGGED_1, 2); break; + case SOUND_PED_ACCIDENTREACTION1: return SFX_WFYG1_SAVED_1; + case SOUND_PED_TAXI_WAIT: return SFX_WFYG1_TAXI_1; + case SOUND_PED_ATTACK: GetPhrase(sfx, ped->m_lastComment, SFX_WFYG1_FIGHT_1, 4); break; + case SOUND_PED_EVADE: GetPhrase(sfx, ped->m_lastComment, SFX_WFYG1_DODGE_1, 9); break; + case SOUND_PED_FLEE_RUN: GetPhrase(sfx, ped->m_lastComment, SFX_WFYG1_RUN_1, 2); break; + case SOUND_PED_CRASH_VEHICLE: GetPhrase(sfx, ped->m_lastComment, SFX_WFYG1_GENERIC_CRASH_1, 7); break; + case SOUND_PED_CRASH_CAR: GetPhrase(sfx, ped->m_lastComment, SFX_WFYG1_CAR_CRASH_1, 9); break; + case SOUND_PED_ANNOYED_DRIVER: GetPhrase(sfx, ped->m_lastComment, SFX_WFYG1_BLOCKED_1, 7); break; + case SOUND_PED_WAIT_DOUBLEBACK: GetPhrase(sfx, ped->m_lastComment, SFX_WFYG1_LOST_1, 3); break; + case SOUND_PED_CHAT_SEXY_FEMALE: GetPhrase(sfx, ped->m_lastComment, SFX_WFYG1_EYEING_1, 2); break; + case SOUND_PED_CHAT_EVENT: return SFX_WFYG1_SHOCKED_1; + case SOUND_PED_PED_COLLISION: GetPhrase(sfx, ped->m_lastComment, SFX_WFYG1_BUMP_1, 11); break; + case SOUND_PED_CHAT: GetPhrase(sfx, ped->m_lastComment, SFX_WFYG1_CHAT_1, 10); break; + default: return GetGenericFemaleTalkSfx(ped, sound); + } + return sfx; +} + +uint32 +cAudioManager::GetWFYG2TalkSfx(CPed *ped, uint16 sound) +{ + uint32 sfx; + + switch(sound) { + case SOUND_PED_HANDS_UP: GetPhrase(sfx, ped->m_lastComment, SFX_WFYG2_GUN_COOL_1, 3); break; + case SOUND_PED_CAR_JACKED: GetPhrase(sfx, ped->m_lastComment, SFX_WFYG2_JACKED_1, 5); break; + case SOUND_PED_ROBBED: GetPhrase(sfx, ped->m_lastComment, SFX_WFYG2_MUGGED_1, 2); break; #ifdef FIX_BUGS - case SOUND_PED_CHAT_SEXY_MALE: GetPhrase(sfx, ped->m_lastComment, SFX_DEFAULT_VOICE_EYEING_1, 6); break; + case SOUND_PED_TAXI_WAIT: GetPhrase(sfx, ped->m_lastComment, SFX_WFYG2_TAXI_1, 2); break; #else - case SOUND_PED_CHAT_SEXY_FEMALE: GetPhrase(sfx, ped->m_lastComment, SFX_DEFAULT_VOICE_EYEING_1, 6); break; + case SOUND_PED_TAXI_WAIT: return SFX_WFYG2_TAXI_1; #endif - case SOUND_PED_CHAT_EVENT: GetPhrase(sfx, ped->m_lastComment, SFX_DEFAULT_VOICE_SHOCKED_1, 6); break; - case SOUND_PED_PED_COLLISION: GetPhrase(sfx, ped->m_lastComment, SFX_DEFAULT_VOICE_BUMP_1, 25); break; - case SOUND_PED_CHAT: GetPhrase(sfx, ped->m_lastComment, SFX_DEFAULT_VOICE_CHAT_1, 25); break; - default: return GetGenericMaleTalkSfx(ped, sound); + case SOUND_PED_ATTACK: GetPhrase(sfx, ped->m_lastComment, SFX_WFYG2_FIGHT_1, 5); break; + case SOUND_PED_EVADE: GetPhrase(sfx, ped->m_lastComment, SFX_WFYG2_DODGE_1, 8); break; + case SOUND_PED_CRASH_VEHICLE: GetPhrase(sfx, ped->m_lastComment, SFX_WFYG2_GENERIC_CRASH_1, 7); break; + case SOUND_PED_CRASH_CAR: GetPhrase(sfx, ped->m_lastComment, SFX_WFYG2_CAR_CRASH_1, 9); break; + case SOUND_PED_ANNOYED_DRIVER: GetPhrase(sfx, ped->m_lastComment, SFX_WFYG2_BLOCKED_1, 5); break; + case SOUND_PED_WAIT_DOUBLEBACK: return SFX_WFYG2_LOST_1; + case SOUND_PED_CHAT_SEXY_FEMALE: GetPhrase(sfx, ped->m_lastComment, SFX_WFYG2_EYEING_1, 4); break; + case SOUND_PED_CHAT_EVENT: return SFX_WFYG2_SHOCKED_1; + case SOUND_PED_PED_COLLISION: GetPhrase(sfx, ped->m_lastComment, SFX_WFYG2_BUMP_1, 11); break; + case SOUND_PED_CHAT: GetPhrase(sfx, ped->m_lastComment, SFX_WFYG2_CHAT_1, 9); break; + default: return GetGenericFemaleTalkSfx(ped, sound); } + return sfx; } uint32 -cAudioManager::GetHFYSTTalkSfx(CPed *ped, int16 sound) +cAudioManager::GetHFYSTTalkSfx(CPed *ped, uint16 sound) { uint32 sfx; switch(sound) { @@ -5767,7 +5873,7 @@ cAudioManager::GetHFYSTTalkSfx(CPed *ped, int16 sound) } uint32 -cAudioManager::GetHFOSTTalkSfx(CPed *ped, int16 sound) +cAudioManager::GetHFOSTTalkSfx(CPed *ped, uint16 sound) { uint32 sfx; @@ -5790,7 +5896,7 @@ cAudioManager::GetHFOSTTalkSfx(CPed *ped, int16 sound) } uint32 -cAudioManager::GetHMYSTTalkSfx(CPed *ped, int16 sound) +cAudioManager::GetHMYSTTalkSfx(CPed *ped, uint16 sound) { uint32 sfx; @@ -5811,7 +5917,7 @@ cAudioManager::GetHMYSTTalkSfx(CPed *ped, int16 sound) } uint32 -cAudioManager::GetHMOSTTalkSfx(CPed *ped, int16 sound) +cAudioManager::GetHMOSTTalkSfx(CPed *ped, uint16 sound) { uint32 sfx; @@ -5836,7 +5942,7 @@ cAudioManager::GetHMOSTTalkSfx(CPed *ped, int16 sound) } uint32 -cAudioManager::GetHFYRITalkSfx(CPed *ped, int16 sound) +cAudioManager::GetHFYRITalkSfx(CPed *ped, uint16 sound) { uint32 sfx; @@ -5860,7 +5966,7 @@ cAudioManager::GetHFYRITalkSfx(CPed *ped, int16 sound) } uint32 -cAudioManager::GetHFORITalkSfx(CPed *ped, int16 sound) +cAudioManager::GetHFORITalkSfx(CPed *ped, uint16 sound) { uint32 sfx; @@ -5885,7 +5991,7 @@ cAudioManager::GetHFORITalkSfx(CPed *ped, int16 sound) } uint32 -cAudioManager::GetHMYRITalkSfx(CPed *ped, int16 sound) +cAudioManager::GetHMYRITalkSfx(CPed *ped, uint16 sound) { uint32 sfx; @@ -5907,7 +6013,7 @@ cAudioManager::GetHMYRITalkSfx(CPed *ped, int16 sound) } uint32 -cAudioManager::GetHMORITalkSfx(CPed *ped, int16 sound) +cAudioManager::GetHMORITalkSfx(CPed *ped, uint16 sound) { uint32 sfx; @@ -5931,7 +6037,7 @@ cAudioManager::GetHMORITalkSfx(CPed *ped, int16 sound) } uint32 -cAudioManager::GetHFYBETalkSfx(CPed *ped, int16 sound) +cAudioManager::GetHFYBETalkSfx(CPed *ped, uint16 sound) { uint32 sfx; @@ -5955,7 +6061,7 @@ cAudioManager::GetHFYBETalkSfx(CPed *ped, int16 sound) } uint32 -cAudioManager::GetHFOBETalkSfx(CPed *ped, int16 sound) +cAudioManager::GetHFOBETalkSfx(CPed *ped, uint16 sound) { uint32 sfx; @@ -5979,7 +6085,7 @@ cAudioManager::GetHFOBETalkSfx(CPed *ped, int16 sound) } uint32 -cAudioManager::GetHMYBETalkSfx(CPed *ped, int16 sound) +cAudioManager::GetHMYBETalkSfx(CPed *ped, uint16 sound) { uint32 sfx; @@ -6004,7 +6110,7 @@ cAudioManager::GetHMYBETalkSfx(CPed *ped, int16 sound) } uint32 -cAudioManager::GetHMOBETalkSfx(CPed *ped, int16 sound) +cAudioManager::GetHMOBETalkSfx(CPed *ped, uint16 sound) { uint32 sfx; @@ -6023,7 +6129,7 @@ cAudioManager::GetHMOBETalkSfx(CPed *ped, int16 sound) } uint32 -cAudioManager::GetHFYBUTalkSfx(CPed *ped, int16 sound) +cAudioManager::GetHFYBUTalkSfx(CPed *ped, uint16 sound) { uint32 sfx; @@ -6048,7 +6154,7 @@ cAudioManager::GetHFYBUTalkSfx(CPed *ped, int16 sound) } uint32 -cAudioManager::GetHFYMDTalkSfx(CPed *ped, int16 sound) +cAudioManager::GetHFYMDTalkSfx(CPed *ped, uint16 sound) { uint32 sfx; @@ -6071,7 +6177,7 @@ cAudioManager::GetHFYMDTalkSfx(CPed *ped, int16 sound) } uint32 -cAudioManager::GetHFYCGTalkSfx(CPed *ped, int16 sound) +cAudioManager::GetHFYCGTalkSfx(CPed *ped, uint16 sound) { uint32 sfx; @@ -6094,7 +6200,7 @@ cAudioManager::GetHFYCGTalkSfx(CPed *ped, int16 sound) } uint32 -cAudioManager::GetHFYPRTalkSfx(CPed *ped, int16 sound) +cAudioManager::GetHFYPRTalkSfx(CPed *ped, uint16 sound) { uint32 sfx; @@ -6116,7 +6222,7 @@ cAudioManager::GetHFYPRTalkSfx(CPed *ped, int16 sound) } uint32 -cAudioManager::GetHFOTRTalkSfx(CPed *ped, int16 sound) +cAudioManager::GetHFOTRTalkSfx(CPed *ped, uint16 sound) { uint32 sfx; @@ -6136,7 +6242,7 @@ cAudioManager::GetHFOTRTalkSfx(CPed *ped, int16 sound) } uint32 -cAudioManager::GetHMOTRTalkSfx(CPed *ped, int16 sound) +cAudioManager::GetHMOTRTalkSfx(CPed *ped, uint16 sound) { uint32 sfx; @@ -6156,33 +6262,7 @@ cAudioManager::GetHMOTRTalkSfx(CPed *ped, int16 sound) } uint32 -cAudioManager::GetHMYAPTalkSfx(CPed *ped, int16 sound) -{ - uint32 sfx; - - switch(sound) { - case SOUND_PED_HANDS_COWER: GetPhrase(sfx, ped->m_lastComment, SFX_HMYAP_GUN_PANIC_1, 7); break; - case SOUND_PED_CAR_JACKING: GetPhrase(sfx, ped->m_lastComment, SFX_HMYAP_JACKING_1, 4); break; - case SOUND_PED_CAR_JACKED: GetPhrase(sfx, ped->m_lastComment, SFX_HMYAP_JACKED_1, 7); break; - case SOUND_PED_ROBBED: GetPhrase(sfx, ped->m_lastComment, SFX_HMYAP_MUGGED_1, 2); break; - case SOUND_PED_ACCIDENTREACTION1: GetPhrase(sfx, ped->m_lastComment, SFX_HMYAP_SAVED_1, 2); break; - case SOUND_PED_TAXI_WAIT: GetPhrase(sfx, ped->m_lastComment, SFX_HMYAP_TAXI_1, 2); break; - case SOUND_PED_EVADE: GetPhrase(sfx, ped->m_lastComment, SFX_HMYAP_DODGE_1, 9); break; - case SOUND_PED_FLEE_RUN: GetPhrase(sfx, ped->m_lastComment, SFX_HMYAP_RUN_1, 6); break; - case SOUND_PED_CRASH_VEHICLE: GetPhrase(sfx, ped->m_lastComment, SFX_HMYAP_GENERIC_CRASH_1, 6); break; - case SOUND_PED_CRASH_CAR: GetPhrase(sfx, ped->m_lastComment, SFX_HMYAP_CAR_CRASH_1, 9); break; - case SOUND_PED_ANNOYED_DRIVER: GetPhrase(sfx, ped->m_lastComment, SFX_HMYAP_BLOCKED_1, 9); break; - case SOUND_PED_WAIT_DOUBLEBACK: GetPhrase(sfx, ped->m_lastComment, SFX_HMYAP_LOST_1, 2); break; - case SOUND_PED_CHAT_SEXY_MALE: GetPhrase(sfx, ped->m_lastComment, SFX_HMYAP_EYEING_1, 3); break; - case SOUND_PED_PED_COLLISION: GetPhrase(sfx, ped->m_lastComment, SFX_HMYAP_BUMP_1, 11); break; - case SOUND_PED_CHAT: GetPhrase(sfx, ped->m_lastComment, SFX_HMYAP_CHAT_1, 9); break; - default: return GetGenericMaleTalkSfx(ped, sound); - } - return sfx; -} - -uint32 -cAudioManager::GetHMOCATalkSfx(CPed *ped, int16 sound) +cAudioManager::GetHMOCATalkSfx(CPed *ped, uint16 sound) { uint32 sfx; @@ -6203,39 +6283,7 @@ cAudioManager::GetHMOCATalkSfx(CPed *ped, int16 sound) } uint32 -cAudioManager::GetBMODKTalkSfx(CPed *ped, int16 sound) -{ - uint32 sfx; - - switch(sound) { - case SOUND_PED_HANDS_COWER: GetPhrase(sfx, ped->m_lastComment, SFX_BMODK_GUN_PANIC_1, 4); break; - case SOUND_PED_CAR_JACKED: GetPhrase(sfx, ped->m_lastComment, SFX_BMODK_JACKED_1, 9); break; - case SOUND_PED_ROBBED: GetPhrase(sfx, ped->m_lastComment, SFX_BMODK_MUGGED_1, 2); break; - case SOUND_PED_INNOCENT: GetPhrase(sfx, ped->m_lastComment, SFX_BMODK_INNOCENT_1, 3); break; - case SOUND_PED_TAXI_WAIT: return SFX_BMODK_TAXI_1; - case SOUND_PED_EVADE: GetPhrase(sfx, ped->m_lastComment, SFX_BMODK_DODGE_1, 7); break; - case SOUND_PED_FLEE_RUN: GetPhrase(sfx, ped->m_lastComment, SFX_BMODK_RUN_1, 4); break; - case SOUND_PED_CRASH_VEHICLE: GetPhrase(sfx, ped->m_lastComment, SFX_BMODK_GENERIC_CRASH_1, 7); break; - case SOUND_PED_CRASH_CAR: GetPhrase(sfx, ped->m_lastComment, SFX_BMODK_CAR_CRASH_1, 10); break; - case SOUND_PED_ANNOYED_DRIVER: GetPhrase(sfx, ped->m_lastComment, SFX_BMODK_BLOCKED_1, 8); break; - case SOUND_PED_147: // this is some cut behaviour, the guy was selling something - GetPhrase(sfx, ped->m_lastComment, SFX_BMODK_UNK_147_1, 11); - // what is this? some sort of censorship? - switch(sfx) { - case SFX_BMODK_UNK_147_5: - case SFX_BMODK_UNK_147_6: - case SFX_BMODK_UNK_147_7: GetPhrase(sfx, ped->m_lastComment, SFX_BMODK_UNK_147_1, 4); break; - default: break; - } - break; - case SOUND_PED_PED_COLLISION: GetPhrase(sfx, ped->m_lastComment, SFX_BMODK_BUMP_1, 10); break; - default: return GetGenericMaleTalkSfx(ped, sound); - } - return sfx; -} - -uint32 -cAudioManager::GetBMYCRTalkSfx(CPed *ped, int16 sound) +cAudioManager::GetBMYCRTalkSfx(CPed *ped, uint16 sound) { uint32 sfx; @@ -6260,7 +6308,7 @@ cAudioManager::GetBMYCRTalkSfx(CPed *ped, int16 sound) } uint32 -cAudioManager::GetBFYSTTalkSfx(CPed *ped, int16 sound) +cAudioManager::GetBFYSTTalkSfx(CPed *ped, uint16 sound) { uint32 sfx; @@ -6284,7 +6332,7 @@ cAudioManager::GetBFYSTTalkSfx(CPed *ped, int16 sound) } uint32 -cAudioManager::GetBFOSTTalkSfx(CPed *ped, int16 sound) +cAudioManager::GetBFOSTTalkSfx(CPed *ped, uint16 sound) { uint32 sfx; @@ -6308,7 +6356,7 @@ cAudioManager::GetBFOSTTalkSfx(CPed *ped, int16 sound) } uint32 -cAudioManager::GetBMYSTTalkSfx(CPed *ped, int16 sound) +cAudioManager::GetBMYSTTalkSfx(CPed *ped, uint16 sound) { uint32 sfx; @@ -6336,7 +6384,7 @@ cAudioManager::GetBMYSTTalkSfx(CPed *ped, int16 sound) } uint32 -cAudioManager::GetBMOSTTalkSfx(CPed *ped, int16 sound) +cAudioManager::GetBMOSTTalkSfx(CPed *ped, uint16 sound) { uint32 sfx; @@ -6359,7 +6407,7 @@ cAudioManager::GetBMOSTTalkSfx(CPed *ped, int16 sound) } uint32 -cAudioManager::GetBFYRITalkSfx(CPed *ped, int16 sound) +cAudioManager::GetBFYRITalkSfx(CPed *ped, uint16 sound) { uint32 sfx; @@ -6385,7 +6433,7 @@ cAudioManager::GetBFYRITalkSfx(CPed *ped, int16 sound) } uint32 -cAudioManager::GetBFORITalkSfx(CPed *ped, int16 sound) +cAudioManager::GetBFORITalkSfx(CPed *ped, uint16 sound) { uint32 sfx; @@ -6409,7 +6457,7 @@ cAudioManager::GetBFORITalkSfx(CPed *ped, int16 sound) } uint32 -cAudioManager::GetBMYRITalkSfx(CPed *ped, int16 sound) +cAudioManager::GetBMYRITalkSfx(CPed *ped, uint16 sound) { uint32 sfx; @@ -6435,7 +6483,7 @@ cAudioManager::GetBMYRITalkSfx(CPed *ped, int16 sound) } uint32 -cAudioManager::GetBFYBETalkSfx(CPed *ped, int16 sound) +cAudioManager::GetBFYBETalkSfx(CPed *ped, uint16 sound) { uint32 sfx; @@ -6468,7 +6516,7 @@ cAudioManager::GetBFYBETalkSfx(CPed *ped, int16 sound) } uint32 -cAudioManager::GetBMYBETalkSfx(CPed *ped, int16 sound) +cAudioManager::GetBMYBETalkSfx(CPed *ped, uint16 sound) { uint32 sfx; @@ -6494,7 +6542,7 @@ cAudioManager::GetBMYBETalkSfx(CPed *ped, int16 sound) } uint32 -cAudioManager::GetBFOBETalkSfx(CPed *ped, int16 sound) +cAudioManager::GetBFOBETalkSfx(CPed *ped, uint16 sound) { uint32 sfx; @@ -6517,7 +6565,7 @@ cAudioManager::GetBFOBETalkSfx(CPed *ped, int16 sound) } uint32 -cAudioManager::GetBMOBETalkSfx(CPed *ped, int16 sound) +cAudioManager::GetBMOBETalkSfx(CPed *ped, uint16 sound) { uint32 sfx; @@ -6540,7 +6588,7 @@ cAudioManager::GetBMOBETalkSfx(CPed *ped, int16 sound) } uint32 -cAudioManager::GetBMYBUTalkSfx(CPed *ped, int16 sound) +cAudioManager::GetBMYBUTalkSfx(CPed *ped, uint16 sound) { uint32 sfx; @@ -6565,7 +6613,7 @@ cAudioManager::GetBMYBUTalkSfx(CPed *ped, int16 sound) } uint32 -cAudioManager::GetBFYPRTalkSfx(CPed *ped, int16 sound) +cAudioManager::GetBFYPRTalkSfx(CPed *ped, uint16 sound) { uint32 sfx; @@ -6587,7 +6635,7 @@ cAudioManager::GetBFYPRTalkSfx(CPed *ped, int16 sound) } uint32 -cAudioManager::GetBFOTRTalkSfx(CPed *ped, int16 sound) +cAudioManager::GetBFOTRTalkSfx(CPed *ped, uint16 sound) { uint32 sfx; @@ -6609,7 +6657,7 @@ cAudioManager::GetBFOTRTalkSfx(CPed *ped, int16 sound) } uint32 -cAudioManager::GetBMOTRTalkSfx(CPed *ped, int16 sound) +cAudioManager::GetBMOTRTalkSfx(CPed *ped, uint16 sound) { uint32 sfx; @@ -6630,7 +6678,7 @@ cAudioManager::GetBMOTRTalkSfx(CPed *ped, int16 sound) } uint32 -cAudioManager::GetBMYPITalkSfx(CPed *ped, int16 sound) +cAudioManager::GetBMYPITalkSfx(CPed *ped, uint16 sound) { uint32 sfx; @@ -6654,7 +6702,7 @@ cAudioManager::GetBMYPITalkSfx(CPed *ped, int16 sound) } uint32 -cAudioManager::GetBMYBBTalkSfx(CPed *ped, int16 sound) +cAudioManager::GetBMYBBTalkSfx(CPed *ped, uint16 sound) { uint32 sfx; @@ -6684,7 +6732,7 @@ cAudioManager::GetBMYBBTalkSfx(CPed *ped, int16 sound) } uint32 -cAudioManager::GetWMYCRTalkSfx(CPed *ped, int16 sound) +cAudioManager::GetWMYCRTalkSfx(CPed *ped, uint16 sound) { uint32 sfx; @@ -6705,7 +6753,7 @@ cAudioManager::GetWMYCRTalkSfx(CPed *ped, int16 sound) } uint32 -cAudioManager::GetWFYSTTalkSfx(CPed *ped, int16 sound) +cAudioManager::GetWFYSTTalkSfx(CPed *ped, uint16 sound) { uint32 sfx; @@ -6731,7 +6779,49 @@ cAudioManager::GetWFYSTTalkSfx(CPed *ped, int16 sound) } uint32 -cAudioManager::GetWFOSTTalkSfx(CPed *ped, int16 sound) +cAudioManager::GetWFYSKTalkSfx(CPed *ped, uint16 sound) +{ + uint32 sfx; + + switch(sound) { + case SOUND_PED_HANDS_COWER: GetPhrase(sfx, ped->m_lastComment, SFX_WFYSK_GUN_PANIC_1, 5); break; + case SOUND_PED_ROBBED: GetPhrase(sfx, ped->m_lastComment, SFX_WFYSK_MUGGED_1, 2); break; + case SOUND_PED_ACCIDENTREACTION1: GetPhrase(sfx, ped->m_lastComment, SFX_WFYSK_SAVED_1, 2); break; + case SOUND_PED_TAXI_WAIT: return SFX_WFYSK_TAXI_1; + case SOUND_PED_ATTACK: GetPhrase(sfx, ped->m_lastComment, SFX_WFYSK_FIGHT_1, 11); break; + case SOUND_PED_EVADE: GetPhrase(sfx, ped->m_lastComment, SFX_WFYSK_DODGE_1, 9); break; + case SOUND_PED_ANNOYED_DRIVER: GetPhrase(sfx, ped->m_lastComment, SFX_WFYSK_BLOCKED_1, 11); break; + case SOUND_PED_PED_COLLISION: GetPhrase(sfx, ped->m_lastComment, SFX_WFYSK_BUMP_1, 18); break; + default: return GetGenericFemaleTalkSfx(ped, sound); + } + return sfx; +} + +uint32 +cAudioManager::GetWMYSKTalkSfx(CPed *ped, uint16 sound) +{ + uint32 sfx; + + switch(sound) { + case SOUND_PED_HANDS_COWER: GetPhrase(sfx, ped->m_lastComment, SFX_WMYSK_GUN_PANIC_1, 5); break; + case SOUND_PED_ROBBED: GetPhrase(sfx, ped->m_lastComment, SFX_WMYSK_MUGGED_1, 2); break; + case SOUND_PED_ACCIDENTREACTION1: GetPhrase(sfx, ped->m_lastComment, SFX_WMYSK_SAVED_1, 2); break; + case SOUND_PED_INNOCENT: GetPhrase(sfx, ped->m_lastComment, SFX_WMYSK_INNOCENT_1, 3); break; + case SOUND_PED_TAXI_WAIT: return SFX_WMYSK_TAXI_1; + case SOUND_PED_ATTACK: GetPhrase(sfx, ped->m_lastComment, SFX_WMYSK_FIGHT_1, 5); break; + case SOUND_PED_EVADE: GetPhrase(sfx, ped->m_lastComment, SFX_WMYSK_DODGE_1, 10); break; + case SOUND_PED_WAIT_DOUBLEBACK: GetPhrase(sfx, ped->m_lastComment, SFX_WMYSK_LOST_1, 2); break; + case SOUND_PED_CHAT_SEXY_MALE: GetPhrase(sfx, ped->m_lastComment, SFX_WMYSK_EYEING_1, 2); break; + case SOUND_PED_CHAT_EVENT: GetPhrase(sfx, ped->m_lastComment, SFX_WMYSK_SHOCKED_1, 2); break; + case SOUND_PED_PED_COLLISION: GetPhrase(sfx, ped->m_lastComment, SFX_WMYSK_BUMP_1, 14); break; + case SOUND_PED_CHAT: GetPhrase(sfx, ped->m_lastComment, SFX_WMYSK_CHAT_1, 13); break; + default: return GetGenericMaleTalkSfx(ped, sound); + } + return sfx; +} + +uint32 +cAudioManager::GetWFOSTTalkSfx(CPed *ped, uint16 sound) { uint32 sfx; @@ -6755,7 +6845,7 @@ cAudioManager::GetWFOSTTalkSfx(CPed *ped, int16 sound) } uint32 -cAudioManager::GetWMYSTTalkSfx(CPed *ped, int16 sound) +cAudioManager::GetWMYSTTalkSfx(CPed *ped, uint16 sound) { uint32 sfx; @@ -6782,7 +6872,7 @@ cAudioManager::GetWMYSTTalkSfx(CPed *ped, int16 sound) } uint32 -cAudioManager::GetWMOSTTalkSfx(CPed *ped, int16 sound) +cAudioManager::GetWMOSTTalkSfx(CPed *ped, uint16 sound) { uint32 sfx; @@ -6809,7 +6899,7 @@ cAudioManager::GetWMOSTTalkSfx(CPed *ped, int16 sound) } uint32 -cAudioManager::GetWFYRITalkSfx(CPed *ped, int16 sound) +cAudioManager::GetWFYRITalkSfx(CPed *ped, uint16 sound) { uint32 sfx; @@ -6834,7 +6924,7 @@ cAudioManager::GetWFYRITalkSfx(CPed *ped, int16 sound) } uint32 -cAudioManager::GetWFORITalkSfx(CPed *ped, int16 sound) +cAudioManager::GetWFORITalkSfx(CPed *ped, uint16 sound) { uint32 sfx; @@ -6858,7 +6948,7 @@ cAudioManager::GetWFORITalkSfx(CPed *ped, int16 sound) } uint32 -cAudioManager::GetWMYRITalkSfx(CPed *ped, int16 sound) +cAudioManager::GetWMYRITalkSfx(CPed *ped, uint16 sound) { uint32 sfx; @@ -6885,7 +6975,7 @@ cAudioManager::GetWMYRITalkSfx(CPed *ped, int16 sound) } uint32 -cAudioManager::GetWMORITalkSfx(CPed *ped, int16 sound) +cAudioManager::GetWMORITalkSfx(CPed *ped, uint16 sound) { uint32 sfx; @@ -6910,7 +7000,7 @@ cAudioManager::GetWMORITalkSfx(CPed *ped, int16 sound) } uint32 -cAudioManager::GetWFYBETalkSfx(CPed *ped, int16 sound) +cAudioManager::GetWFYBETalkSfx(CPed *ped, uint16 sound) { uint32 sfx; @@ -6933,7 +7023,7 @@ cAudioManager::GetWFYBETalkSfx(CPed *ped, int16 sound) } uint32 -cAudioManager::GetWMYBETalkSfx(CPed *ped, int16 sound) +cAudioManager::GetWMYBETalkSfx(CPed *ped, uint16 sound) { uint32 sfx; @@ -6958,7 +7048,7 @@ cAudioManager::GetWMYBETalkSfx(CPed *ped, int16 sound) } uint32 -cAudioManager::GetWFOBETalkSfx(CPed *ped, int16 sound) +cAudioManager::GetWFOBETalkSfx(CPed *ped, uint16 sound) { uint32 sfx; @@ -6981,7 +7071,7 @@ cAudioManager::GetWFOBETalkSfx(CPed *ped, int16 sound) } uint32 -cAudioManager::GetWMOBETalkSfx(CPed *ped, int16 sound) +cAudioManager::GetWMOBETalkSfx(CPed *ped, uint16 sound) { uint32 sfx; @@ -7007,7 +7097,7 @@ cAudioManager::GetWMOBETalkSfx(CPed *ped, int16 sound) } uint32 -cAudioManager::GetWMYCWTalkSfx(CPed *ped, int16 sound) +cAudioManager::GetWMYCWTalkSfx(CPed *ped, uint16 sound) { uint32 sfx; @@ -7036,7 +7126,7 @@ cAudioManager::GetWMYCWTalkSfx(CPed *ped, int16 sound) } uint32 -cAudioManager::GetWMYGOTalkSfx(CPed *ped, int16 sound) +cAudioManager::GetWMYGOTalkSfx(CPed *ped, uint16 sound) { uint32 sfx; @@ -7060,7 +7150,7 @@ cAudioManager::GetWMYGOTalkSfx(CPed *ped, int16 sound) } uint32 -cAudioManager::GetWFOGOTalkSfx(CPed *ped, int16 sound) +cAudioManager::GetWFOGOTalkSfx(CPed *ped, uint16 sound) { uint32 sfx; @@ -7083,7 +7173,7 @@ cAudioManager::GetWFOGOTalkSfx(CPed *ped, int16 sound) } uint32 -cAudioManager::GetWMOGOTalkSfx(CPed *ped, int16 sound) +cAudioManager::GetWMOGOTalkSfx(CPed *ped, uint16 sound) { uint32 sfx; @@ -7107,7 +7197,7 @@ cAudioManager::GetWMOGOTalkSfx(CPed *ped, int16 sound) } uint32 -cAudioManager::GetWFYLGTalkSfx(CPed *ped, int16 sound) +cAudioManager::GetWFYLGTalkSfx(CPed *ped, uint16 sound) { uint32 sfx; @@ -7125,7 +7215,7 @@ cAudioManager::GetWFYLGTalkSfx(CPed *ped, int16 sound) } uint32 -cAudioManager::GetWMYLGTalkSfx(CPed *ped, int16 sound) +cAudioManager::GetWMYLGTalkSfx(CPed *ped, uint16 sound) { uint32 sfx; @@ -7143,7 +7233,7 @@ cAudioManager::GetWMYLGTalkSfx(CPed *ped, int16 sound) } uint32 -cAudioManager::GetWFYBUTalkSfx(CPed *ped, int16 sound) +cAudioManager::GetWFYBUTalkSfx(CPed *ped, uint16 sound) { uint32 sfx; @@ -7163,7 +7253,7 @@ cAudioManager::GetWFYBUTalkSfx(CPed *ped, int16 sound) } uint32 -cAudioManager::GetWMYBUTalkSfx(CPed *ped, int16 sound) +cAudioManager::GetWMYBUTalkSfx(CPed *ped, uint16 sound) { uint32 sfx; @@ -7194,7 +7284,7 @@ cAudioManager::GetWMYBUTalkSfx(CPed *ped, int16 sound) } uint32 -cAudioManager::GetWMOBUTalkSfx(CPed *ped, int16 sound) +cAudioManager::GetWMOBUTalkSfx(CPed *ped, uint16 sound) { uint32 sfx; @@ -7218,7 +7308,7 @@ cAudioManager::GetWMOBUTalkSfx(CPed *ped, int16 sound) } uint32 -cAudioManager::GetWFYPRTalkSfx(CPed *ped, int16 sound) +cAudioManager::GetWFYPRTalkSfx(CPed *ped, uint16 sound) { uint32 sfx; @@ -7239,7 +7329,7 @@ cAudioManager::GetWFYPRTalkSfx(CPed *ped, int16 sound) } uint32 -cAudioManager::GetWFOTRTalkSfx(CPed *ped, int16 sound) +cAudioManager::GetWFOTRTalkSfx(CPed *ped, uint16 sound) { uint32 sfx; @@ -7258,7 +7348,7 @@ cAudioManager::GetWFOTRTalkSfx(CPed *ped, int16 sound) } uint32 -cAudioManager::GetWMOTRTalkSfx(CPed *ped, int16 sound) +cAudioManager::GetWMOTRTalkSfx(CPed *ped, uint16 sound) { uint32 sfx; @@ -7279,7 +7369,7 @@ cAudioManager::GetWMOTRTalkSfx(CPed *ped, int16 sound) } uint32 -cAudioManager::GetWMYPITalkSfx(CPed *ped, int16 sound) +cAudioManager::GetWMYPITalkSfx(CPed *ped, uint16 sound) { uint32 sfx; @@ -7308,7 +7398,7 @@ cAudioManager::GetWMYPITalkSfx(CPed *ped, int16 sound) } uint32 -cAudioManager::GetWMOCATalkSfx(CPed *ped, int16 sound) +cAudioManager::GetWMOCATalkSfx(CPed *ped, uint16 sound) { uint32 sfx; @@ -7332,84 +7422,7 @@ cAudioManager::GetWMOCATalkSfx(CPed *ped, int16 sound) } uint32 -cAudioManager::GetWFYJGTalkSfx(CPed *ped, int16 sound) -{ - uint32 sfx; - switch(sound) { - case SOUND_PED_HANDS_COWER: GetPhrase(sfx, ped->m_lastComment, SFX_WFYJG_GUN_PANIC_1, 4); break; - case SOUND_PED_ACCIDENTREACTION1: sfx = SFX_WFYJG_SAVED_1; break; - case SOUND_PED_TAXI_WAIT: sfx = SFX_WFYJG_TAXI_1; break; - case SOUND_PED_EVADE: GetPhrase(sfx, ped->m_lastComment, SFX_WFYJG_DODGE_1, 8); break; - case SOUND_PED_FLEE_RUN: GetPhrase(sfx, ped->m_lastComment, SFX_WFYJG_RUN_1, 6); break; - case SOUND_PED_PED_COLLISION: GetPhrase(sfx, ped->m_lastComment, SFX_WFYJG_BUMP_1, 12); break; - default: return GetGenericFemaleTalkSfx(ped, sound); - } - return sfx; -} - -uint32 -cAudioManager::GetWMYJGTalkSfx(CPed *ped, int16 sound) -{ - uint32 sfx; - - switch(sound) { - case SOUND_PED_HANDS_COWER: GetPhrase(sfx, ped->m_lastComment, SFX_WMYJG_GUN_PANIC_1, 4); break; - case SOUND_PED_ROBBED: GetPhrase(sfx, ped->m_lastComment, SFX_WMYJG_MUGGED_1, 2); break; - case SOUND_PED_ACCIDENTREACTION1: return SFX_WMYJG_SAVED_1; - case SOUND_PED_TAXI_WAIT: return SFX_WMYJG_TAXI_1; - case SOUND_PED_FLEE_RUN: GetPhrase(sfx, ped->m_lastComment, SFX_WMYJG_RUN_1, 5); break; - case SOUND_PED_ANNOYED_DRIVER: GetPhrase(sfx, ped->m_lastComment, SFX_WMYJG_BLOCKED_1, 10); break; - case SOUND_PED_CHAT_SEXY_MALE: GetPhrase(sfx, ped->m_lastComment, SFX_WMYJG_EYEING_1, 2); break; - case SOUND_PED_PED_COLLISION: GetPhrase(sfx, ped->m_lastComment, SFX_WMYJG_BUMP_1, 10); break; - default: return GetGenericMaleTalkSfx(ped, sound); - } - return sfx; -} - -uint32 -cAudioManager::GetWFYSKTalkSfx(CPed *ped, int16 sound) -{ - uint32 sfx; - - switch(sound) { - case SOUND_PED_HANDS_COWER: GetPhrase(sfx, ped->m_lastComment, SFX_WFYSK_GUN_PANIC_1, 5); break; - case SOUND_PED_ROBBED: GetPhrase(sfx, ped->m_lastComment, SFX_WFYSK_MUGGED_1, 2); break; - case SOUND_PED_ACCIDENTREACTION1: GetPhrase(sfx, ped->m_lastComment, SFX_WFYSK_SAVED_1, 2); break; - case SOUND_PED_TAXI_WAIT: return SFX_WFYSK_TAXI_1; - case SOUND_PED_ATTACK: GetPhrase(sfx, ped->m_lastComment, SFX_WFYSK_FIGHT_1, 11); break; - case SOUND_PED_EVADE: GetPhrase(sfx, ped->m_lastComment, SFX_WFYSK_DODGE_1, 9); break; - case SOUND_PED_ANNOYED_DRIVER: GetPhrase(sfx, ped->m_lastComment, SFX_WFYSK_BLOCKED_1, 11); break; - case SOUND_PED_PED_COLLISION: GetPhrase(sfx, ped->m_lastComment, SFX_WFYSK_BUMP_1, 18); break; - default: return GetGenericFemaleTalkSfx(ped, sound); - } - return sfx; -} - -uint32 -cAudioManager::GetWMYSKTalkSfx(CPed *ped, int16 sound) -{ - uint32 sfx; - - switch(sound) { - case SOUND_PED_HANDS_COWER: GetPhrase(sfx, ped->m_lastComment, SFX_WMYSK_GUN_PANIC_1, 5); break; - case SOUND_PED_ROBBED: GetPhrase(sfx, ped->m_lastComment, SFX_WMYSK_MUGGED_1, 2); break; - case SOUND_PED_ACCIDENTREACTION1: GetPhrase(sfx, ped->m_lastComment, SFX_WMYSK_SAVED_1, 2); break; - case SOUND_PED_INNOCENT: GetPhrase(sfx, ped->m_lastComment, SFX_WMYSK_INNOCENT_1, 3); break; - case SOUND_PED_TAXI_WAIT: return SFX_WMYSK_TAXI_1; - case SOUND_PED_ATTACK: GetPhrase(sfx, ped->m_lastComment, SFX_WMYSK_FIGHT_1, 5); break; - case SOUND_PED_EVADE: GetPhrase(sfx, ped->m_lastComment, SFX_WMYSK_DODGE_1, 10); break; - case SOUND_PED_WAIT_DOUBLEBACK: GetPhrase(sfx, ped->m_lastComment, SFX_WMYSK_LOST_1, 2); break; - case SOUND_PED_CHAT_SEXY_MALE: GetPhrase(sfx, ped->m_lastComment, SFX_WMYSK_EYEING_1, 2); break; - case SOUND_PED_CHAT_EVENT: GetPhrase(sfx, ped->m_lastComment, SFX_WMYSK_SHOCKED_1, 2); break; - case SOUND_PED_PED_COLLISION: GetPhrase(sfx, ped->m_lastComment, SFX_WMYSK_BUMP_1, 14); break; - case SOUND_PED_CHAT: GetPhrase(sfx, ped->m_lastComment, SFX_WMYSK_CHAT_1, 13); break; - default: return GetGenericMaleTalkSfx(ped, sound); - } - return sfx; -} - -uint32 -cAudioManager::GetWFYSHTalkSfx(CPed *ped, int16 sound) +cAudioManager::GetWFYSHTalkSfx(CPed *ped, uint16 sound) { uint32 sfx; @@ -7430,7 +7443,7 @@ cAudioManager::GetWFYSHTalkSfx(CPed *ped, int16 sound) } uint32 -cAudioManager::GetWFOSHTalkSfx(CPed *ped, int16 sound) +cAudioManager::GetWFOSHTalkSfx(CPed *ped, uint16 sound) { uint32 sfx; @@ -7451,7 +7464,7 @@ cAudioManager::GetWFOSHTalkSfx(CPed *ped, int16 sound) } uint32 -cAudioManager::GetJFOTOTalkSfx(CPed *ped, int16 sound) +cAudioManager::GetJFOTOTalkSfx(CPed *ped, uint16 sound) { uint32 sfx; @@ -7476,7 +7489,7 @@ cAudioManager::GetJFOTOTalkSfx(CPed *ped, int16 sound) } uint32 -cAudioManager::GetJMOTOTalkSfx(CPed *ped, int16 sound) +cAudioManager::GetJMOTOTalkSfx(CPed *ped, uint16 sound) { uint32 sfx; @@ -7501,33 +7514,7 @@ cAudioManager::GetJMOTOTalkSfx(CPed *ped, int16 sound) } uint32 -cAudioManager::GetCBTalkSfx(CPed *ped, int16 sound) -{ - uint32 sfx; - - switch(sound) { - case SOUND_PED_HANDS_UP: GetPhrase(sfx, ped->m_lastComment, SFX_CUBAN_GANG_1_GUN_COOL_1, 5); break; - case SOUND_PED_CAR_JACKING: GetPhrase(sfx, ped->m_lastComment, SFX_CUBAN_GANG_1_JACKING_1, 5); break; - case SOUND_PED_CAR_JACKED: GetPhrase(sfx, ped->m_lastComment, SFX_CUBAN_GANG_1_JACKED_1, 4); break; - case SOUND_PED_ROBBED: GetPhrase(sfx, ped->m_lastComment, SFX_CUBAN_GANG_1_MUGGED_1, 2); break; - case SOUND_PED_ACCIDENTREACTION1: sfx = SFX_CUBAN_GANG_1_SAVED_1; break; - case SOUND_PED_TAXI_WAIT: GetPhrase(sfx, ped->m_lastComment, SFX_CUBAN_GANG_1_TAXI_1, 2); break; - case SOUND_PED_ATTACK: GetPhrase(sfx, ped->m_lastComment, SFX_CUBAN_GANG_1_FIGHT_1, 9); break; - case SOUND_PED_EVADE: GetPhrase(sfx, ped->m_lastComment, SFX_CUBAN_GANG_1_DODGE_1, 9); break; - case SOUND_PED_CRASH_VEHICLE: GetPhrase(sfx, ped->m_lastComment, SFX_CUBAN_GANG_1_GENERIC_CRASH_1, 8); break; - case SOUND_PED_CRASH_CAR: GetPhrase(sfx, ped->m_lastComment, SFX_CUBAN_GANG_1_CAR_CRASH_1, 8); break; - case SOUND_PED_ANNOYED_DRIVER: GetPhrase(sfx, ped->m_lastComment, SFX_CUBAN_GANG_1_BLOCKED_1, 8); break; - case SOUND_PED_WAIT_DOUBLEBACK: GetPhrase(sfx, ped->m_lastComment, SFX_CUBAN_GANG_1_LOST_1, 2); break; - case SOUND_PED_CHAT_SEXY_MALE: GetPhrase(sfx, ped->m_lastComment, SFX_CUBAN_GANG_1_EYEING_1, 2); break; - case SOUND_PED_PED_COLLISION: GetPhrase(sfx, ped->m_lastComment, SFX_CUBAN_GANG_1_BUMP_1, 11); break; - case SOUND_PED_CHAT: GetPhrase(sfx, ped->m_lastComment, SFX_CUBAN_GANG_1_CHAT_1, 10); break; - default: return GetGenericMaleTalkSfx(ped, sound); - } - return (SFX_CUBAN_GANG_2_BLOCKED_1 - SFX_CUBAN_GANG_1_BLOCKED_1) * (m_sQueueSample.m_nEntityIndex % 3) + sfx; -} - -uint32 -cAudioManager::GetHNTalkSfx(CPed *ped, int16 sound) +cAudioManager::GetHNTalkSfx(CPed *ped, uint16 sound) { uint32 sfx; @@ -7553,7 +7540,57 @@ cAudioManager::GetHNTalkSfx(CPed *ped, int16 sound) } uint32 -cAudioManager::GetSGTalkSfx(CPed *ped, int16 sound) +cAudioManager::GetBKTalkSfx(CPed *ped, uint16 sound) +{ + uint32 sfx; + + switch(sound) { + case SOUND_PED_HANDS_UP: GetPhrase(sfx, ped->m_lastComment, SFX_BIKER_GANG_1_GUN_COOL_1, 5); break; + case SOUND_PED_CAR_JACKING: GetPhrase(sfx, ped->m_lastComment, SFX_BIKER_GANG_1_JACKING_1, 4); break; + case SOUND_PED_CAR_JACKED: GetPhrase(sfx, ped->m_lastComment, SFX_BIKER_GANG_1_JACKED_1, 8); break; + case SOUND_PED_ROBBED: GetPhrase(sfx, ped->m_lastComment, SFX_BIKER_GANG_1_MUGGED_1, 2); break; + case SOUND_PED_ACCIDENTREACTION1: sfx = SFX_BIKER_GANG_1_SAVED_1; break; + case SOUND_PED_TAXI_WAIT: GetPhrase(sfx, ped->m_lastComment, SFX_BIKER_GANG_1_TAXI_1, 2); break; + case SOUND_PED_ATTACK: GetPhrase(sfx, ped->m_lastComment, SFX_BIKER_GANG_1_FIGHT_1, 9); break; + case SOUND_PED_EVADE: GetPhrase(sfx, ped->m_lastComment, SFX_BIKER_GANG_1_DODGE_1, 9); break; + case SOUND_PED_CRASH_VEHICLE: GetPhrase(sfx, ped->m_lastComment, SFX_BIKER_GANG_1_GENERIC_CRASH_1, 8); break; + case SOUND_PED_ANNOYED_DRIVER: GetPhrase(sfx, ped->m_lastComment, SFX_BIKER_GANG_1_BLOCKED_1, 10); break; + case SOUND_PED_WAIT_DOUBLEBACK: GetPhrase(sfx, ped->m_lastComment, SFX_BIKER_GANG_1_LOST_1, 2); break; + case SOUND_PED_PED_COLLISION: GetPhrase(sfx, ped->m_lastComment, SFX_BIKER_GANG_1_BUMP_1, 10); break; + case SOUND_PED_CHAT: GetPhrase(sfx, ped->m_lastComment, SFX_BIKER_GANG_1_CHAT_1, 12); break; + default: return GetGenericMaleTalkSfx(ped, sound); + } + return (SFX_BIKER_GANG_2_BLOCKED_1 - SFX_BIKER_GANG_1_BLOCKED_1) * (m_sQueueSample.m_nEntityIndex % 3) + sfx; +} + +uint32 +cAudioManager::GetCBTalkSfx(CPed *ped, uint16 sound) +{ + uint32 sfx; + + switch(sound) { + case SOUND_PED_HANDS_UP: GetPhrase(sfx, ped->m_lastComment, SFX_CUBAN_GANG_1_GUN_COOL_1, 5); break; + case SOUND_PED_CAR_JACKING: GetPhrase(sfx, ped->m_lastComment, SFX_CUBAN_GANG_1_JACKING_1, 5); break; + case SOUND_PED_CAR_JACKED: GetPhrase(sfx, ped->m_lastComment, SFX_CUBAN_GANG_1_JACKED_1, 4); break; + case SOUND_PED_ROBBED: GetPhrase(sfx, ped->m_lastComment, SFX_CUBAN_GANG_1_MUGGED_1, 2); break; + case SOUND_PED_ACCIDENTREACTION1: sfx = SFX_CUBAN_GANG_1_SAVED_1; break; + case SOUND_PED_TAXI_WAIT: GetPhrase(sfx, ped->m_lastComment, SFX_CUBAN_GANG_1_TAXI_1, 2); break; + case SOUND_PED_ATTACK: GetPhrase(sfx, ped->m_lastComment, SFX_CUBAN_GANG_1_FIGHT_1, 9); break; + case SOUND_PED_EVADE: GetPhrase(sfx, ped->m_lastComment, SFX_CUBAN_GANG_1_DODGE_1, 9); break; + case SOUND_PED_CRASH_VEHICLE: GetPhrase(sfx, ped->m_lastComment, SFX_CUBAN_GANG_1_GENERIC_CRASH_1, 8); break; + case SOUND_PED_CRASH_CAR: GetPhrase(sfx, ped->m_lastComment, SFX_CUBAN_GANG_1_CAR_CRASH_1, 8); break; + case SOUND_PED_ANNOYED_DRIVER: GetPhrase(sfx, ped->m_lastComment, SFX_CUBAN_GANG_1_BLOCKED_1, 8); break; + case SOUND_PED_WAIT_DOUBLEBACK: GetPhrase(sfx, ped->m_lastComment, SFX_CUBAN_GANG_1_LOST_1, 2); break; + case SOUND_PED_CHAT_SEXY_MALE: GetPhrase(sfx, ped->m_lastComment, SFX_CUBAN_GANG_1_EYEING_1, 2); break; + case SOUND_PED_PED_COLLISION: GetPhrase(sfx, ped->m_lastComment, SFX_CUBAN_GANG_1_BUMP_1, 11); break; + case SOUND_PED_CHAT: GetPhrase(sfx, ped->m_lastComment, SFX_CUBAN_GANG_1_CHAT_1, 10); break; + default: return GetGenericMaleTalkSfx(ped, sound); + } + return (SFX_CUBAN_GANG_2_BLOCKED_1 - SFX_CUBAN_GANG_1_BLOCKED_1) * (m_sQueueSample.m_nEntityIndex % 3) + sfx; +} + +uint32 +cAudioManager::GetSGTalkSfx(CPed *ped, uint16 sound) { uint32 sfx; @@ -7582,7 +7619,7 @@ cAudioManager::GetSGTalkSfx(CPed *ped, int16 sound) } uint32 -cAudioManager::GetCLTalkSfx(CPed *ped, int16 sound) +cAudioManager::GetCLTalkSfx(CPed *ped, uint16 sound) { uint32 sfx; @@ -7608,7 +7645,7 @@ cAudioManager::GetCLTalkSfx(CPed *ped, int16 sound) } uint32 -cAudioManager::GetGDTalkSfx(CPed *ped, int16 sound) +cAudioManager::GetGDTalkSfx(CPed *ped, uint16 sound) { uint32 sfx; @@ -7628,31 +7665,7 @@ cAudioManager::GetGDTalkSfx(CPed *ped, int16 sound) } uint32 -cAudioManager::GetBKTalkSfx(CPed *ped, int16 sound) -{ - uint32 sfx; - - switch(sound) { - case SOUND_PED_HANDS_UP: GetPhrase(sfx, ped->m_lastComment, SFX_BIKER_GANG_1_GUN_COOL_1, 5); break; - case SOUND_PED_CAR_JACKING: GetPhrase(sfx, ped->m_lastComment, SFX_BIKER_GANG_1_JACKING_1, 4); break; - case SOUND_PED_CAR_JACKED: GetPhrase(sfx, ped->m_lastComment, SFX_BIKER_GANG_1_JACKED_1, 8); break; - case SOUND_PED_ROBBED: GetPhrase(sfx, ped->m_lastComment, SFX_BIKER_GANG_1_MUGGED_1, 2); break; - case SOUND_PED_ACCIDENTREACTION1: sfx = SFX_BIKER_GANG_1_SAVED_1; break; - case SOUND_PED_TAXI_WAIT: GetPhrase(sfx, ped->m_lastComment, SFX_BIKER_GANG_1_TAXI_1, 2); break; - case SOUND_PED_ATTACK: GetPhrase(sfx, ped->m_lastComment, SFX_BIKER_GANG_1_FIGHT_1, 9); break; - case SOUND_PED_EVADE: GetPhrase(sfx, ped->m_lastComment, SFX_BIKER_GANG_1_DODGE_1, 9); break; - case SOUND_PED_CRASH_VEHICLE: GetPhrase(sfx, ped->m_lastComment, SFX_BIKER_GANG_1_GENERIC_CRASH_1, 8); break; - case SOUND_PED_ANNOYED_DRIVER: GetPhrase(sfx, ped->m_lastComment, SFX_BIKER_GANG_1_BLOCKED_1, 10); break; - case SOUND_PED_WAIT_DOUBLEBACK: GetPhrase(sfx, ped->m_lastComment, SFX_BIKER_GANG_1_LOST_1, 2); break; - case SOUND_PED_PED_COLLISION: GetPhrase(sfx, ped->m_lastComment, SFX_BIKER_GANG_1_BUMP_1, 10); break; - case SOUND_PED_CHAT: GetPhrase(sfx, ped->m_lastComment, SFX_BIKER_GANG_1_CHAT_1, 12); break; - default: return GetGenericMaleTalkSfx(ped, sound); - } - return (SFX_BIKER_GANG_2_BLOCKED_1 - SFX_BIKER_GANG_1_BLOCKED_1) * (m_sQueueSample.m_nEntityIndex % 3) + sfx; -} - -uint32 -cAudioManager::GetPGTalkSfx(CPed *ped, int16 sound) +cAudioManager::GetPGTalkSfx(CPed *ped, uint16 sound) { uint32 sfx; @@ -7679,21 +7692,12 @@ cAudioManager::GetPGTalkSfx(CPed *ped, int16 sound) } uint32 -cAudioManager::GetVICETalkSfx(CPed *ped, int16 sound, int16 model) +cAudioManager::GetViceWhiteTalkSfx(CPed *ped, uint16 sound) { uint32 sfx; - if(model == MI_VICE6) { - - switch(sound) { - case SOUND_PED_ARREST_COP: GetPhrase(sfx, ped->m_lastComment, SFX_VICE_VOICE_6_ARREST_1, 3); break; - case SOUND_PED_MIAMIVICE_EXITING_CAR: return SFX_VICE_VOICE_6_MIAMIVICE_EXITING_CAR_1; - default: return GetGenericMaleTalkSfx(ped, sound); - } - } switch(sound) { case SOUND_PED_ARREST_COP: GetPhrase(sfx, ped->m_lastComment, SFX_VICE_VOICE_1_ARREST_1, 3); break; case SOUND_PED_MIAMIVICE_EXITING_CAR: sfx = SFX_VICE_VOICE_1_MIAMIVICE_EXITING_CAR_1; break; - default: return GetGenericMaleTalkSfx(ped, sound); } sfx += (SFX_VICE_VOICE_2_ARREST_1-SFX_VICE_VOICE_1_ARREST_1) * (m_sQueueSample.m_nEntityIndex % 5); @@ -7701,96 +7705,132 @@ cAudioManager::GetVICETalkSfx(CPed *ped, int16 sound, int16 model) } uint32 -cAudioManager::GetWFYG1TalkSfx(CPed *ped, int16 sound) +cAudioManager::GetViceBlackTalkSfx(CPed *ped, uint16 sound) { uint32 sfx; - switch(sound) { - case SOUND_PED_HANDS_UP: GetPhrase(sfx, ped->m_lastComment, SFX_WFYG1_GUN_COOL_1, 6); break; - case SOUND_PED_MUGGING: GetPhrase(sfx, ped->m_lastComment, SFX_WFYG1_MUGGING_1, 2); break; - case SOUND_PED_CAR_JACKED: GetPhrase(sfx, ped->m_lastComment, SFX_WFYG1_JACKED_1, 5); break; - case SOUND_PED_ROBBED: GetPhrase(sfx, ped->m_lastComment, SFX_WFYG1_MUGGED_1, 2); break; - case SOUND_PED_ACCIDENTREACTION1: return SFX_WFYG1_SAVED_1; - case SOUND_PED_TAXI_WAIT: return SFX_WFYG1_TAXI_1; - case SOUND_PED_ATTACK: GetPhrase(sfx, ped->m_lastComment, SFX_WFYG1_FIGHT_1, 4); break; - case SOUND_PED_EVADE: GetPhrase(sfx, ped->m_lastComment, SFX_WFYG1_DODGE_1, 9); break; - case SOUND_PED_FLEE_RUN: GetPhrase(sfx, ped->m_lastComment, SFX_WFYG1_RUN_1, 2); break; - case SOUND_PED_CRASH_VEHICLE: GetPhrase(sfx, ped->m_lastComment, SFX_WFYG1_GENERIC_CRASH_1, 7); break; - case SOUND_PED_CRASH_CAR: GetPhrase(sfx, ped->m_lastComment, SFX_WFYG1_CAR_CRASH_1, 9); break; - case SOUND_PED_ANNOYED_DRIVER: GetPhrase(sfx, ped->m_lastComment, SFX_WFYG1_BLOCKED_1, 7); break; - case SOUND_PED_WAIT_DOUBLEBACK: GetPhrase(sfx, ped->m_lastComment, SFX_WFYG1_LOST_1, 3); break; - case SOUND_PED_CHAT_SEXY_FEMALE: GetPhrase(sfx, ped->m_lastComment, SFX_WFYG1_EYEING_1, 2); break; - case SOUND_PED_CHAT_EVENT: return SFX_WFYG1_SHOCKED_1; - case SOUND_PED_PED_COLLISION: GetPhrase(sfx, ped->m_lastComment, SFX_WFYG1_BUMP_1, 11); break; - case SOUND_PED_CHAT: GetPhrase(sfx, ped->m_lastComment, SFX_WFYG1_CHAT_1, 10); break; - default: return GetGenericFemaleTalkSfx(ped, sound); + case SOUND_PED_ARREST_COP: GetPhrase(sfx, ped->m_lastComment, SFX_VICE_VOICE_6_ARREST_1, 3); break; + case SOUND_PED_MIAMIVICE_EXITING_CAR: return SFX_VICE_VOICE_6_MIAMIVICE_EXITING_CAR_1; + default: return GetGenericMaleTalkSfx(ped, sound); } return sfx; } uint32 -cAudioManager::GetWFYG2TalkSfx(CPed *ped, int16 sound) +cAudioManager::GetBMODKTalkSfx(CPed *ped, uint16 sound) { uint32 sfx; switch(sound) { - case SOUND_PED_HANDS_UP: GetPhrase(sfx, ped->m_lastComment, SFX_WFYG2_GUN_COOL_1, 3); break; - case SOUND_PED_CAR_JACKED: GetPhrase(sfx, ped->m_lastComment, SFX_WFYG2_JACKED_1, 5); break; - case SOUND_PED_ROBBED: GetPhrase(sfx, ped->m_lastComment, SFX_WFYG2_MUGGED_1, 2); break; -#ifdef FIX_BUGS - case SOUND_PED_TAXI_WAIT: GetPhrase(sfx, ped->m_lastComment, SFX_WFYG2_TAXI_1, 2); break; -#else - case SOUND_PED_TAXI_WAIT: return SFX_WFYG2_TAXI_1; -#endif - case SOUND_PED_ATTACK: GetPhrase(sfx, ped->m_lastComment, SFX_WFYG2_FIGHT_1, 5); break; - case SOUND_PED_EVADE: GetPhrase(sfx, ped->m_lastComment, SFX_WFYG2_DODGE_1, 8); break; - case SOUND_PED_CRASH_VEHICLE: GetPhrase(sfx, ped->m_lastComment, SFX_WFYG2_GENERIC_CRASH_1, 7); break; - case SOUND_PED_CRASH_CAR: GetPhrase(sfx, ped->m_lastComment, SFX_WFYG2_CAR_CRASH_1, 9); break; - case SOUND_PED_ANNOYED_DRIVER: GetPhrase(sfx, ped->m_lastComment, SFX_WFYG2_BLOCKED_1, 5); break; - case SOUND_PED_WAIT_DOUBLEBACK: return SFX_WFYG2_LOST_1; - case SOUND_PED_CHAT_SEXY_FEMALE: GetPhrase(sfx, ped->m_lastComment, SFX_WFYG2_EYEING_1, 4); break; - case SOUND_PED_CHAT_EVENT: return SFX_WFYG2_SHOCKED_1; - case SOUND_PED_PED_COLLISION: GetPhrase(sfx, ped->m_lastComment, SFX_WFYG2_BUMP_1, 11); break; - case SOUND_PED_CHAT: GetPhrase(sfx, ped->m_lastComment, SFX_WFYG2_CHAT_1, 9); break; - default: return GetGenericFemaleTalkSfx(ped, sound); + case SOUND_PED_HANDS_COWER: GetPhrase(sfx, ped->m_lastComment, SFX_BMODK_GUN_PANIC_1, 4); break; + case SOUND_PED_CAR_JACKED: GetPhrase(sfx, ped->m_lastComment, SFX_BMODK_JACKED_1, 9); break; + case SOUND_PED_ROBBED: GetPhrase(sfx, ped->m_lastComment, SFX_BMODK_MUGGED_1, 2); break; + case SOUND_PED_INNOCENT: GetPhrase(sfx, ped->m_lastComment, SFX_BMODK_INNOCENT_1, 3); break; + case SOUND_PED_TAXI_WAIT: return SFX_BMODK_TAXI_1; + case SOUND_PED_EVADE: GetPhrase(sfx, ped->m_lastComment, SFX_BMODK_DODGE_1, 7); break; + case SOUND_PED_FLEE_RUN: GetPhrase(sfx, ped->m_lastComment, SFX_BMODK_RUN_1, 4); break; + case SOUND_PED_CRASH_VEHICLE: GetPhrase(sfx, ped->m_lastComment, SFX_BMODK_GENERIC_CRASH_1, 7); break; + case SOUND_PED_CRASH_CAR: GetPhrase(sfx, ped->m_lastComment, SFX_BMODK_CAR_CRASH_1, 10); break; + case SOUND_PED_ANNOYED_DRIVER: GetPhrase(sfx, ped->m_lastComment, SFX_BMODK_BLOCKED_1, 8); break; + case SOUND_PED_147: // this is some cut behaviour, the guy was selling something + GetPhrase(sfx, ped->m_lastComment, SFX_BMODK_UNK_147_1, 11); + // what is this? some sort of censorship? + switch(sfx) { + case SFX_BMODK_UNK_147_5: + case SFX_BMODK_UNK_147_6: + case SFX_BMODK_UNK_147_7: GetPhrase(sfx, ped->m_lastComment, SFX_BMODK_UNK_147_1, 4); break; + default: break; + } + break; + case SOUND_PED_PED_COLLISION: GetPhrase(sfx, ped->m_lastComment, SFX_BMODK_BUMP_1, 10); break; + default: return GetGenericMaleTalkSfx(ped, sound); } - return sfx; } uint32 -cAudioManager::GetGenericMaleTalkSfx(CPed *ped, int16 sound) +cAudioManager::GetHMYAPTalkSfx(CPed *ped, uint16 sound) { uint32 sfx; - m_bGenericSfx = TRUE; switch(sound) { - case SOUND_PED_DEATH: GetPhrase(sfx, ped->m_lastComment, SFX_GENERIC_MALE_DEATH_1, 41); break; - case SOUND_PED_BULLET_HIT: - case SOUND_PED_DEFEND: GetPhrase(sfx, ped->m_lastComment, SFX_GENERIC_MALE_GRUNT_1, 41); break; - case SOUND_PED_BURNING: GetPhrase(sfx, ped->m_lastComment, SFX_GENERIC_MALE_FIRE_1, 32); break; - case SOUND_PED_FLEE_SPRINT: GetPhrase(sfx, ped->m_lastComment, SFX_GENERIC_MALE_PANIC_1, 35); break; - default: return NO_SAMPLE; + case SOUND_PED_HANDS_COWER: GetPhrase(sfx, ped->m_lastComment, SFX_HMYAP_GUN_PANIC_1, 7); break; + case SOUND_PED_CAR_JACKING: GetPhrase(sfx, ped->m_lastComment, SFX_HMYAP_JACKING_1, 4); break; + case SOUND_PED_CAR_JACKED: GetPhrase(sfx, ped->m_lastComment, SFX_HMYAP_JACKED_1, 7); break; + case SOUND_PED_ROBBED: GetPhrase(sfx, ped->m_lastComment, SFX_HMYAP_MUGGED_1, 2); break; + case SOUND_PED_ACCIDENTREACTION1: GetPhrase(sfx, ped->m_lastComment, SFX_HMYAP_SAVED_1, 2); break; + case SOUND_PED_TAXI_WAIT: GetPhrase(sfx, ped->m_lastComment, SFX_HMYAP_TAXI_1, 2); break; + case SOUND_PED_EVADE: GetPhrase(sfx, ped->m_lastComment, SFX_HMYAP_DODGE_1, 9); break; + case SOUND_PED_FLEE_RUN: GetPhrase(sfx, ped->m_lastComment, SFX_HMYAP_RUN_1, 6); break; + case SOUND_PED_CRASH_VEHICLE: GetPhrase(sfx, ped->m_lastComment, SFX_HMYAP_GENERIC_CRASH_1, 6); break; + case SOUND_PED_CRASH_CAR: GetPhrase(sfx, ped->m_lastComment, SFX_HMYAP_CAR_CRASH_1, 9); break; + case SOUND_PED_ANNOYED_DRIVER: GetPhrase(sfx, ped->m_lastComment, SFX_HMYAP_BLOCKED_1, 9); break; + case SOUND_PED_WAIT_DOUBLEBACK: GetPhrase(sfx, ped->m_lastComment, SFX_HMYAP_LOST_1, 2); break; + case SOUND_PED_CHAT_SEXY_MALE: GetPhrase(sfx, ped->m_lastComment, SFX_HMYAP_EYEING_1, 3); break; + case SOUND_PED_PED_COLLISION: GetPhrase(sfx, ped->m_lastComment, SFX_HMYAP_BUMP_1, 11); break; + case SOUND_PED_CHAT: GetPhrase(sfx, ped->m_lastComment, SFX_HMYAP_CHAT_1, 9); break; + default: return GetGenericMaleTalkSfx(ped, sound); } return sfx; } uint32 -cAudioManager::GetGenericFemaleTalkSfx(CPed *ped, int16 sound) +cAudioManager::GetWFYJGTalkSfx(CPed *ped, uint16 sound) { uint32 sfx; - m_bGenericSfx = TRUE; switch(sound) { - case SOUND_PED_DEATH: GetPhrase(sfx, ped->m_lastComment, SFX_GENERIC_FEMALE_DEATH_1, 22); break; - case SOUND_PED_BULLET_HIT: - case SOUND_PED_DEFEND: GetPhrase(sfx, ped->m_lastComment, SFX_GENERIC_FEMALE_GRUNT_1, 33); break; - case SOUND_PED_BURNING: GetPhrase(sfx, ped->m_lastComment, SFX_GENERIC_FEMALE_FIRE_1, 17); break; - case SOUND_PED_FLEE_SPRINT: GetPhrase(sfx, ped->m_lastComment, SFX_GENERIC_FEMALE_PANIC_1, 27); break; - default: return NO_SAMPLE; + case SOUND_PED_HANDS_COWER: GetPhrase(sfx, ped->m_lastComment, SFX_WFYJG_GUN_PANIC_1, 4); break; + case SOUND_PED_ACCIDENTREACTION1: sfx = SFX_WFYJG_SAVED_1; break; + case SOUND_PED_TAXI_WAIT: sfx = SFX_WFYJG_TAXI_1; break; + case SOUND_PED_EVADE: GetPhrase(sfx, ped->m_lastComment, SFX_WFYJG_DODGE_1, 8); break; + case SOUND_PED_FLEE_RUN: GetPhrase(sfx, ped->m_lastComment, SFX_WFYJG_RUN_1, 6); break; + case SOUND_PED_PED_COLLISION: GetPhrase(sfx, ped->m_lastComment, SFX_WFYJG_BUMP_1, 12); break; + default: return GetGenericFemaleTalkSfx(ped, sound); + } + return sfx; +} + +uint32 +cAudioManager::GetWMYJGTalkSfx(CPed *ped, uint16 sound) +{ + uint32 sfx; + + switch(sound) { + case SOUND_PED_HANDS_COWER: GetPhrase(sfx, ped->m_lastComment, SFX_WMYJG_GUN_PANIC_1, 4); break; + case SOUND_PED_ROBBED: GetPhrase(sfx, ped->m_lastComment, SFX_WMYJG_MUGGED_1, 2); break; + case SOUND_PED_ACCIDENTREACTION1: return SFX_WMYJG_SAVED_1; + case SOUND_PED_TAXI_WAIT: return SFX_WMYJG_TAXI_1; + case SOUND_PED_FLEE_RUN: GetPhrase(sfx, ped->m_lastComment, SFX_WMYJG_RUN_1, 5); break; + case SOUND_PED_ANNOYED_DRIVER: GetPhrase(sfx, ped->m_lastComment, SFX_WMYJG_BLOCKED_1, 10); break; + case SOUND_PED_CHAT_SEXY_MALE: GetPhrase(sfx, ped->m_lastComment, SFX_WMYJG_EYEING_1, 2); break; + case SOUND_PED_PED_COLLISION: GetPhrase(sfx, ped->m_lastComment, SFX_WMYJG_BUMP_1, 10); break; + default: return GetGenericMaleTalkSfx(ped, sound); } return sfx; } +uint32 +cAudioManager::GetSpecialCharacterTalkSfx(CPed *ped, int32 model, uint16 sound) +{ + return NO_SAMPLE; +} + +void +cAudioManager::DebugPlayPedComment(int32 sound) +{ + tPedComment pedComment; + + pedComment.m_nSampleIndex = sound; + pedComment.m_nProcess = 10; + pedComment.m_nEntityIndex = 0; + pedComment.m_fDistance = 0.0f; + pedComment.m_bVolume = 99; + + pedComment.m_vecPos = CWorld::Players[0].m_pPed->GetPosition(); + + m_sPedComments.Add(&pedComment); +} + void cPedComments::Add(tPedComment *com) { @@ -7862,7 +7902,9 @@ cPedComments::Process() AudioManager.m_sQueueSample.m_nLoopStart = 0; AudioManager.m_sQueueSample.m_nLoopEnd = -1; #endif +#ifdef EXTERNAL_3D_SOUND 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_bReleasingSoundFlag = TRUE; @@ -7983,7 +8025,7 @@ cAudioManager::ProcessExplosions(int32 explosion) m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_nLoopCount = 1; m_sQueueSample.m_bReleasingSoundFlag = TRUE; - m_sQueueSample.m_nEmittingVolume = MAX_VOLUME; + SET_EMITTING_VOLUME(MAX_VOLUME); RESET_LOOP_OFFSETS m_sQueueSample.m_bReverbFlag = TRUE; AddSampleToRequestedQueue(); @@ -8049,7 +8091,7 @@ cAudioManager::ProcessFires(int32) m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_nLoopCount = 0; m_sQueueSample.m_bReleasingSoundFlag = FALSE; - m_sQueueSample.m_nEmittingVolume = emittingVol; + SET_EMITTING_VOLUME(emittingVol); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_bReverbFlag = TRUE; m_sQueueSample.m_bRequireReflection = FALSE; @@ -8072,7 +8114,7 @@ cAudioManager::ProcessFires(int32) m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_nLoopCount = 0; m_sQueueSample.m_bReleasingSoundFlag = FALSE; - m_sQueueSample.m_nEmittingVolume = emittingVol; + SET_EMITTING_VOLUME(emittingVol); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_bReverbFlag = TRUE; m_sQueueSample.m_bRequireReflection = FALSE; @@ -8107,7 +8149,7 @@ cAudioManager::ProcessWaterCannon(int32) m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_nLoopCount = 0; m_sQueueSample.m_bReleasingSoundFlag = FALSE; - m_sQueueSample.m_nEmittingVolume = 50; + SET_EMITTING_VOLUME(50); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_bReverbFlag = TRUE; m_sQueueSample.m_bRequireReflection = FALSE; @@ -8118,83 +8160,6 @@ cAudioManager::ProcessWaterCannon(int32) } } -//positon of arcade machines -CVector aVecExtraSoundPosition[] = { CVector(-1042.546f, 88.794f, 11.324f), CVector(-1004.476f, 181.697f, 11.324f) }; - -void -cAudioManager::ProcessExtraSounds() -{ - const float SOUND_INTENSITY = 18.0f; - const uint8 EMITTING_VOLUME = 50; - - float distance; - - for (int i = 0; i < ARRAY_SIZE(aVecExtraSoundPosition); i++) { - m_sQueueSample.m_vecPos = aVecExtraSoundPosition[i]; - distance = GetDistanceSquared(m_sQueueSample.m_vecPos); - if (distance < SQR(SOUND_INTENSITY)) { - m_sQueueSample.m_fDistance = Sqrt(distance); - m_sQueueSample.m_nVolume = ComputeVolume(EMITTING_VOLUME, SOUND_INTENSITY, m_sQueueSample.m_fDistance); - if (m_sQueueSample.m_nVolume != 0) { - m_sQueueSample.m_nCounter = i; - m_sQueueSample.m_nSampleIndex = SFX_ARCADE; - m_sQueueSample.m_nBankIndex = SFX_BANK_0; - m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_ARCADE); - m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_bReleasingSoundFlag = FALSE; - m_sQueueSample.m_nReleasingVolumeModificator = 4; - m_sQueueSample.m_fSpeedMultiplier = 3.0f; - m_sQueueSample.m_nEmittingVolume = EMITTING_VOLUME; - SET_LOOP_OFFSETS(SFX_ARCADE) - m_sQueueSample.m_bReverbFlag = TRUE; - m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; - m_sQueueSample.m_bRequireReflection = FALSE; - m_sQueueSample.m_nReleasingVolumeDivider = 3; - AddSampleToRequestedQueue(); - } - } - } -} - -void -cAudioManager::ProcessEscalators() -{ - const float SOUND_INTENSITY = 30.0f; - const uint8 EMITTING_VOLUME = 26; - - float distance; - - for (int i = 0; i < CEscalators::NumEscalators; i++) { - if (!CEscalators::GetEscalator(i).IsActive()) - continue; - m_sQueueSample.m_vecPos = CEscalators::GetEscalator(i).GetPosition(); - distance = GetDistanceSquared(m_sQueueSample.m_vecPos); - if (distance < SQR(SOUND_INTENSITY)) { - m_sQueueSample.m_fDistance = Sqrt(distance); - m_sQueueSample.m_nVolume = ComputeVolume(EMITTING_VOLUME, SOUND_INTENSITY, m_sQueueSample.m_fDistance); - if (m_sQueueSample.m_nVolume != 0) { - m_sQueueSample.m_nSampleIndex = SFX_BOAT_V12_LOOP; - m_sQueueSample.m_nBankIndex = SFX_BANK_0; - m_sQueueSample.m_nFrequency = i * 50 % 250 + 3973; - 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_nCounter = i; - m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_nEmittingVolume = EMITTING_VOLUME; - SET_LOOP_OFFSETS(SFX_BOAT_V12_LOOP) - m_sQueueSample.m_bReverbFlag = TRUE; - m_sQueueSample.m_bReleasingSoundFlag = FALSE; - m_sQueueSample.m_bRequireReflection = FALSE; - AddSampleToRequestedQueue(); - } - } - } -} - #pragma region SCRIPT_OBJECTS const int SCRIPT_OBJECT_INTENSITY_S = 30; const int SCRIPT_OBJECT_INTENSITY_L = 80; @@ -8466,7 +8431,7 @@ cAudioManager::ProcessOneShotScriptObject(uint8 sound) m_sQueueSample.m_nCounter = iSound++; m_sQueueSample.m_nLoopCount = 1; m_sQueueSample.m_bReleasingSoundFlag = TRUE; - m_sQueueSample.m_nEmittingVolume = emittingVolume; + SET_EMITTING_VOLUME(emittingVolume); RESET_LOOP_OFFSETS m_sQueueSample.m_bReverbFlag = TRUE; AddSampleToRequestedQueue(); @@ -8683,7 +8648,7 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) m_sQueueSample.m_nLoopCount = 0; m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_bReverbFlag = TRUE; - m_sQueueSample.m_nEmittingVolume = emittingVolume; + SET_EMITTING_VOLUME(emittingVolume); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_bRequireReflection = FALSE; AddSampleToRequestedQueue(); @@ -8726,7 +8691,7 @@ cAudioManager::ProcessWeather(int32 id) m_sQueueSample.m_bIs2D = TRUE; m_sQueueSample.m_nLoopCount = 1; m_sQueueSample.m_bReleasingSoundFlag = TRUE; - m_sQueueSample.m_nEmittingVolume = m_sQueueSample.m_nVolume; + SET_EMITTING_VOLUME(m_sQueueSample.m_nVolume); RESET_LOOP_OFFSETS m_sQueueSample.m_bReverbFlag = FALSE; m_sQueueSample.m_bRequireReflection = FALSE; @@ -8745,7 +8710,7 @@ cAudioManager::ProcessWeather(int32 id) m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_nReleasingVolumeDivider = 30; m_sQueueSample.m_bReverbFlag = FALSE; - m_sQueueSample.m_nEmittingVolume = m_sQueueSample.m_nVolume; + SET_EMITTING_VOLUME(m_sQueueSample.m_nVolume); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_bRequireReflection = FALSE; AddSampleToRequestedQueue(); @@ -8769,7 +8734,7 @@ cAudioManager::ProcessWeather(int32 id) m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_nReleasingVolumeDivider = 7; m_sQueueSample.m_bReverbFlag = FALSE; - m_sQueueSample.m_nEmittingVolume = m_sQueueSample.m_nVolume; + SET_EMITTING_VOLUME(m_sQueueSample.m_nVolume); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_bRequireReflection = FALSE; AddSampleToRequestedQueue(); @@ -8962,7 +8927,7 @@ cAudioManager::ProcessFrontEnd() m_sQueueSample.m_nBankIndex = SFX_BANK_FRONT_END_MENU; m_sQueueSample.m_nReleasingVolumeModificator = 0; m_sQueueSample.m_bIs2D = TRUE; - m_sQueueSample.m_nEmittingVolume = m_sQueueSample.m_nVolume; + SET_EMITTING_VOLUME(m_sQueueSample.m_nVolume); RESET_LOOP_OFFSETS if (stereo) { m_sQueueSample.m_nOffset = 0; @@ -9027,7 +8992,7 @@ cAudioManager::ProcessCrane() m_sQueueSample.m_nReleasingVolumeModificator = 2; m_sQueueSample.m_nFrequency = 6000; m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_nEmittingVolume = 100; + SET_EMITTING_VOLUME(100); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 4.0f; m_sQueueSample.m_fSoundIntensity = intensity; @@ -9100,7 +9065,7 @@ cAudioManager::ProcessProjectiles() m_sQueueSample.m_nCounter = i; m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_nEmittingVolume = emittingVol; + SET_EMITTING_VOLUME(emittingVol); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_bReleasingSoundFlag = FALSE; m_sQueueSample.m_bReverbFlag = TRUE; @@ -9113,6 +9078,83 @@ cAudioManager::ProcessProjectiles() } void +cAudioManager::ProcessEscalators() +{ + const float SOUND_INTENSITY = 30.0f; + const uint8 EMITTING_VOLUME = 26; + + float distance; + + for (int i = 0; i < CEscalators::NumEscalators; i++) { + if (!CEscalators::GetEscalator(i).IsActive()) + continue; + m_sQueueSample.m_vecPos = CEscalators::GetEscalator(i).GetPosition(); + distance = GetDistanceSquared(m_sQueueSample.m_vecPos); + if (distance < SQR(SOUND_INTENSITY)) { + m_sQueueSample.m_fDistance = Sqrt(distance); + m_sQueueSample.m_nVolume = ComputeVolume(EMITTING_VOLUME, SOUND_INTENSITY, m_sQueueSample.m_fDistance); + if (m_sQueueSample.m_nVolume != 0) { + m_sQueueSample.m_nSampleIndex = SFX_BOAT_V12_LOOP; + m_sQueueSample.m_nBankIndex = SFX_BANK_0; + m_sQueueSample.m_nFrequency = i * 50 % 250 + 3973; + 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_nCounter = i; + m_sQueueSample.m_bIs2D = FALSE; + m_sQueueSample.m_nLoopCount = 0; + SET_EMITTING_VOLUME(EMITTING_VOLUME); + SET_LOOP_OFFSETS(SFX_BOAT_V12_LOOP) + m_sQueueSample.m_bReverbFlag = TRUE; + m_sQueueSample.m_bReleasingSoundFlag = FALSE; + m_sQueueSample.m_bRequireReflection = FALSE; + AddSampleToRequestedQueue(); + } + } + } +} + +//positon of arcade machines +CVector aVecExtraSoundPosition[] = { CVector(-1042.546f, 88.794f, 11.324f), CVector(-1004.476f, 181.697f, 11.324f) }; + +void +cAudioManager::ProcessExtraSounds() +{ + const float SOUND_INTENSITY = 18.0f; + const uint8 EMITTING_VOLUME = 50; + + float distance; + + for (int i = 0; i < ARRAY_SIZE(aVecExtraSoundPosition); i++) { + m_sQueueSample.m_vecPos = aVecExtraSoundPosition[i]; + distance = GetDistanceSquared(m_sQueueSample.m_vecPos); + if (distance < SQR(SOUND_INTENSITY)) { + m_sQueueSample.m_fDistance = Sqrt(distance); + m_sQueueSample.m_nVolume = ComputeVolume(EMITTING_VOLUME, SOUND_INTENSITY, m_sQueueSample.m_fDistance); + if (m_sQueueSample.m_nVolume != 0) { + m_sQueueSample.m_nCounter = i; + m_sQueueSample.m_nSampleIndex = SFX_ARCADE; + m_sQueueSample.m_nBankIndex = SFX_BANK_0; + m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_ARCADE); + m_sQueueSample.m_bIs2D = FALSE; + m_sQueueSample.m_nLoopCount = 0; + m_sQueueSample.m_bReleasingSoundFlag = FALSE; + m_sQueueSample.m_nReleasingVolumeModificator = 4; + m_sQueueSample.m_fSpeedMultiplier = 3.0f; + SET_EMITTING_VOLUME(EMITTING_VOLUME); + SET_LOOP_OFFSETS(SFX_ARCADE) + m_sQueueSample.m_bReverbFlag = TRUE; + m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_bRequireReflection = FALSE; + m_sQueueSample.m_nReleasingVolumeDivider = 3; + AddSampleToRequestedQueue(); + } + } + } +} + +void cAudioManager::ProcessGarages() { const float SOUND_INTENSITY = 80.0f; @@ -9180,7 +9222,7 @@ cAudioManager::ProcessGarages() m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_nReleasingVolumeModificator = 3; - m_sQueueSample.m_nEmittingVolume = 90; + SET_EMITTING_VOLUME(90); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 2.0f; m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; @@ -9211,7 +9253,7 @@ cAudioManager::ProcessGarages() } m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_nReleasingVolumeModificator = 4; - m_sQueueSample.m_nEmittingVolume = 60; + SET_EMITTING_VOLUME(60); m_sQueueSample.m_fSpeedMultiplier = 0.0f; m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; m_sQueueSample.m_bReverbFlag = TRUE; @@ -9252,7 +9294,7 @@ cAudioManager::ProcessFireHydrant() m_sQueueSample.m_nReleasingVolumeModificator = 4; m_sQueueSample.m_nFrequency = 15591; m_sQueueSample.m_nCounter = 0; - m_sQueueSample.m_nEmittingVolume = 40; + SET_EMITTING_VOLUME(40); m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_nLoopCount = 0; @@ -9313,7 +9355,7 @@ cAudioManager::ProcessBridgeWarning() m_sQueueSample.m_nReleasingVolumeModificator = 1; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_BRIDGE_OPEN_WARNING); m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_nEmittingVolume = 100; + SET_EMITTING_VOLUME(100); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 2.0f; m_sQueueSample.m_fSoundIntensity = 450.0f; @@ -9339,7 +9381,7 @@ cAudioManager::ProcessBridgeMotor() m_sQueueSample.m_nReleasingVolumeModificator = 1; m_sQueueSample.m_nFrequency = 5500; m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_nEmittingVolume = MAX_VOLUME; + SET_EMITTING_VOLUME(MAX_VOLUME); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 2.0f; m_sQueueSample.m_fSoundIntensity = bridgeIntensity; @@ -9373,7 +9415,7 @@ cAudioManager::ProcessBridgeOneShots() m_sQueueSample.m_nReleasingVolumeModificator = 1; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_nLoopCount = 1; - m_sQueueSample.m_nEmittingVolume = MAX_VOLUME; + SET_EMITTING_VOLUME(MAX_VOLUME); RESET_LOOP_OFFSETS m_sQueueSample.m_fSpeedMultiplier = 2.0f; m_sQueueSample.m_fSoundIntensity = bridgeIntensity; @@ -9783,8 +9825,25 @@ FindMissionAudioSfx(const char *name) return NO_SAMPLE; } +const char * +cAudioManager::GetMissionAudioLoadedLabel(uint8 slot) +{ + if (m_bIsInitialised && slot < MISSION_AUDIO_SLOTS && m_sMissionAudio.m_nSampleIndex[slot] != NO_SAMPLE) { + for (uint32 i = 0; MissionAudioNameSfxAssoc[i].m_pName != nil; ++i) { + if (m_sMissionAudio.m_nSampleIndex[slot] == MissionAudioNameSfxAssoc[i].m_nId) + return MissionAudioNameSfxAssoc[i].m_pName; + } + } + +#ifdef THIS_IS_STUPID + return MissionAudioNameSfxAssoc[0].m_pName; // yeah this is dumb +#else + return ""; +#endif +} + bool8 -cAudioManager::MissionScriptAudioUsesPoliceChannel(int32 soundMission) const +cAudioManager::MissionScriptAudioUsesPoliceChannel(uint32 soundMission) { return FALSE; } @@ -9809,7 +9868,7 @@ cAudioManager::PreloadMissionAudio(uint8 slot, Const char *name) } uint8 -cAudioManager::GetMissionAudioLoadingStatus(uint8 slot) const +cAudioManager::GetMissionAudioLoadingStatus(uint8 slot) { if (m_bIsInitialised && slot < MISSION_AUDIO_SLOTS) return m_sMissionAudio.m_nLoadingStatus[slot]; @@ -9835,7 +9894,7 @@ cAudioManager::PlayLoadedMissionAudio(uint8 slot) } bool8 -cAudioManager::ShouldDuckMissionAudio(uint8 slot) const +cAudioManager::ShouldDuckMissionAudio(uint8 slot) { if (IsMissionAudioSamplePlaying(slot)) return m_sMissionAudio.m_nSampleIndex[slot] != STREAMED_SOUND_MISSION_ROK2_01; @@ -9843,7 +9902,7 @@ cAudioManager::ShouldDuckMissionAudio(uint8 slot) const } bool8 -cAudioManager::IsMissionAudioSamplePlaying(uint8 slot) const +cAudioManager::IsMissionAudioSamplePlaying(uint8 slot) { if (m_bIsInitialised) { if (slot < MISSION_AUDIO_SLOTS) |