Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Nikolay Korolev 2020-04-28 00:47:47 +03:00
commit fcf9011601
9 changed files with 235 additions and 235 deletions

2
librw

@ -1 +1 @@
Subproject commit 4db08e15e8bdd0286195f48a28d4c8108ea64c6a
Subproject commit eb71ca25d0c4f10b39c653d9b9847e38aac198d7

View File

@ -590,7 +590,7 @@ cAudioManager::ClearActiveSamples()
m_asActiveSamples[i].m_fSpeedMultiplier = 0.0f;
m_asActiveSamples[i].m_fSoundIntensity = 200.0f;
m_asActiveSamples[i].m_bOffset = 63;
m_asActiveSamples[i].m_bReleasingSoundFlag = 0;
m_asActiveSamples[i].m_bReleasingSoundFlag = false;
m_asActiveSamples[i].m_nCalculatedVolume = 0;
m_asActiveSamples[i].m_nReleasingVolumeDivider = 0;
m_asActiveSamples[i].m_nVolumeChange = -1;
@ -3680,7 +3680,7 @@ cAudioManager::ProcessBoatEngine(cVehicleParams *params)
}
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 true;
m_sQueueSample.m_nCounter = 40;
m_sQueueSample.m_nSampleIndex = SFX_POLICE_BOAT_ACCEL;
m_sQueueSample.m_nFrequency += (m_sQueueSample.m_nEntityIndex << 16) % 1000;
@ -3747,7 +3747,7 @@ cAudioManager::ProcessBoatEngine(cVehicleParams *params)
CalculateDistance(params->m_bDistanceCalculated, params->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 true;
m_sQueueSample.m_nFrequency += (m_sQueueSample.m_nEntityIndex << 16) % 1000;
m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN;
m_sQueueSample.m_bIs2D = false;
@ -3873,20 +3873,16 @@ cAudioManager::ProcessBridgeMotor()
void
cAudioManager::ProcessBridgeOneShots()
{
if(CBridge::State == STATE_LIFT_PART_IS_UP &&
CBridge::OldState == STATE_LIFT_PART_MOVING_UP) {
if(CBridge::State == STATE_LIFT_PART_IS_UP && CBridge::OldState == STATE_LIFT_PART_MOVING_UP) {
m_sQueueSample.m_nSampleIndex = SFX_COL_CONTAINER_1;
} else {
if(CBridge::State == STATE_LIFT_PART_IS_DOWN &&
CBridge::OldState == STATE_LIFT_PART_MOVING_DOWN) {
if(CBridge::State == STATE_LIFT_PART_IS_DOWN && CBridge::OldState == STATE_LIFT_PART_MOVING_DOWN) {
m_sQueueSample.m_nSampleIndex = SFX_COL_CONTAINER_1;
} else {
if(CBridge::State == STATE_LIFT_PART_MOVING_UP &&
CBridge::OldState == STATE_LIFT_PART_ABOUT_TO_MOVE_UP) {
if(CBridge::State == STATE_LIFT_PART_MOVING_UP && CBridge::OldState == STATE_LIFT_PART_ABOUT_TO_MOVE_UP) {
m_sQueueSample.m_nSampleIndex = SFX_COL_CONTAINER_1;
} else {
if(CBridge::State == STATE_LIFT_PART_MOVING_DOWN &&
CBridge::OldState == STATE_LIFT_PART_IS_UP) {
if(CBridge::State == STATE_LIFT_PART_MOVING_DOWN && CBridge::OldState == STATE_LIFT_PART_IS_UP) {
m_sQueueSample.m_nSampleIndex = SFX_COL_CONTAINER_1;
} else
return;
@ -6001,14 +5997,14 @@ cAudioManager::ProcessOneShotScriptObject(uint8 sound)
case SCRIPT_SOUND_INJURED_PED_MALE_OUCH_S:
case SCRIPT_SOUND_INJURED_PED_MALE_OUCH_L:
male.m_pPed = nil;
male.m_bDistanceCalculated = 0;
male.m_bDistanceCalculated = false;
male.m_fDistance = GetDistanceSquared(&m_sQueueSample.m_vecPos);
SetupPedComments(&male, SOUND_INJURED_PED_MALE_OUCH);
return;
case SCRIPT_SOUND_INJURED_PED_FEMALE_OUCH_S:
case SCRIPT_SOUND_INJURED_PED_FEMALE_OUCH_L:
female.m_pPed = nil;
female.m_bDistanceCalculated = 0;
female.m_bDistanceCalculated = false;
female.m_fDistance = GetDistanceSquared(&m_sQueueSample.m_vecPos);
SetupPedComments(&female, SOUND_INJURED_PED_FEMALE);
return;
@ -6330,7 +6326,7 @@ cAudioManager::ProcessPedOneShots(cPedParams *params)
weapon = params->m_pPed->GetWeapon();
for(uint32 i = 0; i < m_asAudioEntities[m_sQueueSample.m_nEntityIndex].m_AudioEvents; i++) {
noReflection = false;
stereo = 0;
stereo = false;
m_sQueueSample.m_bRequireReflection = false;
sound = m_asAudioEntities[m_sQueueSample.m_nEntityIndex].m_awAudioEvent[i];
switch(sound) {
@ -6420,7 +6416,7 @@ cAudioManager::ProcessPedOneShots(cPedParams *params)
m_sQueueSample.m_nLoopEnd = -1;
m_sQueueSample.m_bEmittingVolume = emittingVol;
m_sQueueSample.m_bIs2D = false;
m_sQueueSample.m_bReleasingSoundFlag = 1;
m_sQueueSample.m_bReleasingSoundFlag = true;
m_sQueueSample.m_bRequireReflection = true;
}
break;
@ -6451,7 +6447,7 @@ cAudioManager::ProcessPedOneShots(cPedParams *params)
m_sQueueSample.m_nLoopEnd = -1;
m_sQueueSample.m_bEmittingVolume = emittingVol;
m_sQueueSample.m_bIs2D = false;
m_sQueueSample.m_bReleasingSoundFlag = 1;
m_sQueueSample.m_bReleasingSoundFlag = true;
m_sQueueSample.m_bRequireReflection = true;
}
break;
@ -6460,7 +6456,7 @@ cAudioManager::ProcessPedOneShots(cPedParams *params)
m_sQueueSample.m_nFrequency = 18000;
m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN;
m_sQueueSample.m_nCounter = iSound;
stereo = 1;
stereo = true;
++iSound;
m_sQueueSample.m_nReleasingVolumeModificator = 3;
m_sQueueSample.m_fSpeedMultiplier = 0.0f;
@ -6472,7 +6468,7 @@ cAudioManager::ProcessPedOneShots(cPedParams *params)
m_sQueueSample.m_nLoopEnd = -1;
m_sQueueSample.m_bEmittingVolume = emittingVol;
m_sQueueSample.m_bIs2D = false;
m_sQueueSample.m_bReleasingSoundFlag = 1;
m_sQueueSample.m_bReleasingSoundFlag = true;
m_sQueueSample.m_bRequireReflection = true;
break;
case SOUND_FIGHT_KICK_34:
@ -6480,7 +6476,7 @@ cAudioManager::ProcessPedOneShots(cPedParams *params)
m_sQueueSample.m_nFrequency = 16500;
m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN;
m_sQueueSample.m_nCounter = iSound;
stereo = 1;
stereo = true;
++iSound;
m_sQueueSample.m_nReleasingVolumeModificator = 3;
m_sQueueSample.m_fSpeedMultiplier = 0.0f;
@ -6492,7 +6488,7 @@ cAudioManager::ProcessPedOneShots(cPedParams *params)
m_sQueueSample.m_nLoopEnd = -1;
m_sQueueSample.m_bEmittingVolume = emittingVol;
m_sQueueSample.m_bIs2D = false;
m_sQueueSample.m_bReleasingSoundFlag = 1;
m_sQueueSample.m_bReleasingSoundFlag = true;
m_sQueueSample.m_bRequireReflection = true;
break;
case SOUND_FIGHT_HEADBUTT_35:
@ -6500,7 +6496,7 @@ cAudioManager::ProcessPedOneShots(cPedParams *params)
m_sQueueSample.m_nFrequency = 20000;
m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN;
m_sQueueSample.m_nCounter = iSound;
stereo = 1;
stereo = true;
++iSound;
m_sQueueSample.m_nReleasingVolumeModificator = 3;
m_sQueueSample.m_fSpeedMultiplier = 0.0f;
@ -6512,7 +6508,7 @@ cAudioManager::ProcessPedOneShots(cPedParams *params)
m_sQueueSample.m_nLoopEnd = -1;
m_sQueueSample.m_bEmittingVolume = emittingVol;
m_sQueueSample.m_bIs2D = false;
m_sQueueSample.m_bReleasingSoundFlag = 1;
m_sQueueSample.m_bReleasingSoundFlag = true;
m_sQueueSample.m_bRequireReflection = true;
break;
case SOUND_FIGHT_PUNCH_36:
@ -6520,7 +6516,7 @@ cAudioManager::ProcessPedOneShots(cPedParams *params)
m_sQueueSample.m_nFrequency = 18000;
m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN;
m_sQueueSample.m_nCounter = iSound;
stereo = 1;
stereo = true;
++iSound;
m_sQueueSample.m_nReleasingVolumeModificator = 3;
m_sQueueSample.m_fSpeedMultiplier = 0.0f;
@ -6532,7 +6528,7 @@ cAudioManager::ProcessPedOneShots(cPedParams *params)
m_sQueueSample.m_nLoopEnd = -1;
m_sQueueSample.m_bEmittingVolume = emittingVol;
m_sQueueSample.m_bIs2D = false;
m_sQueueSample.m_bReleasingSoundFlag = 1;
m_sQueueSample.m_bReleasingSoundFlag = true;
m_sQueueSample.m_bRequireReflection = true;
break;
case SOUND_FIGHT_PUNCH_37:
@ -6540,7 +6536,7 @@ cAudioManager::ProcessPedOneShots(cPedParams *params)
m_sQueueSample.m_nFrequency = 16500;
m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN;
m_sQueueSample.m_nCounter = iSound;
stereo = 1;
stereo = true;
++iSound;
m_sQueueSample.m_nReleasingVolumeModificator = 3;
m_sQueueSample.m_fSpeedMultiplier = 0.0f;
@ -6552,7 +6548,7 @@ cAudioManager::ProcessPedOneShots(cPedParams *params)
m_sQueueSample.m_nLoopEnd = -1;
m_sQueueSample.m_bEmittingVolume = emittingVol;
m_sQueueSample.m_bIs2D = false;
m_sQueueSample.m_bReleasingSoundFlag = 1;
m_sQueueSample.m_bReleasingSoundFlag = true;
m_sQueueSample.m_bRequireReflection = true;
break;
case SOUND_FIGHT_CLOSE_PUNCH_38:
@ -6560,7 +6556,7 @@ cAudioManager::ProcessPedOneShots(cPedParams *params)
m_sQueueSample.m_nFrequency = 20000;
m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN;
m_sQueueSample.m_nCounter = iSound;
stereo = 1;
stereo = true;
++iSound;
m_sQueueSample.m_nReleasingVolumeModificator = 3;
m_sQueueSample.m_fSpeedMultiplier = 0.0f;
@ -6572,7 +6568,7 @@ cAudioManager::ProcessPedOneShots(cPedParams *params)
m_sQueueSample.m_nLoopEnd = -1;
m_sQueueSample.m_bEmittingVolume = emittingVol;
m_sQueueSample.m_bIs2D = false;
m_sQueueSample.m_bReleasingSoundFlag = 1;
m_sQueueSample.m_bReleasingSoundFlag = true;
m_sQueueSample.m_bRequireReflection = true;
break;
case SOUND_FIGHT_PUNCH_39:
@ -6580,7 +6576,7 @@ cAudioManager::ProcessPedOneShots(cPedParams *params)
m_sQueueSample.m_nFrequency = 18000;
m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN;
m_sQueueSample.m_nCounter = iSound;
stereo = 1;
stereo = true;
++iSound;
m_sQueueSample.m_nReleasingVolumeModificator = 3;
m_sQueueSample.m_fSpeedMultiplier = 0.0f;
@ -6592,7 +6588,7 @@ cAudioManager::ProcessPedOneShots(cPedParams *params)
m_sQueueSample.m_nLoopEnd = -1;
m_sQueueSample.m_bEmittingVolume = emittingVol;
m_sQueueSample.m_bIs2D = false;
m_sQueueSample.m_bReleasingSoundFlag = 1;
m_sQueueSample.m_bReleasingSoundFlag = true;
m_sQueueSample.m_bRequireReflection = true;
break;
case SOUND_FIGHT_PUNCH_OR_KICK_BELOW_40:
@ -6600,7 +6596,7 @@ cAudioManager::ProcessPedOneShots(cPedParams *params)
m_sQueueSample.m_nFrequency = 16500;
m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN;
m_sQueueSample.m_nCounter = iSound;
stereo = 1;
stereo = true;
++iSound;
m_sQueueSample.m_nReleasingVolumeModificator = 3;
m_sQueueSample.m_fSpeedMultiplier = 0.0f;
@ -6612,7 +6608,7 @@ cAudioManager::ProcessPedOneShots(cPedParams *params)
m_sQueueSample.m_nLoopEnd = -1;
m_sQueueSample.m_bEmittingVolume = emittingVol;
m_sQueueSample.m_bIs2D = false;
m_sQueueSample.m_bReleasingSoundFlag = 1;
m_sQueueSample.m_bReleasingSoundFlag = true;
m_sQueueSample.m_bRequireReflection = true;
break;
case SOUND_FIGHT_PUNCH_41:
@ -6620,7 +6616,7 @@ cAudioManager::ProcessPedOneShots(cPedParams *params)
m_sQueueSample.m_nFrequency = 20000;
m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN;
m_sQueueSample.m_nCounter = iSound;
stereo = 1;
stereo = true;
++iSound;
m_sQueueSample.m_nReleasingVolumeModificator = 3;
m_sQueueSample.m_fSpeedMultiplier = 0.0f;
@ -6632,7 +6628,7 @@ cAudioManager::ProcessPedOneShots(cPedParams *params)
m_sQueueSample.m_nLoopEnd = -1;
m_sQueueSample.m_bEmittingVolume = emittingVol;
m_sQueueSample.m_bIs2D = false;
m_sQueueSample.m_bReleasingSoundFlag = 1;
m_sQueueSample.m_bReleasingSoundFlag = true;
m_sQueueSample.m_bRequireReflection = true;
break;
case SOUND_FIGHT_PUNCH_FROM_BEHIND_42:
@ -6640,7 +6636,7 @@ cAudioManager::ProcessPedOneShots(cPedParams *params)
m_sQueueSample.m_nFrequency = 18000;
m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN;
m_sQueueSample.m_nCounter = iSound;
stereo = 1;
stereo = true;
++iSound;
m_sQueueSample.m_nReleasingVolumeModificator = 3;
m_sQueueSample.m_fSpeedMultiplier = 0.0f;
@ -6652,7 +6648,7 @@ cAudioManager::ProcessPedOneShots(cPedParams *params)
m_sQueueSample.m_nLoopEnd = -1;
m_sQueueSample.m_bEmittingVolume = emittingVol;
m_sQueueSample.m_bIs2D = false;
m_sQueueSample.m_bReleasingSoundFlag = 1;
m_sQueueSample.m_bReleasingSoundFlag = true;
m_sQueueSample.m_bRequireReflection = true;
break;
case SOUND_FIGHT_KNEE_OR_KICK_43:
@ -6660,7 +6656,7 @@ cAudioManager::ProcessPedOneShots(cPedParams *params)
m_sQueueSample.m_nFrequency = 16500;
m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN;
m_sQueueSample.m_nCounter = iSound;
stereo = 1;
stereo = true;
++iSound;
m_sQueueSample.m_nReleasingVolumeModificator = 3;
m_sQueueSample.m_fSpeedMultiplier = 0.0f;
@ -6672,7 +6668,7 @@ cAudioManager::ProcessPedOneShots(cPedParams *params)
m_sQueueSample.m_nLoopEnd = -1;
m_sQueueSample.m_bEmittingVolume = emittingVol;
m_sQueueSample.m_bIs2D = false;
m_sQueueSample.m_bReleasingSoundFlag = 1;
m_sQueueSample.m_bReleasingSoundFlag = true;
m_sQueueSample.m_bRequireReflection = true;
break;
case SOUND_FIGHT_KICK_44:
@ -6680,7 +6676,7 @@ cAudioManager::ProcessPedOneShots(cPedParams *params)
m_sQueueSample.m_nFrequency = 20000;
m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN;
m_sQueueSample.m_nCounter = iSound;
stereo = 1;
stereo = true;
++iSound;
m_sQueueSample.m_nReleasingVolumeModificator = 3;
m_sQueueSample.m_fSpeedMultiplier = 0.0f;
@ -6692,14 +6688,14 @@ cAudioManager::ProcessPedOneShots(cPedParams *params)
m_sQueueSample.m_nLoopEnd = -1;
m_sQueueSample.m_bEmittingVolume = emittingVol;
m_sQueueSample.m_bIs2D = false;
m_sQueueSample.m_bReleasingSoundFlag = 1;
m_sQueueSample.m_bReleasingSoundFlag = true;
m_sQueueSample.m_bRequireReflection = true;
break;
case SOUND_WEAPON_BAT_ATTACK:
m_sQueueSample.m_nSampleIndex = SFX_BAT_HIT_LEFT;
m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN;
m_sQueueSample.m_nCounter = iSound++;
stereo = 1;
stereo = true;
m_sQueueSample.m_nFrequency = RandomDisplacement(2000) + 22000;
m_sQueueSample.m_nReleasingVolumeModificator = 3;
m_sQueueSample.m_fSpeedMultiplier = 0.0f;
@ -6711,7 +6707,7 @@ cAudioManager::ProcessPedOneShots(cPedParams *params)
emittingVol = m_anRandomTable[2] % 20 + 100;
m_sQueueSample.m_bEmittingVolume = emittingVol;
m_sQueueSample.m_bIs2D = false;
m_sQueueSample.m_bReleasingSoundFlag = 1;
m_sQueueSample.m_bReleasingSoundFlag = true;
if(m_bDynamicAcousticModelingStatus)
m_sQueueSample.m_bRequireReflection = true;
else
@ -6724,7 +6720,7 @@ cAudioManager::ProcessPedOneShots(cPedParams *params)
m_sQueueSample.m_nSampleIndex = SFX_COLT45_LEFT;
m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN;
m_sQueueSample.m_nCounter = iSound++;
stereo = 1;
stereo = true;
m_sQueueSample.m_nFrequency =
SampleManager.GetSampleBaseFrequency(SFX_COLT45_LEFT);
m_sQueueSample.m_nFrequency +=
@ -6739,7 +6735,7 @@ cAudioManager::ProcessPedOneShots(cPedParams *params)
emittingVol = m_anRandomTable[1] % 10 + 90;
m_sQueueSample.m_bEmittingVolume = emittingVol;
m_sQueueSample.m_bIs2D = false;
m_sQueueSample.m_bReleasingSoundFlag = 1;
m_sQueueSample.m_bReleasingSoundFlag = true;
if(m_bDynamicAcousticModelingStatus)
m_sQueueSample.m_bRequireReflection = true;
else
@ -6749,7 +6745,7 @@ cAudioManager::ProcessPedOneShots(cPedParams *params)
m_sQueueSample.m_nSampleIndex = SFX_UZI_LEFT;
m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN;
m_sQueueSample.m_nCounter = iSound++;
stereo = 1;
stereo = true;
m_sQueueSample.m_nFrequency =
SampleManager.GetSampleBaseFrequency(SFX_UZI_LEFT);
m_sQueueSample.m_nFrequency +=
@ -6764,13 +6760,13 @@ cAudioManager::ProcessPedOneShots(cPedParams *params)
m_sQueueSample.m_nLoopEnd = -1;
m_sQueueSample.m_bEmittingVolume = emittingVol;
m_sQueueSample.m_bIs2D = false;
m_sQueueSample.m_bReleasingSoundFlag = 1;
m_sQueueSample.m_bReleasingSoundFlag = true;
break;
case WEAPONTYPE_SHOTGUN:
m_sQueueSample.m_nSampleIndex = SFX_SHOTGUN_LEFT;
m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN;
m_sQueueSample.m_nCounter = iSound++;
stereo = 1;
stereo = true;
m_sQueueSample.m_nFrequency =
SampleManager.GetSampleBaseFrequency(SFX_SHOTGUN_LEFT);
m_sQueueSample.m_nFrequency +=
@ -6785,7 +6781,7 @@ cAudioManager::ProcessPedOneShots(cPedParams *params)
emittingVol = m_anRandomTable[2] % 10 + 100;
m_sQueueSample.m_bEmittingVolume = emittingVol;
m_sQueueSample.m_bIs2D = false;
m_sQueueSample.m_bReleasingSoundFlag = 1;
m_sQueueSample.m_bReleasingSoundFlag = true;
if(m_bDynamicAcousticModelingStatus)
m_sQueueSample.m_bRequireReflection = true;
else
@ -6795,7 +6791,7 @@ cAudioManager::ProcessPedOneShots(cPedParams *params)
m_sQueueSample.m_nSampleIndex = SFX_AK47_LEFT;
m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN;
m_sQueueSample.m_nCounter = iSound++;
stereo = 1;
stereo = true;
m_sQueueSample.m_nFrequency =
SampleManager.GetSampleBaseFrequency(SFX_AK47_LEFT);
m_sQueueSample.m_nFrequency +=
@ -6810,13 +6806,13 @@ cAudioManager::ProcessPedOneShots(cPedParams *params)
m_sQueueSample.m_nLoopEnd = -1;
m_sQueueSample.m_bEmittingVolume = emittingVol;
m_sQueueSample.m_bIs2D = false;
m_sQueueSample.m_bReleasingSoundFlag = 1;
m_sQueueSample.m_bReleasingSoundFlag = true;
break;
case WEAPONTYPE_M16:
m_sQueueSample.m_nSampleIndex = SFX_M16_LEFT;
m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN;
m_sQueueSample.m_nCounter = iSound++;
stereo = 1;
stereo = true;
m_sQueueSample.m_nFrequency =
SampleManager.GetSampleBaseFrequency(SFX_M16_LEFT);
m_sQueueSample.m_nFrequency +=
@ -6831,13 +6827,13 @@ cAudioManager::ProcessPedOneShots(cPedParams *params)
m_sQueueSample.m_nLoopEnd = -1;
m_sQueueSample.m_bEmittingVolume = emittingVol;
m_sQueueSample.m_bIs2D = false;
m_sQueueSample.m_bReleasingSoundFlag = 1;
m_sQueueSample.m_bReleasingSoundFlag = true;
break;
case WEAPONTYPE_SNIPERRIFLE:
m_sQueueSample.m_nSampleIndex = SFX_SNIPER_LEFT;
m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN;
m_sQueueSample.m_nCounter = iSound++;
stereo = 1;
stereo = true;
m_sQueueSample.m_nFrequency =
SampleManager.GetSampleBaseFrequency(SFX_SNIPER_LEFT);
m_sQueueSample.m_nFrequency +=
@ -6852,7 +6848,7 @@ cAudioManager::ProcessPedOneShots(cPedParams *params)
emittingVol = m_anRandomTable[4] % 10 + 110;
m_sQueueSample.m_bEmittingVolume = emittingVol;
m_sQueueSample.m_bIs2D = false;
m_sQueueSample.m_bReleasingSoundFlag = 1;
m_sQueueSample.m_bReleasingSoundFlag = true;
if(m_bDynamicAcousticModelingStatus)
m_sQueueSample.m_bRequireReflection = true;
else
@ -6862,7 +6858,7 @@ cAudioManager::ProcessPedOneShots(cPedParams *params)
m_sQueueSample.m_nSampleIndex = SFX_ROCKET_LEFT;
m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN;
m_sQueueSample.m_nCounter = iSound++;
stereo = 1;
stereo = true;
m_sQueueSample.m_nFrequency =
SampleManager.GetSampleBaseFrequency(SFX_ROCKET_LEFT);
m_sQueueSample.m_nFrequency +=
@ -6877,7 +6873,7 @@ cAudioManager::ProcessPedOneShots(cPedParams *params)
emittingVol = m_anRandomTable[0] % 20 + 80;
m_sQueueSample.m_bEmittingVolume = emittingVol;
m_sQueueSample.m_bIs2D = false;
m_sQueueSample.m_bReleasingSoundFlag = 1;
m_sQueueSample.m_bReleasingSoundFlag = true;
if(m_bDynamicAcousticModelingStatus)
m_sQueueSample.m_bRequireReflection = true;
else
@ -6903,7 +6899,7 @@ cAudioManager::ProcessPedOneShots(cPedParams *params)
m_sQueueSample.m_nSampleIndex);
m_sQueueSample.m_bEmittingVolume = 90;
m_sQueueSample.m_bIs2D = false;
m_sQueueSample.m_bReleasingSoundFlag = 0;
m_sQueueSample.m_bReleasingSoundFlag = false;
m_sQueueSample.m_nReleasingVolumeDivider = 6;
if(m_bDynamicAcousticModelingStatus)
m_sQueueSample.m_bRequireReflection = true;
@ -6955,7 +6951,7 @@ cAudioManager::ProcessPedOneShots(cPedParams *params)
}
emittingVol = 75;
m_sQueueSample.m_nCounter = iSound++;
stereo = 1;
stereo = true;
m_sQueueSample.m_nFrequency += RandomDisplacement(300);
m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN;
m_sQueueSample.m_nReleasingVolumeModificator = 5;
@ -6967,7 +6963,7 @@ cAudioManager::ProcessPedOneShots(cPedParams *params)
m_sQueueSample.m_nLoopEnd = -1;
m_sQueueSample.m_bEmittingVolume = 75;
m_sQueueSample.m_bIs2D = false;
m_sQueueSample.m_bReleasingSoundFlag = 1;
m_sQueueSample.m_bReleasingSoundFlag = true;
m_sQueueSample.m_bRequireReflection = true;
break;
case SOUND_WEAPON_AK47_BULLET_ECHO:
@ -6976,7 +6972,7 @@ cAudioManager::ProcessPedOneShots(cPedParams *params)
m_sQueueSample.m_nSampleIndex = SFX_UZI_END_LEFT;
m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN;
m_sQueueSample.m_nCounter = iSound++;
stereo = 1;
stereo = true;
m_sQueueSample.m_nFrequency =
SampleManager.GetSampleBaseFrequency(SFX_UZI_END_LEFT);
m_sQueueSample.m_nFrequency +=
@ -6991,7 +6987,7 @@ cAudioManager::ProcessPedOneShots(cPedParams *params)
emittingVol = m_anRandomTable[4] % 10 + 40;
m_sQueueSample.m_bEmittingVolume = emittingVol;
m_sQueueSample.m_bIs2D = false;
m_sQueueSample.m_bReleasingSoundFlag = 1;
m_sQueueSample.m_bReleasingSoundFlag = true;
if(m_bDynamicAcousticModelingStatus)
m_sQueueSample.m_bRequireReflection = true;
else
@ -7015,13 +7011,13 @@ cAudioManager::ProcessPedOneShots(cPedParams *params)
emittingVol = 70;
m_sQueueSample.m_bEmittingVolume = 70;
m_sQueueSample.m_bIs2D = false;
m_sQueueSample.m_bReleasingSoundFlag = 1;
m_sQueueSample.m_bReleasingSoundFlag = true;
break;
case SOUND_WEAPON_HIT_PED:
m_sQueueSample.m_nSampleIndex = SFX_BULLET_PED;
m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN;
m_sQueueSample.m_nCounter = iSound++;
stereo = 1;
stereo = true;
m_sQueueSample.m_nFrequency =
SampleManager.GetSampleBaseFrequency(SFX_BULLET_PED);
m_sQueueSample.m_nFrequency +=
@ -7036,13 +7032,13 @@ cAudioManager::ProcessPedOneShots(cPedParams *params)
m_sQueueSample.m_nLoopEnd = -1;
m_sQueueSample.m_bEmittingVolume = emittingVol;
m_sQueueSample.m_bIs2D = false;
m_sQueueSample.m_bReleasingSoundFlag = 1;
m_sQueueSample.m_bReleasingSoundFlag = true;
break;
case SOUND_SPLASH:
m_sQueueSample.m_nSampleIndex = SFX_SPLASH_1;
m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN;
m_sQueueSample.m_nCounter = iSound++;
stereo = 1;
stereo = true;
m_sQueueSample.m_nFrequency = RandomDisplacement(1400) + 20000;
m_sQueueSample.m_nReleasingVolumeModificator = 1;
m_sQueueSample.m_fSpeedMultiplier = 0.0f;
@ -7054,7 +7050,7 @@ cAudioManager::ProcessPedOneShots(cPedParams *params)
m_sQueueSample.m_nLoopEnd = -1;
m_sQueueSample.m_bEmittingVolume = emittingVol;
m_sQueueSample.m_bIs2D = false;
m_sQueueSample.m_bReleasingSoundFlag = 1;
m_sQueueSample.m_bReleasingSoundFlag = true;
m_sQueueSample.m_bRequireReflection = true;
break;
default: SetupPedComments(params, sound); continue;
@ -7126,86 +7122,84 @@ cAudioManager::ProcessPlane(cVehicleParams *params)
struct tVehicleSampleData {
eSfxSample m_nAccelerationSampleIndex;
uint8 m_bEngineSoundType;
char gap_5[3];
eSfxSample m_nHornSample;
int32 m_nHornFrequency;
uint8 m_nSirenOrAlarmSample;
int32 m_nSirenOrAlarmFrequency;
uint8 m_bDoorType;
char gap_25[3];
};
const tVehicleSampleData aVehicleSettings[70] = {
{SFX_CAR_REV_2, 2, "", SFX_CAR_HORN_JEEP, 26513, SFX_CAR_ALARM_1, 9935, 1},
{SFX_CAR_REV_1, 1, "", SFX_CAR_HORN_56CHEV, 11487, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_8, 8, "", SFX_CAR_HORN_PORSCHE, 11025, SFX_CAR_ALARM_1, 10928, 1},
{SFX_CAR_REV_6, 6, "", SFX_CAR_HORN_TRUCK, 29711, SFX_CAR_ALARM_1, 9935, 2},
{SFX_CAR_REV_1, 1, "", SFX_CAR_HORN_56CHEV, 12893, SFX_CAR_ALARM_1, 8941, 0},
{SFX_CAR_REV_5, 5, "", SFX_CAR_HORN_BMW328, 10706, SFX_CAR_ALARM_1, 11922, 1},
{SFX_CAR_REV_4, 4, "", SFX_CAR_HORN_TRUCK, 29711, SFX_CAR_ALARM_1, 7948, 2},
{SFX_CAR_REV_6, 6, "", SFX_CAR_HORN_TRUCK, 29711, SFX_POLICE_SIREN_SLOW, 11556, 2},
{SFX_CAR_REV_6, 6, "", SFX_CAR_HORN_TRUCK, 31478, SFX_CAR_ALARM_1, 8941, 2},
{SFX_CAR_REV_1, 1, "", SFX_CAR_HORN_BMW328, 9538, SFX_CAR_ALARM_1, 12220, 1},
{SFX_CAR_REV_1, 1, "", SFX_CAR_HORN_56CHEV, 10842, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_3, 3, "", SFX_CAR_HORN_BMW328, 12017, SFX_CAR_ALARM_1, 9935, 1},
{SFX_CAR_REV_2, 2, "", SFX_CAR_HORN_JEEP, 22295, SFX_CAR_ALARM_1, 12200, 1},
{SFX_CAR_REV_4, 4, "", SFX_CAR_HORN_BUS2, 18000, SFX_CAR_ALARM_1, 13400, 1},
{SFX_CAR_REV_4, 4, "", SFX_CAR_HORN_BUS, 18286, SFX_CAR_ALARM_1, 9935, 2},
{SFX_CAR_REV_3, 3, "", SFX_CAR_HORN_PORSCHE, 11025, SFX_CAR_ALARM_1, 13600, 1},
{SFX_CAR_REV_4, 4, "", SFX_CAR_HORN_JEEP, 22295, SFX_AMBULANCE_SIREN_SLOW, 8795, 2},
{SFX_CAR_REV_5, 5, "", SFX_CAR_HORN_PORSCHE, 9271, SFX_POLICE_SIREN_SLOW, 16168, 1},
{SFX_CAR_REV_1, 1, "", SFX_CAR_HORN_56CHEV, 12170, SFX_CAR_ALARM_1, 8000, 1},
{SFX_CAR_REV_1, 1, "", SFX_CAR_HORN_BUS2, 12345, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_2, 2, "", SFX_CAR_HORN_BMW328, 10796, SFX_CAR_ALARM_1, 8543, 1},
{SFX_CAR_REV_5, 5, "", SFX_CAR_HORN_PORSCHE, 9271, SFX_CAR_ALARM_1, 9935, 1},
{SFX_CAR_REV_2, 2, "", SFX_CAR_HORN_PICKUP, 10924, SFX_CAR_ALARM_1, 9935, 1},
{SFX_CAR_REV_1, 1, "", SFX_CAR_HORN_PICKUP, 11025, SFX_ICE_CREAM_TUNE, 11025, 0},
{SFX_CAR_REV_7, 7, "", SFX_CAR_HORN_JEEP, 26513, SFX_CAR_ALARM_1, 9935, 1},
{SFX_CAR_REV_1, 1, "", SFX_CAR_HORN_JEEP, 26513, SFX_CAR_ALARM_1, 10000, 0},
{SFX_CAR_REV_5, 5, "", SFX_CAR_HORN_BMW328, 10706, SFX_POLICE_SIREN_SLOW, 13596, 1},
{SFX_CAR_REV_4, 4, "", SFX_CAR_HORN_BUS, 17260, SFX_POLICE_SIREN_SLOW, 13000, 2},
{SFX_CAR_REV_4, 4, "", SFX_CAR_HORN_PICKUP, 8670, SFX_CAR_ALARM_1, 9935, 2},
{SFX_CAR_REV_8, 8, "", SFX_CAR_HORN_PORSCHE, 10400, SFX_CAR_ALARM_1, 10123, 1},
{SFX_CAR_REV_1, 1, "", SFX_CAR_HORN_JEEP, 26513, SFX_POLICE_SIREN_SLOW, 13596, 0},
{SFX_CAR_REV_6, 6, "", SFX_CAR_HORN_BUS2, 11652, SFX_CAR_ALARM_1, 10554, 3},
{SFX_CAR_REV_6, 6, "", SFX_CAR_HORN_TRUCK, 29711, SFX_CAR_ALARM_1, 8000, 2},
{SFX_CAR_REV_6, 6, "", SFX_CAR_HORN_TRUCK, 28043, SFX_CAR_ALARM_1, 9935, 2},
{SFX_CAR_REV_1, 0, "", SFX_CAR_HORN_TRUCK, 29711, SFX_CAR_ALARM_1, 9935, 3},
{SFX_CAR_REV_1, 0, "", SFX_CAR_HORN_JEEP, 26513, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CESNA_IDLE, 0, "", SFX_CAR_HORN_JEEP, 26513, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_6, 6, "", SFX_CAR_HORN_BUS, 16291, SFX_CAR_ALARM_1, 7500, 3},
{SFX_CAR_REV_1, 1, "", SFX_CAR_HORN_56CHEV, 10842, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_1, 1, "", SFX_CAR_HORN_56CHEV, 10233, SFX_CAR_ALARM_1, 8935, 0},
{SFX_CAR_REV_4, 4, "", SFX_CAR_HORN_PICKUP, 8670, SFX_CAR_ALARM_1, 8935, 0},
{SFX_CAR_REV_1, 0, "", SFX_CAR_HORN_PICKUP, 2000, SFX_CAR_ALARM_1, 17000, 0},
{SFX_CAR_REV_4, 4, "", SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_4, 4, "", SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_5, 5, "", SFX_CAR_HORN_BMW328, 9003, SFX_CAR_ALARM_1, 9935, 1},
{SFX_CAR_REV_2, 2, "", SFX_CAR_HORN_PORSCHE, 12375, SFX_CAR_ALARM_1, 9935, 1},
{SFX_CAR_REV_5, 5, "", SFX_CAR_HORN_BUS2, 15554, SFX_CAR_ALARM_1, 9935, 1},
{SFX_CAR_REV_7, 7, "", SFX_CAR_HORN_BUS2, 13857, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_7, 7, "", SFX_CAR_HORN_PICKUP, 10924, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_4, 4, "", SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 2},
{SFX_CAR_REV_1, 0, "", SFX_CAR_HORN_JEEP, 20143, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_1, 0, "", SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_1, 1, "", SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_1, 1, "", SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_4, 4, "", SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9000, 0},
{SFX_CAR_REV_6, 6, "", SFX_CAR_HORN_TRUCK, 28043, SFX_CAR_ALARM_1, 9935, 2},
{SFX_CAR_REV_4, 4, "", SFX_CAR_HORN_BUS, 18286, SFX_CAR_ALARM_1, 9935, 2},
{SFX_CAR_REV_1, 1, "", SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_1, 1, "", SFX_CAR_HORN_56CHEV, 10842, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_4, 4, "", SFX_CAR_HORN_BUS2, 18000, SFX_CAR_ALARM_1, 13400, 1},
{SFX_CAR_REV_1, 1, "", SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_1, 1, "", SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_1, 1, "", SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_1, 1, "", SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_1, 1, "", SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_1, 1, "", SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_1, 1, "", SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_1, 1, "", SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_1, 1, "", SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_1, 1, "", SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0}};
{SFX_CAR_REV_2, 2, SFX_CAR_HORN_JEEP, 26513, SFX_CAR_ALARM_1, 9935, 1},
{SFX_CAR_REV_1, 1, SFX_CAR_HORN_56CHEV, 11487, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_8, 8, SFX_CAR_HORN_PORSCHE, 11025, SFX_CAR_ALARM_1, 10928, 1},
{SFX_CAR_REV_6, 6, SFX_CAR_HORN_TRUCK, 29711, SFX_CAR_ALARM_1, 9935, 2},
{SFX_CAR_REV_1, 1, SFX_CAR_HORN_56CHEV, 12893, SFX_CAR_ALARM_1, 8941, 0},
{SFX_CAR_REV_5, 5, SFX_CAR_HORN_BMW328, 10706, SFX_CAR_ALARM_1, 11922, 1},
{SFX_CAR_REV_4, 4, SFX_CAR_HORN_TRUCK, 29711, SFX_CAR_ALARM_1, 7948, 2},
{SFX_CAR_REV_6, 6, SFX_CAR_HORN_TRUCK, 29711, SFX_POLICE_SIREN_SLOW, 11556, 2},
{SFX_CAR_REV_6, 6, SFX_CAR_HORN_TRUCK, 31478, SFX_CAR_ALARM_1, 8941, 2},
{SFX_CAR_REV_1, 1, SFX_CAR_HORN_BMW328, 9538, SFX_CAR_ALARM_1, 12220, 1},
{SFX_CAR_REV_1, 1, SFX_CAR_HORN_56CHEV, 10842, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_3, 3, SFX_CAR_HORN_BMW328, 12017, SFX_CAR_ALARM_1, 9935, 1},
{SFX_CAR_REV_2, 2, SFX_CAR_HORN_JEEP, 22295, SFX_CAR_ALARM_1, 12200, 1},
{SFX_CAR_REV_4, 4, SFX_CAR_HORN_BUS2, 18000, SFX_CAR_ALARM_1, 13400, 1},
{SFX_CAR_REV_4, 4, SFX_CAR_HORN_BUS, 18286, SFX_CAR_ALARM_1, 9935, 2},
{SFX_CAR_REV_3, 3, SFX_CAR_HORN_PORSCHE, 11025, SFX_CAR_ALARM_1, 13600, 1},
{SFX_CAR_REV_4, 4, SFX_CAR_HORN_JEEP, 22295, SFX_AMBULANCE_SIREN_SLOW, 8795, 2},
{SFX_CAR_REV_5, 5, SFX_CAR_HORN_PORSCHE, 9271, SFX_POLICE_SIREN_SLOW, 16168, 1},
{SFX_CAR_REV_1, 1, SFX_CAR_HORN_56CHEV, 12170, SFX_CAR_ALARM_1, 8000, 1},
{SFX_CAR_REV_1, 1, SFX_CAR_HORN_BUS2, 12345, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_2, 2, SFX_CAR_HORN_BMW328, 10796, SFX_CAR_ALARM_1, 8543, 1},
{SFX_CAR_REV_5, 5, SFX_CAR_HORN_PORSCHE, 9271, SFX_CAR_ALARM_1, 9935, 1},
{SFX_CAR_REV_2, 2, SFX_CAR_HORN_PICKUP, 10924, SFX_CAR_ALARM_1, 9935, 1},
{SFX_CAR_REV_1, 1, SFX_CAR_HORN_PICKUP, 11025, SFX_ICE_CREAM_TUNE, 11025, 0},
{SFX_CAR_REV_7, 7, SFX_CAR_HORN_JEEP, 26513, SFX_CAR_ALARM_1, 9935, 1},
{SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 26513, SFX_CAR_ALARM_1, 10000, 0},
{SFX_CAR_REV_5, 5, SFX_CAR_HORN_BMW328, 10706, SFX_POLICE_SIREN_SLOW, 13596, 1},
{SFX_CAR_REV_4, 4, SFX_CAR_HORN_BUS, 17260, SFX_POLICE_SIREN_SLOW, 13000, 2},
{SFX_CAR_REV_4, 4, SFX_CAR_HORN_PICKUP, 8670, SFX_CAR_ALARM_1, 9935, 2},
{SFX_CAR_REV_8, 8, SFX_CAR_HORN_PORSCHE, 10400, SFX_CAR_ALARM_1, 10123, 1},
{SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 26513, SFX_POLICE_SIREN_SLOW, 13596, 0},
{SFX_CAR_REV_6, 6, SFX_CAR_HORN_BUS2, 11652, SFX_CAR_ALARM_1, 10554, 3},
{SFX_CAR_REV_6, 6, SFX_CAR_HORN_TRUCK, 29711, SFX_CAR_ALARM_1, 8000, 2},
{SFX_CAR_REV_6, 6, SFX_CAR_HORN_TRUCK, 28043, SFX_CAR_ALARM_1, 9935, 2},
{SFX_CAR_REV_1, 0, SFX_CAR_HORN_TRUCK, 29711, SFX_CAR_ALARM_1, 9935, 3},
{SFX_CAR_REV_1, 0, SFX_CAR_HORN_JEEP, 26513, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CESNA_IDLE, 0, SFX_CAR_HORN_JEEP, 26513, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_6, 6, SFX_CAR_HORN_BUS, 16291, SFX_CAR_ALARM_1, 7500, 3},
{SFX_CAR_REV_1, 1, SFX_CAR_HORN_56CHEV, 10842, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_1, 1, SFX_CAR_HORN_56CHEV, 10233, SFX_CAR_ALARM_1, 8935, 0},
{SFX_CAR_REV_4, 4, SFX_CAR_HORN_PICKUP, 8670, SFX_CAR_ALARM_1, 8935, 0},
{SFX_CAR_REV_1, 0, SFX_CAR_HORN_PICKUP, 2000, SFX_CAR_ALARM_1, 17000, 0},
{SFX_CAR_REV_4, 4, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_4, 4, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_5, 5, SFX_CAR_HORN_BMW328, 9003, SFX_CAR_ALARM_1, 9935, 1},
{SFX_CAR_REV_2, 2, SFX_CAR_HORN_PORSCHE, 12375, SFX_CAR_ALARM_1, 9935, 1},
{SFX_CAR_REV_5, 5, SFX_CAR_HORN_BUS2, 15554, SFX_CAR_ALARM_1, 9935, 1},
{SFX_CAR_REV_7, 7, SFX_CAR_HORN_BUS2, 13857, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_7, 7, SFX_CAR_HORN_PICKUP, 10924, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_4, 4, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 2},
{SFX_CAR_REV_1, 0, SFX_CAR_HORN_JEEP, 20143, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_1, 0, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_4, 4, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9000, 0},
{SFX_CAR_REV_6, 6, SFX_CAR_HORN_TRUCK, 28043, SFX_CAR_ALARM_1, 9935, 2},
{SFX_CAR_REV_4, 4, SFX_CAR_HORN_BUS, 18286, SFX_CAR_ALARM_1, 9935, 2},
{SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_1, 1, SFX_CAR_HORN_56CHEV, 10842, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_4, 4, SFX_CAR_HORN_BUS2, 18000, SFX_CAR_ALARM_1, 13400, 1},
{SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0}};
void
cAudioManager::ProcessPlayersVehicleEngine(cVehicleParams *params, CAutomobile *automobile)
@ -7237,19 +7231,19 @@ cAudioManager::ProcessPlayersVehicleEngine(cVehicleParams *params, CAutomobile *
static int16 LastAccel = 0;
static int16 LastBrake = 0;
static uint8 CurrentPretendGear = 1;
static bool bLostTractionLastFrame = 0;
static bool bLostTractionLastFrame = false;
static bool bHandbrakeOnLastFrame = 0;
static int32 nCruising = 0;
static bool bAccelSampleStopped = 1;
static bool bAccelSampleStopped = true;
lostTraction = 0;
processedAccelSampleStopped = 0;
if(bPlayerJustEnteredCar) {
bAccelSampleStopped = 1;
bAccelSampleStopped = true;
bPlayerJustEnteredCar = false;
nCruising = 0;
LastAccel = 0;
bLostTractionLastFrame = 0;
bLostTractionLastFrame = false;
LastBrake = 0;
bHandbrakeOnLastFrame = 0;
CurrentPretendGear = 1;
@ -7300,7 +7294,7 @@ cAudioManager::ProcessPlayersVehicleEngine(cVehicleParams *params, CAutomobile *
if(params->m_fVelocityChange < -0.001f) {
if(channelUsed) {
SampleManager.StopChannel(m_bActiveSamples);
bAccelSampleStopped = 1;
bAccelSampleStopped = true;
}
if(!automobile->m_nWheelsOnGround || automobile->bIsHandbrakeOn ||
lostTraction) {
@ -7315,7 +7309,7 @@ cAudioManager::ProcessPlayersVehicleEngine(cVehicleParams *params, CAutomobile *
} else if(LastAccel > 0) {
if(channelUsed) {
SampleManager.StopChannel(m_bActiveSamples);
bAccelSampleStopped = 1;
bAccelSampleStopped = true;
}
nCruising = 0;
if(!automobile->m_nWheelsOnGround || automobile->bIsHandbrakeOn ||
@ -7327,7 +7321,7 @@ cAudioManager::ProcessPlayersVehicleEngine(cVehicleParams *params, CAutomobile *
}
if(gasPedalAudio > 0.05f) {
freq = (5000.f * (gasPedalAudio - 0.05f) * 20.f / 19) + 19000;
if(engineSoundType == 6) freq >>= 1;
if(engineSoundType == 6) freq /= 2;
AddPlayerCarSample((25.f * (gasPedalAudio - 0.05f) * 20.f / 19) +
40,
freq, (soundOffset + SFX_CAR_FINGER_OFF_ACCEL_1),
@ -7370,10 +7364,10 @@ cAudioManager::ProcessPlayersVehicleEngine(cVehicleParams *params, CAutomobile *
automobile->m_fGasPedalAudio = accelerationMultipler;
}
freq = freqModifier + baseFreq;
if(engineSoundType == 6) freq >>= 1;
if(engineSoundType == 6) freq /= 2;
if(channelUsed) {
SampleManager.StopChannel(m_bActiveSamples);
bAccelSampleStopped = 1;
bAccelSampleStopped = true;
}
AddPlayerCarSample(vol, freq, (engineSoundType + SFX_PHONE_RING), 0, 2, 1);
LastAccel = accelerateState;
@ -7390,7 +7384,7 @@ cAudioManager::ProcessPlayersVehicleEngine(cVehicleParams *params, CAutomobile *
CurrentPretendGear = gearNr;
}
processedAccelSampleStopped = 1;
bAccelSampleStopped = 0;
bAccelSampleStopped = false;
}
if(channelUsed) {
SampleManager.SetChannelEmittingVolume(m_bActiveSamples, 85);
@ -7421,11 +7415,9 @@ cAudioManager::ProcessPlayersVehicleEngine(cVehicleParams *params, CAutomobile *
SampleManager.SetChannelEmittingVolume(m_bActiveSamples, 85);
SampleManager.SetChannel3DPosition(m_bActiveSamples, pos.x, pos.y, pos.z);
SampleManager.SetChannel3DDistances(m_bActiveSamples, 50.f, 12.5f);
if(engineSoundType == 6)
freq =
(GearFreqAdj[CurrentPretendGear] + freqModifier + 22050) >> 1;
else
freq = GearFreqAdj[CurrentPretendGear] + freqModifier + 22050;
if (engineSoundType == 6)
freq /= 2;
SampleManager.SetChannelFrequency(m_bActiveSamples, freq);
if(!channelUsed) {
SampleManager.SetChannelReverbFlag(
@ -7448,9 +7440,8 @@ cAudioManager::ProcessPlayersVehicleEngine(cVehicleParams *params, CAutomobile *
SampleManager.SetChannel3DPosition(m_bActiveSamples, pos.x, pos.y, pos.z);
SampleManager.SetChannel3DDistances(m_bActiveSamples, 50.f, 12.5f);
freq = GearFreqAdj[CurrentPretendGear] + freqModifier + 22050;
if(engineSoundType == 6) freq >>= 1;
if(engineSoundType == 6)
freq /= 2;
SampleManager.SetChannelFrequency(m_bActiveSamples, freq);
if(!channelUsed) {
SampleManager.SetChannelReverbFlag(
@ -7465,7 +7456,7 @@ cAudioManager::ProcessPlayersVehicleEngine(cVehicleParams *params, CAutomobile *
}
nCruising = 1;
}
bAccelSampleStopped = 1;
bAccelSampleStopped = true;
if(accelerateState < 150 || !automobile->m_nWheelsOnGround || automobile->bIsHandbrakeOn ||
lostTraction || currentGear < params->m_pTransmission->nNumberOfGears - 1) {
nCruising = 0;
@ -7477,7 +7468,7 @@ cAudioManager::ProcessPlayersVehicleEngine(cVehicleParams *params, CAutomobile *
--nCruising;
}
freq = 27 * nCruising + freqModifier + 22050;
if(engineSoundType == 6) freq >>= 1;
if(engineSoundType == 6) freq /= 2;
AddPlayerCarSample(85, freq, (soundOffset + SFX_CAR_AFTER_ACCEL_1), engineSoundType,
64, 1);
}
@ -7538,7 +7529,7 @@ cAudioManager::ProcessPoliceCellBeatingScriptObject(uint8 sound)
m_sQueueSample.m_bReverbFlag = true;
m_sQueueSample.m_bRequireReflection = false;
AddSampleToRequestedQueue();
params.m_bDistanceCalculated = 1;
params.m_bDistanceCalculated = true;
params.m_fDistance = distSquared;
params.m_pPed = nil;
SetupPedComments(&params, SOUND_8A);
@ -7633,10 +7624,8 @@ cAudioManager::ProcessPornCinema(uint8 sound)
if(m_sQueueSample.m_bVolume) {
rand = m_anRandomTable[1] & 1;
m_sQueueSample.m_nSampleIndex = rand + sample;
m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(
m_sQueueSample.m_nSampleIndex);
m_sQueueSample.m_nFrequency +=
RandomDisplacement(m_sQueueSample.m_nFrequency >> 4);
m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex);
m_sQueueSample.m_nFrequency += RandomDisplacement(m_sQueueSample.m_nFrequency / 16);
m_sQueueSample.m_nCounter = rand + 1;
m_sQueueSample.m_bIs2D = false;
m_sQueueSample.m_nLoopCount = 1;
@ -8169,9 +8158,9 @@ cAudioManager::ProcessVehicleDoors(cVehicleParams *params)
automobile = (CAutomobile *)params->m_pVehicle;
CalculateDistance(params->m_bDistanceCalculated, params->m_fDistance);
for(int32 i = 0; i < ARRAY_SIZE(automobile->Doors); i++) {
if(automobile->Damage.GetDoorStatus(i) == 2) {
if(automobile->Damage.GetDoorStatus(i) == DOOR_STATUS_SWINGING) {
doorState = automobile->Doors[i].m_nDoorState;
if(doorState == 1 || doorState == 2) {
if(doorState == DOOR_STATUS_SMASHED || doorState == DOOR_STATUS_SWINGING) {
velocity = Min(0.3f, Abs(automobile->Doors[i].m_fAngVel));
if(velocity > 0.0035f) {
emittingVol = (100.f * velocity * 10.f / 3.f);
@ -8481,7 +8470,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams *params)
case 3: m_sQueueSample.m_nSampleIndex = SFX_AIR_BRAKES; break;
default: m_sQueueSample.m_nSampleIndex = SFX_NEW_CAR_DOOR_CLOSE; break;
}
m_sQueueSample.m_bBankIndex = 0;
m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN;
m_sQueueSample.m_nCounter =
m_asAudioEntities[m_sQueueSample.m_nEntityIndex].m_awAudioEvent[i] + 22;
m_sQueueSample.m_nFrequency =
@ -8507,7 +8496,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams *params)
case 3: m_sQueueSample.m_nSampleIndex = SFX_AIR_BRAKES; break;
default: m_sQueueSample.m_nSampleIndex = SFX_NEW_CAR_DOOR_OPEN; break;
}
m_sQueueSample.m_bBankIndex = 0;
m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN;
m_sQueueSample.m_nCounter =
m_asAudioEntities[m_sQueueSample.m_nEntityIndex].m_awAudioEvent[i] + 10;
m_sQueueSample.m_nFrequency =
@ -8522,7 +8511,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams *params)
case SOUND_CAR_WINDSHIELD_CRACK:
maxDist = 900.f;
m_sQueueSample.m_nSampleIndex = SFX_GLASS_CRACK;
m_sQueueSample.m_bBankIndex = 0;
m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN;
m_sQueueSample.m_nCounter = 68;
emittingVol = m_anRandomTable[1] % 30 + 60;
m_sQueueSample.m_nFrequency =
@ -8538,7 +8527,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams *params)
m_asAudioEntities[m_sQueueSample.m_nEntityIndex].m_afVolume[i]));
maxDist = 1225.f;
m_sQueueSample.m_nSampleIndex = SFX_TYRE_BUMP;
m_sQueueSample.m_bBankIndex = 0;
m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN;
m_sQueueSample.m_nCounter = iWheelIndex++;
if(iWheelIndex > 85) iWheelIndex = 82;
m_sQueueSample.m_nFrequency =
@ -8557,7 +8546,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams *params)
emittingVol = 60;
maxDist = 1600.f;
m_sQueueSample.m_nSampleIndex = SFX_CAR_STARTER;
m_sQueueSample.m_bBankIndex = 0;
m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN;
m_sQueueSample.m_nCounter = 33;
m_sQueueSample.m_nFrequency =
SampleManager.GetSampleBaseFrequency(SFX_CAR_STARTER);
@ -8568,7 +8557,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams *params)
break;
case SOUND_CAR_LIGHT_BREAK:
m_sQueueSample.m_nSampleIndex = SFX_GLASS_SHARD_1;
m_sQueueSample.m_bBankIndex = 0;
m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN;
m_sQueueSample.m_nCounter = 37;
m_sQueueSample.m_nFrequency =
9 * SampleManager.GetSampleBaseFrequency(SFX_GLASS_SHARD_1) / 10;
@ -8587,7 +8576,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams *params)
else
m_sQueueSample.m_nFrequency = 13118;
m_sQueueSample.m_nSampleIndex = SFX_SUSPENSION_FAST_MOVE;
m_sQueueSample.m_bBankIndex = 0;
m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN;
m_sQueueSample.m_nCounter = 51;
m_sQueueSample.m_nFrequency +=
RandomDisplacement(m_sQueueSample.m_nFrequency >> 3);
@ -8599,7 +8588,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams *params)
break;
case SOUND_CAR_HYDRAULIC_3:
m_sQueueSample.m_nSampleIndex = SFX_SUSPENSION_SLOW_MOVE_LOOP;
m_sQueueSample.m_bBankIndex = 0;
m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN;
m_sQueueSample.m_nCounter = 86;
m_sQueueSample.m_nFrequency =
SampleManager.GetSampleBaseFrequency(SFX_SUSPENSION_SLOW_MOVE_LOOP);
@ -8613,7 +8602,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams *params)
break;
case SOUND_CAR_JERK:
m_sQueueSample.m_nSampleIndex = SFX_SHAG_SUSPENSION;
m_sQueueSample.m_bBankIndex = 0;
m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN;
m_sQueueSample.m_nCounter = 87;
m_sQueueSample.m_nFrequency =
SampleManager.GetSampleBaseFrequency(SFX_SHAG_SUSPENSION);
@ -8636,7 +8625,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams *params)
900.f;
m_sQueueSample.m_nSampleIndex =
(m_anRandomTable[0] & 1) + SFX_BOAT_SPLASH_1;
m_sQueueSample.m_bBankIndex = 0;
m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN;
m_sQueueSample.m_nCounter = WaveIndex++;
if(WaveIndex > 46) WaveIndex = 41;
m_sQueueSample.m_nFrequency = (7000.f * relVol) + 6000;
@ -8648,7 +8637,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams *params)
break;
case SOUND_17:
m_sQueueSample.m_nSampleIndex = SFX_POLICE_BOAT_THUMB_OFF;
m_sQueueSample.m_bBankIndex = 0;
m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN;
m_sQueueSample.m_nCounter = 47;
m_sQueueSample.m_nFrequency =
SampleManager.GetSampleBaseFrequency(SFX_POLICE_BOAT_THUMB_OFF) +
@ -8663,7 +8652,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams *params)
case SOUND_18:
case SOUND_19:
m_sQueueSample.m_nSampleIndex = SFX_AIR_BRAKES;
m_sQueueSample.m_bBankIndex = 0;
m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN;
m_sQueueSample.m_nCounter = 59;
m_sQueueSample.m_nFrequency = RandomDisplacement(1000) + 11025;
m_sQueueSample.m_nReleasingVolumeModificator = 5;
@ -8676,7 +8665,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams *params)
vol = m_asAudioEntities[m_sQueueSample.m_nEntityIndex].m_afVolume[i];
if(vol > 0.038400002f) vol = 0.038400002f;
m_sQueueSample.m_nSampleIndex = SFX_TANK_TURRET;
m_sQueueSample.m_bBankIndex = 0;
m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN;
m_sQueueSample.m_nCounter = 79;
m_sQueueSample.m_nFrequency = (3000.f * vol * 26.041666f) + 9000;
m_sQueueSample.m_nReleasingVolumeModificator = 2;
@ -8689,7 +8678,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams *params)
break;
case SOUND_CAR_BOMB_TICK:
m_sQueueSample.m_nSampleIndex = SFX_BOMB_BEEP;
m_sQueueSample.m_bBankIndex = 0;
m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN;
m_sQueueSample.m_nCounter = 80;
m_sQueueSample.m_nFrequency =
SampleManager.GetSampleBaseFrequency(SFX_BOMB_BEEP);
@ -8702,7 +8691,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams *params)
break;
case SOUND_PLANE_ON_GROUND:
m_sQueueSample.m_nSampleIndex = SFX_JUMBO_LAND_WHEELS;
m_sQueueSample.m_bBankIndex = 0;
m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN;
m_sQueueSample.m_nCounter = 81;
m_sQueueSample.m_nFrequency =
SampleManager.GetSampleBaseFrequency(SFX_JUMBO_LAND_WHEELS);
@ -8716,7 +8705,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams *params)
emittingVol = m_anRandomTable[2];
maxDist = 14400.f;
m_sQueueSample.m_nSampleIndex = SFX_UZI_LEFT;
m_sQueueSample.m_bBankIndex = 0;
m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN;
m_sQueueSample.m_nCounter = GunIndex++;
emittingVol = emittingVol % 15 + 65;
if(GunIndex > 58) GunIndex = 53;
@ -8734,7 +8723,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams *params)
ARRAY_SIZE(m_anRandomTable)] %
6 +
SFX_BULLET_CAR_1;
m_sQueueSample.m_bBankIndex = 0;
m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN;
m_sQueueSample.m_nCounter = 34;
m_sQueueSample.m_nFrequency =
SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex);
@ -8751,7 +8740,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams *params)
case SOUND_BOMB_ONIGNITION_ACTIVATED:
case SOUND_BOMB_TICK:
m_sQueueSample.m_nSampleIndex = SFX_ARM_BOMB;
m_sQueueSample.m_bBankIndex = 0;
m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN;
m_sQueueSample.m_nCounter = 36;
m_sQueueSample.m_nFrequency =
SampleManager.GetSampleBaseFrequency(SFX_ARM_BOMB);
@ -8763,16 +8752,16 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams *params)
maxDist = 2500.f;
break;
case SOUND_PED_HELI_PLAYER_FOUND:
pedParams.m_pPed = 0;
pedParams.m_bDistanceCalculated = 0;
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_HELI_PLAYER_FOUND);
continue;
case SOUND_PED_BODYCAST_HIT:
pedParams.m_pPed = 0;
pedParams.m_bDistanceCalculated = 0;
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;
@ -8780,7 +8769,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams *params)
continue;
case SOUND_WATER_FALL:
m_sQueueSample.m_nSampleIndex = SFX_SPLASH_1;
m_sQueueSample.m_bBankIndex = 0;
m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN;
m_sQueueSample.m_nCounter = 15;
m_sQueueSample.m_nFrequency = RandomDisplacement(1000) + 16000;
m_sQueueSample.m_nReleasingVolumeModificator = 1;
@ -8792,7 +8781,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams *params)
break;
case SOUND_SPLATTER:
m_sQueueSample.m_nSampleIndex = CrunchOffset + SFX_PED_CRUNCH_1;
m_sQueueSample.m_bBankIndex = 0;
m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN;
m_sQueueSample.m_nCounter = 48;
m_sQueueSample.m_nFrequency =
SampleManager.GetSampleBaseFrequency(SFX_PED_CRUNCH_1) +
@ -8809,15 +8798,13 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams *params)
case SOUND_CAR_PED_COLLISION:
vol = m_asAudioEntities[m_sQueueSample.m_nEntityIndex].m_afVolume[i];
if(20.f < vol) vol = 20.f;
emittingVol = (vol * 0.05f * 127.f);
emittingVol = (vol / 20.0f * 127.f);
if(!emittingVol) continue;
m_sQueueSample.m_nSampleIndex = (m_anRandomTable[2] & 3) + SFX_FIGHT_1;
m_sQueueSample.m_bBankIndex = 0;
m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN;
m_sQueueSample.m_nCounter = 50;
m_sQueueSample.m_nFrequency =
SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex) >>
1;
m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex) / 2;
m_sQueueSample.m_nReleasingVolumeModificator = 1;
m_sQueueSample.m_fSpeedMultiplier = 0.0f;
m_sQueueSample.m_fSoundIntensity = 40.0f;
@ -9168,7 +9155,7 @@ cAudioManager::ProcessWeather(int32 id)
vol = (m_asAudioEntities[id].m_afVolume[0]) + 35;
}
m_sQueueSample.m_bVolume = vol;
if(TheCamera.SoundDistUp < 20.f) m_sQueueSample.m_bVolume >>= 1;
if(TheCamera.SoundDistUp < 20.f) m_sQueueSample.m_bVolume /= 2;
if(counter == 4) counter = 0;
m_sQueueSample.m_nCounter = counter++;
m_sQueueSample.m_nReleasingVolumeModificator = 0;

