diff options
Diffstat (limited to 'src/audio')
-rw-r--r-- | src/audio/AudioLogic.cpp | 53 | ||||
-rw-r--r-- | src/audio/AudioManager.h | 2 | ||||
-rw-r--r-- | src/audio/soundlist.h | 138 |
3 files changed, 116 insertions, 77 deletions
diff --git a/src/audio/AudioLogic.cpp b/src/audio/AudioLogic.cpp index 2767c7ef..6fe63fae 100644 --- a/src/audio/AudioLogic.cpp +++ b/src/audio/AudioLogic.cpp @@ -1639,27 +1639,31 @@ cAudioManager::UsesSirenSwitching(int32 model) const } } -void +bool cAudioManager::ProcessVehicleSirenOrAlarm(cVehicleParams *params) { const float SOUND_INTENSITY = 110.0f; if (params->m_fDistance < SQR(SOUND_INTENSITY)) { CVehicle *veh = params->m_pVehicle; - if (veh->m_bSirenOrAlarm == false && veh->m_nAlarmState <= 0) - return; + if (veh->m_bSirenOrAlarm == false && !veh->IsAlarmOn()) + return true; + + if (veh->IsAlarmOn()) { + if (CTimer::GetTimeInMilliseconds() > veh->m_bRainAudioCounter) + veh->m_bRainAudioCounter = CTimer::GetTimeInMilliseconds() + 750; + + if (veh->m_bRainAudioCounter < CTimer::GetTimeInMilliseconds() + 375) + return true; + } -#ifdef FIX_BUGS - if (params->m_pVehicle->GetStatus() == STATUS_WRECKED) - return; -#endif CalculateDistance(params->m_bDistanceCalculated, params->m_fDistance); - m_sQueueSample.m_nVolume = ComputeVolume(80, SOUND_INTENSITY, m_sQueueSample.m_fDistance); + m_sQueueSample.m_nVolume = ComputeVolume(veh->bIsDrowning ? 20 : 80, SOUND_INTENSITY, m_sQueueSample.m_fDistance); if (m_sQueueSample.m_nVolume != 0) { m_sQueueSample.m_nCounter = 5; if (UsesSiren(params->m_nIndex)) { if (params->m_pVehicle->GetStatus() == STATUS_ABANDONED) - return; + return true; if (veh->m_nCarHornTimer && params->m_nIndex != FIRETRUK) { m_sQueueSample.m_nSampleIndex = SFX_SIREN_FAST; if (params->m_nIndex == FBICAR) @@ -1689,8 +1693,11 @@ cAudioManager::ProcessVehicleSirenOrAlarm(cVehicleParams *params) m_sQueueSample.m_bReverbFlag = true; m_sQueueSample.m_bRequireReflection = false; AddSampleToRequestedQueue(); - } - } + return true; + } else + return true; + } else + return false; } bool @@ -2144,8 +2151,8 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams *params) maxDist = SQR(SOUND_INTENSITY); break; }*/ - case SOUND_18: - case SOUND_19: { + case SOUND_TRAIN_DOOR_CLOSE: + case SOUND_TRAIN_DOOR_OPEN: { const float SOUND_INTENSITY = 35.0f; m_sQueueSample.m_nSampleIndex = SFX_AIR_BRAKES; m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; @@ -2235,7 +2242,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams *params) break; } case SOUND_BOMB_TIMED_ACTIVATED: - case SOUND_55: + case SOUND_91: case SOUND_BOMB_ONIGNITION_ACTIVATED: case SOUND_BOMB_TICK: { const float SOUND_INTENSITY = 50.0f; @@ -2259,14 +2266,14 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams *params) pedParams.m_fDistance = params->m_fDistance; SetupPedComments(&pedParams, SOUND_PED_HELI_PLAYER_FOUND); continue; - case SOUND_PED_BODYCAST_HIT: + /* case SOUND_PED_BODYCAST_HIT: pedParams.m_pPed = nil; pedParams.m_bDistanceCalculated = false; pedParams.m_fDistance = 0.0f; pedParams.m_bDistanceCalculated = params->m_bDistanceCalculated; pedParams.m_fDistance = params->m_fDistance; SetupPedComments(&pedParams, SOUND_PED_BODYCAST_HIT); - continue; + continue; */ case SOUND_WATER_FALL: { const float SOUND_INTENSITY = 40.0f; m_sQueueSample.m_nSampleIndex = SFX_SPLASH_1; @@ -2499,7 +2506,7 @@ cAudioManager::ProcessBoatEngine(cVehicleParams *params) m_sQueueSample.m_nSampleIndex = SFX_FISHING_BOAT_IDLE; if (LastAccel > 20) { oneShotVol = LastVol; - PlayOneShot(m_sQueueSample.m_nEntityIndex, SOUND_17, oneShotVol); + PlayOneShot(m_sQueueSample.m_nEntityIndex, SOUND_BOAT_SLOWDOWN, oneShotVol); } } else { emittingVol = 105 * padAccelerate / 255 + 15; @@ -3604,8 +3611,6 @@ cAudioManager::ProcessPedOneShots(cPedParams *params) m_sQueueSample.m_bRequireReflection = true; break; case SOUND_WEAPON_AK47_BULLET_ECHO: - case SOUND_WEAPON_UZI_BULLET_ECHO: - case SOUND_WEAPON_M16_BULLET_ECHO: m_sQueueSample.m_nSampleIndex = SFX_UZI_END_LEFT; m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_nCounter = iSound++; @@ -3781,11 +3786,11 @@ cAudioManager::SetupPedComments(cPedParams *params, uint32 sound) CalculateDistance(params->m_bDistanceCalculated, params->m_fDistance); if (sound != SOUND_PAGER) { switch (sound) { - case SOUND_AMMUNATION_WELCOME_1: + /*case SOUND_AMMUNATION_WELCOME_1: case SOUND_AMMUNATION_WELCOME_2: case SOUND_AMMUNATION_WELCOME_3: emittingVol = MAX_VOLUME; - break; + break; */ default: if (CWorld::GetIsLineOfSightClear(TheCamera.GetPosition(), m_sQueueSample.m_vecPos, true, false, false, false, false, false)) emittingVol = MAX_VOLUME; @@ -4664,10 +4669,6 @@ cAudioManager::ProcessFrontEnd() m_sQueueSample.m_nSampleIndex = SFX_FE_HIGHLIGHT_LEFT; stereo = true; break; - case SOUND_FRONTEND_MENU_DENIED: - m_sQueueSample.m_nSampleIndex = SFX_FE_HIGHLIGHT_LEFT; - stereo = true; - break; case SOUND_FRONTEND_MENU_SUCCESS: m_sQueueSample.m_nSampleIndex = SFX_FE_SELECT_LEFT; stereo = true; @@ -4687,7 +4688,7 @@ cAudioManager::ProcessFrontEnd() case SOUND_FRONTEND_RADIO_CHANGE: m_sQueueSample.m_nSampleIndex = SFX_RADIO_CLICK; break; - //case SOUND_A0: + //case SOUND_HUD_SOUND: // m_sQueueSample.m_nSampleIndex = SFX_INFO; // break; default: diff --git a/src/audio/AudioManager.h b/src/audio/AudioManager.h index 0b24c2e9..b0078bc4 100644 --- a/src/audio/AudioManager.h +++ b/src/audio/AudioManager.h @@ -339,7 +339,7 @@ public: void ProcessVehicleOneShots(cVehicleParams *params); bool ProcessVehicleReverseWarning(cVehicleParams *params); bool ProcessVehicleRoadNoise(cVehicleParams *params); - void ProcessVehicleSirenOrAlarm(cVehicleParams *params); + bool ProcessVehicleSirenOrAlarm(cVehicleParams *params); void ProcessVehicleSkidding(cVehicleParams *params); void ProcessWaterCannon(int32); void ProcessWeather(int32 id); diff --git a/src/audio/soundlist.h b/src/audio/soundlist.h index 6d1ff6e3..f812cf72 100644 --- a/src/audio/soundlist.h +++ b/src/audio/soundlist.h @@ -16,8 +16,10 @@ enum eSound : uint16 SOUND_CAR_DOOR_OPEN_BACK_RIGHT, SOUND_CAR_WINDSHIELD_CRACK, SOUND_CAR_JUMP, - SOUND_E, - SOUND_F, + SOUND_CAR_JUMP_2, + SOUND_CAR_TYRE_POP, + SOUND_16, + SOUND_17, SOUND_CAR_ENGINE_START, SOUND_CAR_LIGHT_BREAK, SOUND_CAR_HYDRAULIC_1, @@ -25,12 +27,14 @@ enum eSound : uint16 SOUND_CAR_HYDRAULIC_3, SOUND_CAR_JERK, SOUND_CAR_SPLASH, - SOUND_17, - SOUND_18, - SOUND_19, + SOUND_BOAT_SLOWDOWN, + SOUND_TRAIN_DOOR_CLOSE, + SOUND_TRAIN_DOOR_OPEN, SOUND_CAR_TANK_TURRET_ROTATE, SOUND_CAR_BOMB_TICK, SOUND_PLANE_ON_GROUND, + SOUND_31, + SOUND_32, SOUND_STEP_START, SOUND_STEP_END, SOUND_FALL_LAND, @@ -47,13 +51,15 @@ enum eSound : uint16 SOUND_FIGHT_PUNCH_FROM_BEHIND_42, SOUND_FIGHT_KNEE_OR_KICK_43, SOUND_FIGHT_KICK_44, - SOUND_2D, + SOUND_49, SOUND_WEAPON_BAT_ATTACK, + SOUND_WEAPON_UNK_MELEE_ATTACK, + SOUND_WEAPON_CHAINSAW_ATTACK, + SOUND_WEAPON_CHAINSAW_IDLE, + SOUND_WEAPON_CHAINSAW_MADECONTACT, SOUND_WEAPON_SHOT_FIRED, SOUND_WEAPON_RELOAD, SOUND_WEAPON_AK47_BULLET_ECHO, - SOUND_WEAPON_UZI_BULLET_ECHO, - SOUND_WEAPON_M16_BULLET_ECHO, SOUND_WEAPON_FLAMETHROWER_FIRE, SOUND_WEAPON_SNIPER_SHOT_NO_ZOOM, SOUND_WEAPON_ROCKET_SHOT_NO_ZOOM, @@ -66,8 +72,8 @@ enum eSound : uint16 SOUND_GARAGE_BOMB1_SET, SOUND_GARAGE_BOMB2_SET, SOUND_GARAGE_BOMB3_SET, - SOUND_40, - SOUND_41, + SOUND_70, + SOUND_71, SOUND_GARAGE_VEHICLE_DECLINED, SOUND_GARAGE_VEHICLE_ACCEPTED, SOUND_GARAGE_DOOR_CLOSED, @@ -76,8 +82,8 @@ enum eSound : uint16 SOUND_PICKUP_WEAPON_BOUGHT, SOUND_PICKUP_WEAPON, SOUND_PICKUP_HEALTH, - SOUND_4A, - SOUND_4B, + SOUND_80, + SOUND_81, SOUND_PICKUP_ADRENALINE, SOUND_PICKUP_ARMOUR, SOUND_PICKUP_BONUS, @@ -87,7 +93,7 @@ enum eSound : uint16 SOUND_PICKUP_PACMAN_PACKAGE, SOUND_PICKUP_FLOAT_PACKAGE, SOUND_BOMB_TIMED_ACTIVATED, - SOUND_55, + SOUND_91, SOUND_BOMB_ONIGNITION_ACTIVATED, SOUND_BOMB_TICK, SOUND_RAMPAGE_START, @@ -99,48 +105,62 @@ enum eSound : uint16 SOUND_EVIDENCE_PICKUP, SOUND_UNLOAD_GOLD, SOUND_PAGER, - SOUND_PED_DEATH, // 103 in VC - SOUND_PED_DAMAGE, // 104 in VC - SOUND_PED_HIT, // 105 in VC - SOUND_PED_LAND, // hopefully 106 in VC + SOUND_PED_DEATH, + SOUND_PED_DAMAGE, + SOUND_PED_HIT, + SOUND_PED_LAND, SOUND_PED_BULLET_HIT, - SOUND_PED_BOMBER, - SOUND_PED_BURNING, // 108 in VC - SOUND_PED_ARREST_FBI, - SOUND_PED_ARREST_SWAT, + SOUND_PED_BURNING, + SOUND_PED_PLAYER_REACTTOCOP, SOUND_PED_ARREST_COP, + SOUND_111, + SOUND_PED_COP_HELIPILOTPHRASE, + SOUND_PED_PULLOUTWEAPON, SOUND_PED_HELI_PLAYER_FOUND, + SOUND_115, + SOUND_PED_ON_FIRE, + SOUND_PED_AIMING, SOUND_PED_HANDS_UP, SOUND_PED_HANDS_COWER, - SOUND_PED_FLEE_SPRINT, // 120 in VC + SOUND_PED_FLEE_SPRINT, SOUND_PED_CAR_JACKING, SOUND_PED_MUGGING, SOUND_PED_CAR_JACKED, SOUND_PED_ROBBED, - SOUND_PED_TAXI_WAIT, // 137 in VC + SOUND_PED_ACCIDENTREACTION1, + SOUND_PED_UNK_126, + SOUND_PED_PLAYER_AFTERSEX, + SOUND_PED_PLAYER_BEFORESEX, + SOUND_PED_COP_UNK_129, // also used for medics + SOUND_PED_COP_MANYCOPSAROUND, // also used for medics + SOUND_PED_GUNAIMEDAT2, + SOUND_PED_COP_ALONE, // also used for medics + SOUND_PED_GUNAIMEDAT3, + SOUND_PED_COP_REACTION, + SOUND_PED_COP_LITTLECOPSAROUND, // also used for medics + SOUND_PED_PLAYER_FARFROMCOPS, // also used for medics + SOUND_PED_TAXI_WAIT, SOUND_PED_ATTACK, SOUND_PED_DEFEND, - SOUND_PED_PURSUIT_ARMY, - SOUND_PED_PURSUIT_FBI, - SOUND_PED_PURSUIT_SWAT, - SOUND_PED_PURSUIT_COP, - SOUND_PED_HEALING, - SOUND_PED_7B, + SOUND_140, SOUND_PED_LEAVE_VEHICLE, - SOUND_PED_EVADE, // 142 in VC + SOUND_PED_EVADE, SOUND_PED_FLEE_RUN, - SOUND_PED_CAR_COLLISION, // 144-145-146 in VC + SOUND_PED_CAR_COLLISION, + SOUND_PED_BOAT_COLLISION, + SOUND_PED_HORN_ACTIVE, + SOUND_PED_147, SOUND_PED_SOLICIT, + SOUND_PED_149, + SOUND_PED_150, SOUND_PED_EXTINGUISHING_FIRE, SOUND_PED_WAIT_DOUBLEBACK, + SOUND_153, SOUND_PED_CHAT_SEXY, SOUND_PED_CHAT_EVENT, + SOUND_PED_PED_COLLISION, SOUND_PED_CHAT, - SOUND_PED_BODYCAST_HIT, SOUND_PED_TAXI_CALL, - SOUND_INJURED_PED_MALE_OUCH, - SOUND_INJURED_PED_FEMALE, - SOUND_INJURED_PED_MALE_PRISON, SOUND_RACE_START_3, SOUND_RACE_START_2, SOUND_RACE_START_1, @@ -151,25 +171,43 @@ enum eSound : uint16 SOUND_CAR_PED_COLLISION, SOUND_CLOCK_TICK, SOUND_PART_MISSION_COMPLETE, - SOUND_FRONTEND_MENU_STARTING, + SOUND_FRONTEND_MENU_STARTING, // same with SOUND_HUD_SOUND + + // TODO(Miami): What are 170-175?? + + SOUND_FRONTEND_NO_RADIO = 176, // those 3 are all same sound + SOUND_FRONTEND_RADIO_CHANGE, + SOUND_FRONTEND_RADIO_CHANGE_2, + SOUND_HUD_SOUND, + SOUND_180, + SOUND_181, + SOUND_182, + SOUND_LIGHTNING, + SOUND_BULLETTRACE_1, + SOUND_BULLETTRACE_2, + SOUND_186, // makes same sound with 40 + SOUND_187, // makes same sound with 46 + SOUND_MELEE_ATTACK_START, + SOUND_189, + SOUND_WEAPON_MINIGUN_ATTACK, + SOUND_WEAPON_MINIGUN_2, + SOUND_WEAPON_MINIGUN_3, + SOUND_AMMUNATION_IMRAN_ARM_BOMB, + SOUND_194, + + // TODO(Miami): They're frontend sounds but names are copy-paste and incorrect SOUND_FRONTEND_MENU_COMPLETED, - SOUND_FRONTEND_MENU_DENIED, + SOUND_FRONTEND_FAIL, SOUND_FRONTEND_MENU_SUCCESS, SOUND_FRONTEND_EXIT, - SOUND_9A, - SOUND_9B, SOUND_FRONTEND_AUDIO_TEST, - SOUND_FRONTEND_FAIL, - SOUND_FRONTEND_NO_RADIO, - SOUND_FRONTEND_RADIO_CHANGE, - SOUND_A0, - SOUND_AMMUNATION_WELCOME_1, - SOUND_AMMUNATION_WELCOME_2, - SOUND_AMMUNATION_WELCOME_3, - SOUND_LIGHTNING, - SOUND_A5, - SOUND_TOTAL_SOUNDS, - SOUND_NO_SOUND, + + SOUND_INJURED_PED_MALE_OUCH, + SOUND_INJURED_PED_FEMALE, + SOUND_SET_202, + SOUND_SET_203, + SOUND_TOTAL_SOUNDS = 204, + SOUND_NO_SOUND = 205, }; |