summaryrefslogtreecommitdiffstats
path: root/src/audio
diff options
context:
space:
mode:
authoreray orçunus <erayorcunus@gmail.com>2020-06-04 05:03:12 +0200
committereray orçunus <erayorcunus@gmail.com>2020-06-04 05:03:12 +0200
commit016ebc0b00905c35ca16dcbd22c41fb4602c3e37 (patch)
tree5c08c95450e72b97934c20cf537a4b0d42189e71 /src/audio
parentPedChat & PedDebug (diff)
downloadre3-016ebc0b00905c35ca16dcbd22c41fb4602c3e37.tar
re3-016ebc0b00905c35ca16dcbd22c41fb4602c3e37.tar.gz
re3-016ebc0b00905c35ca16dcbd22c41fb4602c3e37.tar.bz2
re3-016ebc0b00905c35ca16dcbd22c41fb4602c3e37.tar.lz
re3-016ebc0b00905c35ca16dcbd22c41fb4602c3e37.tar.xz
re3-016ebc0b00905c35ca16dcbd22c41fb4602c3e37.tar.zst
re3-016ebc0b00905c35ca16dcbd22c41fb4602c3e37.zip
Diffstat (limited to 'src/audio')
-rw-r--r--src/audio/AudioLogic.cpp39
-rw-r--r--src/audio/AudioManager.h2
-rw-r--r--src/audio/soundlist.h36
3 files changed, 38 insertions, 39 deletions
diff --git a/src/audio/AudioLogic.cpp b/src/audio/AudioLogic.cpp
index ab135877..b6fb5a86 100644
--- a/src/audio/AudioLogic.cpp
+++ b/src/audio/AudioLogic.cpp
@@ -1554,27 +1554,23 @@ 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;
-#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);
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)
@@ -1604,8 +1600,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
@@ -2046,7 +2045,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams *params)
maxDist = SQR(SOUND_INTENSITY);
break;
}
- case SOUND_17: {
+ case SOUND_BOAT_SLOWDOWN: {
const float SOUND_INTENSITY = 50.0f;
m_sQueueSample.m_nSampleIndex = SFX_POLICE_BOAT_THUMB_OFF;
m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN;
@@ -2059,8 +2058,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;
@@ -2414,7 +2413,7 @@ cAudioManager::ProcessBoatEngine(cVehicleParams *params)
m_sQueueSample.m_nSampleIndex = SFX_POLICE_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;
@@ -8002,7 +8001,7 @@ cAudioManager::ProcessFrontEnd()
processedPickup = true;
stereo = true;
break;
- case SOUND_4A:
+ case SOUND_PICKUP_ERROR:
m_sQueueSample.m_nSampleIndex = SFX_PICKUP_ERROR_LEFT;
processedPickup = true;
stereo = true;
@@ -8037,19 +8036,19 @@ cAudioManager::ProcessFrontEnd()
m_sQueueSample.m_nSampleIndex = SFX_START_BUTTON_LEFT;
stereo = true;
break;
- case SOUND_FRONTEND_MENU_COMPLETED:
+ case SOUND_FRONTEND_MENU_NEW_PAGE:
m_sQueueSample.m_nSampleIndex = SFX_PAGE_CHANGE_AND_BACK_LEFT;
stereo = true;
break;
- case SOUND_FRONTEND_MENU_DENIED:
+ case SOUND_FRONTEND_MENU_NAVIGATION:
m_sQueueSample.m_nSampleIndex = SFX_HIGHLIGHT_LEFT;
stereo = true;
break;
- case SOUND_FRONTEND_MENU_SUCCESS:
+ case SOUND_FRONTEND_MENU_SETTING_CHANGE:
m_sQueueSample.m_nSampleIndex = SFX_SELECT_LEFT;
stereo = true;
break;
- case SOUND_FRONTEND_EXIT:
+ case SOUND_FRONTEND_MENU_BACK:
m_sQueueSample.m_nSampleIndex = SFX_SUB_MENU_BACK_LEFT;
stereo = true;
break;
@@ -8071,7 +8070,7 @@ cAudioManager::ProcessFrontEnd()
case SOUND_FRONTEND_RADIO_CHANGE:
m_sQueueSample.m_nSampleIndex = SFX_RADIO_CLICK;
break;
- case SOUND_A0:
+ case SOUND_HUD:
m_sQueueSample.m_nSampleIndex = SFX_INFO;
break;
default:
diff --git a/src/audio/AudioManager.h b/src/audio/AudioManager.h
index 8e1c9590..c9cb5bef 100644
--- a/src/audio/AudioManager.h
+++ b/src/audio/AudioManager.h
@@ -420,7 +420,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..08a1631e 100644
--- a/src/audio/soundlist.h
+++ b/src/audio/soundlist.h
@@ -25,9 +25,9 @@ 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,
@@ -76,7 +76,7 @@ enum eSound : uint16
SOUND_PICKUP_WEAPON_BOUGHT,
SOUND_PICKUP_WEAPON,
SOUND_PICKUP_HEALTH,
- SOUND_4A,
+ SOUND_PICKUP_ERROR,
SOUND_4B,
SOUND_PICKUP_ADRENALINE,
SOUND_PICKUP_ARMOUR,
@@ -99,25 +99,25 @@ 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_BURNING,
SOUND_PED_ARREST_FBI,
SOUND_PED_ARREST_SWAT,
SOUND_PED_ARREST_COP,
SOUND_PED_HELI_PLAYER_FOUND,
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_TAXI_WAIT,
SOUND_PED_ATTACK,
SOUND_PED_DEFEND,
SOUND_PED_PURSUIT_ARMY,
@@ -127,9 +127,9 @@ enum eSound : uint16
SOUND_PED_HEALING,
SOUND_PED_7B,
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_SOLICIT,
SOUND_PED_EXTINGUISHING_FIRE,
SOUND_PED_WAIT_DOUBLEBACK,
@@ -152,17 +152,17 @@ enum eSound : uint16
SOUND_CLOCK_TICK,
SOUND_PART_MISSION_COMPLETE,
SOUND_FRONTEND_MENU_STARTING,
- SOUND_FRONTEND_MENU_COMPLETED,
- SOUND_FRONTEND_MENU_DENIED,
- SOUND_FRONTEND_MENU_SUCCESS,
- SOUND_FRONTEND_EXIT,
+ SOUND_FRONTEND_MENU_NEW_PAGE,
+ SOUND_FRONTEND_MENU_NAVIGATION,
+ SOUND_FRONTEND_MENU_SETTING_CHANGE,
+ SOUND_FRONTEND_MENU_BACK,
SOUND_9A,
SOUND_9B,
SOUND_FRONTEND_AUDIO_TEST,
SOUND_FRONTEND_FAIL,
SOUND_FRONTEND_NO_RADIO,
SOUND_FRONTEND_RADIO_CHANGE,
- SOUND_A0,
+ SOUND_HUD,
SOUND_AMMUNATION_WELCOME_1,
SOUND_AMMUNATION_WELCOME_2,
SOUND_AMMUNATION_WELCOME_3,