diff options
46 files changed, 1753 insertions, 1589 deletions
diff --git a/.appveyor.yml b/.appveyor.yml index a1b526be..5c6d3aa5 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -3,24 +3,21 @@ image: Visual Studio 2019 configuration: - Debug - Release -platform: Win32 +platform: +- win-x86-librw_d3d9-mss environment: APPVEYOR_SAVE_CACHE_ON_ERROR: true install: - cmd: >- git submodule update --init --recursive - copy premake5.exe "librw/premake5.exe" - - cd "librw" && premake5 vs2019 && msbuild "build/librw.sln" /property:Configuration=%CONFIGURATION% /property:Platform="win-x86-d3d9" - - cd "%APPVEYOR_BUILD_FOLDER%" && premake5 vs2019 + premake5 vs2019 build: project: build/re3.sln verbosity: minimal artifacts: -- path: bin/%CONFIGURATION%/re3.exe +- path: bin/%PLATFORM%/%CONFIGURATION%/re3.exe name: re3.exe -- path: bin/%CONFIGURATION%/re3.pdb +- path: bin/%PLATFORM%/%CONFIGURATION%/re3.pdb name: re3.pdb diff --git a/librw b/librw -Subproject 09b0b36e7de9866a92a504728f78c780c0d7b8e +Subproject a3120078932053ddd61d696536d8b371e9d65b3 diff --git a/premake5.lua b/premake5.lua index f2a58880..ec499c58 100644 --- a/premake5.lua +++ b/premake5.lua @@ -1,8 +1,85 @@ Librw = os.getenv("LIBRW") or "librw" workspace "re3" - configurations { "Debug", "Release", "ReleaseFH", "DebugRW", "ReleaseRW", "ReleaseGLFW" } + language "C++" + configurations { "Debug", "Release" } location "build" + symbols "Full" + staticruntime "off" + filter { "system:windows" } + platforms { + "win-x86-RW33_d3d8-mss", + "win-x86-librw_d3d9-mss", + "win-x86-librw_gl3_glfw-mss", + } + + filter "configurations:Debug" + defines { "DEBUG" } + + filter "configurations:Release" + defines { "NDEBUG" } + optimize "On" + + filter { "platforms:win*" } + system "windows" + + filter { "platforms:*x86*" } + architecture "x86" + + filter { "platforms:*librw_d3d9*" } + defines { "RW_D3D9" } + + filter "platforms:*librw_gl3_glfw*" + defines { "RW_GL3" } + defines { "GLEW_STATIC" } + includedirs { "glfw-3.3.2.bin.WIN32/include" } + includedirs { "glew-2.1.0/include" } + filter {} + + pbcommands = { + "setlocal EnableDelayedExpansion", + "set file=$(TargetPath)", + "FOR %%i IN (\"%file%\") DO (", + "set filename=%%~ni", + "set fileextension=%%~xi", + "set target=!path!!filename!!fileextension!", + "copy /y \"!file!\" \"!target!\"", + ")" } + + function setpaths (gamepath, exepath, scriptspath) + scriptspath = scriptspath or "" + if (gamepath) then + cmdcopy = { "set \"path=" .. gamepath .. scriptspath .. "\"" } + table.insert(cmdcopy, pbcommands) + postbuildcommands (cmdcopy) + debugdir (gamepath) + if (exepath) then + debugcommand (gamepath .. exepath) + dir, file = exepath:match'(.*/)(.*)' + debugdir (gamepath .. (dir or "")) + end + end + --targetdir ("bin/%{prj.name}/" .. scriptspath) + end + +project "librw" + kind "StaticLib" + targetname "rw" + targetdir "lib/%{cfg.platform}/%{cfg.buildcfg}" + files { path.join(Librw, "src/*.*") } + files { path.join(Librw, "src/*/*.*") } + filter "platforms:*RW33*" + flags { "ExcludeFromBuild" } + filter {} + +project "re3" + kind "WindowedApp" + targetname "re3" + targetdir "bin/%{cfg.platform}/%{cfg.buildcfg}" + targetextension ".exe" + characterset ("MBCS") + linkoptions "/SAFESEH:NO" + files { "src/*.*" } files { "src/animation/*.*" } @@ -48,105 +125,38 @@ workspace "re3" includedirs { "src/extras" } includedirs { "eax" } - includedirs { "dxsdk/include" } includedirs { "milessdk/include" } includedirs { "eax" } - libdirs { "dxsdk/lib" } libdirs { "milessdk/lib" } - - filter "configurations:Debug or Release" - files { "src/fakerw/*.*" } - includedirs { "src/fakerw" } - includedirs { Librw } - libdirs { path.join(Librw, "lib/win-x86-d3d9/%{cfg.buildcfg}") } - links { "rw", "d3d9" } - filter {} - filter "configurations:DebugRW or ReleaseRW" + setpaths("$(GTA_III_RE_DIR)/", "$(TargetFileName)", "") + + filter "platforms:*RW33*" + staticruntime "on" includedirs { "rwsdk/include/d3d8" } libdirs { "rwsdk/lib/d3d8/release" } links { "rwcore", "rpworld", "rpmatfx", "rpskin", "rphanim", "rtbmp", "rtquat", "rtcharse" } - filter {} - - filter "configurations:ReleaseGLFW" - defines { "GLEW_STATIC", "GLFW_DLL" } + defines { "RWLIBS" } + linkoptions "/SECTION:_rwcseg,ER!W /MERGE:_rwcseg=.text" + + filter "platforms:*librw*" + defines { "LIBRW" } files { "src/fakerw/*.*" } includedirs { "src/fakerw" } includedirs { Librw } - includedirs { "glfw-3.3.2.bin.WIN32/include" } - includedirs { "glew-2.1.0/include" } - libdirs { path.join(Librw, "lib/win-x86-gl3/Release") } - libdirs { "glew-2.1.0/lib/Release/Win32" } - libdirs { "glfw-3.3.2.bin.WIN32/lib-vc2015" } - links { "opengl32" } - links { "glew32s" } - links { "glfw3dll" } + libdirs { "lib/%{cfg.platform}/%{cfg.buildcfg}" } links { "rw" } - filter {} - - pbcommands = { - "setlocal EnableDelayedExpansion", - "set file=$(TargetPath)", - "FOR %%i IN (\"%file%\") DO (", - "set filename=%%~ni", - "set fileextension=%%~xi", - "set target=!path!!filename!!fileextension!", - "copy /y \"!file!\" \"!target!\"", - ")" } - - function setpaths (gamepath, exepath, scriptspath) - scriptspath = scriptspath or "" - if (gamepath) then - cmdcopy = { "set \"path=" .. gamepath .. scriptspath .. "\"" } - table.insert(cmdcopy, pbcommands) - postbuildcommands (cmdcopy) - debugdir (gamepath) - if (exepath) then - debugcommand (gamepath .. exepath) - dir, file = exepath:match'(.*/)(.*)' - debugdir (gamepath .. (dir or "")) - end - end - --targetdir ("bin/%{prj.name}/" .. scriptspath) - end -project "re3" - kind "WindowedApp" - language "C++" - targetname "re3" - targetdir "bin/%{cfg.buildcfg}" - targetextension ".exe" - characterset ("MBCS") - linkoptions "/SAFESEH:NO" - - setpaths("$(GTA_III_RE_DIR)/", "$(TargetFileName)", "") - symbols "Full" - staticruntime "off" - - filter "configurations:Debug or Release or ReleaseFH" - prebuildcommands { "cd \"../librw\" && premake5 " .. _ACTION .. " && msbuild \"build/librw.sln\" /property:Configuration=%{cfg.longname} /property:Platform=\"win-x86-d3d9\"" } - defines { "LIBRW", "RW_D3D9" } - - filter "configurations:*RW" - defines { "RWLIBS" } - staticruntime "on" - linkoptions "/SECTION:_rwcseg,ER!W /MERGE:_rwcseg=.text" - - filter "configurations:*GLFW" - prebuildcommands { "cd \"../librw\" && premake5 " .. _ACTION .. " && msbuild \"build/librw.sln\" /property:Configuration=Release /property:Platform=\"win-x86-gl3\"" } - defines { "LIBRW", "RW_GL3" } - - filter "configurations:Debug*" - defines { "DEBUG" } - - filter "configurations:Release*" - defines { "NDEBUG" } - optimize "On" + filter "platforms:*d3d*" + includedirs { "dxsdk/include" } + libdirs { "dxsdk/lib" } + filter "platforms:*d3d9*" + links { "d3d9" } - filter "configurations:ReleaseFH" - prebuildcommands {} - optimize "off" - staticruntime "on" + filter "platforms:*gl3_glfw*" + libdirs { "glew-2.1.0/lib/Release/Win32" } + libdirs { "glfw-3.3.2.bin.WIN32/lib-" .. string.gsub(_ACTION, "vs", "vc") } + links { "opengl32", "glew32s", "glfw3" } diff --git a/src/audio/AudioCollision.cpp b/src/audio/AudioCollision.cpp index a963b293..0e060568 100644 --- a/src/audio/AudioCollision.cpp +++ b/src/audio/AudioCollision.cpp @@ -164,16 +164,16 @@ cAudioManager::SetUpLoopingCollisionSound(cAudioCollision *col, uint8 counter) uint8 emittingVol = SetLoopingCollisionRequestedSfxFreqAndGetVol(col); if(emittingVol) { m_sQueueSample.m_fDistance = Sqrt(col->m_fDistance); - m_sQueueSample.m_bVolume = + m_sQueueSample.m_nVolume = ComputeVolume(emittingVol, CollisionSoundIntensity, m_sQueueSample.m_fDistance); - if(m_sQueueSample.m_bVolume) { + if(m_sQueueSample.m_nVolume) { m_sQueueSample.m_nCounter = counter; m_sQueueSample.m_vecPos = col->m_vecPosition; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_bIs2D = false; m_sQueueSample.m_nReleasingVolumeModificator = 7; m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_bEmittingVolume = emittingVol; + m_sQueueSample.m_nEmittingVolume = emittingVol; m_sQueueSample.m_nLoopStart = SampleManager.GetSampleLoopStartOffset(m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_nLoopEnd = @@ -231,9 +231,9 @@ cAudioManager::SetUpOneShotCollisionSound(cAudioCollision *col) emittingVol = 40.f * ratio; if(emittingVol) { m_sQueueSample.m_fDistance = Sqrt(col->m_fDistance); - m_sQueueSample.m_bVolume = + m_sQueueSample.m_nVolume = ComputeVolume(emittingVol, CollisionSoundIntensity, m_sQueueSample.m_fDistance); - if(m_sQueueSample.m_bVolume) { + if(m_sQueueSample.m_nVolume) { m_sQueueSample.m_nSampleIndex = gOneShotCol[s1]; switch(m_sQueueSample.m_nSampleIndex) { case SFX_COL_TARMAC_1: @@ -289,11 +289,11 @@ cAudioManager::SetUpOneShotCollisionSound(cAudioCollision *col) m_sQueueSample.m_nCounter = counter++; if(counter >= 255) counter = 28; m_sQueueSample.m_vecPos = col->m_vecPosition; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_bIs2D = false; m_sQueueSample.m_nReleasingVolumeModificator = 11; m_sQueueSample.m_nLoopCount = 1; - m_sQueueSample.m_bEmittingVolume = emittingVol; + m_sQueueSample.m_nEmittingVolume = emittingVol; m_sQueueSample.m_nLoopStart = 0; m_sQueueSample.m_nLoopEnd = -1; m_sQueueSample.m_fSpeedMultiplier = 4.0f; @@ -380,7 +380,7 @@ cAudioManager::ReportCollision(CEntity *entity1, CEntity *entity2, uint8 surface CVector v1; CVector v2; - if(!m_bIsInitialised || m_nCollisionEntity < 0 || m_bUserPause || + if(!m_bIsInitialised || m_nCollisionEntity < 0 || m_nUserPause || (velocity < 0.0016f && collisionPower < 0.01f)) return; diff --git a/src/audio/AudioCollision.h b/src/audio/AudioCollision.h index a21bbfdc..324bab0e 100644 --- a/src/audio/AudioCollision.h +++ b/src/audio/AudioCollision.h @@ -2,6 +2,8 @@ #define NUMAUDIOCOLLISIONS 10 +class CEntity; + class cAudioCollision { public: diff --git a/src/audio/AudioManager.cpp b/src/audio/AudioManager.cpp index 0c4b007f..0c06bc67 100644 --- a/src/audio/AudioManager.cpp +++ b/src/audio/AudioManager.cpp @@ -250,7 +250,7 @@ cPedComments::Process() static const int defaultIntensity = 50; static const int policeHeliIntensity = 400; - if(!AudioManager.m_bUserPause) { + if(!AudioManager.m_nUserPause) { if(m_nCommentsInBank[m_nActiveBank]) { sampleIndex = m_asPedComments[m_nActiveBank][m_nIndexMap[m_nActiveBank][0]] .m_nSampleIndex; @@ -262,9 +262,9 @@ cPedComments::Process() .m_nEntityIndex; AudioManager.m_sQueueSample.m_nCounter = 0; AudioManager.m_sQueueSample.m_nSampleIndex = sampleIndex; - AudioManager.m_sQueueSample.m_bBankIndex = SAMPLEBANK_PED; + AudioManager.m_sQueueSample.m_nBankIndex = SAMPLEBANK_PED; AudioManager.m_sQueueSample.m_nReleasingVolumeModificator = 3; - AudioManager.m_sQueueSample.m_bVolume = + AudioManager.m_sQueueSample.m_nVolume = m_asPedComments[m_nActiveBank][m_nIndexMap[m_nActiveBank][0]].m_bVolume; AudioManager.m_sQueueSample.m_fDistance = m_asPedComments[m_nActiveBank][m_nIndexMap[m_nActiveBank][0]] @@ -272,7 +272,7 @@ cPedComments::Process() AudioManager.m_sQueueSample.m_nLoopCount = 1; AudioManager.m_sQueueSample.m_nLoopStart = 0; AudioManager.m_sQueueSample.m_nLoopEnd = -1; - AudioManager.m_sQueueSample.m_bEmittingVolume = maxVolume; + AudioManager.m_sQueueSample.m_nEmittingVolume = maxVolume; AudioManager.m_sQueueSample.m_fSpeedMultiplier = 3.0f; switch(sampleIndex) { case SFX_POLICE_HELI_1: @@ -338,8 +338,8 @@ cAudioManager::cAudioManager() m_bIsInitialised = false; field_1 = 1; m_fSpeedOfSound = 6.86f; - m_bTimeSpent = 50; - m_bActiveSamples = NUM_SOUNDS_SAMPLES_SLOTS; + m_nTimeSpent = 50; + m_nActiveSamples = NUM_SOUNDS_SAMPLES_SLOTS; m_bActiveSampleQueue = 1; ClearRequestedQueue(); m_bActiveSampleQueue = 0; @@ -380,7 +380,7 @@ cAudioManager::AddDetailsToRequestedOrderList(uint8 sample) if(i < sample) { memmove(&m_abSampleQueueIndexTable[m_bActiveSampleQueue][i + 1], &m_abSampleQueueIndexTable[m_bActiveSampleQueue][i], - m_bActiveSamples - i - 1); + m_nActiveSamples - i - 1); } } m_abSampleQueueIndexTable[m_bActiveSampleQueue][i] = sample; @@ -390,11 +390,11 @@ void cAudioManager::AddPlayerCarSample(uint8 emittingVolume, int32 freq, uint32 sample, uint8 unk1, uint8 counter, bool notLooping) { - m_sQueueSample.m_bVolume = ComputeVolume(emittingVolume, 50.f, m_sQueueSample.m_fDistance); - if(m_sQueueSample.m_bVolume) { + m_sQueueSample.m_nVolume = ComputeVolume(emittingVolume, 50.f, m_sQueueSample.m_fDistance); + if(m_sQueueSample.m_nVolume) { m_sQueueSample.m_nCounter = counter; m_sQueueSample.m_nSampleIndex = sample; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_bIs2D = false; m_sQueueSample.m_nReleasingVolumeModificator = 0; m_sQueueSample.m_nFrequency = freq; @@ -404,7 +404,7 @@ cAudioManager::AddPlayerCarSample(uint8 emittingVolume, int32 freq, uint32 sampl } else { m_sQueueSample.m_nLoopCount = 1; } - m_sQueueSample.m_bEmittingVolume = emittingVolume; + m_sQueueSample.m_nEmittingVolume = emittingVolume; m_sQueueSample.m_nLoopStart = SampleManager.GetSampleLoopStartOffset(m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_nLoopEnd = @@ -423,20 +423,20 @@ cAudioManager::AddReflectionsToRequestedQueue() { float reflectionDistance; int32 noise; - uint8 emittingVolume = (m_sQueueSample.m_bVolume >> 1) + (m_sQueueSample.m_bVolume >> 3); + uint8 emittingVolume = (m_sQueueSample.m_nVolume >> 1) + (m_sQueueSample.m_nVolume >> 3); for(uint32 i = 0; i < ARRAY_SIZE(m_afReflectionsDistances); i++) { reflectionDistance = m_afReflectionsDistances[i]; if(reflectionDistance > 0.0f && reflectionDistance < 100.f && reflectionDistance < m_sQueueSample.m_fSoundIntensity) { - m_sQueueSample.m_bLoopsRemaining = (reflectionDistance * 500.f / 1029.f); - if(m_sQueueSample.m_bLoopsRemaining > 5) { + m_sQueueSample.m_nLoopsRemaining = (reflectionDistance * 500.f / 1029.f); + if(m_sQueueSample.m_nLoopsRemaining > 5) { m_sQueueSample.m_fDistance = m_afReflectionsDistances[i]; - m_sQueueSample.m_bEmittingVolume = emittingVolume; - m_sQueueSample.m_bVolume = + m_sQueueSample.m_nEmittingVolume = emittingVolume; + m_sQueueSample.m_nVolume = ComputeVolume(emittingVolume, m_sQueueSample.m_fSoundIntensity, m_sQueueSample.m_fDistance); - if(m_sQueueSample.m_bVolume > emittingVolume >> 4) { + if(m_sQueueSample.m_nVolume > emittingVolume >> 4) { m_sQueueSample.m_nCounter += ((i + 1) << 8); if(m_sQueueSample.m_nLoopCount) { noise = RandomDisplacement( @@ -462,12 +462,12 @@ cAudioManager::AddReleasingSounds() int8 queue = m_bActiveSampleQueue == 0; - for(int32 i = 0; i < m_bSampleRequestQueuesStatus[queue]; i++) { + for(int32 i = 0; i < m_SampleRequestQueuesStatus[queue]; i++) { tSound &sample = m_asSamples[queue][m_abSampleQueueIndexTable[queue][i]]; if(sample.m_bLoopEnded) continue; toProcess[i] = false; - for(int32 j = 0; j < m_bSampleRequestQueuesStatus[m_bActiveSampleQueue]; j++) { + for(int32 j = 0; j < m_SampleRequestQueuesStatus[m_bActiveSampleQueue]; j++) { if(sample.m_nEntityIndex == m_asSamples[m_bActiveSampleQueue] [m_abSampleQueueIndexTable[m_bActiveSampleQueue][j]] @@ -481,21 +481,21 @@ cAudioManager::AddReleasingSounds() } } if(!toProcess[i]) { - if(sample.m_nCounter <= 255 || !sample.m_bLoopsRemaining) { + if(sample.m_nCounter <= 255 || !sample.m_nLoopsRemaining) { if(!sample.m_nReleasingVolumeDivider) continue; if(!sample.m_nLoopCount) { if(sample.m_nVolumeChange == -1) { sample.m_nVolumeChange = - sample.m_bVolume / + sample.m_nVolume / sample.m_nReleasingVolumeDivider; if(sample.m_nVolumeChange <= 0) sample.m_nVolumeChange = 1; } - if(sample.m_bVolume <= sample.m_nVolumeChange) { + if(sample.m_nVolume <= sample.m_nVolumeChange) { sample.m_nReleasingVolumeDivider = 0; continue; } - sample.m_bVolume -= sample.m_nVolumeChange; + sample.m_nVolume -= sample.m_nVolumeChange; } --sample.m_nReleasingVolumeDivider; if(m_bFifthFrameFlag) { @@ -519,28 +519,28 @@ cAudioManager::AddSampleToRequestedQueue() if(m_sQueueSample.m_nSampleIndex < TOTAL_AUDIO_SAMPLES) { calculatedVolume = m_sQueueSample.m_nReleasingVolumeModificator * - (maxVolume - m_sQueueSample.m_bVolume); - sampleIndex = m_bSampleRequestQueuesStatus[m_bActiveSampleQueue]; - if(sampleIndex >= m_bActiveSamples) { + (maxVolume - m_sQueueSample.m_nVolume); + sampleIndex = m_SampleRequestQueuesStatus[m_bActiveSampleQueue]; + if(sampleIndex >= m_nActiveSamples) { sampleIndex = - m_abSampleQueueIndexTable[m_bActiveSampleQueue][m_bActiveSamples - 1]; + m_abSampleQueueIndexTable[m_bActiveSampleQueue][m_nActiveSamples - 1]; if(m_asSamples[m_bActiveSampleQueue][sampleIndex].m_nCalculatedVolume <= calculatedVolume) return; } else { - ++m_bSampleRequestQueuesStatus[m_bActiveSampleQueue]; + ++m_SampleRequestQueuesStatus[m_bActiveSampleQueue]; } m_sQueueSample.m_nCalculatedVolume = calculatedVolume; m_sQueueSample.m_bLoopEnded = false; if(m_sQueueSample.m_bIs2D) { m_sQueueSample.m_bRequireReflection = false; - m_sQueueSample.m_bLoopsRemaining = 0; + m_sQueueSample.m_nLoopsRemaining = 0; } if(m_bDynamicAcousticModelingStatus && m_sQueueSample.m_nLoopCount) { bReflections = m_sQueueSample.m_bRequireReflection; } else { bReflections = false; - m_sQueueSample.m_bLoopsRemaining = 0; + m_sQueueSample.m_nLoopsRemaining = 0; } m_sQueueSample.m_bRequireReflection = false; @@ -571,16 +571,16 @@ cAudioManager::CheckForAnAudioFileOnCD() const void cAudioManager::ClearActiveSamples() { - for(int32 i = 0; i < m_bActiveSamples; i++) { + for(int32 i = 0; i < m_nActiveSamples; i++) { m_asActiveSamples[i].m_nEntityIndex = AEHANDLE_NONE; m_asActiveSamples[i].m_nCounter = 0; m_asActiveSamples[i].m_nSampleIndex = NO_SAMPLE; - m_asActiveSamples[i].m_bBankIndex = SAMPLEBANK_INVALID; + m_asActiveSamples[i].m_nBankIndex = SAMPLEBANK_INVALID; m_asActiveSamples[i].m_bIs2D = false; m_asActiveSamples[i].m_nReleasingVolumeModificator = 5; m_asActiveSamples[i].m_nFrequency = 0; - m_asActiveSamples[i].m_bVolume = 0; - m_asActiveSamples[i].m_bEmittingVolume = 0; + m_asActiveSamples[i].m_nVolume = 0; + m_asActiveSamples[i].m_nEmittingVolume = 0; m_asActiveSamples[i].m_fDistance = 0.0f; m_asActiveSamples[i].m_bIsProcessed = false; m_asActiveSamples[i].m_bLoopEnded = false; @@ -589,14 +589,14 @@ cAudioManager::ClearActiveSamples() m_asActiveSamples[i].m_nLoopEnd = -1; m_asActiveSamples[i].m_fSpeedMultiplier = 0.0f; m_asActiveSamples[i].m_fSoundIntensity = 200.0f; - m_asActiveSamples[i].m_bOffset = 63; - m_asActiveSamples[i].m_bReleasingSoundFlag = 0; + m_asActiveSamples[i].m_nOffset = 63; + m_asActiveSamples[i].m_bReleasingSoundFlag = false; m_asActiveSamples[i].m_nCalculatedVolume = 0; m_asActiveSamples[i].m_nReleasingVolumeDivider = 0; m_asActiveSamples[i].m_nVolumeChange = -1; m_asActiveSamples[i].m_vecPos = {0.0f, 0.0f, 0.0f}; m_asActiveSamples[i].m_bReverbFlag = false; - m_asActiveSamples[i].m_bLoopsRemaining = 0; + m_asActiveSamples[i].m_nLoopsRemaining = 0; m_asActiveSamples[i].m_bRequireReflection = false; } } @@ -606,8 +606,8 @@ cAudioManager::ClearMissionAudio() { if(m_bIsInitialised) { m_sMissionAudio.m_nSampleIndex = NO_SAMPLE; - m_sMissionAudio.m_bLoadingStatus = LOADING_STATUS_NOT_LOADED; - m_sMissionAudio.m_bPlayStatus = PLAY_STATUS_STOPPED; + m_sMissionAudio.m_nLoadingStatus = LOADING_STATUS_NOT_LOADED; + m_sMissionAudio.m_nPlayStatus = PLAY_STATUS_STOPPED; m_sMissionAudio.field_22 = 0; m_sMissionAudio.m_bIsPlayed = false; m_sMissionAudio.m_bPredefinedProperties = 1; @@ -618,10 +618,10 @@ cAudioManager::ClearMissionAudio() void cAudioManager::ClearRequestedQueue() { - for(int32 i = 0; i < m_bActiveSamples; i++) { - m_abSampleQueueIndexTable[m_bActiveSampleQueue][i] = m_bActiveSamples; + for(int32 i = 0; i < m_nActiveSamples; i++) { + m_abSampleQueueIndexTable[m_bActiveSampleQueue][i] = m_nActiveSamples; } - m_bSampleRequestQueuesStatus[m_bActiveSampleQueue] = 0; + m_SampleRequestQueuesStatus[m_bActiveSampleQueue] = 0; } int32 @@ -632,7 +632,7 @@ cAudioManager::ComputeDopplerEffectedFrequency(uint32 oldFreq, float position1, if(!TheCamera.Get_Just_Switched_Status() && speedMultiplier != 0.0f) { float dist = position2 - position1; if(dist != 0.0f) { - float speedOfSource = (dist / m_bTimeSpent) * speedMultiplier; + float speedOfSource = (dist / m_nTimeSpent) * speedMultiplier; if(m_fSpeedOfSound > Abs(speedOfSource)) { if(speedOfSource < 0.0f) { speedOfSource = Max(speedOfSource, -1.5f); @@ -680,7 +680,7 @@ cAudioManager::CreateEntity(int32 type, void *entity) for(uint32 i = 0; i < ARRAY_SIZE(m_asAudioEntities); i++) { if(!m_asAudioEntities[i].m_bIsUsed) { m_asAudioEntities[i].m_bIsUsed = true; - m_asAudioEntities[i].m_bStatus = 0; + m_asAudioEntities[i].m_nStatus = 0; m_asAudioEntities[i].m_nType = (eAudioType)type; m_asAudioEntities[i].m_pEntity = entity; m_asAudioEntities[i].m_awAudioEvent[0] = SOUND_TOTAL_PED_SOUNDS; @@ -2763,7 +2763,7 @@ cAudioManager::GetJumboTaxiFreq() const bool cAudioManager::GetMissionAudioLoadingStatus() const { - if(m_bIsInitialised) return m_sMissionAudio.m_bLoadingStatus; + if(m_bIsInitialised) return m_sMissionAudio.m_nLoadingStatus; return true; } @@ -2946,11 +2946,11 @@ cAudioManager::Initialise() PreInitialiseGameSpecificSetup(); m_bIsInitialised = SampleManager.Initialise(); if(m_bIsInitialised) { - m_bActiveSamples = SampleManager.GetMaximumSupportedChannels(); - if(m_bActiveSamples <= 1) { + m_nActiveSamples = SampleManager.GetMaximumSupportedChannels(); + if(m_nActiveSamples <= 1) { Terminate(); } else { - --m_bActiveSamples; + --m_nActiveSamples; PostInitialiseGameSpecificSetup(); InitialisePoliceRadioZones(); InitialisePoliceRadio(); @@ -2978,7 +2978,7 @@ cAudioManager::IsAudioInitialised() const bool cAudioManager::IsMissionAudioSampleFinished() { - if(m_bIsInitialised) return m_sMissionAudio.m_bPlayStatus == PLAY_STATUS_FINISHED; + if(m_bIsInitialised) return m_sMissionAudio.m_nPlayStatus == PLAY_STATUS_FINISHED; static int32 cPretendFrame = 1; @@ -3017,8 +3017,8 @@ void cAudioManager::PlayLoadedMissionAudio() { if(m_bIsInitialised && m_sMissionAudio.m_nSampleIndex != NO_SAMPLE && - m_sMissionAudio.m_bLoadingStatus == LOADING_STATUS_LOADED && - !m_sMissionAudio.m_bPlayStatus) { + m_sMissionAudio.m_nLoadingStatus == LOADING_STATUS_LOADED && + !m_sMissionAudio.m_nPlayStatus) { m_sMissionAudio.m_bIsPlayed = true; } } @@ -3126,8 +3126,8 @@ cAudioManager::PostInitialiseGameSpecificSetup() if(m_nBridgeEntity >= 0) SetEntityStatus(m_nBridgeEntity, 1); m_sMissionAudio.m_nSampleIndex = NO_SAMPLE; - m_sMissionAudio.m_bLoadingStatus = LOADING_STATUS_NOT_LOADED; - m_sMissionAudio.m_bPlayStatus = PLAY_STATUS_STOPPED; + m_sMissionAudio.m_nLoadingStatus = LOADING_STATUS_NOT_LOADED; + m_sMissionAudio.m_nPlayStatus = PLAY_STATUS_STOPPED; m_sMissionAudio.field_22 = 0; m_sMissionAudio.m_bIsPlayed = false; m_sMissionAudio.m_bPredefinedProperties = 1; @@ -3224,11 +3224,11 @@ cAudioManager::PreloadMissionAudio(const char *name) int32 missionAudioSfx = FindMissionAudioSfx(name); if(missionAudioSfx != NO_SAMPLE) { m_sMissionAudio.m_nSampleIndex = missionAudioSfx; - m_sMissionAudio.m_bLoadingStatus = LOADING_STATUS_NOT_LOADED; - m_sMissionAudio.m_bPlayStatus = PLAY_STATUS_STOPPED; + m_sMissionAudio.m_nLoadingStatus = LOADING_STATUS_NOT_LOADED; + m_sMissionAudio.m_nPlayStatus = PLAY_STATUS_STOPPED; m_sMissionAudio.field_22 = 0; m_sMissionAudio.m_nMissionAudioCounter = - m_bTimeSpent * SampleManager.GetStreamedFileLength(missionAudioSfx) / + m_nTimeSpent * SampleManager.GetStreamedFileLength(missionAudioSfx) / 1000; m_sMissionAudio.m_nMissionAudioCounter *= 4; m_sMissionAudio.m_bIsPlayed = false; @@ -3289,16 +3289,16 @@ cAudioManager::ProcessActiveQueues() uint8 emittingVol; CVector position; - for(int32 i = 0; i < m_bActiveSamples; i++) { + for(int32 i = 0; i < m_nActiveSamples; i++) { m_asSamples[m_bActiveSampleQueue][i].m_bIsProcessed = false; m_asActiveSamples[i].m_bIsProcessed = false; } - for(int32 i = 0; i < m_bSampleRequestQueuesStatus[m_bActiveSampleQueue]; ++i) { + for(int32 i = 0; i < m_SampleRequestQueuesStatus[m_bActiveSampleQueue]; ++i) { tSound &sample = m_asSamples[m_bActiveSampleQueue] [m_abSampleQueueIndexTable[m_bActiveSampleQueue][i]]; if(sample.m_nSampleIndex != NO_SAMPLE) { - for(int32 j = 0; j < m_bActiveSamples; ++j) { + for(int32 j = 0; j < m_nActiveSamples; ++j) { if(sample.m_nEntityIndex == m_asActiveSamples[j].m_nEntityIndex && sample.m_nCounter == m_asActiveSamples[j].m_nCounter && sample.m_nSampleIndex == m_asActiveSamples[j].m_nSampleIndex) { @@ -3327,10 +3327,10 @@ cAudioManager::ProcessActiveQueues() emittingVol = 2 * Min(63, - sample.m_bEmittingVolume); + sample.m_nEmittingVolume); } else { emittingVol = - sample.m_bEmittingVolume; + sample.m_nEmittingVolume; } SampleManager.SetChannelFrequency( j, sample.m_nFrequency); @@ -3371,24 +3371,24 @@ cAudioManager::ProcessActiveQueues() j, freq); } - if(sample.m_bEmittingVolume != - m_asActiveSamples[j].m_bEmittingVolume) { - if(sample.m_bEmittingVolume <= + if(sample.m_nEmittingVolume != + m_asActiveSamples[j].m_nEmittingVolume) { + if(sample.m_nEmittingVolume <= m_asActiveSamples[j] - .m_bEmittingVolume) { + .m_nEmittingVolume) { vol = Max( m_asActiveSamples[j] - .m_bEmittingVolume - + .m_nEmittingVolume - 10, sample - .m_bEmittingVolume); + .m_nEmittingVolume); } else { vol = Min( m_asActiveSamples[j] - .m_bEmittingVolume + + .m_nEmittingVolume + 10, sample - .m_bEmittingVolume); + .m_nEmittingVolume); } uint8 emittingVol; @@ -3402,7 +3402,7 @@ cAudioManager::ProcessActiveQueues() .SetChannelEmittingVolume( j, emittingVol); m_asActiveSamples[j] - .m_bEmittingVolume = vol; + .m_nEmittingVolume = vol; } TranslateEntity(&sample.m_vecPos, &position); @@ -3423,7 +3423,7 @@ cAudioManager::ProcessActiveQueues() } } } - for(int32 i = 0; i < m_bActiveSamples; i++) { + for(int32 i = 0; i < m_nActiveSamples; i++) { if(m_asActiveSamples[i].m_nSampleIndex != NO_SAMPLE && !m_asActiveSamples[i].m_bIsProcessed) { SampleManager.StopChannel(i); @@ -3431,21 +3431,21 @@ cAudioManager::ProcessActiveQueues() m_asActiveSamples[i].m_nEntityIndex = AEHANDLE_NONE; } } - for(int32 i = 0; i < m_bSampleRequestQueuesStatus[m_bActiveSampleQueue]; ++i) { + for(int32 i = 0; i < m_SampleRequestQueuesStatus[m_bActiveSampleQueue]; ++i) { tSound &sample = m_asSamples[m_bActiveSampleQueue] [m_abSampleQueueIndexTable[m_bActiveSampleQueue][i]]; if(!sample.m_bIsProcessed && !sample.m_bLoopEnded && m_asAudioEntities[sample.m_nEntityIndex].m_bIsUsed && sample.m_nSampleIndex < NO_SAMPLE) { if(sample.m_nCounter > 255 && sample.m_nLoopCount && - sample.m_bLoopsRemaining) { - --sample.m_bLoopsRemaining; + sample.m_nLoopsRemaining) { + --sample.m_nLoopsRemaining; sample.m_nReleasingVolumeDivider = 1; } else { - for(int32 j = 0; j < m_bActiveSamples; ++j) { + for(int32 j = 0; j < m_nActiveSamples; ++j) { if(!m_asActiveSamples[j].m_bIsProcessed) { if(sample.m_nLoopCount) { - v28 = sample.m_nFrequency / m_bTimeSpent; + v28 = sample.m_nFrequency / m_nTimeSpent; v29 = sample.m_nLoopCount * SampleManager.GetSampleLength( sample.m_nSampleIndex); @@ -3462,14 +3462,14 @@ cAudioManager::ProcessActiveQueues() if(field_4) { emittingVol = 2 * Min(63, m_asActiveSamples[j] - .m_bEmittingVolume); + .m_nEmittingVolume); } else { emittingVol = - m_asActiveSamples[j].m_bEmittingVolume; + m_asActiveSamples[j].m_nEmittingVolume; } if(SampleManager.InitialiseChannel( j, m_asActiveSamples[j].m_nSampleIndex, - m_asActiveSamples[j].m_bBankIndex)) { + m_asActiveSamples[j].m_nBankIndex)) { SampleManager.SetChannelFrequency( j, m_asActiveSamples[j].m_nFrequency); SampleManager.SetChannelEmittingVolume( @@ -3483,7 +3483,7 @@ cAudioManager::ProcessActiveQueues() j, m_asActiveSamples[j].m_bReverbFlag); if(m_asActiveSamples[j].m_bIs2D) { uint8 offset = - m_asActiveSamples[j].m_bOffset; + m_asActiveSamples[j].m_nOffset; if(offset == 63) { x = 0.f; } else if(offset >= 63) { @@ -3540,17 +3540,17 @@ cAudioManager::ProcessAirBrakes(cVehicleParams *params) CalculateDistance(params->m_bDistanceCalculated, params->m_fDistance); rand = m_anRandomTable[0] % 10 + 70; - m_sQueueSample.m_bVolume = ComputeVolume(rand, 30.0f, m_sQueueSample.m_fDistance); - if(m_sQueueSample.m_bVolume) { + m_sQueueSample.m_nVolume = ComputeVolume(rand, 30.0f, m_sQueueSample.m_fDistance); + if(m_sQueueSample.m_nVolume) { m_sQueueSample.m_nCounter = 13; m_sQueueSample.m_nSampleIndex = SFX_AIR_BRAKES; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_AIR_BRAKES); m_sQueueSample.m_nFrequency += RandomDisplacement(m_sQueueSample.m_nFrequency >> 4); - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_bIs2D = false; m_sQueueSample.m_nReleasingVolumeModificator = 10; m_sQueueSample.m_nLoopCount = 1; - m_sQueueSample.m_bEmittingVolume = rand; + m_sQueueSample.m_nEmittingVolume = rand; m_sQueueSample.m_nLoopStart = 0; m_sQueueSample.m_nLoopEnd = -1; m_sQueueSample.m_fSpeedMultiplier = 0.0f; @@ -3583,12 +3583,12 @@ cAudioManager::ProcessAirportScriptObject(uint8 sound) float distSquared = GetDistanceSquared(&m_sQueueSample.m_vecPos); if(distSquared < SQR(m_sQueueSample.m_fSoundIntensity)) { m_sQueueSample.m_fDistance = Sqrt(distSquared); - m_sQueueSample.m_bVolume = ComputeVolume( + m_sQueueSample.m_nVolume = ComputeVolume( 110, m_sQueueSample.m_fSoundIntensity, m_sQueueSample.m_fDistance); - if(m_sQueueSample.m_bVolume) { + if(m_sQueueSample.m_nVolume) { m_sQueueSample.m_nSampleIndex = (m_anRandomTable[1] & 3) + SFX_AIRPORT_ANNOUNCEMENT_1; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency( m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_nCounter = counter++; @@ -3597,7 +3597,7 @@ cAudioManager::ProcessAirportScriptObject(uint8 sound) m_sQueueSample.m_bReleasingSoundFlag = true; m_sQueueSample.m_nReleasingVolumeModificator = 3; m_sQueueSample.m_fSpeedMultiplier = 2.0f; - m_sQueueSample.m_bEmittingVolume = 110; + m_sQueueSample.m_nEmittingVolume = 110; m_sQueueSample.m_nLoopStart = 0; m_sQueueSample.m_nLoopEnd = -1; m_sQueueSample.m_bReverbFlag = true; @@ -3628,19 +3628,19 @@ cAudioManager::ProcessBoatEngine(cVehicleParams *params) boat = (CBoat *)params->m_pVehicle; if(params->m_nIndex == REEFER) { CalculateDistance(params->m_bDistanceCalculated, params->m_fDistance); - m_sQueueSample.m_bVolume = + m_sQueueSample.m_nVolume = ComputeVolume(80, 50.f, m_sQueueSample.m_fDistance); - if(m_sQueueSample.m_bVolume) { + if(m_sQueueSample.m_nVolume) { m_sQueueSample.m_nCounter = 39; m_sQueueSample.m_nSampleIndex = SFX_FISHING_BOAT_IDLE; m_sQueueSample.m_nFrequency = 10386; m_sQueueSample.m_nFrequency += (m_sQueueSample.m_nEntityIndex << 16) % 1000; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_bIs2D = false; m_sQueueSample.m_nReleasingVolumeModificator = 3; m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_bEmittingVolume = 80; + m_sQueueSample.m_nEmittingVolume = 80; m_sQueueSample.m_nLoopStart = SampleManager.GetSampleLoopStartOffset( m_sQueueSample.m_nSampleIndex); @@ -3678,17 +3678,17 @@ cAudioManager::ProcessBoatEngine(cVehicleParams *params) 11 * m_sQueueSample.m_nFrequency / 10; } } - m_sQueueSample.m_bVolume = + m_sQueueSample.m_nVolume = ComputeVolume(emittingVol, 50.f, m_sQueueSample.m_fDistance); - if(!m_sQueueSample.m_bVolume) return 1; + if(!m_sQueueSample.m_nVolume) return true; m_sQueueSample.m_nCounter = 40; m_sQueueSample.m_nSampleIndex = SFX_POLICE_BOAT_ACCEL; m_sQueueSample.m_nFrequency += (m_sQueueSample.m_nEntityIndex << 16) % 1000; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_bIs2D = false; m_sQueueSample.m_nReleasingVolumeModificator = 3; m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_bEmittingVolume = emittingVol; + m_sQueueSample.m_nEmittingVolume = emittingVol; m_sQueueSample.m_nLoopStart = SampleManager.GetSampleLoopStartOffset(m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_nLoopEnd = @@ -3745,15 +3745,15 @@ cAudioManager::ProcessBoatEngine(cVehicleParams *params) } } CalculateDistance(params->m_bDistanceCalculated, params->m_fDistance); - m_sQueueSample.m_bVolume = + m_sQueueSample.m_nVolume = ComputeVolume(emittingVol, 50.f, m_sQueueSample.m_fDistance); - if(!m_sQueueSample.m_bVolume) return 1; + if(!m_sQueueSample.m_nVolume) return true; m_sQueueSample.m_nFrequency += (m_sQueueSample.m_nEntityIndex << 16) % 1000; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_bIs2D = false; m_sQueueSample.m_nReleasingVolumeModificator = 3; m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_bEmittingVolume = emittingVol; + m_sQueueSample.m_nEmittingVolume = emittingVol; m_sQueueSample.m_nLoopStart = SampleManager.GetSampleLoopStartOffset(m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_nLoopEnd = @@ -3787,16 +3787,16 @@ cAudioManager::ProcessBoatMovingOverWater(cVehicleParams *params) multiplier = (velocityChange - 0.0005f) * 1.3342f; CalculateDistance(params->m_bDistanceCalculated, params->m_fDistance); vol = (30.f * multiplier); - m_sQueueSample.m_bVolume = ComputeVolume(vol, 50.f, m_sQueueSample.m_fDistance); - if(m_sQueueSample.m_bVolume) { + m_sQueueSample.m_nVolume = ComputeVolume(vol, 50.f, m_sQueueSample.m_fDistance); + if(m_sQueueSample.m_nVolume) { m_sQueueSample.m_nCounter = 38; m_sQueueSample.m_nSampleIndex = SFX_BOAT_WATER_LOOP; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_bIs2D = false; m_sQueueSample.m_nReleasingVolumeModificator = 3; m_sQueueSample.m_nFrequency = (6050.f * multiplier) + 16000; m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_bEmittingVolume = vol; + m_sQueueSample.m_nEmittingVolume = vol; m_sQueueSample.m_nLoopStart = SampleManager.GetSampleLoopStartOffset(m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_nLoopEnd = @@ -3844,18 +3844,18 @@ void cAudioManager::ProcessBridgeMotor() { if(m_sQueueSample.m_fDistance < bridgeIntensity) { - m_sQueueSample.m_bVolume = + m_sQueueSample.m_nVolume = ComputeVolume(maxVolume, bridgeIntensity, m_sQueueSample.m_fDistance); - if(m_sQueueSample.m_bVolume) { + if(m_sQueueSample.m_nVolume) { m_sQueueSample.m_nCounter = 1; m_sQueueSample.m_nSampleIndex = SFX_FISHING_BOAT_IDLE; // todo check sfx name - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_bIs2D = false; m_sQueueSample.m_nReleasingVolumeModificator = 1; m_sQueueSample.m_nFrequency = 5500; m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_bEmittingVolume = maxVolume; + m_sQueueSample.m_nEmittingVolume = maxVolume; m_sQueueSample.m_nLoopStart = SampleManager.GetSampleLoopStartOffset(m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_nLoopEnd = @@ -3873,20 +3873,16 @@ cAudioManager::ProcessBridgeMotor() void cAudioManager::ProcessBridgeOneShots() { - if(CBridge::State == STATE_LIFT_PART_IS_UP && - CBridge::OldState == STATE_LIFT_PART_MOVING_UP) { + if(CBridge::State == STATE_LIFT_PART_IS_UP && CBridge::OldState == STATE_LIFT_PART_MOVING_UP) { m_sQueueSample.m_nSampleIndex = SFX_COL_CONTAINER_1; } else { - if(CBridge::State == STATE_LIFT_PART_IS_DOWN && - CBridge::OldState == STATE_LIFT_PART_MOVING_DOWN) { + if(CBridge::State == STATE_LIFT_PART_IS_DOWN && CBridge::OldState == STATE_LIFT_PART_MOVING_DOWN) { m_sQueueSample.m_nSampleIndex = SFX_COL_CONTAINER_1; } else { - if(CBridge::State == STATE_LIFT_PART_MOVING_UP && - CBridge::OldState == STATE_LIFT_PART_ABOUT_TO_MOVE_UP) { + if(CBridge::State == STATE_LIFT_PART_MOVING_UP && CBridge::OldState == STATE_LIFT_PART_ABOUT_TO_MOVE_UP) { m_sQueueSample.m_nSampleIndex = SFX_COL_CONTAINER_1; } else { - if(CBridge::State == STATE_LIFT_PART_MOVING_DOWN && - CBridge::OldState == STATE_LIFT_PART_IS_UP) { + if(CBridge::State == STATE_LIFT_PART_MOVING_DOWN && CBridge::OldState == STATE_LIFT_PART_IS_UP) { m_sQueueSample.m_nSampleIndex = SFX_COL_CONTAINER_1; } else return; @@ -3894,17 +3890,17 @@ cAudioManager::ProcessBridgeOneShots() } } if(m_sQueueSample.m_fDistance < bridgeIntensity) { - m_sQueueSample.m_bVolume = + m_sQueueSample.m_nVolume = ComputeVolume(maxVolume, bridgeIntensity, m_sQueueSample.m_fDistance); - if(m_sQueueSample.m_bVolume) { + if(m_sQueueSample.m_nVolume) { m_sQueueSample.m_nCounter = 2; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_bIs2D = false; m_sQueueSample.m_nReleasingVolumeModificator = 1; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_nLoopCount = 1; - m_sQueueSample.m_bEmittingVolume = maxVolume; + m_sQueueSample.m_nEmittingVolume = maxVolume; m_sQueueSample.m_nLoopStart = 0; m_sQueueSample.m_nLoopEnd = -1; m_sQueueSample.m_fSpeedMultiplier = 2.0f; @@ -3921,17 +3917,17 @@ void cAudioManager::ProcessBridgeWarning() { if(CStats::CommercialPassed && m_sQueueSample.m_fDistance < 450.f) { - m_sQueueSample.m_bVolume = ComputeVolume(100, 450.f, m_sQueueSample.m_fDistance); - if(m_sQueueSample.m_bVolume) { + m_sQueueSample.m_nVolume = ComputeVolume(100, 450.f, m_sQueueSample.m_fDistance); + if(m_sQueueSample.m_nVolume) { m_sQueueSample.m_nCounter = 0; m_sQueueSample.m_nSampleIndex = SFX_BRIDGE_OPEN_WARNING; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_bIs2D = false; m_sQueueSample.m_nReleasingVolumeModificator = 1; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_BRIDGE_OPEN_WARNING); m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_bEmittingVolume = 100; + m_sQueueSample.m_nEmittingVolume = 100; m_sQueueSample.m_nLoopStart = SampleManager.GetSampleLoopStartOffset(m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_nLoopEnd = @@ -3956,17 +3952,17 @@ cAudioManager::ProcessCarBombTick(cVehicleParams *params) automobile = (CAutomobile *)params->m_pVehicle; if(automobile->bEngineOn && automobile->m_bombType == CARBOMB_TIMEDACTIVE) { CalculateDistance(params->m_bDistanceCalculated, params->m_fDistance); - m_sQueueSample.m_bVolume = ComputeVolume(60, 40.f, m_sQueueSample.m_fDistance); - if(m_sQueueSample.m_bVolume) { + m_sQueueSample.m_nVolume = ComputeVolume(60, 40.f, m_sQueueSample.m_fDistance); + if(m_sQueueSample.m_nVolume) { m_sQueueSample.m_nCounter = 35; m_sQueueSample.m_nSampleIndex = SFX_COUNTDOWN; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_bIs2D = false; m_sQueueSample.m_nReleasingVolumeModificator = 0; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_COUNTDOWN); m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_bEmittingVolume = 60; + m_sQueueSample.m_nEmittingVolume = 60; m_sQueueSample.m_nLoopStart = SampleManager.GetSampleLoopStartOffset(m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_nLoopEnd = @@ -4006,17 +4002,17 @@ cAudioManager::ProcessCesna(cVehicleParams *params) AddPlayerCarSample(105, 17000, SFX_CESNA_IDLE, 0, 52, 1); } else if(params->m_fDistance < 40000.f) { CalculateDistance(params->m_bDistanceCalculated, params->m_fDistance); - m_sQueueSample.m_bVolume = ComputeVolume(80, 200.f, m_sQueueSample.m_fDistance); - if(m_sQueueSample.m_bVolume) { + m_sQueueSample.m_nVolume = ComputeVolume(80, 200.f, m_sQueueSample.m_fDistance); + if(m_sQueueSample.m_nVolume) { m_sQueueSample.m_nCounter = 52; m_sQueueSample.m_nSampleIndex = SFX_CESNA_IDLE; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_bIs2D = false; m_sQueueSample.m_nReleasingVolumeModificator = 0; m_sQueueSample.m_nFrequency = 12500; m_sQueueSample.m_nLoopCount = 0; m_sQueueSample.m_nReleasingVolumeDivider = 8; - m_sQueueSample.m_bEmittingVolume = 80; + m_sQueueSample.m_nEmittingVolume = 80; m_sQueueSample.m_nLoopStart = SampleManager.GetSampleLoopStartOffset(m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_nLoopEnd = @@ -4029,18 +4025,18 @@ cAudioManager::ProcessCesna(cVehicleParams *params) AddSampleToRequestedQueue(); } if(params->m_fDistance < 8100.f) { - m_sQueueSample.m_bVolume = + m_sQueueSample.m_nVolume = ComputeVolume(80, 90.f, m_sQueueSample.m_fDistance); - if(m_sQueueSample.m_bVolume) { + if(m_sQueueSample.m_nVolume) { m_sQueueSample.m_nCounter = 2; m_sQueueSample.m_nSampleIndex = SFX_CESNA_REV; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_bIs2D = false; m_sQueueSample.m_nReleasingVolumeModificator = 0; m_sQueueSample.m_nFrequency = 25000; m_sQueueSample.m_nLoopCount = 0; m_sQueueSample.m_nReleasingVolumeDivider = 4; - m_sQueueSample.m_bEmittingVolume = 80; + m_sQueueSample.m_nEmittingVolume = 80; m_sQueueSample.m_nLoopStart = SampleManager.GetSampleLoopStartOffset( m_sQueueSample.m_nSampleIndex); @@ -4079,11 +4075,11 @@ cAudioManager::ProcessCinemaScriptObject(uint8 sound) if(distSquared < SQR(m_sQueueSample.m_fSoundIntensity)) { m_sQueueSample.m_fDistance = Sqrt(distSquared); rand = m_anRandomTable[0] % 90 + 30; - m_sQueueSample.m_bVolume = ComputeVolume( + m_sQueueSample.m_nVolume = ComputeVolume( rand, m_sQueueSample.m_fSoundIntensity, m_sQueueSample.m_fDistance); - if(m_sQueueSample.m_bVolume) { + if(m_sQueueSample.m_nVolume) { m_sQueueSample.m_nSampleIndex = counter % 3 + SFX_CINEMA_BASS_1; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency( m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_nFrequency += @@ -4094,7 +4090,7 @@ cAudioManager::ProcessCinemaScriptObject(uint8 sound) m_sQueueSample.m_bReleasingSoundFlag = true; m_sQueueSample.m_nReleasingVolumeModificator = 3; m_sQueueSample.m_fSpeedMultiplier = 2.0f; - m_sQueueSample.m_bEmittingVolume = rand; + m_sQueueSample.m_nEmittingVolume = rand; m_sQueueSample.m_nLoopStart = 0; m_sQueueSample.m_nLoopEnd = -1; m_sQueueSample.m_bReverbFlag = true; @@ -4121,17 +4117,17 @@ cAudioManager::ProcessCrane() distSquared = GetDistanceSquared(&this->m_sQueueSample.m_vecPos); if(distSquared < SQR(intensity)) { CalculateDistance(distCalculated, distSquared); - m_sQueueSample.m_bVolume = + m_sQueueSample.m_nVolume = ComputeVolume(100, 80.f, m_sQueueSample.m_fDistance); - if(m_sQueueSample.m_bVolume) { + if(m_sQueueSample.m_nVolume) { m_sQueueSample.m_nCounter = 0; m_sQueueSample.m_nSampleIndex = SFX_CRANE_MAGNET; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_bIs2D = false; m_sQueueSample.m_nReleasingVolumeModificator = 2; m_sQueueSample.m_nFrequency = 6000; m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_bEmittingVolume = 100; + m_sQueueSample.m_nEmittingVolume = 100; m_sQueueSample.m_nLoopStart = SampleManager.GetSampleLoopStartOffset( m_sQueueSample.m_nSampleIndex); @@ -4189,11 +4185,11 @@ cAudioManager::ProcessDocksScriptObject(uint8 sound) if(distSquared < SQR(m_sQueueSample.m_fSoundIntensity)) { m_sQueueSample.m_fDistance = Sqrt(distSquared); rand = m_anRandomTable[0] % 60 + 40; - m_sQueueSample.m_bVolume = ComputeVolume( + m_sQueueSample.m_nVolume = ComputeVolume( rand, m_sQueueSample.m_fSoundIntensity, m_sQueueSample.m_fDistance); - if(m_sQueueSample.m_bVolume) { + if(m_sQueueSample.m_nVolume) { m_sQueueSample.m_nSampleIndex = SFX_DOCKS_FOGHORN; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_DOCKS_FOGHORN); m_sQueueSample.m_nFrequency += @@ -4204,7 +4200,7 @@ cAudioManager::ProcessDocksScriptObject(uint8 sound) m_sQueueSample.m_bReleasingSoundFlag = true; m_sQueueSample.m_nReleasingVolumeModificator = 3; m_sQueueSample.m_fSpeedMultiplier = 2.0f; - m_sQueueSample.m_bEmittingVolume = rand; + m_sQueueSample.m_nEmittingVolume = rand; m_sQueueSample.m_nLoopStart = 0; m_sQueueSample.m_nLoopEnd = -1; m_sQueueSample.m_bReverbFlag = true; @@ -4241,14 +4237,14 @@ cAudioManager::ProcessEngineDamage(cVehicleParams *params) SampleManager.GetSampleBaseFrequency(SFX_CAR_ON_FIRE); } CalculateDistance(params->m_bDistanceCalculated, params->m_fDistance); - m_sQueueSample.m_bVolume = ComputeVolume(emittingVolume, engineDamageIntensity, + m_sQueueSample.m_nVolume = ComputeVolume(emittingVolume, engineDamageIntensity, m_sQueueSample.m_fDistance); - if(m_sQueueSample.m_bVolume) { + if(m_sQueueSample.m_nVolume) { m_sQueueSample.m_nCounter = 28; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_bIs2D = false; m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_bEmittingVolume = emittingVolume; + m_sQueueSample.m_nEmittingVolume = emittingVolume; m_sQueueSample.m_nLoopStart = SampleManager.GetSampleLoopStartOffset(m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_nLoopEnd = @@ -4268,47 +4264,47 @@ cAudioManager::ProcessEngineDamage(cVehicleParams *params) void cAudioManager::ProcessEntity(int32 id) { - if(m_asAudioEntities[id].m_bStatus) { + if(m_asAudioEntities[id].m_nStatus) { m_sQueueSample.m_nEntityIndex = id; switch(m_asAudioEntities[id].m_nType) { case AUDIOTYPE_PHYSICAL: - if(!m_bUserPause) { + if(!m_nUserPause) { m_sQueueSample.m_bReverbFlag = true; ProcessPhysical(id); } break; case AUDIOTYPE_EXPLOSION: - if(!m_bUserPause) { + if(!m_nUserPause) { m_sQueueSample.m_bReverbFlag = true; ProcessExplosions(id); } break; case AUDIOTYPE_FIRE: - if(!m_bUserPause) { + if(!m_nUserPause) { m_sQueueSample.m_bReverbFlag = true; ProcessFires(id); } break; case AUDIOTYPE_WEATHER: - if(!m_bUserPause) { + if(!m_nUserPause) { m_sQueueSample.m_bReverbFlag = true; ProcessWeather(id); } break; case AUDIOTYPE_CRANE: - if(!m_bUserPause) { + if(!m_nUserPause) { m_sQueueSample.m_bReverbFlag = true; ProcessCrane(); } break; case AUDIOTYPE_SCRIPTOBJECT: - if(!m_bUserPause) { + if(!m_nUserPause) { m_sQueueSample.m_bReverbFlag = true; ProcessScriptObject(id); } break; case AUDIOTYPE_BRIDGE: - if(!m_bUserPause) { + if(!m_nUserPause) { m_sQueueSample.m_bReverbFlag = true; ProcessBridge(); } @@ -4318,22 +4314,22 @@ cAudioManager::ProcessEntity(int32 id) ProcessFrontEnd(); break; case AUDIOTYPE_PROJECTILE: - if(!m_bUserPause) { + if(!m_nUserPause) { m_sQueueSample.m_bReverbFlag = true; ProcessProjectiles(); } break; case AUDIOTYPE_GARAGE: - if(!m_bUserPause) ProcessGarages(); + if(!m_nUserPause) ProcessGarages(); break; case AUDIOTYPE_FIREHYDRANT: - if(!m_bUserPause) { + if(!m_nUserPause) { m_sQueueSample.m_bReverbFlag = true; ProcessFireHydrant(); } break; case AUDIOTYPE_WATERCANNON: - if(!m_bUserPause) { + if(!m_nUserPause) { m_sQueueSample.m_bReverbFlag = true; ProcessWaterCannon(id); } @@ -4363,14 +4359,14 @@ cAudioManager::ProcessExplosions(int32 explosion) m_sQueueSample.m_nSampleIndex = SFX_EXPLOSION_2; m_sQueueSample.m_nFrequency = RandomDisplacement(2000) + 38000; m_sQueueSample.m_nReleasingVolumeModificator = 0; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; break; case EXPLOSION_MOLOTOV: m_sQueueSample.m_fSoundIntensity = 200.0f; m_sQueueSample.m_nSampleIndex = SFX_EXPLOSION_3; m_sQueueSample.m_nFrequency = RandomDisplacement(1000) + 19000; m_sQueueSample.m_nReleasingVolumeModificator = 0; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; break; case EXPLOSION_MINE: case EXPLOSION_HELI_BOMB: @@ -4378,7 +4374,7 @@ cAudioManager::ProcessExplosions(int32 explosion) m_sQueueSample.m_nSampleIndex = SFX_ROCKET_LEFT; m_sQueueSample.m_nFrequency = RandomDisplacement(1000) + 12347; m_sQueueSample.m_nReleasingVolumeModificator = 0; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; break; default: m_sQueueSample.m_fSoundIntensity = 400.0f; @@ -4388,7 +4384,7 @@ cAudioManager::ProcessExplosions(int32 explosion) m_sQueueSample.m_nFrequency = 8 * m_sQueueSample.m_nFrequency / 10; m_sQueueSample.m_nReleasingVolumeModificator = 0; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; break; } pos = CExplosion::GetExplosionPosition(i); @@ -4396,17 +4392,17 @@ cAudioManager::ProcessExplosions(int32 explosion) distSquared = GetDistanceSquared(&m_sQueueSample.m_vecPos); if(distSquared < SQR(m_sQueueSample.m_fSoundIntensity)) { m_sQueueSample.m_fDistance = Sqrt(distSquared); - m_sQueueSample.m_bVolume = + m_sQueueSample.m_nVolume = ComputeVolume(maxVolume, m_sQueueSample.m_fSoundIntensity, m_sQueueSample.m_fDistance); - if(m_sQueueSample.m_bVolume) { + if(m_sQueueSample.m_nVolume) { m_sQueueSample.m_nCounter = i; m_sQueueSample.m_fSpeedMultiplier = 2.0f; m_sQueueSample.m_bIs2D = false; m_sQueueSample.m_nLoopCount = 1; m_sQueueSample.m_bReleasingSoundFlag = true; m_sQueueSample.m_bReverbFlag = true; - m_sQueueSample.m_bEmittingVolume = maxVolume; + m_sQueueSample.m_nEmittingVolume = maxVolume; m_sQueueSample.m_nLoopStart = 0; m_sQueueSample.m_nLoopEnd = -1; m_sQueueSample.m_bReverbFlag = true; @@ -4430,16 +4426,16 @@ cAudioManager::ProcessFireHydrant() distSquared = GetDistanceSquared(&m_sQueueSample.m_vecPos); if(distSquared < SQR(intensity)) { CalculateDistance(distCalculated, distSquared); - m_sQueueSample.m_bVolume = ComputeVolume(40, 35.f, m_sQueueSample.m_fDistance); - if(m_sQueueSample.m_bVolume) { + m_sQueueSample.m_nVolume = ComputeVolume(40, 35.f, m_sQueueSample.m_fDistance); + if(m_sQueueSample.m_nVolume) { m_sQueueSample.m_nCounter = 0; m_sQueueSample.m_nSampleIndex = SFX_JUMBO_TAXI; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_bIs2D = false; m_sQueueSample.m_nReleasingVolumeModificator = 4; m_sQueueSample.m_nFrequency = 15591; m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_bEmittingVolume = 40; + m_sQueueSample.m_nEmittingVolume = 40; m_sQueueSample.m_nLoopStart = SampleManager.GetSampleLoopStartOffset(m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_nLoopEnd = @@ -4512,18 +4508,18 @@ void cAudioManager::ProcessFires(int32) distSquared = GetDistanceSquared(&m_sQueueSample.m_vecPos); if(distSquared < SQR(m_sQueueSample.m_fSoundIntensity)) { m_sQueueSample.m_fDistance = Sqrt(distSquared); - m_sQueueSample.m_bVolume = + m_sQueueSample.m_nVolume = ComputeVolume(emittingVol, m_sQueueSample.m_fSoundIntensity, m_sQueueSample.m_fDistance); - if(m_sQueueSample.m_bVolume) { + if(m_sQueueSample.m_nVolume) { m_sQueueSample.m_nCounter = i; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_fSpeedMultiplier = 2.0f; m_sQueueSample.m_nReleasingVolumeDivider = 10; m_sQueueSample.m_bIs2D = false; m_sQueueSample.m_nLoopCount = 0; m_sQueueSample.m_bReleasingSoundFlag = false; - m_sQueueSample.m_bEmittingVolume = emittingVol; + m_sQueueSample.m_nEmittingVolume = emittingVol; m_sQueueSample.m_nLoopStart = SampleManager.GetSampleLoopStartOffset( m_sQueueSample.m_nSampleIndex); @@ -4678,27 +4674,27 @@ cAudioManager::ProcessFrontEnd() m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex); } - m_sQueueSample.m_bVolume = 110; + m_sQueueSample.m_nVolume = 110; m_sQueueSample.m_nCounter = counter++; m_sQueueSample.m_nLoopCount = 1; m_sQueueSample.m_bReleasingSoundFlag = true; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_nReleasingVolumeModificator = 0; m_sQueueSample.m_bIs2D = true; - m_sQueueSample.m_bEmittingVolume = m_sQueueSample.m_bVolume; + m_sQueueSample.m_nEmittingVolume = m_sQueueSample.m_nVolume; m_sQueueSample.m_nLoopStart = 0; m_sQueueSample.m_nLoopEnd = -1; if(stereo) - m_sQueueSample.m_bOffset = m_anRandomTable[0] & 31; + m_sQueueSample.m_nOffset = m_anRandomTable[0] & 31; else - m_sQueueSample.m_bOffset = 63; + m_sQueueSample.m_nOffset = 63; m_sQueueSample.m_bReverbFlag = false; m_sQueueSample.m_bRequireReflection = false; AddSampleToRequestedQueue(); if(stereo) { ++m_sQueueSample.m_nSampleIndex; m_sQueueSample.m_nCounter = counter++; - m_sQueueSample.m_bOffset = maxVolume - m_sQueueSample.m_bOffset; + m_sQueueSample.m_nOffset = maxVolume - m_sQueueSample.m_nOffset; AddSampleToRequestedQueue(); } } @@ -4723,9 +4719,9 @@ cAudioManager::ProcessGarages() case SOUND_GARAGE_DOOR_OPENED: \ if(distSquared < 6400.f) { \ CalculateDistance(distCalculated, distSquared); \ - m_sQueueSample.m_bVolume = \ + m_sQueueSample.m_nVolume = \ ComputeVolume(60, 80.f, m_sQueueSample.m_fDistance); \ - if(m_sQueueSample.m_bVolume) { \ + if(m_sQueueSample.m_nVolume) { \ if(CGarages::aGarages[i].m_eGarageType == \ GARAGE_CRUSHER) { \ m_sQueueSample.m_nSampleIndex = \ @@ -4741,9 +4737,9 @@ cAudioManager::ProcessGarages() SFX_COL_GARAGE_DOOR_1; \ m_sQueueSample.m_nFrequency = 18000; \ } \ - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; \ + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; \ m_sQueueSample.m_nReleasingVolumeModificator = 4; \ - m_sQueueSample.m_bEmittingVolume = 60; \ + m_sQueueSample.m_nEmittingVolume = 60; \ m_sQueueSample.m_fSpeedMultiplier = 0.0f; \ m_sQueueSample.m_fSoundIntensity = 80.0f; \ /*m_sQueueSample.m_nReleasingVolumeModificator = 4;*/ \ @@ -4776,9 +4772,9 @@ cAudioManager::ProcessGarages() state = CGarages::aGarages[i].m_eGarageState; if(state == GS_OPENING || state == GS_CLOSING || state == GS_AFTERDROPOFF) { CalculateDistance(distCalculated, distSquared); - m_sQueueSample.m_bVolume = + m_sQueueSample.m_nVolume = ComputeVolume(90, 80.f, m_sQueueSample.m_fDistance); - if(m_sQueueSample.m_bVolume) { + if(m_sQueueSample.m_nVolume) { if(CGarages::aGarages[i].m_eGarageType == GARAGE_CRUSHER) { if(CGarages::aGarages[i].m_eGarageState == GS_AFTERDROPOFF) { @@ -4807,12 +4803,12 @@ cAudioManager::ProcessGarages() m_sQueueSample.m_bReleasingSoundFlag = true; m_sQueueSample.m_nCounter = iSound++; if(iSound < 32) iSound = 32; - m_sQueueSample.m_bBankIndex = + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_bIs2D = false; m_sQueueSample .m_nReleasingVolumeModificator = 3; - m_sQueueSample.m_bEmittingVolume = 90; + m_sQueueSample.m_nEmittingVolume = 90; m_sQueueSample.m_nLoopStart = SampleManager.GetSampleLoopStartOffset( m_sQueueSample.m_nSampleIndex); @@ -4839,10 +4835,10 @@ cAudioManager::ProcessGarages() m_sQueueSample.m_nLoopCount = 0; m_sQueueSample.m_nReleasingVolumeDivider = 3; m_sQueueSample.m_bReleasingSoundFlag = false; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_bIs2D = false; m_sQueueSample.m_nReleasingVolumeModificator = 3; - m_sQueueSample.m_bEmittingVolume = 90; + m_sQueueSample.m_nEmittingVolume = 90; m_sQueueSample.m_nLoopStart = SampleManager.GetSampleLoopStartOffset( m_sQueueSample.m_nSampleIndex); @@ -4896,19 +4892,19 @@ cAudioManager::ProcessHelicopter(cVehicleParams *params) else emittingVol = gHeliSfxRanges[i].m_bBaseVolume; - m_sQueueSample.m_bVolume = ComputeVolume( + m_sQueueSample.m_nVolume = ComputeVolume( emittingVol, gHeliSfxRanges[i].m_fMaxDistance, m_sQueueSample.m_fDistance); - if(m_sQueueSample.m_bVolume) { + if(m_sQueueSample.m_nVolume) { m_sQueueSample.m_nCounter = i + 65; m_sQueueSample.m_nSampleIndex = i + SFX_HELI_1; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_bIs2D = false; m_sQueueSample.m_nReleasingVolumeModificator = 0; m_sQueueSample.m_nFrequency = 1200 * heli->m_nHeliId + SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_bEmittingVolume = emittingVol; + m_sQueueSample.m_nEmittingVolume = emittingVol; m_sQueueSample.m_nLoopStart = SampleManager.GetSampleLoopStartOffset(m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_nLoopEnd = @@ -4949,11 +4945,11 @@ cAudioManager::ProcessHomeScriptObject(uint8 sound) if(dist < SQR(m_sQueueSample.m_fSoundIntensity)) { m_sQueueSample.m_fDistance = Sqrt(dist); rand = m_anRandomTable[0] % 30 + 40; - m_sQueueSample.m_bVolume = ComputeVolume( + m_sQueueSample.m_nVolume = ComputeVolume( rand, m_sQueueSample.m_fSoundIntensity, m_sQueueSample.m_fDistance); - if(m_sQueueSample.m_bVolume) { + if(m_sQueueSample.m_nVolume) { m_sQueueSample.m_nSampleIndex = m_anRandomTable[0] % 5 + SFX_HOME_1; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency( m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_nFrequency += @@ -4964,7 +4960,7 @@ cAudioManager::ProcessHomeScriptObject(uint8 sound) m_sQueueSample.m_bReleasingSoundFlag = true; m_sQueueSample.m_nReleasingVolumeModificator = 3; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_bEmittingVolume = rand; + m_sQueueSample.m_nEmittingVolume = rand; m_sQueueSample.m_nLoopStart = 0; m_sQueueSample.m_nLoopEnd = -1; m_sQueueSample.m_bReverbFlag = true; @@ -5100,11 +5096,11 @@ cAudioManager::ProcessLaunderetteScriptObject(uint8 sound) float distSquared = GetDistanceSquared(&m_sQueueSample.m_vecPos); if(distSquared < SQR(m_sQueueSample.m_fSoundIntensity)) { m_sQueueSample.m_fDistance = Sqrt(distSquared); - m_sQueueSample.m_bVolume = + m_sQueueSample.m_nVolume = ComputeVolume(45, m_sQueueSample.m_fSoundIntensity, m_sQueueSample.m_fDistance); - if(m_sQueueSample.m_bVolume) { + if(m_sQueueSample.m_nVolume) { m_sQueueSample.m_nSampleIndex = SFX_LAUNDERETTE_LOOP; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_LAUNDERETTE_LOOP); m_sQueueSample.m_nCounter = 0; @@ -5113,7 +5109,7 @@ cAudioManager::ProcessLaunderetteScriptObject(uint8 sound) m_sQueueSample.m_bReleasingSoundFlag = false; m_sQueueSample.m_nReleasingVolumeModificator = 5; m_sQueueSample.m_fSpeedMultiplier = 2.0f; - m_sQueueSample.m_bEmittingVolume = 45; + m_sQueueSample.m_nEmittingVolume = 45; m_sQueueSample.m_nLoopStart = SampleManager.GetSampleLoopStartOffset(m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_nLoopEnd = @@ -5122,11 +5118,11 @@ cAudioManager::ProcessLaunderetteScriptObject(uint8 sound) m_sQueueSample.m_bRequireReflection = false; AddSampleToRequestedQueue(); } - m_sQueueSample.m_bVolume = ComputeVolume(110, m_sQueueSample.m_fSoundIntensity, + m_sQueueSample.m_nVolume = ComputeVolume(110, m_sQueueSample.m_fSoundIntensity, m_sQueueSample.m_fDistance); - if(m_sQueueSample.m_bVolume) { + if(m_sQueueSample.m_nVolume) { m_sQueueSample.m_nSampleIndex = SFX_LAUNDERETTE_SONG_LOOP; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_LAUNDERETTE_SONG_LOOP); m_sQueueSample.m_nCounter = 1; @@ -5135,7 +5131,7 @@ cAudioManager::ProcessLaunderetteScriptObject(uint8 sound) m_sQueueSample.m_bReleasingSoundFlag = false; m_sQueueSample.m_nReleasingVolumeModificator = 3; m_sQueueSample.m_fSpeedMultiplier = 2.0f; - m_sQueueSample.m_bEmittingVolume = 110; + m_sQueueSample.m_nEmittingVolume = 110; m_sQueueSample.m_nLoopStart = SampleManager.GetSampleLoopStartOffset(m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_nLoopEnd = @@ -5157,7 +5153,7 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) case SCRIPT_SOUND_PARTY_1_LOOP_S: m_sQueueSample.m_fSoundIntensity = 30.0f; m_sQueueSample.m_nSampleIndex = SFX_CLUB_1; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; emittingVolume = maxVolume; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_CLUB_1); m_sQueueSample.m_nReleasingVolumeModificator = 3; @@ -5167,7 +5163,7 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) case SCRIPT_SOUND_PARTY_1_LOOP_L: m_sQueueSample.m_fSoundIntensity = 80.0f; m_sQueueSample.m_nSampleIndex = SFX_CLUB_1; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; emittingVolume = maxVolume; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_CLUB_1); m_sQueueSample.m_nReleasingVolumeModificator = 3; @@ -5177,7 +5173,7 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) case SCRIPT_SOUND_PARTY_2_LOOP_S: m_sQueueSample.m_fSoundIntensity = 30.0f; m_sQueueSample.m_nSampleIndex = SFX_CLUB_2; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; emittingVolume = maxVolume; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_CLUB_2); m_sQueueSample.m_nReleasingVolumeModificator = 3; @@ -5187,7 +5183,7 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) case SCRIPT_SOUND_PARTY_2_LOOP_L: m_sQueueSample.m_fSoundIntensity = 80.0f; m_sQueueSample.m_nSampleIndex = SFX_CLUB_2; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; emittingVolume = maxVolume; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_CLUB_2); m_sQueueSample.m_nReleasingVolumeModificator = 3; @@ -5197,7 +5193,7 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) case SCRIPT_SOUND_PARTY_3_LOOP_S: m_sQueueSample.m_fSoundIntensity = 30.0f; m_sQueueSample.m_nSampleIndex = SFX_CLUB_3; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; emittingVolume = maxVolume; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_CLUB_3); m_sQueueSample.m_nReleasingVolumeModificator = 3; @@ -5207,7 +5203,7 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) case SCRIPT_SOUND_PARTY_3_LOOP_L: m_sQueueSample.m_fSoundIntensity = 80.0f; m_sQueueSample.m_nSampleIndex = SFX_CLUB_3; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; emittingVolume = maxVolume; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_CLUB_3); m_sQueueSample.m_nReleasingVolumeModificator = 3; @@ -5217,7 +5213,7 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) case SCRIPT_SOUND_PARTY_4_LOOP_S: m_sQueueSample.m_fSoundIntensity = 30.0f; m_sQueueSample.m_nSampleIndex = SFX_CLUB_4; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; emittingVolume = maxVolume; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_CLUB_4); m_sQueueSample.m_nReleasingVolumeModificator = 3; @@ -5227,7 +5223,7 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) case SCRIPT_SOUND_PARTY_4_LOOP_L: m_sQueueSample.m_fSoundIntensity = 80.0f; m_sQueueSample.m_nSampleIndex = SFX_CLUB_4; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; emittingVolume = maxVolume; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_CLUB_4); m_sQueueSample.m_nReleasingVolumeModificator = 3; @@ -5237,7 +5233,7 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) case SCRIPT_SOUND_PARTY_5_LOOP_S: m_sQueueSample.m_fSoundIntensity = 30.0f; m_sQueueSample.m_nSampleIndex = SFX_CLUB_5; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; emittingVolume = maxVolume; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_CLUB_5); m_sQueueSample.m_nReleasingVolumeModificator = 3; @@ -5247,7 +5243,7 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) case SCRIPT_SOUND_PARTY_5_LOOP_L: m_sQueueSample.m_fSoundIntensity = 80.0f; m_sQueueSample.m_nSampleIndex = SFX_CLUB_5; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; emittingVolume = maxVolume; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_CLUB_5); m_sQueueSample.m_nReleasingVolumeModificator = 3; @@ -5257,7 +5253,7 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) case SCRIPT_SOUND_PARTY_6_LOOP_S: m_sQueueSample.m_fSoundIntensity = 30.0f; m_sQueueSample.m_nSampleIndex = SFX_CLUB_6; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; emittingVolume = maxVolume; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_CLUB_6); m_sQueueSample.m_nReleasingVolumeModificator = 3; @@ -5267,7 +5263,7 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) case SCRIPT_SOUND_PARTY_6_LOOP_L: m_sQueueSample.m_fSoundIntensity = 80.0f; m_sQueueSample.m_nSampleIndex = SFX_CLUB_6; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; emittingVolume = maxVolume; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_CLUB_6); m_sQueueSample.m_nReleasingVolumeModificator = 3; @@ -5277,7 +5273,7 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) case SCRIPT_SOUND_PARTY_7_LOOP_S: m_sQueueSample.m_fSoundIntensity = 30.0f; m_sQueueSample.m_nSampleIndex = SFX_CLUB_7; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; emittingVolume = maxVolume; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_CLUB_7); m_sQueueSample.m_nReleasingVolumeModificator = 3; @@ -5287,7 +5283,7 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) case SCRIPT_SOUND_PARTY_7_LOOP_L: m_sQueueSample.m_fSoundIntensity = 80.0f; m_sQueueSample.m_nSampleIndex = SFX_CLUB_7; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; emittingVolume = maxVolume; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_CLUB_7); m_sQueueSample.m_nReleasingVolumeModificator = 3; @@ -5297,7 +5293,7 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) case SCRIPT_SOUND_PARTY_8_LOOP_S: m_sQueueSample.m_fSoundIntensity = 30.0f; m_sQueueSample.m_nSampleIndex = SFX_CLUB_8; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; emittingVolume = maxVolume; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_CLUB_8); m_sQueueSample.m_nReleasingVolumeModificator = 3; @@ -5307,7 +5303,7 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) case SCRIPT_SOUND_PARTY_8_LOOP_L: m_sQueueSample.m_fSoundIntensity = 80.0f; m_sQueueSample.m_nSampleIndex = SFX_CLUB_8; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; emittingVolume = maxVolume; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_CLUB_8); m_sQueueSample.m_nReleasingVolumeModificator = 3; @@ -5317,7 +5313,7 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) case SCRIPT_SOUND_PARTY_9_LOOP_S: m_sQueueSample.m_fSoundIntensity = 30.0f; m_sQueueSample.m_nSampleIndex = SFX_CLUB_9; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; emittingVolume = maxVolume; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_CLUB_9); m_sQueueSample.m_nReleasingVolumeModificator = 3; @@ -5327,7 +5323,7 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) case SCRIPT_SOUND_PARTY_9_LOOP_L: m_sQueueSample.m_fSoundIntensity = 80.0f; m_sQueueSample.m_nSampleIndex = SFX_CLUB_9; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; emittingVolume = maxVolume; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_CLUB_9); m_sQueueSample.m_nReleasingVolumeModificator = 3; @@ -5337,7 +5333,7 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) case SCRIPT_SOUND_PARTY_10_LOOP_S: m_sQueueSample.m_fSoundIntensity = 30.0f; m_sQueueSample.m_nSampleIndex = SFX_CLUB_10; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; emittingVolume = maxVolume; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_CLUB_10); m_sQueueSample.m_nReleasingVolumeModificator = 3; @@ -5347,7 +5343,7 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) case SCRIPT_SOUND_PARTY_10_LOOP_L: m_sQueueSample.m_fSoundIntensity = 80.0f; m_sQueueSample.m_nSampleIndex = SFX_CLUB_10; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; emittingVolume = maxVolume; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_CLUB_10); m_sQueueSample.m_nReleasingVolumeModificator = 3; @@ -5357,7 +5353,7 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) case SCRIPT_SOUND_PARTY_11_LOOP_S: m_sQueueSample.m_fSoundIntensity = 30.0f; m_sQueueSample.m_nSampleIndex = SFX_CLUB_11; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; emittingVolume = maxVolume; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_CLUB_11); m_sQueueSample.m_nReleasingVolumeModificator = 3; @@ -5367,7 +5363,7 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) case SCRIPT_SOUND_PARTY_11_LOOP_L: m_sQueueSample.m_fSoundIntensity = 80.0f; m_sQueueSample.m_nSampleIndex = SFX_CLUB_11; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; emittingVolume = maxVolume; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_CLUB_11); m_sQueueSample.m_nReleasingVolumeModificator = 3; @@ -5377,7 +5373,7 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) case SCRIPT_SOUND_PARTY_12_LOOP_S: m_sQueueSample.m_fSoundIntensity = 30.0f; m_sQueueSample.m_nSampleIndex = SFX_CLUB_12; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; emittingVolume = maxVolume; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_CLUB_12); m_sQueueSample.m_nReleasingVolumeModificator = 3; @@ -5387,7 +5383,7 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) case SCRIPT_SOUND_PARTY_12_LOOP_L: m_sQueueSample.m_fSoundIntensity = 80.0f; m_sQueueSample.m_nSampleIndex = SFX_CLUB_12; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; emittingVolume = maxVolume; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_CLUB_12); m_sQueueSample.m_nReleasingVolumeModificator = 3; @@ -5397,7 +5393,7 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) case SCRIPT_SOUND_PARTY_13_LOOP_S: m_sQueueSample.m_fSoundIntensity = 30.0f; m_sQueueSample.m_nSampleIndex = SFX_CLUB_RAGGA; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; emittingVolume = maxVolume; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_CLUB_RAGGA); m_sQueueSample.m_nReleasingVolumeModificator = 3; @@ -5407,7 +5403,7 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) case SCRIPT_SOUND_PARTY_13_LOOP_L: m_sQueueSample.m_fSoundIntensity = 80.0f; m_sQueueSample.m_nSampleIndex = SFX_CLUB_RAGGA; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; emittingVolume = maxVolume; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_CLUB_RAGGA); m_sQueueSample.m_nReleasingVolumeModificator = 3; @@ -5417,7 +5413,7 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) case SCRIPT_SOUND_STRIP_CLUB_LOOP_1_S: m_sQueueSample.m_fSoundIntensity = 30.0f; m_sQueueSample.m_nSampleIndex = SFX_STRIP_CLUB_1; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; emittingVolume = maxVolume; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_STRIP_CLUB_1); @@ -5428,7 +5424,7 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) case SCRIPT_SOUND_STRIP_CLUB_LOOP_1_L: m_sQueueSample.m_fSoundIntensity = 80.0f; m_sQueueSample.m_nSampleIndex = SFX_STRIP_CLUB_1; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; emittingVolume = maxVolume; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_STRIP_CLUB_1); @@ -5439,7 +5435,7 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) case SCRIPT_SOUND_STRIP_CLUB_LOOP_2_S: m_sQueueSample.m_fSoundIntensity = 30.0f; m_sQueueSample.m_nSampleIndex = SFX_STRIP_CLUB_2; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; emittingVolume = maxVolume; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_STRIP_CLUB_2); @@ -5450,7 +5446,7 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) case SCRIPT_SOUND_STRIP_CLUB_LOOP_2_L: m_sQueueSample.m_fSoundIntensity = 80.0f; m_sQueueSample.m_nSampleIndex = SFX_STRIP_CLUB_2; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; emittingVolume = maxVolume; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_STRIP_CLUB_2); @@ -5465,7 +5461,7 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) case SCRIPT_SOUND_38: m_sQueueSample.m_fSoundIntensity = 30.0f; m_sQueueSample.m_nSampleIndex = SFX_DOG_FOOD_FACTORY; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; emittingVolume = 110; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_DOG_FOOD_FACTORY); @@ -5476,7 +5472,7 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) case SCRIPT_SOUND_39: m_sQueueSample.m_fSoundIntensity = 80.0f; m_sQueueSample.m_nSampleIndex = SFX_DOG_FOOD_FACTORY; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; emittingVolume = 110; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_DOG_FOOD_FACTORY); @@ -5489,7 +5485,7 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) case SCRIPT_SOUND_CHINATOWN_RESTAURANT_S: m_sQueueSample.m_fSoundIntensity = 30.0f; m_sQueueSample.m_nSampleIndex = SFX_RESTAURANT_CHINATOWN; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; emittingVolume = 110; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_RESTAURANT_CHINATOWN); @@ -5500,7 +5496,7 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) case SCRIPT_SOUND_CHINATOWN_RESTAURANT_L: m_sQueueSample.m_fSoundIntensity = 80.0f; m_sQueueSample.m_nSampleIndex = SFX_RESTAURANT_CHINATOWN; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; emittingVolume = 110; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_RESTAURANT_CHINATOWN); @@ -5511,7 +5507,7 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) case SCRIPT_SOUND_CIPRIANI_RESAURANT_S: m_sQueueSample.m_fSoundIntensity = 30.0f; m_sQueueSample.m_nSampleIndex = SFX_RESTAURANT_ITALY; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; emittingVolume = 110; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_RESTAURANT_ITALY); @@ -5522,7 +5518,7 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) case SCRIPT_SOUND_CIPRIANI_RESAURANT_L: m_sQueueSample.m_fSoundIntensity = 80.0f; m_sQueueSample.m_nSampleIndex = SFX_RESTAURANT_ITALY; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; emittingVolume = 110; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_RESTAURANT_ITALY); @@ -5533,7 +5529,7 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) case SCRIPT_SOUND_46_S: m_sQueueSample.m_fSoundIntensity = 30.0f; m_sQueueSample.m_nSampleIndex = SFX_RESTAURANT_GENERIC_1; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; emittingVolume = 110; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_RESTAURANT_GENERIC_1); @@ -5544,7 +5540,7 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) case SCRIPT_SOUND_47_L: m_sQueueSample.m_fSoundIntensity = 80.0f; m_sQueueSample.m_nSampleIndex = SFX_RESTAURANT_GENERIC_1; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; emittingVolume = 110; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_RESTAURANT_GENERIC_1); @@ -5555,7 +5551,7 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) case SCRIPT_SOUND_MARCO_BISTRO_S: m_sQueueSample.m_fSoundIntensity = 30.0f; m_sQueueSample.m_nSampleIndex = SFX_RESTAURANT_GENERIC_2; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; emittingVolume = 110; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_RESTAURANT_GENERIC_2); @@ -5566,7 +5562,7 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) case SCRIPT_SOUND_MARCO_BISTRO_L: m_sQueueSample.m_fSoundIntensity = 80.0f; m_sQueueSample.m_nSampleIndex = SFX_RESTAURANT_GENERIC_2; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; emittingVolume = 110; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_RESTAURANT_GENERIC_2); @@ -5587,7 +5583,7 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) case SCRIPT_SOUND_FRANKIE_PIANO: m_sQueueSample.m_fSoundIntensity = 30.0f; m_sQueueSample.m_nSampleIndex = SFX_PIANO_BAR_1; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; emittingVolume = maxVolume; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_PIANO_BAR_1); m_sQueueSample.m_nReleasingVolumeModificator = 3; @@ -5597,7 +5593,7 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) case SCRIPT_SOUND_PARTY_1_LOOP: m_sQueueSample.m_fSoundIntensity = 80.0f; m_sQueueSample.m_nSampleIndex = SFX_CLUB_1; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; emittingVolume = maxVolume; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_CLUB_1); m_sQueueSample.m_nReleasingVolumeModificator = 3; @@ -5615,7 +5611,7 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) case SCRIPT_SOUND_BANK_ALARM_LOOP_S: m_sQueueSample.m_fSoundIntensity = 30.0f; m_sQueueSample.m_nSampleIndex = SFX_BANK_ALARM_1; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; emittingVolume = 90; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_BANK_ALARM_1); @@ -5626,7 +5622,7 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) case SCRIPT_SOUND_BANK_ALARM_LOOP_L: m_sQueueSample.m_fSoundIntensity = 80.0f; m_sQueueSample.m_nSampleIndex = SFX_BANK_ALARM_1; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; emittingVolume = 90; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_BANK_ALARM_1); @@ -5637,7 +5633,7 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) case SCRIPT_SOUND_POLICE_BALL_LOOP_S: m_sQueueSample.m_fSoundIntensity = 30.0f; m_sQueueSample.m_nSampleIndex = SFX_POLICE_BALL_1; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; emittingVolume = maxVolume; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_POLICE_BALL_1); @@ -5648,7 +5644,7 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) case SCRIPT_SOUND_POLICE_BALL_LOOP_L: m_sQueueSample.m_fSoundIntensity = 80.0f; m_sQueueSample.m_nSampleIndex = SFX_POLICE_BALL_1; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; emittingVolume = maxVolume; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_POLICE_BALL_1); @@ -5659,7 +5655,7 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) case SCRIPT_SOUND_RAVE_LOOP_INDUSTRIAL_S: m_sQueueSample.m_fSoundIntensity = 30.0f; m_sQueueSample.m_nSampleIndex = SFX_RAVE_INDUSTRIAL; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; emittingVolume = maxVolume; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_RAVE_INDUSTRIAL); @@ -5670,7 +5666,7 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) case SCRIPT_SOUND_RAVE_LOOP_INDUSTRIAL_L: m_sQueueSample.m_fSoundIntensity = 80.0f; m_sQueueSample.m_nSampleIndex = SFX_RAVE_INDUSTRIAL; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; emittingVolume = maxVolume; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_RAVE_INDUSTRIAL); @@ -5686,7 +5682,7 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) case SCRIPT_SOUND_RAVE_2_LOOP_S: m_sQueueSample.m_fSoundIntensity = 30.0f; m_sQueueSample.m_nSampleIndex = SFX_RAVE_COMMERCIAL; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; emittingVolume = maxVolume; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex); @@ -5698,7 +5694,7 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) case SCRIPT_SOUND_RAVE_2_LOOP_L: m_sQueueSample.m_fSoundIntensity = 80.0f; m_sQueueSample.m_nSampleIndex = SFX_RAVE_COMMERCIAL; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; emittingVolume = maxVolume; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex); @@ -5709,7 +5705,7 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) case SCRIPT_SOUND_RAVE_3_LOOP_S: m_sQueueSample.m_fSoundIntensity = 30.0f; m_sQueueSample.m_nSampleIndex = SFX_RAVE_SUBURBAN; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; emittingVolume = maxVolume; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_RAVE_SUBURBAN); @@ -5720,7 +5716,7 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) case SCRIPT_SOUND_RAVE_3_LOOP_L: m_sQueueSample.m_fSoundIntensity = 80.0f; m_sQueueSample.m_nSampleIndex = SFX_RAVE_SUBURBAN; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; emittingVolume = maxVolume; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_RAVE_SUBURBAN); @@ -5731,7 +5727,7 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) case SCRIPT_SOUND_PRETEND_FIRE_LOOP: m_sQueueSample.m_fSoundIntensity = 50.0f; m_sQueueSample.m_nSampleIndex = SFX_CAR_ON_FIRE; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; emittingVolume = 80; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_CAR_ON_FIRE); m_sQueueSample.m_nReleasingVolumeModificator = 8; @@ -5744,15 +5740,15 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) distSquared = GetDistanceSquared(&m_sQueueSample.m_vecPos); if(distSquared < SQR(m_sQueueSample.m_fSoundIntensity)) { m_sQueueSample.m_fDistance = Sqrt(distSquared); - m_sQueueSample.m_bVolume = ComputeVolume( + m_sQueueSample.m_nVolume = ComputeVolume( emittingVolume, m_sQueueSample.m_fSoundIntensity, m_sQueueSample.m_fDistance); - if(m_sQueueSample.m_bVolume) { + if(m_sQueueSample.m_nVolume) { m_sQueueSample.m_nCounter = 0; m_sQueueSample.m_bIs2D = false; m_sQueueSample.m_nLoopCount = 0; m_sQueueSample.m_bReleasingSoundFlag = false; m_sQueueSample.m_bReverbFlag = true; - m_sQueueSample.m_bEmittingVolume = emittingVolume; + m_sQueueSample.m_nEmittingVolume = emittingVolume; m_sQueueSample.m_nLoopStart = SampleManager.GetSampleLoopStartOffset(m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_nLoopEnd = @@ -5778,11 +5774,11 @@ cAudioManager::ProcessMissionAudio() if(m_bIsInitialised) { if(m_sMissionAudio.m_nSampleIndex != NO_SAMPLE) { - switch(m_sMissionAudio.m_bLoadingStatus) { + switch(m_sMissionAudio.m_nLoadingStatus) { case LOADING_STATUS_NOT_LOADED: SampleManager.PreloadStreamedFile(m_sMissionAudio.m_nSampleIndex, 1); - m_sMissionAudio.m_bLoadingStatus = LOADING_STATUS_LOADED; + m_sMissionAudio.m_nLoadingStatus = LOADING_STATUS_LOADED; nFramesUntilFailedLoad = 0; return; case LOADING_STATUS_LOADED: @@ -5794,19 +5790,19 @@ cAudioManager::ProcessMissionAudio() nFramesForPretendPlaying = 0; nCheckPlayingDelay = 0; nFramesUntilFailedLoad = 0; - } else if(!m_bUserPause) { + } else if(!m_nUserPause) { if(++nFramesForPretendPlaying < 120) { - m_sMissionAudio.m_bPlayStatus = + m_sMissionAudio.m_nPlayStatus = PLAY_STATUS_PLAYING; } else { - m_sMissionAudio.m_bPlayStatus = + m_sMissionAudio.m_nPlayStatus = PLAY_STATUS_FINISHED; m_sMissionAudio.m_nSampleIndex = NO_SAMPLE; } } } else { - if(m_sMissionAudio.m_bPlayStatus) { - if(m_sMissionAudio.m_bPlayStatus != + if(m_sMissionAudio.m_nPlayStatus) { + if(m_sMissionAudio.m_nPlayStatus != PLAY_STATUS_PLAYING) return; if(m_bTimerJustReset) { @@ -5816,7 +5812,7 @@ cAudioManager::ProcessMissionAudio() } if(MissionScriptAudioUsesPoliceChannel( m_sMissionAudio.m_nSampleIndex)) { - if(!m_bUserPause) { + if(!m_nUserPause) { if(nCheckPlayingDelay) { --nCheckPlayingDelay; } else if( @@ -5826,7 +5822,7 @@ cAudioManager::ProcessMissionAudio() .m_nMissionAudioCounter-- == 0) { m_sMissionAudio - .m_bPlayStatus = + .m_nPlayStatus = PLAY_STATUS_FINISHED; m_sMissionAudio .m_nSampleIndex = @@ -5840,15 +5836,15 @@ cAudioManager::ProcessMissionAudio() } } else if(m_sMissionAudio.field_22) { if(SampleManager.IsStreamPlaying(1) || - m_bUserPause || m_bPreviousUserPause) { - if(m_bUserPause) + m_nUserPause || m_nPreviousUserPause) { + if(m_nUserPause) SampleManager.PauseStream( 1, 1); else SampleManager.PauseStream( 0, 1); } else { - m_sMissionAudio.m_bPlayStatus = + m_sMissionAudio.m_nPlayStatus = PLAY_STATUS_FINISHED; m_sMissionAudio.m_nSampleIndex = NO_SAMPLE; @@ -5857,7 +5853,7 @@ cAudioManager::ProcessMissionAudio() .m_nMissionAudioCounter = 0; } } else { - if(m_bUserPause) return; + if(m_nUserPause) return; if(nCheckPlayingDelay--) { if(!SampleManager.IsStreamPlaying( 1)) @@ -5872,7 +5868,7 @@ cAudioManager::ProcessMissionAudio() SetMissionScriptPoliceAudio( m_sMissionAudio.m_nSampleIndex); } else { - if(m_bUserPause) + if(m_nUserPause) SampleManager.PauseStream(1, 1); if(m_sMissionAudio .m_bPredefinedProperties) { @@ -5902,7 +5898,7 @@ cAudioManager::ProcessMissionAudio() } SampleManager.StartPreloadedStreamedFile(1); } - m_sMissionAudio.m_bPlayStatus = PLAY_STATUS_PLAYING; + m_sMissionAudio.m_nPlayStatus = PLAY_STATUS_PLAYING; nCheckPlayingDelay = 30; } } @@ -5912,7 +5908,7 @@ cAudioManager::ProcessMissionAudio() nFramesForPretendPlaying = 0; g_bMissionAudioLoadFailed = true; nFramesUntilFailedLoad = 0; - m_sMissionAudio.m_bLoadingStatus = LOADING_STATUS_LOADED; + m_sMissionAudio.m_nLoadingStatus = LOADING_STATUS_LOADED; } return; default: return; @@ -5950,13 +5946,13 @@ cAudioManager::ProcessModelCarEngine(cVehicleParams *params) if(emittingVol) { CalculateDistance(params->m_bDistanceCalculated, params->m_fDistance); - m_sQueueSample.m_bVolume = ComputeVolume( + m_sQueueSample.m_nVolume = ComputeVolume( emittingVol, 30.f, m_sQueueSample.m_fDistance); - if(m_sQueueSample.m_bVolume) { + if(m_sQueueSample.m_nVolume) { m_sQueueSample.m_nCounter = 2; m_sQueueSample.m_nSampleIndex = SFX_REMOTE_CONTROLLED_CAR; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_bIs2D = false; m_sQueueSample.m_nReleasingVolumeModificator = 1; m_sQueueSample.m_nFrequency = @@ -5964,7 +5960,7 @@ cAudioManager::ProcessModelCarEngine(cVehicleParams *params) params->m_pTransmission->fMaxVelocity + 11025.f); m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_bEmittingVolume = emittingVol; + m_sQueueSample.m_nEmittingVolume = emittingVol; m_sQueueSample.m_nLoopStart = SampleManager.GetSampleLoopStartOffset( m_sQueueSample.m_nSampleIndex); @@ -6001,14 +5997,14 @@ cAudioManager::ProcessOneShotScriptObject(uint8 sound) case SCRIPT_SOUND_INJURED_PED_MALE_OUCH_S: case SCRIPT_SOUND_INJURED_PED_MALE_OUCH_L: male.m_pPed = nil; - male.m_bDistanceCalculated = 0; + male.m_bDistanceCalculated = false; male.m_fDistance = GetDistanceSquared(&m_sQueueSample.m_vecPos); SetupPedComments(&male, SOUND_INJURED_PED_MALE_OUCH); return; case SCRIPT_SOUND_INJURED_PED_FEMALE_OUCH_S: case SCRIPT_SOUND_INJURED_PED_FEMALE_OUCH_L: female.m_pPed = nil; - female.m_bDistanceCalculated = 0; + female.m_bDistanceCalculated = false; female.m_fDistance = GetDistanceSquared(&m_sQueueSample.m_vecPos); SetupPedComments(&female, SOUND_INJURED_PED_FEMALE); return; @@ -6016,7 +6012,7 @@ cAudioManager::ProcessOneShotScriptObject(uint8 sound) case SCRIPT_SOUND_GATE_STOP_CLUNK: m_sQueueSample.m_fSoundIntensity = 40.0f; m_sQueueSample.m_nSampleIndex = SFX_COL_GATE; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; if(sound == SCRIPT_SOUND_GATE_START_CLUNK) m_sQueueSample.m_nFrequency = 10600; else @@ -6032,7 +6028,7 @@ cAudioManager::ProcessOneShotScriptObject(uint8 sound) case SCRIPT_SOUND_BULLET_HIT_GROUND_3: m_sQueueSample.m_fSoundIntensity = 50.0f; m_sQueueSample.m_nSampleIndex = m_anRandomTable[iSound % 5] % 3 + SFX_BULLET_WALL_1; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_nFrequency += RandomDisplacement(m_sQueueSample.m_nFrequency >> 5); @@ -6046,7 +6042,7 @@ cAudioManager::ProcessOneShotScriptObject(uint8 sound) if(SampleManager.IsSampleBankLoaded(0) != 1) return; m_sQueueSample.m_fSoundIntensity = 80.0f; m_sQueueSample.m_nSampleIndex = SFX_TRAIN_STATION_ANNOUNCE; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; emittingVolume = maxVolume; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_TRAIN_STATION_ANNOUNCE); @@ -6057,7 +6053,7 @@ cAudioManager::ProcessOneShotScriptObject(uint8 sound) case SCRIPT_SOUND_PAYPHONE_RINGING: m_sQueueSample.m_fSoundIntensity = 80.0f; m_sQueueSample.m_nSampleIndex = SFX_PHONE_RING; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; emittingVolume = 80; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_PHONE_RING); m_sQueueSample.m_nReleasingVolumeModificator = 1; @@ -6068,7 +6064,7 @@ cAudioManager::ProcessOneShotScriptObject(uint8 sound) case SCRIPT_SOUND_GLASS_BREAK_L: m_sQueueSample.m_fSoundIntensity = 60.0f; m_sQueueSample.m_nSampleIndex = SFX_GLASS_SMASH; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; emittingVolume = 70; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_GLASS_SMASH); m_sQueueSample.m_nReleasingVolumeModificator = 3; @@ -6078,7 +6074,7 @@ cAudioManager::ProcessOneShotScriptObject(uint8 sound) case SCRIPT_SOUND_GLASS_BREAK_S: m_sQueueSample.m_fSoundIntensity = 60.0f; m_sQueueSample.m_nSampleIndex = SFX_GLASS_SMASH; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; emittingVolume = 60; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_GLASS_SMASH); m_sQueueSample.m_nReleasingVolumeModificator = 3; @@ -6088,7 +6084,7 @@ cAudioManager::ProcessOneShotScriptObject(uint8 sound) case SCRIPT_SOUND_GLASS_CRACK: m_sQueueSample.m_fSoundIntensity = 60.0f; m_sQueueSample.m_nSampleIndex = SFX_GLASS_CRACK; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; emittingVolume = 70; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_GLASS_CRACK); m_sQueueSample.m_nReleasingVolumeModificator = 3; @@ -6099,7 +6095,7 @@ cAudioManager::ProcessOneShotScriptObject(uint8 sound) case SCRIPT_SOUND_GLASS_LIGHT_BREAK: m_sQueueSample.m_fSoundIntensity = 55.0f; m_sQueueSample.m_nSampleIndex = (m_anRandomTable[4] & 3) + SFX_GLASS_SHARD_1; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_nFrequency = RandomDisplacement(2000) + 19000; m_sQueueSample.m_nReleasingVolumeModificator = 9; m_sQueueSample.m_fSpeedMultiplier = 0.0f; @@ -6109,7 +6105,7 @@ cAudioManager::ProcessOneShotScriptObject(uint8 sound) case SCRIPT_SOUND_BOX_DESTROYED_1: m_sQueueSample.m_fSoundIntensity = 60.0f; m_sQueueSample.m_nSampleIndex = SFX_WOODEN_BOX_SMASH; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_nFrequency = RandomDisplacement(1500) + 18600; m_sQueueSample.m_nReleasingVolumeModificator = 3; m_sQueueSample.m_fSpeedMultiplier = 0.0f; @@ -6120,7 +6116,7 @@ cAudioManager::ProcessOneShotScriptObject(uint8 sound) case SCRIPT_SOUND_BOX_DESTROYED_2: m_sQueueSample.m_fSoundIntensity = 60.0f; m_sQueueSample.m_nSampleIndex = SFX_CARDBOARD_BOX_SMASH; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_nFrequency = RandomDisplacement(1500) + 18600; m_sQueueSample.m_nReleasingVolumeModificator = 3; m_sQueueSample.m_fSpeedMultiplier = 0.0f; @@ -6131,7 +6127,7 @@ cAudioManager::ProcessOneShotScriptObject(uint8 sound) case SCRIPT_SOUND_METAL_COLLISION: m_sQueueSample.m_fSoundIntensity = 60.0f; m_sQueueSample.m_nSampleIndex = m_anRandomTable[3] % 5 + SFX_COL_CAR_1; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_nFrequency += RandomDisplacement(m_sQueueSample.m_nFrequency >> 4); @@ -6144,7 +6140,7 @@ cAudioManager::ProcessOneShotScriptObject(uint8 sound) case SCRIPT_SOUND_TIRE_COLLISION: m_sQueueSample.m_fSoundIntensity = 60.0f; m_sQueueSample.m_nSampleIndex = SFX_TYRE_BUMP; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_nFrequency += RandomDisplacement(m_sQueueSample.m_nFrequency >> 4); @@ -6170,21 +6166,21 @@ cAudioManager::ProcessOneShotScriptObject(uint8 sound) m_sQueueSample.m_nFrequency = RandomDisplacement(500) + 11000; m_sQueueSample.m_nReleasingVolumeModificator = 18; m_sQueueSample.m_fSoundIntensity = 20.0f; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_fSpeedMultiplier = 0.0f; m_sQueueSample.m_bIs2D = false; emittingVolume = m_anRandomTable[2] % 20 + 30; distSquared = GetDistanceSquared(&m_sQueueSample.m_vecPos); if(distSquared < SQR(m_sQueueSample.m_fSoundIntensity)) { m_sQueueSample.m_fDistance = Sqrt(distSquared); - m_sQueueSample.m_bVolume = ComputeVolume( + m_sQueueSample.m_nVolume = ComputeVolume( emittingVolume, m_sQueueSample.m_fSoundIntensity, m_sQueueSample.m_fDistance); - if(m_sQueueSample.m_bVolume) { + if(m_sQueueSample.m_nVolume) { m_sQueueSample.m_nCounter = iSound++; m_sQueueSample.m_nLoopCount = 1; m_sQueueSample.m_bReleasingSoundFlag = true; - m_sQueueSample.m_bEmittingVolume = emittingVolume; + m_sQueueSample.m_nEmittingVolume = emittingVolume; m_sQueueSample.m_nLoopStart = 0; m_sQueueSample.m_nLoopEnd = -1; m_sQueueSample.m_bReverbFlag = true; @@ -6200,7 +6196,7 @@ cAudioManager::ProcessOneShotScriptObject(uint8 sound) m_sQueueSample.m_nFrequency = RandomDisplacement(750) + 18000; m_sQueueSample.m_nReleasingVolumeModificator = 15; m_sQueueSample.m_fSoundIntensity = 20.0f; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_fSpeedMultiplier = 0.0f; m_sQueueSample.m_bIs2D = false; emittingVolume = m_anRandomTable[2] % 20 + 30; @@ -6210,7 +6206,7 @@ cAudioManager::ProcessOneShotScriptObject(uint8 sound) m_sQueueSample.m_nFrequency = RandomDisplacement(500) + 11000; m_sQueueSample.m_nReleasingVolumeModificator = 18; m_sQueueSample.m_fSoundIntensity = 20.0f; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_fSpeedMultiplier = 0.0f; m_sQueueSample.m_bIs2D = false; emittingVolume = m_anRandomTable[2] % 20 + 30; @@ -6221,13 +6217,13 @@ cAudioManager::ProcessOneShotScriptObject(uint8 sound) distSquared = GetDistanceSquared(&m_sQueueSample.m_vecPos); if(distSquared < SQR(m_sQueueSample.m_fSoundIntensity)) { m_sQueueSample.m_fDistance = Sqrt(distSquared); - m_sQueueSample.m_bVolume = ComputeVolume( + m_sQueueSample.m_nVolume = ComputeVolume( emittingVolume, m_sQueueSample.m_fSoundIntensity, m_sQueueSample.m_fDistance); - if(m_sQueueSample.m_bVolume) { + if(m_sQueueSample.m_nVolume) { m_sQueueSample.m_nCounter = iSound++; m_sQueueSample.m_nLoopCount = 1; m_sQueueSample.m_bReleasingSoundFlag = true; - m_sQueueSample.m_bEmittingVolume = emittingVolume; + m_sQueueSample.m_nEmittingVolume = emittingVolume; m_sQueueSample.m_nLoopStart = 0; m_sQueueSample.m_nLoopEnd = -1; m_sQueueSample.m_bReverbFlag = true; @@ -6281,18 +6277,18 @@ cAudioManager::ProcessPedHeadphones(cPedParams *params) emittingVol = 42; } - m_sQueueSample.m_bVolume = + m_sQueueSample.m_nVolume = ComputeVolume(emittingVol, 7.f, m_sQueueSample.m_fDistance); - if(m_sQueueSample.m_bVolume) { + if(m_sQueueSample.m_nVolume) { m_sQueueSample.m_nCounter = 64; m_sQueueSample.m_nSampleIndex = SFX_HEADPHONES; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_bIs2D = false; m_sQueueSample.m_nReleasingVolumeModificator = 5; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_HEADPHONES); m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_bEmittingVolume = emittingVol; + m_sQueueSample.m_nEmittingVolume = emittingVol; m_sQueueSample.m_nLoopStart = SampleManager.GetSampleLoopStartOffset( m_sQueueSample.m_nSampleIndex); @@ -6330,7 +6326,7 @@ cAudioManager::ProcessPedOneShots(cPedParams *params) weapon = params->m_pPed->GetWeapon(); for(uint32 i = 0; i < m_asAudioEntities[m_sQueueSample.m_nEntityIndex].m_AudioEvents; i++) { noReflection = false; - stereo = 0; + stereo = false; m_sQueueSample.m_bRequireReflection = false; sound = m_asAudioEntities[m_sQueueSample.m_nEntityIndex].m_awAudioEvent[i]; switch(sound) { @@ -6386,7 +6382,7 @@ cAudioManager::ProcessPedOneShots(cPedParams *params) break; } m_sQueueSample.m_nSampleIndex = sampleIndex; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_nCounter = m_asAudioEntities[m_sQueueSample.m_nEntityIndex] .m_awAudioEvent[i] - @@ -6418,9 +6414,9 @@ cAudioManager::ProcessPedOneShots(cPedParams *params) m_sQueueSample.m_nLoopCount = 1; m_sQueueSample.m_nLoopStart = 0; m_sQueueSample.m_nLoopEnd = -1; - m_sQueueSample.m_bEmittingVolume = emittingVol; + m_sQueueSample.m_nEmittingVolume = emittingVol; m_sQueueSample.m_bIs2D = false; - m_sQueueSample.m_bReleasingSoundFlag = 1; + m_sQueueSample.m_bReleasingSoundFlag = true; m_sQueueSample.m_bRequireReflection = true; } break; @@ -6437,7 +6433,7 @@ cAudioManager::ProcessPedOneShots(cPedParams *params) } else { m_sQueueSample.m_nSampleIndex = SFX_BODY_LAND_AND_FALL; } - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_nCounter = 1; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency( m_sQueueSample.m_nSampleIndex); @@ -6449,18 +6445,18 @@ cAudioManager::ProcessPedOneShots(cPedParams *params) m_sQueueSample.m_nLoopCount = 1; m_sQueueSample.m_nLoopStart = 0; m_sQueueSample.m_nLoopEnd = -1; - m_sQueueSample.m_bEmittingVolume = emittingVol; + m_sQueueSample.m_nEmittingVolume = emittingVol; m_sQueueSample.m_bIs2D = false; - m_sQueueSample.m_bReleasingSoundFlag = 1; + m_sQueueSample.m_bReleasingSoundFlag = true; m_sQueueSample.m_bRequireReflection = true; } break; case SOUND_FIGHT_PUNCH_33: m_sQueueSample.m_nSampleIndex = SFX_FIGHT_1; m_sQueueSample.m_nFrequency = 18000; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_nCounter = iSound; - stereo = 1; + stereo = true; ++iSound; m_sQueueSample.m_nReleasingVolumeModificator = 3; m_sQueueSample.m_fSpeedMultiplier = 0.0f; @@ -6470,17 +6466,17 @@ cAudioManager::ProcessPedOneShots(cPedParams *params) m_sQueueSample.m_nLoopStart = 0; emittingVol = m_anRandomTable[3] % 26 + 100; m_sQueueSample.m_nLoopEnd = -1; - m_sQueueSample.m_bEmittingVolume = emittingVol; + m_sQueueSample.m_nEmittingVolume = emittingVol; m_sQueueSample.m_bIs2D = false; - m_sQueueSample.m_bReleasingSoundFlag = 1; + m_sQueueSample.m_bReleasingSoundFlag = true; m_sQueueSample.m_bRequireReflection = true; break; case SOUND_FIGHT_KICK_34: m_sQueueSample.m_nSampleIndex = SFX_FIGHT_1; m_sQueueSample.m_nFrequency = 16500; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_nCounter = iSound; - stereo = 1; + stereo = true; ++iSound; m_sQueueSample.m_nReleasingVolumeModificator = 3; m_sQueueSample.m_fSpeedMultiplier = 0.0f; @@ -6490,17 +6486,17 @@ cAudioManager::ProcessPedOneShots(cPedParams *params) m_sQueueSample.m_nLoopStart = 0; emittingVol = m_anRandomTable[3] % 26 + 100; m_sQueueSample.m_nLoopEnd = -1; - m_sQueueSample.m_bEmittingVolume = emittingVol; + m_sQueueSample.m_nEmittingVolume = emittingVol; m_sQueueSample.m_bIs2D = false; - m_sQueueSample.m_bReleasingSoundFlag = 1; + m_sQueueSample.m_bReleasingSoundFlag = true; m_sQueueSample.m_bRequireReflection = true; break; case SOUND_FIGHT_HEADBUTT_35: m_sQueueSample.m_nSampleIndex = SFX_FIGHT_1; m_sQueueSample.m_nFrequency = 20000; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_nCounter = iSound; - stereo = 1; + stereo = true; ++iSound; m_sQueueSample.m_nReleasingVolumeModificator = 3; m_sQueueSample.m_fSpeedMultiplier = 0.0f; @@ -6510,17 +6506,17 @@ cAudioManager::ProcessPedOneShots(cPedParams *params) m_sQueueSample.m_nLoopStart = 0; emittingVol = m_anRandomTable[3] % 26 + 100; m_sQueueSample.m_nLoopEnd = -1; - m_sQueueSample.m_bEmittingVolume = emittingVol; + m_sQueueSample.m_nEmittingVolume = emittingVol; m_sQueueSample.m_bIs2D = false; - m_sQueueSample.m_bReleasingSoundFlag = 1; + m_sQueueSample.m_bReleasingSoundFlag = true; m_sQueueSample.m_bRequireReflection = true; break; case SOUND_FIGHT_PUNCH_36: m_sQueueSample.m_nSampleIndex = SFX_FIGHT_2; m_sQueueSample.m_nFrequency = 18000; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_nCounter = iSound; - stereo = 1; + stereo = true; ++iSound; m_sQueueSample.m_nReleasingVolumeModificator = 3; m_sQueueSample.m_fSpeedMultiplier = 0.0f; @@ -6530,17 +6526,17 @@ cAudioManager::ProcessPedOneShots(cPedParams *params) m_sQueueSample.m_nLoopStart = 0; emittingVol = m_anRandomTable[3] % 26 + 100; m_sQueueSample.m_nLoopEnd = -1; - m_sQueueSample.m_bEmittingVolume = emittingVol; + m_sQueueSample.m_nEmittingVolume = emittingVol; m_sQueueSample.m_bIs2D = false; - m_sQueueSample.m_bReleasingSoundFlag = 1; + m_sQueueSample.m_bReleasingSoundFlag = true; m_sQueueSample.m_bRequireReflection = true; break; case SOUND_FIGHT_PUNCH_37: m_sQueueSample.m_nSampleIndex = SFX_FIGHT_2; m_sQueueSample.m_nFrequency = 16500; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_nCounter = iSound; - stereo = 1; + stereo = true; ++iSound; m_sQueueSample.m_nReleasingVolumeModificator = 3; m_sQueueSample.m_fSpeedMultiplier = 0.0f; @@ -6550,17 +6546,17 @@ cAudioManager::ProcessPedOneShots(cPedParams *params) m_sQueueSample.m_nLoopStart = 0; emittingVol = m_anRandomTable[3] % 26 + 100; m_sQueueSample.m_nLoopEnd = -1; - m_sQueueSample.m_bEmittingVolume = emittingVol; + m_sQueueSample.m_nEmittingVolume = emittingVol; m_sQueueSample.m_bIs2D = false; - m_sQueueSample.m_bReleasingSoundFlag = 1; + m_sQueueSample.m_bReleasingSoundFlag = true; m_sQueueSample.m_bRequireReflection = true; break; case SOUND_FIGHT_CLOSE_PUNCH_38: m_sQueueSample.m_nSampleIndex = SFX_FIGHT_2; m_sQueueSample.m_nFrequency = 20000; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_nCounter = iSound; - stereo = 1; + stereo = true; ++iSound; m_sQueueSample.m_nReleasingVolumeModificator = 3; m_sQueueSample.m_fSpeedMultiplier = 0.0f; @@ -6570,17 +6566,17 @@ cAudioManager::ProcessPedOneShots(cPedParams *params) m_sQueueSample.m_nLoopStart = 0; emittingVol = m_anRandomTable[3] % 26 + 100; m_sQueueSample.m_nLoopEnd = -1; - m_sQueueSample.m_bEmittingVolume = emittingVol; + m_sQueueSample.m_nEmittingVolume = emittingVol; m_sQueueSample.m_bIs2D = false; - m_sQueueSample.m_bReleasingSoundFlag = 1; + m_sQueueSample.m_bReleasingSoundFlag = true; m_sQueueSample.m_bRequireReflection = true; break; case SOUND_FIGHT_PUNCH_39: m_sQueueSample.m_nSampleIndex = SFX_FIGHT_4; m_sQueueSample.m_nFrequency = 18000; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_nCounter = iSound; - stereo = 1; + stereo = true; ++iSound; m_sQueueSample.m_nReleasingVolumeModificator = 3; m_sQueueSample.m_fSpeedMultiplier = 0.0f; @@ -6590,17 +6586,17 @@ cAudioManager::ProcessPedOneShots(cPedParams *params) m_sQueueSample.m_nLoopStart = 0; emittingVol = m_anRandomTable[3] % 26 + 100; m_sQueueSample.m_nLoopEnd = -1; - m_sQueueSample.m_bEmittingVolume = emittingVol; + m_sQueueSample.m_nEmittingVolume = emittingVol; m_sQueueSample.m_bIs2D = false; - m_sQueueSample.m_bReleasingSoundFlag = 1; + m_sQueueSample.m_bReleasingSoundFlag = true; m_sQueueSample.m_bRequireReflection = true; break; case SOUND_FIGHT_PUNCH_OR_KICK_BELOW_40: m_sQueueSample.m_nSampleIndex = SFX_FIGHT_4; m_sQueueSample.m_nFrequency = 16500; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_nCounter = iSound; - stereo = 1; + stereo = true; ++iSound; m_sQueueSample.m_nReleasingVolumeModificator = 3; m_sQueueSample.m_fSpeedMultiplier = 0.0f; @@ -6610,17 +6606,17 @@ cAudioManager::ProcessPedOneShots(cPedParams *params) m_sQueueSample.m_nLoopStart = 0; emittingVol = m_anRandomTable[3] % 26 + 100; m_sQueueSample.m_nLoopEnd = -1; - m_sQueueSample.m_bEmittingVolume = emittingVol; + m_sQueueSample.m_nEmittingVolume = emittingVol; m_sQueueSample.m_bIs2D = false; - m_sQueueSample.m_bReleasingSoundFlag = 1; + m_sQueueSample.m_bReleasingSoundFlag = true; m_sQueueSample.m_bRequireReflection = true; break; case SOUND_FIGHT_PUNCH_41: m_sQueueSample.m_nSampleIndex = SFX_FIGHT_4; m_sQueueSample.m_nFrequency = 20000; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_nCounter = iSound; - stereo = 1; + stereo = true; ++iSound; m_sQueueSample.m_nReleasingVolumeModificator = 3; m_sQueueSample.m_fSpeedMultiplier = 0.0f; @@ -6630,17 +6626,17 @@ cAudioManager::ProcessPedOneShots(cPedParams *params) m_sQueueSample.m_nLoopStart = 0; emittingVol = m_anRandomTable[3] % 26 + 100; m_sQueueSample.m_nLoopEnd = -1; - m_sQueueSample.m_bEmittingVolume = emittingVol; + m_sQueueSample.m_nEmittingVolume = emittingVol; m_sQueueSample.m_bIs2D = false; - m_sQueueSample.m_bReleasingSoundFlag = 1; + m_sQueueSample.m_bReleasingSoundFlag = true; m_sQueueSample.m_bRequireReflection = true; break; case SOUND_FIGHT_PUNCH_FROM_BEHIND_42: m_sQueueSample.m_nSampleIndex = SFX_FIGHT_5; m_sQueueSample.m_nFrequency = 18000; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_nCounter = iSound; - stereo = 1; + stereo = true; ++iSound; m_sQueueSample.m_nReleasingVolumeModificator = 3; m_sQueueSample.m_fSpeedMultiplier = 0.0f; @@ -6650,17 +6646,17 @@ cAudioManager::ProcessPedOneShots(cPedParams *params) m_sQueueSample.m_nLoopStart = 0; emittingVol = m_anRandomTable[3] % 26 + 100; m_sQueueSample.m_nLoopEnd = -1; - m_sQueueSample.m_bEmittingVolume = emittingVol; + m_sQueueSample.m_nEmittingVolume = emittingVol; m_sQueueSample.m_bIs2D = false; - m_sQueueSample.m_bReleasingSoundFlag = 1; + m_sQueueSample.m_bReleasingSoundFlag = true; m_sQueueSample.m_bRequireReflection = true; break; case SOUND_FIGHT_KNEE_OR_KICK_43: m_sQueueSample.m_nSampleIndex = SFX_FIGHT_5; m_sQueueSample.m_nFrequency = 16500; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_nCounter = iSound; - stereo = 1; + stereo = true; ++iSound; m_sQueueSample.m_nReleasingVolumeModificator = 3; m_sQueueSample.m_fSpeedMultiplier = 0.0f; @@ -6670,17 +6666,17 @@ cAudioManager::ProcessPedOneShots(cPedParams *params) m_sQueueSample.m_nLoopStart = 0; emittingVol = m_anRandomTable[3] % 26 + 100; m_sQueueSample.m_nLoopEnd = -1; - m_sQueueSample.m_bEmittingVolume = emittingVol; + m_sQueueSample.m_nEmittingVolume = emittingVol; m_sQueueSample.m_bIs2D = false; - m_sQueueSample.m_bReleasingSoundFlag = 1; + m_sQueueSample.m_bReleasingSoundFlag = true; m_sQueueSample.m_bRequireReflection = true; break; case SOUND_FIGHT_KICK_44: m_sQueueSample.m_nSampleIndex = SFX_FIGHT_5; m_sQueueSample.m_nFrequency = 20000; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_nCounter = iSound; - stereo = 1; + stereo = true; ++iSound; m_sQueueSample.m_nReleasingVolumeModificator = 3; m_sQueueSample.m_fSpeedMultiplier = 0.0f; @@ -6690,16 +6686,16 @@ cAudioManager::ProcessPedOneShots(cPedParams *params) m_sQueueSample.m_nLoopStart = 0; emittingVol = m_anRandomTable[3] % 26 + 100; m_sQueueSample.m_nLoopEnd = -1; - m_sQueueSample.m_bEmittingVolume = emittingVol; + m_sQueueSample.m_nEmittingVolume = emittingVol; m_sQueueSample.m_bIs2D = false; - m_sQueueSample.m_bReleasingSoundFlag = 1; + m_sQueueSample.m_bReleasingSoundFlag = true; m_sQueueSample.m_bRequireReflection = true; break; case SOUND_WEAPON_BAT_ATTACK: m_sQueueSample.m_nSampleIndex = SFX_BAT_HIT_LEFT; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_nCounter = iSound++; - stereo = 1; + stereo = true; m_sQueueSample.m_nFrequency = RandomDisplacement(2000) + 22000; m_sQueueSample.m_nReleasingVolumeModificator = 3; m_sQueueSample.m_fSpeedMultiplier = 0.0f; @@ -6709,9 +6705,9 @@ cAudioManager::ProcessPedOneShots(cPedParams *params) m_sQueueSample.m_nLoopStart = 0; m_sQueueSample.m_nLoopEnd = -1; emittingVol = m_anRandomTable[2] % 20 + 100; - m_sQueueSample.m_bEmittingVolume = emittingVol; + m_sQueueSample.m_nEmittingVolume = emittingVol; m_sQueueSample.m_bIs2D = false; - m_sQueueSample.m_bReleasingSoundFlag = 1; + m_sQueueSample.m_bReleasingSoundFlag = true; if(m_bDynamicAcousticModelingStatus) m_sQueueSample.m_bRequireReflection = true; else @@ -6722,9 +6718,9 @@ cAudioManager::ProcessPedOneShots(cPedParams *params) switch(weapon->m_eWeaponType) { case WEAPONTYPE_COLT45: m_sQueueSample.m_nSampleIndex = SFX_COLT45_LEFT; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_nCounter = iSound++; - stereo = 1; + stereo = true; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_COLT45_LEFT); m_sQueueSample.m_nFrequency += @@ -6737,9 +6733,9 @@ cAudioManager::ProcessPedOneShots(cPedParams *params) m_sQueueSample.m_nLoopStart = 0; m_sQueueSample.m_nLoopEnd = -1; emittingVol = m_anRandomTable[1] % 10 + 90; - m_sQueueSample.m_bEmittingVolume = emittingVol; + m_sQueueSample.m_nEmittingVolume = emittingVol; m_sQueueSample.m_bIs2D = false; - m_sQueueSample.m_bReleasingSoundFlag = 1; + m_sQueueSample.m_bReleasingSoundFlag = true; if(m_bDynamicAcousticModelingStatus) m_sQueueSample.m_bRequireReflection = true; else @@ -6747,9 +6743,9 @@ cAudioManager::ProcessPedOneShots(cPedParams *params) break; case WEAPONTYPE_UZI: m_sQueueSample.m_nSampleIndex = SFX_UZI_LEFT; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_nCounter = iSound++; - stereo = 1; + stereo = true; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_UZI_LEFT); m_sQueueSample.m_nFrequency += @@ -6762,15 +6758,15 @@ cAudioManager::ProcessPedOneShots(cPedParams *params) m_sQueueSample.m_nLoopStart = 0; emittingVol = m_anRandomTable[3] % 15 + 70; m_sQueueSample.m_nLoopEnd = -1; - m_sQueueSample.m_bEmittingVolume = emittingVol; + m_sQueueSample.m_nEmittingVolume = emittingVol; m_sQueueSample.m_bIs2D = false; - m_sQueueSample.m_bReleasingSoundFlag = 1; + m_sQueueSample.m_bReleasingSoundFlag = true; break; case WEAPONTYPE_SHOTGUN: m_sQueueSample.m_nSampleIndex = SFX_SHOTGUN_LEFT; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_nCounter = iSound++; - stereo = 1; + stereo = true; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_SHOTGUN_LEFT); m_sQueueSample.m_nFrequency += @@ -6783,9 +6779,9 @@ cAudioManager::ProcessPedOneShots(cPedParams *params) m_sQueueSample.m_nLoopStart = 0; m_sQueueSample.m_nLoopEnd = -1; emittingVol = m_anRandomTable[2] % 10 + 100; - m_sQueueSample.m_bEmittingVolume = emittingVol; + m_sQueueSample.m_nEmittingVolume = emittingVol; m_sQueueSample.m_bIs2D = false; - m_sQueueSample.m_bReleasingSoundFlag = 1; + m_sQueueSample.m_bReleasingSoundFlag = true; if(m_bDynamicAcousticModelingStatus) m_sQueueSample.m_bRequireReflection = true; else @@ -6793,9 +6789,9 @@ cAudioManager::ProcessPedOneShots(cPedParams *params) break; case WEAPONTYPE_AK47: m_sQueueSample.m_nSampleIndex = SFX_AK47_LEFT; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_nCounter = iSound++; - stereo = 1; + stereo = true; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_AK47_LEFT); m_sQueueSample.m_nFrequency += @@ -6808,15 +6804,15 @@ cAudioManager::ProcessPedOneShots(cPedParams *params) m_sQueueSample.m_nLoopStart = 0; emittingVol = m_anRandomTable[1] % 15 + 70; m_sQueueSample.m_nLoopEnd = -1; - m_sQueueSample.m_bEmittingVolume = emittingVol; + m_sQueueSample.m_nEmittingVolume = emittingVol; m_sQueueSample.m_bIs2D = false; - m_sQueueSample.m_bReleasingSoundFlag = 1; + m_sQueueSample.m_bReleasingSoundFlag = true; break; case WEAPONTYPE_M16: m_sQueueSample.m_nSampleIndex = SFX_M16_LEFT; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_nCounter = iSound++; - stereo = 1; + stereo = true; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_M16_LEFT); m_sQueueSample.m_nFrequency += @@ -6829,15 +6825,15 @@ cAudioManager::ProcessPedOneShots(cPedParams *params) m_sQueueSample.m_nLoopStart = 0; emittingVol = m_anRandomTable[4] % 15 + 70; m_sQueueSample.m_nLoopEnd = -1; - m_sQueueSample.m_bEmittingVolume = emittingVol; + m_sQueueSample.m_nEmittingVolume = emittingVol; m_sQueueSample.m_bIs2D = false; - m_sQueueSample.m_bReleasingSoundFlag = 1; + m_sQueueSample.m_bReleasingSoundFlag = true; break; case WEAPONTYPE_SNIPERRIFLE: m_sQueueSample.m_nSampleIndex = SFX_SNIPER_LEFT; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_nCounter = iSound++; - stereo = 1; + stereo = true; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_SNIPER_LEFT); m_sQueueSample.m_nFrequency += @@ -6850,9 +6846,9 @@ cAudioManager::ProcessPedOneShots(cPedParams *params) m_sQueueSample.m_nLoopStart = 0; m_sQueueSample.m_nLoopEnd = -1; emittingVol = m_anRandomTable[4] % 10 + 110; - m_sQueueSample.m_bEmittingVolume = emittingVol; + m_sQueueSample.m_nEmittingVolume = emittingVol; m_sQueueSample.m_bIs2D = false; - m_sQueueSample.m_bReleasingSoundFlag = 1; + m_sQueueSample.m_bReleasingSoundFlag = true; if(m_bDynamicAcousticModelingStatus) m_sQueueSample.m_bRequireReflection = true; else @@ -6860,9 +6856,9 @@ cAudioManager::ProcessPedOneShots(cPedParams *params) break; case WEAPONTYPE_ROCKETLAUNCHER: m_sQueueSample.m_nSampleIndex = SFX_ROCKET_LEFT; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_nCounter = iSound++; - stereo = 1; + stereo = true; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_ROCKET_LEFT); m_sQueueSample.m_nFrequency += @@ -6875,9 +6871,9 @@ cAudioManager::ProcessPedOneShots(cPedParams *params) m_sQueueSample.m_nLoopStart = 0; m_sQueueSample.m_nLoopEnd = -1; emittingVol = m_anRandomTable[0] % 20 + 80; - m_sQueueSample.m_bEmittingVolume = emittingVol; + m_sQueueSample.m_nEmittingVolume = emittingVol; m_sQueueSample.m_bIs2D = false; - m_sQueueSample.m_bReleasingSoundFlag = 1; + m_sQueueSample.m_bReleasingSoundFlag = true; if(m_bDynamicAcousticModelingStatus) m_sQueueSample.m_bRequireReflection = true; else @@ -6885,7 +6881,7 @@ cAudioManager::ProcessPedOneShots(cPedParams *params) break; case WEAPONTYPE_FLAMETHROWER: m_sQueueSample.m_nSampleIndex = SFX_FLAMETHROWER_LEFT; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_nCounter = 9; emittingVol = 90; m_sQueueSample.m_nFrequency = @@ -6901,9 +6897,9 @@ cAudioManager::ProcessPedOneShots(cPedParams *params) m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_nLoopEnd = SampleManager.GetSampleLoopEndOffset( m_sQueueSample.m_nSampleIndex); - m_sQueueSample.m_bEmittingVolume = 90; + m_sQueueSample.m_nEmittingVolume = 90; m_sQueueSample.m_bIs2D = false; - m_sQueueSample.m_bReleasingSoundFlag = 0; + m_sQueueSample.m_bReleasingSoundFlag = false; m_sQueueSample.m_nReleasingVolumeDivider = 6; if(m_bDynamicAcousticModelingStatus) m_sQueueSample.m_bRequireReflection = true; @@ -6955,9 +6951,9 @@ cAudioManager::ProcessPedOneShots(cPedParams *params) } emittingVol = 75; m_sQueueSample.m_nCounter = iSound++; - stereo = 1; + stereo = true; m_sQueueSample.m_nFrequency += RandomDisplacement(300); - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_nReleasingVolumeModificator = 5; m_sQueueSample.m_fSpeedMultiplier = 0.0f; m_sQueueSample.m_fSoundIntensity = 30.0f; @@ -6965,18 +6961,18 @@ cAudioManager::ProcessPedOneShots(cPedParams *params) m_sQueueSample.m_nLoopCount = 1; m_sQueueSample.m_nLoopStart = 0; m_sQueueSample.m_nLoopEnd = -1; - m_sQueueSample.m_bEmittingVolume = 75; + m_sQueueSample.m_nEmittingVolume = 75; m_sQueueSample.m_bIs2D = false; - m_sQueueSample.m_bReleasingSoundFlag = 1; + m_sQueueSample.m_bReleasingSoundFlag = true; m_sQueueSample.m_bRequireReflection = true; break; case SOUND_WEAPON_AK47_BULLET_ECHO: case SOUND_WEAPON_UZI_BULLET_ECHO: case SOUND_WEAPON_M16_BULLET_ECHO: m_sQueueSample.m_nSampleIndex = SFX_UZI_END_LEFT; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_nCounter = iSound++; - stereo = 1; + stereo = true; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_UZI_END_LEFT); m_sQueueSample.m_nFrequency += @@ -6989,9 +6985,9 @@ cAudioManager::ProcessPedOneShots(cPedParams *params) m_sQueueSample.m_nLoopStart = 0; m_sQueueSample.m_nLoopEnd = -1; emittingVol = m_anRandomTable[4] % 10 + 40; - m_sQueueSample.m_bEmittingVolume = emittingVol; + m_sQueueSample.m_nEmittingVolume = emittingVol; m_sQueueSample.m_bIs2D = false; - m_sQueueSample.m_bReleasingSoundFlag = 1; + m_sQueueSample.m_bReleasingSoundFlag = true; if(m_bDynamicAcousticModelingStatus) m_sQueueSample.m_bRequireReflection = true; else @@ -6999,7 +6995,7 @@ cAudioManager::ProcessPedOneShots(cPedParams *params) break; case SOUND_WEAPON_FLAMETHROWER_FIRE: m_sQueueSample.m_nSampleIndex = SFX_FLAMETHROWER_START_LEFT; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_nCounter = iSound++; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_FLAMETHROWER_START_LEFT); @@ -7013,15 +7009,15 @@ cAudioManager::ProcessPedOneShots(cPedParams *params) m_sQueueSample.m_nLoopStart = 0; m_sQueueSample.m_nLoopEnd = -1; emittingVol = 70; - m_sQueueSample.m_bEmittingVolume = 70; + m_sQueueSample.m_nEmittingVolume = 70; m_sQueueSample.m_bIs2D = false; - m_sQueueSample.m_bReleasingSoundFlag = 1; + m_sQueueSample.m_bReleasingSoundFlag = true; break; case SOUND_WEAPON_HIT_PED: m_sQueueSample.m_nSampleIndex = SFX_BULLET_PED; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_nCounter = iSound++; - stereo = 1; + stereo = true; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_BULLET_PED); m_sQueueSample.m_nFrequency += @@ -7034,15 +7030,15 @@ cAudioManager::ProcessPedOneShots(cPedParams *params) m_sQueueSample.m_nLoopStart = 0; emittingVol = m_anRandomTable[0] % 20 + 90; m_sQueueSample.m_nLoopEnd = -1; - m_sQueueSample.m_bEmittingVolume = emittingVol; + m_sQueueSample.m_nEmittingVolume = emittingVol; m_sQueueSample.m_bIs2D = false; - m_sQueueSample.m_bReleasingSoundFlag = 1; + m_sQueueSample.m_bReleasingSoundFlag = true; break; case SOUND_SPLASH: m_sQueueSample.m_nSampleIndex = SFX_SPLASH_1; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_nCounter = iSound++; - stereo = 1; + stereo = true; m_sQueueSample.m_nFrequency = RandomDisplacement(1400) + 20000; m_sQueueSample.m_nReleasingVolumeModificator = 1; m_sQueueSample.m_fSpeedMultiplier = 0.0f; @@ -7052,9 +7048,9 @@ cAudioManager::ProcessPedOneShots(cPedParams *params) m_sQueueSample.m_nLoopStart = 0; emittingVol = m_anRandomTable[2] % 30 + 70; m_sQueueSample.m_nLoopEnd = -1; - m_sQueueSample.m_bEmittingVolume = emittingVol; + m_sQueueSample.m_nEmittingVolume = emittingVol; m_sQueueSample.m_bIs2D = false; - m_sQueueSample.m_bReleasingSoundFlag = 1; + m_sQueueSample.m_bReleasingSoundFlag = true; m_sQueueSample.m_bRequireReflection = true; break; default: SetupPedComments(params, sound); continue; @@ -7063,23 +7059,23 @@ cAudioManager::ProcessPedOneShots(cPedParams *params) if(stereo && iSound > 60) iSound = 21; if(params->m_fDistance < maxDist) { CalculateDistance(params->m_bDistanceCalculated, params->m_fDistance); - m_sQueueSample.m_bVolume = + m_sQueueSample.m_nVolume = ComputeVolume(emittingVol, m_sQueueSample.m_fSoundIntensity, m_sQueueSample.m_fDistance); - if(m_sQueueSample.m_bVolume) { + if(m_sQueueSample.m_nVolume) { if(noReflection) { if(0.2f * m_sQueueSample.m_fSoundIntensity <= m_sQueueSample.m_fDistance) { noReflection = 0; } else { m_sQueueSample.m_bIs2D = true; - m_sQueueSample.m_bOffset = 0; + m_sQueueSample.m_nOffset = 0; } } m_sQueueSample.m_bReverbFlag = true; AddSampleToRequestedQueue(); if(noReflection) { - m_sQueueSample.m_bOffset = 127; + m_sQueueSample.m_nOffset = 127; ++m_sQueueSample.m_nSampleIndex; if(m_asAudioEntities[m_sQueueSample.m_nEntityIndex] .m_awAudioEvent[i] != SOUND_WEAPON_SHOT_FIRED || @@ -7126,96 +7122,90 @@ cAudioManager::ProcessPlane(cVehicleParams *params) struct tVehicleSampleData { eSfxSample m_nAccelerationSampleIndex; uint8 m_bEngineSoundType; - char gap_5[3]; eSfxSample m_nHornSample; int32 m_nHornFrequency; uint8 m_nSirenOrAlarmSample; int32 m_nSirenOrAlarmFrequency; uint8 m_bDoorType; - char gap_25[3]; }; -// int32 *GearFreqAdj = (int32 *)0x606A50; -int32 GearFreqAdj[] = {112, 23, 0, 0, 112, 23, 0, 0, 72, 13, 0, 0, - 176, 4, 0, 0, 0, 0, 0, 0, 24, 252, 255, 255}; - -// tVehicleSampleData *CarSounds = (tVehicleSampleData *)0x606204; - -const tVehicleSampleData CarSounds[70] = { - {SFX_CAR_REV_2, 2, "", SFX_CAR_HORN_JEEP, 26513, SFX_CAR_ALARM_1, 9935, 1}, - {SFX_CAR_REV_1, 1, "", SFX_CAR_HORN_56CHEV, 11487, SFX_CAR_ALARM_1, 9935, 0}, - {SFX_CAR_REV_8, 8, "", SFX_CAR_HORN_PORSCHE, 11025, SFX_CAR_ALARM_1, 10928, 1}, - {SFX_CAR_REV_6, 6, "", SFX_CAR_HORN_TRUCK, 29711, SFX_CAR_ALARM_1, 9935, 2}, - {SFX_CAR_REV_1, 1, "", SFX_CAR_HORN_56CHEV, 12893, SFX_CAR_ALARM_1, 8941, 0}, - {SFX_CAR_REV_5, 5, "", SFX_CAR_HORN_BMW328, 10706, SFX_CAR_ALARM_1, 11922, 1}, - {SFX_CAR_REV_4, 4, "", SFX_CAR_HORN_TRUCK, 29711, SFX_CAR_ALARM_1, 7948, 2}, - {SFX_CAR_REV_6, 6, "", SFX_CAR_HORN_TRUCK, 29711, SFX_POLICE_SIREN_SLOW, 11556, 2}, - {SFX_CAR_REV_6, 6, "", SFX_CAR_HORN_TRUCK, 31478, SFX_CAR_ALARM_1, 8941, 2}, - {SFX_CAR_REV_1, 1, "", SFX_CAR_HORN_BMW328, 9538, SFX_CAR_ALARM_1, 12220, 1}, - {SFX_CAR_REV_1, 1, "", SFX_CAR_HORN_56CHEV, 10842, SFX_CAR_ALARM_1, 9935, 0}, - {SFX_CAR_REV_3, 3, "", SFX_CAR_HORN_BMW328, 12017, SFX_CAR_ALARM_1, 9935, 1}, - {SFX_CAR_REV_2, 2, "", SFX_CAR_HORN_JEEP, 22295, SFX_CAR_ALARM_1, 12200, 1}, - {SFX_CAR_REV_4, 4, "", SFX_CAR_HORN_BUS2, 18000, SFX_CAR_ALARM_1, 13400, 1}, - {SFX_CAR_REV_4, 4, "", SFX_CAR_HORN_BUS, 18286, SFX_CAR_ALARM_1, 9935, 2}, - {SFX_CAR_REV_3, 3, "", SFX_CAR_HORN_PORSCHE, 11025, SFX_CAR_ALARM_1, 13600, 1}, - {SFX_CAR_REV_4, 4, "", SFX_CAR_HORN_JEEP, 22295, SFX_AMBULANCE_SIREN_SLOW, 8795, 2}, - {SFX_CAR_REV_5, 5, "", SFX_CAR_HORN_PORSCHE, 9271, SFX_POLICE_SIREN_SLOW, 16168, 1}, - {SFX_CAR_REV_1, 1, "", SFX_CAR_HORN_56CHEV, 12170, SFX_CAR_ALARM_1, 8000, 1}, - {SFX_CAR_REV_1, 1, "", SFX_CAR_HORN_BUS2, 12345, SFX_CAR_ALARM_1, 9935, 0}, - {SFX_CAR_REV_2, 2, "", SFX_CAR_HORN_BMW328, 10796, SFX_CAR_ALARM_1, 8543, 1}, - {SFX_CAR_REV_5, 5, "", SFX_CAR_HORN_PORSCHE, 9271, SFX_CAR_ALARM_1, 9935, 1}, - {SFX_CAR_REV_2, 2, "", SFX_CAR_HORN_PICKUP, 10924, SFX_CAR_ALARM_1, 9935, 1}, - {SFX_CAR_REV_1, 1, "", SFX_CAR_HORN_PICKUP, 11025, SFX_ICE_CREAM_TUNE, 11025, 0}, - {SFX_CAR_REV_7, 7, "", SFX_CAR_HORN_JEEP, 26513, SFX_CAR_ALARM_1, 9935, 1}, - {SFX_CAR_REV_1, 1, "", SFX_CAR_HORN_JEEP, 26513, SFX_CAR_ALARM_1, 10000, 0}, - {SFX_CAR_REV_5, 5, "", SFX_CAR_HORN_BMW328, 10706, SFX_POLICE_SIREN_SLOW, 13596, 1}, - {SFX_CAR_REV_4, 4, "", SFX_CAR_HORN_BUS, 17260, SFX_POLICE_SIREN_SLOW, 13000, 2}, - {SFX_CAR_REV_4, 4, "", SFX_CAR_HORN_PICKUP, 8670, SFX_CAR_ALARM_1, 9935, 2}, - {SFX_CAR_REV_8, 8, "", SFX_CAR_HORN_PORSCHE, 10400, SFX_CAR_ALARM_1, 10123, 1}, - {SFX_CAR_REV_1, 1, "", SFX_CAR_HORN_JEEP, 26513, SFX_POLICE_SIREN_SLOW, 13596, 0}, - {SFX_CAR_REV_6, 6, "", SFX_CAR_HORN_BUS2, 11652, SFX_CAR_ALARM_1, 10554, 3}, - {SFX_CAR_REV_6, 6, "", SFX_CAR_HORN_TRUCK, 29711, SFX_CAR_ALARM_1, 8000, 2}, - {SFX_CAR_REV_6, 6, "", SFX_CAR_HORN_TRUCK, 28043, SFX_CAR_ALARM_1, 9935, 2}, - {SFX_CAR_REV_1, 0, "", SFX_CAR_HORN_TRUCK, 29711, SFX_CAR_ALARM_1, 9935, 3}, - {SFX_CAR_REV_1, 0, "", SFX_CAR_HORN_JEEP, 26513, SFX_CAR_ALARM_1, 9935, 0}, - {SFX_CESNA_IDLE, 0, "", SFX_CAR_HORN_JEEP, 26513, SFX_CAR_ALARM_1, 9935, 0}, - {SFX_CAR_REV_6, 6, "", SFX_CAR_HORN_BUS, 16291, SFX_CAR_ALARM_1, 7500, 3}, - {SFX_CAR_REV_1, 1, "", SFX_CAR_HORN_56CHEV, 10842, SFX_CAR_ALARM_1, 9935, 0}, - {SFX_CAR_REV_1, 1, "", SFX_CAR_HORN_56CHEV, 10233, SFX_CAR_ALARM_1, 8935, 0}, - {SFX_CAR_REV_4, 4, "", SFX_CAR_HORN_PICKUP, 8670, SFX_CAR_ALARM_1, 8935, 0}, - {SFX_CAR_REV_1, 0, "", SFX_CAR_HORN_PICKUP, 2000, SFX_CAR_ALARM_1, 17000, 0}, - {SFX_CAR_REV_4, 4, "", SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0}, - {SFX_CAR_REV_4, 4, "", SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0}, - {SFX_CAR_REV_5, 5, "", SFX_CAR_HORN_BMW328, 9003, SFX_CAR_ALARM_1, 9935, 1}, - {SFX_CAR_REV_2, 2, "", SFX_CAR_HORN_PORSCHE, 12375, SFX_CAR_ALARM_1, 9935, 1}, - {SFX_CAR_REV_5, 5, "", SFX_CAR_HORN_BUS2, 15554, SFX_CAR_ALARM_1, 9935, 1}, - {SFX_CAR_REV_7, 7, "", SFX_CAR_HORN_BUS2, 13857, SFX_CAR_ALARM_1, 9935, 0}, - {SFX_CAR_REV_7, 7, "", SFX_CAR_HORN_PICKUP, 10924, SFX_CAR_ALARM_1, 9935, 0}, - {SFX_CAR_REV_4, 4, "", SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 2}, - {SFX_CAR_REV_1, 0, "", SFX_CAR_HORN_JEEP, 20143, SFX_CAR_ALARM_1, 9935, 0}, - {SFX_CAR_REV_1, 0, "", SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0}, - {SFX_CAR_REV_1, 1, "", SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0}, - {SFX_CAR_REV_1, 1, "", SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0}, - {SFX_CAR_REV_4, 4, "", SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9000, 0}, - {SFX_CAR_REV_6, 6, "", SFX_CAR_HORN_TRUCK, 28043, SFX_CAR_ALARM_1, 9935, 2}, - {SFX_CAR_REV_4, 4, "", SFX_CAR_HORN_BUS, 18286, SFX_CAR_ALARM_1, 9935, 2}, - {SFX_CAR_REV_1, 1, "", SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0}, - {SFX_CAR_REV_1, 1, "", SFX_CAR_HORN_56CHEV, 10842, SFX_CAR_ALARM_1, 9935, 0}, - {SFX_CAR_REV_4, 4, "", SFX_CAR_HORN_BUS2, 18000, SFX_CAR_ALARM_1, 13400, 1}, - {SFX_CAR_REV_1, 1, "", SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0}, - {SFX_CAR_REV_1, 1, "", SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0}, - {SFX_CAR_REV_1, 1, "", SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0}, - {SFX_CAR_REV_1, 1, "", SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0}, - {SFX_CAR_REV_1, 1, "", SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0}, - {SFX_CAR_REV_1, 1, "", SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0}, - {SFX_CAR_REV_1, 1, "", SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0}, - {SFX_CAR_REV_1, 1, "", SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0}, - {SFX_CAR_REV_1, 1, "", SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0}, - {SFX_CAR_REV_1, 1, "", SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0}}; +const tVehicleSampleData aVehicleSettings[70] = { + {SFX_CAR_REV_2, 2, SFX_CAR_HORN_JEEP, 26513, SFX_CAR_ALARM_1, 9935, 1}, + {SFX_CAR_REV_1, 1, SFX_CAR_HORN_56CHEV, 11487, SFX_CAR_ALARM_1, 9935, 0}, + {SFX_CAR_REV_8, 8, SFX_CAR_HORN_PORSCHE, 11025, SFX_CAR_ALARM_1, 10928, 1}, + {SFX_CAR_REV_6, 6, SFX_CAR_HORN_TRUCK, 29711, SFX_CAR_ALARM_1, 9935, 2}, + {SFX_CAR_REV_1, 1, SFX_CAR_HORN_56CHEV, 12893, SFX_CAR_ALARM_1, 8941, 0}, + {SFX_CAR_REV_5, 5, SFX_CAR_HORN_BMW328, 10706, SFX_CAR_ALARM_1, 11922, 1}, + {SFX_CAR_REV_4, 4, SFX_CAR_HORN_TRUCK, 29711, SFX_CAR_ALARM_1, 7948, 2}, + {SFX_CAR_REV_6, 6, SFX_CAR_HORN_TRUCK, 29711, SFX_POLICE_SIREN_SLOW, 11556, 2}, + {SFX_CAR_REV_6, 6, SFX_CAR_HORN_TRUCK, 31478, SFX_CAR_ALARM_1, 8941, 2}, + {SFX_CAR_REV_1, 1, SFX_CAR_HORN_BMW328, 9538, SFX_CAR_ALARM_1, 12220, 1}, + {SFX_CAR_REV_1, 1, SFX_CAR_HORN_56CHEV, 10842, SFX_CAR_ALARM_1, 9935, 0}, + {SFX_CAR_REV_3, 3, SFX_CAR_HORN_BMW328, 12017, SFX_CAR_ALARM_1, 9935, 1}, + {SFX_CAR_REV_2, 2, SFX_CAR_HORN_JEEP, 22295, SFX_CAR_ALARM_1, 12200, 1}, + {SFX_CAR_REV_4, 4, SFX_CAR_HORN_BUS2, 18000, SFX_CAR_ALARM_1, 13400, 1}, + {SFX_CAR_REV_4, 4, SFX_CAR_HORN_BUS, 18286, SFX_CAR_ALARM_1, 9935, 2}, + {SFX_CAR_REV_3, 3, SFX_CAR_HORN_PORSCHE, 11025, SFX_CAR_ALARM_1, 13600, 1}, + {SFX_CAR_REV_4, 4, SFX_CAR_HORN_JEEP, 22295, SFX_AMBULANCE_SIREN_SLOW, 8795, 2}, + {SFX_CAR_REV_5, 5, SFX_CAR_HORN_PORSCHE, 9271, SFX_POLICE_SIREN_SLOW, 16168, 1}, + {SFX_CAR_REV_1, 1, SFX_CAR_HORN_56CHEV, 12170, SFX_CAR_ALARM_1, 8000, 1}, + {SFX_CAR_REV_1, 1, SFX_CAR_HORN_BUS2, 12345, SFX_CAR_ALARM_1, 9935, 0}, + {SFX_CAR_REV_2, 2, SFX_CAR_HORN_BMW328, 10796, SFX_CAR_ALARM_1, 8543, 1}, + {SFX_CAR_REV_5, 5, SFX_CAR_HORN_PORSCHE, 9271, SFX_CAR_ALARM_1, 9935, 1}, + {SFX_CAR_REV_2, 2, SFX_CAR_HORN_PICKUP, 10924, SFX_CAR_ALARM_1, 9935, 1}, + {SFX_CAR_REV_1, 1, SFX_CAR_HORN_PICKUP, 11025, SFX_ICE_CREAM_TUNE, 11025, 0}, + {SFX_CAR_REV_7, 7, SFX_CAR_HORN_JEEP, 26513, SFX_CAR_ALARM_1, 9935, 1}, + {SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 26513, SFX_CAR_ALARM_1, 10000, 0}, + {SFX_CAR_REV_5, 5, SFX_CAR_HORN_BMW328, 10706, SFX_POLICE_SIREN_SLOW, 13596, 1}, + {SFX_CAR_REV_4, 4, SFX_CAR_HORN_BUS, 17260, SFX_POLICE_SIREN_SLOW, 13000, 2}, + {SFX_CAR_REV_4, 4, SFX_CAR_HORN_PICKUP, 8670, SFX_CAR_ALARM_1, 9935, 2}, + {SFX_CAR_REV_8, 8, SFX_CAR_HORN_PORSCHE, 10400, SFX_CAR_ALARM_1, 10123, 1}, + {SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 26513, SFX_POLICE_SIREN_SLOW, 13596, 0}, + {SFX_CAR_REV_6, 6, SFX_CAR_HORN_BUS2, 11652, SFX_CAR_ALARM_1, 10554, 3}, + {SFX_CAR_REV_6, 6, SFX_CAR_HORN_TRUCK, 29711, SFX_CAR_ALARM_1, 8000, 2}, + {SFX_CAR_REV_6, 6, SFX_CAR_HORN_TRUCK, 28043, SFX_CAR_ALARM_1, 9935, 2}, + {SFX_CAR_REV_1, 0, SFX_CAR_HORN_TRUCK, 29711, SFX_CAR_ALARM_1, 9935, 3}, + {SFX_CAR_REV_1, 0, SFX_CAR_HORN_JEEP, 26513, SFX_CAR_ALARM_1, 9935, 0}, + {SFX_CESNA_IDLE, 0, SFX_CAR_HORN_JEEP, 26513, SFX_CAR_ALARM_1, 9935, 0}, + {SFX_CAR_REV_6, 6, SFX_CAR_HORN_BUS, 16291, SFX_CAR_ALARM_1, 7500, 3}, + {SFX_CAR_REV_1, 1, SFX_CAR_HORN_56CHEV, 10842, SFX_CAR_ALARM_1, 9935, 0}, + {SFX_CAR_REV_1, 1, SFX_CAR_HORN_56CHEV, 10233, SFX_CAR_ALARM_1, 8935, 0}, + {SFX_CAR_REV_4, 4, SFX_CAR_HORN_PICKUP, 8670, SFX_CAR_ALARM_1, 8935, 0}, + {SFX_CAR_REV_1, 0, SFX_CAR_HORN_PICKUP, 2000, SFX_CAR_ALARM_1, 17000, 0}, + {SFX_CAR_REV_4, 4, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0}, + {SFX_CAR_REV_4, 4, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0}, + {SFX_CAR_REV_5, 5, SFX_CAR_HORN_BMW328, 9003, SFX_CAR_ALARM_1, 9935, 1}, + {SFX_CAR_REV_2, 2, SFX_CAR_HORN_PORSCHE, 12375, SFX_CAR_ALARM_1, 9935, 1}, + {SFX_CAR_REV_5, 5, SFX_CAR_HORN_BUS2, 15554, SFX_CAR_ALARM_1, 9935, 1}, + {SFX_CAR_REV_7, 7, SFX_CAR_HORN_BUS2, 13857, SFX_CAR_ALARM_1, 9935, 0}, + {SFX_CAR_REV_7, 7, SFX_CAR_HORN_PICKUP, 10924, SFX_CAR_ALARM_1, 9935, 0}, + {SFX_CAR_REV_4, 4, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 2}, + {SFX_CAR_REV_1, 0, SFX_CAR_HORN_JEEP, 20143, SFX_CAR_ALARM_1, 9935, 0}, + {SFX_CAR_REV_1, 0, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0}, + {SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0}, + {SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0}, + {SFX_CAR_REV_4, 4, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9000, 0}, + {SFX_CAR_REV_6, 6, SFX_CAR_HORN_TRUCK, 28043, SFX_CAR_ALARM_1, 9935, 2}, + {SFX_CAR_REV_4, 4, SFX_CAR_HORN_BUS, 18286, SFX_CAR_ALARM_1, 9935, 2}, + {SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0}, + {SFX_CAR_REV_1, 1, SFX_CAR_HORN_56CHEV, 10842, SFX_CAR_ALARM_1, 9935, 0}, + {SFX_CAR_REV_4, 4, SFX_CAR_HORN_BUS2, 18000, SFX_CAR_ALARM_1, 13400, 1}, + {SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0}, + {SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0}, + {SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0}, + {SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0}, + {SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0}, + {SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0}, + {SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0}, + {SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0}, + {SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0}, + {SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0}}; void cAudioManager::ProcessPlayersVehicleEngine(cVehicleParams *params, CAutomobile *automobile) { + static int32 GearFreqAdj[] = { 6000, 6000, 3400, 1200, 0, -1000 }; + cTransmission *transmission; float velocityChange; float relativeVelocityChange; @@ -7241,19 +7231,19 @@ cAudioManager::ProcessPlayersVehicleEngine(cVehicleParams *params, CAutomobile * static int16 LastAccel = 0; static int16 LastBrake = 0; static uint8 CurrentPretendGear = 1; - static bool bLostTractionLastFrame = 0; + static bool bLostTractionLastFrame = false; static bool bHandbrakeOnLastFrame = 0; static int32 nCruising = 0; - static bool bAccelSampleStopped = 1; + static bool bAccelSampleStopped = true; lostTraction = 0; processedAccelSampleStopped = 0; if(bPlayerJustEnteredCar) { - bAccelSampleStopped = 1; + bAccelSampleStopped = true; bPlayerJustEnteredCar = false; nCruising = 0; LastAccel = 0; - bLostTractionLastFrame = 0; + bLostTractionLastFrame = false; LastBrake = 0; bHandbrakeOnLastFrame = 0; CurrentPretendGear = 1; @@ -7263,7 +7253,7 @@ cAudioManager::ProcessPlayersVehicleEngine(cVehicleParams *params, CAutomobile * } else { accelerateState = Pads->GetAccelerate(); } - channelUsed = SampleManager.GetChannelUsedFlag(m_bActiveSamples); + channelUsed = SampleManager.GetChannelUsedFlag(m_nActiveSamples); transmission = params->m_pTransmission; velocityChange = params->m_fVelocityChange; relativeVelocityChange = 2.0f * velocityChange / transmission->fMaxVelocity; @@ -7298,13 +7288,13 @@ cAudioManager::ProcessPlayersVehicleEngine(cVehicleParams *params, CAutomobile * } else { freqModifier = 0; } - engineSoundType = CarSounds[params->m_nIndex].m_bEngineSoundType; + engineSoundType = aVehicleSettings[params->m_nIndex].m_bEngineSoundType; soundOffset = 3 * (engineSoundType - 1); if(accelerateState <= 0) { if(params->m_fVelocityChange < -0.001f) { if(channelUsed) { - SampleManager.StopChannel(m_bActiveSamples); - bAccelSampleStopped = 1; + SampleManager.StopChannel(m_nActiveSamples); + bAccelSampleStopped = true; } if(!automobile->m_nWheelsOnGround || automobile->bIsHandbrakeOn || lostTraction) { @@ -7318,8 +7308,8 @@ cAudioManager::ProcessPlayersVehicleEngine(cVehicleParams *params, CAutomobile * automobile->m_fGasPedalAudio = gasPedalAudio; } else if(LastAccel > 0) { if(channelUsed) { - SampleManager.StopChannel(m_bActiveSamples); - bAccelSampleStopped = 1; + SampleManager.StopChannel(m_nActiveSamples); + bAccelSampleStopped = true; } nCruising = 0; if(!automobile->m_nWheelsOnGround || automobile->bIsHandbrakeOn || @@ -7331,7 +7321,7 @@ cAudioManager::ProcessPlayersVehicleEngine(cVehicleParams *params, CAutomobile * } if(gasPedalAudio > 0.05f) { freq = (5000.f * (gasPedalAudio - 0.05f) * 20.f / 19) + 19000; - if(engineSoundType == 6) freq >>= 1; + if(engineSoundType == 6) freq /= 2; AddPlayerCarSample((25.f * (gasPedalAudio - 0.05f) * 20.f / 19) + 40, freq, (soundOffset + SFX_CAR_FINGER_OFF_ACCEL_1), @@ -7374,10 +7364,10 @@ cAudioManager::ProcessPlayersVehicleEngine(cVehicleParams *params, CAutomobile * automobile->m_fGasPedalAudio = accelerationMultipler; } freq = freqModifier + baseFreq; - if(engineSoundType == 6) freq >>= 1; + if(engineSoundType == 6) freq /= 2; if(channelUsed) { - SampleManager.StopChannel(m_bActiveSamples); - bAccelSampleStopped = 1; + SampleManager.StopChannel(m_nActiveSamples); + bAccelSampleStopped = true; } AddPlayerCarSample(vol, freq, (engineSoundType + SFX_PHONE_RING), 0, 2, 1); LastAccel = accelerateState; @@ -7394,22 +7384,22 @@ cAudioManager::ProcessPlayersVehicleEngine(cVehicleParams *params, CAutomobile * CurrentPretendGear = gearNr; } processedAccelSampleStopped = 1; - bAccelSampleStopped = 0; + bAccelSampleStopped = false; } if(channelUsed) { - SampleManager.SetChannelEmittingVolume(m_bActiveSamples, 85); - SampleManager.SetChannel3DPosition(m_bActiveSamples, pos.x, pos.y, pos.z); - SampleManager.SetChannel3DDistances(m_bActiveSamples, 50.f, 12.5f); + SampleManager.SetChannelEmittingVolume(m_nActiveSamples, 85); + SampleManager.SetChannel3DPosition(m_nActiveSamples, pos.x, pos.y, pos.z); + SampleManager.SetChannel3DDistances(m_nActiveSamples, 50.f, 12.5f); if(engineSoundType == 6) freq = (GearFreqAdj[CurrentPretendGear] + freqModifier + 22050) >> 1; else freq = GearFreqAdj[CurrentPretendGear] + freqModifier + 22050; - SampleManager.SetChannelFrequency(m_bActiveSamples, freq); + SampleManager.SetChannelFrequency(m_nActiveSamples, freq); if(!channelUsed) { SampleManager.SetChannelReverbFlag( - m_bActiveSamples, m_bDynamicAcousticModelingStatus != 0); - SampleManager.StartChannel(m_bActiveSamples); + m_nActiveSamples, m_bDynamicAcousticModelingStatus != 0); + SampleManager.StartChannel(m_nActiveSamples); } LastAccel = accelerateState; @@ -7418,23 +7408,21 @@ cAudioManager::ProcessPlayersVehicleEngine(cVehicleParams *params, CAutomobile * return; } if(processedAccelSampleStopped) { - if(!SampleManager.InitialiseChannel(m_bActiveSamples, soundOffset + 345, 0)) + if(!SampleManager.InitialiseChannel(m_nActiveSamples, soundOffset + 345, 0)) return; - SampleManager.SetChannelLoopCount(m_bActiveSamples, 1); - SampleManager.SetChannelLoopPoints(m_bActiveSamples, 0, -1); - SampleManager.SetChannelEmittingVolume(m_bActiveSamples, 85); - SampleManager.SetChannel3DPosition(m_bActiveSamples, pos.x, pos.y, pos.z); - SampleManager.SetChannel3DDistances(m_bActiveSamples, 50.f, 12.5f); - if(engineSoundType == 6) - freq = - (GearFreqAdj[CurrentPretendGear] + freqModifier + 22050) >> 1; - else - freq = GearFreqAdj[CurrentPretendGear] + freqModifier + 22050; - SampleManager.SetChannelFrequency(m_bActiveSamples, freq); + SampleManager.SetChannelLoopCount(m_nActiveSamples, 1); + SampleManager.SetChannelLoopPoints(m_nActiveSamples, 0, -1); + SampleManager.SetChannelEmittingVolume(m_nActiveSamples, 85); + SampleManager.SetChannel3DPosition(m_nActiveSamples, pos.x, pos.y, pos.z); + SampleManager.SetChannel3DDistances(m_nActiveSamples, 50.f, 12.5f); + freq = GearFreqAdj[CurrentPretendGear] + freqModifier + 22050; + if (engineSoundType == 6) + freq /= 2; + SampleManager.SetChannelFrequency(m_nActiveSamples, freq); if(!channelUsed) { SampleManager.SetChannelReverbFlag( - m_bActiveSamples, m_bDynamicAcousticModelingStatus != 0); - SampleManager.StartChannel(m_bActiveSamples); + m_nActiveSamples, m_bDynamicAcousticModelingStatus != 0); + SampleManager.StartChannel(m_nActiveSamples); } LastAccel = accelerateState; @@ -7444,22 +7432,21 @@ cAudioManager::ProcessPlayersVehicleEngine(cVehicleParams *params, CAutomobile * } if(CurrentPretendGear < params->m_pTransmission->nNumberOfGears - 1) { ++CurrentPretendGear; - if(!SampleManager.InitialiseChannel(m_bActiveSamples, soundOffset + 345, 0)) + if(!SampleManager.InitialiseChannel(m_nActiveSamples, soundOffset + 345, 0)) return; - SampleManager.SetChannelLoopCount(m_bActiveSamples, 1); - SampleManager.SetChannelLoopPoints(m_bActiveSamples, 0, -1); - SampleManager.SetChannelEmittingVolume(m_bActiveSamples, 85); - SampleManager.SetChannel3DPosition(m_bActiveSamples, pos.x, pos.y, pos.z); - SampleManager.SetChannel3DDistances(m_bActiveSamples, 50.f, 12.5f); + SampleManager.SetChannelLoopCount(m_nActiveSamples, 1); + SampleManager.SetChannelLoopPoints(m_nActiveSamples, 0, -1); + SampleManager.SetChannelEmittingVolume(m_nActiveSamples, 85); + SampleManager.SetChannel3DPosition(m_nActiveSamples, pos.x, pos.y, pos.z); + SampleManager.SetChannel3DDistances(m_nActiveSamples, 50.f, 12.5f); freq = GearFreqAdj[CurrentPretendGear] + freqModifier + 22050; - - if(engineSoundType == 6) freq >>= 1; - - SampleManager.SetChannelFrequency(m_bActiveSamples, freq); + if(engineSoundType == 6) + freq /= 2; + SampleManager.SetChannelFrequency(m_nActiveSamples, freq); if(!channelUsed) { SampleManager.SetChannelReverbFlag( - m_bActiveSamples, m_bDynamicAcousticModelingStatus != 0); - SampleManager.StartChannel(m_bActiveSamples); + m_nActiveSamples, m_bDynamicAcousticModelingStatus != 0); + SampleManager.StartChannel(m_nActiveSamples); } LastAccel = accelerateState; @@ -7469,7 +7456,7 @@ cAudioManager::ProcessPlayersVehicleEngine(cVehicleParams *params, CAutomobile * } nCruising = 1; } - bAccelSampleStopped = 1; + bAccelSampleStopped = true; if(accelerateState < 150 || !automobile->m_nWheelsOnGround || automobile->bIsHandbrakeOn || lostTraction || currentGear < params->m_pTransmission->nNumberOfGears - 1) { nCruising = 0; @@ -7481,7 +7468,7 @@ cAudioManager::ProcessPlayersVehicleEngine(cVehicleParams *params, CAutomobile * --nCruising; } freq = 27 * nCruising + freqModifier + 22050; - if(engineSoundType == 6) freq >>= 1; + if(engineSoundType == 6) freq /= 2; AddPlayerCarSample(85, freq, (soundOffset + SFX_CAR_AFTER_ACCEL_1), engineSoundType, 64, 1); } @@ -7521,11 +7508,11 @@ cAudioManager::ProcessPoliceCellBeatingScriptObject(uint8 sound) sampleIndex = (m_anRandomTable[3] & 1) + SFX_BAT_HIT_LEFT; m_sQueueSample.m_nSampleIndex = sampleIndex; emittingVol = m_anRandomTable[0] % 50 + 55; - m_sQueueSample.m_bVolume = + m_sQueueSample.m_nVolume = ComputeVolume(emittingVol, m_sQueueSample.m_fSoundIntensity, m_sQueueSample.m_fDistance); - if(m_sQueueSample.m_bVolume) { - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + if(m_sQueueSample.m_nVolume) { + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency( m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_nFrequency += @@ -7536,13 +7523,13 @@ cAudioManager::ProcessPoliceCellBeatingScriptObject(uint8 sound) m_sQueueSample.m_bReleasingSoundFlag = true; m_sQueueSample.m_nReleasingVolumeModificator = 3; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_bEmittingVolume = emittingVol; + m_sQueueSample.m_nEmittingVolume = emittingVol; m_sQueueSample.m_nLoopStart = 0; m_sQueueSample.m_nLoopEnd = -1; m_sQueueSample.m_bReverbFlag = true; m_sQueueSample.m_bRequireReflection = false; AddSampleToRequestedQueue(); - params.m_bDistanceCalculated = 1; + params.m_bDistanceCalculated = true; params.m_fDistance = distSquared; params.m_pPed = nil; SetupPedComments(¶ms, SOUND_8A); @@ -7565,38 +7552,38 @@ cAudioManager::ProcessPornCinema(uint8 sound) case SCRIPT_SOUND_PORN_CINEMA_1_S: case SCRIPT_SOUND_MISTY_SEX_S: m_sQueueSample.m_nSampleIndex = SFX_PORN_1_LOOP; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; sample = SFX_PORN_1_GROAN_1; m_sQueueSample.m_fSoundIntensity = 20.0f; break; case SCRIPT_SOUND_PORN_CINEMA_1_L: case SCRIPT_SOUND_MISTY_SEX_L: m_sQueueSample.m_nSampleIndex = SFX_PORN_1_LOOP; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; sample = SFX_PORN_1_GROAN_1; m_sQueueSample.m_fSoundIntensity = 80.0f; break; case SCRIPT_SOUND_PORN_CINEMA_2_S: m_sQueueSample.m_nSampleIndex = SFX_PORN_2_LOOP; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; sample = SFX_PORN_2_GROAN_1; m_sQueueSample.m_fSoundIntensity = 20.0f; break; case SCRIPT_SOUND_PORN_CINEMA_2_L: m_sQueueSample.m_nSampleIndex = SFX_PORN_2_LOOP; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; sample = SFX_PORN_2_GROAN_1; m_sQueueSample.m_fSoundIntensity = 80.0f; break; case SCRIPT_SOUND_PORN_CINEMA_3_S: m_sQueueSample.m_nSampleIndex = SFX_PORN_3_LOOP; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_fSoundIntensity = 20.0f; sample = SFX_PORN_3_GROAN_1; break; case SCRIPT_SOUND_PORN_CINEMA_3_L: m_sQueueSample.m_nSampleIndex = SFX_PORN_3_LOOP; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_fSoundIntensity = 80.0f; sample = SFX_PORN_3_GROAN_1; break; @@ -7606,10 +7593,10 @@ cAudioManager::ProcessPornCinema(uint8 sound) if(distSquared < SQR(m_sQueueSample.m_fSoundIntensity)) { m_sQueueSample.m_fDistance = Sqrt(distSquared); if(sound != SCRIPT_SOUND_MISTY_SEX_S && sound != SCRIPT_SOUND_MISTY_SEX_L) { - m_sQueueSample.m_bVolume = + m_sQueueSample.m_nVolume = ComputeVolume(maxVolume, m_sQueueSample.m_fSoundIntensity, m_sQueueSample.m_fDistance); - if(m_sQueueSample.m_bVolume) { + if(m_sQueueSample.m_nVolume) { m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency( m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_nCounter = 0; @@ -7618,7 +7605,7 @@ cAudioManager::ProcessPornCinema(uint8 sound) m_sQueueSample.m_bReleasingSoundFlag = false; m_sQueueSample.m_nReleasingVolumeModificator = 3; m_sQueueSample.m_fSpeedMultiplier = 2.0f; - m_sQueueSample.m_bEmittingVolume = maxVolume; + m_sQueueSample.m_nEmittingVolume = maxVolume; m_sQueueSample.m_nLoopStart = SampleManager.GetSampleLoopStartOffset( m_sQueueSample.m_nSampleIndex); @@ -7632,15 +7619,13 @@ cAudioManager::ProcessPornCinema(uint8 sound) time = CTimer::GetTimeInMilliseconds(); if(time > gPornNextTime) { - m_sQueueSample.m_bVolume = ComputeVolume( + m_sQueueSample.m_nVolume = ComputeVolume( 90, m_sQueueSample.m_fSoundIntensity, m_sQueueSample.m_fDistance); - if(m_sQueueSample.m_bVolume) { + if(m_sQueueSample.m_nVolume) { rand = m_anRandomTable[1] & 1; m_sQueueSample.m_nSampleIndex = rand + sample; - m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency( - m_sQueueSample.m_nSampleIndex); - m_sQueueSample.m_nFrequency += - RandomDisplacement(m_sQueueSample.m_nFrequency >> 4); + m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex); + m_sQueueSample.m_nFrequency += RandomDisplacement(m_sQueueSample.m_nFrequency / 16); m_sQueueSample.m_nCounter = rand + 1; m_sQueueSample.m_bIs2D = false; m_sQueueSample.m_nLoopCount = 1; @@ -7670,7 +7655,7 @@ cAudioManager::ProcessProjectiles() emittingVol = maxVolume; m_sQueueSample.m_fSoundIntensity = rocketLauncherIntensity; m_sQueueSample.m_nSampleIndex = SFX_ROCKET_FLY; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_ROCKET_FLY); m_sQueueSample.m_nReleasingVolumeModificator = 3; @@ -7679,7 +7664,7 @@ cAudioManager::ProcessProjectiles() emittingVol = molotovVolume; m_sQueueSample.m_fSoundIntensity = molotovIntensity; m_sQueueSample.m_nSampleIndex = SFX_PED_ON_FIRE; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_nFrequency = 32 * SampleManager.GetSampleBaseFrequency(SFX_PED_ON_FIRE) / 25; m_sQueueSample.m_nReleasingVolumeModificator = 7; @@ -7693,14 +7678,14 @@ cAudioManager::ProcessProjectiles() float distSquared = GetDistanceSquared(&m_sQueueSample.m_vecPos); if(distSquared < SQR(m_sQueueSample.m_fSoundIntensity)) { m_sQueueSample.m_fDistance = Sqrt(distSquared); - m_sQueueSample.m_bVolume = + m_sQueueSample.m_nVolume = ComputeVolume(emittingVol, m_sQueueSample.m_fSoundIntensity, m_sQueueSample.m_fDistance); - if(m_sQueueSample.m_bVolume) { + if(m_sQueueSample.m_nVolume) { m_sQueueSample.m_nCounter = i; m_sQueueSample.m_bIs2D = false; m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_bEmittingVolume = emittingVol; + m_sQueueSample.m_nEmittingVolume = emittingVol; m_sQueueSample.m_nLoopStart = SampleManager.GetSampleLoopStartOffset( m_sQueueSample.m_nSampleIndex); @@ -7728,19 +7713,19 @@ cAudioManager::ProcessRainOnVehicle(cVehicleParams *params) veh->m_bRainAudioCounter = 0; CalculateDistance(params->m_bDistanceCalculated, params->m_fDistance); float emittingVol = 30.f * CWeather::Rain; - m_sQueueSample.m_bVolume = ComputeVolume( + m_sQueueSample.m_nVolume = ComputeVolume( emittingVol, rainOnVehicleIntensity, m_sQueueSample.m_fDistance); - if(m_sQueueSample.m_bVolume) { + if(m_sQueueSample.m_nVolume) { m_sQueueSample.m_nCounter = veh->m_bRainSamplesCounter++; if(veh->m_bRainSamplesCounter > 4) veh->m_bRainSamplesCounter = 68; m_sQueueSample.m_nSampleIndex = (m_anRandomTable[1] & 3) + SFX_CAR_RAIN_1; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_bIs2D = false; m_sQueueSample.m_nReleasingVolumeModificator = 9; m_sQueueSample.m_nFrequency = m_anRandomTable[1] % 4000 + 28000; m_sQueueSample.m_nLoopCount = 1; - m_sQueueSample.m_bEmittingVolume = (uint8)emittingVol; + m_sQueueSample.m_nEmittingVolume = (uint8)emittingVol; m_sQueueSample.m_nLoopStart = 0; m_sQueueSample.m_nLoopEnd = -1; m_sQueueSample.m_fSpeedMultiplier = 0.0f; @@ -7795,9 +7780,9 @@ cAudioManager::ProcessReverseGear(cVehicleParams *params) } modificator = Abs(modificator); emittingVol = (24.f * modificator); - m_sQueueSample.m_bVolume = + m_sQueueSample.m_nVolume = ComputeVolume(emittingVol, reverseGearIntensity, m_sQueueSample.m_fDistance); - if(m_sQueueSample.m_bVolume) { + if(m_sQueueSample.m_nVolume) { if(params->m_pVehicle->m_fGasPedal >= 0.0f) { m_sQueueSample.m_nCounter = 62; m_sQueueSample.m_nSampleIndex = SFX_REVERSE_GEAR_2; @@ -7805,12 +7790,12 @@ cAudioManager::ProcessReverseGear(cVehicleParams *params) m_sQueueSample.m_nCounter = 61; m_sQueueSample.m_nSampleIndex = SFX_REVERSE_GEAR; } - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_bIs2D = false; m_sQueueSample.m_nReleasingVolumeModificator = 3; m_sQueueSample.m_nFrequency = (6000.f * modificator) + 7000; m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_bEmittingVolume = emittingVol; + m_sQueueSample.m_nEmittingVolume = emittingVol; m_sQueueSample.m_nLoopStart = SampleManager.GetSampleLoopStartOffset(m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_nLoopEnd = @@ -7843,11 +7828,11 @@ cAudioManager::ProcessSawMillScriptObject(uint8 sound) distSquared = GetDistanceSquared(&m_sQueueSample.m_vecPos); if(distSquared < SQR(m_sQueueSample.m_fSoundIntensity)) { m_sQueueSample.m_fDistance = Sqrt(distSquared); - m_sQueueSample.m_bVolume = + m_sQueueSample.m_nVolume = ComputeVolume(30, m_sQueueSample.m_fSoundIntensity, m_sQueueSample.m_fDistance); - if(m_sQueueSample.m_bVolume) { + if(m_sQueueSample.m_nVolume) { m_sQueueSample.m_nSampleIndex = SFX_SAWMILL_LOOP; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_SAWMILL_LOOP); m_sQueueSample.m_nCounter = 0; @@ -7856,7 +7841,7 @@ cAudioManager::ProcessSawMillScriptObject(uint8 sound) m_sQueueSample.m_bReleasingSoundFlag = false; m_sQueueSample.m_nReleasingVolumeModificator = 5; m_sQueueSample.m_fSpeedMultiplier = 2.0f; - m_sQueueSample.m_bEmittingVolume = 30; + m_sQueueSample.m_nEmittingVolume = 30; m_sQueueSample.m_nLoopStart = SampleManager.GetSampleLoopStartOffset(m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_nLoopEnd = @@ -7867,11 +7852,11 @@ cAudioManager::ProcessSawMillScriptObject(uint8 sound) } time = CTimer::GetTimeInMilliseconds(); if(time > gSawMillNextTime) { - m_sQueueSample.m_bVolume = ComputeVolume( + m_sQueueSample.m_nVolume = ComputeVolume( 70, m_sQueueSample.m_fSoundIntensity, m_sQueueSample.m_fDistance); - if(m_sQueueSample.m_bVolume) { + if(m_sQueueSample.m_nVolume) { m_sQueueSample.m_nSampleIndex = SFX_SAWMILL_CUT_WOOD; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency( m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_nCounter = 1; @@ -7919,11 +7904,11 @@ cAudioManager::ProcessShopScriptObject(uint8 sound) distSquared = GetDistanceSquared(&m_sQueueSample.m_vecPos); if(distSquared < SQR(m_sQueueSample.m_fSoundIntensity)) { m_sQueueSample.m_fDistance = Sqrt(distSquared); - m_sQueueSample.m_bVolume = + m_sQueueSample.m_nVolume = ComputeVolume(30, m_sQueueSample.m_fSoundIntensity, m_sQueueSample.m_fDistance); - if(m_sQueueSample.m_bVolume) { + if(m_sQueueSample.m_nVolume) { m_sQueueSample.m_nSampleIndex = SFX_SHOP_LOOP; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_SHOP_LOOP); m_sQueueSample.m_nCounter = 0; @@ -7932,7 +7917,7 @@ cAudioManager::ProcessShopScriptObject(uint8 sound) m_sQueueSample.m_bReleasingSoundFlag = false; m_sQueueSample.m_nReleasingVolumeModificator = 5; m_sQueueSample.m_fSpeedMultiplier = 2.0f; - m_sQueueSample.m_bEmittingVolume = 30; + m_sQueueSample.m_nEmittingVolume = 30; m_sQueueSample.m_nLoopStart = SampleManager.GetSampleLoopStartOffset(m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_nLoopEnd = @@ -7943,12 +7928,12 @@ cAudioManager::ProcessShopScriptObject(uint8 sound) } time = CTimer::GetTimeInMilliseconds(); if(time > gShopNextTime) { - m_sQueueSample.m_bVolume = ComputeVolume( + m_sQueueSample.m_nVolume = ComputeVolume( 70, m_sQueueSample.m_fSoundIntensity, m_sQueueSample.m_fDistance); - if(m_sQueueSample.m_bVolume) { + if(m_sQueueSample.m_nVolume) { rand = m_anRandomTable[1] & 1; m_sQueueSample.m_nSampleIndex = rand + SFX_SHOP_TILL_1; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency( m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_nCounter = rand + 1; @@ -7957,7 +7942,7 @@ cAudioManager::ProcessShopScriptObject(uint8 sound) m_sQueueSample.m_bReleasingSoundFlag = true; m_sQueueSample.m_nReleasingVolumeModificator = 3; m_sQueueSample.m_fSpeedMultiplier = 2.0f; - m_sQueueSample.m_bEmittingVolume = 70; + m_sQueueSample.m_nEmittingVolume = 70; m_sQueueSample.m_nLoopStart = 0; m_sQueueSample.m_nLoopEnd = -1; m_sQueueSample.m_bReverbFlag = true; @@ -7972,14 +7957,14 @@ cAudioManager::ProcessShopScriptObject(uint8 sound) void cAudioManager::ProcessSpecial() { - if(m_bUserPause) { - if(!m_bPreviousUserPause) { + if(m_nUserPause) { + if(!m_nPreviousUserPause) { MusicManager.ChangeMusicMode(MUSICMODE_FRONTEND); SampleManager.SetEffectsFadeVolume(maxVolume); SampleManager.SetMusicFadeVolume(maxVolume); } } else { - if(m_bPreviousUserPause) { + if(m_nPreviousUserPause) { MusicManager.StopFrontEndTrack(); MusicManager.ChangeMusicMode(MUSICMODE_GAME); } @@ -7988,7 +7973,7 @@ cAudioManager::ProcessSpecial() const PedState &state = playerPed->m_nPedState; if(state != PED_ENTER_CAR && state != PED_STEAL_CAR && !playerPed->bInVehicle) - SampleManager.StopChannel(m_bActiveSamples); + SampleManager.StopChannel(m_nActiveSamples); } } } @@ -8008,18 +7993,18 @@ cAudioManager::ProcessTrainNoise(cVehicleParams *params) speedMultipler = Min(1.0f, train->m_fSpeed * 250.f / 51.f); emittingVol = (75.f * speedMultipler); if(train->m_fWagonPosition == 0.0f) { - m_sQueueSample.m_bVolume = + m_sQueueSample.m_nVolume = ComputeVolume(emittingVol, 300.f, m_sQueueSample.m_fDistance); - if(m_sQueueSample.m_bVolume) { + if(m_sQueueSample.m_nVolume) { m_sQueueSample.m_nCounter = 32; m_sQueueSample.m_nSampleIndex = SFX_TRAIN_FAR; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_bIs2D = false; m_sQueueSample.m_nReleasingVolumeModificator = 2; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_TRAIN_FAR); m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_bEmittingVolume = emittingVol; + m_sQueueSample.m_nEmittingVolume = emittingVol; m_sQueueSample.m_nLoopStart = SampleManager.GetSampleLoopStartOffset( m_sQueueSample.m_nSampleIndex); @@ -8035,19 +8020,19 @@ cAudioManager::ProcessTrainNoise(cVehicleParams *params) } } if(params->m_fDistance < 4900.f) { - m_sQueueSample.m_bVolume = + m_sQueueSample.m_nVolume = ComputeVolume(emittingVol, 70.f, m_sQueueSample.m_fDistance); - if(m_sQueueSample.m_bVolume) { + if(m_sQueueSample.m_nVolume) { m_sQueueSample.m_nCounter = 33; m_sQueueSample.m_nSampleIndex = SFX_TRAIN_NEAR; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_bIs2D = false; m_sQueueSample.m_nReleasingVolumeModificator = 5; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_TRAIN_NEAR) + 100 * m_sQueueSample.m_nEntityIndex % 987; m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_bEmittingVolume = emittingVol; + m_sQueueSample.m_nEmittingVolume = emittingVol; m_sQueueSample.m_nLoopStart = SampleManager.GetSampleLoopStartOffset( m_sQueueSample.m_nSampleIndex); @@ -8173,15 +8158,15 @@ cAudioManager::ProcessVehicleDoors(cVehicleParams *params) automobile = (CAutomobile *)params->m_pVehicle; CalculateDistance(params->m_bDistanceCalculated, params->m_fDistance); for(int32 i = 0; i < ARRAY_SIZE(automobile->Doors); i++) { - if(automobile->Damage.GetDoorStatus(i) == 2) { + if(automobile->Damage.GetDoorStatus(i) == DOOR_STATUS_SWINGING) { doorState = automobile->Doors[i].m_nDoorState; - if(doorState == 1 || doorState == 2) { + if(doorState == DOOR_STATUS_SMASHED || doorState == DOOR_STATUS_SWINGING) { velocity = Min(0.3f, Abs(automobile->Doors[i].m_fAngVel)); if(velocity > 0.0035f) { emittingVol = (100.f * velocity * 10.f / 3.f); - m_sQueueSample.m_bVolume = ComputeVolume( + m_sQueueSample.m_nVolume = ComputeVolume( emittingVol, 40.f, m_sQueueSample.m_fDistance); - if(m_sQueueSample.m_bVolume) { + if(m_sQueueSample.m_nVolume) { m_sQueueSample.m_nCounter = i + 6; m_sQueueSample.m_nSampleIndex = m_anRandomTable[1] % 6 + SFX_COL_CAR_PANEL_1; @@ -8189,11 +8174,11 @@ cAudioManager::ProcessVehicleDoors(cVehicleParams *params) SampleManager.GetSampleBaseFrequency( m_sQueueSample.m_nSampleIndex) + RandomDisplacement(1000); - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_bIs2D = false; m_sQueueSample.m_nReleasingVolumeModificator = 10; m_sQueueSample.m_nLoopCount = 1; - m_sQueueSample.m_bEmittingVolume = emittingVol; + m_sQueueSample.m_nEmittingVolume = emittingVol; m_sQueueSample.m_nLoopStart = 0; m_sQueueSample.m_nLoopEnd = -1; m_sQueueSample.m_fSpeedMultiplier = 1.0f; @@ -8218,7 +8203,6 @@ cAudioManager::ProcessVehicleEngine(cVehicleParams *params) CAutomobile *automobile; float relativeGearChange; float relativeChange; - float reverseRelativechange; uint8 volume; eSfxSample accelerationSample; int32 freq = 0; // uinitialized variable @@ -8232,7 +8216,7 @@ cAudioManager::ProcessVehicleEngine(cVehicleParams *params) playerVeh = FindPlayerVehicle(); veh = params->m_pVehicle; if(playerVeh == veh && veh->m_status == STATUS_WRECKED) { - SampleManager.StopChannel(m_bActiveSamples); + SampleManager.StopChannel(m_nActiveSamples); return; } if(veh->bEngineOn) { @@ -8251,36 +8235,28 @@ cAudioManager::ProcessVehicleEngine(cVehicleParams *params) currentGear = params->m_pVehicle->m_nCurrentGear; if(automobile->m_nWheelsOnGround) { if(automobile->bIsHandbrakeOn) { - if(0.f == params->m_fVelocityChange) + if(params->m_fVelocityChange == 0.0f) traction = 0.9f; } else if(params->m_pVehicle->m_status == STATUS_SIMPLE) { - traction = 0.f; + traction = 0.0f; } else { switch(transmission->nDriveType) { case '4': - for(int32 i = 0; - i < - ARRAY_SIZE(automobile->m_aWheelState); - i++) { - if(automobile->m_aWheelState[i] == - WHEEL_STATE_SPINNING) + for(int32 i = 0; i < ARRAY_SIZE(automobile->m_aWheelState); i++) { + if(automobile->m_aWheelState[i] == WHEEL_STATE_SPINNING) traction += 0.05f; } break; case 'F': - if(automobile->m_aWheelState[0] == - WHEEL_STATE_SPINNING) + if(automobile->m_aWheelState[0] == WHEEL_STATE_SPINNING) traction += 0.1f; - if(automobile->m_aWheelState[2] == - WHEEL_STATE_SPINNING) + if(automobile->m_aWheelState[2] == WHEEL_STATE_SPINNING) traction += 0.1f; break; case 'R': - if(automobile->m_aWheelState[1] == - WHEEL_STATE_SPINNING) + if(automobile->m_aWheelState[1] == WHEEL_STATE_SPINNING) traction += 0.1f; - if(automobile->m_aWheelState[3] == - WHEEL_STATE_SPINNING) + if(automobile->m_aWheelState[3] == WHEEL_STATE_SPINNING) traction += 0.1f; break; } @@ -8288,44 +8264,16 @@ cAudioManager::ProcessVehicleEngine(cVehicleParams *params) if(transmission->fMaxVelocity <= 0.f) { relativeChange = 0.f; } else if(currentGear) { - if((params->m_fVelocityChange - - transmission->Gears[currentGear] - .fShiftDownVelocity) / - transmission->fMaxVelocity * 2.5f <= - 1.f) - relativeGearChange = - (params->m_fVelocityChange - - transmission->Gears[currentGear] - .fShiftDownVelocity) / - transmission->fMaxVelocity * 2.5f; - else - relativeGearChange = 1.f; - if(0.f == traction && - automobile->m_status != STATUS_SIMPLE && - params->m_fVelocityChange >= - transmission->Gears[1].fShiftUpVelocity) { + relativeGearChange = Min(1.0f, (params->m_fVelocityChange - transmission->Gears[currentGear].fShiftDownVelocity) / transmission->fMaxVelocity * 2.5f); + if(traction == 0.0f && automobile->m_status != STATUS_SIMPLE && params->m_fVelocityChange >= transmission->Gears[1].fShiftUpVelocity) { traction = 0.7f; } - relativeChange = - traction * automobile->m_fGasPedalAudio * - 0.95f + - (1.f - traction) * relativeGearChange; - } else { - reverseRelativechange = Abs( - (params->m_fVelocityChange - - transmission->Gears[0].fShiftDownVelocity) / - transmission->fMaxReverseVelocity); - if(1.f - reverseRelativechange <= 1.f) { - relativeChange = - 1.f - reverseRelativechange; - } else { - relativeChange = 1.f; - } - } + relativeChange = traction * automobile->m_fGasPedalAudio * 0.95f + (1.0f - traction) * relativeGearChange; + } else + relativeChange = Min(1.0f, 1.0f - Abs((params->m_fVelocityChange - transmission->Gears[0].fShiftDownVelocity) / transmission->fMaxReverseVelocity)); } else { if(automobile->m_nDriveWheelsOnGround) - automobile->m_fGasPedalAudio = - automobile->m_fGasPedalAudio * 0.4f; + automobile->m_fGasPedalAudio *= 0.4f; relativeChange = automobile->m_fGasPedalAudio; } modificator = relativeChange; @@ -8338,111 +8286,85 @@ cAudioManager::ProcessVehicleEngine(cVehicleParams *params) volume = ComputeVolume(120, 50.f, m_sQueueSample.m_fDistance); } else { - emittingVol = modificator * 4 / 3 * 40.f + 80.f; - volume = ComputeVolume(emittingVol, 50.f, - m_sQueueSample.m_fDistance); + emittingVol = modificator * 4.0f / 3.0f * 40.f + 80.f; + volume = ComputeVolume(emittingVol, 50.f, m_sQueueSample.m_fDistance); } } else { modificator = 0.f; emittingVol = 80; volume = ComputeVolume(80, 50.f, m_sQueueSample.m_fDistance); } - m_sQueueSample.m_bVolume = volume; - if(m_sQueueSample.m_bVolume) { + m_sQueueSample.m_nVolume = volume; + if(m_sQueueSample.m_nVolume) { if(automobile->m_status == STATUS_SIMPLE) { if(modificator < 0.02f) { - m_sQueueSample.m_nSampleIndex = - CarSounds[params->m_nIndex].m_bEngineSoundType + - SFX_CAR_REV_10; + m_sQueueSample.m_nSampleIndex = aVehicleSettings[params->m_nIndex].m_bEngineSoundType + SFX_CAR_REV_10; freq = 10000.f * modificator + 22050; m_sQueueSample.m_nCounter = 52; - m_sQueueSample.m_bBankIndex = 0; - m_sQueueSample.m_bIs2D = 0; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_bIs2D = false; m_sQueueSample.m_nReleasingVolumeModificator = 3; - m_sQueueSample.m_nFrequency = - freq + - 100 * m_sQueueSample.m_nEntityIndex % 1000; - if(m_sQueueSample.m_nSampleIndex == - SFX_CAR_IDLE_6 || - m_sQueueSample.m_nSampleIndex == SFX_CAR_REV_6) - m_sQueueSample.m_nFrequency = - m_sQueueSample.m_nFrequency >> 1; + m_sQueueSample.m_nFrequency = freq + 100 * m_sQueueSample.m_nEntityIndex % 1000; + if(m_sQueueSample.m_nSampleIndex == SFX_CAR_IDLE_6 || m_sQueueSample.m_nSampleIndex == SFX_CAR_REV_6) + m_sQueueSample.m_nFrequency /= 2; m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_bEmittingVolume = emittingVol; - m_sQueueSample.m_nLoopStart = - SampleManager.GetSampleLoopStartOffset( - m_sQueueSample.m_nSampleIndex); - m_sQueueSample.m_nLoopEnd = - SampleManager.GetSampleLoopEndOffset( - m_sQueueSample.m_nSampleIndex); + m_sQueueSample.m_nEmittingVolume = emittingVol; + m_sQueueSample.m_nLoopStart = SampleManager.GetSampleLoopStartOffset(m_sQueueSample.m_nSampleIndex); + m_sQueueSample.m_nLoopEnd = SampleManager.GetSampleLoopEndOffset(m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_fSpeedMultiplier = 6.0f; m_sQueueSample.m_fSoundIntensity = 50.0f; m_sQueueSample.m_bReleasingSoundFlag = false; m_sQueueSample.m_nReleasingVolumeDivider = 8; - m_sQueueSample.m_bReverbFlag = 1; - m_sQueueSample.m_bRequireReflection = 0; + m_sQueueSample.m_bReverbFlag = true; + m_sQueueSample.m_bRequireReflection = false; AddSampleToRequestedQueue(); return; } accelerationSample = - CarSounds[params->m_nIndex].m_nAccelerationSampleIndex; + aVehicleSettings[params->m_nIndex].m_nAccelerationSampleIndex; } else { if(automobile->m_fGasPedal < 0.05f) { m_sQueueSample.m_nSampleIndex = - CarSounds[params->m_nIndex].m_bEngineSoundType + + aVehicleSettings[params->m_nIndex].m_bEngineSoundType + SFX_CAR_REV_10; // to recheck idle sounds start // 1 postion later freq = 10000.f * modificator + 22050; m_sQueueSample.m_nCounter = 52; - m_sQueueSample.m_bBankIndex = 0; - m_sQueueSample.m_bIs2D = 0; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_bIs2D = false; m_sQueueSample.m_nReleasingVolumeModificator = 3; - m_sQueueSample.m_nFrequency = - freq + - 100 * m_sQueueSample.m_nEntityIndex % 1000; - if(m_sQueueSample.m_nSampleIndex == - SFX_CAR_IDLE_6 || + m_sQueueSample.m_nFrequency = freq + 100 * m_sQueueSample.m_nEntityIndex % 1000; + if(m_sQueueSample.m_nSampleIndex == SFX_CAR_IDLE_6 || m_sQueueSample.m_nSampleIndex == SFX_CAR_REV_6) - m_sQueueSample.m_nFrequency = - m_sQueueSample.m_nFrequency >> 1; + m_sQueueSample.m_nFrequency = m_sQueueSample.m_nFrequency >> 1; m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_bEmittingVolume = emittingVol; - m_sQueueSample.m_nLoopStart = - SampleManager.GetSampleLoopStartOffset( - m_sQueueSample.m_nSampleIndex); - m_sQueueSample.m_nLoopEnd = - SampleManager.GetSampleLoopEndOffset( - m_sQueueSample.m_nSampleIndex); + m_sQueueSample.m_nEmittingVolume = emittingVol; + m_sQueueSample.m_nLoopStart = SampleManager.GetSampleLoopStartOffset( m_sQueueSample.m_nSampleIndex); + m_sQueueSample.m_nLoopEnd = SampleManager.GetSampleLoopEndOffset(m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_fSpeedMultiplier = 6.0f; m_sQueueSample.m_fSoundIntensity = 50.0f; m_sQueueSample.m_bReleasingSoundFlag = false; m_sQueueSample.m_nReleasingVolumeDivider = 8; - m_sQueueSample.m_bReverbFlag = 1; - m_sQueueSample.m_bRequireReflection = 0; + m_sQueueSample.m_bReverbFlag = true; + m_sQueueSample.m_bRequireReflection = false; AddSampleToRequestedQueue(); return; } - accelerationSample = - CarSounds[params->m_nIndex].m_nAccelerationSampleIndex; + accelerationSample = aVehicleSettings[params->m_nIndex].m_nAccelerationSampleIndex; } m_sQueueSample.m_nSampleIndex = accelerationSample; m_sQueueSample.m_nCounter = 2; - m_sQueueSample.m_bBankIndex = 0; - m_sQueueSample.m_bIs2D = 0; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_bIs2D = false; m_sQueueSample.m_nReleasingVolumeModificator = 3; - m_sQueueSample.m_nFrequency = - freq + 100 * m_sQueueSample.m_nEntityIndex % 1000; + m_sQueueSample.m_nFrequency = freq + 100 * m_sQueueSample.m_nEntityIndex % 1000; if(m_sQueueSample.m_nSampleIndex == SFX_CAR_IDLE_6 || m_sQueueSample.m_nSampleIndex == SFX_CAR_REV_6) - m_sQueueSample.m_nFrequency = - m_sQueueSample.m_nFrequency >> 1; + m_sQueueSample.m_nFrequency /= 2; m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_bEmittingVolume = emittingVol; - m_sQueueSample.m_nLoopStart = - SampleManager.GetSampleLoopStartOffset( - m_sQueueSample.m_nSampleIndex); - m_sQueueSample.m_nLoopEnd = SampleManager.GetSampleLoopEndOffset( - m_sQueueSample.m_nSampleIndex); + m_sQueueSample.m_nEmittingVolume = emittingVol; + m_sQueueSample.m_nLoopStart = SampleManager.GetSampleLoopStartOffset(m_sQueueSample.m_nSampleIndex); + m_sQueueSample.m_nLoopEnd = SampleManager.GetSampleLoopEndOffset(m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_fSpeedMultiplier = 6.0f; m_sQueueSample.m_fSoundIntensity = 50.0f; m_sQueueSample.m_bReleasingSoundFlag = false; @@ -8481,19 +8403,19 @@ cAudioManager::ProcessVehicleHorn(cVehicleParams *params) CalculateDistance(params->m_bDistanceCalculated, params->m_fDistance); - m_sQueueSample.m_bVolume = + m_sQueueSample.m_nVolume = ComputeVolume(80, 40.f, m_sQueueSample.m_fDistance); - if(m_sQueueSample.m_bVolume) { + if(m_sQueueSample.m_nVolume) { m_sQueueSample.m_nCounter = 4; m_sQueueSample.m_nSampleIndex = - CarSounds[params->m_nIndex].m_nHornSample; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + aVehicleSettings[params->m_nIndex].m_nHornSample; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_bIs2D = false; m_sQueueSample.m_nReleasingVolumeModificator = 2; m_sQueueSample.m_nFrequency = - CarSounds[params->m_nIndex].m_nHornFrequency; + aVehicleSettings[params->m_nIndex].m_nHornFrequency; m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_bEmittingVolume = 80; + m_sQueueSample.m_nEmittingVolume = 80; m_sQueueSample.m_nLoopStart = SampleManager.GetSampleLoopStartOffset( m_sQueueSample.m_nSampleIndex); @@ -8542,13 +8464,13 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams *params) case SOUND_CAR_DOOR_CLOSE_BACK_RIGHT: maxDist = 2500.f; emittingVol = m_anRandomTable[2] % 5 + 122; - switch(CarSounds[params->m_nIndex].m_bDoorType) { + switch(aVehicleSettings[params->m_nIndex].m_bDoorType) { case 0: m_sQueueSample.m_nSampleIndex = SFX_OLD_CAR_DOOR_CLOSE; break; case 2: m_sQueueSample.m_nSampleIndex = SFX_TRUCK_DOOR_CLOSE; break; case 3: m_sQueueSample.m_nSampleIndex = SFX_AIR_BRAKES; break; default: m_sQueueSample.m_nSampleIndex = SFX_NEW_CAR_DOOR_CLOSE; break; } - m_sQueueSample.m_bBankIndex = 0; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_nCounter = m_asAudioEntities[m_sQueueSample.m_nEntityIndex].m_awAudioEvent[i] + 22; m_sQueueSample.m_nFrequency = @@ -8568,13 +8490,13 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams *params) case SOUND_CAR_DOOR_OPEN_BACK_RIGHT: maxDist = 2500.f; emittingVol = m_anRandomTable[1] % 10 + 117; - switch(CarSounds[params->m_nIndex].m_bDoorType) { + switch(aVehicleSettings[params->m_nIndex].m_bDoorType) { case 0: m_sQueueSample.m_nSampleIndex = SFX_OLD_CAR_DOOR_OPEN; break; case 2: m_sQueueSample.m_nSampleIndex = SFX_TRUCK_DOOR_OPEN; break; case 3: m_sQueueSample.m_nSampleIndex = SFX_AIR_BRAKES; break; default: m_sQueueSample.m_nSampleIndex = SFX_NEW_CAR_DOOR_OPEN; break; } - m_sQueueSample.m_bBankIndex = 0; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_nCounter = m_asAudioEntities[m_sQueueSample.m_nEntityIndex].m_awAudioEvent[i] + 10; m_sQueueSample.m_nFrequency = @@ -8589,7 +8511,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams *params) case SOUND_CAR_WINDSHIELD_CRACK: maxDist = 900.f; m_sQueueSample.m_nSampleIndex = SFX_GLASS_CRACK; - m_sQueueSample.m_bBankIndex = 0; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_nCounter = 68; emittingVol = m_anRandomTable[1] % 30 + 60; m_sQueueSample.m_nFrequency = @@ -8605,7 +8527,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams *params) m_asAudioEntities[m_sQueueSample.m_nEntityIndex].m_afVolume[i])); maxDist = 1225.f; m_sQueueSample.m_nSampleIndex = SFX_TYRE_BUMP; - m_sQueueSample.m_bBankIndex = 0; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_nCounter = iWheelIndex++; if(iWheelIndex > 85) iWheelIndex = 82; m_sQueueSample.m_nFrequency = @@ -8620,119 +8542,11 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams *params) m_sQueueSample.m_fSpeedMultiplier = 2.0f; m_sQueueSample.m_fSoundIntensity = 35.0f; break; - case SOUND_E: - case SOUND_F: - case SOUND_STEP_START: - case SOUND_STEP_END: - case SOUND_FALL_LAND: - case SOUND_FALL_COLLAPSE: - case SOUND_FIGHT_PUNCH_33: - case SOUND_FIGHT_KICK_34: - case SOUND_FIGHT_HEADBUTT_35: - case SOUND_FIGHT_PUNCH_36: - case SOUND_FIGHT_PUNCH_37: - case SOUND_FIGHT_CLOSE_PUNCH_38: - case SOUND_FIGHT_PUNCH_39: - case SOUND_FIGHT_PUNCH_OR_KICK_BELOW_40: - case SOUND_FIGHT_PUNCH_41: - case SOUND_FIGHT_PUNCH_FROM_BEHIND_42: - case SOUND_FIGHT_KNEE_OR_KICK_43: - case SOUND_FIGHT_KICK_44: - case SOUND_WEAPON_BAT_ATTACK: - case SOUND_WEAPON_RELOAD: - case SOUND_WEAPON_AK47_BULLET_ECHO: - case SOUND_WEAPON_UZI_BULLET_ECHO: - case SOUND_WEAPON_M16_BULLET_ECHO: - case SOUND_WEAPON_FLAMETHROWER_FIRE: - case SOUND_WEAPON_SNIPER_SHOT_NO_ZOOM: - case SOUND_WEAPON_ROCKET_SHOT_NO_ZOOM: - case SOUND_WEAPON_HIT_PED: - case SOUND_GARAGE_NO_MONEY: - case SOUND_GARAGE_BAD_VEHICLE: - case SOUND_GARAGE_OPENING: - case SOUND_GARAGE_BOMB_ALREADY_SET: - case SOUND_GARAGE_BOMB1_SET: - case SOUND_GARAGE_BOMB2_SET: - case SOUND_GARAGE_BOMB3_SET: - case SOUND_40: - case SOUND_41: - case SOUND_GARAGE_VEHICLE_DECLINED: - case SOUND_GARAGE_VEHICLE_ACCEPTED: - case SOUND_GARAGE_DOOR_CLOSED: - case SOUND_GARAGE_DOOR_OPENED: - case SOUND_CRANE_PICKUP: - case SOUND_PICKUP_WEAPON_BOUGHT: - case SOUND_PICKUP_WEAPON: - case SOUND_PICKUP_HEALTH: - case SOUND_4A: - case SOUND_4B: - case SOUND_PICKUP_ADRENALINE: - case SOUND_PICKUP_ARMOUR: - case SOUND_PICKUP_BONUS: - case SOUND_PICKUP_MONEY: - case SOUND_PICKUP_HIDDEN_PACKAGE: - case SOUND_PICKUP_PACMAN_PILL: - case SOUND_PICKUP_PACMAN_PACKAGE: - case SOUND_PICKUP_FLOAT_PACKAGE: - case SOUND_RAMPAGE_START: - case SOUND_RAMPAGE_ONGOING: - case SOUND_RAMPAGE_PASSED: - case SOUND_RAMPAGE_FAILED: - case SOUND_RAMPAGE_KILL: - case SOUND_RAMPAGE_CAR_BLOWN: - case SOUND_EVIDENCE_PICKUP: - case SOUND_UNLOAD_GOLD: - case SOUND_PAGER: - case SOUND_PED_DEATH: - case SOUND_PED_DAMAGE: - case SOUND_PED_HIT: - case SOUND_PED_LAND: - case SOUND_PED_BULLET_HIT: - case SOUND_PED_BOMBER: - case SOUND_PED_BURNING: - case SOUND_PED_ARREST_FBI: - case SOUND_PED_ARREST_SWAT: - case SOUND_PED_ARREST_COP: - case SOUND_PED_HANDS_UP: - case SOUND_PED_HANDS_COWER: - case SOUND_PED_FLEE_SPRINT: - case SOUND_PED_CAR_JACKING: - case SOUND_PED_MUGGING: - case SOUND_PED_CAR_JACKED: - case SOUND_PED_ROBBED: - case SOUND_PED_TAXI_WAIT: - case SOUND_PED_ATTACK: - case SOUND_PED_DEFEND: - case SOUND_PED_PURSUIT_ARMY: - case SOUND_PED_PURSUIT_FBI: - case SOUND_PED_PURSUIT_SWAT: - case SOUND_PED_PURSUIT_COP: - case SOUND_PED_HEALING: - case SOUND_PED_7B: - case SOUND_PED_LEAVE_VEHICLE: - case SOUND_PED_EVADE: - case SOUND_PED_FLEE_RUN: - case SOUND_PED_CAR_COLLISION: - case SOUND_PED_SOLICIT: - case SOUND_PED_EXTINGUISHING_FIRE: - case SOUND_PED_WAIT_DOUBLEBACK: - case SOUND_PED_CHAT_SEXY: - case SOUND_PED_CHAT_EVENT: - case SOUND_PED_CHAT: - case SOUND_PED_TAXI_CALL: - case SOUND_INJURED_PED_MALE_OUCH: - case SOUND_INJURED_PED_FEMALE: - case SOUND_8A: - case SOUND_RACE_START_3: - case SOUND_RACE_START_2: - case SOUND_RACE_START_1: - case SOUND_RACE_START_GO: - case SOUND_SPLASH: continue; case SOUND_CAR_ENGINE_START: emittingVol = 60; maxDist = 1600.f; m_sQueueSample.m_nSampleIndex = SFX_CAR_STARTER; - m_sQueueSample.m_bBankIndex = 0; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_nCounter = 33; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_CAR_STARTER); @@ -8743,7 +8557,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams *params) break; case SOUND_CAR_LIGHT_BREAK: m_sQueueSample.m_nSampleIndex = SFX_GLASS_SHARD_1; - m_sQueueSample.m_bBankIndex = 0; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_nCounter = 37; m_sQueueSample.m_nFrequency = 9 * SampleManager.GetSampleBaseFrequency(SFX_GLASS_SHARD_1) / 10; @@ -8762,7 +8576,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams *params) else m_sQueueSample.m_nFrequency = 13118; m_sQueueSample.m_nSampleIndex = SFX_SUSPENSION_FAST_MOVE; - m_sQueueSample.m_bBankIndex = 0; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_nCounter = 51; m_sQueueSample.m_nFrequency += RandomDisplacement(m_sQueueSample.m_nFrequency >> 3); @@ -8774,7 +8588,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams *params) break; case SOUND_CAR_HYDRAULIC_3: m_sQueueSample.m_nSampleIndex = SFX_SUSPENSION_SLOW_MOVE_LOOP; - m_sQueueSample.m_bBankIndex = 0; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_nCounter = 86; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_SUSPENSION_SLOW_MOVE_LOOP); @@ -8788,7 +8602,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams *params) break; case SOUND_CAR_JERK: m_sQueueSample.m_nSampleIndex = SFX_SHAG_SUSPENSION; - m_sQueueSample.m_bBankIndex = 0; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_nCounter = 87; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_SHAG_SUSPENSION); @@ -8811,7 +8625,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams *params) 900.f; m_sQueueSample.m_nSampleIndex = (m_anRandomTable[0] & 1) + SFX_BOAT_SPLASH_1; - m_sQueueSample.m_bBankIndex = 0; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_nCounter = WaveIndex++; if(WaveIndex > 46) WaveIndex = 41; m_sQueueSample.m_nFrequency = (7000.f * relVol) + 6000; @@ -8823,7 +8637,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams *params) break; case SOUND_17: m_sQueueSample.m_nSampleIndex = SFX_POLICE_BOAT_THUMB_OFF; - m_sQueueSample.m_bBankIndex = 0; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_nCounter = 47; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_POLICE_BOAT_THUMB_OFF) + @@ -8838,7 +8652,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams *params) case SOUND_18: case SOUND_19: m_sQueueSample.m_nSampleIndex = SFX_AIR_BRAKES; - m_sQueueSample.m_bBankIndex = 0; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_nCounter = 59; m_sQueueSample.m_nFrequency = RandomDisplacement(1000) + 11025; m_sQueueSample.m_nReleasingVolumeModificator = 5; @@ -8851,7 +8665,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams *params) vol = m_asAudioEntities[m_sQueueSample.m_nEntityIndex].m_afVolume[i]; if(vol > 0.038400002f) vol = 0.038400002f; m_sQueueSample.m_nSampleIndex = SFX_TANK_TURRET; - m_sQueueSample.m_bBankIndex = 0; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_nCounter = 79; m_sQueueSample.m_nFrequency = (3000.f * vol * 26.041666f) + 9000; m_sQueueSample.m_nReleasingVolumeModificator = 2; @@ -8864,7 +8678,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams *params) break; case SOUND_CAR_BOMB_TICK: m_sQueueSample.m_nSampleIndex = SFX_BOMB_BEEP; - m_sQueueSample.m_bBankIndex = 0; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_nCounter = 80; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_BOMB_BEEP); @@ -8877,7 +8691,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams *params) break; case SOUND_PLANE_ON_GROUND: m_sQueueSample.m_nSampleIndex = SFX_JUMBO_LAND_WHEELS; - m_sQueueSample.m_bBankIndex = 0; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_nCounter = 81; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_JUMBO_LAND_WHEELS); @@ -8891,7 +8705,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams *params) emittingVol = m_anRandomTable[2]; maxDist = 14400.f; m_sQueueSample.m_nSampleIndex = SFX_UZI_LEFT; - m_sQueueSample.m_bBankIndex = 0; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_nCounter = GunIndex++; emittingVol = emittingVol % 15 + 65; if(GunIndex > 58) GunIndex = 53; @@ -8909,7 +8723,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams *params) ARRAY_SIZE(m_anRandomTable)] % 6 + SFX_BULLET_CAR_1; - m_sQueueSample.m_bBankIndex = 0; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_nCounter = 34; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex); @@ -8926,7 +8740,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams *params) case SOUND_BOMB_ONIGNITION_ACTIVATED: case SOUND_BOMB_TICK: m_sQueueSample.m_nSampleIndex = SFX_ARM_BOMB; - m_sQueueSample.m_bBankIndex = 0; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_nCounter = 36; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_ARM_BOMB); @@ -8938,16 +8752,16 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams *params) maxDist = 2500.f; break; case SOUND_PED_HELI_PLAYER_FOUND: - pedParams.m_pPed = 0; - pedParams.m_bDistanceCalculated = 0; + pedParams.m_pPed = nil; + pedParams.m_bDistanceCalculated = false; pedParams.m_fDistance = 0.0f; pedParams.m_bDistanceCalculated = params->m_bDistanceCalculated; pedParams.m_fDistance = params->m_fDistance; SetupPedComments(&pedParams, SOUND_PED_HELI_PLAYER_FOUND); continue; case SOUND_PED_BODYCAST_HIT: - pedParams.m_pPed = 0; - pedParams.m_bDistanceCalculated = 0; + pedParams.m_pPed = nil; + pedParams.m_bDistanceCalculated = false; pedParams.m_fDistance = 0.0f; pedParams.m_bDistanceCalculated = params->m_bDistanceCalculated; pedParams.m_fDistance = params->m_fDistance; @@ -8955,7 +8769,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams *params) continue; case SOUND_WATER_FALL: m_sQueueSample.m_nSampleIndex = SFX_SPLASH_1; - m_sQueueSample.m_bBankIndex = 0; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_nCounter = 15; m_sQueueSample.m_nFrequency = RandomDisplacement(1000) + 16000; m_sQueueSample.m_nReleasingVolumeModificator = 1; @@ -8967,7 +8781,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams *params) break; case SOUND_SPLATTER: m_sQueueSample.m_nSampleIndex = CrunchOffset + SFX_PED_CRUNCH_1; - m_sQueueSample.m_bBankIndex = 0; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_nCounter = 48; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_PED_CRUNCH_1) + @@ -8984,41 +8798,40 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams *params) case SOUND_CAR_PED_COLLISION: vol = m_asAudioEntities[m_sQueueSample.m_nEntityIndex].m_afVolume[i]; if(20.f < vol) vol = 20.f; - emittingVol = (vol * 0.05f * 127.f); + emittingVol = (vol / 20.0f * 127.f); if(!emittingVol) continue; m_sQueueSample.m_nSampleIndex = (m_anRandomTable[2] & 3) + SFX_FIGHT_1; - m_sQueueSample.m_bBankIndex = 0; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_nCounter = 50; - m_sQueueSample.m_nFrequency = - SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex) >> - 1; + m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex) / 2; m_sQueueSample.m_nReleasingVolumeModificator = 1; m_sQueueSample.m_fSpeedMultiplier = 0.0f; m_sQueueSample.m_fSoundIntensity = 40.0f; maxDist = 1600.f; break; + default: continue; } if(params->m_fDistance < maxDist) { CalculateDistance(params->m_bDistanceCalculated, params->m_fDistance); - m_sQueueSample.m_bVolume = + m_sQueueSample.m_nVolume = ComputeVolume(emittingVol, m_sQueueSample.m_fSoundIntensity, m_sQueueSample.m_fDistance); - if(m_sQueueSample.m_bVolume) { + if(m_sQueueSample.m_nVolume) { if(noReflections) { m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_bReleasingSoundFlag = 0; + m_sQueueSample.m_bReleasingSoundFlag = false; } else { m_sQueueSample.m_nLoopCount = 1; - m_sQueueSample.m_bReleasingSoundFlag = 1; + m_sQueueSample.m_bReleasingSoundFlag = true; } m_sQueueSample.m_nLoopStart = SampleManager.GetSampleLoopStartOffset( m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_nLoopEnd = SampleManager.GetSampleLoopEndOffset( m_sQueueSample.m_nSampleIndex); - m_sQueueSample.m_bEmittingVolume = emittingVol; - m_sQueueSample.m_bReverbFlag = 1; + m_sQueueSample.m_nEmittingVolume = emittingVol; + m_sQueueSample.m_bReverbFlag = true; m_sQueueSample.m_bIs2D = false; AddSampleToRequestedQueue(); } @@ -9035,18 +8848,18 @@ cAudioManager::ProcessVehicleReverseWarning(cVehicleParams *params) if(veh->bEngineOn && veh->m_fGasPedal < 0.0f) { CalculateDistance(params->m_bDistanceCalculated, params->m_fDistance); - m_sQueueSample.m_bVolume = ComputeVolume(60, 50.f, m_sQueueSample.m_fDistance); - if(m_sQueueSample.m_bVolume) { + m_sQueueSample.m_nVolume = ComputeVolume(60, 50.f, m_sQueueSample.m_fDistance); + if(m_sQueueSample.m_nVolume) { m_sQueueSample.m_nCounter = 12; m_sQueueSample.m_nSampleIndex = SFX_REVERSE_WARNING; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_bIs2D = false; m_sQueueSample.m_nReleasingVolumeModificator = 2; m_sQueueSample.m_nFrequency = (100 * m_sQueueSample.m_nEntityIndex & 1023) + SampleManager.GetSampleBaseFrequency(SFX_REVERSE_WARNING); m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_bEmittingVolume = 60; + m_sQueueSample.m_nEmittingVolume = 60; m_sQueueSample.m_nLoopStart = SampleManager.GetSampleLoopStartOffset(m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_nLoopEnd = @@ -9083,11 +8896,11 @@ cAudioManager::ProcessVehicleRoadNoise(cVehicleParams *params) 30.f * Min(1.f, velocity / (0.5f * params->m_pTransmission->fMaxVelocity)); - m_sQueueSample.m_bVolume = + m_sQueueSample.m_nVolume = ComputeVolume(emittingVol, 95.f, m_sQueueSample.m_fDistance); - if(m_sQueueSample.m_bVolume) { + if(m_sQueueSample.m_nVolume) { m_sQueueSample.m_nCounter = 0; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_bIs2D = false; m_sQueueSample.m_nReleasingVolumeModificator = 3; if(params->m_pVehicle->m_nSurfaceTouched == @@ -9104,7 +8917,7 @@ cAudioManager::ProcessVehicleRoadNoise(cVehicleParams *params) } m_sQueueSample.m_nFrequency = freq; m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_bEmittingVolume = emittingVol; + m_sQueueSample.m_nEmittingVolume = emittingVol; m_sQueueSample.m_nLoopStart = SampleManager.GetSampleLoopStartOffset( m_sQueueSample.m_nSampleIndex); @@ -9136,8 +8949,8 @@ cAudioManager::ProcessVehicleSirenOrAlarm(cVehicleParams *params) if (params->m_pVehicle->m_status == STATUS_WRECKED) return; #endif CalculateDistance(params->m_bDistanceCalculated, params->m_fDistance); - m_sQueueSample.m_bVolume = ComputeVolume(80, 110.f, m_sQueueSample.m_fDistance); - if(m_sQueueSample.m_bVolume) { + m_sQueueSample.m_nVolume = ComputeVolume(80, 110.f, m_sQueueSample.m_fDistance); + if(m_sQueueSample.m_nVolume) { m_sQueueSample.m_nCounter = 5; if(UsesSiren(params->m_nIndex)) { if(params->m_pVehicle->m_status == STATUS_ABANDONED) return; @@ -9152,21 +8965,21 @@ cAudioManager::ProcessVehicleSirenOrAlarm(cVehicleParams *params) m_sQueueSample.m_nCounter = 60; } else { m_sQueueSample.m_nSampleIndex = - CarSounds[params->m_nIndex].m_nSirenOrAlarmSample; + aVehicleSettings[params->m_nIndex].m_nSirenOrAlarmSample; m_sQueueSample.m_nFrequency = - CarSounds[params->m_nIndex].m_nSirenOrAlarmFrequency; + aVehicleSettings[params->m_nIndex].m_nSirenOrAlarmFrequency; } } else { m_sQueueSample.m_nSampleIndex = - CarSounds[params->m_nIndex].m_nSirenOrAlarmSample; + aVehicleSettings[params->m_nIndex].m_nSirenOrAlarmSample; m_sQueueSample.m_nFrequency = - CarSounds[params->m_nIndex].m_nSirenOrAlarmFrequency; + aVehicleSettings[params->m_nIndex].m_nSirenOrAlarmFrequency; } - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_bIs2D = false; m_sQueueSample.m_nReleasingVolumeModificator = 1; m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_bEmittingVolume = 80; + m_sQueueSample.m_nEmittingVolume = 80; m_sQueueSample.m_nLoopStart = SampleManager.GetSampleLoopStartOffset(m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_nLoopEnd = @@ -9236,9 +9049,9 @@ cAudioManager::ProcessVehicleSkidding(cVehicleParams *params) if(skidVal > 0.0f) { emittingVol = 50.f * skidVal; - m_sQueueSample.m_bVolume = + m_sQueueSample.m_nVolume = ComputeVolume(emittingVol, 40.f, m_sQueueSample.m_fDistance); - if(m_sQueueSample.m_bVolume) { + if(m_sQueueSample.m_nVolume) { m_sQueueSample.m_nCounter = 3; switch(params->m_pVehicle->m_nSurfaceTouched) { case SURFACE_GRASS: @@ -9246,7 +9059,7 @@ cAudioManager::ProcessVehicleSkidding(cVehicleParams *params) m_sQueueSample.m_nSampleIndex = SFX_RAIN; emittingVol /= 4; m_sQueueSample.m_nFrequency = 13000.f * skidVal + 35000.f; - m_sQueueSample.m_bVolume /= 4; + m_sQueueSample.m_nVolume /= 4; break; case SURFACE_DIRT: case SURFACE_DIRTTRACK: @@ -9262,11 +9075,11 @@ cAudioManager::ProcessVehicleSkidding(cVehicleParams *params) break; } - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_bIs2D = false; m_sQueueSample.m_nReleasingVolumeModificator = 8; m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_bEmittingVolume = emittingVol; + m_sQueueSample.m_nEmittingVolume = emittingVol; m_sQueueSample.m_nLoopStart = SampleManager.GetSampleLoopStartOffset(m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_nLoopEnd = @@ -9291,13 +9104,13 @@ void cAudioManager::ProcessWaterCannon(int32) float distSquared = GetDistanceSquared(&m_sQueueSample.m_vecPos); if(distSquared < 900.f) { m_sQueueSample.m_fDistance = Sqrt(distSquared); - m_sQueueSample.m_bVolume = + m_sQueueSample.m_nVolume = ComputeVolume(50, m_sQueueSample.m_fSoundIntensity, m_sQueueSample.m_fDistance); - if(m_sQueueSample.m_bVolume) { + if(m_sQueueSample.m_nVolume) { m_sQueueSample.m_fSoundIntensity = 900.0f; m_sQueueSample.m_nSampleIndex = SFX_JUMBO_TAXI; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_nFrequency = 15591; m_sQueueSample.m_nReleasingVolumeModificator = 5; m_sQueueSample.m_nCounter = i; @@ -9306,7 +9119,7 @@ void cAudioManager::ProcessWaterCannon(int32) m_sQueueSample.m_bIs2D = false; m_sQueueSample.m_nLoopCount = 0; m_sQueueSample.m_bReleasingSoundFlag = false; - m_sQueueSample.m_bEmittingVolume = 50; + m_sQueueSample.m_nEmittingVolume = 50; m_sQueueSample.m_nLoopStart = SampleManager.GetSampleLoopStartOffset( m_sQueueSample.m_nSampleIndex); @@ -9332,25 +9145,25 @@ cAudioManager::ProcessWeather(int32 id) m_asAudioEntities[id].m_awAudioEvent[0] == SOUND_LIGHTNING) { if(m_asAudioEntities[id].m_afVolume[0] >= 10.f) { m_sQueueSample.m_nSampleIndex = SFX_EXPLOSION_1; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_nFrequency = RandomDisplacement(500) + 4000; vol = (m_asAudioEntities[id].m_afVolume[0] - 10.f) + 40; } else { m_sQueueSample.m_nSampleIndex = SFX_EXPLOSION_2; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_nFrequency = RandomDisplacement(500) + 4000; vol = (m_asAudioEntities[id].m_afVolume[0]) + 35; } - m_sQueueSample.m_bVolume = vol; - if(TheCamera.SoundDistUp < 20.f) m_sQueueSample.m_bVolume >>= 1; + m_sQueueSample.m_nVolume = vol; + if(TheCamera.SoundDistUp < 20.f) m_sQueueSample.m_nVolume /= 2; if(counter == 4) counter = 0; m_sQueueSample.m_nCounter = counter++; m_sQueueSample.m_nReleasingVolumeModificator = 0; - m_sQueueSample.m_bOffset = (m_anRandomTable[2] & 15) + 55; + m_sQueueSample.m_nOffset = (m_anRandomTable[2] & 15) + 55; m_sQueueSample.m_bIs2D = true; m_sQueueSample.m_nLoopCount = 1; m_sQueueSample.m_bReleasingSoundFlag = true; - m_sQueueSample.m_bEmittingVolume = m_sQueueSample.m_bVolume; + m_sQueueSample.m_nEmittingVolume = m_sQueueSample.m_nVolume; m_sQueueSample.m_nLoopStart = 0; m_sQueueSample.m_nLoopEnd = -1; m_sQueueSample.m_bReverbFlag = false; @@ -9360,17 +9173,17 @@ cAudioManager::ProcessWeather(int32 id) if(CWeather::Rain > 0.0f && (!CCullZones::CamNoRain() || !CCullZones::PlayerNoRain())) { m_sQueueSample.m_nSampleIndex = SFX_RAIN; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_RAIN); - m_sQueueSample.m_bVolume = (int32)(25.f * CWeather::Rain); + m_sQueueSample.m_nVolume = (int32)(25.f * CWeather::Rain); m_sQueueSample.m_nCounter = 4; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_nReleasingVolumeModificator = 0; - m_sQueueSample.m_bOffset = 63; + m_sQueueSample.m_nOffset = 63; m_sQueueSample.m_bIs2D = true; m_sQueueSample.m_nLoopCount = 0; m_sQueueSample.m_bReleasingSoundFlag = false; m_sQueueSample.m_nReleasingVolumeDivider = 30; m_sQueueSample.m_bReverbFlag = false; - m_sQueueSample.m_bEmittingVolume = m_sQueueSample.m_bVolume; + m_sQueueSample.m_nEmittingVolume = m_sQueueSample.m_nVolume; m_sQueueSample.m_nLoopStart = SampleManager.GetSampleLoopStartOffset(m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_nLoopEnd = @@ -9400,19 +9213,19 @@ cAudioManager::ProcessWetRoadNoise(cVehicleParams *params) Min(1.0f, velChange / (0.5f * params->m_pTransmission->fMaxVelocity)); emittingVol = 23.0f * relativeVelocity * CWeather::WetRoads; - m_sQueueSample.m_bVolume = + m_sQueueSample.m_nVolume = ComputeVolume(emittingVol, 30.f, m_sQueueSample.m_fDistance); - if(m_sQueueSample.m_bVolume) { + if(m_sQueueSample.m_nVolume) { m_sQueueSample.m_nCounter = 1; m_sQueueSample.m_nSampleIndex = SFX_ROAD_NOISE; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_bIs2D = false; m_sQueueSample.m_nReleasingVolumeModificator = 3; modificator = m_sQueueSample.m_fDistance / 6.f; freq = SampleManager.GetSampleBaseFrequency(SFX_ROAD_NOISE); m_sQueueSample.m_nFrequency = freq + freq * modificator; m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_bEmittingVolume = emittingVol; + m_sQueueSample.m_nEmittingVolume = emittingVol; m_sQueueSample.m_nLoopStart = SampleManager.GetSampleLoopStartOffset( m_sQueueSample.m_nSampleIndex); @@ -9446,11 +9259,11 @@ cAudioManager::ProcessWorkShopScriptObject(uint8 sound) distSquared = GetDistanceSquared(&m_sQueueSample.m_vecPos); if(distSquared < SQR(m_sQueueSample.m_fSoundIntensity)) { m_sQueueSample.m_fDistance = Sqrt(distSquared); - m_sQueueSample.m_bVolume = + m_sQueueSample.m_nVolume = ComputeVolume(30, m_sQueueSample.m_fSoundIntensity, m_sQueueSample.m_fDistance); - if(m_sQueueSample.m_bVolume) { + if(m_sQueueSample.m_nVolume) { m_sQueueSample.m_nSampleIndex = SFX_WORKSHOP_1; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_WORKSHOP_1); m_sQueueSample.m_nCounter = 0; @@ -9459,7 +9272,7 @@ cAudioManager::ProcessWorkShopScriptObject(uint8 sound) m_sQueueSample.m_bReleasingSoundFlag = false; m_sQueueSample.m_nReleasingVolumeModificator = 5; m_sQueueSample.m_fSpeedMultiplier = 2.0f; - m_sQueueSample.m_bEmittingVolume = 30; + m_sQueueSample.m_nEmittingVolume = 30; m_sQueueSample.m_nLoopStart = SampleManager.GetSampleLoopStartOffset(m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_nLoopEnd = @@ -9564,8 +9377,8 @@ cAudioManager::Service() m_bTimerJustReset = 0; } if(m_bIsInitialised) { - m_bPreviousUserPause = m_bUserPause; - m_bUserPause = CTimer::GetIsUserPaused(); + m_nPreviousUserPause = m_nUserPause; + m_nUserPause = CTimer::GetIsUserPaused(); UpdateReflections(); ServiceSoundEffects(); MusicManager.Service(); @@ -9579,7 +9392,7 @@ cAudioManager::ServiceSoundEffects() m_bFifthFrameFlag = false; else m_bFifthFrameFlag = true; - if(m_bUserPause && !m_bPreviousUserPause) { + if(m_nUserPause && !m_nPreviousUserPause) { for(int32 i = 0; i < allChannels; i++) SampleManager.StopChannel(i); ClearRequestedQueue(); @@ -9624,7 +9437,7 @@ int8 cAudioManager::SetCurrent3DProvider(uint8 which) { if(!m_bIsInitialised) return -1; - for(uint8 i = 0; i < m_bActiveSamples + 1; ++i) SampleManager.StopChannel(i); + for(uint8 i = 0; i < m_nActiveSamples + 1; ++i) SampleManager.StopChannel(i); ClearRequestedQueue(); if(m_bActiveSampleQueue) m_bActiveSampleQueue = 0; @@ -9634,8 +9447,8 @@ cAudioManager::SetCurrent3DProvider(uint8 which) ClearActiveSamples(); int8 current = SampleManager.SetCurrent3DProvider(which); if(current > 0) { - m_bActiveSamples = SampleManager.GetMaximumSupportedChannels(); - if(m_bActiveSamples > 1) --m_bActiveSamples; + m_nActiveSamples = SampleManager.GetMaximumSupportedChannels(); + if(m_nActiveSamples > 1) --m_nActiveSamples; } return current; } @@ -9663,7 +9476,7 @@ cAudioManager::SetEntityStatus(int32 id, uint8 status) { if(m_bIsInitialised && id >= 0 && id < totalAudioEntitiesSlots && m_asAudioEntities[id].m_bIsUsed) { - m_asAudioEntities[id].m_bStatus = status; + m_asAudioEntities[id].m_nStatus = status; } } @@ -9700,16 +9513,16 @@ cAudioManager::SetupJumboEngineSound(uint8 vol, int32 freq) if(m_sQueueSample.m_fDistance >= 180.f) return false; uint8 emittingVol = vol - gJumboVolOffsetPercentage / 100; - m_sQueueSample.m_bVolume = ComputeVolume(emittingVol, 180.f, m_sQueueSample.m_fDistance); - if(m_sQueueSample.m_bVolume) { + m_sQueueSample.m_nVolume = ComputeVolume(emittingVol, 180.f, m_sQueueSample.m_fDistance); + if(m_sQueueSample.m_nVolume) { m_sQueueSample.m_nCounter = 3; m_sQueueSample.m_nSampleIndex = SFX_JUMBO_ENGINE; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_bIs2D = false; m_sQueueSample.m_nReleasingVolumeModificator = 1; m_sQueueSample.m_nFrequency = freq; m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_bEmittingVolume = emittingVol; + m_sQueueSample.m_nEmittingVolume = emittingVol; m_sQueueSample.m_nLoopStart = SampleManager.GetSampleLoopStartOffset(m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_nLoopEnd = @@ -9731,14 +9544,14 @@ cAudioManager::SetupJumboFlySound(uint8 emittingVol) if(m_sQueueSample.m_fDistance >= 440.0f) return false; int32 vol = ComputeVolume(emittingVol, 440.0f, m_sQueueSample.m_fDistance); - m_sQueueSample.m_bVolume = vol; - if(m_sQueueSample.m_bVolume) { + m_sQueueSample.m_nVolume = vol; + if(m_sQueueSample.m_nVolume) { m_sQueueSample.m_nSampleIndex = SFX_JUMBO_DIST_FLY; m_sQueueSample.m_nCounter = 0; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_bIs2D = false; m_sQueueSample.m_nReleasingVolumeModificator = 1; - m_sQueueSample.m_bEmittingVolume = emittingVol; + m_sQueueSample.m_nEmittingVolume = emittingVol; m_sQueueSample.m_nLoopCount = 0; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_JUMBO_DIST_FLY); @@ -9761,18 +9574,18 @@ cAudioManager::SetupJumboRumbleSound(uint8 emittingVol) { if(m_sQueueSample.m_fDistance >= 240.f) return false; - m_sQueueSample.m_bVolume = ComputeVolume(emittingVol, 240.f, m_sQueueSample.m_fDistance); + m_sQueueSample.m_nVolume = ComputeVolume(emittingVol, 240.f, m_sQueueSample.m_fDistance); - if(m_sQueueSample.m_bVolume) { + if(m_sQueueSample.m_nVolume) { m_sQueueSample.m_nCounter = 5; m_sQueueSample.m_nSampleIndex = SFX_JUMBO_RUMBLE; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_bIs2D = true; m_sQueueSample.m_nReleasingVolumeModificator = 1; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_JUMBO_RUMBLE); m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_bEmittingVolume = emittingVol; + m_sQueueSample.m_nEmittingVolume = emittingVol; m_sQueueSample.m_nLoopStart = SampleManager.GetSampleLoopStartOffset(m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_nLoopEnd = @@ -9781,14 +9594,14 @@ cAudioManager::SetupJumboRumbleSound(uint8 emittingVol) m_sQueueSample.m_fSoundIntensity = 240.0f; m_sQueueSample.m_bReleasingSoundFlag = false; m_sQueueSample.m_nReleasingVolumeDivider = 12; - m_sQueueSample.m_bOffset = 0; + m_sQueueSample.m_nOffset = 0; m_sQueueSample.m_bReverbFlag = true; m_sQueueSample.m_bRequireReflection = false; AddSampleToRequestedQueue(); m_sQueueSample.m_nCounter = 6; m_sQueueSample.m_nSampleIndex = SFX_JUMBO_RUMBLE; m_sQueueSample.m_nFrequency += 200; - m_sQueueSample.m_bOffset = maxVolume; + m_sQueueSample.m_nOffset = maxVolume; AddSampleToRequestedQueue(); } return true; @@ -9803,17 +9616,17 @@ cAudioManager::SetupJumboTaxiSound(uint8 vol) if(m_sQueueSample.m_fDistance / 180 < 0.7f) emittingVol -= emittingVol * gJumboVolOffsetPercentage / 100; - m_sQueueSample.m_bVolume = ComputeVolume(emittingVol, 180.f, m_sQueueSample.m_fDistance); + m_sQueueSample.m_nVolume = ComputeVolume(emittingVol, 180.f, m_sQueueSample.m_fDistance); - if(m_sQueueSample.m_bVolume) { + if(m_sQueueSample.m_nVolume) { m_sQueueSample.m_nCounter = 1; m_sQueueSample.m_nSampleIndex = SFX_JUMBO_TAXI; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_bIs2D = false; m_sQueueSample.m_nReleasingVolumeModificator = 1; m_sQueueSample.m_nFrequency = GetJumboTaxiFreq(); m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_bEmittingVolume = emittingVol; + m_sQueueSample.m_nEmittingVolume = emittingVol; m_sQueueSample.m_nLoopStart = SampleManager.GetSampleLoopStartOffset(m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_nLoopEnd = @@ -9834,17 +9647,17 @@ cAudioManager::SetupJumboWhineSound(uint8 emittingVol, int32 freq) { if(m_sQueueSample.m_fDistance >= 170.f) return false; - m_sQueueSample.m_bVolume = ComputeVolume(emittingVol, 170.f, m_sQueueSample.m_fDistance); + m_sQueueSample.m_nVolume = ComputeVolume(emittingVol, 170.f, m_sQueueSample.m_fDistance); - if(m_sQueueSample.m_bVolume) { + if(m_sQueueSample.m_nVolume) { m_sQueueSample.m_nCounter = 2; m_sQueueSample.m_nSampleIndex = SFX_JUMBO_WHINE; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_bIs2D = false; m_sQueueSample.m_nReleasingVolumeModificator = 1; m_sQueueSample.m_nFrequency = freq; m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_bEmittingVolume = emittingVol; + m_sQueueSample.m_nEmittingVolume = emittingVol; m_sQueueSample.m_nLoopStart = SampleManager.GetSampleLoopStartOffset(m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_nLoopEnd = @@ -9898,14 +9711,14 @@ cAudioManager::SetupPedComments(cPedParams *params, uint32 sound) } break; } - m_sQueueSample.m_bVolume = ComputeVolume( + m_sQueueSample.m_nVolume = ComputeVolume( emittingVol, soundIntensity, m_sQueueSample.m_fDistance); pedComment.m_nProcess = 10; - if(m_sQueueSample.m_bVolume) { + if(m_sQueueSample.m_nVolume) { pedComment.m_nEntityIndex = m_sQueueSample.m_nEntityIndex; pedComment.m_vecPos = m_sQueueSample.m_vecPos; pedComment.m_fDistance = m_sQueueSample.m_fDistance; - pedComment.m_bVolume = m_sQueueSample.m_bVolume; + pedComment.m_bVolume = m_sQueueSample.m_nVolume; m_sPedComments.Add(&pedComment); } } @@ -9959,14 +9772,14 @@ cAudioManager::SetupPedComments(cPedParams *params, uint32 sound) } break; } - m_sQueueSample.m_bVolume = ComputeVolume( + m_sQueueSample.m_nVolume = ComputeVolume( emittingVol, soundIntensity, m_sQueueSample.m_fDistance); pedComment.m_nProcess = 10; - if(m_sQueueSample.m_bVolume) { + if(m_sQueueSample.m_nVolume) { pedComment.m_nEntityIndex = m_sQueueSample.m_nEntityIndex; pedComment.m_vecPos = m_sQueueSample.m_vecPos; pedComment.m_fDistance = m_sQueueSample.m_fDistance; - pedComment.m_bVolume = m_sQueueSample.m_bVolume; + pedComment.m_bVolume = m_sQueueSample.m_nVolume; m_sPedComments.Add(&pedComment); } } @@ -10131,14 +9944,14 @@ cAudioManager::UsesSirenSwitching(int32 model) const void cAudioManager::AdjustSamplesVolume() { - for(int i = 0; i < m_bSampleRequestQueuesStatus[m_bActiveSampleQueue]; i++) { + for(int i = 0; i < m_SampleRequestQueuesStatus[m_bActiveSampleQueue]; i++) { tSound *pSample = &m_asSamples[m_bActiveSampleQueue] [m_abSampleQueueIndexTable[m_bActiveSampleQueue][i] + 1]; if(!pSample->m_bIs2D) - pSample->m_bEmittingVolume = - ComputeEmittingVolume(pSample->m_bEmittingVolume, + pSample->m_nEmittingVolume = + ComputeEmittingVolume(pSample->m_nEmittingVolume, pSample->m_fSoundIntensity, pSample->m_fDistance); } } diff --git a/src/audio/AudioManager.h b/src/audio/AudioManager.h index 72d8ba41..d8b6c4d7 100644 --- a/src/audio/AudioManager.h +++ b/src/audio/AudioManager.h @@ -1,164 +1,33 @@ #pragma once -#include "common.h" -#include "config.h" - -#include "DMAudio.h" - +#include "audio_enums.h" #include "AudioCollision.h" #include "PoliceRadio.h" -enum eScriptSounds : int16 { - SCRIPT_SOUND_0 = 0, - SCRIPT_SOUND_1 = 1, - SCRIPT_SOUND_2 = 2, - SCRIPT_SOUND_3 = 3, - SCRIPT_SOUND_PARTY_1_LOOP_S = 4, - SCRIPT_SOUND_PARTY_1_LOOP_L = 5, - SCRIPT_SOUND_PARTY_2_LOOP_S = 6, - SCRIPT_SOUND_PARTY_2_LOOP_L = 7, - SCRIPT_SOUND_PARTY_3_LOOP_S = 8, - SCRIPT_SOUND_PARTY_3_LOOP_L = 9, - SCRIPT_SOUND_PARTY_4_LOOP_S = 10, - SCRIPT_SOUND_PARTY_4_LOOP_L = 11, - SCRIPT_SOUND_PARTY_5_LOOP_S = 12, - SCRIPT_SOUND_PARTY_5_LOOP_L = 13, - SCRIPT_SOUND_PARTY_6_LOOP_S = 14, - SCRIPT_SOUND_PARTY_6_LOOP_L = 15, - SCRIPT_SOUND_PARTY_7_LOOP_S = 16, - SCRIPT_SOUND_PARTY_7_LOOP_L = 17, - SCRIPT_SOUND_PARTY_8_LOOP_S = 18, - SCRIPT_SOUND_PARTY_8_LOOP_L = 19, - SCRIPT_SOUND_PARTY_9_LOOP_S = 20, - SCRIPT_SOUND_PARTY_9_LOOP_L = 21, - SCRIPT_SOUND_PARTY_10_LOOP_S = 22, - SCRIPT_SOUND_PARTY_10_LOOP_L = 23, - SCRIPT_SOUND_PARTY_11_LOOP_S = 24, - SCRIPT_SOUND_PARTY_11_LOOP_L = 25, - SCRIPT_SOUND_PARTY_12_LOOP_S = 26, - SCRIPT_SOUND_PARTY_12_LOOP_L = 27, - SCRIPT_SOUND_PARTY_13_LOOP_S = 28, - SCRIPT_SOUND_PARTY_13_LOOP_L = 29, - SCRIPT_SOUND_STRIP_CLUB_LOOP_1_S = 30, - SCRIPT_SOUND_STRIP_CLUB_LOOP_1_L = 31, - SCRIPT_SOUND_STRIP_CLUB_LOOP_2_S = 32, - SCRIPT_SOUND_STRIP_CLUB_LOOP_2_L = 33, - SCRIPT_SOUND_WORK_SHOP_LOOP_S = 34, - SCRIPT_SOUND_WORK_SHOP_LOOP_L = 35, - SCRIPT_SOUND_SAWMILL_LOOP_S = 36, - SCRIPT_SOUND_SAWMILL_LOOP_L = 37, - SCRIPT_SOUND_38 = 38, - SCRIPT_SOUND_39 = 39, - SCRIPT_SOUND_LAUNDERETTE_LOOP_S = 40, - SCRIPT_SOUND_LAUNDERETTE_LOOP_L = 41, - SCRIPT_SOUND_CHINATOWN_RESTAURANT_S = 42, - SCRIPT_SOUND_CHINATOWN_RESTAURANT_L = 43, - SCRIPT_SOUND_CIPRIANI_RESAURANT_S = 44, - SCRIPT_SOUND_CIPRIANI_RESAURANT_L = 45, - SCRIPT_SOUND_46_S = 46, - SCRIPT_SOUND_47_L = 47, - SCRIPT_SOUND_MARCO_BISTRO_S = 48, - SCRIPT_SOUND_MARCO_BISTRO_L = 49, - SCRIPT_SOUND_AIRPORT_LOOP_S = 50, - SCRIPT_SOUND_AIRPORT_LOOP_L = 51, - SCRIPT_SOUND_SHOP_LOOP_S = 52, - SCRIPT_SOUND_SHOP_LOOP_L = 53, - SCRIPT_SOUND_CINEMA_LOOP_S = 54, - SCRIPT_SOUND_CINEMA_LOOP_L = 55, - SCRIPT_SOUND_DOCKS_LOOP_S = 56, - SCRIPT_SOUND_DOCKS_LOOP_L = 57, - SCRIPT_SOUND_HOME_LOOP_S = 58, - SCRIPT_SOUND_HOME_LOOP_L = 59, - SCRIPT_SOUND_FRANKIE_PIANO = 60, - SCRIPT_SOUND_PARTY_1_LOOP = 61, - SCRIPT_SOUND_PORN_CINEMA_1_S = 62, - SCRIPT_SOUND_PORN_CINEMA_1_L = 63, - SCRIPT_SOUND_PORN_CINEMA_2_S = 64, - SCRIPT_SOUND_PORN_CINEMA_2_L = 65, - SCRIPT_SOUND_PORN_CINEMA_3_S = 66, - SCRIPT_SOUND_PORN_CINEMA_3_L = 67, - SCRIPT_SOUND_BANK_ALARM_LOOP_S = 68, - SCRIPT_SOUND_BANK_ALARM_LOOP_L = 69, - SCRIPT_SOUND_POLICE_BALL_LOOP_S = 70, - SCRIPT_SOUND_POLICE_BALL_LOOP_L = 71, - SCRIPT_SOUND_RAVE_LOOP_INDUSTRIAL_S = 72, - SCRIPT_SOUND_RAVE_LOOP_INDUSTRIAL_L = 73, - SCRIPT_SOUND_74 = 74, - SCRIPT_SOUND_75 = 75, - SCRIPT_SOUND_POLICE_CELL_BEATING_LOOP_S = 76, - SCRIPT_SOUND_POLICE_CELL_BEATING_LOOP_L = 77, - SCRIPT_SOUND_INJURED_PED_MALE_OUCH_S = 78, - SCRIPT_SOUND_INJURED_PED_MALE_OUCH_L = 79, - SCRIPT_SOUND_INJURED_PED_FEMALE_OUCH_S = 80, - SCRIPT_SOUND_INJURED_PED_FEMALE_OUCH_L = 81, - SCRIPT_SOUND_EVIDENCE_PICKUP = 82, - SCRIPT_SOUND_UNLOAD_GOLD = 83, - SCRIPT_SOUND_RAVE_1_LOOP_S = 84, - SCRIPT_SOUND_RAVE_1_LOOP_L = 85, - SCRIPT_SOUND_RAVE_2_LOOP_S = 86, - SCRIPT_SOUND_RAVE_2_LOOP_L = 87, - SCRIPT_SOUND_RAVE_3_LOOP_S = 88, - SCRIPT_SOUND_RAVE_3_LOOP_L = 89, - SCRIPT_SOUND_MISTY_SEX_S = 90, - SCRIPT_SOUND_MISTY_SEX_L = 91, - SCRIPT_SOUND_GATE_START_CLUNK = 92, - SCRIPT_SOUND_GATE_STOP_CLUNK = 93, - SCRIPT_SOUND_PART_MISSION_COMPLETE = 94, - SCRIPT_SOUND_CHUNKY_RUN_SHOUT = 95, - SCRIPT_SOUND_SECURITY_GUARD_AWAY_SHOUT = 96, - SCRIPT_SOUND_RACE_START_3 = 97, - SCRIPT_SOUND_RACE_START_2 = 98, - SCRIPT_SOUND_RACE_START_1 = 99, - SCRIPT_SOUND_RACE_START_GO = 100, - SCRIPT_SOUND_SWAT_PED_SHOUT = 101, - SCRIPT_SOUND_PRETEND_FIRE_LOOP = 102, - SCRIPT_SOUND_AMMUNATION_CHAT_1 = 103, - SCRIPT_SOUND_AMMUNATION_CHAT_2 = 104, - SCRIPT_SOUND_AMMUNATION_CHAT_3 = 105, - SCRIPT_SOUND_BULLET_HIT_GROUND_1 = 106, - SCRIPT_SOUND_BULLET_HIT_GROUND_2 = 107, - SCRIPT_SOUND_BULLET_HIT_GROUND_3 = 108, - SCRIPT_SOUND_BULLET_HIT_WATER = 109, //no sound - SCRIPT_SOUND_110 = 110, - SCRIPT_SOUND_111 = 111, - SCRIPT_SOUND_PAYPHONE_RINGING = 112, - SCRIPT_SOUND_113 = 113, - SCRIPT_SOUND_GLASS_BREAK_L = 114, - SCRIPT_SOUND_GLASS_BREAK_S = 115, - SCRIPT_SOUND_GLASS_CRACK = 116, - SCRIPT_SOUND_GLASS_LIGHT_BREAK = 117, - SCRIPT_SOUND_BOX_DESTROYED_1 = 118, - SCRIPT_SOUND_BOX_DESTROYED_2 = 119, - SCRIPT_SOUND_METAL_COLLISION = 120, - SCRIPT_SOUND_TIRE_COLLISION = 121, - SCRIPT_SOUND_GUNSHELL_DROP = 122, - SCRIPT_SOUND_GUNSHELL_DROP_SOFT = 123, -}; - class tSound { public: int32 m_nEntityIndex; int32 m_nCounter; int32 m_nSampleIndex; - uint8 m_bBankIndex; + uint8 m_nBankIndex; bool m_bIs2D; int32 m_nReleasingVolumeModificator; - int32 m_nFrequency; - uint8 m_bVolume; + uint32 m_nFrequency; + uint8 m_nVolume; float m_fDistance; int32 m_nLoopCount; int32 m_nLoopStart; int32 m_nLoopEnd; - uint8 m_bEmittingVolume; + uint8 m_nEmittingVolume; float m_fSpeedMultiplier; float m_fSoundIntensity; bool m_bReleasingSoundFlag; CVector m_vecPos; bool m_bReverbFlag; - uint8 m_bLoopsRemaining; + uint8 m_nLoopsRemaining; bool m_bRequireReflection; // Used for oneshots - uint8 m_bOffset; + uint8 m_nOffset; int32 m_nReleasingVolumeDivider; bool m_bIsProcessed; bool m_bLoopEnded; @@ -177,7 +46,7 @@ public: eAudioType m_nType; void *m_pEntity; bool m_bIsUsed; - uint8 m_bStatus; + uint8 m_nStatus; int16 m_awAudioEvent[NUM_AUDIOENTITY_EVENTS]; float m_afVolume[NUM_AUDIOENTITY_EVENTS]; uint8 m_AudioEvents; @@ -220,9 +89,9 @@ class cMissionAudio public: CVector m_vecPos; bool m_bPredefinedProperties; - int m_nSampleIndex; - uint8 m_bLoadingStatus; - uint8 m_bPlayStatus; + int32 m_nSampleIndex; + uint8 m_nLoadingStatus; + uint8 m_nPlayStatus; uint8 field_22; // todo find a name int32 m_nMissionAudioCounter; bool m_bIsPlayed; @@ -242,12 +111,31 @@ public: }; -class cVehicleParams; +class cTransmission; class CPlane; class CVehicle; class CPed; -class cPedParams; -class cTransmission; + +class cPedParams +{ +public: + bool m_bDistanceCalculated; + float m_fDistance; + CPed *m_pPed; +}; + +class cVehicleParams +{ +public: + bool m_bDistanceCalculated; + float m_fDistance; + CVehicle *m_pVehicle; + cTransmission *m_pTransmission; + int32 m_nIndex; + float m_fVelocityChange; +}; + +static_assert(sizeof(cVehicleParams) == 0x18, "cVehicleParams: error"); enum { /* @@ -272,7 +160,7 @@ public: bool m_bIsInitialised; uint8 field_1; // unused bool m_bFifthFrameFlag; - uint8 m_bActiveSamples; + uint8 m_nActiveSamples; uint8 field_4; // unused bool m_bDynamicAcousticModelingStatus; float m_fSpeedOfSound; @@ -282,7 +170,7 @@ public: bool m_bActiveSampleQueue; tSound m_asSamples[NUM_SOUNDS_SAMPLES_BANKS][NUM_SOUNDS_SAMPLES_SLOTS]; uint8 m_abSampleQueueIndexTable[NUM_SOUNDS_SAMPLES_BANKS][NUM_SOUNDS_SAMPLES_SLOTS]; - uint8 m_bSampleRequestQueuesStatus[NUM_SOUNDS_SAMPLES_BANKS]; + uint8 m_SampleRequestQueuesStatus[NUM_SOUNDS_SAMPLES_BANKS]; tSound m_asActiveSamples[NUM_SOUNDS_SAMPLES_SLOTS]; tAudioEntity m_asAudioEntities[NUM_AUDIOENTITIES]; int32 m_anAudioEntityIndices[NUM_AUDIOENTITIES]; @@ -302,9 +190,9 @@ public: int32 m_nBridgeEntity; cMissionAudio m_sMissionAudio; int32 m_anRandomTable[5]; - uint8 m_bTimeSpent; - uint8 m_bUserPause; - uint8 m_bPreviousUserPause; + uint8 m_nTimeSpent; + uint8 m_nUserPause; + uint8 m_nPreviousUserPause; uint32 m_FrameCounter; cAudioManager(); @@ -314,7 +202,7 @@ public: uint32 GetFrameCounter() const { return m_FrameCounter; } float GetReflectionsDistance(int32 idx) const { return m_afReflectionsDistances[idx]; } int32 GetRandomNumber(int32 idx) const { return m_anRandomTable[idx]; } - bool IsMissionAudioPlaying() const { return m_sMissionAudio.m_bPlayStatus == 1; } + bool IsMissionAudioPlaying() const { return m_sMissionAudio.m_nPlayStatus == 1; } // "Should" be in alphabetic order, except "getXTalkSfx" void AddDetailsToRequestedOrderList(uint8 sample); diff --git a/src/audio/DMAudio.h b/src/audio/DMAudio.h index 42688fa6..428f08b4 100644 --- a/src/audio/DMAudio.h +++ b/src/audio/DMAudio.h @@ -1,180 +1,9 @@ #pragma once #include "audio_enums.h" +#include "soundlist.h" #include "Crime.h" -enum eSound : int16 -{ - SOUND_CAR_DOOR_CLOSE_BONNET = 0, - SOUND_CAR_DOOR_CLOSE_BUMPER = 1, - SOUND_CAR_DOOR_CLOSE_FRONT_LEFT = 2, - SOUND_CAR_DOOR_CLOSE_FRONT_RIGHT = 3, - SOUND_CAR_DOOR_CLOSE_BACK_LEFT = 4, - SOUND_CAR_DOOR_CLOSE_BACK_RIGHT = 5, - SOUND_CAR_DOOR_OPEN_BONNET = 6, - SOUND_CAR_DOOR_OPEN_BUMPER = 7, - SOUND_CAR_DOOR_OPEN_FRONT_LEFT = 8, - SOUND_CAR_DOOR_OPEN_FRONT_RIGHT = 9, - SOUND_CAR_DOOR_OPEN_BACK_LEFT = 10, - SOUND_CAR_DOOR_OPEN_BACK_RIGHT = 11, - SOUND_CAR_WINDSHIELD_CRACK = 12, - SOUND_CAR_JUMP = 13, - SOUND_E = 14, - SOUND_F = 15, - SOUND_CAR_ENGINE_START = 16, - SOUND_CAR_LIGHT_BREAK = 17, - SOUND_CAR_HYDRAULIC_1 = 18, - SOUND_CAR_HYDRAULIC_2 = 19, - SOUND_CAR_HYDRAULIC_3 = 20, - SOUND_CAR_JERK = 21, - SOUND_CAR_SPLASH = 22, - SOUND_17 = 23, - SOUND_18 = 24, - SOUND_19 = 25, - SOUND_CAR_TANK_TURRET_ROTATE = 26, - SOUND_CAR_BOMB_TICK = 27, - SOUND_PLANE_ON_GROUND = 28, - SOUND_STEP_START = 29, - SOUND_STEP_END = 30, - SOUND_FALL_LAND = 31, - SOUND_FALL_COLLAPSE = 32, - SOUND_FIGHT_PUNCH_33 = 33, - SOUND_FIGHT_KICK_34 = 34, - SOUND_FIGHT_HEADBUTT_35 = 35, - SOUND_FIGHT_PUNCH_36 = 36, - SOUND_FIGHT_PUNCH_37 = 37, - SOUND_FIGHT_CLOSE_PUNCH_38 = 38, - SOUND_FIGHT_PUNCH_39 = 39, - SOUND_FIGHT_PUNCH_OR_KICK_BELOW_40 = 40, - SOUND_FIGHT_PUNCH_41 = 41, - SOUND_FIGHT_PUNCH_FROM_BEHIND_42 = 42, - SOUND_FIGHT_KNEE_OR_KICK_43 = 43, - SOUND_FIGHT_KICK_44 = 44, - SOUND_2D = 45, - SOUND_WEAPON_BAT_ATTACK = 46, - SOUND_WEAPON_SHOT_FIRED = 47, - SOUND_WEAPON_RELOAD = 48, - SOUND_WEAPON_AK47_BULLET_ECHO = 49, - SOUND_WEAPON_UZI_BULLET_ECHO = 50, - SOUND_WEAPON_M16_BULLET_ECHO = 51, - SOUND_WEAPON_FLAMETHROWER_FIRE = 52, - SOUND_WEAPON_SNIPER_SHOT_NO_ZOOM = 53, - SOUND_WEAPON_ROCKET_SHOT_NO_ZOOM = 54, - SOUND_WEAPON_HIT_PED = 55, - SOUND_WEAPON_HIT_VEHICLE = 56, - SOUND_GARAGE_NO_MONEY = 57, - SOUND_GARAGE_BAD_VEHICLE = 58, - SOUND_GARAGE_OPENING = 59, - SOUND_GARAGE_BOMB_ALREADY_SET = 60, - SOUND_GARAGE_BOMB1_SET = 61, - SOUND_GARAGE_BOMB2_SET = 62, - SOUND_GARAGE_BOMB3_SET = 63, - SOUND_40 = 64, - SOUND_41 = 65, - SOUND_GARAGE_VEHICLE_DECLINED = 66, - SOUND_GARAGE_VEHICLE_ACCEPTED = 67, - SOUND_GARAGE_DOOR_CLOSED = 68, - SOUND_GARAGE_DOOR_OPENED = 69, - SOUND_CRANE_PICKUP = 70, - SOUND_PICKUP_WEAPON_BOUGHT = 71, - SOUND_PICKUP_WEAPON = 72, - SOUND_PICKUP_HEALTH = 73, - SOUND_4A = 74, - SOUND_4B = 75, - SOUND_PICKUP_ADRENALINE = 76, - SOUND_PICKUP_ARMOUR = 77, - SOUND_PICKUP_BONUS = 78, - SOUND_PICKUP_MONEY = 79, - SOUND_PICKUP_HIDDEN_PACKAGE = 80, - SOUND_PICKUP_PACMAN_PILL = 81, - SOUND_PICKUP_PACMAN_PACKAGE = 82, - SOUND_PICKUP_FLOAT_PACKAGE = 83, - SOUND_BOMB_TIMED_ACTIVATED = 84, - SOUND_55 = 85, - SOUND_BOMB_ONIGNITION_ACTIVATED = 86, - SOUND_BOMB_TICK = 87, - SOUND_RAMPAGE_START = 88, - SOUND_RAMPAGE_ONGOING = 89, - SOUND_RAMPAGE_PASSED = 90, - SOUND_RAMPAGE_FAILED = 91, - SOUND_RAMPAGE_KILL = 92, - SOUND_RAMPAGE_CAR_BLOWN = 93, - SOUND_EVIDENCE_PICKUP = 94, - SOUND_UNLOAD_GOLD = 95, - SOUND_PAGER = 96, - SOUND_PED_DEATH = 97, // 103 in VC - SOUND_PED_DAMAGE = 98, // 104 in VC - SOUND_PED_HIT = 99, // 105 in VC - SOUND_PED_LAND = 100, // hopefully 106 in VC - SOUND_PED_BULLET_HIT = 101, - SOUND_PED_BOMBER = 102, - SOUND_PED_BURNING = 103, // 108 in VC - SOUND_PED_ARREST_FBI = 104, - SOUND_PED_ARREST_SWAT = 105, - SOUND_PED_ARREST_COP = 106, - SOUND_PED_HELI_PLAYER_FOUND = 107, - SOUND_PED_HANDS_UP = 108, - SOUND_PED_HANDS_COWER = 109, - SOUND_PED_FLEE_SPRINT = 110, // 120 in VC - SOUND_PED_CAR_JACKING = 111, - SOUND_PED_MUGGING = 112, - SOUND_PED_CAR_JACKED = 113, - SOUND_PED_ROBBED = 114, - SOUND_PED_TAXI_WAIT = 115, // 137 in VC - SOUND_PED_ATTACK = 116, - SOUND_PED_DEFEND = 117, - SOUND_PED_PURSUIT_ARMY = 118, - SOUND_PED_PURSUIT_FBI = 119, - SOUND_PED_PURSUIT_SWAT = 120, - SOUND_PED_PURSUIT_COP = 121, - SOUND_PED_HEALING = 122, - SOUND_PED_7B = 123, - SOUND_PED_LEAVE_VEHICLE = 124, - SOUND_PED_EVADE = 125, // 142 in VC - SOUND_PED_FLEE_RUN = 126, - SOUND_PED_CAR_COLLISION = 127, // 144-145-146 in VC - SOUND_PED_SOLICIT = 128, - SOUND_PED_EXTINGUISHING_FIRE = 129, - SOUND_PED_WAIT_DOUBLEBACK = 130, - SOUND_PED_CHAT_SEXY = 131, - SOUND_PED_CHAT_EVENT = 132, - SOUND_PED_CHAT = 133, - SOUND_PED_BODYCAST_HIT = 134, - SOUND_PED_TAXI_CALL = 135, - SOUND_INJURED_PED_MALE_OUCH = 136, - SOUND_INJURED_PED_FEMALE = 137, - SOUND_8A = 138, - SOUND_RACE_START_3 = 139, - SOUND_RACE_START_2 = 140, - SOUND_RACE_START_1 = 141, - SOUND_RACE_START_GO = 142, - SOUND_SPLASH = 143, - SOUND_WATER_FALL = 144, - SOUND_SPLATTER = 145, - SOUND_CAR_PED_COLLISION = 146, - SOUND_CLOCK_TICK = 147, - SOUND_PART_MISSION_COMPLETE = 148, - SOUND_FRONTEND_MENU_STARTING = 149, - SOUND_FRONTEND_MENU_COMPLETED = 150, - SOUND_FRONTEND_MENU_DENIED = 151, - SOUND_FRONTEND_MENU_SUCCESS = 152, - SOUND_FRONTEND_EXIT = 153, - SOUND_9A = 154, - SOUND_9B = 155, - SOUND_FRONTEND_AUDIO_TEST = 156, - SOUND_FRONTEND_FAIL = 157, - SOUND_FRONTEND_NO_RADIO = 158, - SOUND_FRONTEND_RADIO_CHANGE = 159, - SOUND_A0 = 160, - SOUND_AMMUNATION_WELCOME_1 = 161, - SOUND_AMMUNATION_WELCOME_2 = 162, - SOUND_AMMUNATION_WELCOME_3 = 163, - SOUND_LIGHTNING = 164, - SOUND_A5 = 165, - SOUND_TOTAL_SOUNDS = 166, - SOUND_TOTAL_PED_SOUNDS = 167, -}; - #define AEHANDLE_IS_FAILED(h) ((h)<0) #define AEHANDLE_IS_OK(h) ((h)>=0) diff --git a/src/audio/MusicManager.cpp b/src/audio/MusicManager.cpp index efea6e45..9cab45b4 100644 --- a/src/audio/MusicManager.cpp +++ b/src/audio/MusicManager.cpp @@ -1,5 +1,6 @@ #include "common.h" #include <time.h> +#include "soundlist.h" #include "MusicManager.h" #include "AudioManager.h" #include "ControllerConfig.h" @@ -302,14 +303,14 @@ cMusicManager::GetRadioInCar(void) CVehicle *veh = FindPlayerVehicle(); if (veh != nil){ if (UsesPoliceRadio(veh)) { - if (m_nRadioInCar == NO_STREAMED_SOUND || CReplay::IsPlayingBack() && AudioManager.m_bUserPause) + if (m_nRadioInCar == NO_STREAMED_SOUND || CReplay::IsPlayingBack() && AudioManager.m_nUserPause) return POLICE_RADIO; return m_nRadioInCar; } else return veh->m_nRadioStation; } } - if (m_nRadioInCar == NO_STREAMED_SOUND || CReplay::IsPlayingBack() && AudioManager.m_bUserPause) + if (m_nRadioInCar == NO_STREAMED_SOUND || CReplay::IsPlayingBack() && AudioManager.m_nUserPause) return RADIO_OFF; return m_nRadioInCar; } @@ -402,7 +403,7 @@ cMusicManager::ServiceFrontEndMode() switch (m_nCurrentStreamedSound) { case STREAMED_SOUND_MISSION_COMPLETED: - if (!AudioManager.m_bUserPause) + if (!AudioManager.m_nUserPause) ChangeMusicMode(MUSICMODE_GAME); break; case STREAMED_SOUND_GAME_COMPLETED: @@ -458,7 +459,7 @@ cMusicManager::ServiceGameMode() nFramesSinceCutsceneEnded = -1; } - if (AudioManager.m_bPreviousUserPause) + if (AudioManager.m_nPreviousUserPause) m_bPreviousPlayerInCar = false; if (!m_bPlayerInCar) { if (m_bPreviousPlayerInCar) { diff --git a/src/audio/PoliceRadio.cpp b/src/audio/PoliceRadio.cpp index c4946da6..31b6c7b6 100644 --- a/src/audio/PoliceRadio.cpp +++ b/src/audio/PoliceRadio.cpp @@ -130,18 +130,18 @@ cAudioManager::DoPoliceRadioCrackle() m_sQueueSample.m_nEntityIndex = m_nPoliceChannelEntity; m_sQueueSample.m_nCounter = 0; m_sQueueSample.m_nSampleIndex = SFX_POLICE_RADIO_CRACKLE; - m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; + m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_bIs2D = true; m_sQueueSample.m_nReleasingVolumeModificator = 10; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_POLICE_RADIO_CRACKLE); - m_sQueueSample.m_bVolume = m_anRandomTable[2] % 20 + 15; + m_sQueueSample.m_nVolume = m_anRandomTable[2] % 20 + 15; m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_bEmittingVolume = m_sQueueSample.m_bVolume; + m_sQueueSample.m_nEmittingVolume = m_sQueueSample.m_nVolume; m_sQueueSample.m_nLoopStart = SampleManager.GetSampleLoopStartOffset(SFX_POLICE_RADIO_CRACKLE); m_sQueueSample.m_nLoopEnd = SampleManager.GetSampleLoopEndOffset(SFX_POLICE_RADIO_CRACKLE); m_sQueueSample.m_bReleasingSoundFlag = false; m_sQueueSample.m_bReverbFlag = false; - m_sQueueSample.m_bOffset = 63; + m_sQueueSample.m_nOffset = 63; m_sQueueSample.m_nReleasingVolumeDivider = 3; m_sQueueSample.m_bRequireReflection = false; AddSampleToRequestedQueue(); @@ -155,7 +155,7 @@ cAudioManager::ServicePoliceRadio() if(!m_bIsInitialised) return; - if(!m_bUserPause) { + if(!m_nUserPause) { bool crimeReport = SetupCrimeReport(); #ifdef FIX_BUGS // Crash at 0x5fe6ef if(CReplay::IsPlayingBack() || !FindPlayerPed() || !FindPlayerPed()->m_pWanted) @@ -190,14 +190,14 @@ cAudioManager::ServicePoliceRadioChannel(int32 wantedLevel) if (!m_bIsInitialised) return; - if (m_bUserPause) { + if (m_nUserPause) { if (SampleManager.GetChannelUsedFlag(policeChannel)) SampleManager.StopChannel(policeChannel); if (g_nMissionAudioSfx != TOTAL_AUDIO_SAMPLES && bMissionAudioPhysicalPlayingStatus == 1 && SampleManager.IsStreamPlaying(1)) { SampleManager.PauseStream(1, 1); } } else { - if (m_bPreviousUserPause && g_nMissionAudioSfx != TOTAL_AUDIO_SAMPLES && + if (m_nPreviousUserPause && g_nMissionAudioSfx != TOTAL_AUDIO_SAMPLES && bMissionAudioPhysicalPlayingStatus == 1) { SampleManager.PauseStream(0, 1); } diff --git a/src/audio/soundlist.h b/src/audio/soundlist.h new file mode 100644 index 00000000..364f4655 --- /dev/null +++ b/src/audio/soundlist.h @@ -0,0 +1,301 @@ +#pragma once + +enum eSound : int16 +{ + SOUND_CAR_DOOR_CLOSE_BONNET = 0, + SOUND_CAR_DOOR_CLOSE_BUMPER = 1, + SOUND_CAR_DOOR_CLOSE_FRONT_LEFT = 2, + SOUND_CAR_DOOR_CLOSE_FRONT_RIGHT = 3, + SOUND_CAR_DOOR_CLOSE_BACK_LEFT = 4, + SOUND_CAR_DOOR_CLOSE_BACK_RIGHT = 5, + SOUND_CAR_DOOR_OPEN_BONNET = 6, + SOUND_CAR_DOOR_OPEN_BUMPER = 7, + SOUND_CAR_DOOR_OPEN_FRONT_LEFT = 8, + SOUND_CAR_DOOR_OPEN_FRONT_RIGHT = 9, + SOUND_CAR_DOOR_OPEN_BACK_LEFT = 10, + SOUND_CAR_DOOR_OPEN_BACK_RIGHT = 11, + SOUND_CAR_WINDSHIELD_CRACK = 12, + SOUND_CAR_JUMP = 13, + SOUND_E = 14, + SOUND_F = 15, + SOUND_CAR_ENGINE_START = 16, + SOUND_CAR_LIGHT_BREAK = 17, + SOUND_CAR_HYDRAULIC_1 = 18, + SOUND_CAR_HYDRAULIC_2 = 19, + SOUND_CAR_HYDRAULIC_3 = 20, + SOUND_CAR_JERK = 21, + SOUND_CAR_SPLASH = 22, + SOUND_17 = 23, + SOUND_18 = 24, + SOUND_19 = 25, + SOUND_CAR_TANK_TURRET_ROTATE = 26, + SOUND_CAR_BOMB_TICK = 27, + SOUND_PLANE_ON_GROUND = 28, + SOUND_STEP_START = 29, + SOUND_STEP_END = 30, + SOUND_FALL_LAND = 31, + SOUND_FALL_COLLAPSE = 32, + SOUND_FIGHT_PUNCH_33 = 33, + SOUND_FIGHT_KICK_34 = 34, + SOUND_FIGHT_HEADBUTT_35 = 35, + SOUND_FIGHT_PUNCH_36 = 36, + SOUND_FIGHT_PUNCH_37 = 37, + SOUND_FIGHT_CLOSE_PUNCH_38 = 38, + SOUND_FIGHT_PUNCH_39 = 39, + SOUND_FIGHT_PUNCH_OR_KICK_BELOW_40 = 40, + SOUND_FIGHT_PUNCH_41 = 41, + SOUND_FIGHT_PUNCH_FROM_BEHIND_42 = 42, + SOUND_FIGHT_KNEE_OR_KICK_43 = 43, + SOUND_FIGHT_KICK_44 = 44, + SOUND_2D = 45, + SOUND_WEAPON_BAT_ATTACK = 46, + SOUND_WEAPON_SHOT_FIRED = 47, + SOUND_WEAPON_RELOAD = 48, + SOUND_WEAPON_AK47_BULLET_ECHO = 49, + SOUND_WEAPON_UZI_BULLET_ECHO = 50, + SOUND_WEAPON_M16_BULLET_ECHO = 51, + SOUND_WEAPON_FLAMETHROWER_FIRE = 52, + SOUND_WEAPON_SNIPER_SHOT_NO_ZOOM = 53, + SOUND_WEAPON_ROCKET_SHOT_NO_ZOOM = 54, + SOUND_WEAPON_HIT_PED = 55, + SOUND_WEAPON_HIT_VEHICLE = 56, + SOUND_GARAGE_NO_MONEY = 57, + SOUND_GARAGE_BAD_VEHICLE = 58, + SOUND_GARAGE_OPENING = 59, + SOUND_GARAGE_BOMB_ALREADY_SET = 60, + SOUND_GARAGE_BOMB1_SET = 61, + SOUND_GARAGE_BOMB2_SET = 62, + SOUND_GARAGE_BOMB3_SET = 63, + SOUND_40 = 64, + SOUND_41 = 65, + SOUND_GARAGE_VEHICLE_DECLINED = 66, + SOUND_GARAGE_VEHICLE_ACCEPTED = 67, + SOUND_GARAGE_DOOR_CLOSED = 68, + SOUND_GARAGE_DOOR_OPENED = 69, + SOUND_CRANE_PICKUP = 70, + SOUND_PICKUP_WEAPON_BOUGHT = 71, + SOUND_PICKUP_WEAPON = 72, + SOUND_PICKUP_HEALTH = 73, + SOUND_4A = 74, + SOUND_4B = 75, + SOUND_PICKUP_ADRENALINE = 76, + SOUND_PICKUP_ARMOUR = 77, + SOUND_PICKUP_BONUS = 78, + SOUND_PICKUP_MONEY = 79, + SOUND_PICKUP_HIDDEN_PACKAGE = 80, + SOUND_PICKUP_PACMAN_PILL = 81, + SOUND_PICKUP_PACMAN_PACKAGE = 82, + SOUND_PICKUP_FLOAT_PACKAGE = 83, + SOUND_BOMB_TIMED_ACTIVATED = 84, + SOUND_55 = 85, + SOUND_BOMB_ONIGNITION_ACTIVATED = 86, + SOUND_BOMB_TICK = 87, + SOUND_RAMPAGE_START = 88, + SOUND_RAMPAGE_ONGOING = 89, + SOUND_RAMPAGE_PASSED = 90, + SOUND_RAMPAGE_FAILED = 91, + SOUND_RAMPAGE_KILL = 92, + SOUND_RAMPAGE_CAR_BLOWN = 93, + SOUND_EVIDENCE_PICKUP = 94, + SOUND_UNLOAD_GOLD = 95, + SOUND_PAGER = 96, + SOUND_PED_DEATH = 97, // 103 in VC + SOUND_PED_DAMAGE = 98, // 104 in VC + SOUND_PED_HIT = 99, // 105 in VC + SOUND_PED_LAND = 100, // hopefully 106 in VC + SOUND_PED_BULLET_HIT = 101, + SOUND_PED_BOMBER = 102, + SOUND_PED_BURNING = 103, // 108 in VC + SOUND_PED_ARREST_FBI = 104, + SOUND_PED_ARREST_SWAT = 105, + SOUND_PED_ARREST_COP = 106, + SOUND_PED_HELI_PLAYER_FOUND = 107, + SOUND_PED_HANDS_UP = 108, + SOUND_PED_HANDS_COWER = 109, + SOUND_PED_FLEE_SPRINT = 110, // 120 in VC + SOUND_PED_CAR_JACKING = 111, + SOUND_PED_MUGGING = 112, + SOUND_PED_CAR_JACKED = 113, + SOUND_PED_ROBBED = 114, + SOUND_PED_TAXI_WAIT = 115, // 137 in VC + SOUND_PED_ATTACK = 116, + SOUND_PED_DEFEND = 117, + SOUND_PED_PURSUIT_ARMY = 118, + SOUND_PED_PURSUIT_FBI = 119, + SOUND_PED_PURSUIT_SWAT = 120, + SOUND_PED_PURSUIT_COP = 121, + SOUND_PED_HEALING = 122, + SOUND_PED_7B = 123, + SOUND_PED_LEAVE_VEHICLE = 124, + SOUND_PED_EVADE = 125, // 142 in VC + SOUND_PED_FLEE_RUN = 126, + SOUND_PED_CAR_COLLISION = 127, // 144-145-146 in VC + SOUND_PED_SOLICIT = 128, + SOUND_PED_EXTINGUISHING_FIRE = 129, + SOUND_PED_WAIT_DOUBLEBACK = 130, + SOUND_PED_CHAT_SEXY = 131, + SOUND_PED_CHAT_EVENT = 132, + SOUND_PED_CHAT = 133, + SOUND_PED_BODYCAST_HIT = 134, + SOUND_PED_TAXI_CALL = 135, + SOUND_INJURED_PED_MALE_OUCH = 136, + SOUND_INJURED_PED_FEMALE = 137, + SOUND_8A = 138, + SOUND_RACE_START_3 = 139, + SOUND_RACE_START_2 = 140, + SOUND_RACE_START_1 = 141, + SOUND_RACE_START_GO = 142, + SOUND_SPLASH = 143, + SOUND_WATER_FALL = 144, + SOUND_SPLATTER = 145, + SOUND_CAR_PED_COLLISION = 146, + SOUND_CLOCK_TICK = 147, + SOUND_PART_MISSION_COMPLETE = 148, + SOUND_FRONTEND_MENU_STARTING = 149, + SOUND_FRONTEND_MENU_COMPLETED = 150, + SOUND_FRONTEND_MENU_DENIED = 151, + SOUND_FRONTEND_MENU_SUCCESS = 152, + SOUND_FRONTEND_EXIT = 153, + SOUND_9A = 154, + SOUND_9B = 155, + SOUND_FRONTEND_AUDIO_TEST = 156, + SOUND_FRONTEND_FAIL = 157, + SOUND_FRONTEND_NO_RADIO = 158, + SOUND_FRONTEND_RADIO_CHANGE = 159, + SOUND_A0 = 160, + SOUND_AMMUNATION_WELCOME_1 = 161, + SOUND_AMMUNATION_WELCOME_2 = 162, + SOUND_AMMUNATION_WELCOME_3 = 163, + SOUND_LIGHTNING = 164, + SOUND_A5 = 165, + SOUND_TOTAL_SOUNDS = 166, + SOUND_TOTAL_PED_SOUNDS = 167, +}; + + +enum eScriptSounds : int16 { + SCRIPT_SOUND_0 = 0, + SCRIPT_SOUND_1 = 1, + SCRIPT_SOUND_2 = 2, + SCRIPT_SOUND_3 = 3, + SCRIPT_SOUND_PARTY_1_LOOP_S = 4, + SCRIPT_SOUND_PARTY_1_LOOP_L = 5, + SCRIPT_SOUND_PARTY_2_LOOP_S = 6, + SCRIPT_SOUND_PARTY_2_LOOP_L = 7, + SCRIPT_SOUND_PARTY_3_LOOP_S = 8, + SCRIPT_SOUND_PARTY_3_LOOP_L = 9, + SCRIPT_SOUND_PARTY_4_LOOP_S = 10, + SCRIPT_SOUND_PARTY_4_LOOP_L = 11, + SCRIPT_SOUND_PARTY_5_LOOP_S = 12, + SCRIPT_SOUND_PARTY_5_LOOP_L = 13, + SCRIPT_SOUND_PARTY_6_LOOP_S = 14, + SCRIPT_SOUND_PARTY_6_LOOP_L = 15, + SCRIPT_SOUND_PARTY_7_LOOP_S = 16, + SCRIPT_SOUND_PARTY_7_LOOP_L = 17, + SCRIPT_SOUND_PARTY_8_LOOP_S = 18, + SCRIPT_SOUND_PARTY_8_LOOP_L = 19, + SCRIPT_SOUND_PARTY_9_LOOP_S = 20, + SCRIPT_SOUND_PARTY_9_LOOP_L = 21, + SCRIPT_SOUND_PARTY_10_LOOP_S = 22, + SCRIPT_SOUND_PARTY_10_LOOP_L = 23, + SCRIPT_SOUND_PARTY_11_LOOP_S = 24, + SCRIPT_SOUND_PARTY_11_LOOP_L = 25, + SCRIPT_SOUND_PARTY_12_LOOP_S = 26, + SCRIPT_SOUND_PARTY_12_LOOP_L = 27, + SCRIPT_SOUND_PARTY_13_LOOP_S = 28, + SCRIPT_SOUND_PARTY_13_LOOP_L = 29, + SCRIPT_SOUND_STRIP_CLUB_LOOP_1_S = 30, + SCRIPT_SOUND_STRIP_CLUB_LOOP_1_L = 31, + SCRIPT_SOUND_STRIP_CLUB_LOOP_2_S = 32, + SCRIPT_SOUND_STRIP_CLUB_LOOP_2_L = 33, + SCRIPT_SOUND_WORK_SHOP_LOOP_S = 34, + SCRIPT_SOUND_WORK_SHOP_LOOP_L = 35, + SCRIPT_SOUND_SAWMILL_LOOP_S = 36, + SCRIPT_SOUND_SAWMILL_LOOP_L = 37, + SCRIPT_SOUND_38 = 38, + SCRIPT_SOUND_39 = 39, + SCRIPT_SOUND_LAUNDERETTE_LOOP_S = 40, + SCRIPT_SOUND_LAUNDERETTE_LOOP_L = 41, + SCRIPT_SOUND_CHINATOWN_RESTAURANT_S = 42, + SCRIPT_SOUND_CHINATOWN_RESTAURANT_L = 43, + SCRIPT_SOUND_CIPRIANI_RESAURANT_S = 44, + SCRIPT_SOUND_CIPRIANI_RESAURANT_L = 45, + SCRIPT_SOUND_46_S = 46, + SCRIPT_SOUND_47_L = 47, + SCRIPT_SOUND_MARCO_BISTRO_S = 48, + SCRIPT_SOUND_MARCO_BISTRO_L = 49, + SCRIPT_SOUND_AIRPORT_LOOP_S = 50, + SCRIPT_SOUND_AIRPORT_LOOP_L = 51, + SCRIPT_SOUND_SHOP_LOOP_S = 52, + SCRIPT_SOUND_SHOP_LOOP_L = 53, + SCRIPT_SOUND_CINEMA_LOOP_S = 54, + SCRIPT_SOUND_CINEMA_LOOP_L = 55, + SCRIPT_SOUND_DOCKS_LOOP_S = 56, + SCRIPT_SOUND_DOCKS_LOOP_L = 57, + SCRIPT_SOUND_HOME_LOOP_S = 58, + SCRIPT_SOUND_HOME_LOOP_L = 59, + SCRIPT_SOUND_FRANKIE_PIANO = 60, + SCRIPT_SOUND_PARTY_1_LOOP = 61, + SCRIPT_SOUND_PORN_CINEMA_1_S = 62, + SCRIPT_SOUND_PORN_CINEMA_1_L = 63, + SCRIPT_SOUND_PORN_CINEMA_2_S = 64, + SCRIPT_SOUND_PORN_CINEMA_2_L = 65, + SCRIPT_SOUND_PORN_CINEMA_3_S = 66, + SCRIPT_SOUND_PORN_CINEMA_3_L = 67, + SCRIPT_SOUND_BANK_ALARM_LOOP_S = 68, + SCRIPT_SOUND_BANK_ALARM_LOOP_L = 69, + SCRIPT_SOUND_POLICE_BALL_LOOP_S = 70, + SCRIPT_SOUND_POLICE_BALL_LOOP_L = 71, + SCRIPT_SOUND_RAVE_LOOP_INDUSTRIAL_S = 72, + SCRIPT_SOUND_RAVE_LOOP_INDUSTRIAL_L = 73, + SCRIPT_SOUND_74 = 74, + SCRIPT_SOUND_75 = 75, + SCRIPT_SOUND_POLICE_CELL_BEATING_LOOP_S = 76, + SCRIPT_SOUND_POLICE_CELL_BEATING_LOOP_L = 77, + SCRIPT_SOUND_INJURED_PED_MALE_OUCH_S = 78, + SCRIPT_SOUND_INJURED_PED_MALE_OUCH_L = 79, + SCRIPT_SOUND_INJURED_PED_FEMALE_OUCH_S = 80, + SCRIPT_SOUND_INJURED_PED_FEMALE_OUCH_L = 81, + SCRIPT_SOUND_EVIDENCE_PICKUP = 82, + SCRIPT_SOUND_UNLOAD_GOLD = 83, + SCRIPT_SOUND_RAVE_1_LOOP_S = 84, + SCRIPT_SOUND_RAVE_1_LOOP_L = 85, + SCRIPT_SOUND_RAVE_2_LOOP_S = 86, + SCRIPT_SOUND_RAVE_2_LOOP_L = 87, + SCRIPT_SOUND_RAVE_3_LOOP_S = 88, + SCRIPT_SOUND_RAVE_3_LOOP_L = 89, + SCRIPT_SOUND_MISTY_SEX_S = 90, + SCRIPT_SOUND_MISTY_SEX_L = 91, + SCRIPT_SOUND_GATE_START_CLUNK = 92, + SCRIPT_SOUND_GATE_STOP_CLUNK = 93, + SCRIPT_SOUND_PART_MISSION_COMPLETE = 94, + SCRIPT_SOUND_CHUNKY_RUN_SHOUT = 95, + SCRIPT_SOUND_SECURITY_GUARD_AWAY_SHOUT = 96, + SCRIPT_SOUND_RACE_START_3 = 97, + SCRIPT_SOUND_RACE_START_2 = 98, + SCRIPT_SOUND_RACE_START_1 = 99, + SCRIPT_SOUND_RACE_START_GO = 100, + SCRIPT_SOUND_SWAT_PED_SHOUT = 101, + SCRIPT_SOUND_PRETEND_FIRE_LOOP = 102, + SCRIPT_SOUND_AMMUNATION_CHAT_1 = 103, + SCRIPT_SOUND_AMMUNATION_CHAT_2 = 104, + SCRIPT_SOUND_AMMUNATION_CHAT_3 = 105, + SCRIPT_SOUND_BULLET_HIT_GROUND_1 = 106, + SCRIPT_SOUND_BULLET_HIT_GROUND_2 = 107, + SCRIPT_SOUND_BULLET_HIT_GROUND_3 = 108, + SCRIPT_SOUND_BULLET_HIT_WATER = 109, //no sound + SCRIPT_SOUND_110 = 110, + SCRIPT_SOUND_111 = 111, + SCRIPT_SOUND_PAYPHONE_RINGING = 112, + SCRIPT_SOUND_113 = 113, + SCRIPT_SOUND_GLASS_BREAK_L = 114, + SCRIPT_SOUND_GLASS_BREAK_S = 115, + SCRIPT_SOUND_GLASS_CRACK = 116, + SCRIPT_SOUND_GLASS_LIGHT_BREAK = 117, + SCRIPT_SOUND_BOX_DESTROYED_1 = 118, + SCRIPT_SOUND_BOX_DESTROYED_2 = 119, + SCRIPT_SOUND_METAL_COLLISION = 120, + SCRIPT_SOUND_TIRE_COLLISION = 121, + SCRIPT_SOUND_GUNSHELL_DROP = 122, + SCRIPT_SOUND_GUNSHELL_DROP_SOFT = 123, +}; diff --git a/src/control/CarCtrl.cpp b/src/control/CarCtrl.cpp index ae38b68f..f347b2c9 100644 --- a/src/control/CarCtrl.cpp +++ b/src/control/CarCtrl.cpp @@ -1868,6 +1868,9 @@ void CCarCtrl::Init(void) NumFiretrucksOnDuty = 0; LastTimeFireTruckCreated = 0; LastTimeAmbulanceCreated = 0; +#ifdef FIX_BUGS + LastTimeLawEnforcerCreated = 0; +#endif bCarsGeneratedAroundCamera = false; CountDownToCarsAtStart = 2; CarDensityMultiplier = 1.0f; @@ -1890,6 +1893,11 @@ void CCarCtrl::ReInit(void) NumPermanentCars = 0; NumAmbulancesOnDuty = 0; NumFiretrucksOnDuty = 0; +#ifdef FIX_BUGS + LastTimeFireTruckCreated = 0; + LastTimeAmbulanceCreated = 0; + LastTimeLawEnforcerCreated = 0; +#endif CountDownToCarsAtStart = 2; CarDensityMultiplier = 1.0f; for (int i = 0; i < MAX_CARS_TO_KEEP; i++) diff --git a/src/control/Replay.cpp b/src/control/Replay.cpp index d37e98cf..da350660 100644 --- a/src/control/Replay.cpp +++ b/src/control/Replay.cpp @@ -701,7 +701,7 @@ void CReplay::StoreCarUpdate(CVehicle *vehicle, int id) vp->door_angles[1] = 127.0f / PI * car->Doors[3].m_fAngle; vp->door_status = 0; for (int i = 0; i < 6; i++){ - if (car->Damage.GetDoorStatus(i) == 3) + if (car->Damage.GetDoorStatus(i) == DOOR_STATUS_MISSING) vp->door_status |= BIT(i); } } @@ -744,27 +744,27 @@ void CReplay::ProcessCarUpdate(CVehicle *vehicle, float interpolation, CAddressI car->Damage.SetDoorStatus(DOOR_FRONT_LEFT, DOOR_STATUS_SWINGING); if (vp->door_angles[1]) car->Damage.SetDoorStatus(DOOR_FRONT_RIGHT, DOOR_STATUS_SWINGING); - if (vp->door_status & 1 && car->Damage.GetDoorStatus(DOOR_BONNET) != 3){ + if (vp->door_status & 1 && car->Damage.GetDoorStatus(DOOR_BONNET) != DOOR_STATUS_MISSING){ car->Damage.SetDoorStatus(DOOR_BONNET, DOOR_STATUS_MISSING); car->SetDoorDamage(CAR_BONNET, DOOR_BONNET, true); } - if (vp->door_status & 2 && car->Damage.GetDoorStatus(DOOR_BOOT) != 3) { + if (vp->door_status & 2 && car->Damage.GetDoorStatus(DOOR_BOOT) != DOOR_STATUS_MISSING) { car->Damage.SetDoorStatus(DOOR_BOOT, DOOR_STATUS_MISSING); car->SetDoorDamage(CAR_BOOT, DOOR_BOOT, true); } - if (vp->door_status & 4 && car->Damage.GetDoorStatus(DOOR_FRONT_LEFT) != 3) { + if (vp->door_status & 4 && car->Damage.GetDoorStatus(DOOR_FRONT_LEFT) != DOOR_STATUS_MISSING) { car->Damage.SetDoorStatus(DOOR_FRONT_LEFT, DOOR_STATUS_MISSING); car->SetDoorDamage(CAR_DOOR_LF, DOOR_FRONT_LEFT, true); } - if (vp->door_status & 8 && car->Damage.GetDoorStatus(DOOR_FRONT_RIGHT) != 3) { + if (vp->door_status & 8 && car->Damage.GetDoorStatus(DOOR_FRONT_RIGHT) != DOOR_STATUS_MISSING) { car->Damage.SetDoorStatus(DOOR_FRONT_RIGHT, DOOR_STATUS_MISSING); car->SetDoorDamage(CAR_DOOR_RF, DOOR_FRONT_RIGHT, true); } - if (vp->door_status & 0x10 && car->Damage.GetDoorStatus(DOOR_REAR_LEFT) != 3) { + if (vp->door_status & 0x10 && car->Damage.GetDoorStatus(DOOR_REAR_LEFT) != DOOR_STATUS_MISSING) { car->Damage.SetDoorStatus(DOOR_REAR_LEFT, DOOR_STATUS_MISSING); car->SetDoorDamage(CAR_DOOR_LR, DOOR_REAR_LEFT, true); } - if (vp->door_status & 0x20 && car->Damage.GetDoorStatus(DOOR_REAR_RIGHT) != 3) { + if (vp->door_status & 0x20 && car->Damage.GetDoorStatus(DOOR_REAR_RIGHT) != DOOR_STATUS_MISSING) { car->Damage.SetDoorStatus(DOOR_REAR_RIGHT, DOOR_STATUS_MISSING); car->SetDoorDamage(CAR_DOOR_RR, DOOR_REAR_RIGHT, true); } diff --git a/src/control/Script.cpp b/src/control/Script.cpp index 7ab40847..1f65ce6e 100644 --- a/src/control/Script.cpp +++ b/src/control/Script.cpp @@ -256,10 +256,6 @@ void CUpsideDownCarCheck::UpdateTimers() { uint32 timeStep = CTimer::GetTimeStepInMilliseconds(); for (int i = 0; i < MAX_UPSIDEDOWN_CAR_CHECKS; i++){ -#ifdef FIX_BUGS - if (m_sCars[i].m_nVehicleIndex == -1) - continue; -#endif CVehicle* v = CPools::GetVehiclePool()->GetAt(m_sCars[i].m_nVehicleIndex); if (v){ if (IsCarUpsideDown(m_sCars[i].m_nVehicleIndex)) @@ -1674,13 +1670,7 @@ int8 CRunningScript::ProcessCommands100To199(int32 command) return 0; } case COMMAND_GENERATE_RANDOM_INT: -#ifdef FIX_BUGS - // Not a very good fix but before switching to PS2 rand, it sort of works - *GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL) = CGeneral::GetRandomNumberInRange(0, 65535); -#else - /* On PC between 0 and 32767, even though script expects values between 0 and 65536 */ *GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL) = CGeneral::GetRandomNumber(); -#endif return 0; case COMMAND_CREATE_CHAR: { @@ -2314,20 +2304,15 @@ int8 CRunningScript::ProcessCommands200To299(int32 command) assert(pCurrent); // GetIndex(0) doesn't look good int handle = CPools::GetVehiclePool()->GetIndex(pCurrent); if (handle != CTheScripts::StoreVehicleIndex && m_bIsMissionScript){ -#ifdef FIX_BUGS - if (CTheScripts::StoreVehicleIndex != -1) -#endif - { - CVehicle* pOld = CPools::GetVehiclePool()->GetAt(CTheScripts::StoreVehicleIndex); - if (pOld){ - CCarCtrl::RemoveFromInterestingVehicleList(pOld); - if (pOld->VehicleCreatedBy == MISSION_VEHICLE && CTheScripts::StoreVehicleWasRandom){ - pOld->VehicleCreatedBy = RANDOM_VEHICLE; - pOld->bIsLocked = false; - CCarCtrl::NumRandomCars++; - CCarCtrl::NumMissionCars--; - CTheScripts::MissionCleanup.RemoveEntityFromList(CTheScripts::StoreVehicleIndex, CLEANUP_CAR); - } + CVehicle* pOld = CPools::GetVehiclePool()->GetAt(CTheScripts::StoreVehicleIndex); + if (pOld){ + CCarCtrl::RemoveFromInterestingVehicleList(pOld); + if (pOld->VehicleCreatedBy == MISSION_VEHICLE && CTheScripts::StoreVehicleWasRandom){ + pOld->VehicleCreatedBy = RANDOM_VEHICLE; + pOld->bIsLocked = false; + CCarCtrl::NumRandomCars++; + CCarCtrl::NumMissionCars--; + CTheScripts::MissionCleanup.RemoveEntityFromList(CTheScripts::StoreVehicleIndex, CLEANUP_CAR); } } @@ -2370,20 +2355,15 @@ int8 CRunningScript::ProcessCommands200To299(int32 command) assert(pCurrent); // Here pCurrent shouldn't be NULL anyway int handle = CPools::GetVehiclePool()->GetIndex(pCurrent); if (handle != CTheScripts::StoreVehicleIndex && m_bIsMissionScript) { -#ifdef FIX_BUGS - if (CTheScripts::StoreVehicleIndex != -1) -#endif - { - CVehicle* pOld = CPools::GetVehiclePool()->GetAt(CTheScripts::StoreVehicleIndex); - if (pOld){ - CCarCtrl::RemoveFromInterestingVehicleList(pOld); - if (pOld->VehicleCreatedBy == MISSION_VEHICLE && CTheScripts::StoreVehicleWasRandom){ - pOld->VehicleCreatedBy = RANDOM_VEHICLE; - pOld->bIsLocked = false; - CCarCtrl::NumRandomCars++; - CCarCtrl::NumMissionCars--; - CTheScripts::MissionCleanup.RemoveEntityFromList(CTheScripts::StoreVehicleIndex, CLEANUP_CAR); - } + CVehicle* pOld = CPools::GetVehiclePool()->GetAt(CTheScripts::StoreVehicleIndex); + if (pOld){ + CCarCtrl::RemoveFromInterestingVehicleList(pOld); + if (pOld->VehicleCreatedBy == MISSION_VEHICLE && CTheScripts::StoreVehicleWasRandom){ + pOld->VehicleCreatedBy = RANDOM_VEHICLE; + pOld->bIsLocked = false; + CCarCtrl::NumRandomCars++; + CCarCtrl::NumMissionCars--; + CTheScripts::MissionCleanup.RemoveEntityFromList(CTheScripts::StoreVehicleIndex, CLEANUP_CAR); } } @@ -9652,6 +9632,16 @@ int8 CRunningScript::ProcessCommands1100To1199(int32 command) #endif return 0; #endif +#ifndef GTA3_1_1_PATCH + case COMMAND_SET_THREAT_REACTION_RANGE_MULTIPLIER: + CollectParameters(&m_nIp, 1); +#ifdef FIX_BUGS + CPed::nThreatReactionRangeMultiplier = *(float*)&ScriptParams[0]; +#else + CPed::nThreatReactionRangeMultiplier = (float)ScriptParams[0]; +#endif + return 0; +#endif default: assert(0); } diff --git a/src/control/ScriptCommands.h b/src/control/ScriptCommands.h index dafe2418..77cf3f0f 100644 --- a/src/control/ScriptCommands.h +++ b/src/control/ScriptCommands.h @@ -1156,5 +1156,8 @@ enum { COMMAND_IS_CHAR_LYING_DOWN, COMMAND_CAN_CHAR_SEE_DEAD_CHAR, COMMAND_SET_ENTER_CAR_RANGE_MULTIPLIER, +#ifndef GTA3_1_1_PATCH + COMMAND_SET_THREAT_REACTION_RANGE_MULTIPLIER +#endif #endif };
\ No newline at end of file diff --git a/src/core/Cam.cpp b/src/core/Cam.cpp index 5cf1c8f3..801652cb 100644 --- a/src/core/Cam.cpp +++ b/src/core/Cam.cpp @@ -2545,11 +2545,13 @@ CCam::Process_M16_1stPerson(const CVector &CameraTarget, float, float, float) ResetStatics = false; } +#ifndef GTA3_1_1_PATCH ((CPed*)CamTargetEntity)->m_pedIK.GetComponentPosition(&HeadPos, PED_HEAD); Source = HeadPos; Source.z += 0.1f; Source.x -= 0.19f*Cos(m_fInitialPlayerOrientation); Source.y -= 0.19f*Sin(m_fInitialPlayerOrientation); +#endif // Look around bool UseMouse = false; @@ -2578,6 +2580,17 @@ CCam::Process_M16_1stPerson(const CVector &CameraTarget, float, float, float) if(Alpha > DEGTORAD(60.0f)) Alpha = DEGTORAD(60.0f); if(Alpha < -DEGTORAD(89.5f)) Alpha = -DEGTORAD(89.5f); +#ifdef GTA3_1_1_PATCH + HeadPos.x = 0.0f; + HeadPos.y = 0.0f; + HeadPos.z = 0.0f; + ((CPed*)CamTargetEntity)->m_pedIK.GetComponentPosition(&HeadPos, PED_HEAD); + Source = HeadPos; + Source.z += 0.1f; + Source.x -= 0.19f * Cos(m_fInitialPlayerOrientation); + Source.y -= 0.19f * Sin(m_fInitialPlayerOrientation); +#endif + TargetCoors.x = 3.0f * Cos(Alpha) * Cos(Beta) + Source.x; TargetCoors.y = 3.0f * Cos(Alpha) * Sin(Beta) + Source.y; TargetCoors.z = 3.0f * Sin(Alpha) + Source.z; diff --git a/src/core/Camera.cpp b/src/core/Camera.cpp index c8eaaa56..9a053056 100644 --- a/src/core/Camera.cpp +++ b/src/core/Camera.cpp @@ -71,11 +71,27 @@ bool bDidWeProcessAnyCinemaCam; #define CTRLDOWN(key) ((KEYDOWN(rsLCTRL) || KEYDOWN(rsRCTRL)) && KEYDOWN((RsKeyCodes)key)) #endif +CCamera::CCamera(void) +{ +#ifdef GTA3_1_1_PATCH + m_fMouseAccelHorzntl = 0.0025f; + m_fMouseAccelVertical = 0.003f; +#endif + Init(); +} + void CCamera::Init(void) { +#ifdef GTA3_1_1_PATCH + float fMouseAccelHorzntl = m_fMouseAccelHorzntl; + float fMouseAccelVertical = m_fMouseAccelVertical; +#endif memset(this, 0, sizeof(CCamera)); // getting rid of vtable, eh? - +#ifdef GTA3_1_1_PATCH + m_fMouseAccelHorzntl = fMouseAccelHorzntl; + m_fMouseAccelVertical = fMouseAccelVertical; +#endif m_pRwCamera = nil; m_1rstPersonRunCloseToAWall = false; m_fPositionAlongSpline = 0.0f; @@ -191,8 +207,10 @@ CCamera::Init(void) m_uiTransitionState = 0; m_uiTimeTransitionStart = 0; m_bLookingAtPlayer = true; +#ifndef GTA3_1_1_PATCH m_fMouseAccelHorzntl = 0.0025f; m_fMouseAccelVertical = 0.003f; +#endif m_f3rdPersonCHairMultX = 0.53f; m_f3rdPersonCHairMultY = 0.4f; } diff --git a/src/core/Camera.h b/src/core/Camera.h index d1c8ec03..6d53f417 100644 --- a/src/core/Camera.h +++ b/src/core/Camera.h @@ -546,6 +546,7 @@ uint32 unknown; // some counter having to do with music #endif // High level and misc + CCamera(void); void Init(void); void Process(void); void CamControl(void); diff --git a/src/core/ControllerConfig.cpp b/src/core/ControllerConfig.cpp index f55568be..cba8186f 100644 --- a/src/core/ControllerConfig.cpp +++ b/src/core/ControllerConfig.cpp @@ -685,7 +685,15 @@ void CControllerConfigManager::AffectControllerStateOn_ButtonDown_Driving(int32 } bool isDodo = false; - if (FindPlayerVehicle() && (FindPlayerVehicle()->IsVehicle() && FindPlayerVehicle()->GetModelIndex() == MI_DODO)) + if (FindPlayerVehicle() && (FindPlayerVehicle()->IsVehicle() && ( + FindPlayerVehicle()->GetModelIndex() == MI_DODO +#ifdef FIX_BUGS + || CVehicle::bAllDodosCheat +#ifdef ALLCARSHELI_CHEAT + || bAllCarCheat +#endif +#endif + ))) { isDodo = true; } diff --git a/src/core/Frontend.cpp b/src/core/Frontend.cpp index e9125b23..a83bffce 100644 --- a/src/core/Frontend.cpp +++ b/src/core/Frontend.cpp @@ -2977,8 +2977,10 @@ CMenuManager::LoadAllTextures() CTxdStore::LoadTxd(frontendTxdSlot, "MODELS/FRONTEND.TXD"); CTxdStore::AddRef(frontendTxdSlot); CTxdStore::SetCurrentTxd(frontendTxdSlot); +#ifndef GTA3_1_1_PATCH CStreaming::IHaveUsedStreamingMemory(); CTimer::Update(); +#endif for (int i = 0; i < ARRAY_SIZE(FrontendFilenames); i++) { m_aFrontEndSprites[i].SetTexture(FrontendFilenames[i][0], FrontendFilenames[i][1]); @@ -3005,6 +3007,10 @@ CMenuManager::LoadAllTextures() m_aMapSprites[i].SetAddressing(rwTEXTUREADDRESSBORDER); } #endif +#ifdef GTA3_1_1_PATCH + CStreaming::IHaveUsedStreamingMemory(); + CTimer::Update(); +#endif m_bSpritesLoaded = true; CTxdStore::PopCurrentTxd(); } @@ -3016,7 +3022,11 @@ CMenuManager::LoadSettings() int fileHandle = CFileMgr::OpenFile("gta3.set", "r"); int32 prevLang = m_PrefsLanguage; +#ifdef GTA3_1_1_PATCH + CMBlur::BlurOn = (_dwOperatingSystemVersion != OS_WIN98); +#else CMBlur::BlurOn = true; +#endif MousePointerStateHelper.bInvertVertically = true; // 50 is silly @@ -4491,7 +4501,18 @@ CMenuManager::ProcessButtonPresses(void) m_PrefsUseWideScreen = false; m_PrefsShowSubtitles = true; m_nDisplayVideoMode = m_nPrefsVideoMode; +#ifdef GTA3_1_1_PATCH + if (_dwOperatingSystemVersion == OS_WIN98) { + CMBlur::BlurOn = false; + CMBlur::MotionBlurClose(); + } + else { + CMBlur::BlurOn = true; + CMBlur::MotionBlurOpen(Scene.camera); + } +#else CMBlur::BlurOn = true; +#endif SaveSettings(); } else if ((m_nCurrScreen != MENUPAGE_SKIN_SELECT_OLD) && (m_nCurrScreen == MENUPAGE_CONTROLLER_PC)) { ControlsManager.MakeControllerActionsBlank(); @@ -5029,7 +5050,7 @@ CMenuManager::WaitForUserCD() CSprite2d *splash; char *splashscreen = nil; -#ifndef RANDOMSPLASH +#if (!(defined RANDOMSPLASH) && !(defined GTA3_1_1_PATCH)) if (CGame::frenchGame || CGame::germanGame || !CGame::nastyGame) splashscreen = "mainsc2"; else diff --git a/src/core/Frontend.h b/src/core/Frontend.h index 6a18ce7a..c1284101 100644 --- a/src/core/Frontend.h +++ b/src/core/Frontend.h @@ -648,3 +648,4 @@ public: static_assert(sizeof(CMenuManager) == 0x564, "CMenuManager: error"); extern CMenuManager FrontEndMenuManager; +extern unsigned long _dwOperatingSystemVersion;
\ No newline at end of file diff --git a/src/core/Pad.cpp b/src/core/Pad.cpp index 84bb1526..0a626570 100644 --- a/src/core/Pad.cpp +++ b/src/core/Pad.cpp @@ -293,6 +293,38 @@ void KangarooCheat() } #endif +#ifdef ALLCARSHELI_CHEAT +void AllCarsHeliCheat(void) +{ + wchar* string; + if (bAllCarCheat) { + string = TheText.Get("CHEATOF"); + bAllCarCheat = false; + } + else { + string = TheText.Get("CHEAT1"); + bAllCarCheat = true; + } + CHud::SetHelpMessage(string, true); +} +#endif + +#ifdef ALT_DODO_CHEAT +void AltDodoCheat(void) +{ + wchar* string; + if (CVehicle::bAltDodoCheat) { + string = TheText.Get("CHEATOF"); + CVehicle::bAltDodoCheat = false; + } + else { + string = TheText.Get("CHEAT1"); + CVehicle::bAltDodoCheat = true; + } + CHud::SetHelpMessage(string, true); +} +#endif + void CControllerState::Clear(void) { @@ -915,6 +947,18 @@ void CPad::AddToPCCheatString(char c) if (!_CHEATCMP("GUBEDDEP")) CPed::SwitchDebugDisplay(); #endif + +#ifdef ALLCARSHELI_CHEAT + // "CARSAREHELI" + if (!_CHEATCMP("ILEHERASRAC")) + AllCarsHeliCheat(); +#endif + +#ifdef ALT_DODO_CHEAT + // "IWANTTOMASTERDODO" + if (!_CHEATCMP("ODODRETSAMOTTNAWI")) + AltDodoCheat(); +#endif #undef _CHEATCMP } diff --git a/src/core/Pad.h b/src/core/Pad.h index b3b0849b..b8228444 100644 --- a/src/core/Pad.h +++ b/src/core/Pad.h @@ -450,3 +450,7 @@ public: VALIDATE_SIZE(CPad, 0xFC); extern CPad Pads[MAX_PADS]; + +#ifdef ALLCARSHELI_CHEAT +extern bool bAllCarCheat; +#endif diff --git a/src/core/common.h b/src/core/common.h index 955225cc..18f4715c 100644 --- a/src/core/common.h +++ b/src/core/common.h @@ -31,6 +31,7 @@ #define HIERNODEID(hier, i) ((hier)->nodeInfo[i].id) #define HANIMFRAMES(anim) ((anim)->keyframes) #else +#define RWHALFPIXEL // always d3d #define STREAMPOS(str) ((str)->Type.memory.position) #define STREAMFILE(str) ((str)->Type.file.fpFile) #define HIERNODEINFO(hier) ((hier)->pNodeInfo) @@ -38,6 +39,12 @@ #define HANIMFRAMES(anim) ((anim)->pFrames) #endif +#ifdef RWHALFPIXEL +#define HALFPX (0.5f) +#else +#define HALFPX (0.0f) +#endif + #define rwVENDORID_ROCKSTAR 0x0253F2 // Get rid of bullshit windows definitions, we're not running on an 8086 diff --git a/src/core/config.h b/src/core/config.h index 2cf8ec88..163af701 100644 --- a/src/core/config.h +++ b/src/core/config.h @@ -191,7 +191,7 @@ enum Config { #define TOGGLEABLE_BETA_FEATURES // toggleable from debug menu. not too many things #define MORE_LANGUAGES // Add more translations to the game #define DEFAULT_NATIVE_RESOLUTION // Set default video mode to your native resolution (fixes Windows 10 launch) -//#define USE_TXD_CDIMAGE // generate and load textures from txd.img +#define USE_TXD_CDIMAGE // generate and load textures from txd.img //#define USE_TEXTURE_POOL //#define OPENAL @@ -204,6 +204,8 @@ enum Config { #define XINPUT #endif #define KANGAROO_CHEAT +#define ALLCARSHELI_CHEAT +#define ALT_DODO_CHEAT #define REGISTER_START_BUTTON // Hud, frontend and radar diff --git a/src/core/templates.h b/src/core/templates.h index a1627357..51a24e4c 100644 --- a/src/core/templates.h +++ b/src/core/templates.h @@ -104,6 +104,10 @@ public: return m_flags[i].free ? nil : (T*)&m_entries[i]; } T *GetAt(int handle){ +#ifdef FIX_BUGS + if (handle == -1) + return nil; +#endif return m_flags[handle>>8].u == (handle & 0xFF) ? (T*)&m_entries[handle >> 8] : nil; } diff --git a/src/entities/Physical.cpp b/src/entities/Physical.cpp index a27e4d7b..d37405ec 100644 --- a/src/entities/Physical.cpp +++ b/src/entities/Physical.cpp @@ -814,7 +814,11 @@ CPhysical::ApplyCollisionAlt(CEntity *B, CColPoint &colpoint, float &impulse, CV normalSpeed = DotProduct(speed, colpoint.normal); if(normalSpeed < 0.0f){ float minspeed = 0.0104f * CTimer::GetTimeStep(); +#ifdef GTA3_1_1_PATCH + if ((IsObject() || IsVehicle() && (GetUp().z < -0.3f || ((CVehicle*)this)->IsBike() && (m_status == STATUS_ABANDONED || m_status == STATUS_WRECKED))) && +#else if((IsObject() || IsVehicle() && GetUp().z < -0.3f) && +#endif !bHasContacted && Abs(m_vecMoveSpeed.x) < minspeed && Abs(m_vecMoveSpeed.y) < minspeed && diff --git a/src/extras/debugmenu.cpp b/src/extras/debugmenu.cpp index f419e76f..1c5e26ee 100644 --- a/src/extras/debugmenu.cpp +++ b/src/extras/debugmenu.cpp @@ -1068,13 +1068,13 @@ drawArrow(RwRect r, int direction, int style) int top = r.y; int bottom = r.y+r.h; - float umin = 0.5f / width; - float vmin = 0.5f / height; - float umax = (width + 0.5f) / width; - float vmax = (height + 0.5f) / height; + float umin = HALFPX / width; + float vmin = HALFPX / height; + float umax = (width + HALFPX) / width; + float vmax = (height + HALFPX) / height; if(direction < 0){ - vmin = (height - 0.5f) / height; - vmax = -0.5f / height; + vmin = (height - HALFPX) / height; + vmax = -HALFPX / height; } if(style){ @@ -1167,10 +1167,10 @@ drawMouse(void) float h = RwRasterGetHeight(cursor); float recipz = 1.0f/RwCameraGetNearClipPlane(cam); - float umin = 0.5f / w; - float vmin = 0.5f / h; - float umax = (w + 0.5f) / w; - float vmax = (h + 0.5f) / h; + float umin = HALFPX / w; + float vmin = HALFPX / h; + float umax = (w + HALFPX) / w; + float vmax = (h + HALFPX) / h; vert = vertices; RwIm2DVertexSetScreenX(vert, x); diff --git a/src/fakerw/fake.cpp b/src/fakerw/fake.cpp index 26b5ae3d..ccc7635f 100644 --- a/src/fakerw/fake.cpp +++ b/src/fakerw/fake.cpp @@ -294,6 +294,14 @@ static rw::Raster* ConvertTexRaster(rw::Raster *ras) { using namespace rw; + + if(ras->platform == rw::platform) + return ras; + // compatible platforms + if(ras->platform == PLATFORM_D3D8 && rw::platform == PLATFORM_D3D9 || + ras->platform == PLATFORM_D3D9 && rw::platform == PLATFORM_D3D8) + return ras; + Image *img = ras->toImage(); ras->destroy(); img->unindex(); @@ -306,9 +314,7 @@ ConvertTexRaster(rw::Raster *ras) RwBool rwNativeTextureHackRead(RwStream *stream, RwTexture **tex, RwInt32 size) { *tex = Texture::streamReadNative(stream); -#ifdef RW_GL3 - if(strcmp((*tex)->name, "copnu") == 0) - tex = tex; +#ifdef LIBRW (*tex)->raster = ConvertTexRaster((*tex)->raster); #endif return *tex != nil; @@ -830,4 +836,10 @@ RwBool RtCharsetDestroy(RtCharset * charSet) { charSet->destroy(); return // fake shit -RwInt32 _rwD3D8FindCorrectRasterFormat(RwRasterType type, RwInt32 flags) { return 1; } +RwInt32 _rwD3D8FindCorrectRasterFormat(RwRasterType type, RwInt32 flags) +{ +#ifdef RW_GL3 + return '3LGO'; +#endif + return flags & 0xF00; +} diff --git a/src/modelinfo/VehicleModelInfo.cpp b/src/modelinfo/VehicleModelInfo.cpp index 0c3a7720..098400cc 100644 --- a/src/modelinfo/VehicleModelInfo.cpp +++ b/src/modelinfo/VehicleModelInfo.cpp @@ -960,7 +960,9 @@ CVehicleModelInfo::DeleteVehicleColourTextures(void) for(i = 0; i < 256; i++){ if(ms_colourTextureTable[i]){ RwTextureDestroy(ms_colourTextureTable[i]); +#ifdef GTA3_1_1_PATCH ms_colourTextureTable[i] = nil; +#endif } } } diff --git a/src/objects/ParticleObject.cpp b/src/objects/ParticleObject.cpp index 932a0b8a..1ea10e92 100644 --- a/src/objects/ParticleObject.cpp +++ b/src/objects/ParticleObject.cpp @@ -7,6 +7,7 @@ #include "Particle.h" #include "Camera.h" #include "Game.h" +#include "DMAudio.h" CParticleObject gPObjectArray[MAX_PARTICLEOBJECTS]; diff --git a/src/peds/Ped.h b/src/peds/Ped.h index f4caafd8..46c6c82d 100644 --- a/src/peds/Ped.h +++ b/src/peds/Ped.h @@ -567,6 +567,9 @@ public: bool CanSeeEntity(CEntity*, float); void RestorePreviousObjective(void); void SetIdle(void); +#ifdef _MSC_VER + __declspec(noinline) // workaround for a compiler bug, hooray MS :P +#endif void SetObjective(eObjective, void*); void SetObjective(eObjective); void SetObjective(eObjective, int16, int16); @@ -885,15 +888,6 @@ public: #endif }; -class cPedParams -{ -public: - bool m_bDistanceCalculated; - char gap_1[3]; - float m_fDistance; - CPed *m_pPed; -}; - void FinishFuckUCB(CAnimBlendAssociation *assoc, void *arg); #ifndef PED_SKIN diff --git a/src/render/2dEffect.h b/src/render/2dEffect.h index 62216bca..b0615e4d 100644 --- a/src/render/2dEffect.h +++ b/src/render/2dEffect.h @@ -76,8 +76,14 @@ public: if(type == EFFECT_LIGHT){ if(light.corona) RwTextureDestroy(light.corona); +#ifdef GTA3_1_1_PATCH + light.corona = nil; +#endif if(light.shadow) RwTextureDestroy(light.shadow); +#ifdef GTA3_1_1_PATCH + light.shadow = nil; +#endif } } }; diff --git a/src/render/Clouds.cpp b/src/render/Clouds.cpp index cb08a997..07688491 100644 --- a/src/render/Clouds.cpp +++ b/src/render/Clouds.cpp @@ -44,10 +44,25 @@ void CClouds::Shutdown(void) { RwTextureDestroy(gpCloudTex[0]); +#ifdef GTA3_1_1_PATCH + gpCloudTex[0] = nil; +#endif RwTextureDestroy(gpCloudTex[1]); +#ifdef GTA3_1_1_PATCH + gpCloudTex[1] = nil; +#endif RwTextureDestroy(gpCloudTex[2]); +#ifdef GTA3_1_1_PATCH + gpCloudTex[2] = nil; +#endif RwTextureDestroy(gpCloudTex[3]); +#ifdef GTA3_1_1_PATCH + gpCloudTex[3] = nil; +#endif RwTextureDestroy(gpCloudTex[4]); +#ifdef GTA3_1_1_PATCH + gpCloudTex[4] = nil; +#endif } void diff --git a/src/render/MBlur.cpp b/src/render/MBlur.cpp index c3a25bce..68ec1194 100644 --- a/src/render/MBlur.cpp +++ b/src/render/MBlur.cpp @@ -58,13 +58,13 @@ CMBlur::CreateImmediateModeData(RwCamera *cam, RwRect *rect) float zero, xmax, ymax; if(RwRasterGetDepth(RwCameraGetRaster(cam)) == 16){ - zero = 0.5f; - xmax = rect->w + 0.5f; - ymax = rect->h + 0.5f; + zero = HALFPX; + xmax = rect->w + HALFPX; + ymax = rect->h + HALFPX; }else{ - zero = -0.5f; - xmax = rect->w - 0.5f; - ymax = rect->h - 0.5f; + zero = -HALFPX; + xmax = rect->w - HALFPX; + ymax = rect->h - HALFPX; } RwIm2DVertexSetScreenX(&Vertex[0], zero); diff --git a/src/render/Rubbish.cpp b/src/render/Rubbish.cpp index d21dd558..bfd50c07 100644 --- a/src/render/Rubbish.cpp +++ b/src/render/Rubbish.cpp @@ -414,7 +414,19 @@ void CRubbish::Shutdown(void) { RwTextureDestroy(gpRubbishTexture[0]); +#ifdef GTA3_1_1_PATCH + gpRubbishTexture[0] = nil; +#endif RwTextureDestroy(gpRubbishTexture[1]); +#ifdef GTA3_1_1_PATCH + gpRubbishTexture[1] = nil; +#endif RwTextureDestroy(gpRubbishTexture[2]); +#ifdef GTA3_1_1_PATCH + gpRubbishTexture[2] = nil; +#endif RwTextureDestroy(gpRubbishTexture[3]); +#ifdef GTA3_1_1_PATCH + gpRubbishTexture[3] = nil; +#endif } diff --git a/src/render/Skidmarks.cpp b/src/render/Skidmarks.cpp index f3479536..5d521041 100644 --- a/src/render/Skidmarks.cpp +++ b/src/render/Skidmarks.cpp @@ -54,8 +54,17 @@ void CSkidmarks::Shutdown(void) { RwTextureDestroy(gpSkidTex); +#ifdef GTA3_1_1_PATCH + gpSkidTex = nil; +#endif RwTextureDestroy(gpSkidBloodTex); +#ifdef GTA3_1_1_PATCH + gpSkidBloodTex = nil; +#endif RwTextureDestroy(gpSkidMudTex); +#ifdef GTA3_1_1_PATCH + gpSkidMudTex = nil; +#endif } void diff --git a/src/render/SpecialFX.cpp b/src/render/SpecialFX.cpp index fc081fa3..7e08fbad 100644 --- a/src/render/SpecialFX.cpp +++ b/src/render/SpecialFX.cpp @@ -298,6 +298,12 @@ void CBulletTraces::Render(void) if (!aTraces[i].m_bInUse) continue; RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)FALSE); +#ifdef FIX_BUGS + // Raster has no transparent pixels so it relies on the raster format having alpha + // to turn on blending. librw image conversion might get rid of it right now so let's + // just force it on. + RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE); +#endif RwRenderStateSet(rwRENDERSTATESRCBLEND, (void*)rwBLENDONE); RwRenderStateSet(rwRENDERSTATEDESTBLEND, (void*)rwBLENDONE); RwRenderStateSet(rwRENDERSTATETEXTURERASTER, RwTextureGetRaster(gpShadowExplosionTex)); diff --git a/src/save/GenericGameStorage.cpp b/src/save/GenericGameStorage.cpp index 29f666df..3e25ba42 100644 --- a/src/save/GenericGameStorage.cpp +++ b/src/save/GenericGameStorage.cpp @@ -3,6 +3,7 @@ #include "crossplatform.h" #include "main.h" +#include "DMAudio.h" #include "AudioScriptObject.h" #include "Camera.h" #include "CarGen.h" diff --git a/src/skel/glfw/glfw.cpp b/src/skel/glfw/glfw.cpp index db6be3a2..6359d22f 100644 --- a/src/skel/glfw/glfw.cpp +++ b/src/skel/glfw/glfw.cpp @@ -248,83 +248,6 @@ psNativeTextureSupport(void) /* ***************************************************************************** */ -static char cpuvendor[16] = "UnknownVendr"; -__declspec(naked) const char * _psGetCpuVendr() -{ - __asm - { - push ebx - xor eax, eax - cpuid - mov dword ptr [cpuvendor+0], ebx - mov dword ptr [cpuvendor+4], edx - mov dword ptr [cpuvendor+8], ecx - mov eax, offset cpuvendor - pop ebx - retn - } -} - -/* - ***************************************************************************** - */ -__declspec(naked) RwUInt32 _psGetCpuFeatures() -{ - __asm - { - mov eax, 1 - cpuid - mov eax, edx - retn - } -} - -/* - ***************************************************************************** - */ -__declspec(naked) RwUInt32 _psGetCpuFeaturesEx() -{ - __asm - { - mov eax, 80000000h - cpuid - - cmp eax, 80000000h - jbe short _NOEX - - mov eax, 80000001h - cpuid - - mov eax, edx - jmp short _RETEX - -_NOEX: - xor eax, eax - mov eax, eax - -_RETEX: - retn - } -} - -void _psPrintCpuInfo() -{ - RwUInt32 features = _psGetCpuFeatures(); - RwUInt32 FeaturesEx = _psGetCpuFeaturesEx(); - - debug("Running on a %s", _psGetCpuVendr()); - - if ( features & 0x800000 ) - debug("with MMX"); - if ( features & 0x2000000 ) - debug("with SSE"); - if ( FeaturesEx & 0x80000000 ) - debug("with 3DNow"); -} - -/* - ***************************************************************************** - */ #ifdef UNDER_CE #define CMDSTR LPWSTR #else @@ -357,8 +280,6 @@ psInitialise(void) gGameState = GS_START_UP; TRACE("gGameState = GS_START_UP"); - _psPrintCpuInfo(); - OSVERSIONINFO verInfo; verInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); diff --git a/src/skel/win/win.cpp b/src/skel/win/win.cpp index e623defb..288788c0 100644 --- a/src/skel/win/win.cpp +++ b/src/skel/win/win.cpp @@ -596,8 +596,9 @@ psInitialise(void) C_PcSave::SetSaveDirectory(_psGetUserFilesFolder()); InitialiseLanguage(); - +#ifndef GTA3_1_1_PATCH FrontEndMenuManager.LoadSettings(); +#endif gGameState = GS_START_UP; TRACE("gGameState = GS_START_UP"); @@ -642,7 +643,11 @@ psInitialise(void) _dwOperatingSystemVersion = OS_WIN95; } } - + +#ifdef GTA3_1_1_PATCH + FrontEndMenuManager.LoadSettings(); +#endif + dwDXVersion = GetDXVersion(); debug("DirectX version 0x%x\n", dwDXVersion); diff --git a/src/vehicles/Automobile.cpp b/src/vehicles/Automobile.cpp index 74609e15..bfb215d2 100644 --- a/src/vehicles/Automobile.cpp +++ b/src/vehicles/Automobile.cpp @@ -1013,16 +1013,28 @@ CAutomobile::ProcessControl(void) m_aWheelSpeed[0] = Max(m_aWheelSpeed[0]-0.0005f, 0.0f); }else if((GetModelIndex() == MI_DODO || CVehicle::bAllDodosCheat) && m_vecMoveSpeed.Magnitude() > 0.0f && CTimer::GetTimeStep() > 0.0f){ - FlyingControl(FLIGHT_MODEL_DODO); +#ifdef ALT_DODO_CHEAT + if (bAltDodoCheat) + FlyingControl(FLIGHT_MODEL_SEAPLANE); + else +#endif + FlyingControl(FLIGHT_MODEL_DODO); }else if(GetModelIndex() == MI_MIAMI_RCBARON){ FlyingControl(FLIGHT_MODEL_RCPLANE); }else if(GetModelIndex() == MI_MIAMI_RCRAIDER || GetModelIndex() == MI_MIAMI_SPARROW || bAllCarCheat){ - if(CPad::GetPad(0)->GetCircleJustDown()) - m_aWheelSpeed[0] = Max(m_aWheelSpeed[0]-0.03f, 0.0f); - if(m_aWheelSpeed[0] < 0.22f) - m_aWheelSpeed[0] += 0.0001f; - if(m_aWheelSpeed[0] > 0.15f) +#ifdef ALLCARSHELI_CHEAT + if (bAllCarCheat) FlyingControl(FLIGHT_MODEL_HELI); + else +#endif + { + if (CPad::GetPad(0)->GetCircleJustDown()) + m_aWheelSpeed[0] = Max(m_aWheelSpeed[0] - 0.03f, 0.0f); + if (m_aWheelSpeed[0] < 0.22f) + m_aWheelSpeed[0] += 0.0001f; + if (m_aWheelSpeed[0] > 0.15f) + FlyingControl(FLIGHT_MODEL_HELI); + } } } diff --git a/src/vehicles/Vehicle.cpp b/src/vehicles/Vehicle.cpp index 06894447..d0ccd31b 100644 --- a/src/vehicles/Vehicle.cpp +++ b/src/vehicles/Vehicle.cpp @@ -24,6 +24,9 @@ bool CVehicle::bAllDodosCheat; bool CVehicle::bCheat3; bool CVehicle::bCheat4; bool CVehicle::bCheat5; +#ifdef ALT_DODO_CHEAT +bool CVehicle::bAltDodoCheat; +#endif bool CVehicle::m_bDisableMouseSteering = true; void *CVehicle::operator new(size_t sz) { return CPools::GetVehiclePool()->New(); } @@ -185,6 +188,48 @@ CVehicle::GetHeightAboveRoad(void) return -1.0f * GetColModel()->boundingBox.min.z; } +const float fRCPropFallOff = 3.0f; +const float fRCAeroThrust = 0.003f; +const float fRCSideSlipMult = 0.1f; +const float fRCRudderMult = 0.2f; +const float fRCYawMult = -0.01f; +const float fRCRollMult = 0.02f; +const float fRCRollStabilise = -0.08f; +const float fRCPitchMult = 0.005f; +const float fRCTailMult = 0.3f; +const float fRCFormLiftMult = 0.02f; +const float fRCAttackLiftMult = 0.25f; +const CVector vecRCAeroResistance(0.998f, 0.998f, 0.9f); + +const float fSeaPropFallOff = 2.3f; +const float fSeaThrust = 0.002f; +const float fSeaSideSlipMult = 0.1f; +const float fSeaRudderMult = 0.01f; +const float fSeaYawMult = -0.0003f; +const float fSeaRollMult = 0.0015f; +const float fSeaRollStabilise = -0.01f; +const float fSeaPitchMult = 0.0002f; +const float fSeaTailMult = 0.01f; +const float fSeaFormLiftMult = 0.012f; +const float fSeaAttackLiftMult = 0.1f; +const CVector vecSeaAeroResistance(0.995f, 0.995f, 0.85f); + +const float fSpeedResistanceY = 500.0f; +const float fSpeedResistanceZ = 500.0f; + +const CVector vecHeliMoveRes(0.995f, 0.995f, 0.99f); +const CVector vecRCHeliMoveRes(0.99f, 0.99f, 0.99f); +const float fThrustVar = 0.3f; +const float fRotorFallOff = 0.75f; +const float fStabiliseVar = 0.015f; +const float fPitchBrake = 10.0f; +const float fPitchVar = 0.006f; +const float fRollVar = 0.006f; +const float fYawVar = -0.001f; +const CVector vecHeliResistance(0.81f, 0.85f, 0.99f); +const CVector vecRCHeliResistance(0.92f, 0.92f, 0.998f); +const float fSpinSpeedRes = 20.0f; + void CVehicle::FlyingControl(eFlightModel flightModel) { @@ -229,20 +274,183 @@ CVehicle::FlyingControl(eFlightModel flightModel) m_vecTurnSpeed.y *= Pow(0.9f, CTimer::GetTimeStep()); moveSpeed = m_vecMoveSpeed.MagnitudeSqr(); - if(moveSpeed > 2.25f) + if(moveSpeed > SQR(1.5f)) m_vecMoveSpeed *= 1.5f/Sqrt(moveSpeed); float turnSpeed = m_vecTurnSpeed.MagnitudeSqr(); - if(turnSpeed > 0.04f) + if(turnSpeed > SQR(0.2f)) m_vecTurnSpeed *= 0.2f/Sqrt(turnSpeed); } break; case FLIGHT_MODEL_RCPLANE: case FLIGHT_MODEL_SEAPLANE: - assert(0 && "Plane flight model not implemented"); + { + // thrust + float fForwSpeed = DotProduct(GetMoveSpeed(), GetForward()); + CVector vecWidthForward = GetColModel()->boundingBox.min.y * GetForward(); + float fThrust = (CPad::GetPad(0)->GetAccelerate() - CPad::GetPad(0)->GetBrake()) / 255.0f; + if (fForwSpeed > 0.1f || (flightModel == FLIGHT_MODEL_RCPLANE && fForwSpeed > 0.02f)) + fThrust += 1.0f; + else if (fForwSpeed > 0.0f && fThrust < 0.0f) + fThrust = 0.0f; + float fThrustImpulse; + if (flightModel == FLIGHT_MODEL_RCPLANE) + fThrustImpulse = (fThrust - fRCPropFallOff * fForwSpeed) * fRCAeroThrust; + else + fThrustImpulse = (fThrust - fSeaPropFallOff * fForwSpeed) * fSeaThrust; + ApplyMoveForce(fThrustImpulse * GetForward() * m_fMass * CTimer::GetTimeStep()); + + // left/right + float fSideSpeed = -DotProduct(GetMoveSpeed(), GetRight()); + float fSteerLR = CPad::GetPad(0)->GetSteeringLeftRight() / 128.0f; + float fSideSlipImpulse; + if (flightModel == FLIGHT_MODEL_RCPLANE) + fSideSlipImpulse = Abs(fSideSpeed) * fSideSpeed * fRCSideSlipMult; + else + fSideSlipImpulse = Abs(fSideSpeed) * fSideSpeed * fSeaSideSlipMult; + ApplyMoveForce(m_fMass * GetRight() * fSideSlipImpulse * CTimer::GetTimeStep()); + + float fYaw = -DotProduct(CrossProduct(m_vecTurnSpeed + m_vecTurnFriction, vecWidthForward) + m_vecMoveSpeed + m_vecMoveFriction, GetRight()); + float fYawImpulse; + if (flightModel == FLIGHT_MODEL_RCPLANE) + fYawImpulse = fRCRudderMult * fYaw * Abs(fYaw) + fRCYawMult * fSteerLR * fForwSpeed; + else + fYawImpulse = fSeaRudderMult * fYaw * Abs(fYaw) + fSeaYawMult * fSteerLR * fForwSpeed; + ApplyTurnForce(fYawImpulse * GetRight() * m_fTurnMass * CTimer::GetTimeStep(), vecWidthForward); + + float fRollImpulse; + if (flightModel == FLIGHT_MODEL_RCPLANE) { + float fDirectionMultiplier = CPad::GetPad(0)->GetLookRight(); + if (CPad::GetPad(0)->GetLookLeft()) + fDirectionMultiplier = -1; + fRollImpulse = (0.5f * fDirectionMultiplier + fSteerLR) * fRCRollMult; + } + else + fRollImpulse = fSteerLR * fSeaRollMult; + ApplyTurnForce(GetRight() * fRollImpulse * fForwSpeed * m_fTurnMass * CTimer::GetTimeStep(), GetUp()); + + CVector vecFRight = CrossProduct(GetForward(), CVector(0.0f, 0.0f, 1.0f)); + CVector vecStabilise = (GetUp().z > 0.0f) ? vecFRight : -vecFRight; + float fStabiliseDirection = (GetRight().z > 0.0f) ? -1.0f : 1.0f; + float fStabiliseImpulse; + if (flightModel == FLIGHT_MODEL_RCPLANE) + fStabiliseImpulse = fRCRollStabilise * fStabiliseDirection * (1.0f - DotProduct(GetRight(), vecStabilise)) * (1.0f - Abs(GetForward().z)); + else + fStabiliseImpulse = fSeaRollStabilise * fStabiliseDirection * (1.0f - DotProduct(GetRight(), vecStabilise)) * (1.0f - Abs(GetForward().z)); + ApplyTurnForce(fStabiliseImpulse * m_fTurnMass * GetRight(), GetUp()); // no CTimer::GetTimeStep(), is it right? VC doesn't have it too + + // up/down + float fTail = -DotProduct(CrossProduct(m_vecTurnSpeed + m_vecTurnFriction, vecWidthForward) + m_vecMoveSpeed + m_vecMoveFriction, GetUp()); + float fSteerUD = -CPad::GetPad(0)->GetSteeringUpDown() / 128.0f; + float fPitchImpulse; + if (flightModel == FLIGHT_MODEL_RCPLANE) + fPitchImpulse = fRCTailMult * fTail * Abs(fTail) + fRCPitchMult * fSteerUD * fForwSpeed; + else + fPitchImpulse = fSeaTailMult * fTail * Abs(fTail) + fSeaPitchMult * fSteerUD * fForwSpeed; + ApplyTurnForce(fPitchImpulse * m_fTurnMass * GetUp() * CTimer::GetTimeStep(), vecWidthForward); + + float fLift = -DotProduct(GetMoveSpeed(), GetUp()) / Max(0.01f, GetMoveSpeed().Magnitude()); + float fLiftImpluse; + if (flightModel == FLIGHT_MODEL_RCPLANE) + fLiftImpluse = (fRCAttackLiftMult * fLift + fRCFormLiftMult) * fForwSpeed * fForwSpeed; + else + fLiftImpluse = (fSeaAttackLiftMult * fLift + fSeaFormLiftMult) * fForwSpeed * fForwSpeed; + float fLiftForce = fLiftImpluse * m_fMass * CTimer::GetTimeStep(); + if (GRAVITY * CTimer::GetTimeStep() * m_fMass < fLiftImpluse) { + if (flightModel == FLIGHT_MODEL_RCPLANE && GetPosition().z > 50.0f) + fLiftForce = CTimer::GetTimeStep() * 0.0072 * m_fMass; + else if (flightModel == FLIGHT_MODEL_SEAPLANE && GetPosition().z > 80.0f) + fLiftForce = CTimer::GetTimeStep() * 0.0072 * m_fMass; + } + ApplyMoveForce(fLiftForce * GetUp()); + CVector vecResistance; + if (flightModel == FLIGHT_MODEL_RCPLANE) + vecResistance = vecRCAeroResistance; + else + vecResistance = vecSeaAeroResistance; + float rX = Pow(vecResistance.x, CTimer::GetTimeStep()); + float rY = Pow(vecResistance.y, CTimer::GetTimeStep()); + float rZ = Pow(vecResistance.z, CTimer::GetTimeStep()); + CVector vecTurnSpeed = Multiply3x3(m_vecTurnSpeed, GetMatrix()); + vecTurnSpeed.x *= rX; + float fResistance = vecTurnSpeed.y * (1.0f / (fSpeedResistanceY * SQR(vecTurnSpeed.y) + 1.0f)) * rY - vecTurnSpeed.y; + vecTurnSpeed.z *= rZ; + m_vecTurnSpeed = Multiply3x3(GetMatrix(), vecTurnSpeed); + ApplyTurnForce(-GetUp() * fResistance * m_fTurnMass, GetRight() + Multiply3x3(GetMatrix(), m_vecCentreOfMass)); + break; + } case FLIGHT_MODEL_HELI: - assert(0 && "Heli flight model not implemented"); + { + CVector vecMoveResistance; + if (GetModelIndex() == MI_MIAMI_SPARROW) + vecMoveResistance = vecHeliMoveRes; + else + vecMoveResistance = vecRCHeliMoveRes; + float rmX = Pow(vecMoveResistance.x, CTimer::GetTimeStep()); + float rmY = Pow(vecMoveResistance.y, CTimer::GetTimeStep()); + float rmZ = Pow(vecMoveResistance.z, CTimer::GetTimeStep()); + m_vecMoveSpeed.x *= rmX; + m_vecMoveSpeed.y *= rmY; + m_vecMoveSpeed.z *= rmZ; + if (m_status != STATUS_PLAYER && m_status != STATUS_PLAYER_REMOTE) + return; + float fThrust; + if (bCheat5) + fThrust = CPad::GetPad(0)->GetSteeringUpDown() * fThrustVar / 128.0f + 0.95f; + else + fThrust = fThrustVar * (CPad::GetPad(0)->GetAccelerate() - 2 * CPad::GetPad(0)->GetBrake()) / 255.0f + 0.95f; + fThrust -= fRotorFallOff * DotProduct(m_vecMoveSpeed, GetUp()); +#ifdef GTA3_1_1_PATCH + if (fThrust > 0.9f && GetPosition().z > 80.0f) + fThrust = 0.9f; +#endif + ApplyMoveForce(GRAVITY * GetUp() * fThrust * m_fMass * CTimer::GetTimeStep()); + + if (GetUp().z > 0.0f) + ApplyTurnForce(-CVector(GetUp().x, GetUp().y, 0.0f) * fStabiliseVar * m_fTurnMass * CTimer::GetTimeStep(), GetUp()); + + float fRoll, fPitch, fYaw; + if (bCheat5) { + fPitch = CPad::GetPad(0)->GetCarGunUpDown() / 128.0f; + fRoll = -CPad::GetPad(0)->GetSteeringLeftRight() / 128.0f; + fYaw = CPad::GetPad(0)->GetCarGunLeftRight() / 128.0f; + } + else { + fPitch = CPad::GetPad(0)->GetSteeringUpDown() / 128.0f; + fRoll = CPad::GetPad(0)->GetLookLeft(); + if (CPad::GetPad(0)->GetLookRight()) + fRoll = -1.0f; + fYaw = CPad::GetPad(0)->GetSteeringLeftRight() / 128.0f; + } + if (CPad::GetPad(0)->GetHorn()) { + fYaw = 0.0f; + fPitch = clamp(10.0f * DotProduct(m_vecMoveSpeed, GetUp()), -200.0f, 1.3f); + fRoll = clamp(10.0f * DotProduct(m_vecMoveSpeed, GetRight()), -200.0f, 1.3f); + } + debug("fPitch: %f\n", fPitch); + ApplyTurnForce(fPitch * GetUp() * fPitchVar * m_fTurnMass * CTimer::GetTimeStep(), GetForward()); + ApplyTurnForce(fRoll * GetUp() * fRollVar * m_fTurnMass * CTimer::GetTimeStep(), GetRight()); + ApplyTurnForce(fYaw * GetForward() * fYawVar * m_fTurnMass * CTimer::GetTimeStep(), GetRight()); + + CVector vecResistance; + if (GetModelIndex() == MI_MIAMI_SPARROW) + vecResistance = vecHeliResistance; + else + vecResistance = vecRCHeliResistance; + float rX = Pow(vecResistance.x, CTimer::GetTimeStep()); + float rY = Pow(vecResistance.y, CTimer::GetTimeStep()); + float rZ = Pow(vecResistance.z, CTimer::GetTimeStep()); + CVector vecTurnSpeed = Multiply3x3(m_vecTurnSpeed, GetMatrix()); + float fResistanceMultiplier = Pow(1.0f / (fSpinSpeedRes * SQR(vecTurnSpeed.z) + 1.0f), CTimer::GetTimeStep()); + float fResistance = vecTurnSpeed.z * fResistanceMultiplier - vecTurnSpeed.z; + vecTurnSpeed.x *= rX; + vecTurnSpeed.y *= rY; + vecTurnSpeed.z *= rZ; + m_vecTurnSpeed = Multiply3x3(GetMatrix(), vecTurnSpeed); + ApplyTurnForce(-GetRight() * fResistance * m_fTurnMass, GetForward() + Multiply3x3(GetMatrix(), m_vecCentreOfMass)); + break; + } } } diff --git a/src/vehicles/Vehicle.h b/src/vehicles/Vehicle.h index 2ae78829..cb4ac2cf 100644 --- a/src/vehicles/Vehicle.h +++ b/src/vehicles/Vehicle.h @@ -280,6 +280,9 @@ public: static bool bCheat3; static bool bCheat4; static bool bCheat5; +#ifdef ALT_DODO_CHEAT + static bool bAltDodoCheat; +#endif static bool m_bDisableMouseSteering; }; @@ -288,19 +291,4 @@ static_assert(offsetof(CVehicle, m_pCurGroundEntity) == 0x1E0, "CVehicle: error" static_assert(offsetof(CVehicle, m_nAlarmState) == 0x1A0, "CVehicle: error"); static_assert(offsetof(CVehicle, m_nLastWeaponDamage) == 0x228, "CVehicle: error"); -class cTransmission; - -class cVehicleParams -{ -public: - bool m_bDistanceCalculated; - float m_fDistance; - CVehicle *m_pVehicle; - cTransmission *m_pTransmission; - int m_nIndex; - float m_fVelocityChange; -}; - -static_assert(sizeof(cVehicleParams) == 0x18, "cVehicleParams: error"); - void DestroyVehicleAndDriverAndPassengers(CVehicle* pVehicle); diff --git a/src/weapons/BulletInfo.cpp b/src/weapons/BulletInfo.cpp index 36c3cc78..7fa32ca7 100644 --- a/src/weapons/BulletInfo.cpp +++ b/src/weapons/BulletInfo.cpp @@ -3,7 +3,7 @@ #include "BulletInfo.h" #include "AnimBlendAssociation.h" -#include "AudioManager.h" +#include "DMAudio.h" #include "AudioScriptObject.h" #ifdef FIX_BUGS #include "Collision.h" diff --git a/src/weapons/WeaponEffects.cpp b/src/weapons/WeaponEffects.cpp index f7e50f78..46195d2c 100644 --- a/src/weapons/WeaponEffects.cpp +++ b/src/weapons/WeaponEffects.cpp @@ -46,6 +46,9 @@ void CWeaponEffects::Shutdown(void) { RwTextureDestroy(gpCrossHairTex); +#ifdef GTA3_1_1_PATCH + gpCrossHairTex = nil; +#endif } void |