diff options
author | shfil <filip.gawin@zoho.com> | 2020-12-25 14:02:47 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-25 14:02:47 +0100 |
commit | dc72729a40b7710ce734cdd76c34b7c91c5f714a (patch) | |
tree | 64d5bd1c00d147ab568da0abdcdd156bb9211f33 | |
parent | Fix cMusicManager::SetRadioChannelByScript (diff) | |
parent | More audio enums (diff) | |
download | re3-dc72729a40b7710ce734cdd76c34b7c91c5f714a.tar re3-dc72729a40b7710ce734cdd76c34b7c91c5f714a.tar.gz re3-dc72729a40b7710ce734cdd76c34b7c91c5f714a.tar.bz2 re3-dc72729a40b7710ce734cdd76c34b7c91c5f714a.tar.lz re3-dc72729a40b7710ce734cdd76c34b7c91c5f714a.tar.xz re3-dc72729a40b7710ce734cdd76c34b7c91c5f714a.tar.zst re3-dc72729a40b7710ce734cdd76c34b7c91c5f714a.zip |
-rw-r--r-- | src/audio/AudioCollision.cpp | 34 | ||||
-rw-r--r-- | src/audio/AudioLogic.cpp | 352 | ||||
-rw-r--r-- | src/audio/AudioManager.cpp | 9 | ||||
-rw-r--r-- | src/audio/AudioManager.h | 163 |
4 files changed, 314 insertions, 244 deletions
diff --git a/src/audio/AudioCollision.cpp b/src/audio/AudioCollision.cpp index 6ce7bbac..c5aa170c 100644 --- a/src/audio/AudioCollision.cpp +++ b/src/audio/AudioCollision.cpp @@ -71,31 +71,33 @@ cAudioManager::GetCollisionOneShotRatio(int32 a, float b) const case SURFACE_TARMAC: case SURFACE_PAVEMENT: case SURFACE_STEEP_CLIFF: - case SURFACE_TRANSPARENT_STONE: result = GetCollisionRatio(b, 10.f, 60.f, 50.f); break; + case SURFACE_TRANSPARENT_STONE: + case SURFACE_CONCRETE_BEACH: result = GetCollisionRatio(b, 10.f, 60.f, 50.f); break; case SURFACE_GRASS: + case SURFACE_GRAVEL: + case SURFACE_MUD_DRY: case SURFACE_CARDBOARDBOX: result = GetCollisionRatio(b, 0.f, 2.f, 2.f); break; - case SURFACE_GRAVEL: result = GetCollisionRatio(b, 0.f, 2.f, 2.f); break; - case SURFACE_MUD_DRY: result = GetCollisionRatio(b, 0.f, 2.f, 2.f); break; case SURFACE_CAR: result = GetCollisionRatio(b, 6.f, 50.f, 44.f); break; - case SURFACE_GLASS: result = GetCollisionRatio(b, 0.1f, 10.f, 9.9f); break; + case SURFACE_GLASS: + case SURFACE_METAL_CHAIN_FENCE: result = GetCollisionRatio(b, 0.1f, 10.f, 9.9f); break; case SURFACE_TRANSPARENT_CLOTH: case SURFACE_THICK_METAL_PLATE: result = GetCollisionRatio(b, 30.f, 130.f, 100.f); break; case SURFACE_GARAGE_DOOR: result = GetCollisionRatio(b, 20.f, 100.f, 80.f); break; case SURFACE_CAR_PANEL: result = GetCollisionRatio(b, 0.f, 4.f, 4.f); break; case SURFACE_SCAFFOLD_POLE: - case SURFACE_METAL_GATE: result = GetCollisionRatio(b, 1.f, 10.f, 9.f); break; + case SURFACE_METAL_GATE: case SURFACE_LAMP_POST: result = GetCollisionRatio(b, 1.f, 10.f, 9.f); break; case SURFACE_FIRE_HYDRANT: result = GetCollisionRatio(b, 1.f, 15.f, 14.f); break; case SURFACE_GIRDER: result = GetCollisionRatio(b, 8.f, 50.f, 42.f); break; - case SURFACE_METAL_CHAIN_FENCE: result = GetCollisionRatio(b, 0.1f, 10.f, 9.9f); break; case SURFACE_PED: result = GetCollisionRatio(b, 0.f, 20.f, 20.f); break; - case SURFACE_SAND: result = GetCollisionRatio(b, 0.f, 10.f, 10.f); break; - case SURFACE_WATER: result = GetCollisionRatio(b, 0.f, 10.f, 10.f); break; + case SURFACE_SAND: + case SURFACE_WATER: + case SURFACE_RUBBER: + case SURFACE_WHEELBASE: + case SURFACE_SAND_BEACH: result = GetCollisionRatio(b, 0.f, 10.f, 10.f); break; case SURFACE_WOOD_CRATES: result = GetCollisionRatio(b, 1.f, 4.f, 3.f); break; case SURFACE_WOOD_BENCH: result = GetCollisionRatio(b, 0.1f, 5.f, 4.9f); break; case SURFACE_WOOD_SOLID: result = GetCollisionRatio(b, 0.1f, 40.f, 39.9f); break; - case SURFACE_RUBBER: - case SURFACE_WHEELBASE: result = GetCollisionRatio(b, 0.f, 10.f, 10.f); break; case SURFACE_PLASTIC: result = GetCollisionRatio(b, 0.1f, 4.f, 3.9f); break; case SURFACE_HEDGE: result = GetCollisionRatio(b, 0.f, 0.5f, 0.5f); break; case SURFACE_CONTAINER: result = GetCollisionRatio(b, 4.f, 40.f, 36.f); break; @@ -135,8 +137,8 @@ cAudioManager::SetLoopingCollisionRequestedSfxFreqAndGetVol(const cAudioCollisio m_sQueueSample.m_nSampleIndex = SFX_BOAT_WATER_LOOP; m_sQueueSample.m_nFrequency = 6050.f * ratio + 16000; vol = 30.f * ratio; - } else if(surface1 == SURFACE_GRAVEL || surface2 == SURFACE_GRAVEL || surface1 == SURFACE_MUD_DRY || - surface2 == SURFACE_MUD_DRY || surface1 == SURFACE_SAND || surface2 == SURFACE_SAND) { + } else if(surface1 == SURFACE_GRAVEL || surface2 == SURFACE_GRAVEL || surface1 == SURFACE_MUD_DRY || surface2 == SURFACE_MUD_DRY || + surface1 == SURFACE_SAND || surface2 == SURFACE_SAND || surface1 == SURFACE_SAND_BEACH || surface2 == SURFACE_SAND_BEACH) { ratio = GetCollisionRatio(audioCollision.m_fIntensity2, 0.0001f, 0.09f, 0.0899f); m_sQueueSample.m_nSampleIndex = SFX_GRAVEL_SKID; m_sQueueSample.m_nFrequency = 6000.f * ratio + 10000; @@ -156,12 +158,12 @@ cAudioManager::SetLoopingCollisionRequestedSfxFreqAndGetVol(const cAudioCollisio void cAudioManager::SetUpLoopingCollisionSound(const cAudioCollision &col, uint8 counter) { + bool distCalculated = false; if(col.m_fIntensity2 > 0.0016f) { uint8 emittingVol = SetLoopingCollisionRequestedSfxFreqAndGetVol(col); if(emittingVol) { - m_sQueueSample.m_fDistance = Sqrt(col.m_fDistance); - m_sQueueSample.m_nVolume = - ComputeVolume(emittingVol, CollisionSoundIntensity, m_sQueueSample.m_fDistance); + CalculateDistance(distCalculated, m_sQueueSample.m_fDistance); + m_sQueueSample.m_nVolume = ComputeVolume(emittingVol, CollisionSoundIntensity, m_sQueueSample.m_fDistance); if(m_sQueueSample.m_nVolume) { m_sQueueSample.m_nCounter = counter; m_sQueueSample.m_vecPos = col.m_vecPosition; @@ -266,7 +268,7 @@ cAudioManager::SetUpOneShotCollisionSound(const cAudioCollision &col) m_sQueueSample.m_nSampleIndex += m_anRandomTable[3] % 4; break; case SFX_COL_PED_1: - m_sQueueSample.m_nSampleIndex += m_anRandomTable[4] % 5; + m_sQueueSample.m_nSampleIndex += m_anRandomTable[4] % 2; break; case SFX_COL_WOOD_CRATES_1: m_sQueueSample.m_nSampleIndex += m_anRandomTable[4] % 4; diff --git a/src/audio/AudioLogic.cpp b/src/audio/AudioLogic.cpp index 3958241c..5b2fb75c 100644 --- a/src/audio/AudioLogic.cpp +++ b/src/audio/AudioLogic.cpp @@ -317,7 +317,6 @@ cAudioManager::ProcessPlayerMood() return; } - //lastMissionPassedTime = CTheScripts::GetLastMissionPassedTime(); if (lastMissionPassedTime != -1) { if (curTime < lastMissionPassedTime) { lastMissionPassedTime = curTime; @@ -1403,7 +1402,7 @@ cAudioManager::ProcessVehicleEngine(cVehicleParams& params) } else if (params.m_fVelocityChange == 0.0f) { traction = 0.9f; } - if (transmission->fMaxVelocity <= 0.0) { + if (transmission->fMaxVelocity <= 0.0f) { relativeChange = 0.0f; modificator = 0.0f; } else { @@ -1421,7 +1420,7 @@ cAudioManager::ProcessVehicleEngine(cVehicleParams& params) } modificator = relativeChange; } else { - modificator = Min(1.0, Abs(params.m_fVelocityChange / transmission->fMaxVelocity > 1.0f)); + modificator = Min(1.0f, Abs(params.m_fVelocityChange / transmission->fMaxVelocity > 1.0f)); } } } else { @@ -1506,14 +1505,10 @@ cAudioManager::UpdateGasPedalAudio(CVehicle* veh, int vehType) float gasPedal = Abs(veh->m_fGasPedal); float* gasPealAudioPtr; - switch (vehType) { - case VEHICLE_TYPE_CAR: - gasPealAudioPtr = &((CAutomobile*)veh)->m_fGasPedalAudio; - case VEHICLE_TYPE_BIKE: - gasPealAudioPtr = &((CBike*)veh)->m_fGasPedalAudio; - default: - return; - break; + switch(vehType) { + case VEHICLE_TYPE_CAR: gasPealAudioPtr = &((CAutomobile *)veh)->m_fGasPedalAudio; break; + case VEHICLE_TYPE_BIKE: gasPealAudioPtr = &((CBike *)veh)->m_fGasPedalAudio; break; + default: return; } if (*gasPealAudioPtr < gasPedal) *gasPealAudioPtr = Min(*gasPealAudioPtr + 0.09f, gasPedal); @@ -1568,29 +1563,12 @@ cAudioManager::AddPlayerCarSample(uint8 emittingVolume, int32 freq, uint32 sampl } void -cAudioManager::ProcessCesna(cVehicleParams& params) +cAudioManager::ProcessCesna(cVehicleParams ¶ms) { - static uint8 nAccel = 0; - - //((CAutomobile *)params.m_pVehicle)->Damage.GetEngineStatus(); - - if (FindPlayerVehicle() == params.m_pVehicle) { - if (params.m_nIndex == DODO) { - if (Pads[0].GetAccelerate() <= 0) { - if (nAccel != 0) - --nAccel; - } else if (nAccel < 60) { - ++nAccel; - } - AddPlayerCarSample(85 * (60 - nAccel) / 60 + 20, 8500 * nAccel / 60 + 17000, SFX_CESNA_IDLE, SFX_BANK_0, 52, true); - AddPlayerCarSample(85 * nAccel / 60 + 20, 8500 * nAccel / 60 + 17000, SFX_CESNA_REV, SFX_BANK_0, 2, true); - } - } else if (params.m_nIndex == DODO) { - AddPlayerCarSample(105, 17000, SFX_CESNA_IDLE, SFX_BANK_0, 52, true); - } else if (params.m_fDistance < SQR(200)) { + if(params.m_fDistance < SQR(200)) { CalculateDistance(params.m_bDistanceCalculated, params.m_fDistance); m_sQueueSample.m_nVolume = ComputeVolume(80, 200.f, m_sQueueSample.m_fDistance); - if (m_sQueueSample.m_nVolume != 0) { + if(m_sQueueSample.m_nVolume != 0) { m_sQueueSample.m_nCounter = 52; m_sQueueSample.m_nSampleIndex = SFX_CESNA_IDLE; m_sQueueSample.m_nBankIndex = SFX_BANK_0; @@ -1602,28 +1580,28 @@ cAudioManager::ProcessCesna(cVehicleParams& params) m_sQueueSample.m_nEmittingVolume = 80; m_sQueueSample.m_nLoopStart = SampleManager.GetSampleLoopStartOffset(m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_nLoopEnd = SampleManager.GetSampleLoopEndOffset(m_sQueueSample.m_nSampleIndex); - m_sQueueSample.m_fSpeedMultiplier = 8.0f; + m_sQueueSample.m_fSpeedMultiplier = 4.0f; m_sQueueSample.m_fSoundIntensity = 200.0f; m_sQueueSample.m_bReleasingSoundFlag = false; m_sQueueSample.m_bReverbFlag = true; m_sQueueSample.m_bRequireReflection = false; AddSampleToRequestedQueue(); } - if (params.m_fDistance < SQR(90)) { + if(params.m_fDistance < SQR(90)) { m_sQueueSample.m_nVolume = ComputeVolume(80, 90.f, m_sQueueSample.m_fDistance); - if (m_sQueueSample.m_nVolume != 0) { + if(m_sQueueSample.m_nVolume != 0) { m_sQueueSample.m_nCounter = 2; m_sQueueSample.m_nSampleIndex = SFX_CESNA_REV; m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_bIs2D = false; - m_sQueueSample.m_nReleasingVolumeModificator = 0; + m_sQueueSample.m_nReleasingVolumeModificator = 3; m_sQueueSample.m_nFrequency = 25000; m_sQueueSample.m_nLoopCount = 0; m_sQueueSample.m_nReleasingVolumeDivider = 4; m_sQueueSample.m_nEmittingVolume = 80; m_sQueueSample.m_nLoopStart = SampleManager.GetSampleLoopStartOffset(m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_nLoopEnd = SampleManager.GetSampleLoopEndOffset(m_sQueueSample.m_nSampleIndex); - m_sQueueSample.m_fSpeedMultiplier = 8.0f; + m_sQueueSample.m_fSpeedMultiplier = 4.0f; m_sQueueSample.m_fSoundIntensity = 90.0f; m_sQueueSample.m_bReleasingSoundFlag = false; m_sQueueSample.m_bReverbFlag = true; @@ -3059,6 +3037,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams& params) pedParams.m_bDistanceCalculated = params.m_bDistanceCalculated; pedParams.m_fDistance = params.m_fDistance; SetupPedComments(pedParams, SOUND_PED_VCPA_PLAYER_FOUND); + continue; } case SOUND_WATER_FALL: { const float SOUND_INTENSITY = 40.0f; @@ -3144,7 +3123,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams& params) m_sQueueSample.m_nCounter = GunIndex++; if (GunIndex > 58) GunIndex = 53; - m_sQueueSample.m_bRequireReflection = 0; + m_sQueueSample.m_bRequireReflection = false; AddSampleToRequestedQueue(); continue; #endif @@ -3254,7 +3233,7 @@ cAudioManager::ProcessBoatEngine(cVehicleParams& params) static uint16 LastAccel = 0; static uint8 LastVol = 0; - static const int intensity = 50; + static const int intensity = 90; if (params.m_fDistance < SQR(intensity)) { boat = (CBoat *)params.m_pVehicle; @@ -3415,7 +3394,7 @@ cAudioManager::ProcessBoatMovingOverWater(cVehicleParams& params) m_sQueueSample.m_fSpeedMultiplier = 2.0f; m_sQueueSample.m_fSoundIntensity = 50.0f; m_sQueueSample.m_bReleasingSoundFlag = false; - m_sQueueSample.m_nReleasingVolumeDivider = 3; + m_sQueueSample.m_nReleasingVolumeDivider = 6; m_sQueueSample.m_bReverbFlag = true; m_sQueueSample.m_bRequireReflection = false; AddSampleToRequestedQueue(); @@ -3613,7 +3592,7 @@ cAudioManager::ProcessCarHeli(cVehicleParams& params) //after accel rotor sound emittingVol = ((cameraAngle + 1.0f) * volumeModifier * 127.0f) / 2.0f; - m_sQueueSample.m_nVolume = ComputeVolume(emittingVol, 140.0, m_sQueueSample.m_fDistance); + m_sQueueSample.m_nVolume = ComputeVolume(emittingVol, 140.0f, m_sQueueSample.m_fDistance); if (m_sQueueSample.m_nVolume != 0) { m_sQueueSample.m_nCounter = 1; if (hunterBool) { @@ -3660,7 +3639,7 @@ cAudioManager::ProcessCarHeli(cVehicleParams& params) if (automobile->bEngineOn) { if (propellerSpeed < 1.0f) { emittingVol = (1.0f - propellerSpeed / 2.0f) * 70.0f; - m_sQueueSample.m_nVolume = ComputeVolume(emittingVol, 30.0, m_sQueueSample.m_fDistance); + m_sQueueSample.m_nVolume = ComputeVolume(emittingVol, 30.0f, m_sQueueSample.m_fDistance); if (m_sQueueSample.m_nVolume) { if (hunterBool) { m_sQueueSample.m_nSampleIndex = SFX_HELI_APACHE_4; @@ -3701,7 +3680,7 @@ cAudioManager::ProcessCarHeli(cVehicleParams& params) m_sQueueSample.m_nFrequency = 18000 + Min(1.0f, (Max(accelerateState, brakeState) / 255.0f) * freqModifier) * 2204; else m_sQueueSample.m_nFrequency = 14287 + Min(1.0f, freqModifier) * 3713; - if (propellerSpeed < 1.0) + if (propellerSpeed < 1.0f) m_sQueueSample.m_nFrequency = (propellerSpeed + 1) * (m_sQueueSample.m_nFrequency / 2.0f); m_sQueueSample.m_nFrequency = clamp2(m_sQueueSample.m_nFrequency, freqSkimmerPrev, 197); freqSkimmerPrev = m_sQueueSample.m_nFrequency; @@ -3744,7 +3723,7 @@ cAudioManager::ProcessCarHeli(cVehicleParams& params) m_sQueueSample.m_nCounter = 2; m_sQueueSample.m_nSampleIndex = hunterBool ? SFX_HELI_APACHE_3 : SFX_CAR_HELI_REA; m_sQueueSample.m_nBankIndex = 0; - m_sQueueSample.m_bIs2D = 0; + m_sQueueSample.m_bIs2D = false; m_sQueueSample.m_nReleasingVolumeModificator = 1; m_sQueueSample.m_nFrequency = (volumeModifier + 1.0f) * 16000; m_sQueueSample.m_nLoopCount = 0; @@ -3863,8 +3842,8 @@ cAudioManager::ProcessJumbo(cVehicleParams& params) CPlane *plane; float position; - //if (params.m_fDistance >= SQR(440)) - // return; + if (params.m_fDistance >= SQR(440)) + return; CalculateDistance(params.m_bDistanceCalculated, params.m_fDistance); plane = (CPlane*)params.m_pVehicle; @@ -4066,27 +4045,26 @@ bool cAudioManager::SetupJumboFlySound(uint8 emittingVol) { const float SOUND_INTENSITY = 440.0f; - if (m_sQueueSample.m_fDistance >= SOUND_INTENSITY) - return false; + if(m_sQueueSample.m_fDistance >= SOUND_INTENSITY) return false; int32 vol = ComputeVolume(emittingVol, SOUND_INTENSITY, m_sQueueSample.m_fDistance); m_sQueueSample.m_nVolume = vol; - if (m_sQueueSample.m_nVolume != 0) { - m_sQueueSample.m_nSampleIndex = SFX_JUMBO_DIST_FLY; + if(m_sQueueSample.m_nVolume != 0) { m_sQueueSample.m_nCounter = 0; + m_sQueueSample.m_nSampleIndex = SFX_JUMBO_DIST_FLY; m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_bIs2D = false; m_sQueueSample.m_nReleasingVolumeModificator = 1; - m_sQueueSample.m_nEmittingVolume = emittingVol; - m_sQueueSample.m_nLoopCount = 0; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_JUMBO_DIST_FLY); + m_sQueueSample.m_nLoopCount = 0; + m_sQueueSample.m_nEmittingVolume = emittingVol; m_sQueueSample.m_nLoopStart = SampleManager.GetSampleLoopStartOffset(m_sQueueSample.m_nSampleIndex); - m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; - m_sQueueSample.m_bReleasingSoundFlag = false; + m_sQueueSample.m_nLoopEnd = SampleManager.GetSampleLoopEndOffset(m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_fSpeedMultiplier = 4.0f; - m_sQueueSample.m_bReverbFlag = true; + m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; m_sQueueSample.m_nReleasingVolumeDivider = 5; - m_sQueueSample.m_nLoopEnd = SampleManager.GetSampleLoopEndOffset(m_sQueueSample.m_nSampleIndex); + m_sQueueSample.m_bReverbFlag = true; + m_sQueueSample.m_bRequireReflection = false; // todo port fix to re3 AddSampleToRequestedQueue(); } return true; @@ -4132,7 +4110,7 @@ cAudioManager::SetupJumboRumbleSound(uint8 emittingVol) int32 cAudioManager::GetJumboTaxiFreq() const { - return (60.833f * m_sQueueSample.m_fDistance) + 22050; + return (1.f / 180 * 10950 * m_sQueueSample.m_fDistance) + 22050; // todo port fix to re3 } #pragma endregion Some jumbo crap @@ -5022,7 +5000,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) uint8 param1 = soundParams & 0xFF; uint32 param2 = soundParams >> 8; m_sQueueSample.m_nSampleIndex = (m_anRandomTable[3] & 1) + SFX_SKATE_1; - m_sQueueSample.m_nBankIndex = 0; + m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_nCounter = iSound; stereo = true; ++iSound; @@ -5429,7 +5407,7 @@ cAudioManager::GetPlayerTalkSfx(CPed *ped, int16 sound) { uint32 sfx; - if(this->m_bIsPlayerShutUp) return NO_SAMPLE; + if(m_bIsPlayerShutUp) return NO_SAMPLE; switch(sound) { case SOUND_PED_DEATH: return 9796; case SOUND_PED_DAMAGE: @@ -8446,116 +8424,204 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) uint8 emittingVolume; float distSquared; - switch (sound) { - /*case SCRIPT_SOUND_PARTY_1_LOOP_S: - m_sQueueSample.m_fSoundIntensity = SCRIPT_OBJECT_INTENSITY_S; - m_sQueueSample.m_nSampleIndex = SFX_CLUB_1; - m_sQueueSample.m_nBankIndex = SFX_BANK_0;//SAMPLEBANK_BUILDING_CLUB_1; - emittingVolume = MAX_VOLUME; - m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_CLUB_1); - m_sQueueSample.m_nReleasingVolumeModificator = 3; + switch(sound) { + case SCRIPT_SOUND_BANK_ALARM_LOOP: + m_sQueueSample.m_fSoundIntensity = 80.0f; + m_sQueueSample.m_nSampleIndex = SFX_BUILDINGS_BANK_ALARM; + m_sQueueSample.m_nBankIndex = SFX_BANK_BUILDING_BANK_ALARM; + emittingVolume = 90; + m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_BUILDINGS_BANK_ALARM); + m_sQueueSample.m_nReleasingVolumeModificator = 2; m_sQueueSample.m_nReleasingVolumeDivider = 3; m_sQueueSample.m_fSpeedMultiplier = 2.0f; + m_sQueueSample.m_bIs2D = false; break; - case SCRIPT_SOUND_PARTY_1_LOOP_L: - m_sQueueSample.m_fSoundIntensity = SCRIPT_OBJECT_INTENSITY_L; - m_sQueueSample.m_nSampleIndex = SFX_CLUB_1; - m_sQueueSample.m_nBankIndex = SFX_BANK_0;//SAMPLEBANK_BUILDING_CLUB_1; - emittingVolume = MAX_VOLUME; - m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_CLUB_1); + case SCRIPT_SOUND_POLICE_CELL_DOOR_SLIDING_LOOP: + case SCRIPT_SOUND_GARAGE_DOOR_SLIDING_LOOP: + m_sQueueSample.m_fSoundIntensity = 80.0f; + m_sQueueSample.m_nSampleIndex = SFX_GARAGE_DOOR_LOOP; + m_sQueueSample.m_nBankIndex = SFX_BANK_0; + emittingVolume = 90; + m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_GARAGE_DOOR_LOOP); m_sQueueSample.m_nReleasingVolumeModificator = 3; m_sQueueSample.m_nReleasingVolumeDivider = 3; m_sQueueSample.m_fSpeedMultiplier = 2.0f; + m_sQueueSample.m_bIs2D = false; break; - case SCRIPT_SOUND_PARTY_2_LOOP_S: - m_sQueueSample.m_fSoundIntensity = SCRIPT_OBJECT_INTENSITY_S; - m_sQueueSample.m_nSampleIndex = SFX_CLUB_2; - m_sQueueSample.m_nBankIndex = SFX_BANK_0;//SAMPLEBANK_BUILDING_CLUB_2; - emittingVolume = MAX_VOLUME; - m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_CLUB_2); - m_sQueueSample.m_nReleasingVolumeModificator = 3; + case SCRIPT_SOUND_SNORING_LOOP: + m_sQueueSample.m_fSoundIntensity = 6.0f; + m_sQueueSample.m_nSampleIndex = SFX_BUILDING_SNORE; + m_sQueueSample.m_nBankIndex = SFX_BANK_BUILDING_SNORING; + emittingVolume = 25; + m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_BUILDING_SNORE); + m_sQueueSample.m_nReleasingVolumeModificator = 6; m_sQueueSample.m_nReleasingVolumeDivider = 3; - m_sQueueSample.m_fSpeedMultiplier = 2.0f; + m_sQueueSample.m_fSpeedMultiplier = 3.0f; + m_sQueueSample.m_bIs2D = false; break; - case SCRIPT_SOUND_PARTY_2_LOOP_L: - m_sQueueSample.m_fSoundIntensity = SCRIPT_OBJECT_INTENSITY_L; - m_sQueueSample.m_nSampleIndex = SFX_CLUB_2; - m_sQueueSample.m_nBankIndex = SFX_BANK_0;//SAMPLEBANK_BUILDING_CLUB_2; - emittingVolume = MAX_VOLUME; - m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_CLUB_2); - m_sQueueSample.m_nReleasingVolumeModificator = 3; + case SCRIPT_SOUND_SHOOTING_RANGE_TARGET_MOVING_LOOP: + m_sQueueSample.m_fSoundIntensity = 40.0f; + m_sQueueSample.m_nSampleIndex = SFX_TANK_TURRET; + m_sQueueSample.m_nBankIndex = SFX_BANK_0; + emittingVolume = 60; + m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_TANK_TURRET); + m_sQueueSample.m_nReleasingVolumeModificator = 4; m_sQueueSample.m_nReleasingVolumeDivider = 3; m_sQueueSample.m_fSpeedMultiplier = 2.0f; + m_sQueueSample.m_bIs2D = false; break; - case SCRIPT_SOUND_PARTY_3_LOOP_S: - m_sQueueSample.m_fSoundIntensity = SCRIPT_OBJECT_INTENSITY_S; - m_sQueueSample.m_nSampleIndex = SFX_CLUB_3; - m_sQueueSample.m_nBankIndex = SFX_BANK_0;//SAMPLEBANK_BUILDING_CLUB_3; - emittingVolume = MAX_VOLUME; - m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_CLUB_3); + case SCRIPT_SOUND_NEW_BUILDING_BAR_1: + m_sQueueSample.m_nSampleIndex = SFX_BUILDING_BAR_1; + m_sQueueSample.m_nBankIndex = SFX_BANK_BUILDING_BAR_1; + m_sQueueSample.m_fSoundIntensity = 80.0f; + emittingVolume = 127; + m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_nReleasingVolumeModificator = 3; - m_sQueueSample.m_nReleasingVolumeDivider = 3; - m_sQueueSample.m_fSpeedMultiplier = 2.0f; + m_sQueueSample.m_nReleasingVolumeDivider = 15; + m_sQueueSample.m_fSpeedMultiplier = 4.0f; + m_sQueueSample.m_bIs2D = false; break; - case SCRIPT_SOUND_PARTY_3_LOOP_L: - m_sQueueSample.m_fSoundIntensity = SCRIPT_OBJECT_INTENSITY_L; - m_sQueueSample.m_nSampleIndex = SFX_CLUB_3; - m_sQueueSample.m_nBankIndex = SFX_BANK_0;//SAMPLEBANK_BUILDING_CLUB_3; - emittingVolume = MAX_VOLUME; - m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_CLUB_3); + case SCRIPT_SOUND_NEW_BUILDING_BAR_2: + m_sQueueSample.m_nSampleIndex = SFX_BUILDING_BAR_2; + m_sQueueSample.m_nBankIndex = SFX_BANK_BUILDING_BAR_2; + m_sQueueSample.m_fSoundIntensity = 80.0f; + emittingVolume = 127; + m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_nReleasingVolumeModificator = 3; - m_sQueueSample.m_nReleasingVolumeDivider = 3; - m_sQueueSample.m_fSpeedMultiplier = 2.0f; + m_sQueueSample.m_nReleasingVolumeDivider = 15; + m_sQueueSample.m_fSpeedMultiplier = 4.0f; + m_sQueueSample.m_bIs2D = false; break; - case SCRIPT_SOUND_PARTY_4_LOOP_S: - m_sQueueSample.m_fSoundIntensity = SCRIPT_OBJECT_INTENSITY_S; - m_sQueueSample.m_nSampleIndex = SFX_CLUB_4; - m_sQueueSample.m_nBankIndex = SFX_BANK_0;//SAMPLEBANK_BUILDING_CLUB_4; - emittingVolume = MAX_VOLUME; - m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_CLUB_4); + case SCRIPT_SOUND_NEW_BUILDING_BAR_3: + m_sQueueSample.m_nSampleIndex = SFX_BUILDING_BAR_3; + m_sQueueSample.m_nBankIndex = SFX_BANK_BUILDING_BAR_3; + m_sQueueSample.m_fSoundIntensity = 80.0f; + emittingVolume = 127; + m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_nReleasingVolumeModificator = 3; - m_sQueueSample.m_nReleasingVolumeDivider = 3; - m_sQueueSample.m_fSpeedMultiplier = 2.0f; + m_sQueueSample.m_nReleasingVolumeDivider = 15; + m_sQueueSample.m_fSpeedMultiplier = 4.0f; + m_sQueueSample.m_bIs2D = false; break; - case SCRIPT_SOUND_PARTY_4_LOOP_L: - m_sQueueSample.m_fSoundIntensity = SCRIPT_OBJECT_INTENSITY_L; - m_sQueueSample.m_nSampleIndex = SFX_CLUB_4; - m_sQueueSample.m_nBankIndex = SFX_BANK_0;//SAMPLEBANK_BUILDING_CLUB_4; - emittingVolume = MAX_VOLUME; - m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_CLUB_4); + case SCRIPT_SOUND_NEW_BUILDING_BAR_4: + m_sQueueSample.m_nSampleIndex = SFX_BUILDING_BAR_4; + m_sQueueSample.m_nBankIndex = SFX_BANK_BUILDING_BAR_4; + m_sQueueSample.m_fSoundIntensity = 80.0f; + emittingVolume = 127; + m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_nReleasingVolumeModificator = 3; - m_sQueueSample.m_nReleasingVolumeDivider = 3; - m_sQueueSample.m_fSpeedMultiplier = 2.0f; + m_sQueueSample.m_nReleasingVolumeDivider = 15; + m_sQueueSample.m_fSpeedMultiplier = 4.0f; + m_sQueueSample.m_bIs2D = false; break; - case SCRIPT_SOUND_PARTY_1_LOOP: - m_sQueueSample.m_fSoundIntensity = SCRIPT_OBJECT_INTENSITY_L; - m_sQueueSample.m_nSampleIndex = SFX_CLUB_1; - m_sQueueSample.m_nBankIndex = SFX_BANK_0;//SAMPLEBANK_BUILDING_CLUB_1; - emittingVolume = MAX_VOLUME; - m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_CLUB_1); + case SCRIPT_SOUND_NEW_BUILDING_MALIBU_1: + if(MusicManager.m_nPlayingTrack == STREAMED_SOUND_MALIBU_AMBIENT) return; + m_sQueueSample.m_nSampleIndex = SFX_BUILDING_MAL1; + m_sQueueSample.m_nBankIndex = SFX_BANK_BUILDING_MALIBU_1; + MusicManager.SetMalibuClubTrackPos(SCRIPT_SOUND_NEW_BUILDING_MALIBU_1); + m_sQueueSample.m_fSoundIntensity = 80.0f; + emittingVolume = 127; + m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_nReleasingVolumeModificator = 3; - m_sQueueSample.m_nReleasingVolumeDivider = 3; - m_sQueueSample.m_fSpeedMultiplier = 2.0f; + m_sQueueSample.m_nReleasingVolumeDivider = 15; + m_sQueueSample.m_fSpeedMultiplier = 4.0f; + m_sQueueSample.m_bIs2D = false; break; - case SCRIPT_SOUND_PRETEND_FIRE_LOOP: - m_sQueueSample.m_fSoundIntensity = 50.0f; - m_sQueueSample.m_nSampleIndex = SFX_CAR_ON_FIRE; + case SCRIPT_SOUND_NEW_BUILDING_MALIBU_2: + if(MusicManager.m_nPlayingTrack == STREAMED_SOUND_MALIBU_AMBIENT) return; + m_sQueueSample.m_nSampleIndex = SFX_BUILDING_MAL2; + m_sQueueSample.m_nBankIndex = SFX_BANK_BUILDING_MALIBU_2; + MusicManager.SetMalibuClubTrackPos(SCRIPT_SOUND_NEW_BUILDING_MALIBU_2); + m_sQueueSample.m_fSoundIntensity = 80.0f; + emittingVolume = 127; + m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex); + m_sQueueSample.m_nReleasingVolumeModificator = 3; + m_sQueueSample.m_nReleasingVolumeDivider = 15; + m_sQueueSample.m_fSpeedMultiplier = 4.0f; + m_sQueueSample.m_bIs2D = false; + break; + case SCRIPT_SOUND_NEW_BUILDING_MALIBU_3: + if(MusicManager.m_nPlayingTrack == STREAMED_SOUND_MALIBU_AMBIENT) return; + m_sQueueSample.m_nSampleIndex = SFX_BUILDING_MAL3; + m_sQueueSample.m_nBankIndex = SFX_BANK_BUILDING_MALIBU_3; + MusicManager.SetMalibuClubTrackPos(SCRIPT_SOUND_NEW_BUILDING_MALIBU_3); + m_sQueueSample.m_fSoundIntensity = 80.0f; + emittingVolume = 127; + m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex); + m_sQueueSample.m_nReleasingVolumeModificator = 3; + m_sQueueSample.m_nReleasingVolumeDivider = 15; + m_sQueueSample.m_fSpeedMultiplier = 4.0f; + m_sQueueSample.m_bIs2D = false; + break; + case SCRIPT_SOUND_NEW_BUILDING_STRIP_1: + if(MusicManager.m_nPlayingTrack == STREAMED_SOUND_STRIPCLUB_AMBIENT) return; + m_sQueueSample.m_nSampleIndex = SFX_BUILDING_STR1; + m_sQueueSample.m_nBankIndex = SFX_BANK_BUILDING_STRIP_1; + MusicManager.SetStripClubTrackPos(SCRIPT_SOUND_NEW_BUILDING_STRIP_1); + m_sQueueSample.m_fSoundIntensity = 80.0f; + emittingVolume = 127; + m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex); + m_sQueueSample.m_nReleasingVolumeModificator = 3; + m_sQueueSample.m_nReleasingVolumeDivider = 15; + m_sQueueSample.m_fSpeedMultiplier = 4.0f; + m_sQueueSample.m_bIs2D = false; + break; + case SCRIPT_SOUND_NEW_BUILDING_STRIP_2: + if(MusicManager.m_nPlayingTrack == STREAMED_SOUND_STRIPCLUB_AMBIENT) return; + m_sQueueSample.m_nSampleIndex = SFX_BUILDING_STR2; + m_sQueueSample.m_nBankIndex = SFX_BANK_BUILDING_STRIP_2; + MusicManager.SetStripClubTrackPos(SCRIPT_SOUND_NEW_BUILDING_STRIP_2); + m_sQueueSample.m_fSoundIntensity = 80.0f; + emittingVolume = 127; + m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex); + m_sQueueSample.m_nReleasingVolumeModificator = 3; + m_sQueueSample.m_nReleasingVolumeDivider = 15; + m_sQueueSample.m_fSpeedMultiplier = 4.0f; + m_sQueueSample.m_bIs2D = false; + break; + case SCRIPT_SOUND_NEW_BUILDING_STRIP_3: + if(MusicManager.m_nPlayingTrack == STREAMED_SOUND_STRIPCLUB_AMBIENT) return; + m_sQueueSample.m_nSampleIndex = SFX_BUILDING_STR3; + m_sQueueSample.m_nBankIndex = SFX_BANK_BUILDING_STRIP_3; + MusicManager.SetStripClubTrackPos(SCRIPT_SOUND_NEW_BUILDING_STRIP_3); + m_sQueueSample.m_fSoundIntensity = 80.0f; + emittingVolume = 127; + m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex); + m_sQueueSample.m_nReleasingVolumeModificator = 3; + m_sQueueSample.m_nReleasingVolumeDivider = 15; + m_sQueueSample.m_fSpeedMultiplier = 4.0f; + m_sQueueSample.m_bIs2D = false; + break; + case SCRIPT_SOUND_NEW_BUILDING_CHURCH: + m_sQueueSample.m_nSampleIndex = SFX_BUILDING_CHURCH; + m_sQueueSample.m_nBankIndex = SFX_BANK_BUILDING_CHURCH; + m_sQueueSample.m_fSoundIntensity = 80.0f; + emittingVolume = 127; + m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex); + m_sQueueSample.m_nReleasingVolumeModificator = 3; + m_sQueueSample.m_nReleasingVolumeDivider = 15; + m_sQueueSample.m_fSpeedMultiplier = 4.0f; + m_sQueueSample.m_bIs2D = false; + break; + case SCRIPT_SOUND_NEW_WATERFALL: + emittingVolume = 30; + m_sQueueSample.m_fSoundIntensity = 80.0f; + m_sQueueSample.m_nSampleIndex = SFX_BOAT_WATER_LOOP; m_sQueueSample.m_nBankIndex = SFX_BANK_0; - emittingVolume = 80; - m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_CAR_ON_FIRE); - m_sQueueSample.m_nReleasingVolumeModificator = 8; - m_sQueueSample.m_nReleasingVolumeDivider = 10; + m_sQueueSample.m_nFrequency = 20812; + m_sQueueSample.m_nReleasingVolumeModificator = 4; + m_sQueueSample.m_nReleasingVolumeDivider = 9; m_sQueueSample.m_fSpeedMultiplier = 2.0f; - break;*/ - default: - return; + m_sQueueSample.m_bIs2D = false; + break; + default: return; } distSquared = GetDistanceSquared(m_sQueueSample.m_vecPos); - if (distSquared < SQR(m_sQueueSample.m_fSoundIntensity)) { - m_sQueueSample.m_fDistance = Sqrt(distSquared); + if(distSquared < SQR(m_sQueueSample.m_fSoundIntensity)) { + m_sQueueSample.m_fDistance = distSquared <= 0.0f ? 0.0f : Sqrt(distSquared); m_sQueueSample.m_nVolume = ComputeVolume(emittingVolume, m_sQueueSample.m_fSoundIntensity, m_sQueueSample.m_fDistance); - if (m_sQueueSample.m_nVolume != 0) { + if(m_sQueueSample.m_nVolume != 0) { m_sQueueSample.m_nCounter = 0; m_sQueueSample.m_bIs2D = false; m_sQueueSample.m_nLoopCount = 0; @@ -8637,7 +8703,7 @@ cAudioManager::ProcessWeather(int32 id) modifier = Max(Abs(x), Abs(y)) * 10.0f; modifier = Min(1.0f, modifier); wind = Max(CWeather::Wind, modifier); - if (wind > 0.0f && CObject::fDistToNearestTree < 75.0) { + if (wind > 0.0f && CObject::fDistToNearestTree < 75.0f) { m_sQueueSample.m_nSampleIndex = SFX_PALM_TREE_LO; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_PALM_TREE_LO); m_sQueueSample.m_nVolume = (m_anRandomTable[1] % 10 + 45.0f) * (75.0f - CObject::fDistToNearestTree) * (4.0f / 300.0f) * wind; @@ -9124,7 +9190,7 @@ cAudioManager::ProcessFireHydrant() const float SOUND_INTENSITY = 35; float distSquared; - bool distCalculated = 0; + bool distCalculated = false; m_sQueueSample.m_vecPos = ((CEntity *)m_asAudioEntities[m_sQueueSample.m_nEntityIndex].m_pEntity)->GetPosition(); distSquared = GetDistanceSquared(m_sQueueSample.m_vecPos); @@ -9921,7 +9987,7 @@ cAudioManager::ProcessMissionAudioSlot(uint8 slot) } break; case LOADING_STATUS_FAILED: - if (++nFramesUntilFailedLoad[slot] >= 90) { + if (++nFramesUntilFailedLoad[slot] >= 120) { nFramesForPretendPlaying[slot] = 0; g_bMissionAudioLoadFailed[slot] = true; nFramesUntilFailedLoad[slot] = 0; diff --git a/src/audio/AudioManager.cpp b/src/audio/AudioManager.cpp index 5e29fdf1..d441b750 100644 --- a/src/audio/AudioManager.cpp +++ b/src/audio/AudioManager.cpp @@ -20,7 +20,7 @@ const int allChannels = channels + 2; cAudioManager::cAudioManager() { m_bIsInitialised = false; - field_1 = 1; + m_bReverb = true; m_fSpeedOfSound = 6.86f; m_nTimeSpent = 50; m_nActiveSamples = NUM_SOUNDS_SAMPLES_SLOTS; @@ -426,7 +426,8 @@ cAudioManager::CheckForAnAudioFileOnCD() const uint8 cAudioManager::GetCDAudioDriveLetter() const { - return SampleManager.GetCDAudioDriveLetter(); + if(m_bIsInitialised) return SampleManager.GetCDAudioDriveLetter(); + return 0; } bool @@ -456,7 +457,7 @@ cAudioManager::ServiceSoundEffects() ClearActiveSamples(); } m_nActiveSampleQueue = m_nActiveSampleQueue == 1 ? 0 : 1; - ProcessReverb(); + if(m_bReverb) ProcessReverb(); ProcessSpecial(); ClearRequestedQueue(); InterrogateAudioEntities(); @@ -802,7 +803,7 @@ cAudioManager::AddReleasingSounds() if (sample.m_nReleasingVolumeModificator < 20) ++sample.m_nReleasingVolumeModificator; } - sample.m_bReleasingSoundFlag = 0; + sample.m_bReleasingSoundFlag = false; } memcpy(&m_sQueueSample, &sample, sizeof(tSound)); AddSampleToRequestedQueue(); diff --git a/src/audio/AudioManager.h b/src/audio/AudioManager.h index fe5c32e4..378e16d3 100644 --- a/src/audio/AudioManager.h +++ b/src/audio/AudioManager.h @@ -176,7 +176,7 @@ class cAudioManager { public: bool m_bIsInitialised; - uint8 field_1; // unused + uint8 m_bReverb; // unused bool m_bFifthFrameFlag; uint8 m_nActiveSamples; uint8 field_4; // unused @@ -256,8 +256,8 @@ public: uint8 ComputeVolume(uint8 emittingVolume, float soundIntensity, float distance) const; // done int32 CreateEntity(eAudioType type, void *entity); // done - void DestroyAllGameCreatedEntities(); // done ? I don't seed pEntity = nil; - void DestroyEntity(int32 id); // done (inlined in vc) ? I not seen id checks + void DestroyAllGameCreatedEntities(); // done + void DestroyEntity(int32 id); // done (inlined in vc) void DoPoliceRadioCrackle(); // done // functions returning talk sfx, @@ -359,38 +359,39 @@ public: uint32 GetGenericFemaleTalkSfx(CPed *ped, int16 sound); // todo names (inlined in vc) // end of functions returning talk sfx - void GenerateIntegerRandomNumberTable(); // done - char *Get3DProviderName(uint8 id) const; - uint8 GetCDAudioDriveLetter() const; - int8 GetCurrent3DProviderIndex() const; - int8 AutoDetect3DProviders() const; // done - float GetCollisionLoopingRatio(uint32 a, uint32 b, float c) const; // not used - float GetCollisionOneShotRatio(int32 a, float b) const; - float GetCollisionRatio(float a, float b, float c, float d) const; - float GetDistanceSquared(const CVector &v) const; // done (inlined in vc) - int32 GetJumboTaxiFreq() const; - uint8 GetMissionAudioLoadingStatus(uint8 slot) const; // done - int8 GetMissionScriptPoliceAudioPlayingStatus() const; - uint8 GetNum3DProvidersAvailable() const; // done - uint32 GetPedCommentSfx(CPed *ped, int32 sound); - void GetPhrase(uint32 &phrase, uint32 &prevPhrase, uint32 sample, uint32 maxOffset) const; - float GetVehicleDriveWheelSkidValue(CVehicle* veh, tWheelState wheelState, float gasPedalAudio, cTransmission* transmission, float velocityChange); // done - float GetVehicleNonDriveWheelSkidValue(CVehicle* veh, tWheelState wheelState, cTransmission* transmission, float velocityChange); // done + void GenerateIntegerRandomNumberTable(); // done + char *Get3DProviderName(uint8 id) const; // done + uint8 GetCDAudioDriveLetter() const; // done + int8 GetCurrent3DProviderIndex() const; // done + int8 AutoDetect3DProviders() const; // done + float GetCollisionLoopingRatio(uint32 a, uint32 b, float c) const; // not used + float GetCollisionOneShotRatio(int32 a, float b) const; // done + float GetCollisionRatio(float a, float b, float c, float d) const; // done (inlined in vc) + float GetDistanceSquared(const CVector &v) const; // done (inlined in vc) + int32 GetJumboTaxiFreq() const; // done (inlined in vc) + uint8 GetMissionAudioLoadingStatus(uint8 slot) const; // done + int8 GetMissionScriptPoliceAudioPlayingStatus() const; // done + uint8 GetNum3DProvidersAvailable() const; // done + uint32 GetPedCommentSfx(CPed *ped, int32 sound); // done + void GetPhrase(uint32 &phrase, uint32 &prevPhrase, uint32 sample, uint32 maxOffset) const; // done + float GetVehicleDriveWheelSkidValue(CVehicle *veh, tWheelState wheelState, float gasPedalAudio, cTransmission *transmission, + float velocityChange); // done + float GetVehicleNonDriveWheelSkidValue(CVehicle *veh, tWheelState wheelState, cTransmission *transmission, float velocityChange); // done bool HasAirBrakes(int32 model) const; // done - void Initialise(); // done - void InitialisePoliceRadio(); //done - void InitialisePoliceRadioZones(); //done - void InterrogateAudioEntities(); // done - bool IsAudioInitialised() const; // done + void Initialise(); // done + void InitialisePoliceRadio(); // done + void InitialisePoliceRadioZones(); // done + void InterrogateAudioEntities(); // done (inlined) + bool IsAudioInitialised() const; // done bool IsMissionAudioSampleFinished(uint8 slot); // done - bool IsMP3RadioChannelAvailable() const; // done + bool IsMP3RadioChannelAvailable() const; // done bool MissionScriptAudioUsesPoliceChannel(int32 soundMission) const; //done void PlayLoadedMissionAudio(uint8 slot); // done - void PlayOneShot(int32 index, uint16 sound, float vol); // done + void PlayOneShot(int32 index, uint16 sound, float vol); // done void PlaySuspectLastSeen(float x, float y, float z); // done void PlayerJustGotInCar() const; // done void PlayerJustLeftCar() const; // done @@ -403,7 +404,7 @@ public: void ProcessActiveQueues(); // done bool ProcessAirBrakes(cVehicleParams& params); // done bool ProcessBoatEngine(cVehicleParams& params); - bool ProcessBoatMovingOverWater(cVehicleParams& params); + bool ProcessBoatMovingOverWater(cVehicleParams& params); //done #ifdef GTA_BRIDGE void ProcessBridge(); // done(bcs not exists in VC) void ProcessBridgeMotor(); // done(bcs not exists in VC) @@ -412,7 +413,7 @@ public: #endif bool ProcessCarBombTick(cVehicleParams& params); // done void ProcessCarHeli(cVehicleParams& params); // done - void ProcessCesna(cVehicleParams& params); // + void ProcessCesna(cVehicleParams& params); // done //void ProcessCrane(); // done(bcs not exists in VC) bool ProcessEngineDamage(cVehicleParams& params); // done void ProcessEntity(int32 sound); // done @@ -420,7 +421,7 @@ public: void ProcessFireHydrant(); // done void ProcessFires(int32 entity); // done void ProcessFrontEnd(); // done - void ProcessGarages(); // + void ProcessGarages(); // done void ProcessJumbo(cVehicleParams& params); // done void ProcessJumboAccel(CPlane *plane); // done void ProcessJumboDecel(CPlane *plane); // done @@ -428,9 +429,9 @@ public: void ProcessJumboLanding(CPlane *plane); // done void ProcessJumboTakeOff(CPlane *plane); // done void ProcessJumboTaxi(); // done - void ProcessLoopingScriptObject(uint8 sound); // - void ProcessMissionAudio(); // - void ProcessMissionAudioSlot(uint8 slot); // + void ProcessLoopingScriptObject(uint8 sound); // done + void ProcessMissionAudio(); // done + void ProcessMissionAudioSlot(uint8 slot); // done void ProcessModelHeliVehicle(cVehicleParams& params); // done void ProcessModelVehicle(cVehicleParams& params); // done void ProcessOneShotScriptObject(uint8 sound); // @@ -450,15 +451,15 @@ public: bool ProcessTrainNoise(cVehicleParams *params); //done(bcs not exists in VC) #endif void ProcessVehicle(CVehicle *vehicle); // done - bool ProcessVehicleDoors(cVehicleParams& params); // done - void ProcessVehicleEngine(cVehicleParams& params); // done - void ProcessVehicleFlatTyre(cVehicleParams& params); // done - bool ProcessVehicleHorn(cVehicleParams& params); // done - void ProcessVehicleOneShots(cVehicleParams& params); // done - bool ProcessVehicleReverseWarning(cVehicleParams& params); // done - bool ProcessVehicleRoadNoise(cVehicleParams& params); // done - bool ProcessVehicleSirenOrAlarm(cVehicleParams& params); // done - bool ProcessVehicleSkidding(cVehicleParams& params); // done + bool ProcessVehicleDoors(cVehicleParams ¶ms); // done + void ProcessVehicleEngine(cVehicleParams ¶ms); // done + void ProcessVehicleFlatTyre(cVehicleParams ¶ms); // done + bool ProcessVehicleHorn(cVehicleParams ¶ms); // done + void ProcessVehicleOneShots(cVehicleParams ¶ms); // done + bool ProcessVehicleReverseWarning(cVehicleParams ¶ms); // done + bool ProcessVehicleRoadNoise(cVehicleParams ¶ms); // done + bool ProcessVehicleSirenOrAlarm(cVehicleParams ¶ms); // done + bool ProcessVehicleSkidding(cVehicleParams ¶ms); // done void ProcessWaterCannon(int32); // done void ProcessWeather(int32 id); // done bool ProcessWetRoadNoise(cVehicleParams& params); // done @@ -474,52 +475,52 @@ public: void ResetPoliceRadio(); // done void ResetTimers(uint32 time); // done - void Service(); //done - void ServiceCollisions(); //done - void ServicePoliceRadio(); - void ServicePoliceRadioChannel(uint8 wantedLevel); - void ServiceSoundEffects(); - int8 SetCurrent3DProvider(uint8 which); - void SetDynamicAcousticModelingStatus(uint8 status); - void SetEffectsFadeVol(uint8 volume) const; - void SetEffectsMasterVolume(uint8 volume) const; - void SetMP3BoostVolume(uint8 volume) const; - void SetEntityStatus(int32 id, uint8 status); //done - uint32 SetLoopingCollisionRequestedSfxFreqAndGetVol(const cAudioCollision &audioCollision); - void SetMissionAudioLocation(uint8 slot, float x, float y, float z); - void SetMissionScriptPoliceAudio(int32 sfx) const; - void SetMonoMode(uint8 mono); - void SetMusicFadeVol(uint8 volume) const; - void SetMusicMasterVolume(uint8 volume) const; - void SetSpeakerConfig(int32 conf) const; - void SetUpLoopingCollisionSound(const cAudioCollision &col, uint8 counter); - void SetUpOneShotCollisionSound(const cAudioCollision &col); - bool SetupCrimeReport(); - bool SetupJumboEngineSound(uint8 vol, uint32 freq); - bool SetupJumboFlySound(uint8 emittingVol); - bool SetupJumboRumbleSound(uint8 emittingVol); - bool SetupJumboTaxiSound(uint8 vol); - bool SetupJumboWhineSound(uint8 emittingVol, uint32 freq); - void SetupPedComments(cPedParams ¶ms, uint16 sound); // done + void Service(); // done + void ServiceCollisions(); // done + void ServicePoliceRadio(); // done + void ServicePoliceRadioChannel(uint8 wantedLevel); // done + void ServiceSoundEffects(); // done + int8 SetCurrent3DProvider(uint8 which); // done + void SetDynamicAcousticModelingStatus(uint8 status); // done + void SetEffectsFadeVol(uint8 volume) const; // done + void SetEffectsMasterVolume(uint8 volume) const; // done + void SetMP3BoostVolume(uint8 volume) const; // done + void SetEntityStatus(int32 id, uint8 status); // done + uint32 SetLoopingCollisionRequestedSfxFreqAndGetVol(const cAudioCollision &audioCollision); // done + void SetMissionAudioLocation(uint8 slot, float x, float y, float z); // done + void SetMissionScriptPoliceAudio(int32 sfx) const; // inlined and optimized + void SetMonoMode(uint8 mono); // done + void SetMusicFadeVol(uint8 volume) const; // done + void SetMusicMasterVolume(uint8 volume) const; // done + void SetSpeakerConfig(int32 conf) const; // done + void SetUpLoopingCollisionSound(const cAudioCollision &col, uint8 counter); // done + void SetUpOneShotCollisionSound(const cAudioCollision &col); // done + bool SetupCrimeReport(); // done + bool SetupJumboEngineSound(uint8 vol, uint32 freq); // done + bool SetupJumboFlySound(uint8 emittingVol); // done + bool SetupJumboRumbleSound(uint8 emittingVol); // done + bool SetupJumboTaxiSound(uint8 vol); // done + bool SetupJumboWhineSound(uint8 emittingVol, uint32 freq); // done + void SetupPedComments(cPedParams ¶ms, uint16 sound); // done void SetupSuspectLastSeenReport(); - void Terminate(); //done - void TranslateEntity(Const CVector *v1, CVector *v2) const; //done + void Terminate(); // done + void TranslateEntity(Const CVector *v1, CVector *v2) const; // done - void UpdateGasPedalAudio(CVehicle* veh, int vehType); // done - void UpdateReflections(); //done - bool UsesReverseWarning(int32 model) const; //done - bool UsesSiren(cVehicleParams& params) const; //done - bool UsesSirenSwitching(cVehicleParams& params) const; //done + void UpdateGasPedalAudio(CVehicle *veh, int vehType); // done + void UpdateReflections(); // done + bool UsesReverseWarning(int32 model) const; // done + bool UsesSiren(cVehicleParams ¶ms) const; // done + bool UsesSirenSwitching(cVehicleParams ¶ms) const; // done - CVehicle *FindVehicleOfPlayer(); //done - void SetPedTalkingStatus(CPed *ped, uint8 status); - void SetPlayersMood(uint8 mood, uint32 time); + CVehicle *FindVehicleOfPlayer(); // done + void SetPedTalkingStatus(CPed *ped, uint8 status); // done + void SetPlayersMood(uint8 mood, uint32 time); // done #ifdef GTA_PC // only used in pc - void AdjustSamplesVolume(); - uint8 ComputeEmittingVolume(uint8 emittingVolume, float intensity, float dist); + void AdjustSamplesVolume(); // done (inlined) + uint8 ComputeEmittingVolume(uint8 emittingVolume, float intensity, float dist); // done (inlined) #endif }; |