mirror of
https://github.com/GTAmodding/re3.git
synced 2024-12-25 19:15:41 +00:00
Audio fixes for erorcun review
This commit is contained in:
parent
9afac431b0
commit
c7e9ddb566
4 changed files with 41 additions and 41 deletions
|
@ -518,11 +518,11 @@ cAudioManager::AgeCrimes()
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
cAudioManager::CalculateDistance(bool *ptr, float dist)
|
cAudioManager::CalculateDistance(bool &condition, float dist)
|
||||||
{
|
{
|
||||||
if(*ptr == false) {
|
if(condition == false) {
|
||||||
m_sQueueSample.m_fDistance = Sqrt(dist);
|
m_sQueueSample.m_fDistance = Sqrt(dist);
|
||||||
*ptr = true;
|
condition = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3181,7 +3181,7 @@ cAudioManager::ProcessAirBrakes(cVehicleParams *params)
|
||||||
(automobile->m_fVelocityChangeForAudio > -0.025f || params->m_fVelocityChange <= 0.025f))
|
(automobile->m_fVelocityChangeForAudio > -0.025f || params->m_fVelocityChange <= 0.025f))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
CalculateDistance((bool *)params, params->m_fDistance);
|
CalculateDistance(params->m_bDistanceCalculated, params->m_fDistance);
|
||||||
rand = m_anRandomTable[0] % 10 + 70;
|
rand = m_anRandomTable[0] % 10 + 70;
|
||||||
m_sQueueSample.m_bVolume = ComputeVolume(rand, 30.0f, m_sQueueSample.m_fDistance);
|
m_sQueueSample.m_bVolume = ComputeVolume(rand, 30.0f, m_sQueueSample.m_fDistance);
|
||||||
if(m_sQueueSample.m_bVolume) {
|
if(m_sQueueSample.m_bVolume) {
|
||||||
|
@ -3273,7 +3273,7 @@ cAudioManager::ProcessBoatEngine(cVehicleParams *params)
|
||||||
if(params->m_fDistance < 2500.f) {
|
if(params->m_fDistance < 2500.f) {
|
||||||
boat = (CBoat *)params->m_pVehicle;
|
boat = (CBoat *)params->m_pVehicle;
|
||||||
if(params->m_nIndex == REEFER) {
|
if(params->m_nIndex == REEFER) {
|
||||||
CalculateDistance((bool *)params, params->m_fDistance);
|
CalculateDistance(params->m_bDistanceCalculated, params->m_fDistance);
|
||||||
m_sQueueSample.m_bVolume = ComputeVolume(80, 50.f, m_sQueueSample.m_fDistance);
|
m_sQueueSample.m_bVolume = ComputeVolume(80, 50.f, m_sQueueSample.m_fDistance);
|
||||||
if(m_sQueueSample.m_bVolume) {
|
if(m_sQueueSample.m_bVolume) {
|
||||||
m_sQueueSample.m_counter = 39;
|
m_sQueueSample.m_counter = 39;
|
||||||
|
@ -3379,7 +3379,7 @@ cAudioManager::ProcessBoatEngine(cVehicleParams *params)
|
||||||
m_sQueueSample.m_nSampleIndex = SFX_POLICE_BOAT_ACCEL;
|
m_sQueueSample.m_nSampleIndex = SFX_POLICE_BOAT_ACCEL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
CalculateDistance((bool *)params, params->m_fDistance);
|
CalculateDistance(params->m_bDistanceCalculated, params->m_fDistance);
|
||||||
m_sQueueSample.m_bVolume = ComputeVolume(emittingVol, 50.f, m_sQueueSample.m_fDistance);
|
m_sQueueSample.m_bVolume = ComputeVolume(emittingVol, 50.f, m_sQueueSample.m_fDistance);
|
||||||
if(!m_sQueueSample.m_bVolume) return 1;
|
if(!m_sQueueSample.m_bVolume) return 1;
|
||||||
m_sQueueSample.m_nFrequency += (m_sQueueSample.m_nEntityIndex << 16) % 1000;
|
m_sQueueSample.m_nFrequency += (m_sQueueSample.m_nEntityIndex << 16) % 1000;
|
||||||
|
@ -3418,7 +3418,7 @@ cAudioManager::ProcessBoatMovingOverWater(cVehicleParams *params)
|
||||||
|
|
||||||
velocityChange = min(0.75f, velocityChange);
|
velocityChange = min(0.75f, velocityChange);
|
||||||
multiplier = (velocityChange - 0.0005f) * 1.3342f;
|
multiplier = (velocityChange - 0.0005f) * 1.3342f;
|
||||||
CalculateDistance((bool *)params, params->m_fDistance);
|
CalculateDistance(params->m_bDistanceCalculated, params->m_fDistance);
|
||||||
vol = (30.f * multiplier);
|
vol = (30.f * multiplier);
|
||||||
m_sQueueSample.m_bVolume = ComputeVolume(vol, 50.f, m_sQueueSample.m_fDistance);
|
m_sQueueSample.m_bVolume = ComputeVolume(vol, 50.f, m_sQueueSample.m_fDistance);
|
||||||
if(m_sQueueSample.m_bVolume) {
|
if(m_sQueueSample.m_bVolume) {
|
||||||
|
@ -3448,13 +3448,13 @@ void
|
||||||
cAudioManager::ProcessBridge()
|
cAudioManager::ProcessBridge()
|
||||||
{
|
{
|
||||||
float dist;
|
float dist;
|
||||||
bool something = false;
|
bool distCalculated = false;
|
||||||
|
|
||||||
if(CBridge::pLiftRoad) {
|
if(CBridge::pLiftRoad) {
|
||||||
m_sQueueSample.m_vecPos = CBridge::pLiftRoad->GetPosition();
|
m_sQueueSample.m_vecPos = CBridge::pLiftRoad->GetPosition();
|
||||||
dist = GetDistanceSquared(&m_sQueueSample.m_vecPos);
|
dist = GetDistanceSquared(&m_sQueueSample.m_vecPos);
|
||||||
if(dist < 202500.0f) {
|
if(dist < 202500.0f) {
|
||||||
CalculateDistance(&something, dist);
|
CalculateDistance(distCalculated, dist);
|
||||||
switch(CBridge::State) {
|
switch(CBridge::State) {
|
||||||
case STATE_BRIDGE_LOCKED:
|
case STATE_BRIDGE_LOCKED:
|
||||||
case STATE_LIFT_PART_IS_UP:
|
case STATE_LIFT_PART_IS_UP:
|
||||||
|
@ -3584,7 +3584,7 @@ cAudioManager::ProcessCarBombTick(cVehicleParams *params)
|
||||||
if(params->m_fDistance >= 1600.f) return 0;
|
if(params->m_fDistance >= 1600.f) return 0;
|
||||||
automobile = (CAutomobile *)params->m_pVehicle;
|
automobile = (CAutomobile *)params->m_pVehicle;
|
||||||
if(automobile->bEngineOn && automobile->m_bombType == CARBOMB_TIMEDACTIVE) {
|
if(automobile->bEngineOn && automobile->m_bombType == CARBOMB_TIMEDACTIVE) {
|
||||||
CalculateDistance((bool *)params, params->m_fDistance);
|
CalculateDistance(params->m_bDistanceCalculated, params->m_fDistance);
|
||||||
m_sQueueSample.m_bVolume = ComputeVolume(60, 40.f, m_sQueueSample.m_fDistance);
|
m_sQueueSample.m_bVolume = ComputeVolume(60, 40.f, m_sQueueSample.m_fDistance);
|
||||||
if(m_sQueueSample.m_bVolume) {
|
if(m_sQueueSample.m_bVolume) {
|
||||||
m_sQueueSample.m_counter = 35;
|
m_sQueueSample.m_counter = 35;
|
||||||
|
@ -3750,7 +3750,7 @@ cAudioManager::ProcessEngineDamage(cVehicleParams *params)
|
||||||
m_sQueueSample.field_16 = 7;
|
m_sQueueSample.field_16 = 7;
|
||||||
m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_CAR_ON_FIRE);
|
m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_CAR_ON_FIRE);
|
||||||
}
|
}
|
||||||
CalculateDistance((bool *)params, params->m_fDistance);
|
CalculateDistance(params->m_bDistanceCalculated, params->m_fDistance);
|
||||||
m_sQueueSample.m_bVolume = ComputeVolume(emittingVolume, 40.f, m_sQueueSample.m_fDistance);
|
m_sQueueSample.m_bVolume = ComputeVolume(emittingVolume, 40.f, m_sQueueSample.m_fDistance);
|
||||||
if(m_sQueueSample.m_bVolume) {
|
if(m_sQueueSample.m_bVolume) {
|
||||||
m_sQueueSample.m_counter = 28;
|
m_sQueueSample.m_counter = 28;
|
||||||
|
@ -3933,12 +3933,12 @@ void
|
||||||
cAudioManager::ProcessFireHydrant()
|
cAudioManager::ProcessFireHydrant()
|
||||||
{
|
{
|
||||||
float distSquared;
|
float distSquared;
|
||||||
bool something = false;
|
bool distCalculated = false;
|
||||||
|
|
||||||
m_sQueueSample.m_vecPos = *(CVector *)((size_t)m_asAudioEntities[m_sQueueSample.m_nEntityIndex].m_pEntity + 52);
|
m_sQueueSample.m_vecPos = *(CVector *)((size_t)m_asAudioEntities[m_sQueueSample.m_nEntityIndex].m_pEntity + 52);
|
||||||
distSquared = GetDistanceSquared(&m_sQueueSample.m_vecPos);
|
distSquared = GetDistanceSquared(&m_sQueueSample.m_vecPos);
|
||||||
if(distSquared < 1225.f) {
|
if(distSquared < 1225.f) {
|
||||||
CalculateDistance(&something, distSquared);
|
CalculateDistance(distCalculated, distSquared);
|
||||||
m_sQueueSample.m_bVolume = ComputeVolume(40, 35.f, m_sQueueSample.m_fDistance);
|
m_sQueueSample.m_bVolume = ComputeVolume(40, 35.f, m_sQueueSample.m_fDistance);
|
||||||
if(m_sQueueSample.m_bVolume) {
|
if(m_sQueueSample.m_bVolume) {
|
||||||
m_sQueueSample.m_counter = 0;
|
m_sQueueSample.m_counter = 0;
|
||||||
|
@ -4155,7 +4155,7 @@ cAudioManager::ProcessHelicopter(cVehicleParams *params)
|
||||||
|
|
||||||
if(gHeliSfxRanges[0].m_fMaxDistance * gHeliSfxRanges[0].m_fMaxDistance <= params->m_fDistance) return 0;
|
if(gHeliSfxRanges[0].m_fMaxDistance * gHeliSfxRanges[0].m_fMaxDistance <= params->m_fDistance) return 0;
|
||||||
|
|
||||||
CalculateDistance((bool *)params, params->m_fDistance);
|
CalculateDistance(params->m_bDistanceCalculated, params->m_fDistance);
|
||||||
heli = (CHeli *)params->m_pVehicle;
|
heli = (CHeli *)params->m_pVehicle;
|
||||||
for(uint32 i = 0; i < 3; i++) {
|
for(uint32 i = 0; i < 3; i++) {
|
||||||
MaxDist = gHeliSfxRanges[i].m_fMaxDistance;
|
MaxDist = gHeliSfxRanges[i].m_fMaxDistance;
|
||||||
|
@ -4254,7 +4254,7 @@ cAudioManager::ProcessJumbo(cVehicleParams *params)
|
||||||
float position;
|
float position;
|
||||||
|
|
||||||
if(params->m_fDistance < 193600.0f) {
|
if(params->m_fDistance < 193600.0f) {
|
||||||
CalculateDistance((bool *)params, params->m_fDistance);
|
CalculateDistance(params->m_bDistanceCalculated, params->m_fDistance);
|
||||||
plane = (CPlane *)params->m_pVehicle;
|
plane = (CPlane *)params->m_pVehicle;
|
||||||
DoJumboVolOffset();
|
DoJumboVolOffset();
|
||||||
position = PlanePathPosition[plane->m_nPlaneId];
|
position = PlanePathPosition[plane->m_nPlaneId];
|
||||||
|
@ -5214,7 +5214,7 @@ cAudioManager::ProcessModelCarEngine(cVehicleParams *params)
|
||||||
else
|
else
|
||||||
emittingVol = 90;
|
emittingVol = 90;
|
||||||
if(emittingVol) {
|
if(emittingVol) {
|
||||||
CalculateDistance((bool *)params, params->m_fDistance);
|
CalculateDistance(params->m_bDistanceCalculated, params->m_fDistance);
|
||||||
m_sQueueSample.m_bVolume =
|
m_sQueueSample.m_bVolume =
|
||||||
ComputeVolume(emittingVol, 30.f, m_sQueueSample.m_fDistance);
|
ComputeVolume(emittingVol, 30.f, m_sQueueSample.m_fDistance);
|
||||||
if(m_sQueueSample.m_bVolume) {
|
if(m_sQueueSample.m_bVolume) {
|
||||||
|
@ -5537,7 +5537,7 @@ cAudioManager::ProcessPedHeadphones(cPedParams *params)
|
||||||
if(params->m_fDistance < 49.f) {
|
if(params->m_fDistance < 49.f) {
|
||||||
ped = params->m_pPed;
|
ped = params->m_pPed;
|
||||||
if(!ped->bIsAimingGun || ped->m_bodyPartBleeding != 2) {
|
if(!ped->bIsAimingGun || ped->m_bodyPartBleeding != 2) {
|
||||||
CalculateDistance((bool *)params, params->m_fDistance);
|
CalculateDistance(params->m_bDistanceCalculated, params->m_fDistance);
|
||||||
if(ped->bInVehicle && ped->m_nPedState == PED_DRIVING) {
|
if(ped->bInVehicle && ped->m_nPedState == PED_DRIVING) {
|
||||||
emittingVol = 10;
|
emittingVol = 10;
|
||||||
veh = ped->m_pMyVehicle;
|
veh = ped->m_pMyVehicle;
|
||||||
|
@ -6991,7 +6991,7 @@ cAudioManager::ProcessRainOnVehicle(cVehicleParams *params)
|
||||||
veh = params->m_pVehicle;
|
veh = params->m_pVehicle;
|
||||||
if(veh->m_bRainAudioCounter >= 2) {
|
if(veh->m_bRainAudioCounter >= 2) {
|
||||||
veh->m_bRainAudioCounter = 0;
|
veh->m_bRainAudioCounter = 0;
|
||||||
CalculateDistance((bool *)params, params->m_fDistance);
|
CalculateDistance(params->m_bDistanceCalculated, params->m_fDistance);
|
||||||
emittingVol = 30.f * CWeather::Rain;
|
emittingVol = 30.f * CWeather::Rain;
|
||||||
m_sQueueSample.m_bVolume = ComputeVolume(emittingVol, 22.f, m_sQueueSample.m_fDistance);
|
m_sQueueSample.m_bVolume = ComputeVolume(emittingVol, 22.f, m_sQueueSample.m_fDistance);
|
||||||
if(m_sQueueSample.m_bVolume) {
|
if(m_sQueueSample.m_bVolume) {
|
||||||
|
@ -7040,7 +7040,7 @@ cAudioManager::ProcessReverseGear(cVehicleParams *params)
|
||||||
if(params->m_fDistance >= 900.f) return 0;
|
if(params->m_fDistance >= 900.f) return 0;
|
||||||
veh = params->m_pVehicle;
|
veh = params->m_pVehicle;
|
||||||
if(veh->bEngineOn && (veh->m_fGasPedal < 0.0f || !veh->m_nCurrentGear)) {
|
if(veh->bEngineOn && (veh->m_fGasPedal < 0.0f || !veh->m_nCurrentGear)) {
|
||||||
CalculateDistance((bool *)params, params->m_fDistance);
|
CalculateDistance(params->m_bDistanceCalculated, params->m_fDistance);
|
||||||
automobile = (CAutomobile *)params->m_pVehicle;
|
automobile = (CAutomobile *)params->m_pVehicle;
|
||||||
if(automobile->m_nWheelsOnGround) {
|
if(automobile->m_nWheelsOnGround) {
|
||||||
modificator = params->m_fVelocityChange / params->m_pTransmission->fMaxReverseVelocity;
|
modificator = params->m_fVelocityChange / params->m_pTransmission->fMaxReverseVelocity;
|
||||||
|
@ -7258,7 +7258,7 @@ cAudioManager::ProcessTrainNoise(cVehicleParams *params)
|
||||||
if(params->m_fDistance >= 90000.f) return 0;
|
if(params->m_fDistance >= 90000.f) return 0;
|
||||||
|
|
||||||
if(params->m_fVelocityChange > 0.0f) {
|
if(params->m_fVelocityChange > 0.0f) {
|
||||||
CalculateDistance((bool *)params, params->m_fDistance);
|
CalculateDistance(params->m_bDistanceCalculated, params->m_fDistance);
|
||||||
train = (CTrain *)params->m_pVehicle;
|
train = (CTrain *)params->m_pVehicle;
|
||||||
speedMultipler = min(1.0f, train->m_fSpeed * 250.f / 51.f);
|
speedMultipler = min(1.0f, train->m_fSpeed * 250.f / 51.f);
|
||||||
emittingVol = (75.f * speedMultipler);
|
emittingVol = (75.f * speedMultipler);
|
||||||
|
@ -7323,7 +7323,7 @@ cAudioManager::ProcessVehicle(CVehicle *veh)
|
||||||
cVehicleParams params;
|
cVehicleParams params;
|
||||||
m_sQueueSample.m_vecPos = veh->GetPosition();
|
m_sQueueSample.m_vecPos = veh->GetPosition();
|
||||||
|
|
||||||
params.m_bDistancECalculated = 0;
|
params.m_bDistanceCalculated = false;
|
||||||
params.m_fDistance = GetDistanceSquared(&m_sQueueSample.m_vecPos);
|
params.m_fDistance = GetDistanceSquared(&m_sQueueSample.m_vecPos);
|
||||||
params.m_pVehicle = veh;
|
params.m_pVehicle = veh;
|
||||||
params.m_pTransmission = nil;
|
params.m_pTransmission = nil;
|
||||||
|
@ -7416,7 +7416,7 @@ cAudioManager::ProcessVehicleDoors(cVehicleParams *params)
|
||||||
if(params->m_fDistance >= 1600.f) return 0;
|
if(params->m_fDistance >= 1600.f) return 0;
|
||||||
|
|
||||||
automobile = (CAutomobile *)params->m_pVehicle;
|
automobile = (CAutomobile *)params->m_pVehicle;
|
||||||
CalculateDistance((bool *)params, params->m_fDistance);
|
CalculateDistance(params->m_bDistanceCalculated, params->m_fDistance);
|
||||||
for(int32 i = 0; i < 6; i++) {
|
for(int32 i = 0; i < 6; i++) {
|
||||||
if(automobile->Damage.GetDoorStatus(i) == 2) {
|
if(automobile->Damage.GetDoorStatus(i) == 2) {
|
||||||
doorState = automobile->Doors[i].m_nDoorState;
|
doorState = automobile->Doors[i].m_nDoorState;
|
||||||
|
@ -7472,7 +7472,7 @@ cAudioManager::ProcessVehicleHorn(cVehicleParams *params)
|
||||||
automobile->m_modelIndex != MI_MRWHOOP) {
|
automobile->m_modelIndex != MI_MRWHOOP) {
|
||||||
if(automobile->m_nCarHornTimer) {
|
if(automobile->m_nCarHornTimer) {
|
||||||
if(!params->m_pVehicle->m_status) {
|
if(!params->m_pVehicle->m_status) {
|
||||||
CalculateDistance((bool *)params, params->m_fDistance);
|
CalculateDistance(params->m_bDistanceCalculated, params->m_fDistance);
|
||||||
m_sQueueSample.m_bVolume = ComputeVolume(80, 40.f, m_sQueueSample.m_fDistance);
|
m_sQueueSample.m_bVolume = ComputeVolume(80, 40.f, m_sQueueSample.m_fDistance);
|
||||||
if(m_sQueueSample.m_bVolume) {
|
if(m_sQueueSample.m_bVolume) {
|
||||||
m_sQueueSample.m_counter = 4;
|
m_sQueueSample.m_counter = 4;
|
||||||
|
@ -7504,7 +7504,7 @@ cAudioManager::ProcessVehicleHorn(cVehicleParams *params)
|
||||||
automobile->field_22D =
|
automobile->field_22D =
|
||||||
(LOBYTE(m_nTimeOfRecentCrime) + LOBYTE(m_sQueueSample.m_nEntityIndex)) & 7;
|
(LOBYTE(m_nTimeOfRecentCrime) + LOBYTE(m_sQueueSample.m_nEntityIndex)) & 7;
|
||||||
if(hornPatternsArray[automobile->field_22D][44 - automobile->m_nCarHornTimer]) {
|
if(hornPatternsArray[automobile->field_22D][44 - automobile->m_nCarHornTimer]) {
|
||||||
CalculateDistance((bool *)params, params->m_fDistance);
|
CalculateDistance(params->m_bDistanceCalculated, params->m_fDistance);
|
||||||
m_sQueueSample.m_bVolume = ComputeVolume(80, 40.f, m_sQueueSample.m_fDistance);
|
m_sQueueSample.m_bVolume = ComputeVolume(80, 40.f, m_sQueueSample.m_fDistance);
|
||||||
if(m_sQueueSample.m_bVolume) {
|
if(m_sQueueSample.m_bVolume) {
|
||||||
m_sQueueSample.m_counter = 4;
|
m_sQueueSample.m_counter = 4;
|
||||||
|
@ -7550,7 +7550,7 @@ cAudioManager::ProcessVehicleReverseWarning(cVehicleParams *params)
|
||||||
if(params->m_fDistance >= 2500.f) return 0;
|
if(params->m_fDistance >= 2500.f) return 0;
|
||||||
|
|
||||||
if(veh->bEngineOn && veh->m_fGasPedal < 0.0f) {
|
if(veh->bEngineOn && veh->m_fGasPedal < 0.0f) {
|
||||||
CalculateDistance((bool *)params, params->m_fDistance);
|
CalculateDistance(params->m_bDistanceCalculated, params->m_fDistance);
|
||||||
m_sQueueSample.m_bVolume = ComputeVolume(60, 50.f, m_sQueueSample.m_fDistance);
|
m_sQueueSample.m_bVolume = ComputeVolume(60, 50.f, m_sQueueSample.m_fDistance);
|
||||||
if(m_sQueueSample.m_bVolume) {
|
if(m_sQueueSample.m_bVolume) {
|
||||||
m_sQueueSample.m_counter = 12;
|
m_sQueueSample.m_counter = 12;
|
||||||
|
@ -7592,7 +7592,7 @@ cAudioManager::ProcessVehicleRoadNoise(cVehicleParams *params)
|
||||||
if(params->m_pVehicle->m_vecMoveSpeed.z) {
|
if(params->m_pVehicle->m_vecMoveSpeed.z) {
|
||||||
velocity = Abs(params->m_fVelocityChange);
|
velocity = Abs(params->m_fVelocityChange);
|
||||||
if(velocity > 0.0f) {
|
if(velocity > 0.0f) {
|
||||||
CalculateDistance((bool *)params, params->m_fDistance);
|
CalculateDistance(params->m_bDistanceCalculated, params->m_fDistance);
|
||||||
emittingVol =
|
emittingVol =
|
||||||
30.f * min(1.f, velocity / (0.5f * params->m_pTransmission->fMaxVelocity));
|
30.f * min(1.f, velocity / (0.5f * params->m_pTransmission->fMaxVelocity));
|
||||||
m_sQueueSample.m_bVolume = ComputeVolume(emittingVol, 95.f, m_sQueueSample.m_fDistance);
|
m_sQueueSample.m_bVolume = ComputeVolume(emittingVol, 95.f, m_sQueueSample.m_fDistance);
|
||||||
|
@ -7639,7 +7639,7 @@ cAudioManager::ProcessVehicleSirenOrAlarm(cVehicleParams *params)
|
||||||
CVehicle *veh = params->m_pVehicle;
|
CVehicle *veh = params->m_pVehicle;
|
||||||
if(veh->m_bSirenOrAlarm == 0 && veh->m_nAlarmState <= 0) return;
|
if(veh->m_bSirenOrAlarm == 0 && veh->m_nAlarmState <= 0) return;
|
||||||
|
|
||||||
CalculateDistance((bool *)params, params->m_fDistance);
|
CalculateDistance(params->m_bDistanceCalculated, params->m_fDistance);
|
||||||
m_sQueueSample.m_bVolume = ComputeVolume(80, 110.f, m_sQueueSample.m_fDistance);
|
m_sQueueSample.m_bVolume = ComputeVolume(80, 110.f, m_sQueueSample.m_fDistance);
|
||||||
if(m_sQueueSample.m_bVolume) {
|
if(m_sQueueSample.m_bVolume) {
|
||||||
m_sQueueSample.m_counter = 5;
|
m_sQueueSample.m_counter = 5;
|
||||||
|
@ -7695,7 +7695,7 @@ cAudioManager::ProcessVehicleSkidding(cVehicleParams *params)
|
||||||
if(params->m_fDistance >= 1600.f) return;
|
if(params->m_fDistance >= 1600.f) return;
|
||||||
automobile = (CAutomobile *)params->m_pVehicle;
|
automobile = (CAutomobile *)params->m_pVehicle;
|
||||||
if(!automobile->m_nWheelsOnGround) return;
|
if(!automobile->m_nWheelsOnGround) return;
|
||||||
CalculateDistance((bool *)params, params->m_fDistance);
|
CalculateDistance(params->m_bDistanceCalculated, params->m_fDistance);
|
||||||
for(int32 i = 0; i < 4; i++) {
|
for(int32 i = 0; i < 4; i++) {
|
||||||
if(!automobile->m_aWheelState[i] || automobile->Damage.GetWheelStatus(i) == WHEEL_STATUS_MISSING)
|
if(!automobile->m_aWheelState[i] || automobile->Damage.GetWheelStatus(i) == WHEEL_STATUS_MISSING)
|
||||||
continue;
|
continue;
|
||||||
|
@ -7884,7 +7884,7 @@ cAudioManager::ProcessWetRoadNoise(cVehicleParams *params)
|
||||||
if(params->m_pVehicle->m_vecMoveSpeed.z) {
|
if(params->m_pVehicle->m_vecMoveSpeed.z) {
|
||||||
velChange = Abs(params->m_fVelocityChange);
|
velChange = Abs(params->m_fVelocityChange);
|
||||||
if(velChange > 0.f) {
|
if(velChange > 0.f) {
|
||||||
CalculateDistance((bool *)params, params->m_fDistance);
|
CalculateDistance(params->m_bDistanceCalculated, params->m_fDistance);
|
||||||
relativeVelocity =
|
relativeVelocity =
|
||||||
min(1.0f, velChange / (0.5f * params->m_pTransmission->fMaxVelocity));
|
min(1.0f, velChange / (0.5f * params->m_pTransmission->fMaxVelocity));
|
||||||
emittingVol = 23.0f * relativeVelocity * CWeather::WetRoads;
|
emittingVol = 23.0f * relativeVelocity * CWeather::WetRoads;
|
||||||
|
@ -8913,14 +8913,14 @@ cAudioManager::SetupPedComments(cPedParams *params, uint32 sound)
|
||||||
soundIntensity = 50.f;
|
soundIntensity = 50.f;
|
||||||
|
|
||||||
if(params->m_fDistance < maxDist) {
|
if(params->m_fDistance < maxDist) {
|
||||||
CalculateDistance((bool *)params, params->m_fDistance);
|
CalculateDistance(params->m_bDistanceCalculated, params->m_fDistance);
|
||||||
if(sound != SOUND_PAGER) {
|
if(sound != SOUND_PAGER) {
|
||||||
switch(sound) {
|
switch(sound) {
|
||||||
case SOUND_AMMUNATION_WELCOME_1:
|
case SOUND_AMMUNATION_WELCOME_1:
|
||||||
case SOUND_AMMUNATION_WELCOME_2:
|
case SOUND_AMMUNATION_WELCOME_2:
|
||||||
case SOUND_AMMUNATION_WELCOME_3: emittingVol = maxVolume; break;
|
case SOUND_AMMUNATION_WELCOME_3: emittingVol = maxVolume; break;
|
||||||
default:
|
default:
|
||||||
if(CWorld::GetIsLineOfSightClear(TheCamera.GetGameCamPosition(),
|
if(CWorld::GetIsLineOfSightClear(TheCamera.GetPosition(),
|
||||||
m_sQueueSample.m_vecPos, 1, 0, 0, 0, 0, 0,
|
m_sQueueSample.m_vecPos, 1, 0, 0, 0, 0, 0,
|
||||||
0)) {
|
0)) {
|
||||||
emittingVol = maxVolume;
|
emittingVol = maxVolume;
|
||||||
|
@ -8974,14 +8974,14 @@ cAudioManager::SetupPedComments(cPedParams *params, uint32 sound)
|
||||||
}
|
}
|
||||||
|
|
||||||
if(params->m_fDistance < maxDist) {
|
if(params->m_fDistance < maxDist) {
|
||||||
CalculateDistance((bool *)params, params->m_fDistance);
|
CalculateDistance(params->m_bDistanceCalculated, params->m_fDistance);
|
||||||
if(sound != SOUND_PAGER) {
|
if(sound != SOUND_PAGER) {
|
||||||
switch(sound) {
|
switch(sound) {
|
||||||
case SOUND_AMMUNATION_WELCOME_1:
|
case SOUND_AMMUNATION_WELCOME_1:
|
||||||
case SOUND_AMMUNATION_WELCOME_2:
|
case SOUND_AMMUNATION_WELCOME_2:
|
||||||
case SOUND_AMMUNATION_WELCOME_3: emittingVol = maxVolume; break;
|
case SOUND_AMMUNATION_WELCOME_3: emittingVol = maxVolume; break;
|
||||||
default:
|
default:
|
||||||
if(CWorld::GetIsLineOfSightClear(TheCamera.GetGameCamPosition(),
|
if(CWorld::GetIsLineOfSightClear(TheCamera.GetPosition(),
|
||||||
m_sQueueSample.m_vecPos, 1, 0, 0, 0, 0, 0,
|
m_sQueueSample.m_vecPos, 1, 0, 0, 0, 0, 0,
|
||||||
0)) {
|
0)) {
|
||||||
emittingVol = maxVolume;
|
emittingVol = maxVolume;
|
||||||
|
|
|
@ -440,7 +440,7 @@ public:
|
||||||
void AddSampleToRequestedQueue(); /// ok
|
void AddSampleToRequestedQueue(); /// ok
|
||||||
void AgeCrimes(); /// ok
|
void AgeCrimes(); /// ok
|
||||||
|
|
||||||
void CalculateDistance(bool *ptr, float dist); /// ok
|
void CalculateDistance(bool &condition, float dist); /// ok
|
||||||
bool CheckForAnAudioFileOnCD() const; /// ok
|
bool CheckForAnAudioFileOnCD() const; /// ok
|
||||||
void ClearActiveSamples(); /// ok
|
void ClearActiveSamples(); /// ok
|
||||||
void ClearMissionAudio(); /// ok
|
void ClearMissionAudio(); /// ok
|
||||||
|
|
|
@ -819,7 +819,7 @@ public:
|
||||||
class cPedParams
|
class cPedParams
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
char m_bDistanceCalculated;
|
bool m_bDistanceCalculated;
|
||||||
char gap_1[3];
|
char gap_1[3];
|
||||||
float m_fDistance;
|
float m_fDistance;
|
||||||
CPed *m_pPed;
|
CPed *m_pPed;
|
||||||
|
|
|
@ -286,7 +286,7 @@ class cTransmission;
|
||||||
class cVehicleParams
|
class cVehicleParams
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
uint8 m_bDistancECalculated;
|
bool m_bDistanceCalculated;
|
||||||
char gap_1[3];
|
char gap_1[3];
|
||||||
float m_fDistance;
|
float m_fDistance;
|
||||||
CVehicle *m_pVehicle;
|
CVehicle *m_pVehicle;
|
||||||
|
@ -295,4 +295,4 @@ public:
|
||||||
float m_fVelocityChange;
|
float m_fVelocityChange;
|
||||||
};
|
};
|
||||||
|
|
||||||
static_assert(sizeof(cVehicleParams) == 0x18, "CVehicle: error");
|
static_assert(sizeof(cVehicleParams) == 0x18, "cVehicleParams: error");
|
||||||
|
|
Loading…
Reference in a new issue