View File

@ -242,12 +242,31 @@ public:
};
class cVehicleParams;
class cTransmission;
class CPlane;
class CVehicle;
class CPed;
class cPedParams;
class cTransmission;
class cPedParams
{
public:
bool m_bDistanceCalculated;
float m_fDistance;
CPed *m_pPed;
};
class cVehicleParams
{
public:
bool m_bDistanceCalculated;
float m_fDistance;
CVehicle *m_pVehicle;
cTransmission *m_pTransmission;
int m_nIndex;
float m_fVelocityChange;
};
static_assert(sizeof(cVehicleParams) == 0x18, "cVehicleParams: error");
enum {
/*

View File

@ -701,7 +701,7 @@ void CReplay::StoreCarUpdate(CVehicle *vehicle, int id)
vp->door_angles[1] = 127.0f / PI * car->Doors[3].m_fAngle;
vp->door_status = 0;
for (int i = 0; i < 6; i++){
if (car->Damage.GetDoorStatus(i) == 3)
if (car->Damage.GetDoorStatus(i) == DOOR_STATUS_MISSING)
vp->door_status |= BIT(i);
}
}
@ -744,27 +744,27 @@ void CReplay::ProcessCarUpdate(CVehicle *vehicle, float interpolation, CAddressI
car->Damage.SetDoorStatus(DOOR_FRONT_LEFT, DOOR_STATUS_SWINGING);
if (vp->door_angles[1])
car->Damage.SetDoorStatus(DOOR_FRONT_RIGHT, DOOR_STATUS_SWINGING);
if (vp->door_status & 1 && car->Damage.GetDoorStatus(DOOR_BONNET) != 3){
if (vp->door_status & 1 && car->Damage.GetDoorStatus(DOOR_BONNET) != DOOR_STATUS_MISSING){
car->Damage.SetDoorStatus(DOOR_BONNET, DOOR_STATUS_MISSING);
car->SetDoorDamage(CAR_BONNET, DOOR_BONNET, true);
}
if (vp->door_status & 2 && car->Damage.GetDoorStatus(DOOR_BOOT) != 3) {
if (vp->door_status & 2 && car->Damage.GetDoorStatus(DOOR_BOOT) != DOOR_STATUS_MISSING) {
car->Damage.SetDoorStatus(DOOR_BOOT, DOOR_STATUS_MISSING);
car->SetDoorDamage(CAR_BOOT, DOOR_BOOT, true);
}
if (vp->door_status & 4 && car->Damage.GetDoorStatus(DOOR_FRONT_LEFT) != 3) {
if (vp->door_status & 4 && car->Damage.GetDoorStatus(DOOR_FRONT_LEFT) != DOOR_STATUS_MISSING) {
car->Damage.SetDoorStatus(DOOR_FRONT_LEFT, DOOR_STATUS_MISSING);
car->SetDoorDamage(CAR_DOOR_LF, DOOR_FRONT_LEFT, true);
}
if (vp->door_status & 8 && car->Damage.GetDoorStatus(DOOR_FRONT_RIGHT) != 3) {
if (vp->door_status & 8 && car->Damage.GetDoorStatus(DOOR_FRONT_RIGHT) != DOOR_STATUS_MISSING) {
car->Damage.SetDoorStatus(DOOR_FRONT_RIGHT, DOOR_STATUS_MISSING);
car->SetDoorDamage(CAR_DOOR_RF, DOOR_FRONT_RIGHT, true);
}
if (vp->door_status & 0x10 && car->Damage.GetDoorStatus(DOOR_REAR_LEFT) != 3) {
if (vp->door_status & 0x10 && car->Damage.GetDoorStatus(DOOR_REAR_LEFT) != DOOR_STATUS_MISSING) {
car->Damage.SetDoorStatus(DOOR_REAR_LEFT, DOOR_STATUS_MISSING);
car->SetDoorDamage(CAR_DOOR_LR, DOOR_REAR_LEFT, true);
}
if (vp->door_status & 0x20 && car->Damage.GetDoorStatus(DOOR_REAR_RIGHT) != 3) {
if (vp->door_status & 0x20 && car->Damage.GetDoorStatus(DOOR_REAR_RIGHT) != DOOR_STATUS_MISSING) {
car->Damage.SetDoorStatus(DOOR_REAR_RIGHT, DOOR_STATUS_MISSING);
car->SetDoorDamage(CAR_DOOR_RR, DOOR_REAR_RIGHT, true);
}

View File

@ -191,7 +191,7 @@ enum Config {
#define TOGGLEABLE_BETA_FEATURES // toggleable from debug menu. not too many things
#define MORE_LANGUAGES // Add more translations to the game
#define DEFAULT_NATIVE_RESOLUTION // Set default video mode to your native resolution (fixes Windows 10 launch)
//#define USE_TXD_CDIMAGE // generate and load textures from txd.img
#define USE_TXD_CDIMAGE // generate and load textures from txd.img
//#define USE_TEXTURE_POOL
//#define OPENAL

View File

@ -294,6 +294,14 @@ static rw::Raster*
ConvertTexRaster(rw::Raster *ras)
{
using namespace rw;
if(ras->platform == rw::platform)
return ras;
// compatible platforms
if(ras->platform == PLATFORM_D3D8 && rw::platform == PLATFORM_D3D9 ||
ras->platform == PLATFORM_D3D9 && rw::platform == PLATFORM_D3D8)
return ras;
Image *img = ras->toImage();
ras->destroy();
img->unindex();
@ -306,9 +314,7 @@ ConvertTexRaster(rw::Raster *ras)
RwBool rwNativeTextureHackRead(RwStream *stream, RwTexture **tex, RwInt32 size)
{
*tex = Texture::streamReadNative(stream);
#ifdef RW_GL3
if(strcmp((*tex)->name, "copnu") == 0)
tex = tex;
#ifdef LIBRW
(*tex)->raster = ConvertTexRaster((*tex)->raster);
#endif
return *tex != nil;
@ -830,4 +836,10 @@ RwBool RtCharsetDestroy(RtCharset * charSet) { charSet->destroy(); return
// fake shit
RwInt32 _rwD3D8FindCorrectRasterFormat(RwRasterType type, RwInt32 flags) { return 1; }
RwInt32 _rwD3D8FindCorrectRasterFormat(RwRasterType type, RwInt32 flags)
{
#ifdef RW_GL3
return '3LGO';
#endif
return flags & 0xF00;
}

View File

@ -888,15 +888,6 @@ public:
#endif
};
class cPedParams
{
public:
bool m_bDistanceCalculated;
char gap_1[3];
float m_fDistance;
CPed *m_pPed;
};
void FinishFuckUCB(CAnimBlendAssociation *assoc, void *arg);
#ifndef PED_SKIN

View File

@ -298,6 +298,12 @@ void CBulletTraces::Render(void)
if (!aTraces[i].m_bInUse)
continue;
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)FALSE);
#ifdef FIX_BUGS
// Raster has no transparent pixels so it relies on the raster format having alpha
// to turn on blending. librw image conversion might get rid of it right now so let's
// just force it on.
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE);
#endif
RwRenderStateSet(rwRENDERSTATESRCBLEND, (void*)rwBLENDONE);
RwRenderStateSet(rwRENDERSTATEDESTBLEND, (void*)rwBLENDONE);
RwRenderStateSet(rwRENDERSTATETEXTURERASTER, RwTextureGetRaster(gpShadowExplosionTex));

View File

@ -291,19 +291,4 @@ static_assert(offsetof(CVehicle, m_pCurGroundEntity) == 0x1E0, "CVehicle: error"
static_assert(offsetof(CVehicle, m_nAlarmState) == 0x1A0, "CVehicle: error");
static_assert(offsetof(CVehicle, m_nLastWeaponDamage) == 0x228, "CVehicle: error");
class cTransmission;
class cVehicleParams
{
public:
bool m_bDistanceCalculated;
float m_fDistance;
CVehicle *m_pVehicle;
cTransmission *m_pTransmission;
int m_nIndex;
float m_fVelocityChange;
};
static_assert(sizeof(cVehicleParams) == 0x18, "cVehicleParams: error");
void DestroyVehicleAndDriverAndPassengers(CVehicle* pVehicle);