diff --git a/.vscode/settings.json b/.vscode/settings.json index fee80960..10cb5627 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -13,7 +13,7 @@ "src/modelinfo", "src/objects", "src/peds", - "src/renderer", + "src/render", "src/rw", "src/save", "src/skel", diff --git a/CMakeLists.txt b/CMakeLists.txt index 5396d3b4..6ec3cc63 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,6 +18,7 @@ endif() set(${PROJECT}_AUDIO "OAL" CACHE STRING "Audio") +option(${PROJECT}_INSTALL "Enable installation of ${EXECUTABLE} + gamefiles" OFF) option(${PROJECT}_WITH_OPUS "Build ${EXECUTABLE} with opus support" OFF) option(${PROJECT}_WITH_LIBSNDFILE "Build ${EXECUTABLE} with libsndfile (instead of internal decoder)" OFF) diff --git a/codewarrior/re3.mcp.xml b/codewarrior/re3.mcp.xml index ca20ec2a..b18e2bcc 100644 --- a/codewarrior/re3.mcp.xml +++ b/codewarrior/re3.mcp.xml @@ -187,7 +187,7 @@ SearchPath - Path..\src\renderer + Path..\src\render PathFormatWindows PathRootProject @@ -6424,7 +6424,7 @@ SearchPath - Path..\src\renderer + Path..\src\render PathFormatWindows PathRootProject @@ -14281,7 +14281,7 @@ Windows - renderer + render Debug Name diff --git a/conanfile.py b/conanfile.py index cabcc4c2..b6424eb2 100644 --- a/conanfile.py +++ b/conanfile.py @@ -60,7 +60,7 @@ class Re3Conan(ConanFile): self.requires("opusfile/0.12") def export_sources(self): - for d in ("cmake", "src"): + for d in ("cmake", "gamefiles", "src"): shutil.copytree(src=d, dst=os.path.join(self.export_sources_folder, d)) self.copy("CMakeLists.txt") diff --git a/premake5.lua b/premake5.lua index 25090dc6..82e985f7 100644 --- a/premake5.lua +++ b/premake5.lua @@ -264,7 +264,7 @@ project "re3" files { addSrcFiles("src/modelinfo") } files { addSrcFiles("src/objects") } files { addSrcFiles("src/peds") } - files { addSrcFiles("src/renderer") } + files { addSrcFiles("src/render") } files { addSrcFiles("src/rw") } files { addSrcFiles("src/save") } files { addSrcFiles("src/skel") } @@ -293,7 +293,7 @@ project "re3" includedirs { "src/modelinfo" } includedirs { "src/objects" } includedirs { "src/peds" } - includedirs { "src/renderer" } + includedirs { "src/render" } includedirs { "src/rw" } includedirs { "src/save/" } includedirs { "src/skel/" } @@ -303,6 +303,9 @@ project "re3" includedirs { "src/weapons" } includedirs { "src/extras" } + filter "configurations:Vanilla" + defines { "VANILLA_DEFINES" } + if(not _OPTIONS["no-git-hash"]) then defines { "USE_OUR_VERSIONING" } end @@ -313,9 +316,6 @@ project "re3" includedirs { "vendor/opusfile/include" } end - filter "configurations:Vanilla" - defines { "VANILLA_DEFINES" } - filter "platforms:*mss" defines { "AUDIO_MSS" } includedirs { "vendor/milessdk/include" } diff --git a/src/audio/AudioCollision.cpp b/src/audio/AudioCollision.cpp index cfd13fb6..fd819641 100644 --- a/src/audio/AudioCollision.cpp +++ b/src/audio/AudioCollision.cpp @@ -10,39 +10,20 @@ const int CollisionSoundIntensity = 60; -void -cAudioManager::ReportCollision(CEntity *entity1, CEntity *entity2, uint8 surface1, uint8 surface2, float collisionPower, - float velocity) +cAudioCollisionManager::cAudioCollisionManager() { - float distSquared; - CVector v1; - CVector v2; + m_sQueue.m_pEntity1 = nil; + m_sQueue.m_pEntity2 = nil; + m_sQueue.m_bSurface1 = SURFACE_DEFAULT; + m_sQueue.m_bSurface2 = SURFACE_DEFAULT; + m_sQueue.m_fIntensity2 = 0.0f; + m_sQueue.m_fIntensity1 = 0.0f; + m_sQueue.m_vecPosition = CVector(0.0f, 0.0f, 0.0f); - if(!m_bIsInitialised || m_nCollisionEntity < 0 || m_nUserPause || - (velocity < 0.0016f && collisionPower < 0.01f)) - return; + for (int i = 0; i < NUMAUDIOCOLLISIONS; i++) + m_bIndicesTable[i] = NUMAUDIOCOLLISIONS; - if(entity1->IsBuilding()) { - v1 = v2 = entity2->GetPosition(); - } else if(entity2->IsBuilding()) { - v1 = v2 = entity1->GetPosition(); - } else { - v1 = entity1->GetPosition(); - v2 = entity2->GetPosition(); - } - CVector pos = (v1 + v2) * 0.5f; - distSquared = GetDistanceSquared(pos); - if(distSquared < SQR(CollisionSoundIntensity)) { - m_sCollisionManager.m_sQueue.m_pEntity1 = entity1; - m_sCollisionManager.m_sQueue.m_pEntity2 = entity2; - m_sCollisionManager.m_sQueue.m_bSurface1 = surface1; - m_sCollisionManager.m_sQueue.m_bSurface2 = surface2; - m_sCollisionManager.m_sQueue.m_fIntensity1 = collisionPower; - m_sCollisionManager.m_sQueue.m_fIntensity2 = velocity; - m_sCollisionManager.m_sQueue.m_vecPosition = pos; - m_sCollisionManager.m_sQueue.m_fDistance = distSquared; - m_sCollisionManager.AddCollisionToRequestedQueue(); - } + m_bCollisionsInQueue = 0; } void @@ -74,71 +55,133 @@ cAudioCollisionManager::AddCollisionToRequestedQueue() m_bIndicesTable[i] = collisionsIndex; } -void -cAudioManager::ServiceCollisions() +float +cAudioManager::GetCollisionLoopingRatio(uint32 a, uint32 b, float c) const { - int i, j; - bool8 abRepeatedCollision1[NUMAUDIOCOLLISIONS]; - bool8 abRepeatedCollision2[NUMAUDIOCOLLISIONS]; - - m_sQueueSample.m_nEntityIndex = m_nCollisionEntity; + return GetCollisionRatio(c, 0.0f, 0.02f, 0.02f); +} - for (int i = 0; i < NUMAUDIOCOLLISIONS; i++) - abRepeatedCollision1[i] = abRepeatedCollision2[i] = FALSE; +float +cAudioManager::GetCollisionOneShotRatio(int32 a, float b) const +{ + float result; - for (i = 0; i < m_sCollisionManager.m_bCollisionsInQueue; i++) { - for (j = 0; j < NUMAUDIOCOLLISIONS; j++) { - int index = m_sCollisionManager.m_bIndicesTable[i]; - if ((m_sCollisionManager.m_asCollisions1[index].m_pEntity1 == m_sCollisionManager.m_asCollisions2[j].m_pEntity1) - && (m_sCollisionManager.m_asCollisions1[index].m_pEntity2 == m_sCollisionManager.m_asCollisions2[j].m_pEntity2) - && (m_sCollisionManager.m_asCollisions1[index].m_bSurface1 == m_sCollisionManager.m_asCollisions2[j].m_bSurface1) - && (m_sCollisionManager.m_asCollisions1[index].m_bSurface2 == m_sCollisionManager.m_asCollisions2[j].m_bSurface2) - ) { - abRepeatedCollision1[index] = TRUE; - abRepeatedCollision2[j] = TRUE; - m_sCollisionManager.m_asCollisions1[index].m_nBaseVolume = ++m_sCollisionManager.m_asCollisions2[j].m_nBaseVolume; - SetUpLoopingCollisionSound(m_sCollisionManager.m_asCollisions1[index], j); - break; - } - } + switch(a) { + case SURFACE_DEFAULT: + 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_GRASS: + 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_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_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_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; + case SURFACE_NEWS_VENDOR: result = GetCollisionRatio(b, 0.f, 5.f, 5.f); break; + default: result = 0.f; break; } - for (i = 0; i < NUMAUDIOCOLLISIONS; i++) { - if (!abRepeatedCollision2[i]) { - m_sCollisionManager.m_asCollisions2[i].m_pEntity1 = nil; - m_sCollisionManager.m_asCollisions2[i].m_pEntity2 = nil; - m_sCollisionManager.m_asCollisions2[i].m_bSurface1 = SURFACE_DEFAULT; - m_sCollisionManager.m_asCollisions2[i].m_bSurface2 = SURFACE_DEFAULT; - m_sCollisionManager.m_asCollisions2[i].m_fIntensity2 = 0.0f; - m_sCollisionManager.m_asCollisions2[i].m_fIntensity1 = 0.0f; - m_sCollisionManager.m_asCollisions2[i].m_vecPosition = CVector(0.0f, 0.0f, 0.0f); - m_sCollisionManager.m_asCollisions2[i].m_fDistance = 0.0f; - } + return result; +} + +float +cAudioManager::GetCollisionRatio(float a, float b, float c, float d) const +{ + float e; + e = a; + if(a <= b) return 0.0f; + if(c <= a) e = c; + return (e - b) / d; +} + +uint32 +cAudioManager::SetLoopingCollisionRequestedSfxFreqAndGetVol(const cAudioCollision &audioCollision) +{ + uint8 surface1 = audioCollision.m_bSurface1; + uint8 surface2 = audioCollision.m_bSurface2; + int32 vol; + float ratio; + + if(surface1 == SURFACE_GRASS || surface2 == SURFACE_GRASS || surface1 == SURFACE_HEDGE || + surface2 == SURFACE_HEDGE) { + ratio = GetCollisionRatio(audioCollision.m_fIntensity2, 0.0001f, 0.09f, 0.0899f); + m_sQueueSample.m_nSampleIndex = SFX_RAIN; + m_sQueueSample.m_nFrequency = 13000.f * ratio + 35000; + vol = 50.f * ratio; + } else if(surface1 == SURFACE_WATER || surface2 == SURFACE_WATER) { + ratio = GetCollisionRatio(audioCollision.m_fIntensity2, 0.0001f, 0.09f, 0.0899f); + 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) { + 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; + vol = 50.f * ratio; + } else if(surface1 == SURFACE_PED || surface2 == SURFACE_PED) { + return 0; + } else { + ratio = GetCollisionRatio(audioCollision.m_fIntensity2, 0.0001f, 0.09f, 0.0899f); + m_sQueueSample.m_nSampleIndex = SFX_SCRAPE_CAR_1; + m_sQueueSample.m_nFrequency = 10000.f * ratio + 10000; + vol = 40.f * ratio; } + if(audioCollision.m_nBaseVolume < 2) vol = audioCollision.m_nBaseVolume * vol / 2; + return vol; +} - for (i = 0; i < m_sCollisionManager.m_bCollisionsInQueue; i++) { - int index = m_sCollisionManager.m_bIndicesTable[i]; - if (!abRepeatedCollision1[index]) { - for (j = 0; j < NUMAUDIOCOLLISIONS; j++) { - if (!abRepeatedCollision2[j]) { - m_sCollisionManager.m_asCollisions2[j].m_nBaseVolume = 1; - m_sCollisionManager.m_asCollisions2[j].m_pEntity1 = m_sCollisionManager.m_asCollisions1[index].m_pEntity1; - m_sCollisionManager.m_asCollisions2[j].m_pEntity2 = m_sCollisionManager.m_asCollisions1[index].m_pEntity2; - m_sCollisionManager.m_asCollisions2[j].m_bSurface1 = m_sCollisionManager.m_asCollisions1[index].m_bSurface1; - m_sCollisionManager.m_asCollisions2[j].m_bSurface2 = m_sCollisionManager.m_asCollisions1[index].m_bSurface2; - break; - } +void +cAudioManager::SetUpLoopingCollisionSound(const cAudioCollision &col, uint8 counter) +{ + 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); + if(m_sQueueSample.m_nVolume) { + m_sQueueSample.m_nCounter = counter; + m_sQueueSample.m_vecPos = col.m_vecPosition; + m_sQueueSample.m_nBankIndex = SFX_BANK_0; + m_sQueueSample.m_bIs2D = FALSE; + m_sQueueSample.m_nReleasingVolumeModificator = 7; + m_sQueueSample.m_nLoopCount = 0; + m_sQueueSample.m_nEmittingVolume = emittingVol; + SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex); + m_sQueueSample.m_fSpeedMultiplier = 4.0f; + m_sQueueSample.m_fSoundIntensity = CollisionSoundIntensity; + m_sQueueSample.m_bReleasingSoundFlag = FALSE; + m_sQueueSample.m_nReleasingVolumeDivider = 5; + m_sQueueSample.m_bReverbFlag = TRUE; + m_sQueueSample.m_bRequireReflection = FALSE; + AddSampleToRequestedQueue(); } - SetUpOneShotCollisionSound(m_sCollisionManager.m_asCollisions1[index]); - SetUpLoopingCollisionSound(m_sCollisionManager.m_asCollisions1[index], j); } } - - for (int i = 0; i < NUMAUDIOCOLLISIONS; i++) - m_sCollisionManager.m_bIndicesTable[i] = NUMAUDIOCOLLISIONS; - m_sCollisionManager.m_bCollisionsInQueue = 0; } - static const int32 gOneShotCol[] = {SFX_COL_TARMAC_1, SFX_COL_TARMAC_1, SFX_COL_GRASS_1, @@ -176,8 +219,9 @@ static const int32 gOneShotCol[] = {SFX_COL_TARMAC_1, void cAudioManager::SetUpOneShotCollisionSound(const cAudioCollision &col) { - uint16 s1; - uint16 s2; + + int16 s1; + int16 s2; int32 emittingVol; float ratio; @@ -277,126 +321,101 @@ cAudioManager::SetUpOneShotCollisionSound(const cAudioCollision &col) } void -cAudioManager::SetUpLoopingCollisionSound(const cAudioCollision &col, uint8 counter) +cAudioManager::ServiceCollisions() { - 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); - if(m_sQueueSample.m_nVolume) { - m_sQueueSample.m_nCounter = counter; - m_sQueueSample.m_vecPos = col.m_vecPosition; - m_sQueueSample.m_nBankIndex = SFX_BANK_0; - m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_nReleasingVolumeModificator = 7; - m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_nEmittingVolume = emittingVol; - SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex); - m_sQueueSample.m_fSpeedMultiplier = 4.0f; - m_sQueueSample.m_fSoundIntensity = CollisionSoundIntensity; - m_sQueueSample.m_bReleasingSoundFlag = FALSE; - m_sQueueSample.m_nReleasingVolumeDivider = 5; - m_sQueueSample.m_bReverbFlag = TRUE; - m_sQueueSample.m_bRequireReflection = FALSE; - AddSampleToRequestedQueue(); + int i, j; + bool8 abRepeatedCollision1[NUMAUDIOCOLLISIONS]; + bool8 abRepeatedCollision2[NUMAUDIOCOLLISIONS]; + + m_sQueueSample.m_nEntityIndex = m_nCollisionEntity; + + for (int i = 0; i < NUMAUDIOCOLLISIONS; i++) + abRepeatedCollision1[i] = abRepeatedCollision2[i] = FALSE; + + for (i = 0; i < m_sCollisionManager.m_bCollisionsInQueue; i++) { + for (j = 0; j < NUMAUDIOCOLLISIONS; j++) { + int index = m_sCollisionManager.m_bIndicesTable[i]; + if ((m_sCollisionManager.m_asCollisions1[index].m_pEntity1 == m_sCollisionManager.m_asCollisions2[j].m_pEntity1) + && (m_sCollisionManager.m_asCollisions1[index].m_pEntity2 == m_sCollisionManager.m_asCollisions2[j].m_pEntity2) + && (m_sCollisionManager.m_asCollisions1[index].m_bSurface1 == m_sCollisionManager.m_asCollisions2[j].m_bSurface1) + && (m_sCollisionManager.m_asCollisions1[index].m_bSurface2 == m_sCollisionManager.m_asCollisions2[j].m_bSurface2) + ) { + abRepeatedCollision1[index] = TRUE; + abRepeatedCollision2[j] = TRUE; + m_sCollisionManager.m_asCollisions1[index].m_nBaseVolume = ++m_sCollisionManager.m_asCollisions2[j].m_nBaseVolume; + SetUpLoopingCollisionSound(m_sCollisionManager.m_asCollisions1[index], j); + break; } } } -} -uint32 -cAudioManager::SetLoopingCollisionRequestedSfxFreqAndGetVol(const cAudioCollision &audioCollision) -{ - uint8 surface1 = audioCollision.m_bSurface1; - uint8 surface2 = audioCollision.m_bSurface2; - int32 vol; - float ratio; - - if(surface1 == SURFACE_GRASS || surface2 == SURFACE_GRASS || surface1 == SURFACE_HEDGE || - surface2 == SURFACE_HEDGE) { - ratio = GetCollisionRatio(audioCollision.m_fIntensity2, 0.0001f, 0.09f, 0.0899f); - m_sQueueSample.m_nSampleIndex = SFX_RAIN; - m_sQueueSample.m_nFrequency = 13000.f * ratio + 35000; - vol = 50.f * ratio; - } else if(surface1 == SURFACE_WATER || surface2 == SURFACE_WATER) { - ratio = GetCollisionRatio(audioCollision.m_fIntensity2, 0.0001f, 0.09f, 0.0899f); - 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) { - 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; - vol = 50.f * ratio; - } else if(surface1 == SURFACE_PED || surface2 == SURFACE_PED) { - return 0; - } else { - ratio = GetCollisionRatio(audioCollision.m_fIntensity2, 0.0001f, 0.09f, 0.0899f); - m_sQueueSample.m_nSampleIndex = SFX_SCRAPE_CAR_1; - m_sQueueSample.m_nFrequency = 10000.f * ratio + 10000; - vol = 40.f * ratio; + for (i = 0; i < NUMAUDIOCOLLISIONS; i++) { + if (!abRepeatedCollision2[i]) { + m_sCollisionManager.m_asCollisions2[i].m_pEntity1 = nil; + m_sCollisionManager.m_asCollisions2[i].m_pEntity2 = nil; + m_sCollisionManager.m_asCollisions2[i].m_bSurface1 = SURFACE_DEFAULT; + m_sCollisionManager.m_asCollisions2[i].m_bSurface2 = SURFACE_DEFAULT; + m_sCollisionManager.m_asCollisions2[i].m_fIntensity2 = 0.0f; + m_sCollisionManager.m_asCollisions2[i].m_fIntensity1 = 0.0f; + m_sCollisionManager.m_asCollisions2[i].m_vecPosition = CVector(0.0f, 0.0f, 0.0f); + m_sCollisionManager.m_asCollisions2[i].m_fDistance = 0.0f; + } } - if(audioCollision.m_nBaseVolume < 2) vol = audioCollision.m_nBaseVolume * vol / 2; - return vol; -} -float -cAudioManager::GetCollisionOneShotRatio(uint32 a, float b) -{ - switch(a) { - case SURFACE_DEFAULT: - case SURFACE_TARMAC: - case SURFACE_PAVEMENT: - case SURFACE_STEEP_CLIFF: - case SURFACE_TRANSPARENT_STONE: return GetCollisionRatio(b, 10.f, 60.f, 50.f); - case SURFACE_GRASS: - case SURFACE_CARDBOARDBOX: return GetCollisionRatio(b, 0.f, 2.f, 2.f); - case SURFACE_GRAVEL: return GetCollisionRatio(b, 0.f, 2.f, 2.f); - case SURFACE_MUD_DRY: return GetCollisionRatio(b, 0.f, 2.f, 2.f); - case SURFACE_CAR: return GetCollisionRatio(b, 6.f, 50.f, 44.f); - case SURFACE_GLASS: return GetCollisionRatio(b, 0.1f, 10.f, 9.9f); - case SURFACE_TRANSPARENT_CLOTH: - case SURFACE_THICK_METAL_PLATE: return GetCollisionRatio(b, 30.f, 130.f, 100.f); - case SURFACE_GARAGE_DOOR: return GetCollisionRatio(b, 20.f, 100.f, 80.f); - case SURFACE_CAR_PANEL: return GetCollisionRatio(b, 0.f, 4.f, 4.f); - case SURFACE_SCAFFOLD_POLE: - case SURFACE_METAL_GATE: return GetCollisionRatio(b, 1.f, 10.f, 9.f); - case SURFACE_LAMP_POST: return GetCollisionRatio(b, 1.f, 10.f, 9.f); - case SURFACE_FIRE_HYDRANT: return GetCollisionRatio(b, 1.f, 15.f, 14.f); - case SURFACE_GIRDER: return GetCollisionRatio(b, 8.f, 50.f, 42.f); - case SURFACE_METAL_CHAIN_FENCE: return GetCollisionRatio(b, 0.1f, 10.f, 9.9f); - case SURFACE_PED: return GetCollisionRatio(b, 0.f, 20.f, 20.f); - case SURFACE_SAND: return GetCollisionRatio(b, 0.f, 10.f, 10.f); - case SURFACE_WATER: return GetCollisionRatio(b, 0.f, 10.f, 10.f); - case SURFACE_WOOD_CRATES: return GetCollisionRatio(b, 1.f, 4.f, 3.f); - case SURFACE_WOOD_BENCH: return GetCollisionRatio(b, 0.1f, 5.f, 4.9f); - case SURFACE_WOOD_SOLID: return GetCollisionRatio(b, 0.1f, 40.f, 39.9f); - case SURFACE_RUBBER: - case SURFACE_WHEELBASE: return GetCollisionRatio(b, 0.f, 10.f, 10.f); - case SURFACE_PLASTIC: return GetCollisionRatio(b, 0.1f, 4.f, 3.9f); - case SURFACE_HEDGE: return GetCollisionRatio(b, 0.f, 0.5f, 0.5f); - case SURFACE_CONTAINER: return GetCollisionRatio(b, 4.f, 40.f, 36.f); - case SURFACE_NEWS_VENDOR: return GetCollisionRatio(b, 0.f, 5.f, 5.f); + for (i = 0; i < m_sCollisionManager.m_bCollisionsInQueue; i++) { + int index = m_sCollisionManager.m_bIndicesTable[i]; + if (!abRepeatedCollision1[index]) { + for (j = 0; j < NUMAUDIOCOLLISIONS; j++) { + if (!abRepeatedCollision2[j]) { + m_sCollisionManager.m_asCollisions2[j].m_nBaseVolume = 1; + m_sCollisionManager.m_asCollisions2[j].m_pEntity1 = m_sCollisionManager.m_asCollisions1[index].m_pEntity1; + m_sCollisionManager.m_asCollisions2[j].m_pEntity2 = m_sCollisionManager.m_asCollisions1[index].m_pEntity2; + m_sCollisionManager.m_asCollisions2[j].m_bSurface1 = m_sCollisionManager.m_asCollisions1[index].m_bSurface1; + m_sCollisionManager.m_asCollisions2[j].m_bSurface2 = m_sCollisionManager.m_asCollisions1[index].m_bSurface2; + break; + } + } + SetUpOneShotCollisionSound(m_sCollisionManager.m_asCollisions1[index]); + SetUpLoopingCollisionSound(m_sCollisionManager.m_asCollisions1[index], j); + } } - return 0.f; + for (int i = 0; i < NUMAUDIOCOLLISIONS; i++) + m_sCollisionManager.m_bIndicesTable[i] = NUMAUDIOCOLLISIONS; + m_sCollisionManager.m_bCollisionsInQueue = 0; } -float -cAudioManager::GetCollisionLoopingRatio(uint32 a, uint32 b, float c) +void +cAudioManager::ReportCollision(CEntity *entity1, CEntity *entity2, uint8 surface1, uint8 surface2, float collisionPower, + float velocity) { - return GetCollisionRatio(c, 0.0f, 0.02f, 0.02f); -} + float distSquared; + CVector v1; + CVector v2; -float -cAudioManager::GetCollisionRatio(float a, float b, float c, float d) -{ - float e; - e = a; - if(a <= b) return 0.0f; - if(c <= a) e = c; - return (e - b) / d; + if(!m_bIsInitialised || m_nCollisionEntity < 0 || m_nUserPause || + (velocity < 0.0016f && collisionPower < 0.01f)) + return; + + if(entity1->IsBuilding()) { + v1 = v2 = entity2->GetPosition(); + } else if(entity2->IsBuilding()) { + v1 = v2 = entity1->GetPosition(); + } else { + v1 = entity1->GetPosition(); + v2 = entity2->GetPosition(); + } + CVector pos = (v1 + v2) * 0.5f; + distSquared = GetDistanceSquared(pos); + if(distSquared < SQR(CollisionSoundIntensity)) { + m_sCollisionManager.m_sQueue.m_pEntity1 = entity1; + m_sCollisionManager.m_sQueue.m_pEntity2 = entity2; + m_sCollisionManager.m_sQueue.m_bSurface1 = surface1; + m_sCollisionManager.m_sQueue.m_bSurface2 = surface2; + m_sCollisionManager.m_sQueue.m_fIntensity1 = collisionPower; + m_sCollisionManager.m_sQueue.m_fIntensity2 = velocity; + m_sCollisionManager.m_sQueue.m_vecPosition = pos; + m_sCollisionManager.m_sQueue.m_fDistance = distSquared; + m_sCollisionManager.AddCollisionToRequestedQueue(); + } } diff --git a/src/audio/AudioCollision.h b/src/audio/AudioCollision.h index a201d500..0a058916 100644 --- a/src/audio/AudioCollision.h +++ b/src/audio/AudioCollision.h @@ -17,18 +17,7 @@ public: float m_fDistance; int32 m_nBaseVolume; - cAudioCollision() { Reset(); } - - void Reset() - { - m_pEntity1 = nil; - m_pEntity2 = nil; - m_bSurface1 = 0; - m_bSurface2 = 0; - m_fIntensity1 = m_fIntensity2 = 0.0f; - m_vecPosition = CVector(0.0f, 0.0f, 0.0f); - m_fDistance = 0.0f; - } + // no methods }; VALIDATE_SIZE(cAudioCollision, 40); @@ -42,15 +31,7 @@ public: uint8 m_bCollisionsInQueue; cAudioCollision m_sQueue; - cAudioCollisionManager() - { - m_sQueue.Reset(); - - for(int i = 0; i < NUMAUDIOCOLLISIONS; i++) - m_bIndicesTable[i] = NUMAUDIOCOLLISIONS; - - m_bCollisionsInQueue = 0; - } + cAudioCollisionManager(); void AddCollisionToRequestedQueue(); }; diff --git a/src/audio/AudioLogic.cpp b/src/audio/AudioLogic.cpp index 44664f8a..fdc7305b 100644 --- a/src/audio/AudioLogic.cpp +++ b/src/audio/AudioLogic.cpp @@ -52,8 +52,11 @@ uint32 gHomeNextTime; uint32 gCellNextTime; uint32 gNextCryTime; +enum PLAY_STATUS { PLAY_STATUS_STOPPED = 0, PLAY_STATUS_PLAYING, PLAY_STATUS_FINISHED }; +enum LOADING_STATUS { LOADING_STATUS_NOT_LOADED = 0, LOADING_STATUS_LOADED, LOADING_STATUS_FAILED }; + void -cAudioManager::PreInitialiseGameSpecificSetup() +cAudioManager::PreInitialiseGameSpecificSetup() const { BankStartOffset[SFX_BANK_0] = SAMPLEBANK_START; #ifdef GTA_PS2 @@ -160,7 +163,6 @@ cAudioManager::PostInitialiseGameSpecificSetup() m_sMissionAudio.m_nMissionAudioCounter = 0; ResetAudioLogicTimers(CTimer::GetTimeInMilliseconds()); } - void cAudioManager::PreTerminateGameSpecificShutdown() { @@ -226,7 +228,7 @@ cAudioManager::ResetAudioLogicTimers(uint32 timer) } void -cAudioManager::ProcessReverb() +cAudioManager::ProcessReverb() const { if (SampleManager.UpdateReverb() && m_bDynamicAcousticModelingStatus) { #ifndef GTA_PS2 @@ -246,7 +248,7 @@ cAudioManager::ProcessReverb() } float -cAudioManager::GetDistanceSquared(const CVector &v) +cAudioManager::GetDistanceSquared(const CVector &v) const { const CVector &c = TheCamera.GetPosition(); return sq(v.x - c.x) + sq(v.y - c.y) + sq((v.z - c.z) * 0.2f); @@ -799,6 +801,8 @@ cAudioManager::ProcessModelCarEngine(cVehicleParams& params) } } + + bool8 cAudioManager::ProcessVehicleRoadNoise(cVehicleParams& params) { @@ -1059,20 +1063,20 @@ cAudioManager::UpdateGasPedalAudio(CAutomobile *automobile) } void -cAudioManager::PlayerJustGotInCar() +cAudioManager::PlayerJustGotInCar() const { if (m_bIsInitialised) bPlayerJustEnteredCar = TRUE; } void -cAudioManager::PlayerJustLeftCar(void) +cAudioManager::PlayerJustLeftCar(void) const { // UNUSED: This is a perfectly empty function. } void -cAudioManager::AddPlayerCarSample(uint8 emittingVolume, uint32 freq, uint32 sample, uint8 bank, uint8 counter, bool8 notLooping) +cAudioManager::AddPlayerCarSample(uint8 emittingVolume, int32 freq, uint32 sample, uint8 bank, uint8 counter, bool8 notLooping) { m_sQueueSample.m_nVolume = ComputeVolume(emittingVolume, 50.f, m_sQueueSample.m_fDistance); if (m_sQueueSample.m_nVolume != 0) { @@ -1577,7 +1581,7 @@ cAudioManager::ProcessVehicleHorn(cVehicleParams& params) } bool8 -cAudioManager::UsesSiren(uint32 model) +cAudioManager::UsesSiren(int32 model) const { switch (model) { case FIRETRUK: @@ -1593,7 +1597,7 @@ cAudioManager::UsesSiren(uint32 model) } bool8 -cAudioManager::UsesSirenSwitching(uint32 model) +cAudioManager::UsesSirenSwitching(int32 model) const { switch (model) { case AMBULAN: @@ -1659,7 +1663,7 @@ cAudioManager::ProcessVehicleSirenOrAlarm(cVehicleParams& params) } bool8 -cAudioManager::UsesReverseWarning(uint32 model) +cAudioManager::UsesReverseWarning(int32 model) const { return model == LINERUN || model == FIRETRUK || model == TRASH || model == BUS || model == COACH; } @@ -1788,7 +1792,7 @@ cAudioManager::ProcessAirBrakes(cVehicleParams& params) } bool8 -cAudioManager::HasAirBrakes(uint32 model) +cAudioManager::HasAirBrakes(int32 model) const { return model == LINERUN || model == FIRETRUK || model == TRASH || model == BUS || model == COACH; } @@ -2627,8 +2631,8 @@ uint8 gJumboVolOffsetPercentage; void DoJumboVolOffset() { - if (!(AudioManager.m_FrameCounter % (AudioManager.m_anRandomTable[0] % 6 + 3))) - gJumboVolOffsetPercentage = AudioManager.m_anRandomTable[1] % 60; + if (!(AudioManager.GetFrameCounter() % (AudioManager.GetRandomNumber(0) % 6 + 3))) + gJumboVolOffsetPercentage = AudioManager.GetRandomNumber(1) % 60; } void @@ -2906,7 +2910,7 @@ cAudioManager::SetupJumboRumbleSound(uint8 emittingVol) } int32 -cAudioManager::GetJumboTaxiFreq() +cAudioManager::GetJumboTaxiFreq() const { return (60.833f * m_sQueueSample.m_fDistance) + 22050; } @@ -3561,23 +3565,23 @@ cAudioManager::SetupPedComments(cPedParams ¶ms, uint16 sound) switch (sound) { case SOUND_PED_HELI_PLAYER_FOUND: soundIntensity = 400.0f; - pedComment.m_nSampleIndex = m_anRandomTable[m_sQueueSample.m_nEntityIndex % 4] % 29 + SFX_POLICE_HELI_1; + pedComment.m_nSampleIndex = GetRandomNumberInRange(m_sQueueSample.m_nEntityIndex % 4, SFX_POLICE_HELI_1, SFX_POLICE_HELI_29); break; case SOUND_PED_BODYCAST_HIT: if (CTimer::GetTimeInMilliseconds() <= gNextCryTime) return; soundIntensity = 50.0f; gNextCryTime = CTimer::GetTimeInMilliseconds() + 500; - pedComment.m_nSampleIndex = m_anRandomTable[m_sQueueSample.m_nEntityIndex % 4] % 4 + SFX_PLASTER_BLOKE_1; + pedComment.m_nSampleIndex = GetRandomNumberInRange(m_sQueueSample.m_nEntityIndex % 4, SFX_PLASTER_BLOKE_1, SFX_PLASTER_BLOKE_4); break; case SOUND_INJURED_PED_MALE_OUCH: case SOUND_INJURED_PED_MALE_PRISON: soundIntensity = 50.0f; - pedComment.m_nSampleIndex = m_anRandomTable[m_sQueueSample.m_nEntityIndex % 4] % 15 + SFX_GENERIC_MALE_GRUNT_1; + pedComment.m_nSampleIndex = GetRandomNumberInRange(m_sQueueSample.m_nEntityIndex % 4, SFX_GENERIC_MALE_GRUNT_1, SFX_GENERIC_MALE_GRUNT_15); break; case SOUND_INJURED_PED_FEMALE: soundIntensity = 50.0f; - pedComment.m_nSampleIndex = m_anRandomTable[m_sQueueSample.m_nEntityIndex % 4] % 11 + SFX_GENERIC_FEMALE_GRUNT_1; + pedComment.m_nSampleIndex = GetRandomNumberInRange(m_sQueueSample.m_nEntityIndex % 4, SFX_GENERIC_FEMALE_GRUNT_1, SFX_GENERIC_FEMALE_GRUNT_11); break; default: return; @@ -3614,7 +3618,7 @@ cAudioManager::SetupPedComments(cPedParams ¶ms, uint16 sound) } int32 -cAudioManager::GetPedCommentSfx(CPed *ped, uint16 sound) +cAudioManager::GetPedCommentSfx(CPed *ped, int32 sound) { if (ped->IsPlayer()) return GetPlayerTalkSfx(sound); @@ -3635,7 +3639,7 @@ cAudioManager::GetPedCommentSfx(CPed *ped, uint16 sound) case MI_MALE01: return GetNormalMaleTalkSfx(sound); case MI_TAXI_D: - return GetAsianTaxiDriverTalkSfx(sound); + return GetTaxiDriverTalkSfx(sound); case MI_PIMP: return GetPimpTalkSfx(sound); case MI_GANG01: @@ -3669,7 +3673,7 @@ cAudioManager::GetPedCommentSfx(CPed *ped, uint16 sound) case MI_SPECIAL04: return GetSpecialCharacterTalkSfx(ped->GetModelIndex(), sound); case MI_MALE02: - return GetCasualMaleOldTalkSfx(sound); + return GetMaleNo2TalkSfx(sound); case MI_MALE03: case MI_P_MAN1: case MI_P_MAN2: @@ -3764,14 +3768,14 @@ cAudioManager::GetPedCommentSfx(CPed *ped, uint16 sound) case MI_STUD_WOM: return GetStudentFemaleTalkSfx(sound); case MI_CAS_MAN: - return GetCasualMaleYoungTalkSfx(sound); + return GetCasualMaleOldTalkSfx(sound); default: return GetGenericMaleTalkSfx(sound); } } void -cAudioManager::GetPhrase(uint32 &phrase, uint32 &prevPhrase, uint32 sample, uint32 maxOffset) +cAudioManager::GetPhrase(uint32 &phrase, uint32 &prevPhrase, uint32 sample, uint32 maxOffset) const { phrase = sample + m_anRandomTable[m_sQueueSample.m_nEntityIndex & 3] % maxOffset; @@ -3785,7 +3789,7 @@ cAudioManager::GetPhrase(uint32 &phrase, uint32 &prevPhrase, uint32 sample, uint #pragma region PED_COMMENTS uint32 -cAudioManager::GetPlayerTalkSfx(uint16 sound) +cAudioManager::GetPlayerTalkSfx(int16 sound) { uint32 sfx; static uint32 lastSfx = NO_SAMPLE; @@ -3808,7 +3812,7 @@ cAudioManager::GetPlayerTalkSfx(uint16 sound) } uint32 -cAudioManager::GetCopTalkSfx(uint16 sound) +cAudioManager::GetCopTalkSfx(int16 sound) { uint32 sfx; PedState pedState; @@ -3832,7 +3836,7 @@ cAudioManager::GetCopTalkSfx(uint16 sound) } uint32 -cAudioManager::GetSwatTalkSfx(uint16 sound) +cAudioManager::GetSwatTalkSfx(int16 sound) { uint32 sfx; PedState pedState; @@ -3856,7 +3860,7 @@ cAudioManager::GetSwatTalkSfx(uint16 sound) } uint32 -cAudioManager::GetFBITalkSfx(uint16 sound) +cAudioManager::GetFBITalkSfx(int16 sound) { uint32 sfx; PedState pedState; @@ -3880,7 +3884,7 @@ cAudioManager::GetFBITalkSfx(uint16 sound) } uint32 -cAudioManager::GetArmyTalkSfx(uint16 sound) +cAudioManager::GetArmyTalkSfx(int16 sound) { uint32 sfx; PedState pedState; @@ -3899,7 +3903,7 @@ cAudioManager::GetArmyTalkSfx(uint16 sound) } uint32 -cAudioManager::GetMedicTalkSfx(uint16 sound) +cAudioManager::GetMedicTalkSfx(int16 sound) { uint32 sfx; static uint32 lastSfx = NO_SAMPLE; @@ -3927,41 +3931,41 @@ cAudioManager::GetMedicTalkSfx(uint16 sound) } uint32 -cAudioManager::GetFiremanTalkSfx(uint16 sound) +cAudioManager::GetFiremanTalkSfx(int16 sound) { return GetGenericMaleTalkSfx(sound); } uint32 -cAudioManager::GetBusinessMaleOldTalkSfx(uint16 sound) +cAudioManager::GetNormalMaleTalkSfx(int16 sound) { uint32 sfx; static uint32 lastSfx = NO_SAMPLE; switch (sound) { case SOUND_PED_HANDS_COWER: - GetPhrase(sfx, lastSfx, SFX_BUSINESS_MALE_OLD_VOICE_1_GUN_PANIC_1, 3); + GetPhrase(sfx, lastSfx, SFX_NORMAL_MALE_GUN_PANIC_1, 7); break; case SOUND_PED_CAR_JACKED: - GetPhrase(sfx, lastSfx, SFX_BUSINESS_MALE_OLD_VOICE_1_CARJACKED_1, 2); - break; - case SOUND_PED_ROBBED: - GetPhrase(sfx, lastSfx, SFX_BUSINESS_MALE_OLD_VOICE_1_MUGGED_1, 2); - break; - case SOUND_PED_ATTACK: - GetPhrase(sfx, lastSfx, SFX_BUSINESS_MALE_OLD_VOICE_1_FIGHT_1, 5); + GetPhrase(sfx, lastSfx, SFX_NORMAL_MALE_CARJACKED_1, 7); break; case SOUND_PED_EVADE: - GetPhrase(sfx, lastSfx, SFX_BUSINESS_MALE_OLD_VOICE_1_DODGE_1, 4); + GetPhrase(sfx, lastSfx, SFX_NORMAL_MALE_DODGE_1, 9); break; case SOUND_PED_FLEE_RUN: - GetPhrase(sfx, lastSfx, SFX_BUSINESS_MALE_OLD_VOICE_1_MRUN_FROM_FIGHT_1, 5); + GetPhrase(sfx, lastSfx, SFX_NORMAL_MALE_RUN_FROM_FIGHT_1, 5); break; case SOUND_PED_ANNOYED_DRIVER: - GetPhrase(sfx, lastSfx, SFX_BUSINESS_MALE_OLD_VOICE_1_DRIVER_ABUSE_1, 5); + GetPhrase(sfx, lastSfx, SFX_NORMAL_MALE_DRIVER_ABUSE_1, 12); + break; + case SOUND_PED_CHAT_SEXY: + GetPhrase(sfx, lastSfx, SFX_NORMAL_MALE_EYING_1, 8); + break; + case SOUND_PED_CHAT_EVENT: + GetPhrase(sfx, lastSfx, SFX_NORMAL_MALE_SHOCKED_1, 10); break; case SOUND_PED_CHAT: - GetPhrase(sfx, lastSfx, SFX_BUSINESS_MALE_OLD_VOICE_1_CHAT_1, 5); + GetPhrase(sfx, lastSfx, SFX_NORMAL_MALE_CHAT_1, 25); break; default: return GetGenericMaleTalkSfx(sound); @@ -3970,47 +3974,61 @@ cAudioManager::GetBusinessMaleOldTalkSfx(uint16 sound) } uint32 -cAudioManager::GetBusinessMaleYoungTalkSfx(uint16 sound, uint32 model) +cAudioManager::GetTaxiDriverTalkSfx(int16 sound) { uint32 sfx; static uint32 lastSfx = NO_SAMPLE; switch (sound) { - case SOUND_PED_HANDS_COWER: - GetPhrase(sfx, lastSfx, SFX_BUSINESS_MALE_YOUNG_VOICE_1_GUN_PANIC_1, 3); - break; case SOUND_PED_CAR_JACKED: - GetPhrase(sfx, lastSfx, SFX_BUSINESS_MALE_YOUNG_VOICE_1_CARJACKED_1, 2); + GetPhrase(sfx, lastSfx, SFX_ASIAN_TAXI_DRIVER_VOICE_1_CARJACKED_1, 7); break; - case SOUND_PED_ROBBED: - GetPhrase(sfx, lastSfx, SFX_BUSINESS_MALE_YOUNG_VOICE_1_MUGGED_1, 2); + case SOUND_PED_ANNOYED_DRIVER: + GetPhrase(sfx, lastSfx, SFX_ASIAN_TAXI_DRIVER_VOICE_1_DRIVER_ABUSE_1, 6); break; - case SOUND_PED_ATTACK: - GetPhrase(sfx, lastSfx, SFX_BUSINESS_MALE_YOUNG_VOICE_1_FIGHT_1, 4); + default: + return GetGenericMaleTalkSfx(sound); + } + + return (SFX_ASIAN_TAXI_DRIVER_VOICE_2_DRIVER_ABUSE_1 - SFX_ASIAN_TAXI_DRIVER_VOICE_1_DRIVER_ABUSE_1) * (m_sQueueSample.m_nEntityIndex % 2) + sfx; +} + +uint32 +cAudioManager::GetPimpTalkSfx(int16 sound) +{ + uint32 sfx; + static uint32 lastSfx = NO_SAMPLE; + + switch (sound) { + case SOUND_PED_HANDS_UP: + GetPhrase(sfx, lastSfx, SFX_PIMP_GUN_COOL_1, 7); break; - case SOUND_PED_EVADE: - GetPhrase(sfx, lastSfx, SFX_BUSINESS_MALE_YOUNG_VOICE_1_DODGE_1, 4); + case SOUND_PED_CAR_JACKED: + GetPhrase(sfx, lastSfx, SFX_PIMP_CARJACKED_1, 4); break; - case SOUND_PED_FLEE_RUN: - GetPhrase(sfx, lastSfx, SFX_BUSINESS_MALE_YOUNG_VOICE_1_RUN_FROM_FIGHT_1, 5); + case SOUND_PED_DEFEND: + GetPhrase(sfx, lastSfx, SFX_PIMP_FIGHT_1, 9); + break; + case SOUND_PED_EVADE: + GetPhrase(sfx, lastSfx, SFX_PIMP_DODGE_1, 6); break; case SOUND_PED_ANNOYED_DRIVER: - GetPhrase(sfx, lastSfx, SFX_BUSINESS_MALE_YOUNG_VOICE_1_DRIVER_ABUSE_1, 6); + GetPhrase(sfx, lastSfx, SFX_PIMP_DRIVER_ABUSE_1, 5); + break; + case SOUND_PED_CHAT_EVENT: + GetPhrase(sfx, lastSfx, SFX_PIMP_SHOCKED_1, 2); break; case SOUND_PED_CHAT: - GetPhrase(sfx, lastSfx, SFX_BUSINESS_MALE_YOUNG_VOICE_1_CHAT_1, 6); + GetPhrase(sfx, lastSfx, SFX_PIMP_CHAT_1, 17); break; default: return GetGenericMaleTalkSfx(sound); } - - if (model == MI_B_MAN3) - sfx += (SFX_BUSINESS_MALE_YOUNG_VOICE_2_DRIVER_ABUSE_1 - SFX_BUSINESS_MALE_YOUNG_VOICE_1_DRIVER_ABUSE_1); return sfx; } uint32 -cAudioManager::GetMafiaTalkSfx(uint16 sound) +cAudioManager::GetMafiaTalkSfx(int16 sound) { uint32 sfx; static uint32 lastSfx = NO_SAMPLE; @@ -4044,7 +4062,7 @@ cAudioManager::GetMafiaTalkSfx(uint16 sound) } uint32 -cAudioManager::GetTriadTalkSfx(uint16 sound) +cAudioManager::GetTriadTalkSfx(int16 sound) { uint32 sfx; static uint32 lastSfx = NO_SAMPLE; @@ -4081,7 +4099,7 @@ cAudioManager::GetTriadTalkSfx(uint16 sound) } uint32 -cAudioManager::GetDiabloTalkSfx(uint16 sound) +cAudioManager::GetDiabloTalkSfx(int16 sound) { uint32 sfx; static uint32 lastSfx = NO_SAMPLE; @@ -4122,7 +4140,7 @@ cAudioManager::GetDiabloTalkSfx(uint16 sound) } uint32 -cAudioManager::GetYakuzaTalkSfx(uint16 sound) +cAudioManager::GetYakuzaTalkSfx(int16 sound) { uint32 sfx; static uint32 lastSfx = NO_SAMPLE; @@ -4153,7 +4171,7 @@ cAudioManager::GetYakuzaTalkSfx(uint16 sound) } uint32 -cAudioManager::GetYardieTalkSfx(uint16 sound) +cAudioManager::GetYardieTalkSfx(int16 sound) { uint32 sfx; static uint32 lastSfx = NO_SAMPLE; @@ -4190,7 +4208,7 @@ cAudioManager::GetYardieTalkSfx(uint16 sound) } uint32 -cAudioManager::GetColumbianTalkSfx(uint16 sound) +cAudioManager::GetColumbianTalkSfx(int16 sound) { uint32 sfx; static uint32 lastSfx = NO_SAMPLE; @@ -4224,7 +4242,7 @@ cAudioManager::GetColumbianTalkSfx(uint16 sound) } uint32 -cAudioManager::GetHoodTalkSfx(uint16 sound) +cAudioManager::GetHoodTalkSfx(int16 sound) { uint32 sfx; static uint32 lastSfx = NO_SAMPLE; @@ -4263,7 +4281,7 @@ cAudioManager::GetHoodTalkSfx(uint16 sound) } uint32 -cAudioManager::GetBlackCriminalTalkSfx(uint16 sound) +cAudioManager::GetBlackCriminalTalkSfx(int16 sound) { uint32 sfx; static uint32 lastSfx = NO_SAMPLE; @@ -4295,7 +4313,7 @@ cAudioManager::GetBlackCriminalTalkSfx(uint16 sound) } uint32 -cAudioManager::GetWhiteCriminalTalkSfx(uint16 sound) +cAudioManager::GetWhiteCriminalTalkSfx(int16 sound) { uint32 sfx; static uint32 lastSfx = NO_SAMPLE; @@ -4327,7 +4345,7 @@ cAudioManager::GetWhiteCriminalTalkSfx(uint16 sound) } uint32 -cAudioManager::GetCasualMaleOldTalkSfx(uint16 sound) +cAudioManager::GetMaleNo2TalkSfx(int16 sound) { uint32 sfx; static uint32 lastSfx = NO_SAMPLE; @@ -4361,13 +4379,79 @@ cAudioManager::GetCasualMaleOldTalkSfx(uint16 sound) } uint32 -cAudioManager::GetCasualMaleYoungTalkSfx(uint16 sound) +cAudioManager::GetBlackProjectMaleTalkSfx(int16 sound, int32 model) { - return GetGenericMaleTalkSfx(sound); + uint32 sfx; + static uint32 lastSfx = NO_SAMPLE; + + switch(sound) { + case SOUND_PED_HANDS_UP: GetPhrase(sfx, lastSfx, SFX_BLACK_PROJECT_MALE_VOICE_1_GUN_COOL_1, 3); break; + case SOUND_PED_CAR_JACKED: GetPhrase(sfx, lastSfx, SFX_BLACK_PROJECT_MALE_VOICE_1_CARJACKED_1, 2); break; + case SOUND_PED_ROBBED: GetPhrase(sfx, lastSfx, SFX_BLACK_PROJECT_MALE_VOICE_1_MUGGED_1, 2); break; + case SOUND_PED_ATTACK: GetPhrase(sfx, lastSfx, SFX_BLACK_PROJECT_MALE_VOICE_1_FIGHT_1, 6); break; + case SOUND_PED_EVADE: GetPhrase(sfx, lastSfx, SFX_BLACK_PROJECT_MALE_VOICE_1_DODGE_1, 5); break; + case SOUND_PED_ANNOYED_DRIVER: GetPhrase(sfx, lastSfx, SFX_BLACK_PROJECT_MALE_VOICE_1_DRIVER_ABUSE_1, 7); break; + case SOUND_PED_CHAT_SEXY: GetPhrase(sfx, lastSfx, SFX_BLACK_PROJECT_MALE_VOICE_1_EYING_1, 3); break; + case SOUND_PED_CHAT: GetPhrase(sfx, lastSfx, SFX_BLACK_PROJECT_MALE_VOICE_1_CHAT_1, 6); break; + default: return GetGenericMaleTalkSfx(sound); + } + + if (model == MI_P_MAN2) + sfx += (SFX_BLACK_PROJECT_MALE_VOICE_2_DRIVER_ABUSE_1 - SFX_BLACK_PROJECT_MALE_VOICE_1_DRIVER_ABUSE_1); + return sfx; +} + +uint32 +cAudioManager::GetWhiteFatMaleTalkSfx(int16 sound) +{ + uint32 sfx; + static uint32 lastSfx = NO_SAMPLE; + + switch(sound) { + case SOUND_PED_CAR_JACKED: GetPhrase(sfx, lastSfx, SFX_WHITE_FAT_MALE_VOICE_1_CARJACKED_1, 3); break; + case SOUND_PED_ROBBED: GetPhrase(sfx, lastSfx, SFX_WHITE_FAT_MALE_VOICE_1_MUGGED_1, 3); break; + case SOUND_PED_EVADE: GetPhrase(sfx, lastSfx, SFX_WHITE_FAT_MALE_VOICE_1_DODGE_1, 9); break; + case SOUND_PED_ANNOYED_DRIVER: GetPhrase(sfx, lastSfx, SFX_WHITE_FAT_MALE_VOICE_1_DRIVER_ABUSE_1, 9); break; + case SOUND_PED_WAIT_DOUBLEBACK: GetPhrase(sfx, lastSfx, SFX_WHITE_FAT_MALE_VOICE_1_LOST_1, 2); break; + case SOUND_PED_CHAT: GetPhrase(sfx, lastSfx, SFX_WHITE_FAT_MALE_VOICE_1_CHAT_1, 9); break; + default: return GetGenericMaleTalkSfx(sound); + } + return sfx; +} + +uint32 +cAudioManager::GetBlackFatMaleTalkSfx(int16 sound) +{ + uint32 sfx; + static uint32 lastSfx = NO_SAMPLE; + + switch (sound) { + case SOUND_PED_CAR_JACKED: + GetPhrase(sfx, lastSfx, SFX_BLACK_FAT_MALE_VOICE_1_CARJACKED_1, 4); + break; + case SOUND_PED_ROBBED: + GetPhrase(sfx, lastSfx, SFX_BLACK_FAT_MALE_VOICE_1_MUGGED_1, 3); + break; + case SOUND_PED_EVADE: + GetPhrase(sfx, lastSfx, SFX_BLACK_FAT_MALE_VOICE_1_DODGE_1, 7); + break; + case SOUND_PED_ANNOYED_DRIVER: + GetPhrase(sfx, lastSfx, SFX_BLACK_FAT_MALE_VOICE_1_DRIVER_ABUSE_1, 6); + break; + case SOUND_PED_WAIT_DOUBLEBACK: + GetPhrase(sfx, lastSfx, SFX_BLACK_FAT_MALE_VOICE_1_LOST_1, 3); + break; + case SOUND_PED_CHAT: + GetPhrase(sfx, lastSfx, SFX_BLACK_FAT_MALE_VOICE_1_CHAT_1, 8); + break; + default: + return GetGenericMaleTalkSfx(sound); + } + return sfx; } uint32 -cAudioManager::GetBlackCasualFemaleTalkSfx(uint16 sound) +cAudioManager::GetBlackCasualFemaleTalkSfx(int16 sound) { uint32 sfx; static uint32 lastSfx = NO_SAMPLE; @@ -4404,7 +4488,7 @@ cAudioManager::GetBlackCasualFemaleTalkSfx(uint16 sound) } uint32 -cAudioManager::GetWhiteCasualFemaleTalkSfx(uint16 sound) +cAudioManager::GetWhiteCasualFemaleTalkSfx(int16 sound) { uint32 sfx; static uint32 lastSfx = NO_SAMPLE; @@ -4441,7 +4525,7 @@ cAudioManager::GetWhiteCasualFemaleTalkSfx(uint16 sound) } uint32 -cAudioManager::GetFemaleNo3TalkSfx(uint16 sound) +cAudioManager::GetFemaleNo3TalkSfx(int16 sound) { uint32 sfx; static uint32 lastSfx = NO_SAMPLE; @@ -4478,47 +4562,7 @@ cAudioManager::GetFemaleNo3TalkSfx(uint16 sound) } uint32 -cAudioManager::GetWhiteBusinessFemaleTalkSfx(uint16 sound, uint32 model) -{ - uint32 sfx; - static uint32 lastSfx = NO_SAMPLE; - - switch (sound) { - case SOUND_PED_HANDS_COWER: - GetPhrase(sfx, lastSfx, SFX_WHITE_BUSINESS_FEMALE_VOICE_1_GUN_PANIC_1, 4); - break; - case SOUND_PED_CAR_JACKED: - GetPhrase(sfx, lastSfx, SFX_WHITE_BUSINESS_FEMALE_VOICE_1_CARJACKED_1, 2); - break; - case SOUND_PED_ROBBED: - GetPhrase(sfx, lastSfx, SFX_WHITE_BUSINESS_FEMALE_VOICE_1_MUGGED_1, 2); - break; - case SOUND_PED_EVADE: - GetPhrase(sfx, lastSfx, SFX_WHITE_BUSINESS_FEMALE_VOICE_1_DODGE_1, 6); - break; - case SOUND_PED_FLEE_RUN: - GetPhrase(sfx, lastSfx, SFX_WHITE_BUSINESS_FEMALE_VOICE_1_RUN_FROM_FIGHT_1, 4); - break; - case SOUND_PED_ANNOYED_DRIVER: - GetPhrase(sfx, lastSfx, SFX_WHITE_BUSINESS_FEMALE_VOICE_1_DRIVER_ABUSE_1, 5); - break; - case SOUND_PED_CHAT_EVENT: - GetPhrase(sfx, lastSfx, SFX_WHITE_BUSINESS_FEMALE_VOICE_1_SHOCKED_1, 4); - break; - case SOUND_PED_CHAT: - GetPhrase(sfx, lastSfx, SFX_WHITE_BUSINESS_FEMALE_VOICE_1_CHAT_1, 7); - break; - default: - return GetGenericFemaleTalkSfx(sound); - } - - if (model == MI_B_WOM2) - sfx += (SFX_WHITE_BUSINESS_FEMALE_VOICE_2_DRIVER_ABUSE_1 - SFX_WHITE_BUSINESS_FEMALE_VOICE_1_DRIVER_ABUSE_1); - return sfx; -} - -uint32 -cAudioManager::GetBlackFatFemaleTalkSfx(uint16 sound) +cAudioManager::GetBlackFatFemaleTalkSfx(int16 sound) { uint32 sfx; static uint32 lastSfx = NO_SAMPLE; @@ -4552,56 +4596,7 @@ cAudioManager::GetBlackFatFemaleTalkSfx(uint16 sound) } uint32 -cAudioManager::GetWhiteFatMaleTalkSfx(uint16 sound) -{ - uint32 sfx; - static uint32 lastSfx = NO_SAMPLE; - - switch(sound) { - case SOUND_PED_CAR_JACKED: GetPhrase(sfx, lastSfx, SFX_WHITE_FAT_MALE_VOICE_1_CARJACKED_1, 3); break; - case SOUND_PED_ROBBED: GetPhrase(sfx, lastSfx, SFX_WHITE_FAT_MALE_VOICE_1_MUGGED_1, 3); break; - case SOUND_PED_EVADE: GetPhrase(sfx, lastSfx, SFX_WHITE_FAT_MALE_VOICE_1_DODGE_1, 9); break; - case SOUND_PED_ANNOYED_DRIVER: GetPhrase(sfx, lastSfx, SFX_WHITE_FAT_MALE_VOICE_1_DRIVER_ABUSE_1, 9); break; - case SOUND_PED_WAIT_DOUBLEBACK: GetPhrase(sfx, lastSfx, SFX_WHITE_FAT_MALE_VOICE_1_LOST_1, 2); break; - case SOUND_PED_CHAT: GetPhrase(sfx, lastSfx, SFX_WHITE_FAT_MALE_VOICE_1_CHAT_1, 9); break; - default: return GetGenericMaleTalkSfx(sound); - } - return sfx; -} - -uint32 -cAudioManager::GetBlackFatMaleTalkSfx(uint16 sound) -{ - uint32 sfx; - static uint32 lastSfx = NO_SAMPLE; - - switch (sound) { - case SOUND_PED_CAR_JACKED: - GetPhrase(sfx, lastSfx, SFX_BLACK_FAT_MALE_VOICE_1_CARJACKED_1, 4); - break; - case SOUND_PED_ROBBED: - GetPhrase(sfx, lastSfx, SFX_BLACK_FAT_MALE_VOICE_1_MUGGED_1, 3); - break; - case SOUND_PED_EVADE: - GetPhrase(sfx, lastSfx, SFX_BLACK_FAT_MALE_VOICE_1_DODGE_1, 7); - break; - case SOUND_PED_ANNOYED_DRIVER: - GetPhrase(sfx, lastSfx, SFX_BLACK_FAT_MALE_VOICE_1_DRIVER_ABUSE_1, 6); - break; - case SOUND_PED_WAIT_DOUBLEBACK: - GetPhrase(sfx, lastSfx, SFX_BLACK_FAT_MALE_VOICE_1_LOST_1, 3); - break; - case SOUND_PED_CHAT: - GetPhrase(sfx, lastSfx, SFX_BLACK_FAT_MALE_VOICE_1_CHAT_1, 8); - break; - default: - return GetGenericMaleTalkSfx(sound); - } - return sfx; -} - -uint32 -cAudioManager::GetWhiteFatFemaleTalkSfx(uint16 sound) +cAudioManager::GetWhiteFatFemaleTalkSfx(int16 sound) { uint32 sfx; static uint32 lastSfx = NO_SAMPLE; @@ -4635,7 +4630,7 @@ cAudioManager::GetWhiteFatFemaleTalkSfx(uint16 sound) } uint32 -cAudioManager::GetBlackFemaleProstituteTalkSfx(uint16 sound) +cAudioManager::GetBlackFemaleProstituteTalkSfx(int16 sound) { uint32 sfx; static uint32 lastSfx = NO_SAMPLE; @@ -4669,7 +4664,7 @@ cAudioManager::GetBlackFemaleProstituteTalkSfx(uint16 sound) } uint32 -cAudioManager::GetWhiteFemaleProstituteTalkSfx(uint16 sound) +cAudioManager::GetWhiteFemaleProstituteTalkSfx(int16 sound) { uint32 sfx; static uint32 lastSfx = NO_SAMPLE; @@ -4700,30 +4695,7 @@ cAudioManager::GetWhiteFemaleProstituteTalkSfx(uint16 sound) } uint32 -cAudioManager::GetBlackProjectMaleTalkSfx(uint16 sound, uint32 model) -{ - uint32 sfx; - static uint32 lastSfx = NO_SAMPLE; - - switch(sound) { - case SOUND_PED_HANDS_UP: GetPhrase(sfx, lastSfx, SFX_BLACK_PROJECT_MALE_VOICE_1_GUN_COOL_1, 3); break; - case SOUND_PED_CAR_JACKED: GetPhrase(sfx, lastSfx, SFX_BLACK_PROJECT_MALE_VOICE_1_CARJACKED_1, 2); break; - case SOUND_PED_ROBBED: GetPhrase(sfx, lastSfx, SFX_BLACK_PROJECT_MALE_VOICE_1_MUGGED_1, 2); break; - case SOUND_PED_ATTACK: GetPhrase(sfx, lastSfx, SFX_BLACK_PROJECT_MALE_VOICE_1_FIGHT_1, 6); break; - case SOUND_PED_EVADE: GetPhrase(sfx, lastSfx, SFX_BLACK_PROJECT_MALE_VOICE_1_DODGE_1, 5); break; - case SOUND_PED_ANNOYED_DRIVER: GetPhrase(sfx, lastSfx, SFX_BLACK_PROJECT_MALE_VOICE_1_DRIVER_ABUSE_1, 7); break; - case SOUND_PED_CHAT_SEXY: GetPhrase(sfx, lastSfx, SFX_BLACK_PROJECT_MALE_VOICE_1_EYING_1, 3); break; - case SOUND_PED_CHAT: GetPhrase(sfx, lastSfx, SFX_BLACK_PROJECT_MALE_VOICE_1_CHAT_1, 6); break; - default: return GetGenericMaleTalkSfx(sound); - } - - if (model == MI_P_MAN2) - sfx += (SFX_BLACK_PROJECT_MALE_VOICE_2_DRIVER_ABUSE_1 - SFX_BLACK_PROJECT_MALE_VOICE_1_DRIVER_ABUSE_1); - return sfx; -} - -uint32 -cAudioManager::GetBlackProjectFemaleOldTalkSfx(uint16 sound) +cAudioManager::GetBlackProjectFemaleOldTalkSfx(int16 sound) { uint32 sfx; static uint32 lastSfx = NO_SAMPLE; @@ -4757,7 +4729,7 @@ cAudioManager::GetBlackProjectFemaleOldTalkSfx(uint16 sound) } uint32 -cAudioManager::GetBlackProjectFemaleYoungTalkSfx(uint16 sound) +cAudioManager::GetBlackProjectFemaleYoungTalkSfx(int16 sound) { uint32 sfx; static uint32 lastSfx = NO_SAMPLE; @@ -4791,7 +4763,7 @@ cAudioManager::GetBlackProjectFemaleYoungTalkSfx(uint16 sound) } uint32 -cAudioManager::GetChinatownMaleOldTalkSfx(uint16 sound) +cAudioManager::GetChinatownMaleOldTalkSfx(int16 sound) { uint32 sfx; static uint32 lastSfx = NO_SAMPLE; @@ -4825,7 +4797,7 @@ cAudioManager::GetChinatownMaleOldTalkSfx(uint16 sound) } uint32 -cAudioManager::GetChinatownMaleYoungTalkSfx(uint16 sound) +cAudioManager::GetChinatownMaleYoungTalkSfx(int16 sound) { uint32 sfx; static uint32 lastSfx = NO_SAMPLE; @@ -4859,7 +4831,7 @@ cAudioManager::GetChinatownMaleYoungTalkSfx(uint16 sound) } uint32 -cAudioManager::GetChinatownFemaleOldTalkSfx(uint16 sound) +cAudioManager::GetChinatownFemaleOldTalkSfx(int16 sound) { uint32 sfx; static uint32 lastSfx = NO_SAMPLE; @@ -4890,7 +4862,7 @@ cAudioManager::GetChinatownFemaleOldTalkSfx(uint16 sound) } uint32 -cAudioManager::GetChinatownFemaleYoungTalkSfx(uint16 sound) +cAudioManager::GetChinatownFemaleYoungTalkSfx(int16 sound) { uint32 sfx; static uint32 lastSfx = NO_SAMPLE; @@ -4921,7 +4893,7 @@ cAudioManager::GetChinatownFemaleYoungTalkSfx(uint16 sound) } uint32 -cAudioManager::GetLittleItalyMaleTalkSfx(uint16 sound) +cAudioManager::GetLittleItalyMaleTalkSfx(int16 sound) { uint32 sfx; static uint32 lastSfx = NO_SAMPLE; @@ -4955,7 +4927,7 @@ cAudioManager::GetLittleItalyMaleTalkSfx(uint16 sound) } uint32 -cAudioManager::GetLittleItalyFemaleOldTalkSfx(uint16 sound) +cAudioManager::GetLittleItalyFemaleOldTalkSfx(int16 sound) { uint32 sfx; static uint32 lastSfx = NO_SAMPLE; @@ -4986,7 +4958,7 @@ cAudioManager::GetLittleItalyFemaleOldTalkSfx(uint16 sound) } uint32 -cAudioManager::GetLittleItalyFemaleYoungTalkSfx(uint16 sound) +cAudioManager::GetLittleItalyFemaleYoungTalkSfx(int16 sound) { uint32 sfx; static uint32 lastSfx = NO_SAMPLE; @@ -5017,7 +4989,7 @@ cAudioManager::GetLittleItalyFemaleYoungTalkSfx(uint16 sound) } uint32 -cAudioManager::GetWhiteDockerMaleTalkSfx(uint16 sound) +cAudioManager::GetWhiteDockerMaleTalkSfx(int16 sound) { uint32 sfx; static uint32 lastSfx = NO_SAMPLE; @@ -5048,7 +5020,7 @@ cAudioManager::GetWhiteDockerMaleTalkSfx(uint16 sound) } uint32 -cAudioManager::GetBlackDockerMaleTalkSfx(uint16 sound) +cAudioManager::GetBlackDockerMaleTalkSfx(int16 sound) { uint32 sfx; static uint32 lastSfx = NO_SAMPLE; @@ -5079,7 +5051,7 @@ cAudioManager::GetBlackDockerMaleTalkSfx(uint16 sound) } uint32 -cAudioManager::GetScumMaleTalkSfx(uint16 sound) +cAudioManager::GetScumMaleTalkSfx(int16 sound) { uint32 sfx; static uint32 lastSfx = NO_SAMPLE; @@ -5116,7 +5088,7 @@ cAudioManager::GetScumMaleTalkSfx(uint16 sound) } uint32 -cAudioManager::GetScumFemaleTalkSfx(uint16 sound) +cAudioManager::GetScumFemaleTalkSfx(int16 sound) { uint32 sfx; static uint32 lastSfx = NO_SAMPLE; @@ -5147,7 +5119,7 @@ cAudioManager::GetScumFemaleTalkSfx(uint16 sound) } uint32 -cAudioManager::GetWhiteWorkerMaleTalkSfx(uint16 sound) +cAudioManager::GetWhiteWorkerMaleTalkSfx(int16 sound) { uint32 sfx; static uint32 lastSfx = NO_SAMPLE; @@ -5178,7 +5150,7 @@ cAudioManager::GetWhiteWorkerMaleTalkSfx(uint16 sound) } uint32 -cAudioManager::GetBlackWorkerMaleTalkSfx(uint16 sound) +cAudioManager::GetBlackWorkerMaleTalkSfx(int16 sound) { uint32 sfx; static uint32 lastSfx = NO_SAMPLE; @@ -5209,7 +5181,124 @@ cAudioManager::GetBlackWorkerMaleTalkSfx(uint16 sound) } uint32 -cAudioManager::GetBlackBusinessFemaleTalkSfx(uint16 sound) +cAudioManager::GetBusinessMaleYoungTalkSfx(int16 sound, int32 model) +{ + uint32 sfx; + static uint32 lastSfx = NO_SAMPLE; + + switch (sound) { + case SOUND_PED_HANDS_COWER: + GetPhrase(sfx, lastSfx, SFX_BUSINESS_MALE_YOUNG_VOICE_1_GUN_PANIC_1, 3); + break; + case SOUND_PED_CAR_JACKED: + GetPhrase(sfx, lastSfx, SFX_BUSINESS_MALE_YOUNG_VOICE_1_CARJACKED_1, 2); + break; + case SOUND_PED_ROBBED: + GetPhrase(sfx, lastSfx, SFX_BUSINESS_MALE_YOUNG_VOICE_1_MUGGED_1, 2); + break; + case SOUND_PED_ATTACK: + GetPhrase(sfx, lastSfx, SFX_BUSINESS_MALE_YOUNG_VOICE_1_FIGHT_1, 4); + break; + case SOUND_PED_EVADE: + GetPhrase(sfx, lastSfx, SFX_BUSINESS_MALE_YOUNG_VOICE_1_DODGE_1, 4); + break; + case SOUND_PED_FLEE_RUN: + GetPhrase(sfx, lastSfx, SFX_BUSINESS_MALE_YOUNG_VOICE_1_RUN_FROM_FIGHT_1, 5); + break; + case SOUND_PED_ANNOYED_DRIVER: + GetPhrase(sfx, lastSfx, SFX_BUSINESS_MALE_YOUNG_VOICE_1_DRIVER_ABUSE_1, 6); + break; + case SOUND_PED_CHAT: + GetPhrase(sfx, lastSfx, SFX_BUSINESS_MALE_YOUNG_VOICE_1_CHAT_1, 6); + break; + default: + return GetGenericMaleTalkSfx(sound); + } + + if (model == MI_B_MAN3) + sfx += (SFX_BUSINESS_MALE_YOUNG_VOICE_2_DRIVER_ABUSE_1 - SFX_BUSINESS_MALE_YOUNG_VOICE_1_DRIVER_ABUSE_1); + return sfx; +} + +uint32 +cAudioManager::GetBusinessMaleOldTalkSfx(int16 sound) +{ + uint32 sfx; + static uint32 lastSfx = NO_SAMPLE; + + switch (sound) { + case SOUND_PED_HANDS_COWER: + GetPhrase(sfx, lastSfx, SFX_BUSINESS_MALE_OLD_VOICE_1_GUN_PANIC_1, 3); + break; + case SOUND_PED_CAR_JACKED: + GetPhrase(sfx, lastSfx, SFX_BUSINESS_MALE_OLD_VOICE_1_CARJACKED_1, 2); + break; + case SOUND_PED_ROBBED: + GetPhrase(sfx, lastSfx, SFX_BUSINESS_MALE_OLD_VOICE_1_MUGGED_1, 2); + break; + case SOUND_PED_ATTACK: + GetPhrase(sfx, lastSfx, SFX_BUSINESS_MALE_OLD_VOICE_1_FIGHT_1, 5); + break; + case SOUND_PED_EVADE: + GetPhrase(sfx, lastSfx, SFX_BUSINESS_MALE_OLD_VOICE_1_DODGE_1, 4); + break; + case SOUND_PED_FLEE_RUN: + GetPhrase(sfx, lastSfx, SFX_BUSINESS_MALE_OLD_VOICE_1_MRUN_FROM_FIGHT_1, 5); + break; + case SOUND_PED_ANNOYED_DRIVER: + GetPhrase(sfx, lastSfx, SFX_BUSINESS_MALE_OLD_VOICE_1_DRIVER_ABUSE_1, 5); + break; + case SOUND_PED_CHAT: + GetPhrase(sfx, lastSfx, SFX_BUSINESS_MALE_OLD_VOICE_1_CHAT_1, 5); + break; + default: + return GetGenericMaleTalkSfx(sound); + } + return sfx; +} + +uint32 +cAudioManager::GetWhiteBusinessFemaleTalkSfx(int16 sound, int32 model) +{ + uint32 sfx; + static uint32 lastSfx = NO_SAMPLE; + + switch (sound) { + case SOUND_PED_HANDS_COWER: + GetPhrase(sfx, lastSfx, SFX_WHITE_BUSINESS_FEMALE_VOICE_1_GUN_PANIC_1, 4); + break; + case SOUND_PED_CAR_JACKED: + GetPhrase(sfx, lastSfx, SFX_WHITE_BUSINESS_FEMALE_VOICE_1_CARJACKED_1, 2); + break; + case SOUND_PED_ROBBED: + GetPhrase(sfx, lastSfx, SFX_WHITE_BUSINESS_FEMALE_VOICE_1_MUGGED_1, 2); + break; + case SOUND_PED_EVADE: + GetPhrase(sfx, lastSfx, SFX_WHITE_BUSINESS_FEMALE_VOICE_1_DODGE_1, 6); + break; + case SOUND_PED_FLEE_RUN: + GetPhrase(sfx, lastSfx, SFX_WHITE_BUSINESS_FEMALE_VOICE_1_RUN_FROM_FIGHT_1, 4); + break; + case SOUND_PED_ANNOYED_DRIVER: + GetPhrase(sfx, lastSfx, SFX_WHITE_BUSINESS_FEMALE_VOICE_1_DRIVER_ABUSE_1, 5); + break; + case SOUND_PED_CHAT_EVENT: + GetPhrase(sfx, lastSfx, SFX_WHITE_BUSINESS_FEMALE_VOICE_1_SHOCKED_1, 4); + break; + case SOUND_PED_CHAT: + GetPhrase(sfx, lastSfx, SFX_WHITE_BUSINESS_FEMALE_VOICE_1_CHAT_1, 7); + break; + default: + return GetGenericFemaleTalkSfx(sound); + } + + if (model == MI_B_WOM2) + sfx += (SFX_WHITE_BUSINESS_FEMALE_VOICE_2_DRIVER_ABUSE_1 - SFX_WHITE_BUSINESS_FEMALE_VOICE_1_DRIVER_ABUSE_1); + return sfx; +} + +uint32 +cAudioManager::GetBlackBusinessFemaleTalkSfx(int16 sound) { uint32 sfx; static uint32 lastSfx = NO_SAMPLE; @@ -5246,7 +5335,7 @@ cAudioManager::GetBlackBusinessFemaleTalkSfx(uint16 sound) } uint32 -cAudioManager::GetSupermodelMaleTalkSfx(uint16 sound) +cAudioManager::GetSupermodelMaleTalkSfx(int16 sound) { uint32 sfx; static uint32 lastSfx = NO_SAMPLE; @@ -5280,7 +5369,7 @@ cAudioManager::GetSupermodelMaleTalkSfx(uint16 sound) } uint32 -cAudioManager::GetSupermodelFemaleTalkSfx(uint16 sound) +cAudioManager::GetSupermodelFemaleTalkSfx(int16 sound) { uint32 sfx; static uint32 lastSfx = NO_SAMPLE; @@ -5311,7 +5400,7 @@ cAudioManager::GetSupermodelFemaleTalkSfx(uint16 sound) } uint32 -cAudioManager::GetStewardMaleTalkSfx(uint16 sound) +cAudioManager::GetStewardMaleTalkSfx(int16 sound) { uint32 sfx; static uint32 lastSfx = NO_SAMPLE; @@ -5339,7 +5428,7 @@ cAudioManager::GetStewardMaleTalkSfx(uint16 sound) } uint32 -cAudioManager::GetStewardFemaleTalkSfx(uint16 sound) +cAudioManager::GetStewardFemaleTalkSfx(int16 sound) { uint32 sfx; static uint32 lastSfx = NO_SAMPLE; @@ -5364,7 +5453,7 @@ cAudioManager::GetStewardFemaleTalkSfx(uint16 sound) } uint32 -cAudioManager::GetFanMaleTalkSfx(uint16 sound, uint32 model) +cAudioManager::GetFanMaleTalkSfx(int16 sound, int32 model) { uint32 sfx; static uint32 lastSfx = NO_SAMPLE; @@ -5395,7 +5484,7 @@ cAudioManager::GetFanMaleTalkSfx(uint16 sound, uint32 model) } uint32 -cAudioManager::GetFanFemaleTalkSfx(uint16 sound) +cAudioManager::GetFanFemaleTalkSfx(int16 sound) { uint32 sfx; static uint32 lastSfx = NO_SAMPLE; @@ -5423,7 +5512,7 @@ cAudioManager::GetFanFemaleTalkSfx(uint16 sound) } uint32 -cAudioManager::GetHospitalMaleTalkSfx(uint16 sound) +cAudioManager::GetHospitalMaleTalkSfx(int16 sound) { uint32 sfx; static uint32 lastSfx = NO_SAMPLE; @@ -5451,7 +5540,7 @@ cAudioManager::GetHospitalMaleTalkSfx(uint16 sound) } uint32 -cAudioManager::GetHospitalFemaleTalkSfx(uint16 sound) +cAudioManager::GetHospitalFemaleTalkSfx(int16 sound) { uint32 sfx; static uint32 lastSfx = NO_SAMPLE; @@ -5473,7 +5562,7 @@ cAudioManager::GetHospitalFemaleTalkSfx(uint16 sound) } uint32 -cAudioManager::GetWhiteConstructionWorkerTalkSfx(uint16 sound) +cAudioManager::GetWhiteConstructionWorkerTalkSfx(int16 sound) { uint32 sfx; static uint32 lastSfx = NO_SAMPLE; @@ -5507,7 +5596,7 @@ cAudioManager::GetWhiteConstructionWorkerTalkSfx(uint16 sound) } uint32 -cAudioManager::GetBlackConstructionWorkerTalkSfx(uint16 sound) +cAudioManager::GetBlackConstructionWorkerTalkSfx(int16 sound) { uint32 sfx; static uint32 lastSfx = NO_SAMPLE; @@ -5541,7 +5630,7 @@ cAudioManager::GetBlackConstructionWorkerTalkSfx(uint16 sound) } uint32 -cAudioManager::GetShopperFemaleTalkSfx(uint16 sound, uint32 model) +cAudioManager::GetShopperFemaleTalkSfx(int16 sound, int32 model) { uint32 sfx; static uint32 lastSfx = NO_SAMPLE; @@ -5578,7 +5667,7 @@ cAudioManager::GetShopperFemaleTalkSfx(uint16 sound, uint32 model) } uint32 -cAudioManager::GetStudentMaleTalkSfx(uint16 sound) +cAudioManager::GetStudentMaleTalkSfx(int16 sound) { uint32 sfx; static uint32 lastSfx = NO_SAMPLE; @@ -5612,7 +5701,7 @@ cAudioManager::GetStudentMaleTalkSfx(uint16 sound) } uint32 -cAudioManager::GetStudentFemaleTalkSfx(uint16 sound) +cAudioManager::GetStudentFemaleTalkSfx(int16 sound) { uint32 sfx; static uint32 lastSfx = NO_SAMPLE; @@ -5646,23 +5735,29 @@ cAudioManager::GetStudentFemaleTalkSfx(uint16 sound) } uint32 -cAudioManager::GetSpecialCharacterTalkSfx(uint32 modelIndex, uint16 sound) +cAudioManager::GetCasualMaleOldTalkSfx(int16 sound) +{ + return GetGenericMaleTalkSfx(sound); +} + +uint32 +cAudioManager::GetSpecialCharacterTalkSfx(int32 modelIndex, int32 sound) { char *modelName = CModelInfo::GetModelInfo(modelIndex)->GetModelName(); if (!CGeneral::faststricmp(modelName, "eight") || !CGeneral::faststricmp(modelName, "eight2")) { - return GetEightBallTalkSfx(sound); + return GetEightTalkSfx(sound); } if (!CGeneral::faststricmp(modelName, "frankie")) { - return GetSalvatoreTalkSfx(sound); + return GetFrankieTalkSfx(sound); } if (!CGeneral::faststricmp(modelName, "misty")) { return GetMistyTalkSfx(sound); } if (!CGeneral::faststricmp(modelName, "ojg") || !CGeneral::faststricmp(modelName, "ojg_p")) { - return GetOldJapTalkSfx(sound); + return GetOJGTalkSfx(sound); } if (!CGeneral::faststricmp(modelName, "cat")) { - return GetCatalinaTalkSfx(sound); + return GetCatatalinaTalkSfx(sound); } if (!CGeneral::faststricmp(modelName, "bomber")) { return GetBomberTalkSfx(sound); @@ -5682,9 +5777,8 @@ cAudioManager::GetSpecialCharacterTalkSfx(uint32 modelIndex, uint16 sound) return GetGenericMaleTalkSfx(sound); } - uint32 -cAudioManager::GetEightBallTalkSfx(uint16 sound) +cAudioManager::GetEightTalkSfx(int16 sound) { uint32 sfx; static uint32 lastSfx = NO_SAMPLE; @@ -5709,7 +5803,7 @@ cAudioManager::GetEightBallTalkSfx(uint16 sound) } uint32 -cAudioManager::GetSalvatoreTalkSfx(uint16 sound) +cAudioManager::GetFrankieTalkSfx(int16 sound) { uint32 sfx; static uint32 lastSfx = NO_SAMPLE; @@ -5734,7 +5828,7 @@ cAudioManager::GetSalvatoreTalkSfx(uint16 sound) } uint32 -cAudioManager::GetMistyTalkSfx(uint16 sound) +cAudioManager::GetMistyTalkSfx(int16 sound) { uint32 sfx; static uint32 lastSfx = NO_SAMPLE; @@ -5763,19 +5857,19 @@ cAudioManager::GetMistyTalkSfx(uint16 sound) } uint32 -cAudioManager::GetOldJapTalkSfx(uint16 sound) +cAudioManager::GetOJGTalkSfx(int16 sound) { return GetGenericMaleTalkSfx(sound); } uint32 -cAudioManager::GetCatalinaTalkSfx(uint16 sound) +cAudioManager::GetCatatalinaTalkSfx(int16 sound) { return GetGenericFemaleTalkSfx(sound); } uint32 -cAudioManager::GetBomberTalkSfx(uint16 sound) +cAudioManager::GetBomberTalkSfx(int16 sound) { uint32 sfx; static uint32 lastSfx = NO_SAMPLE; @@ -5792,7 +5886,7 @@ cAudioManager::GetBomberTalkSfx(uint16 sound) } uint32 -cAudioManager::GetSecurityGuardTalkSfx(uint16 sound) +cAudioManager::GetSecurityGuardTalkSfx(int16 sound) { uint32 sfx; static uint32 lastSfx = NO_SAMPLE; @@ -5825,7 +5919,7 @@ cAudioManager::GetSecurityGuardTalkSfx(uint16 sound) } uint32 -cAudioManager::GetChunkyTalkSfx(uint16 sound) +cAudioManager::GetChunkyTalkSfx(int16 sound) { uint32 sfx; static uint32 lastSfx = NO_SAMPLE; @@ -5845,98 +5939,7 @@ cAudioManager::GetChunkyTalkSfx(uint16 sound) } uint32 -cAudioManager::GetAsianTaxiDriverTalkSfx(uint16 sound) -{ - uint32 sfx; - static uint32 lastSfx = NO_SAMPLE; - - switch (sound) { - case SOUND_PED_CAR_JACKED: - GetPhrase(sfx, lastSfx, SFX_ASIAN_TAXI_DRIVER_VOICE_1_CARJACKED_1, 7); - break; - case SOUND_PED_ANNOYED_DRIVER: - GetPhrase(sfx, lastSfx, SFX_ASIAN_TAXI_DRIVER_VOICE_1_DRIVER_ABUSE_1, 6); - break; - default: - return GetGenericMaleTalkSfx(sound); - } - - return (SFX_ASIAN_TAXI_DRIVER_VOICE_2_DRIVER_ABUSE_1 - SFX_ASIAN_TAXI_DRIVER_VOICE_1_DRIVER_ABUSE_1) * (m_sQueueSample.m_nEntityIndex % 2) + sfx; -} - -uint32 -cAudioManager::GetPimpTalkSfx(uint16 sound) -{ - uint32 sfx; - static uint32 lastSfx = NO_SAMPLE; - - switch (sound) { - case SOUND_PED_HANDS_UP: - GetPhrase(sfx, lastSfx, SFX_PIMP_GUN_COOL_1, 7); - break; - case SOUND_PED_CAR_JACKED: - GetPhrase(sfx, lastSfx, SFX_PIMP_CARJACKED_1, 4); - break; - case SOUND_PED_DEFEND: - GetPhrase(sfx, lastSfx, SFX_PIMP_FIGHT_1, 9); - break; - case SOUND_PED_EVADE: - GetPhrase(sfx, lastSfx, SFX_PIMP_DODGE_1, 6); - break; - case SOUND_PED_ANNOYED_DRIVER: - GetPhrase(sfx, lastSfx, SFX_PIMP_DRIVER_ABUSE_1, 5); - break; - case SOUND_PED_CHAT_EVENT: - GetPhrase(sfx, lastSfx, SFX_PIMP_SHOCKED_1, 2); - break; - case SOUND_PED_CHAT: - GetPhrase(sfx, lastSfx, SFX_PIMP_CHAT_1, 17); - break; - default: - return GetGenericMaleTalkSfx(sound); - } - return sfx; -} - -uint32 -cAudioManager::GetNormalMaleTalkSfx(uint16 sound) -{ - uint32 sfx; - static uint32 lastSfx = NO_SAMPLE; - - switch (sound) { - case SOUND_PED_HANDS_COWER: - GetPhrase(sfx, lastSfx, SFX_NORMAL_MALE_GUN_PANIC_1, 7); - break; - case SOUND_PED_CAR_JACKED: - GetPhrase(sfx, lastSfx, SFX_NORMAL_MALE_CARJACKED_1, 7); - break; - case SOUND_PED_EVADE: - GetPhrase(sfx, lastSfx, SFX_NORMAL_MALE_DODGE_1, 9); - break; - case SOUND_PED_FLEE_RUN: - GetPhrase(sfx, lastSfx, SFX_NORMAL_MALE_RUN_FROM_FIGHT_1, 5); - break; - case SOUND_PED_ANNOYED_DRIVER: - GetPhrase(sfx, lastSfx, SFX_NORMAL_MALE_DRIVER_ABUSE_1, 12); - break; - case SOUND_PED_CHAT_SEXY: - GetPhrase(sfx, lastSfx, SFX_NORMAL_MALE_EYING_1, 8); - break; - case SOUND_PED_CHAT_EVENT: - GetPhrase(sfx, lastSfx, SFX_NORMAL_MALE_SHOCKED_1, 10); - break; - case SOUND_PED_CHAT: - GetPhrase(sfx, lastSfx, SFX_NORMAL_MALE_CHAT_1, 25); - break; - default: - return GetGenericMaleTalkSfx(sound); - } - return sfx; -} - -uint32 -cAudioManager::GetGenericMaleTalkSfx(uint16 sound) +cAudioManager::GetGenericMaleTalkSfx(int16 sound) { uint32 sfx; static uint32 lastSfx = NO_SAMPLE; @@ -5962,7 +5965,7 @@ cAudioManager::GetGenericMaleTalkSfx(uint16 sound) } uint32 -cAudioManager::GetGenericFemaleTalkSfx(uint16 sound) +cAudioManager::GetGenericFemaleTalkSfx(int16 sound) { uint32 sfx; static uint32 lastSfx = NO_SAMPLE; @@ -8350,7 +8353,7 @@ FindMissionAudioSfx(const char *name) } bool8 -cAudioManager::MissionScriptAudioUsesPoliceChannel(uint32 soundMission) +cAudioManager::MissionScriptAudioUsesPoliceChannel(int32 soundMission) const { switch (soundMission) { case STREAMED_SOUND_MISSION_J6_D: @@ -8391,7 +8394,7 @@ cAudioManager::PreloadMissionAudio(Const char *name) } uint8 -cAudioManager::GetMissionAudioLoadingStatus() +cAudioManager::GetMissionAudioLoadingStatus() const { if (m_bIsInitialised) return m_sMissionAudio.m_nLoadingStatus; diff --git a/src/audio/AudioManager.cpp b/src/audio/AudioManager.cpp index c3565828..a113cc93 100644 --- a/src/audio/AudioManager.cpp +++ b/src/audio/AudioManager.cpp @@ -109,9 +109,7 @@ cAudioManager::Service() if (m_bIsInitialised) { m_nPreviousUserPause = m_nUserPause; m_nUserPause = CTimer::GetIsUserPaused(); -#ifdef GTA_PC UpdateReflections(); -#endif ServiceSoundEffects(); MusicManager.Service(); } @@ -218,33 +216,33 @@ cAudioManager::PlayOneShot(int32 index, uint16 sound, float vol) } void -cAudioManager::SetEffectsMasterVolume(uint8 volume) +cAudioManager::SetEffectsMasterVolume(uint8 volume) const { SampleManager.SetEffectsMasterVolume(volume); } void -cAudioManager::SetMusicMasterVolume(uint8 volume) +cAudioManager::SetMusicMasterVolume(uint8 volume) const { SampleManager.SetMusicMasterVolume(volume); } void -cAudioManager::SetEffectsFadeVol(uint8 volume) +cAudioManager::SetEffectsFadeVol(uint8 volume) const { SampleManager.SetEffectsFadeVolume(volume); } void -cAudioManager::SetMusicFadeVol(uint8 volume) +cAudioManager::SetMonoMode(bool8 mono) { - SampleManager.SetMusicFadeVolume(volume); + SampleManager.SetMonoMode(mono); } void -cAudioManager::SetMonoMode(bool8 mono) +cAudioManager::SetMusicFadeVol(uint8 volume) const { - SampleManager.SetMonoMode(mono); + SampleManager.SetMusicFadeVolume(volume); } void @@ -309,10 +307,8 @@ cAudioManager::DestroyAllGameCreatedEntities() } } -#ifdef GTA_PC - uint8 -cAudioManager::GetNum3DProvidersAvailable() +cAudioManager::GetNum3DProvidersAvailable() const { if (m_bIsInitialised) return SampleManager.GetNum3DProvidersAvailable(); @@ -320,7 +316,7 @@ cAudioManager::GetNum3DProvidersAvailable() } char * -cAudioManager::Get3DProviderName(uint8 id) +cAudioManager::Get3DProviderName(uint8 id) const { if (!m_bIsInitialised) return nil; @@ -335,7 +331,7 @@ cAudioManager::Get3DProviderName(uint8 id) } int8 -cAudioManager::GetCurrent3DProviderIndex() +cAudioManager::GetCurrent3DProviderIndex() const { if (m_bIsInitialised) return SampleManager.GetCurrent3DProviderIndex(); @@ -367,13 +363,13 @@ cAudioManager::SetCurrent3DProvider(uint8 which) } void -cAudioManager::SetSpeakerConfig(int32 conf) +cAudioManager::SetSpeakerConfig(int32 conf) const { SampleManager.SetSpeakerConfig(conf); } bool8 -cAudioManager::IsMP3RadioChannelAvailable() +cAudioManager::IsMP3RadioChannelAvailable() const { if (m_bIsInitialised) return SampleManager.IsMP3RadioChannelAvailable(); @@ -382,7 +378,7 @@ cAudioManager::IsMP3RadioChannelAvailable() } void -cAudioManager::ReleaseDigitalHandle() +cAudioManager::ReleaseDigitalHandle() const { if (m_bIsInitialised) { SampleManager.ReleaseDigitalHandle(); @@ -390,7 +386,7 @@ cAudioManager::ReleaseDigitalHandle() } void -cAudioManager::ReacquireDigitalHandle() +cAudioManager::ReacquireDigitalHandle() const { if (m_bIsInitialised) { SampleManager.ReacquireDigitalHandle(); @@ -404,13 +400,13 @@ cAudioManager::SetDynamicAcousticModelingStatus(bool8 status) } bool8 -cAudioManager::CheckForAnAudioFileOnCD() +cAudioManager::CheckForAnAudioFileOnCD() const { return SampleManager.CheckForAnAudioFileOnCD(); } char -cAudioManager::GetCDAudioDriveLetter() +cAudioManager::GetCDAudioDriveLetter() const { if (m_bIsInitialised) return SampleManager.GetCDAudioDriveLetter(); @@ -419,13 +415,11 @@ cAudioManager::GetCDAudioDriveLetter() } bool8 -cAudioManager::IsAudioInitialised() +cAudioManager::IsAudioInitialised() const { return m_bIsInitialised; } -#endif // GTA_PC - void cAudioManager::ServiceSoundEffects() { @@ -475,14 +469,8 @@ cAudioManager::ServiceSoundEffects() m_sAudioScriptObjectManager.m_nScriptObjectEntityTotal = 0; } -uint32 -cAudioManager::FL(float f) -{ - return SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex) * f; -} - uint8 -cAudioManager::ComputeVolume(uint8 emittingVolume, float soundIntensity, float distance) +cAudioManager::ComputeVolume(uint8 emittingVolume, float soundIntensity, float distance) const { float newSoundIntensity; if (soundIntensity <= 0.0f) @@ -494,7 +482,7 @@ cAudioManager::ComputeVolume(uint8 emittingVolume, float soundIntensity, float d } void -cAudioManager::TranslateEntity(Const CVector *in, CVector *out) +cAudioManager::TranslateEntity(Const CVector *in, CVector *out) const { *out = MultiplyInverse(TheCamera.GetMatrix(), *in); } @@ -513,7 +501,7 @@ cAudioManager::ComputePan(float dist, CVector *vec) } int32 -cAudioManager::ComputeDopplerEffectedFrequency(uint32 oldFreq, float position1, float position2, float speedMultiplier) +cAudioManager::ComputeDopplerEffectedFrequency(uint32 oldFreq, float position1, float position2, float speedMultiplier) const { uint32 newFreq = oldFreq; if (!TheCamera.Get_Just_Switched_Status() && speedMultiplier != 0.0f) { @@ -534,7 +522,7 @@ cAudioManager::ComputeDopplerEffectedFrequency(uint32 oldFreq, float position1, } int32 -cAudioManager::RandomDisplacement(uint32 seed) +cAudioManager::RandomDisplacement(uint32 seed) const { int32 value; @@ -605,7 +593,6 @@ cAudioManager::AddSampleToRequestedQueue() AddReflectionsToRequestedQueue(); } } - void cAudioManager::AddDetailsToRequestedOrderList(uint8 sample) { @@ -623,7 +610,6 @@ cAudioManager::AddDetailsToRequestedOrderList(uint8 sample) m_abSampleQueueIndexTable[m_nActiveSampleQueue][i] = sample; } -#ifdef GTA_PC void cAudioManager::AddReflectionsToRequestedQueue() { @@ -701,7 +687,6 @@ cAudioManager::UpdateReflections() m_afReflectionsDistances[4] = 50.0f; } } -#endif // GTA_PC void cAudioManager::AddReleasingSounds() @@ -979,13 +964,6 @@ cAudioManager::ClearActiveSamples() } } -void -cAudioManager::LoadBankIfNecessary(uint8 bank) -{ - if(!SampleManager.IsSampleBankLoaded(bank)) - SampleManager.LoadSampleBank(bank); -} - void cAudioManager::GenerateIntegerRandomNumberTable() { diff --git a/src/audio/AudioManager.h b/src/audio/AudioManager.h index 7c591a1e..70302745 100644 --- a/src/audio/AudioManager.h +++ b/src/audio/AudioManager.h @@ -20,8 +20,8 @@ public: #ifndef GTA_PS2 int32 m_nLoopStart; int32 m_nLoopEnd; - uint8 m_nEmittingVolume; #endif + uint8 m_nEmittingVolume; float m_fSpeedMultiplier; float m_fSoundIntensity; bool8 m_bReleasingSoundFlag; @@ -183,9 +183,6 @@ enum { MAX_REFLECTIONS, }; -enum PLAY_STATUS { PLAY_STATUS_STOPPED = 0, PLAY_STATUS_PLAYING, PLAY_STATUS_FINISHED }; -enum LOADING_STATUS { LOADING_STATUS_NOT_LOADED = 0, LOADING_STATUS_LOADED, LOADING_STATUS_FAILED }; - class cAudioManager { public: @@ -207,10 +204,8 @@ public: tAudioEntity m_asAudioEntities[NUM_AUDIOENTITIES]; int32 m_anAudioEntityIndices[NUM_AUDIOENTITIES]; int32 m_nAudioEntitiesTotal; -#ifdef GTA_PC CVector m_avecReflectionsPos[NUM_AUDIO_REFLECTIONS]; float m_afReflectionsDistances[NUM_AUDIO_REFLECTIONS]; -#endif cAudioScriptObjectManager m_sAudioScriptObjectManager; cPedComments m_sPedComments; int32 m_nFireAudioEntity; @@ -232,279 +227,277 @@ public: cAudioManager(); ~cAudioManager(); - void Initialise(); - void Terminate(); - void Service(); + // getters + uint32 GetFrameCounter() const { return m_FrameCounter; } + float GetReflectionsDistance(int32 idx) const { return m_afReflectionsDistances[idx]; } + int32 GetRandomNumber(int32 idx) const { return m_anRandomTable[idx]; } + int32 GetRandomNumberInRange(int32 idx, int32 low, int32 high) const { return (m_anRandomTable[idx] % (high - low + 1)) + low; } + bool8 ShouldDuckMissionAudio() const { return m_sMissionAudio.m_nPlayStatus == 1; } + + // "Should" be in alphabetic order, except "getXTalkSfx" + void AddDetailsToRequestedOrderList(uint8 sample); + void AddPlayerCarSample(uint8 emittingVolume, int32 freq, uint32 sample, uint8 bank, + uint8 counter, bool8 notLooping); + void AddReflectionsToRequestedQueue(); + void AddReleasingSounds(); + void AddSampleToRequestedQueue(); + void AgeCrimes(); + + void CalculateDistance(bool8 &condition, float dist); + bool8 CheckForAnAudioFileOnCD() const; + void ClearActiveSamples(); + void ClearMissionAudio(); + void ClearRequestedQueue(); + int32 ComputeDopplerEffectedFrequency(uint32 oldFreq, float position1, float position2, + float speedMultiplier) const; + int32 ComputePan(float, CVector *); + uint8 ComputeVolume(uint8 emittingVolume, float soundIntensity, float distance) const; int32 CreateEntity(eAudioType type, void *entity); - void DestroyEntity(int32 id); - void SetEntityStatus(int32 id, bool8 status); - void PlayOneShot(int32 index, uint16 sound, float vol); - void SetEffectsMasterVolume(uint8 volume); - void SetMusicMasterVolume(uint8 volume); - void SetEffectsFadeVol(uint8 volume); - void SetMusicFadeVol(uint8 volume); - void SetMonoMode(bool8 mono); - void ResetTimers(uint32 time); + void DestroyAllGameCreatedEntities(); + void DestroyEntity(int32 id); + void DoPoliceRadioCrackle(); -#ifdef GTA_PC - uint8 GetNum3DProvidersAvailable(); - char *Get3DProviderName(uint8 id); - int8 GetCurrent3DProviderIndex(); - int8 SetCurrent3DProvider(uint8 which); - void SetSpeakerConfig(int32 conf); - bool8 IsMP3RadioChannelAvailable(); - void ReleaseDigitalHandle(); - void ReacquireDigitalHandle(); - void SetDynamicAcousticModelingStatus(bool8 status); - bool8 CheckForAnAudioFileOnCD(); - char GetCDAudioDriveLetter(); - bool8 IsAudioInitialised(); -#endif + // functions returning talk sfx, + // order from GetPedCommentSfx + uint32 GetPlayerTalkSfx(int16 sound); + uint32 GetCopTalkSfx(int16 sound); + uint32 GetSwatTalkSfx(int16 sound); + uint32 GetFBITalkSfx(int16 sound); + uint32 GetArmyTalkSfx(int16 sound); + uint32 GetMedicTalkSfx(int16 sound); + uint32 GetFiremanTalkSfx(int16 sound); + uint32 GetNormalMaleTalkSfx(int16 sound); + uint32 GetTaxiDriverTalkSfx(int16 sound); + uint32 GetPimpTalkSfx(int16 sound); + uint32 GetMafiaTalkSfx(int16 sound); + uint32 GetTriadTalkSfx(int16 sound); + uint32 GetDiabloTalkSfx(int16 sound); + uint32 GetYakuzaTalkSfx(int16 sound); + uint32 GetYardieTalkSfx(int16 sound); + uint32 GetColumbianTalkSfx(int16 sound); + uint32 GetHoodTalkSfx(int16 sound); + uint32 GetBlackCriminalTalkSfx(int16 sound); + uint32 GetWhiteCriminalTalkSfx(int16 sound); + uint32 GetMaleNo2TalkSfx(int16 sound); + uint32 GetBlackProjectMaleTalkSfx(int16 sound, int32 model); + uint32 GetWhiteFatMaleTalkSfx(int16 sound); + uint32 GetBlackFatMaleTalkSfx(int16 sound); + uint32 GetBlackCasualFemaleTalkSfx(int16 sound); + uint32 GetWhiteCasualFemaleTalkSfx(int16 sound); + uint32 GetFemaleNo3TalkSfx(int16 sound); + uint32 GetBlackFatFemaleTalkSfx(int16 sound); + uint32 GetWhiteFatFemaleTalkSfx(int16 sound); + uint32 GetBlackFemaleProstituteTalkSfx(int16 sound); + uint32 GetWhiteFemaleProstituteTalkSfx(int16 sound); + uint32 GetBlackProjectFemaleOldTalkSfx(int16 sound); + uint32 GetBlackProjectFemaleYoungTalkSfx(int16 sound); + uint32 GetChinatownMaleOldTalkSfx(int16 sound); + uint32 GetChinatownMaleYoungTalkSfx(int16 sound); + uint32 GetChinatownFemaleOldTalkSfx(int16 sound); + uint32 GetChinatownFemaleYoungTalkSfx(int16 sound); + uint32 GetLittleItalyMaleTalkSfx(int16 sound); + uint32 GetLittleItalyFemaleOldTalkSfx(int16 sound); + uint32 GetLittleItalyFemaleYoungTalkSfx(int16 sound); + uint32 GetWhiteDockerMaleTalkSfx(int16 sound); + uint32 GetBlackDockerMaleTalkSfx(int16 sound); + uint32 GetScumMaleTalkSfx(int16 sound); + uint32 GetScumFemaleTalkSfx(int16 sound); + uint32 GetWhiteWorkerMaleTalkSfx(int16 sound); + uint32 GetBlackWorkerMaleTalkSfx(int16 sound); + uint32 GetBusinessMaleYoungTalkSfx(int16 sound, int32 model); + uint32 GetBusinessMaleOldTalkSfx(int16 sound); + uint32 GetWhiteBusinessFemaleTalkSfx(int16 sound, int32 model); + uint32 GetBlackBusinessFemaleTalkSfx(int16 sound); + uint32 GetSupermodelMaleTalkSfx(int16 sound); + uint32 GetSupermodelFemaleTalkSfx(int16 sound); + uint32 GetStewardMaleTalkSfx(int16 sound); + uint32 GetStewardFemaleTalkSfx(int16 sound); + uint32 GetFanMaleTalkSfx(int16 sound, int32 model); + uint32 GetFanFemaleTalkSfx(int16 sound); + uint32 GetHospitalMaleTalkSfx(int16 sound); + uint32 GetHospitalFemaleTalkSfx(int16 sound); + uint32 GetWhiteConstructionWorkerTalkSfx(int16 sound); + uint32 GetBlackConstructionWorkerTalkSfx(int16 sound); + uint32 GetShopperFemaleTalkSfx(int16 sound, int32 model); + uint32 GetStudentMaleTalkSfx(int16 sound); + uint32 GetStudentFemaleTalkSfx(int16 sound); + uint32 GetCasualMaleOldTalkSfx(int16 sound); + + uint32 GetSpecialCharacterTalkSfx(int32 modelIndex, int32 sound); + uint32 GetEightTalkSfx(int16 sound); + uint32 GetFrankieTalkSfx(int16 sound); + uint32 GetMistyTalkSfx(int16 sound); + uint32 GetOJGTalkSfx(int16 sound); + uint32 GetCatatalinaTalkSfx(int16 sound); + uint32 GetBomberTalkSfx(int16 sound); + uint32 GetSecurityGuardTalkSfx(int16 sound); + uint32 GetChunkyTalkSfx(int16 sound); + + uint32 GetGenericMaleTalkSfx(int16 sound); + uint32 GetGenericFemaleTalkSfx(int16 sound); + // end of functions returning talk sfx + + void GenerateIntegerRandomNumberTable(); + char *Get3DProviderName(uint8 id) const; + char GetCDAudioDriveLetter() const; + int8 GetCurrent3DProviderIndex() const; + 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; + int32 GetJumboTaxiFreq() const; + uint8 GetMissionAudioLoadingStatus() const; + int8 GetMissionScriptPoliceAudioPlayingStatus() const; + uint8 GetNum3DProvidersAvailable() const; + int32 GetPedCommentSfx(CPed *ped, int32 sound); + void GetPhrase(uint32 &phrase, uint32 &prevPhrase, uint32 sample, uint32 maxOffset) const; + float GetVehicleDriveWheelSkidValue(uint8 wheel, CAutomobile *automobile, + cTransmission *transmission, float velocityChange); + float GetVehicleNonDriveWheelSkidValue(uint8 wheel, CAutomobile *automobile, + cTransmission *transmission, float velocityChange); + + bool8 HasAirBrakes(int32 model) const; - void ServiceSoundEffects(); - uint32 FL(float f); // not used - uint8 ComputeVolume(uint8 emittingVolume, float soundIntensity, float distance); - void TranslateEntity(Const CVector *v1, CVector *v2); - int32 ComputePan(float, CVector *); - int32 ComputeDopplerEffectedFrequency(uint32 oldFreq, float position1, float position2, float speedMultiplier); // inlined on PS2 - int32 RandomDisplacement(uint32 seed); - void InterrogateAudioEntities(); // inlined on PS2 - void AddSampleToRequestedQueue(); - void AddDetailsToRequestedOrderList(uint8 sample); // inlined on PS2 -#ifdef GTA_PC - void AddReflectionsToRequestedQueue(); - void UpdateReflections(); -#endif - void AddReleasingSounds(); - void ProcessActiveQueues(); - void ClearRequestedQueue(); // inlined on PS2 - void ClearActiveSamples(); - void GenerateIntegerRandomNumberTable(); // inlined on PS2 - void LoadBankIfNecessary(uint8 bank); // this is used only on PS2 but technically not a platform code + void Initialise(); + void InitialisePoliceRadio(); + void InitialisePoliceRadioZones(); + void InterrogateAudioEntities(); + bool8 IsAudioInitialised() const; + bool8 IsMissionAudioSampleFinished(); + bool8 IsMP3RadioChannelAvailable() const; -#ifdef GTA_PC - void AdjustSamplesVolume(); - uint8 ComputeEmittingVolume(uint8 emittingVolume, float intensity, float dist); -#endif + bool8 MissionScriptAudioUsesPoliceChannel(int32 soundMission) const; - // audio logic - void PreInitialiseGameSpecificSetup(); + void PlayLoadedMissionAudio(); + void PlayOneShot(int32 index, uint16 sound, float vol); + void PlaySuspectLastSeen(float x, float y, float z); + void PlayerJustGotInCar() const; + void PlayerJustLeftCar() const; void PostInitialiseGameSpecificSetup(); - void PreTerminateGameSpecificShutdown(); void PostTerminateGameSpecificShutdown(); - void ResetAudioLogicTimers(uint32 timer); - void ProcessReverb(); - float GetDistanceSquared(const CVector &v); - void CalculateDistance(bool8 &condition, float dist); - void ProcessSpecial(); + void PreInitialiseGameSpecificSetup() const; + void PreloadMissionAudio(Const char *name); + void PreTerminateGameSpecificShutdown(); + /// processX - main logic of adding new sounds + void ProcessActiveQueues(); + bool8 ProcessAirBrakes(cVehicleParams& params); + void ProcessAirportScriptObject(uint8 sound); + bool8 ProcessBoatEngine(cVehicleParams& params); + bool8 ProcessBoatMovingOverWater(cVehicleParams& params); + void ProcessBridge(); + void ProcessBridgeMotor(); + void ProcessBridgeOneShots(); + void ProcessBridgeWarning(); + bool8 ProcessCarBombTick(cVehicleParams& params); + void ProcessCesna(cVehicleParams& params); + void ProcessCinemaScriptObject(uint8 sound); + void ProcessCrane(); + void ProcessDocksScriptObject(uint8 sound); + bool8 ProcessEngineDamage(cVehicleParams& params); void ProcessEntity(int32 sound); - void ProcessPhysical(int32 id); - void ProcessVehicle(CVehicle *vehicle); - void ProcessRainOnVehicle(cVehicleParams ¶ms); - bool8 ProcessReverseGear(cVehicleParams ¶ms); - void ProcessModelCarEngine(cVehicleParams ¶ms); - bool8 ProcessVehicleRoadNoise(cVehicleParams ¶ms); - bool8 ProcessWetRoadNoise(cVehicleParams ¶ms); - - // vehicles - void ProcessVehicleEngine(cVehicleParams ¶ms); - void UpdateGasPedalAudio(CAutomobile *automobile); // inlined on PS2 - void PlayerJustGotInCar(); - void PlayerJustLeftCar(); - void AddPlayerCarSample(uint8 emittingVolume, uint32 freq, uint32 sample, uint8 bank, uint8 counter, bool8 notLooping); - void ProcessCesna(cVehicleParams ¶ms); - void ProcessPlayersVehicleEngine(cVehicleParams ¶ms, CAutomobile *automobile); - bool8 ProcessVehicleSkidding(cVehicleParams ¶ms); - float GetVehicleDriveWheelSkidValue(uint8 wheel, CAutomobile *automobile, cTransmission *transmission, float velocityChange); - float GetVehicleNonDriveWheelSkidValue(uint8 wheel, CAutomobile *automobile, cTransmission *transmission, float velocityChange); // was in .h on PS2 - void ProcessVehicleHorn(cVehicleParams ¶ms); - bool8 UsesSiren(uint32 model); // inlined on PS2 - bool8 UsesSirenSwitching(uint32 model); // inlined on PS2 - bool8 ProcessVehicleSirenOrAlarm(cVehicleParams ¶ms); - bool8 UsesReverseWarning(uint32 model); // inlined on PS2 - bool8 ProcessVehicleReverseWarning(cVehicleParams ¶ms); - bool8 ProcessVehicleDoors(cVehicleParams ¶ms); - bool8 ProcessAirBrakes(cVehicleParams ¶ms); - bool8 HasAirBrakes(uint32 model); // inlined on PS2 - bool8 ProcessEngineDamage(cVehicleParams ¶ms); - bool8 ProcessCarBombTick(cVehicleParams ¶ms); - void ProcessVehicleOneShots(cVehicleParams ¶ms); - bool8 ProcessTrainNoise(cVehicleParams ¶ms); - bool8 ProcessBoatEngine(cVehicleParams ¶ms); - bool8 ProcessBoatMovingOverWater(cVehicleParams ¶ms); - bool8 ProcessHelicopter(cVehicleParams ¶ms); - void ProcessPlane(cVehicleParams ¶ms); // inlined on PS2 - void ProcessJumbo(cVehicleParams ¶ms); - void ProcessJumboTaxi(); // inlined on PS2 - void ProcessJumboAccel(CPlane *plane); - void ProcessJumboTakeOff(CPlane *plane); // inlined on PS2 - void ProcessJumboFlying(); // inlined on PS2 - void ProcessJumboLanding(CPlane *plane); // inlined on PS2 - void ProcessJumboDecel(CPlane *plane); // inlined on PS2 - bool8 SetupJumboTaxiSound(uint8 vol); - bool8 SetupJumboWhineSound(uint8 emittingVol, uint32 freq); - bool8 SetupJumboEngineSound(uint8 vol, uint32 freq); - bool8 SetupJumboFlySound(uint8 emittingVol); - bool8 SetupJumboRumbleSound(uint8 emittingVol); - int32 GetJumboTaxiFreq(); // inlined on PS2 - - // peds - void ProcessPed(CPhysical *ped); // inlined on PS2 - void ProcessPedHeadphones(cPedParams ¶ms); - void ProcessPedOneShots(cPedParams ¶ms); - - // ped comments - void SetupPedComments(cPedParams ¶ms, uint16 sound); - int32 GetPedCommentSfx(CPed *ped, uint16 sound); - void GetPhrase(uint32 &phrase, uint32 &prevPhrase, uint32 sample, uint32 maxOffset); // inlined on PS2 - uint32 GetPlayerTalkSfx(uint16 sound); // inlined on PS2 - uint32 GetCopTalkSfx(uint16 sound); - uint32 GetSwatTalkSfx(uint16 sound); - uint32 GetFBITalkSfx(uint16 sound); - uint32 GetArmyTalkSfx(uint16 sound); - uint32 GetMedicTalkSfx(uint16 sound); - uint32 GetFiremanTalkSfx(uint16 sound); // inlined on PS2 - uint32 GetBusinessMaleOldTalkSfx(uint16 sound); - uint32 GetBusinessMaleYoungTalkSfx(uint16 sound, uint32 model); - uint32 GetMafiaTalkSfx(uint16 sound); - uint32 GetTriadTalkSfx(uint16 sound); - uint32 GetDiabloTalkSfx(uint16 sound); - uint32 GetYakuzaTalkSfx(uint16 sound); - uint32 GetYardieTalkSfx(uint16 sound); - uint32 GetColumbianTalkSfx(uint16 sound); - uint32 GetHoodTalkSfx(uint16 sound); - uint32 GetBlackCriminalTalkSfx(uint16 sound); - uint32 GetWhiteCriminalTalkSfx(uint16 sound); - uint32 GetCasualMaleOldTalkSfx(uint16 sound); - uint32 GetCasualMaleYoungTalkSfx(uint16 sound); - uint32 GetBlackCasualFemaleTalkSfx(uint16 sound); - uint32 GetWhiteCasualFemaleTalkSfx(uint16 sound); - uint32 GetFemaleNo3TalkSfx(uint16 sound); - uint32 GetWhiteBusinessFemaleTalkSfx(uint16 sound, uint32 model); - uint32 GetBlackFatFemaleTalkSfx(uint16 sound); - uint32 GetWhiteFatMaleTalkSfx(uint16 sound); - uint32 GetBlackFatMaleTalkSfx(uint16 sound); - uint32 GetWhiteFatFemaleTalkSfx(uint16 sound); - uint32 GetBlackFemaleProstituteTalkSfx(uint16 sound); - uint32 GetWhiteFemaleProstituteTalkSfx(uint16 sound); - uint32 GetBlackProjectMaleTalkSfx(uint16 sound, uint32 model); - uint32 GetBlackProjectFemaleOldTalkSfx(uint16 sound); - uint32 GetBlackProjectFemaleYoungTalkSfx(uint16 sound); - uint32 GetChinatownMaleOldTalkSfx(uint16 sound); - uint32 GetChinatownMaleYoungTalkSfx(uint16 sound); - uint32 GetChinatownFemaleOldTalkSfx(uint16 sound); - uint32 GetChinatownFemaleYoungTalkSfx(uint16 sound); - uint32 GetLittleItalyMaleTalkSfx(uint16 sound); - uint32 GetLittleItalyFemaleOldTalkSfx(uint16 sound); - uint32 GetLittleItalyFemaleYoungTalkSfx(uint16 sound); - uint32 GetWhiteDockerMaleTalkSfx(uint16 sound); - uint32 GetBlackDockerMaleTalkSfx(uint16 sound); - uint32 GetScumMaleTalkSfx(uint16 sound); - uint32 GetScumFemaleTalkSfx(uint16 sound); - uint32 GetWhiteWorkerMaleTalkSfx(uint16 sound); - uint32 GetBlackWorkerMaleTalkSfx(uint16 sound); - uint32 GetBlackBusinessFemaleTalkSfx(uint16 sound); - uint32 GetSupermodelMaleTalkSfx(uint16 sound); - uint32 GetSupermodelFemaleTalkSfx(uint16 sound); - uint32 GetStewardMaleTalkSfx(uint16 sound); - uint32 GetStewardFemaleTalkSfx(uint16 sound); - uint32 GetFanMaleTalkSfx(uint16 sound, uint32 model); - uint32 GetFanFemaleTalkSfx(uint16 sound); - uint32 GetHospitalMaleTalkSfx(uint16 sound); - uint32 GetHospitalFemaleTalkSfx(uint16 sound); // inlined on PS2 - uint32 GetWhiteConstructionWorkerTalkSfx(uint16 sound); - uint32 GetBlackConstructionWorkerTalkSfx(uint16 sound); - uint32 GetShopperFemaleTalkSfx(uint16 sound, uint32 model); - uint32 GetStudentMaleTalkSfx(uint16 sound); - uint32 GetStudentFemaleTalkSfx(uint16 sound); - - uint32 GetSpecialCharacterTalkSfx(uint32 modelIndex, uint16 sound); - uint32 GetEightBallTalkSfx(uint16 sound); // inlined on PS2 - uint32 GetSalvatoreTalkSfx(uint16 sound); // inlined on PS2 - uint32 GetMistyTalkSfx(uint16 sound); - uint32 GetOldJapTalkSfx(uint16 sound); // inlined on PS2 - uint32 GetCatalinaTalkSfx(uint16 sound); // inlined on PS2 - uint32 GetBomberTalkSfx(uint16 sound); // inlined on PS2 - uint32 GetSecurityGuardTalkSfx(uint16 sound); - uint32 GetChunkyTalkSfx(uint16 sound); // inlined on PS2 - - uint32 GetAsianTaxiDriverTalkSfx(uint16 sound); // inlined on PS2 - uint32 GetPimpTalkSfx(uint16 sound); - uint32 GetNormalMaleTalkSfx(uint16 sound); - uint32 GetGenericMaleTalkSfx(uint16 sound); - uint32 GetGenericFemaleTalkSfx(uint16 sound); - - // particles void ProcessExplosions(int32 explosion); + void ProcessFireHydrant(); void ProcessFires(int32 entity); - void ProcessWaterCannon(int32); - - // script objects - void ProcessScriptObject(int32 id); // inlined on PS2 - void ProcessOneShotScriptObject(uint8 sound); + void ProcessFrontEnd(); + void ProcessGarages(); + bool8 ProcessHelicopter(cVehicleParams& params); + void ProcessHomeScriptObject(uint8 sound); + void ProcessJumbo(cVehicleParams& params); + void ProcessJumboAccel(CPlane *plane); + void ProcessJumboDecel(CPlane *plane); + void ProcessJumboFlying(); + void ProcessJumboLanding(CPlane *plane); + void ProcessJumboTakeOff(CPlane *plane); + void ProcessJumboTaxi(); + void ProcessLaunderetteScriptObject(uint8 sound); void ProcessLoopingScriptObject(uint8 sound); + void ProcessMissionAudio(); + void ProcessModelCarEngine(cVehicleParams& params); + void ProcessOneShotScriptObject(uint8 sound); + void ProcessPed(CPhysical *ped); + void ProcessPedHeadphones(cPedParams ¶ms); + void ProcessPedOneShots(cPedParams ¶ms); + void ProcessPhysical(int32 id); + void ProcessPlane(cVehicleParams& params); + void ProcessPlayersVehicleEngine(cVehicleParams& params, CAutomobile *automobile); + void ProcessPoliceCellBeatingScriptObject(uint8 sound); void ProcessPornCinema(uint8 sound); - void ProcessWorkShopScriptObject(uint8 sound); + void ProcessProjectiles(); + void ProcessRainOnVehicle(cVehicleParams& params); + void ProcessReverb() const; + bool8 ProcessReverseGear(cVehicleParams& params); void ProcessSawMillScriptObject(uint8 sound); - void ProcessLaunderetteScriptObject(uint8 sound); + void ProcessScriptObject(int32 id); void ProcessShopScriptObject(uint8 sound); - void ProcessAirportScriptObject(uint8 sound); - void ProcessCinemaScriptObject(uint8 sound); - void ProcessDocksScriptObject(uint8 sound); - void ProcessHomeScriptObject(uint8 sound); - void ProcessPoliceCellBeatingScriptObject(uint8 sound); - - // misc + void ProcessSpecial(); + bool8 ProcessTrainNoise(cVehicleParams& params); + void ProcessVehicle(CVehicle *vehicle); + bool8 ProcessVehicleDoors(cVehicleParams& params); + void ProcessVehicleEngine(cVehicleParams& params); + void ProcessVehicleHorn(cVehicleParams& params); + void ProcessVehicleOneShots(cVehicleParams& params); + bool8 ProcessVehicleReverseWarning(cVehicleParams& params); + bool8 ProcessVehicleRoadNoise(cVehicleParams& params); + bool8 ProcessVehicleSirenOrAlarm(cVehicleParams& params); + bool8 ProcessVehicleSkidding(cVehicleParams& params); + void ProcessWaterCannon(int32); void ProcessWeather(int32 id); - void ProcessFrontEnd(); - void ProcessCrane(); - void ProcessProjectiles(); - void ProcessGarages(); - void ProcessFireHydrant(); - - // bridge - void ProcessBridge(); // inlined on PS2 - void ProcessBridgeWarning(); - void ProcessBridgeMotor(); - void ProcessBridgeOneShots(); - - // mission audio - bool8 MissionScriptAudioUsesPoliceChannel(uint32 soundMission); - void PreloadMissionAudio(Const char *name); - uint8 GetMissionAudioLoadingStatus(); - void SetMissionAudioLocation(float x, float y, float z); - void PlayLoadedMissionAudio(); - bool8 IsMissionAudioSampleFinished(); - bool8 IsMissionAudioSamplePlaying() { return m_sMissionAudio.m_nPlayStatus == PLAY_STATUS_PLAYING; } - bool8 ShouldDuckMissionAudio() { return IsMissionAudioSamplePlaying(); } - void ClearMissionAudio(); - void ProcessMissionAudio(); + bool8 ProcessWetRoadNoise(cVehicleParams& params); + void ProcessWorkShopScriptObject(uint8 sound); - // police radio - void InitialisePoliceRadioZones(); - void InitialisePoliceRadio(); + int32 RandomDisplacement(uint32 seed) const; + void ReacquireDigitalHandle() const; + void ReleaseDigitalHandle() const; + void ReportCollision(CEntity *entity1, CEntity *entity2, uint8 surface1, uint8 surface2, + float collisionPower, float intensity2); + void ReportCrime(eCrimeType crime, const CVector &pos); + void ResetAudioLogicTimers(uint32 timer); void ResetPoliceRadio(); - void SetMissionScriptPoliceAudio(int32 sfx); - int8 GetMissionScriptPoliceAudioPlayingStatus(); - void DoPoliceRadioCrackle(); + void ResetTimers(uint32 time); + + void Service(); + void ServiceCollisions(); void ServicePoliceRadio(); void ServicePoliceRadioChannel(uint8 wantedLevel); + void ServiceSoundEffects(); + int8 SetCurrent3DProvider(uint8 which); + void SetDynamicAcousticModelingStatus(bool8 status); + void SetEffectsFadeVol(uint8 volume) const; + void SetEffectsMasterVolume(uint8 volume) const; + void SetEntityStatus(int32 id, bool8 status); + uint32 SetLoopingCollisionRequestedSfxFreqAndGetVol(const cAudioCollision &audioCollision); + void SetMissionAudioLocation(float x, float y, float z); + void SetMissionScriptPoliceAudio(int32 sfx) const; + void SetMonoMode(bool8 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); bool8 SetupCrimeReport(); + bool8 SetupJumboEngineSound(uint8 vol, uint32 freq); + bool8 SetupJumboFlySound(uint8 emittingVol); + bool8 SetupJumboRumbleSound(uint8 emittingVol); + bool8 SetupJumboTaxiSound(uint8 vol); + bool8 SetupJumboWhineSound(uint8 emittingVol, uint32 freq); + void SetupPedComments(cPedParams ¶ms, uint16 sound); void SetupSuspectLastSeenReport(); - void ReportCrime(eCrimeType crime, const CVector &pos); - void PlaySuspectLastSeen(float x, float y, float z); - void AgeCrimes(); // inlined on PS2 - - // collision stuff - void ReportCollision(CEntity *entity1, CEntity *entity2, uint8 surface1, uint8 surface2, float collisionPower, float intensity2); - void ServiceCollisions(); - void SetUpOneShotCollisionSound(const cAudioCollision &col); - void SetUpLoopingCollisionSound(const cAudioCollision &col, uint8 counter); - uint32 SetLoopingCollisionRequestedSfxFreqAndGetVol(const cAudioCollision &audioCollision); - float GetCollisionOneShotRatio(uint32 a, float b); - float GetCollisionLoopingRatio(uint32 a, uint32 b, float c); // not used - float GetCollisionRatio(float a, float b, float c, float d); // inlined on PS2 + + void Terminate(); + void TranslateEntity(Const CVector *v1, CVector *v2) const; + + void UpdateGasPedalAudio(CAutomobile *automobile); + void UpdateReflections(); + bool8 UsesReverseWarning(int32 model) const; + bool8 UsesSiren(int32 model) const; + bool8 UsesSirenSwitching(int32 model) const; + +#ifdef GTA_PC + // only used in pc + void AdjustSamplesVolume(); + uint8 ComputeEmittingVolume(uint8 emittingVolume, float intensity, float dist); +#endif }; /* diff --git a/src/audio/MusicManager.cpp b/src/audio/MusicManager.cpp index 815e55f2..cb441622 100644 --- a/src/audio/MusicManager.cpp +++ b/src/audio/MusicManager.cpp @@ -236,23 +236,23 @@ cMusicManager::Initialise() if (!IsInitialised()) { time_t timevalue = time(0); if (timevalue == -1) { - pos = AudioManager.m_anRandomTable[0]; + pos = AudioManager.GetRandomNumber(0); } else { tm *pTm = localtime(&timevalue); if (pTm->tm_sec == 0) - pTm->tm_sec = AudioManager.m_anRandomTable[0]; + pTm->tm_sec = AudioManager.GetRandomNumber(0); if (pTm->tm_min == 0) - pTm->tm_min = AudioManager.m_anRandomTable[1]; + pTm->tm_min = AudioManager.GetRandomNumber(1); if (pTm->tm_hour == 0) - pTm->tm_hour = AudioManager.m_anRandomTable[2]; + pTm->tm_hour = AudioManager.GetRandomNumber(2); if (pTm->tm_mday == 0) - pTm->tm_mday = AudioManager.m_anRandomTable[3]; + pTm->tm_mday = AudioManager.GetRandomNumber(3); if (pTm->tm_mon == 0) - pTm->tm_mon = AudioManager.m_anRandomTable[4]; + pTm->tm_mon = AudioManager.GetRandomNumber(4); if (pTm->tm_year == 0) - pTm->tm_year = AudioManager.m_anRandomTable[3]; + pTm->tm_year = AudioManager.GetRandomNumber(3); if (pTm->tm_wday == 0) - pTm->tm_wday = AudioManager.m_anRandomTable[2]; + pTm->tm_wday = AudioManager.GetRandomNumber(2); pos = pTm->tm_yday * pTm->tm_wday * pTm->tm_year @@ -265,7 +265,7 @@ cMusicManager::Initialise() for (int i = 0; i < TOTAL_STREAMED_SOUNDS; i++) { m_aTracks[i].m_nLength = SampleManager.GetStreamedFileLength(i); - m_aTracks[i].m_nPosition = pos * AudioManager.m_anRandomTable[i % 5] % m_aTracks[i].m_nLength; + m_aTracks[i].m_nPosition = pos * AudioManager.GetRandomNumber(i % 5) % m_aTracks[i].m_nLength; m_aTracks[i].m_nLastPosCheckTimer = CTimer::GetTimeInMillisecondsPauseMode(); } @@ -949,7 +949,7 @@ cMusicManager::GetCarTuning() if (veh == nil) return RADIO_OFF; if (UsesPoliceRadio(veh)) return POLICE_RADIO; if (veh->m_nRadioStation == USERTRACK && !SampleManager.IsMP3RadioChannelAvailable()) - veh->m_nRadioStation = AudioManager.m_anRandomTable[2] % USERTRACK; + veh->m_nRadioStation = AudioManager.GetRandomNumber(2) % USERTRACK; return veh->m_nRadioStation; } diff --git a/src/audio/PolRadio.cpp b/src/audio/PolRadio.cpp index 9a98de35..235a53d3 100644 --- a/src/audio/PolRadio.cpp +++ b/src/audio/PolRadio.cpp @@ -106,7 +106,7 @@ cAudioManager::ResetPoliceRadio() } void -cAudioManager::SetMissionScriptPoliceAudio(int32 sfx) +cAudioManager::SetMissionScriptPoliceAudio(int32 sfx) const { if (!m_bIsInitialised) return; if (g_nMissionAudioPlayingStatus != 1) { @@ -116,7 +116,7 @@ cAudioManager::SetMissionScriptPoliceAudio(int32 sfx) } int8 -cAudioManager::GetMissionScriptPoliceAudioPlayingStatus() +cAudioManager::GetMissionScriptPoliceAudioPlayingStatus() const { return g_nMissionAudioPlayingStatus; } @@ -677,6 +677,8 @@ cAudioManager::SetupSuspectLastSeenReport() } } + + void cAudioManager::ReportCrime(eCrimeType type, const CVector &pos) { diff --git a/src/audio/sampman.h b/src/audio/sampman.h index dc95622b..d1ad9a26 100644 --- a/src/audio/sampman.h +++ b/src/audio/sampman.h @@ -259,8 +259,8 @@ static char StreamedNameTable[][25] = { "AUDIO\\door_2.OPUS", "AUDIO\\door_3.OPUS", "AUDIO\\door_4.OPUS", "AUDIO\\door_5.OPUS", "AUDIO\\door_6.OPUS", "AUDIO\\t3_a.OPUS", "AUDIO\\t3_b.OPUS", "AUDIO\\t3_c.OPUS", "AUDIO\\k1_b.OPUS", "AUDIO\\cat1.OPUS"}; #else -#ifdef PS2_AUDIO_PATHS -static char PS2StreamedNameTable[][25]= +#if defined(PS2_AUDIO_PATHS) +static char StreamedNameTable[][25]= { "AUDIO\\MUSIC\\HEAD.VB", "AUDIO\\MUSIC\\CLASS.VB", @@ -357,110 +357,7 @@ static char PS2StreamedNameTable[][25]= "AUDIO\\PHONE\\MT_PH4.VB", "AUDIO\\MUSIC\\MISCOM.VB", "AUDIO\\MUSIC\\END.VB", - "AUDIO\\lib_a1.WAV", - "AUDIO\\lib_a2.WAV", - "AUDIO\\lib_a.WAV", - "AUDIO\\lib_b.WAV", - "AUDIO\\lib_c.WAV", - "AUDIO\\lib_d.WAV", - "AUDIO\\l2_a.WAV", - "AUDIO\\j4t_1.WAV", - "AUDIO\\j4t_2.WAV", - "AUDIO\\j4t_3.WAV", - "AUDIO\\j4t_4.WAV", - "AUDIO\\j4_a.WAV", - "AUDIO\\j4_b.WAV", - "AUDIO\\j4_c.WAV", - "AUDIO\\j4_d.WAV", - "AUDIO\\j4_e.WAV", - "AUDIO\\j4_f.WAV", - "AUDIO\\j6_1.WAV", - "AUDIO\\j6_a.WAV", - "AUDIO\\j6_b.WAV", - "AUDIO\\j6_c.WAV", - "AUDIO\\j6_d.WAV", - "AUDIO\\t4_a.WAV", - "AUDIO\\s1_a.WAV", - "AUDIO\\s1_a1.WAV", - "AUDIO\\s1_b.WAV", - "AUDIO\\s1_c.WAV", - "AUDIO\\s1_c1.WAV", - "AUDIO\\s1_d.WAV", - "AUDIO\\s1_e.WAV", - "AUDIO\\s1_f.WAV", - "AUDIO\\s1_g.WAV", - "AUDIO\\s1_h.WAV", - "AUDIO\\s1_i.WAV", - "AUDIO\\s1_j.WAV", - "AUDIO\\s1_k.WAV", - "AUDIO\\s1_l.WAV", - "AUDIO\\s3_a.WAV", - "AUDIO\\s3_b.WAV", - "AUDIO\\el3_a.WAV", - "AUDIO\\mf1_a.WAV", - "AUDIO\\mf2_a.WAV", - "AUDIO\\mf3_a.WAV", - "AUDIO\\mf3_b.WAV", - "AUDIO\\mf3_b1.WAV", - "AUDIO\\mf3_c.WAV", - "AUDIO\\mf4_a.WAV", - "AUDIO\\mf4_b.WAV", - "AUDIO\\mf4_c.WAV", - "AUDIO\\a1_a.WAV", - "AUDIO\\a3_a.WAV", - "AUDIO\\a5_a.WAV", - "AUDIO\\a4_a.WAV", - "AUDIO\\a4_b.WAV", - "AUDIO\\a4_c.WAV", - "AUDIO\\a4_d.WAV", - "AUDIO\\k1_a.WAV", - "AUDIO\\k3_a.WAV", - "AUDIO\\r1_a.WAV", - "AUDIO\\r2_a.WAV", - "AUDIO\\r2_b.WAV", - "AUDIO\\r2_c.WAV", - "AUDIO\\r2_d.WAV", - "AUDIO\\r2_e.WAV", - "AUDIO\\r2_f.WAV", - "AUDIO\\r2_g.WAV", - "AUDIO\\r2_h.WAV", - "AUDIO\\r5_a.WAV", - "AUDIO\\r6_a.WAV", - "AUDIO\\r6_a1.WAV", - "AUDIO\\r6_b.WAV", - "AUDIO\\lo2_a.WAV", - "AUDIO\\lo6_a.WAV", - "AUDIO\\yd2_a.WAV", - "AUDIO\\yd2_b.WAV", - "AUDIO\\yd2_c.WAV", - "AUDIO\\yd2_c1.WAV", - "AUDIO\\yd2_d.WAV", - "AUDIO\\yd2_e.WAV", - "AUDIO\\yd2_f.WAV", - "AUDIO\\yd2_g.WAV", - "AUDIO\\yd2_h.WAV", - "AUDIO\\yd2_ass.WAV", - "AUDIO\\yd2_ok.WAV", - "AUDIO\\h5_a.WAV", - "AUDIO\\h5_b.WAV", - "AUDIO\\h5_c.WAV", - "AUDIO\\ammu_a.WAV", - "AUDIO\\ammu_b.WAV", - "AUDIO\\ammu_c.WAV", - "AUDIO\\door_1.WAV", - "AUDIO\\door_2.WAV", - "AUDIO\\door_3.WAV", - "AUDIO\\door_4.WAV", - "AUDIO\\door_5.WAV", - "AUDIO\\door_6.WAV", - "AUDIO\\t3_a.WAV", - "AUDIO\\t3_b.WAV", - "AUDIO\\t3_c.WAV", - "AUDIO\\k1_b.WAV", - "AUDIO\\cat1.WAV" -}; -#endif - +#else static char StreamedNameTable[][25] = { "AUDIO\\HEAD.WAV", @@ -558,6 +455,7 @@ static char StreamedNameTable[][25] = "AUDIO\\MT_PH4.MP3", "AUDIO\\MISCOM.WAV", "AUDIO\\END.MP3", +#endif "AUDIO\\lib_a1.WAV", "AUDIO\\lib_a2.WAV", "AUDIO\\lib_a.WAV", diff --git a/src/audio/sampman_miles.cpp b/src/audio/sampman_miles.cpp index 7c40d15d..e820864c 100644 --- a/src/audio/sampman_miles.cpp +++ b/src/audio/sampman_miles.cpp @@ -992,20 +992,11 @@ cSampleManager::Initialise(void) if ( GetDriveType(m_szCDRomRootPath) == DRIVE_CDROM ) { - FILE *f; -#ifdef PS2_AUDIO_PATHS strcpy(filepath, m_szCDRomRootPath); - strcat(filepath, PS2StreamedNameTable[0]); - f = fopen(filepath, "rb"); - - if ( !f ) -#endif - { - strcpy(filepath, m_szCDRomRootPath); - strcat(filepath, StreamedNameTable[0]); + strcat(filepath, StreamedNameTable[0]); + + FILE *f = fopen(filepath, "rb"); - f = fopen(filepath, "rb"); - } if ( f ) { fclose(f); @@ -1014,20 +1005,11 @@ cSampleManager::Initialise(void) for ( int32 i = 0; i < TOTAL_STREAMED_SOUNDS; i++ ) { -#ifdef PS2_AUDIO_PATHS strcpy(filepath, m_szCDRomRootPath); - strcat(filepath, PS2StreamedNameTable[i]); - + strcat(filepath, StreamedNameTable[i]); + mp3Stream[0] = AIL_open_stream(DIG, filepath, 0); - if ( !mp3Stream[0] ) -#endif - { - strcpy(filepath, m_szCDRomRootPath); - strcat(filepath, StreamedNameTable[i]); - - mp3Stream[0] = AIL_open_stream(DIG, filepath, 0); - } - + if ( mp3Stream[0] ) { AIL_stream_ms_position(mp3Stream[0], &tatalms, NULL); @@ -1096,14 +1078,7 @@ cSampleManager::Initialise(void) strcpy(_aHDDPath, m_szCDRomRootPath); rootpath[0] = '\0'; - FILE *f; - -#ifdef PS2_AUDIO_PATHS - f = fopen(PS2StreamedNameTable[0], "rb"); - if (!f) -#endif - - f = fopen(StreamedNameTable[0], "rb"); + FILE *f = fopen(StreamedNameTable[0], "rb"); if ( f ) { @@ -1111,20 +1086,11 @@ cSampleManager::Initialise(void) for ( int32 i = 0; i < TOTAL_STREAMED_SOUNDS; i++ ) { -#ifdef PS2_AUDIO_PATHS strcpy(filepath, rootpath); - strcat(filepath, PS2StreamedNameTable[i]); - + strcat(filepath, StreamedNameTable[i]); + mp3Stream[0] = AIL_open_stream(DIG, filepath, 0); - if ( !mp3Stream[0] ) -#endif - { - strcpy(filepath, rootpath); - strcat(filepath, StreamedNameTable[i]); - - mp3Stream[0] = AIL_open_stream(DIG, filepath, 0); - } - + if ( mp3Stream[0] ) { AIL_stream_ms_position(mp3Stream[0], &tatalms, NULL); @@ -1245,7 +1211,7 @@ cSampleManager::Initialise(void) int32 randval; if ( bUseRandomTable ) - randval = AudioManager.m_anRandomTable[1]; + randval = AudioManager.GetRandomNumber(1); else randval = localtm->tm_sec * localtm->tm_min; @@ -1256,7 +1222,7 @@ cSampleManager::Initialise(void) randmp3 = randmp3->pNext; if ( bUseRandomTable ) - _CurMP3Pos = AudioManager.m_anRandomTable[0] % randmp3->nTrackLength; + _CurMP3Pos = AudioManager.GetRandomNumber(0) % randmp3->nTrackLength; else { if ( localtm->tm_sec > 0 ) @@ -1265,7 +1231,7 @@ cSampleManager::Initialise(void) _CurMP3Pos = s*s*s*s*s*s*s*s % randmp3->nTrackLength; } else - _CurMP3Pos = AudioManager.m_anRandomTable[0] % randmp3->nTrackLength; + _CurMP3Pos = AudioManager.GetRandomNumber(0) % randmp3->nTrackLength; } } else @@ -1333,11 +1299,9 @@ cSampleManager::CheckForAnAudioFileOnCD(void) { #if GTA_VERSION < GTA3_PC_STEAM && !defined(NO_CDCHECK) char filepath[MAX_PATH]; - FILE *f; -#ifdef PS2_AUDIO_PATHS #if GTA_VERSION >= GTA3_PC_11 - if(_bUseHDDAudio) + if (_bUseHDDAudio) strcpy(filepath, _aHDDPath); else strcpy(filepath, m_szCDRomRootPath); @@ -1345,25 +1309,10 @@ cSampleManager::CheckForAnAudioFileOnCD(void) strcpy(filepath, m_szCDRomRootPath); #endif // #if GTA_VERSION >= GTA3_PC_11 - strcat(filepath, PS2StreamedNameTable[AudioManager.m_anRandomTable[1] % TOTAL_STREAMED_SOUNDS]); - - f = fopen(filepath, "rb"); - if ( !f ) -#endif // PS2_AUDIO_PATHS - { -#if GTA_VERSION >= GTA3_PC_11 - if (_bUseHDDAudio) - strcpy(filepath, _aHDDPath); - else - strcpy(filepath, m_szCDRomRootPath); -#else - strcpy(filepath, m_szCDRomRootPath); -#endif // #if GTA_VERSION >= GTA3_PC_11 - - strcat(filepath, StreamedNameTable[AudioManager.m_anRandomTable[1] % TOTAL_STREAMED_SOUNDS]); + strcat(filepath, StreamedNameTable[AudioManager.GetRandomNumber(1) % TOTAL_STREAMED_SOUNDS]); + + FILE *f = fopen(filepath, "rb"); - f = fopen(filepath, "rb"); - } if ( f ) { fclose(f); @@ -1631,12 +1580,12 @@ cSampleManager::UpdateReverb(void) if ( !usingEAX ) return FALSE; - if ( AudioManager.m_FrameCounter & 15 ) + if ( AudioManager.GetFrameCounter() & 15 ) return FALSE; - float y = AudioManager.m_afReflectionsDistances[REFLECTION_TOP] + AudioManager.m_afReflectionsDistances[REFLECTION_BOTTOM]; - float x = AudioManager.m_afReflectionsDistances[REFLECTION_LEFT] + AudioManager.m_afReflectionsDistances[REFLECTION_RIGHT]; - float z = AudioManager.m_afReflectionsDistances[REFLECTION_UP]; + float y = AudioManager.GetReflectionsDistance(REFLECTION_TOP) + AudioManager.GetReflectionsDistance(REFLECTION_BOTTOM); + float x = AudioManager.GetReflectionsDistance(REFLECTION_LEFT) + AudioManager.GetReflectionsDistance(REFLECTION_RIGHT); + float z = AudioManager.GetReflectionsDistance(REFLECTION_UP); float normy = norm(y, 5.0f, 40.0f); float normx = norm(x, 5.0f, 40.0f); @@ -2058,19 +2007,11 @@ cSampleManager::PreloadStreamedFile(uint8 nFile, uint8 nStream) } char filepath[MAX_PATH]; -#ifdef PS2_AUDIO_PATHS + strcpy(filepath, m_szCDRomRootPath); - strcat(filepath, PS2StreamedNameTable[nFile]); - + strcat(filepath, StreamedNameTable[nFile]); + mp3Stream[nStream] = AIL_open_stream(DIG, filepath, 0); - if ( !mp3Stream[nStream] ) -#endif - { - strcpy(filepath, m_szCDRomRootPath); - strcat(filepath, StreamedNameTable[nFile]); - - mp3Stream[nStream] = AIL_open_stream(DIG, filepath, 0); - } if ( mp3Stream[nStream] ) { @@ -2132,19 +2073,10 @@ cSampleManager::StartStreamedFile(uint8 nFile, uint32 nPos, uint8 nStream) // Try to continue from previous song, if already started if(!_GetMP3PosFromStreamPos(&position, &e) && !e) { nFile = 0; -#ifdef PS2_AUDIO_PATHS strcpy(filename, m_szCDRomRootPath); - strcat(filename, PS2StreamedNameTable[nFile]); - - mp3Stream[nStream] = AIL_open_stream(DIG, filename, 0); - if ( !mp3Stream[nStream] ) -#endif - { - strcpy(filename, m_szCDRomRootPath); - strcat(filename, StreamedNameTable[nFile]); + strcat(filename, StreamedNameTable[nFile]); - mp3Stream[nStream] = AIL_open_stream(DIG, filename, 0); - } + mp3Stream[nStream] = AIL_open_stream(DIG, filename, 0); if ( mp3Stream[nStream] ) { AIL_set_stream_loop_count(mp3Stream[nStream], 1); @@ -2188,19 +2120,10 @@ cSampleManager::StartStreamedFile(uint8 nFile, uint32 nPos, uint8 nStream) { nFile = 0; _bIsMp3Active = 0; -#ifdef PS2_AUDIO_PATHS strcpy(filename, m_szCDRomRootPath); - strcat(filename, PS2StreamedNameTable[nFile]); - - mp3Stream[nStream] = AIL_open_stream(DIG, filename, 0); - if ( !mp3Stream[nStream] ) -#endif - { - strcpy(filename, m_szCDRomRootPath); - strcat(filename, StreamedNameTable[nFile]); + strcat(filename, StreamedNameTable[nFile]); - mp3Stream[nStream] = AIL_open_stream(DIG, filename, 0); - } + mp3Stream[nStream] = AIL_open_stream(DIG, filename, 0); if ( mp3Stream[nStream] ) { AIL_set_stream_loop_count(mp3Stream[nStream], 1); @@ -2238,19 +2161,10 @@ cSampleManager::StartStreamedFile(uint8 nFile, uint32 nPos, uint8 nStream) position = 0; nFile = 0; } -#ifdef PS2_AUDIO_PATHS strcpy(filename, m_szCDRomRootPath); - strcat(filename, PS2StreamedNameTable[nFile]); - - mp3Stream[nStream] = AIL_open_stream(DIG, filename, 0); - if ( !mp3Stream[nStream] ) -#endif - { - strcpy(filename, m_szCDRomRootPath); - strcat(filename, StreamedNameTable[nFile]); + strcat(filename, StreamedNameTable[nFile]); - mp3Stream[nStream] = AIL_open_stream(DIG, filename, 0); - } + mp3Stream[nStream] = AIL_open_stream(DIG, filename, 0); if ( mp3Stream[nStream] ) { AIL_set_stream_loop_count(mp3Stream[nStream], 1); diff --git a/src/audio/sampman_oal.cpp b/src/audio/sampman_oal.cpp index 74b352a1..fdd449f7 100644 --- a/src/audio/sampman_oal.cpp +++ b/src/audio/sampman_oal.cpp @@ -894,11 +894,7 @@ cSampleManager::Initialise(void) for ( int32 i = 0; i < TOTAL_STREAMED_SOUNDS; i++ ) { - if(aStream[0] && ( -#ifdef PS2_AUDIO_PATHS - aStream[0]->Open(PS2StreamedNameTable[i], IsThisTrackAt16KHz(i) ? 16000 : 32000) || -#endif - aStream[0]->Open(StreamedNameTable[i], IsThisTrackAt16KHz(i) ? 16000 : 32000))) + if ( aStream[0] && aStream[0]->Open(StreamedNameTable[i], IsThisTrackAt16KHz(i) ? 16000 : 32000) ) { uint32 tatalms = aStream[0]->GetLengthMS(); aStream[0]->Close(); @@ -995,7 +991,7 @@ cSampleManager::Initialise(void) int32 randval; if ( bUseRandomTable ) - randval = AudioManager.m_anRandomTable[1]; + randval = AudioManager.GetRandomNumber(1); else randval = localtm->tm_sec * localtm->tm_min; @@ -1006,7 +1002,7 @@ cSampleManager::Initialise(void) randmp3 = randmp3->pNext; if ( bUseRandomTable ) - _CurMP3Pos = AudioManager.m_anRandomTable[0] % randmp3->nTrackLength; + _CurMP3Pos = AudioManager.GetRandomNumber(0) % randmp3->nTrackLength; else { if ( localtm->tm_sec > 0 ) @@ -1015,7 +1011,7 @@ cSampleManager::Initialise(void) _CurMP3Pos = s*s*s*s*s*s*s*s % randmp3->nTrackLength; } else - _CurMP3Pos = AudioManager.m_anRandomTable[0] % randmp3->nTrackLength; + _CurMP3Pos = AudioManager.GetRandomNumber(0) % randmp3->nTrackLength; } } else @@ -1363,9 +1359,9 @@ bool8 cSampleManager::UpdateReverb(void) if ( AudioManager.GetFrameCounter() & 15 ) return FALSE; - float y = AudioManager.m_afReflectionsDistances[REFLECTION_TOP] + AudioManager.m_afReflectionsDistances[REFLECTION_BOTTOM]; - float x = AudioManager.m_afReflectionsDistances[REFLECTION_LEFT] + AudioManager.m_afReflectionsDistances[REFLECTION_RIGHT]; - float z = AudioManager.m_afReflectionsDistances[REFLECTION_UP]; + float y = AudioManager.GetReflectionsDistance(REFLECTION_TOP) + AudioManager.GetReflectionsDistance(REFLECTION_BOTTOM); + float x = AudioManager.GetReflectionsDistance(REFLECTION_LEFT) + AudioManager.GetReflectionsDistance(REFLECTION_RIGHT); + float z = AudioManager.GetReflectionsDistance(REFLECTION_UP); float normy = norm(y, 5.0f, 40.0f); float normx = norm(x, 5.0f, 40.0f); @@ -1605,6 +1601,8 @@ cSampleManager::StopChannel(uint32 nChannel) void cSampleManager::PreloadStreamedFile(uint8 nFile, uint8 nStream) { + char filename[MAX_PATH]; + ASSERT( nStream < MAX_STREAMS ); if ( nFile < TOTAL_STREAMED_SOUNDS ) @@ -1613,10 +1611,9 @@ cSampleManager::PreloadStreamedFile(uint8 nFile, uint8 nStream) stream->Close(); -#ifdef PS2_AUDIO_PATHS - if(!stream->Open(PS2StreamedNameTable[nFile], IsThisTrackAt16KHz(nFile) ? 16000 : 32000)) -#endif - stream->Open(StreamedNameTable[nFile], IsThisTrackAt16KHz(nFile) ? 16000 : 32000); + strcpy(filename, StreamedNameTable[nFile]); + + stream->Open(filename, IsThisTrackAt16KHz(nFile) ? 16000 : 32000); if ( !stream->Setup() ) { stream->Close(); @@ -1676,11 +1673,10 @@ cSampleManager::StartStreamedFile(uint8 nFile, uint32 nPos, uint8 nStream) // Try to continue from previous song, if already started if(!_GetMP3PosFromStreamPos(&position, &e) && !e) { nFile = 0; + strcpy(filename, StreamedNameTable[nFile]); + CStream *stream = aStream[nStream]; -#ifdef PS2_AUDIO_PATHS - if(!stream->Open(PS2StreamedNameTable[nFile], IsThisTrackAt16KHz(nFile) ? 16000 : 32000)) -#endif - stream->Open(StreamedNameTable[nFile], IsThisTrackAt16KHz(nFile) ? 16000 : 32000); + stream->Open(filename, IsThisTrackAt16KHz(nFile) ? 16000 : 32000); if ( stream->Setup() ) { if (position != 0) stream->SetPosMS(position); @@ -1729,11 +1725,10 @@ cSampleManager::StartStreamedFile(uint8 nFile, uint32 nPos, uint8 nStream) { nFile = 0; _bIsMp3Active = 0; - CStream *stream = aStream[nStream]; -#ifdef PS2_AUDIO_PATHS - if(!stream->Open(PS2StreamedNameTable[nFile], IsThisTrackAt16KHz(nFile) ? 16000 : 32000)) -#endif - stream->Open(StreamedNameTable[nFile], IsThisTrackAt16KHz(nFile) ? 16000 : 32000); + strcpy(filename, StreamedNameTable[nFile]); + + CStream* stream = aStream[nStream]; + stream->Open(filename, IsThisTrackAt16KHz(nFile) ? 16000 : 32000); if (stream->Setup()) { if (position != 0) @@ -1773,11 +1768,11 @@ cSampleManager::StartStreamedFile(uint8 nFile, uint32 nPos, uint8 nStream) position = 0; nFile = 0; } + strcpy(filename, StreamedNameTable[nFile]); + CStream *stream = aStream[nStream]; -#ifdef PS2_AUDIO_PATHS - if(!stream->Open(PS2StreamedNameTable[nFile], IsThisTrackAt16KHz(nFile) ? 16000 : 32000)) -#endif - stream->Open(StreamedNameTable[nFile], IsThisTrackAt16KHz(nFile) ? 16000 : 32000); + + aStream[nStream]->Open(filename, IsThisTrackAt16KHz(nFile) ? 16000 : 32000); if ( stream->Setup() ) { if (position != 0) diff --git a/src/control/Garages.cpp b/src/control/Garages.cpp index 245e961d..91971ae7 100644 --- a/src/control/Garages.cpp +++ b/src/control/Garages.cpp @@ -2305,9 +2305,6 @@ void CGarages::Save(uint8 * buf, uint32 * size) *size = (6 * sizeof(uint32) + TOTAL_COLLECTCARS_GARAGES * sizeof(*CarTypesCollected) + sizeof(uint32) + 3 * NUM_GARAGE_STORED_CARS * sizeof(CStoredCar) + NUM_GARAGES * sizeof(CGarage)); #else * size = 5484; -#endif -#if !defined THIS_IS_STUPID && !defined FIX_GARAGE_SIZE && defined COMPATIBLE_SAVES - memset(buf + 5240, 0, *size - 5240); // garbage data is written otherwise #endif CloseHideOutGaragesBeforeSave(); WriteSaveBuf(buf, NumGarages); diff --git a/src/control/Script.cpp b/src/control/Script.cpp index b07c0701..e06acdc3 100644 --- a/src/control/Script.cpp +++ b/src/control/Script.cpp @@ -1771,12 +1771,20 @@ int scriptToLoad = 0; int open_script() { + // glfwGetKey doesn't work because of CGame::Initialise is blocking + CPad::UpdatePads(); + if (CPad::GetPad(0)->GetChar('G')) + scriptToLoad = 0; + if (CPad::GetPad(0)->GetChar('R')) + scriptToLoad = 1; + if (CPad::GetPad(0)->GetChar('D')) + scriptToLoad = 2; switch (scriptToLoad) { - case 0: return CFileMgr::OpenFile("data\\main.scm", "rb"); - case 1: return CFileMgr::OpenFile("data\\main_freeroam.scm", "rb"); - case 2: return CFileMgr::OpenFile("data\\main_d.scm", "rb"); + case 0: return CFileMgr::OpenFile("main.scm", "rb"); + case 1: return CFileMgr::OpenFile("main_freeroam.scm", "rb"); + case 2: return CFileMgr::OpenFile("main_d.scm", "rb"); } - return CFileMgr::OpenFile("data\\main.scm", "rb"); + return CFileMgr::OpenFile("main.scm", "rb"); } #endif @@ -1792,16 +1800,10 @@ void CTheScripts::Init() MissionCleanUp.Init(); UpsideDownCars.Init(); StuckCars.Init(); + CFileMgr::SetDir("data"); #ifdef USE_DEBUG_SCRIPT_LOADER - // glfwGetKey doesn't work because of CGame::Initialise is blocking - CPad::UpdatePads(); - if(CPad::GetPad(0)->GetChar('G')) scriptToLoad = 0; - if(CPad::GetPad(0)->GetChar('R')) scriptToLoad = 1; - if(CPad::GetPad(0)->GetChar('D')) scriptToLoad = 2; - int mainf = open_script(); #else - CFileMgr::SetDir("data"); int mainf = CFileMgr::OpenFile("main.scm", "rb"); #endif CFileMgr::Read(mainf, (char*)ScriptSpace, SIZE_MAIN_SCRIPT); @@ -4390,11 +4392,7 @@ CTheScripts::SwitchToMission(int32 mission) CTimer::Suspend(); int offset = CTheScripts::MultiScriptArray[mission]; CFileMgr::ChangeDir("\\"); -#ifdef USE_DEBUG_SCRIPT_LOADER - int handle = open_script(); -#else int handle = CFileMgr::OpenFile("data\\main.scm", "rb"); -#endif CFileMgr::Seek(handle, offset, 0); CFileMgr::Read(handle, (const char*)&CTheScripts::ScriptSpace[SIZE_MAIN_SCRIPT], SIZE_MISSION_SCRIPT); CFileMgr::CloseFile(handle); diff --git a/src/control/Script.h b/src/control/Script.h index cefd6747..5682024b 100644 --- a/src/control/Script.h +++ b/src/control/Script.h @@ -591,6 +591,5 @@ void RetryMission(int, int); #endif #ifdef USE_DEBUG_SCRIPT_LOADER -int open_script(); extern int scriptToLoad; #endif \ No newline at end of file diff --git a/src/control/Script6.cpp b/src/control/Script6.cpp index c9b2b070..31be6987 100644 --- a/src/control/Script6.cpp +++ b/src/control/Script6.cpp @@ -305,11 +305,7 @@ int8 CRunningScript::ProcessCommands1000To1099(int32 command) CTimer::Suspend(); int offset = CTheScripts::MultiScriptArray[ScriptParams[0]]; CFileMgr::ChangeDir("\\"); -#ifdef USE_DEBUG_SCRIPT_LOADER - int handle = open_script(); -#else int handle = CFileMgr::OpenFile("data\\main.scm", "rb"); -#endif CFileMgr::Seek(handle, offset, 0); CFileMgr::Read(handle, (const char*)&CTheScripts::ScriptSpace[SIZE_MAIN_SCRIPT], SIZE_MISSION_SCRIPT); CFileMgr::CloseFile(handle); diff --git a/src/core/Fire.cpp b/src/core/Fire.cpp index 8b184622..984b21bb 100644 --- a/src/core/Fire.cpp +++ b/src/core/Fire.cpp @@ -396,7 +396,7 @@ CFireManager::StartScriptFire(const CVector &pos, CEntity *target, float strengt if (target) { if (target->IsPed()) { ped->m_pFire = fire; - if (target != FindPlayerPed()) { + if (target != (CVehicle *)FindPlayerPed()) { CVector2D pos = target->GetPosition(); ped->SetFlee(pos, 10000); ped->SetMoveAnim(); diff --git a/src/core/config.h b/src/core/config.h index f0960e44..885f98b8 100644 --- a/src/core/config.h +++ b/src/core/config.h @@ -259,7 +259,7 @@ enum Config { #define FIX_BUGS // fixes bugs that we've came across during reversing. You can undefine this only on release builds. #define MORE_LANGUAGES // Add more translations to the game -#define COMPATIBLE_SAVES // this allows changing structs while keeping saves compatible, and keeps saves compatible between platforms, needs to be enabled on 64bit builds! +#define COMPATIBLE_SAVES // this allows changing structs while keeping saves compatible, and keeps saves compatible between platforms #define FIX_INCOMPATIBLE_SAVES // try to fix incompatible saves, requires COMPATIBLE_SAVES #define LOAD_INI_SETTINGS // as the name suggests. fundamental for CUSTOM_FRONTEND_OPTIONS @@ -420,7 +420,7 @@ enum Config { #define RADIO_SCROLL_TO_PREV_STATION #define AUDIO_CACHE #define PS2_AUDIO_CHANNELS // increases the maximum number of audio channels to PS2 value of 44 (PC has 28 originally) -#define PS2_AUDIO_PATHS // changes audio paths for cutscenes and radio to PS2 paths (needs vbdec on MSS builds) +//#define PS2_AUDIO_PATHS // changes audio paths for cutscenes and radio to PS2 paths (needs vbdec on MSS builds) //#define AUDIO_OAL_USE_SNDFILE // use libsndfile to decode WAVs instead of our internal decoder #define AUDIO_OAL_USE_MPG123 // use mpg123 to support mp3 files #define PAUSE_RADIO_IN_FRONTEND // pause radio when game is paused diff --git a/src/peds/Ped.cpp b/src/peds/Ped.cpp index 8d0fbbe8..5b52d021 100644 --- a/src/peds/Ped.cpp +++ b/src/peds/Ped.cpp @@ -326,7 +326,6 @@ CPed::~CPed(void) nearPed->m_nearPeds[k] = nearPed->m_nearPeds[k + 1]; nearPed->m_nearPeds[k + 1] = nil; } - nearPed->m_nearPeds[ARRAY_SIZE(m_nearPeds) - 1] = nil; nearPed->m_numNearPeds--; } else j++; @@ -2474,12 +2473,12 @@ CPed::ProcessControl(void) obstacleForFlyingOtherDirZ = 501.0f; } #ifdef VC_PED_PORTS - int16 flyDir = 0; + uint8 flyDir = 0; float feetZ = GetPosition().z - FEET_OFFSET; #ifdef FIX_BUGS - if (obstacleForFlyingZ > feetZ && obstacleForFlyingZ < 500.0f) + if (obstacleForFlyingZ > feetZ && obstacleForFlyingOtherDirZ < 501.0f) flyDir = 1; - else if (obstacleForFlyingOtherDirZ > feetZ && obstacleForFlyingOtherDirZ < 501.0f) + else if (obstacleForFlyingOtherDirZ > feetZ && obstacleForFlyingZ < 500.0f) flyDir = 2; #else if ((obstacleForFlyingZ > feetZ && obstacleForFlyingOtherDirZ < 500.0f) || (obstacleForFlyingZ > feetZ && obstacleForFlyingOtherDirZ > feetZ)) @@ -2488,8 +2487,8 @@ CPed::ProcessControl(void) flyDir = 2; #endif - if (flyDir > 0 && !bSomeVCflag1) { - GetMatrix().SetTranslateOnly((flyDir == 2 ? obstacleForFlyingOtherDir.point : obstacleForFlying.point)); + if (flyDir != 0 && !bSomeVCflag1) { + SetPosition((flyDir == 2 ? obstacleForFlyingOtherDir.point : obstacleForFlying.point)); GetMatrix().GetPosition().z += FEET_OFFSET; GetMatrix().UpdateRW(); SetLanding(); @@ -3188,7 +3187,7 @@ CPed::ProcessEntityCollision(CEntity *collidingEnt, CColPoint *collidingPoints) lowerSpeedLimit *= 1.5f; } CAnimBlendAssociation *fallAnim = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_FALL); - if (!bWasStanding && ((speed > upperSpeedLimit /* ||!bPushedAlongByCar*/) || (m_vecMoveSpeed.z < lowerSpeedLimit)) + if (!bWasStanding && speed > upperSpeedLimit && (/*!bPushedAlongByCar ||*/ m_vecMoveSpeed.z < lowerSpeedLimit) && m_pCollidingEntity != collidingEnt) { float damage = 100.0f * Max(speed - 0.25f, 0.0f); diff --git a/src/peds/PedFight.cpp b/src/peds/PedFight.cpp index 13d3930c..46ac369c 100644 --- a/src/peds/PedFight.cpp +++ b/src/peds/PedFight.cpp @@ -320,14 +320,6 @@ CPed::SetAttack(CEntity *victim) ((CPlayerPed*)this)->m_fFPSMoveHeading = TheCamera.Find3rdPersonQuickAimPitch(); } } -#ifdef FIX_BUGS - // fix aiming for flamethrower while using PC controls - else if (GetWeapon()->m_eWeaponType == WEAPONTYPE_FLAMETHROWER && TheCamera.Cams[0].Using3rdPersonMouseCam() && this == FindPlayerPed()) - { - SetAimFlag(m_fRotationCur); - ((CPlayerPed*)this)->m_fFPSMoveHeading = TheCamera.Find3rdPersonQuickAimPitch(); - } -#endif if (m_nPedState == PED_ATTACK) { bIsAttacking = true; return; diff --git a/src/renderer/2dEffect.h b/src/render/2dEffect.h similarity index 100% rename from src/renderer/2dEffect.h rename to src/render/2dEffect.h diff --git a/src/renderer/Antennas.cpp b/src/render/Antennas.cpp similarity index 100% rename from src/renderer/Antennas.cpp rename to src/render/Antennas.cpp diff --git a/src/renderer/Antennas.h b/src/render/Antennas.h similarity index 100% rename from src/renderer/Antennas.h rename to src/render/Antennas.h diff --git a/src/renderer/Clouds.cpp b/src/render/Clouds.cpp similarity index 100% rename from src/renderer/Clouds.cpp rename to src/render/Clouds.cpp diff --git a/src/renderer/Clouds.h b/src/render/Clouds.h similarity index 100% rename from src/renderer/Clouds.h rename to src/render/Clouds.h diff --git a/src/renderer/Console.cpp b/src/render/Console.cpp similarity index 100% rename from src/renderer/Console.cpp rename to src/render/Console.cpp diff --git a/src/renderer/Console.h b/src/render/Console.h similarity index 100% rename from src/renderer/Console.h rename to src/render/Console.h diff --git a/src/renderer/Coronas.cpp b/src/render/Coronas.cpp similarity index 100% rename from src/renderer/Coronas.cpp rename to src/render/Coronas.cpp diff --git a/src/renderer/Coronas.h b/src/render/Coronas.h similarity index 100% rename from src/renderer/Coronas.h rename to src/render/Coronas.h diff --git a/src/renderer/Credits.cpp b/src/render/Credits.cpp similarity index 100% rename from src/renderer/Credits.cpp rename to src/render/Credits.cpp diff --git a/src/renderer/Credits.h b/src/render/Credits.h similarity index 100% rename from src/renderer/Credits.h rename to src/render/Credits.h diff --git a/src/renderer/Draw.cpp b/src/render/Draw.cpp similarity index 100% rename from src/renderer/Draw.cpp rename to src/render/Draw.cpp diff --git a/src/renderer/Draw.h b/src/render/Draw.h similarity index 100% rename from src/renderer/Draw.h rename to src/render/Draw.h diff --git a/src/renderer/Fluff.cpp b/src/render/Fluff.cpp similarity index 100% rename from src/renderer/Fluff.cpp rename to src/render/Fluff.cpp diff --git a/src/renderer/Fluff.h b/src/render/Fluff.h similarity index 100% rename from src/renderer/Fluff.h rename to src/render/Fluff.h diff --git a/src/renderer/Font.cpp b/src/render/Font.cpp similarity index 100% rename from src/renderer/Font.cpp rename to src/render/Font.cpp diff --git a/src/renderer/Font.h b/src/render/Font.h similarity index 100% rename from src/renderer/Font.h rename to src/render/Font.h diff --git a/src/renderer/Glass.cpp b/src/render/Glass.cpp similarity index 100% rename from src/renderer/Glass.cpp rename to src/render/Glass.cpp diff --git a/src/renderer/Glass.h b/src/render/Glass.h similarity index 100% rename from src/renderer/Glass.h rename to src/render/Glass.h diff --git a/src/renderer/Hud.cpp b/src/render/Hud.cpp similarity index 100% rename from src/renderer/Hud.cpp rename to src/render/Hud.cpp diff --git a/src/renderer/Hud.h b/src/render/Hud.h similarity index 100% rename from src/renderer/Hud.h rename to src/render/Hud.h diff --git a/src/renderer/Instance.cpp b/src/render/Instance.cpp similarity index 100% rename from src/renderer/Instance.cpp rename to src/render/Instance.cpp diff --git a/src/renderer/Instance.h b/src/render/Instance.h similarity index 100% rename from src/renderer/Instance.h rename to src/render/Instance.h diff --git a/src/renderer/Lines.cpp b/src/render/Lines.cpp similarity index 100% rename from src/renderer/Lines.cpp rename to src/render/Lines.cpp diff --git a/src/renderer/Lines.h b/src/render/Lines.h similarity index 100% rename from src/renderer/Lines.h rename to src/render/Lines.h diff --git a/src/renderer/MBlur.cpp b/src/render/MBlur.cpp similarity index 100% rename from src/renderer/MBlur.cpp rename to src/render/MBlur.cpp diff --git a/src/renderer/MBlur.h b/src/render/MBlur.h similarity index 100% rename from src/renderer/MBlur.h rename to src/render/MBlur.h diff --git a/src/renderer/Particle.cpp b/src/render/Particle.cpp similarity index 100% rename from src/renderer/Particle.cpp rename to src/render/Particle.cpp diff --git a/src/renderer/Particle.h b/src/render/Particle.h similarity index 100% rename from src/renderer/Particle.h rename to src/render/Particle.h diff --git a/src/renderer/ParticleMgr.cpp b/src/render/ParticleMgr.cpp similarity index 100% rename from src/renderer/ParticleMgr.cpp rename to src/render/ParticleMgr.cpp diff --git a/src/renderer/ParticleMgr.h b/src/render/ParticleMgr.h similarity index 100% rename from src/renderer/ParticleMgr.h rename to src/render/ParticleMgr.h diff --git a/src/renderer/ParticleType.h b/src/render/ParticleType.h similarity index 100% rename from src/renderer/ParticleType.h rename to src/render/ParticleType.h diff --git a/src/renderer/PlayerSkin.cpp b/src/render/PlayerSkin.cpp similarity index 100% rename from src/renderer/PlayerSkin.cpp rename to src/render/PlayerSkin.cpp diff --git a/src/renderer/PlayerSkin.h b/src/render/PlayerSkin.h similarity index 100% rename from src/renderer/PlayerSkin.h rename to src/render/PlayerSkin.h diff --git a/src/renderer/PointLights.cpp b/src/render/PointLights.cpp similarity index 100% rename from src/renderer/PointLights.cpp rename to src/render/PointLights.cpp diff --git a/src/renderer/PointLights.h b/src/render/PointLights.h similarity index 100% rename from src/renderer/PointLights.h rename to src/render/PointLights.h diff --git a/src/renderer/RenderBuffer.cpp b/src/render/RenderBuffer.cpp similarity index 100% rename from src/renderer/RenderBuffer.cpp rename to src/render/RenderBuffer.cpp diff --git a/src/renderer/RenderBuffer.h b/src/render/RenderBuffer.h similarity index 100% rename from src/renderer/RenderBuffer.h rename to src/render/RenderBuffer.h diff --git a/src/renderer/Renderer.cpp b/src/render/Renderer.cpp similarity index 100% rename from src/renderer/Renderer.cpp rename to src/render/Renderer.cpp diff --git a/src/renderer/Renderer.h b/src/render/Renderer.h similarity index 100% rename from src/renderer/Renderer.h rename to src/render/Renderer.h diff --git a/src/renderer/Rubbish.cpp b/src/render/Rubbish.cpp similarity index 100% rename from src/renderer/Rubbish.cpp rename to src/render/Rubbish.cpp diff --git a/src/renderer/Rubbish.h b/src/render/Rubbish.h similarity index 100% rename from src/renderer/Rubbish.h rename to src/render/Rubbish.h diff --git a/src/renderer/Shadows.cpp b/src/render/Shadows.cpp similarity index 100% rename from src/renderer/Shadows.cpp rename to src/render/Shadows.cpp diff --git a/src/renderer/Shadows.h b/src/render/Shadows.h similarity index 100% rename from src/renderer/Shadows.h rename to src/render/Shadows.h diff --git a/src/renderer/Skidmarks.cpp b/src/render/Skidmarks.cpp similarity index 100% rename from src/renderer/Skidmarks.cpp rename to src/render/Skidmarks.cpp diff --git a/src/renderer/Skidmarks.h b/src/render/Skidmarks.h similarity index 100% rename from src/renderer/Skidmarks.h rename to src/render/Skidmarks.h diff --git a/src/renderer/SpecialFX.cpp b/src/render/SpecialFX.cpp similarity index 100% rename from src/renderer/SpecialFX.cpp rename to src/render/SpecialFX.cpp diff --git a/src/renderer/SpecialFX.h b/src/render/SpecialFX.h similarity index 100% rename from src/renderer/SpecialFX.h rename to src/render/SpecialFX.h diff --git a/src/renderer/Sprite.cpp b/src/render/Sprite.cpp similarity index 100% rename from src/renderer/Sprite.cpp rename to src/render/Sprite.cpp diff --git a/src/renderer/Sprite.h b/src/render/Sprite.h similarity index 100% rename from src/renderer/Sprite.h rename to src/render/Sprite.h diff --git a/src/renderer/Sprite2d.cpp b/src/render/Sprite2d.cpp similarity index 100% rename from src/renderer/Sprite2d.cpp rename to src/render/Sprite2d.cpp diff --git a/src/renderer/Sprite2d.h b/src/render/Sprite2d.h similarity index 100% rename from src/renderer/Sprite2d.h rename to src/render/Sprite2d.h diff --git a/src/renderer/TexList.cpp b/src/render/TexList.cpp similarity index 100% rename from src/renderer/TexList.cpp rename to src/render/TexList.cpp diff --git a/src/renderer/TexList.h b/src/render/TexList.h similarity index 100% rename from src/renderer/TexList.h rename to src/render/TexList.h diff --git a/src/renderer/Timecycle.cpp b/src/render/Timecycle.cpp similarity index 100% rename from src/renderer/Timecycle.cpp rename to src/render/Timecycle.cpp diff --git a/src/renderer/Timecycle.h b/src/render/Timecycle.h similarity index 100% rename from src/renderer/Timecycle.h rename to src/render/Timecycle.h diff --git a/src/renderer/WaterCannon.cpp b/src/render/WaterCannon.cpp similarity index 100% rename from src/renderer/WaterCannon.cpp rename to src/render/WaterCannon.cpp diff --git a/src/renderer/WaterCannon.h b/src/render/WaterCannon.h similarity index 100% rename from src/renderer/WaterCannon.h rename to src/render/WaterCannon.h diff --git a/src/renderer/WaterLevel.cpp b/src/render/WaterLevel.cpp similarity index 100% rename from src/renderer/WaterLevel.cpp rename to src/render/WaterLevel.cpp diff --git a/src/renderer/WaterLevel.h b/src/render/WaterLevel.h similarity index 100% rename from src/renderer/WaterLevel.h rename to src/render/WaterLevel.h diff --git a/src/renderer/Weather.cpp b/src/render/Weather.cpp similarity index 100% rename from src/renderer/Weather.cpp rename to src/render/Weather.cpp diff --git a/src/renderer/Weather.h b/src/render/Weather.h similarity index 100% rename from src/renderer/Weather.h rename to src/render/Weather.h