1
0
Fork 0
mirror of https://git.rip/DMCA_FUCKER/re3.git synced 2024-12-22 19:30:01 +00:00

Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Roman Masanin 2020-09-28 03:40:58 +03:00
commit 1ea89f5aed
38 changed files with 1236 additions and 973 deletions

2
.gitattributes vendored Normal file
View file

@ -0,0 +1,2 @@
sdk/* linguist-vendored
vendor/* linguist-vendored

View file

@ -14,7 +14,7 @@ such that we have a working game at all times.
## How can I try it?
- re3 requires game assets to work, so you **must** own a copy of GTA III.
- re3 requires game assets to work, so you **must** own [a copy of GTA III](https://store.steampowered.com/app/12100/Grand_Theft_Auto_III/).
- Build re3 or download it from one of the above links (Debug or Release).
- (Optional) If you want to use optional features like Russian language or menu map, copy the files in /gamefiles folder to your game root folder.
- Move re3.exe to GTA 3 directory and run it.

View file

@ -1,328 +1,331 @@
newoption {
trigger = "glewdir",
value = "PATH",
description = "Directory of GLEW",
default = "vendor/glew-2.1.0"
}
newoption {
trigger = "glfwdir64",
value = "PATH",
description = "Directory of glfw",
default = "vendor/glfw-3.3.2.bin.WIN64",
}
newoption {
trigger = "glfwdir32",
value = "PATH",
description = "Directory of glfw",
default = "vendor/glfw-3.3.2.bin.WIN32",
}
newoption {
trigger = "with-librw",
description = "Build and use librw from this solution"
}
newoption {
trigger = "with-opus",
description = "Build with opus"
}
if(_OPTIONS["with-librw"]) then
Librw = "vendor/librw"
else
Librw = os.getenv("LIBRW") or "vendor/librw"
end
function getsys(a)
if a == 'windows' then
return 'win'
end
return a
end
function getarch(a)
if a == 'x86_64' then
return 'amd64'
elseif a == 'ARM' then
return 'arm'
end
return a
end
workspace "re3"
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",
"win-x86-RW33_d3d8-oal",
"win-x86-librw_d3d9-oal",
"win-x86-librw_gl3_glfw-oal",
"win-amd64-librw_d3d9-oal",
"win-amd64-librw_gl3_glfw-oal",
}
filter { "system:linux" }
platforms {
"linux-x86-librw_gl3_glfw-oal",
"linux-amd64-librw_gl3_glfw-oal",
"linux-arm-librw_gl3_glfw-oal",
}
filter { "system:bsd" }
platforms {
"bsd-amd64-librw_gl3_glfw-oal"
}
filter "configurations:Debug"
defines { "DEBUG" }
filter "configurations:Release"
defines { "NDEBUG" }
optimize "On"
filter { "platforms:win*" }
system "windows"
filter { "platforms:linux*" }
system "linux"
filter { "platforms:bsd*" }
system "bsd"
filter { "platforms:*x86*" }
architecture "x86"
filter { "platforms:*amd64*" }
architecture "amd64"
filter { "platforms:*arm*" }
architecture "ARM"
filter { "platforms:*librw_d3d9*" }
defines { "RW_D3D9" }
if(not _OPTIONS["with-librw"]) then
libdirs { path.join(Librw, "lib/win-%{getarch(cfg.architecture)}-d3d9/%{cfg.buildcfg}") }
end
filter "platforms:*librw_gl3_glfw*"
defines { "RW_GL3" }
includedirs { path.join(_OPTIONS["glewdir"], "include") }
if(not _OPTIONS["with-librw"]) then
libdirs { path.join(Librw, "lib/%{getsys(cfg.system)}-%{getarch(cfg.architecture)}-gl3/%{cfg.buildcfg}") }
end
filter "platforms:*x86-librw_gl3_glfw*"
includedirs { path.join(_OPTIONS["glfwdir32"], "include") }
filter "platforms:*amd64-librw_gl3_glfw*"
includedirs { path.join(_OPTIONS["glfwdir64"], "include") }
filter "platforms:win*librw_gl3_glfw*"
defines { "GLEW_STATIC" }
filter {}
function setpaths (gamepath, exepath, scriptspath)
scriptspath = scriptspath or ""
if (gamepath) then
postbuildcommands {
'{COPY} "%{cfg.buildtarget.abspath}" "' .. gamepath .. scriptspath .. '%{cfg.buildtarget.name}"'
}
debugdir (gamepath)
if (exepath) then
-- Used VS variable $(TargetFileName) because it doesn't accept premake tokens. Does debugcommand even work outside VS??
debugcommand (gamepath .. "$(TargetFileName)")
dir, file = exepath:match'(.*/)(.*)'
debugdir (gamepath .. (dir or ""))
end
end
--targetdir ("bin/%{prj.name}/" .. scriptspath)
end
if(_OPTIONS["with-librw"]) then
project "librw"
kind "StaticLib"
targetname "rw"
targetdir(path.join(Librw, "lib/%{cfg.platform}/%{cfg.buildcfg}"))
files { path.join(Librw, "src/*.*") }
files { path.join(Librw, "src/*/*.*") }
filter "platforms:bsd*"
includedirs { "/usr/local/include" }
libdirs { "/usr/local/lib" }
filter "platforms:*RW33*"
flags { "ExcludeFromBuild" }
filter {}
end
local function addSrcFiles( prefix )
return prefix .. "/*cpp", prefix .. "/*.h", prefix .. "/*.c", prefix .. "/*.ico", prefix .. "/*.rc"
end
project "re3"
kind "WindowedApp"
targetname "re3"
targetdir "bin/%{cfg.platform}/%{cfg.buildcfg}"
files { addSrcFiles("src") }
files { addSrcFiles("src/animation") }
newoption {
trigger = "glewdir",
value = "PATH",
description = "Directory of GLEW",
default = "vendor/glew-2.1.0"
}
newoption {
trigger = "glfwdir64",
value = "PATH",
description = "Directory of glfw",
default = "vendor/glfw-3.3.2.bin.WIN64",
}
newoption {
trigger = "glfwdir32",
value = "PATH",
description = "Directory of glfw",
default = "vendor/glfw-3.3.2.bin.WIN32",
}
newoption {
trigger = "with-librw",
description = "Build and use librw from this solution"
}
newoption {
trigger = "with-opus",
description = "Build with opus"
}
if(_OPTIONS["with-librw"]) then
Librw = "vendor/librw"
else
Librw = os.getenv("LIBRW") or "vendor/librw"
end
function getsys(a)
if a == 'windows' then
return 'win'
end
return a
end
function getarch(a)
if a == 'x86_64' then
return 'amd64'
elseif a == 'ARM' then
return 'arm'
elseif a == 'ARM64' then
return 'arm64'
end
return a
end
workspace "re3"
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",
"win-x86-RW33_d3d8-oal",
"win-x86-librw_d3d9-oal",
"win-x86-librw_gl3_glfw-oal",
"win-amd64-librw_d3d9-oal",
"win-amd64-librw_gl3_glfw-oal",
}
filter { "system:linux" }
platforms {
"linux-x86-librw_gl3_glfw-oal",
"linux-amd64-librw_gl3_glfw-oal",
"linux-arm-librw_gl3_glfw-oal",
"linux-arm64-librw_gl3_glfw-oal",
}
filter { "system:bsd" }
platforms {
"bsd-amd64-librw_gl3_glfw-oal"
}
filter "configurations:Debug"
defines { "DEBUG" }
filter "configurations:Release"
defines { "NDEBUG" }
optimize "On"
filter { "platforms:win*" }
system "windows"
filter { "platforms:linux*" }
system "linux"
filter { "platforms:bsd*" }
system "bsd"
filter { "platforms:*x86*" }
architecture "x86"
filter { "platforms:*amd64*" }
architecture "amd64"
filter { "platforms:*arm*" }
architecture "ARM"
filter { "platforms:*librw_d3d9*" }
defines { "RW_D3D9" }
if(not _OPTIONS["with-librw"]) then
libdirs { path.join(Librw, "lib/win-%{getarch(cfg.architecture)}-d3d9/%{cfg.buildcfg}") }
end
filter "platforms:*librw_gl3_glfw*"
defines { "RW_GL3" }
includedirs { path.join(_OPTIONS["glewdir"], "include") }
if(not _OPTIONS["with-librw"]) then
libdirs { path.join(Librw, "lib/%{getsys(cfg.system)}-%{getarch(cfg.architecture)}-gl3/%{cfg.buildcfg}") }
end
filter "platforms:*x86-librw_gl3_glfw*"
includedirs { path.join(_OPTIONS["glfwdir32"], "include") }
filter "platforms:*amd64-librw_gl3_glfw*"
includedirs { path.join(_OPTIONS["glfwdir64"], "include") }
filter "platforms:win*librw_gl3_glfw*"
defines { "GLEW_STATIC" }
filter {}
function setpaths (gamepath, exepath, scriptspath)
scriptspath = scriptspath or ""
if (gamepath) then
postbuildcommands {
'{COPY} "%{cfg.buildtarget.abspath}" "' .. gamepath .. scriptspath .. '%{cfg.buildtarget.name}"'
}
debugdir (gamepath)
if (exepath) then
-- Used VS variable $(TargetFileName) because it doesn't accept premake tokens. Does debugcommand even work outside VS??
debugcommand (gamepath .. "$(TargetFileName)")
dir, file = exepath:match'(.*/)(.*)'
debugdir (gamepath .. (dir or ""))
end
end
--targetdir ("bin/%{prj.name}/" .. scriptspath)
end
if(_OPTIONS["with-librw"]) then
project "librw"
kind "StaticLib"
targetname "rw"
targetdir(path.join(Librw, "lib/%{cfg.platform}/%{cfg.buildcfg}"))
files { path.join(Librw, "src/*.*") }
files { path.join(Librw, "src/*/*.*") }
filter "platforms:bsd*"
includedirs { "/usr/local/include" }
libdirs { "/usr/local/lib" }
filter "platforms:*RW33*"
flags { "ExcludeFromBuild" }
filter {}
end
local function addSrcFiles( prefix )
return prefix .. "/*cpp", prefix .. "/*.h", prefix .. "/*.c", prefix .. "/*.ico", prefix .. "/*.rc"
end
project "re3"
kind "WindowedApp"
targetname "re3"
targetdir "bin/%{cfg.platform}/%{cfg.buildcfg}"
files { addSrcFiles("src") }
files { addSrcFiles("src/animation") }
files { addSrcFiles("src/audio") }
files { addSrcFiles("src/audio/eax") }
files { addSrcFiles("src/audio/oal") }
files { addSrcFiles("src/control") }
files { addSrcFiles("src/core") }
files { addSrcFiles("src/entities") }
files { addSrcFiles("src/math") }
files { addSrcFiles("src/modelinfo") }
files { addSrcFiles("src/objects") }
files { addSrcFiles("src/peds") }
files { addSrcFiles("src/render") }
files { addSrcFiles("src/rw") }
files { addSrcFiles("src/save") }
files { addSrcFiles("src/skel") }
files { addSrcFiles("src/skel/glfw") }
files { addSrcFiles("src/text") }
files { addSrcFiles("src/vehicles") }
files { addSrcFiles("src/weapons") }
files { addSrcFiles("src/extras") }
includedirs { "src" }
includedirs { "src/animation" }
files { addSrcFiles("src/audio/eax") }
files { addSrcFiles("src/audio/oal") }
files { addSrcFiles("src/control") }
files { addSrcFiles("src/core") }
files { addSrcFiles("src/entities") }
files { addSrcFiles("src/math") }
files { addSrcFiles("src/modelinfo") }
files { addSrcFiles("src/objects") }
files { addSrcFiles("src/peds") }
files { addSrcFiles("src/render") }
files { addSrcFiles("src/rw") }
files { addSrcFiles("src/save") }
files { addSrcFiles("src/skel") }
files { addSrcFiles("src/skel/glfw") }
files { addSrcFiles("src/text") }
files { addSrcFiles("src/vehicles") }
files { addSrcFiles("src/weapons") }
files { addSrcFiles("src/extras") }
includedirs { "src" }
includedirs { "src/animation" }
includedirs { "src/audio" }
includedirs { "src/audio/eax" }
includedirs { "src/audio/oal" }
includedirs { "src/control" }
includedirs { "src/core" }
includedirs { "src/entities" }
includedirs { "src/math" }
includedirs { "src/modelinfo" }
includedirs { "src/objects" }
includedirs { "src/peds" }
includedirs { "src/render" }
includedirs { "src/rw" }
includedirs { "src/save/" }
includedirs { "src/skel/" }
includedirs { "src/skel/glfw" }
includedirs { "src/text" }
includedirs { "src/vehicles" }
includedirs { "src/weapons" }
includedirs { "src/extras" }
if _OPTIONS["with-opus"] then
includedirs { "vendor/ogg/include" }
includedirs { "vendor/opus/include" }
includedirs { "vendor/opusfile/include" }
end
filter "platforms:*mss"
defines { "AUDIO_MSS" }
includedirs { "sdk/milessdk/include" }
libdirs { "sdk/milessdk/lib" }
if _OPTIONS["with-opus"] then
filter "platforms:win*"
libdirs { "vendor/ogg/win32/VS2015/Win32/%{cfg.buildcfg}" }
libdirs { "vendor/opus/win32/VS2015/Win32/%{cfg.buildcfg}" }
libdirs { "vendor/opusfile/win32/VS2015/Win32/Release-NoHTTP" }
filter {}
defines { "AUDIO_OPUS" }
end
filter "platforms:*oal"
defines { "AUDIO_OAL" }
filter {}
if(os.getenv("GTA_III_RE_DIR")) then
setpaths("$(GTA_III_RE_DIR)/", "%(cfg.buildtarget.name)", "")
end
filter "platforms:win*"
files { addSrcFiles("src/skel/win") }
includedirs { "src/skel/win" }
linkoptions "/SAFESEH:NO"
characterset ("MBCS")
targetextension ".exe"
filter "platforms:win*oal"
includedirs { "vendor/openal-soft/include" }
includedirs { "vendor/libsndfile/include" }
includedirs { "vendor/mpg123/include" }
filter "platforms:win-x86*oal"
libdirs { "vendor/mpg123/lib/Win32" }
libdirs { "vendor/libsndfile/lib/Win32" }
libdirs { "vendor/openal-soft/libs/Win32" }
filter "platforms:win-amd64*oal"
libdirs { "vendor/mpg123/lib/Win64" }
libdirs { "vendor/libsndfile/lib/Win64" }
libdirs { "vendor/openal-soft/libs/Win64" }
filter "platforms:linux*oal"
links { "openal", "mpg123", "sndfile", "pthread" }
filter "platforms:bsd*oal"
links { "openal", "mpg123", "sndfile", "pthread" }
if _OPTIONS["with-opus"] then
filter {}
links { "libogg" }
links { "opus" }
links { "opusfile" }
end
filter "platforms:*RW33*"
staticruntime "on"
includedirs { "sdk/rwsdk/include/d3d8" }
libdirs { "sdk/rwsdk/lib/d3d8/release" }
links { "rwcore", "rpworld", "rpmatfx", "rpskin", "rphanim", "rtbmp", "rtquat", "rtcharse" }
defines { "RWLIBS" }
linkoptions "/SECTION:_rwcseg,ER!W /MERGE:_rwcseg=.text"
filter "platforms:*librw*"
defines { "LIBRW" }
files { addSrcFiles("src/fakerw") }
includedirs { "src/fakerw" }
includedirs { Librw }
if(_OPTIONS["with-librw"]) then
libdirs { "vendor/librw/lib/%{cfg.platform}/%{cfg.buildcfg}" }
end
links { "rw" }
filter "platforms:*d3d9*"
links { "d3d9" }
filter "platforms:*x86*d3d*"
includedirs { "sdk/dx8sdk/include" }
libdirs { "sdk/dx8sdk/lib" }
filter "platforms:*amd64*d3d9*"
defines { "USE_D3D9" }
filter "platforms:win-x86*gl3_glfw*"
libdirs { path.join(_OPTIONS["glewdir"], "lib/Release/Win32") }
libdirs { path.join(_OPTIONS["glfwdir32"], "lib-" .. string.gsub(_ACTION or '', "vs", "vc")) }
links { "opengl32", "glew32s", "glfw3" }
filter "platforms:win-amd64*gl3_glfw*"
libdirs { path.join(_OPTIONS["glewdir"], "lib/Release/x64") }
libdirs { path.join(_OPTIONS["glfwdir64"], "lib-" .. string.gsub(_ACTION or '', "vs", "vc")) }
links { "opengl32", "glew32s", "glfw3" }
filter "platforms:linux*gl3_glfw*"
links { "GL", "GLEW", "glfw" }
filter "platforms:bsd*gl3_glfw*"
links { "GL", "GLEW", "glfw", "sysinfo" }
includedirs { "/usr/local/include" }
libdirs { "/usr/local/lib" }
includedirs { "src/audio/eax" }
includedirs { "src/audio/oal" }
includedirs { "src/control" }
includedirs { "src/core" }
includedirs { "src/entities" }
includedirs { "src/math" }
includedirs { "src/modelinfo" }
includedirs { "src/objects" }
includedirs { "src/peds" }
includedirs { "src/render" }
includedirs { "src/rw" }
includedirs { "src/save/" }
includedirs { "src/skel/" }
includedirs { "src/skel/glfw" }
includedirs { "src/text" }
includedirs { "src/vehicles" }
includedirs { "src/weapons" }
includedirs { "src/extras" }
if _OPTIONS["with-opus"] then
includedirs { "vendor/ogg/include" }
includedirs { "vendor/opus/include" }
includedirs { "vendor/opusfile/include" }
end
filter "platforms:*mss"
defines { "AUDIO_MSS" }
includedirs { "sdk/milessdk/include" }
libdirs { "sdk/milessdk/lib" }
if _OPTIONS["with-opus"] then
filter "platforms:win*"
libdirs { "vendor/ogg/win32/VS2015/Win32/%{cfg.buildcfg}" }
libdirs { "vendor/opus/win32/VS2015/Win32/%{cfg.buildcfg}" }
libdirs { "vendor/opusfile/win32/VS2015/Win32/Release-NoHTTP" }
filter {}
defines { "AUDIO_OPUS" }
end
filter "platforms:*oal"
defines { "AUDIO_OAL" }
filter {}
if(os.getenv("GTA_III_RE_DIR")) then
setpaths("$(GTA_III_RE_DIR)/", "%(cfg.buildtarget.name)", "")
end
filter "platforms:win*"
files { addSrcFiles("src/skel/win") }
includedirs { "src/skel/win" }
linkoptions "/SAFESEH:NO"
characterset ("MBCS")
targetextension ".exe"
filter "platforms:win*oal"
includedirs { "vendor/openal-soft/include" }
includedirs { "vendor/libsndfile/include" }
includedirs { "vendor/mpg123/include" }
filter "platforms:win-x86*oal"
libdirs { "vendor/mpg123/lib/Win32" }
libdirs { "vendor/libsndfile/lib/Win32" }
libdirs { "vendor/openal-soft/libs/Win32" }
filter "platforms:win-amd64*oal"
libdirs { "vendor/mpg123/lib/Win64" }
libdirs { "vendor/libsndfile/lib/Win64" }
libdirs { "vendor/openal-soft/libs/Win64" }
filter "platforms:linux*oal"
links { "openal", "mpg123", "sndfile", "pthread" }
filter "platforms:bsd*oal"
links { "openal", "mpg123", "sndfile", "pthread" }
if _OPTIONS["with-opus"] then
filter {}
links { "libogg" }
links { "opus" }
links { "opusfile" }
end
filter "platforms:*RW33*"
staticruntime "on"
includedirs { "sdk/rwsdk/include/d3d8" }
libdirs { "sdk/rwsdk/lib/d3d8/release" }
links { "rwcore", "rpworld", "rpmatfx", "rpskin", "rphanim", "rtbmp", "rtquat", "rtcharse" }
defines { "RWLIBS" }
linkoptions "/SECTION:_rwcseg,ER!W /MERGE:_rwcseg=.text"
filter "platforms:*librw*"
defines { "LIBRW" }
files { addSrcFiles("src/fakerw") }
includedirs { "src/fakerw" }
includedirs { Librw }
if(_OPTIONS["with-librw"]) then
libdirs { "vendor/librw/lib/%{cfg.platform}/%{cfg.buildcfg}" }
end
links { "rw" }
filter "platforms:*d3d9*"
links { "d3d9" }
filter "platforms:*x86*d3d*"
includedirs { "sdk/dx8sdk/include" }
libdirs { "sdk/dx8sdk/lib" }
filter "platforms:*amd64*d3d9*"
defines { "USE_D3D9" }
filter "platforms:win-x86*gl3_glfw*"
libdirs { path.join(_OPTIONS["glewdir"], "lib/Release/Win32") }
libdirs { path.join(_OPTIONS["glfwdir32"], "lib-" .. string.gsub(_ACTION or '', "vs", "vc")) }
links { "opengl32", "glew32s", "glfw3" }
filter "platforms:win-amd64*gl3_glfw*"
libdirs { path.join(_OPTIONS["glewdir"], "lib/Release/x64") }
libdirs { path.join(_OPTIONS["glfwdir64"], "lib-" .. string.gsub(_ACTION or '', "vs", "vc")) }
links { "opengl32", "glew32s", "glfw3" }
filter "platforms:linux*gl3_glfw*"
links { "GL", "GLEW", "glfw" }
filter "platforms:bsd*gl3_glfw*"
links { "GL", "GLEW", "glfw", "sysinfo" }
includedirs { "/usr/local/include" }
libdirs { "/usr/local/lib" }

View file

@ -165,7 +165,7 @@ cAudioManager::SetUpLoopingCollisionSound(const cAudioCollision &col, uint8 coun
if(m_sQueueSample.m_nVolume) {
m_sQueueSample.m_nCounter = counter;
m_sQueueSample.m_vecPos = col.m_vecPosition;
m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN;
m_sQueueSample.m_nBankIndex = SFX_BANK_0;
m_sQueueSample.m_bIs2D = false;
m_sQueueSample.m_nReleasingVolumeModificator = 7;
m_sQueueSample.m_nLoopCount = 0;
@ -306,7 +306,7 @@ cAudioManager::SetUpOneShotCollisionSound(const cAudioCollision &col)
m_sQueueSample.m_nCounter = counter++;
if(counter >= 255) counter = 28;
m_sQueueSample.m_vecPos = col.m_vecPosition;
m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN;
m_sQueueSample.m_nBankIndex = SFX_BANK_0;
m_sQueueSample.m_bIs2D = false;
m_sQueueSample.m_nReleasingVolumeModificator = 11;
m_sQueueSample.m_nLoopCount = 1;

File diff suppressed because it is too large Load diff

View file

@ -86,7 +86,7 @@ cAudioManager::Terminate()
m_sAudioScriptObjectManager.m_nScriptObjectEntityTotal = 0;
PreTerminateGameSpecificShutdown();
for (uint32 i = 0; i < MAX_SAMPLEBANKS; i++) {
for (uint32 i = 0; i < MAX_SFX_BANKS; i++) {
if (SampleManager.IsSampleBankLoaded(i))
SampleManager.UnloadSampleBank(i);
}
@ -917,7 +917,7 @@ cAudioManager::ClearActiveSamples()
m_asActiveSamples[i].m_nEntityIndex = AEHANDLE_NONE;
m_asActiveSamples[i].m_nCounter = 0;
m_asActiveSamples[i].m_nSampleIndex = NO_SAMPLE;
m_asActiveSamples[i].m_nBankIndex = SAMPLEBANK_INVALID;
m_asActiveSamples[i].m_nBankIndex = INVALID_SFX_BANK;
m_asActiveSamples[i].m_bIs2D = false;
m_asActiveSamples[i].m_nReleasingVolumeModificator = 5;
m_asActiveSamples[i].m_nFrequency = 0;

View file

@ -213,7 +213,7 @@ public:
float GetReflectionsDistance(int32 idx) const { return m_afReflectionsDistances[idx]; }
int32 GetRandomNumber(int32 idx) const { return m_anRandomTable[idx]; }
int32 GetRandomNumberInRange(int32 idx, int32 low, int32 high) const { return (m_anRandomTable[idx] % (high - low + 1)) + low; }
bool IsMissionAudioSamplePlaying() const { return m_sMissionAudio.m_nPlayStatus == 1; }
bool ShouldDuckMissionAudio() const { return m_sMissionAudio.m_nPlayStatus == 1; }
// "Should" be in alphabetic order, except "getXTalkSfx"
void AddDetailsToRequestedOrderList(uint8 sample);

View file

@ -26,12 +26,12 @@ cMusicManager::cMusicManager()
m_bIsInitialised = false;
m_bDisabled = false;
m_nMusicMode = MUSICMODE_DISABLED;
m_nCurrentStreamedSound = NO_STREAMED_SOUND;
m_nPreviousStreamedSound = NO_STREAMED_SOUND;
m_nCurrentStreamedSound = NO_TRACK;
m_nPreviousStreamedSound = NO_TRACK;
m_bFrontendTrackFinished = false;
m_bPlayInFrontend = false;
m_bSetNextStation = false;
m_nAnnouncement = NO_STREAMED_SOUND;
m_nAnnouncement = NO_TRACK;
m_bPreviousPlayerInCar = false;
m_bPlayerInCar = false;
m_bAnnouncementInProgress = false;
@ -161,7 +161,7 @@ cMusicManager::DisplayRadioStationName()
CFont::SetPropOn();
CFont::SetFontStyle(FONT_HEADING);
CFont::SetCentreOn();
CFont::SetCentreSize(SCREEN_SCALE_X(640.0f));
CFont::SetCentreSize(SCREEN_STRETCH_X(640.0f));
CFont::SetColor(CRGBA(0, 0, 0, 255));
CFont::PrintString(SCREEN_WIDTH / 2 + SCREEN_SCALE_X(2.0f), SCREEN_SCALE_Y(22.0f) + SCREEN_SCALE_Y(2.0f), pCurrentStation);
@ -224,7 +224,7 @@ cMusicManager::Initialise()
m_bRadioSetByScript = false;
m_nRadioStation = HEAD_RADIO;
m_nRadioPosition = -1;
m_nRadioInCar = NO_STREAMED_SOUND;
m_nRadioInCar = NO_TRACK;
gNumRetunePresses = 0;
gRetuneCounter = 0;
m_bIsInitialised = true;
@ -239,8 +239,8 @@ cMusicManager::Terminate()
if (SampleManager.IsStreamPlaying(0)) {
SampleManager.StopStreamedFile(0);
m_nCurrentStreamedSound = NO_STREAMED_SOUND;
m_nPreviousStreamedSound = NO_STREAMED_SOUND;
m_nCurrentStreamedSound = NO_TRACK;
m_nPreviousStreamedSound = NO_TRACK;
}
m_bIsInitialised = false;
}
@ -274,8 +274,8 @@ cMusicManager::ChangeMusicMode(uint8 mode)
}
SampleManager.StopStreamedFile(0);
}
m_nCurrentStreamedSound = NO_STREAMED_SOUND;
m_nPreviousStreamedSound = NO_STREAMED_SOUND;
m_nCurrentStreamedSound = NO_TRACK;
m_nPreviousStreamedSound = NO_TRACK;
m_bFrontendTrackFinished = false;
m_bPlayInFrontend = false;
m_bSetNextStation = false;
@ -301,14 +301,14 @@ cMusicManager::GetRadioInCar(void)
CVehicle *veh = FindPlayerVehicle();
if (veh != nil){
if (UsesPoliceRadio(veh)) {
if (m_nRadioInCar == NO_STREAMED_SOUND || (CReplay::IsPlayingBack() && AudioManager.m_nUserPause == 0))
if (m_nRadioInCar == NO_TRACK || (CReplay::IsPlayingBack() && AudioManager.m_nUserPause == 0))
return POLICE_RADIO;
return m_nRadioInCar;
} else return veh->m_nRadioStation;
}
}
if (m_nRadioInCar == NO_STREAMED_SOUND || (CReplay::IsPlayingBack() && AudioManager.m_nUserPause == 0))
if (m_nRadioInCar == NO_TRACK || (CReplay::IsPlayingBack() && AudioManager.m_nUserPause == 0))
return RADIO_OFF;
return m_nRadioInCar;
}
@ -347,7 +347,7 @@ cMusicManager::ResetMusicAfterReload()
m_bRadioSetByScript = false;
m_nRadioStation = 0;
m_nRadioPosition = -1;
m_nAnnouncement = NO_STREAMED_SOUND;
m_nAnnouncement = NO_TRACK;
m_bAnnouncementInProgress = false;
m_bSetNextStation = false;
gRetuneCounter = 0;
@ -384,7 +384,7 @@ cMusicManager::Service()
m_nLastTrackServiceTime = m_nTimer;
} else m_bDoTrackService = false;
if (m_nCurrentStreamedSound == NO_STREAMED_SOUND && SampleManager.IsStreamPlaying(0))
if (m_nCurrentStreamedSound == NO_TRACK && SampleManager.IsStreamPlaying(0))
SampleManager.StopStreamedFile(0);
else switch (m_nMusicMode) {
case MUSICMODE_FRONTEND: ServiceFrontEndMode(); break;
@ -410,8 +410,8 @@ cMusicManager::ServiceFrontEndMode()
default:
break;
}
m_nCurrentStreamedSound = NO_STREAMED_SOUND;
m_nPreviousStreamedSound = NO_STREAMED_SOUND;
m_nCurrentStreamedSound = NO_TRACK;
m_nPreviousStreamedSound = NO_TRACK;
}
} else if (bHasStarted) {
if (!SampleManager.IsStreamPlaying(0))
@ -434,6 +434,7 @@ cMusicManager::ServiceGameMode()
{
bool bRadioOff = false;
static int8 nFramesSinceCutsceneEnded = -1;
uint8 volume;
m_bPreviousPlayerInCar = m_bPlayerInCar;
m_bPlayerInCar = PlayerInCar();
@ -516,29 +517,29 @@ cMusicManager::ServiceGameMode()
m_bPlayerInCar = false;
if (FindPlayerVehicle())
FindPlayerVehicle()->m_nRadioStation = m_nCurrentStreamedSound;
m_nCurrentStreamedSound = NO_STREAMED_SOUND;
m_nCurrentStreamedSound = NO_TRACK;
}
if (CTimer::GetIsSlowMotionActive()) {
if (TheCamera.pTargetEntity != nil) {
float dist = (TheCamera.pTargetEntity->GetPosition() - TheCamera.GetPosition()).MagnitudeSqr();
if (dist >= 3025.0f) {
float DistToTargetSq = (TheCamera.pTargetEntity->GetPosition() - TheCamera.GetPosition()).MagnitudeSqr();
if (DistToTargetSq >= SQR(55.0f)) {
SampleManager.SetStreamedVolumeAndPan(0, 63, 0, 0);
} else if (dist >= 100.0f) {
int8 volume = ((45.0f - (Sqrt(dist) - 10.0f)) / 45.0f * 100.0f);
int8 pan;
if (AudioManager.IsMissionAudioSamplePlaying())
} else if (DistToTargetSq >= SQR(10.0f)) {
volume = ((45.0f - (Sqrt(DistToTargetSq) - 10.0f)) / 45.0f * 100.0f);
uint8 pan;
if (AudioManager.ShouldDuckMissionAudio())
volume /= 4;
if (volume != 0) {
CVector trVec;
AudioManager.TranslateEntity(&TheCamera.pTargetEntity->GetPosition(), &trVec);
pan = AudioManager.ComputePan(55.0f, &trVec);
if (volume > 0) {
CVector panVec;
AudioManager.TranslateEntity(&TheCamera.pTargetEntity->GetPosition(), &panVec);
pan = AudioManager.ComputePan(55.0f, &panVec);
} else {
pan = 0;
}
if (gRetuneCounter)
volume /= 4;
SampleManager.SetStreamedVolumeAndPan(volume, pan, 0, 0);
} else if (AudioManager.IsMissionAudioSamplePlaying()) {
} else if (AudioManager.ShouldDuckMissionAudio()) {
SampleManager.SetStreamedVolumeAndPan(25, 63, 0, 0);
} else if (gRetuneCounter) {
SampleManager.SetStreamedVolumeAndPan(25, 63, 0, 0);
@ -546,26 +547,24 @@ cMusicManager::ServiceGameMode()
SampleManager.SetStreamedVolumeAndPan(100, 63, 0, 0);
}
}
} else if (AudioManager.IsMissionAudioSamplePlaying()) {
} else if (AudioManager.ShouldDuckMissionAudio()) {
SampleManager.SetStreamedVolumeAndPan(25, 63, 0, 0);
nFramesSinceCutsceneEnded = 0;
} else {
int8 volume;
if (nFramesSinceCutsceneEnded == -1) {
volume = 100;
} else if (nFramesSinceCutsceneEnded >= 20) {
if (nFramesSinceCutsceneEnded >= 40) {
nFramesSinceCutsceneEnded = -1;
volume = 100;
} else {
volume = 3 * (nFramesSinceCutsceneEnded - 20) + 25;
nFramesSinceCutsceneEnded++;
}
} else {
} else if (nFramesSinceCutsceneEnded < 20) {
nFramesSinceCutsceneEnded++;
volume = 25;
} else if (nFramesSinceCutsceneEnded < 40) {
volume = 3 * (nFramesSinceCutsceneEnded - 20) + 25;
nFramesSinceCutsceneEnded++;
} else {
nFramesSinceCutsceneEnded = -1;
volume = 100;
}
if (gRetuneCounter) volume /= 4;
if (gRetuneCounter != 0)
volume /= 4;
SampleManager.SetStreamedVolumeAndPan(volume, 63, 0, 0);
}
return;
@ -585,7 +584,7 @@ cMusicManager::ServiceGameMode()
} else {
m_nCurrentStreamedSound = m_nRadioStation;
if (FindPlayerVehicle()->m_nRadioStation == m_nCurrentStreamedSound) {
m_nPreviousStreamedSound = NO_STREAMED_SOUND;
m_nPreviousStreamedSound = NO_TRACK;
SampleManager.SetStreamedVolumeAndPan(0, 63, 0, 0);
SampleManager.StopStreamedFile(0);
}
@ -608,19 +607,19 @@ cMusicManager::ServiceGameMode()
}
} else {
m_bPlayerInCar = false;
m_nCurrentStreamedSound = NO_STREAMED_SOUND;
m_nCurrentStreamedSound = NO_TRACK;
}
}
void
cMusicManager::StopFrontEndTrack()
{
if (IsInitialised() && !m_bDisabled && m_nMusicMode == MUSICMODE_FRONTEND && m_nCurrentStreamedSound != NO_STREAMED_SOUND) {
if (IsInitialised() && !m_bDisabled && m_nMusicMode == MUSICMODE_FRONTEND && m_nCurrentStreamedSound != NO_TRACK) {
m_aTracks[m_nCurrentStreamedSound].m_nPosition = SampleManager.GetStreamedFilePosition(0);
m_aTracks[m_nCurrentStreamedSound].m_nLastPosCheckTimer = CTimer::GetTimeInMillisecondsPauseMode();
SampleManager.StopStreamedFile(0);
m_nPreviousStreamedSound = NO_STREAMED_SOUND;
m_nCurrentStreamedSound = NO_STREAMED_SOUND;
m_nPreviousStreamedSound = NO_TRACK;
m_nCurrentStreamedSound = NO_TRACK;
}
}
@ -636,9 +635,9 @@ cMusicManager::PlayFrontEndTrack(uint8 track, uint8 bPlayInFrontend)
{
if (IsInitialised() && !m_bDisabled && track < TOTAL_STREAMED_SOUNDS) {
if (m_nMusicMode == MUSICMODE_GAME) {
if (m_nCurrentStreamedSound != NO_STREAMED_SOUND) {
if (m_nCurrentStreamedSound != NO_TRACK) {
if (m_bAnnouncementInProgress) {
m_nAnnouncement = NO_STREAMED_SOUND;
m_nAnnouncement = NO_TRACK;
m_bAnnouncementInProgress = false;
}
m_aTracks[m_nCurrentStreamedSound].m_nPosition = SampleManager.GetStreamedFilePosition(0);
@ -646,7 +645,7 @@ cMusicManager::PlayFrontEndTrack(uint8 track, uint8 bPlayInFrontend)
}
SampleManager.StopStreamedFile(0);
} else if (m_nMusicMode == MUSICMODE_FRONTEND) {
if (m_nCurrentStreamedSound != NO_STREAMED_SOUND) {
if (m_nCurrentStreamedSound != NO_TRACK) {
m_aTracks[m_nCurrentStreamedSound].m_nPosition = SampleManager.GetStreamedFilePosition(0);
m_aTracks[m_nCurrentStreamedSound].m_nLastPosCheckTimer = CTimer::GetTimeInMillisecondsPauseMode();
}
@ -691,23 +690,22 @@ cMusicManager::StopCutSceneMusic(void)
{
if (IsInitialised() && !m_bDisabled && m_nMusicMode == MUSICMODE_CUTSCENE) {
SampleManager.StopStreamedFile(0);
m_nCurrentStreamedSound = NO_STREAMED_SOUND;
m_nCurrentStreamedSound = NO_TRACK;
}
}
uint32
cMusicManager::GetTrackStartPos(uint8 track)
{
uint32 result;
uint32 timer = m_aTracks[track].m_nLastPosCheckTimer;
if (CTimer::GetTimeInMillisecondsPauseMode() <= timer) {
result = m_aTracks[track].m_nPosition;
uint32 pos = m_aTracks[track].m_nPosition;
if (CTimer::GetTimeInMillisecondsPauseMode() > m_aTracks[track].m_nLastPosCheckTimer)
pos += Min(CTimer::GetTimeInMillisecondsPauseMode() - m_aTracks[track].m_nLastPosCheckTimer, 90000);
else
m_aTracks[track].m_nLastPosCheckTimer = CTimer::GetTimeInMillisecondsPauseMode();
} else
result = Min(CTimer::GetTimeInMillisecondsPauseMode() - timer, 90000) + m_aTracks[track].m_nPosition;
if (result > m_aTracks[track].m_nLength) result %= m_aTracks[track].m_nLength;
return result;
if (pos > m_aTracks[track].m_nLength)
pos %= m_aTracks[track].m_nLength;
return pos;
}
@ -733,7 +731,7 @@ cMusicManager::ServiceAmbience()
uint8 volume;
if (m_bAnnouncementInProgress) {
m_nAnnouncement = NO_STREAMED_SOUND;
m_nAnnouncement = NO_TRACK;
m_bAnnouncementInProgress = false;
}
if (m_nCurrentStreamedSound < STREAMED_SOUND_CITY_AMBIENT) {
@ -741,13 +739,13 @@ cMusicManager::ServiceAmbience()
m_aTracks[m_nCurrentStreamedSound].m_nPosition = SampleManager.GetStreamedFilePosition(0);
m_aTracks[m_nCurrentStreamedSound].m_nLastPosCheckTimer = CTimer::GetTimeInMillisecondsPauseMode();
SampleManager.StopStreamedFile(0);
m_nCurrentStreamedSound = NO_STREAMED_SOUND;
m_nCurrentStreamedSound = NO_TRACK;
return;
}
m_nCurrentStreamedSound = STREAMED_SOUND_CITY_AMBIENT;
}
if (CWorld::Players[CWorld::PlayerInFocus].m_WBState != WBSTATE_PLAYING && !SampleManager.IsStreamPlaying(0)) {
m_nCurrentStreamedSound = NO_STREAMED_SOUND;
m_nCurrentStreamedSound = NO_TRACK;
return;
}
@ -774,7 +772,7 @@ cMusicManager::ServiceAmbience()
SampleManager.SetStreamedVolumeAndPan(volume, 63, 1, 0);
m_bDontServiceAmbienceTrack = true;
} else
m_nCurrentStreamedSound = NO_STREAMED_SOUND;
m_nCurrentStreamedSound = NO_TRACK;
}
}
@ -813,7 +811,7 @@ cMusicManager::ServiceAnnouncement()
static int8 cCheck = 0;
if (m_bAnnouncementInProgress) {
if (!SampleManager.IsStreamPlaying(0)) {
m_nAnnouncement = NO_STREAMED_SOUND;
m_nAnnouncement = NO_TRACK;
m_bAnnouncementInProgress = false;
}
return true;
@ -823,7 +821,7 @@ cMusicManager::ServiceAnnouncement()
cCheck = 0;
int pos = SampleManager.GetStreamedFilePosition(0);
if (SampleManager.IsStreamPlaying(0)) {
if (m_nCurrentStreamedSound != NO_STREAMED_SOUND) {
if (m_nCurrentStreamedSound != NO_TRACK) {
m_aTracks[m_nCurrentStreamedSound].m_nPosition = pos;
m_aTracks[m_nCurrentStreamedSound].m_nLastPosCheckTimer = CTimer::GetTimeInMillisecondsPauseMode();
SampleManager.StopStreamedFile(0);
@ -832,7 +830,7 @@ cMusicManager::ServiceAnnouncement()
SampleManager.SetStreamedVolumeAndPan(0, 63, 0, 0);
if (SampleManager.StartStreamedFile(m_nAnnouncement, 0, 0)) {
SampleManager.SetStreamedVolumeAndPan(AudioManager.IsMissionAudioSamplePlaying() ? 25 : 100, 63, 0, 0);
SampleManager.SetStreamedVolumeAndPan(AudioManager.ShouldDuckMissionAudio() ? 25 : 100, 63, 0, 0);
m_bAnnouncementInProgress = true;
m_nPreviousStreamedSound = m_nCurrentStreamedSound;
m_nCurrentStreamedSound = m_nAnnouncement;
@ -905,7 +903,7 @@ cMusicManager::ChangeRadioChannel()
return false;
if (!SampleManager.StartStreamedFile(m_nCurrentStreamedSound, GetTrackStartPos(m_nCurrentStreamedSound), 0))
return false;
SampleManager.SetStreamedVolumeAndPan(AudioManager.IsMissionAudioSamplePlaying() ? 25 : 100, 63, 0, 0);
SampleManager.SetStreamedVolumeAndPan(AudioManager.ShouldDuckMissionAudio() ? 25 : 100, 63, 0, 0);
}
return true;
}

View file

@ -129,7 +129,7 @@ cAudioManager::DoPoliceRadioCrackle()
m_sQueueSample.m_nEntityIndex = m_nPoliceChannelEntity;
m_sQueueSample.m_nCounter = 0;
m_sQueueSample.m_nSampleIndex = SFX_POLICE_RADIO_CRACKLE;
m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN;
m_sQueueSample.m_nBankIndex = SFX_BANK_0;
m_sQueueSample.m_bIs2D = true;
m_sQueueSample.m_nReleasingVolumeModificator = 10;
m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_POLICE_RADIO_CRACKLE);

View file

@ -224,7 +224,7 @@ enum eStreamedSounds
STREAMED_SOUND_MISSION_K1_B,
STREAMED_SOUND_MISSION_CAT1,
TOTAL_STREAMED_SOUNDS,
NO_STREAMED_SOUND,
NO_TRACK,
};
enum AudioEntityHandle {

View file

@ -16,83 +16,83 @@ struct tSample {
#ifdef GTA_PS2
#define PS2BANK(e) e
#else
#define PS2BANK(e) e = SAMPLEBANK_MAIN
#define PS2BANK(e) e = SFX_BANK_0
#endif // GTA_PS2
enum
{
SAMPLEBANK_MAIN,
SFX_BANK_0,
CAR_SAMPLEBANKS_OFFSET,
SAMPLEBANK_CAR_PACARD = CAR_SAMPLEBANKS_OFFSET,
SAMPLEBANK_CAR_PATHFINDER,
SAMPLEBANK_CAR_PORSCHE,
SAMPLEBANK_CAR_SPIDER,
SAMPLEBANK_CAR_MERC,
SAMPLEBANK_CAR_MACKTRUCK,
SAMPLEBANK_CAR_HOTROD,
SAMPLEBANK_CAR_COBRA,
SAMPLEBANK_CAR_NONE,
CAR_SFX_BANKS_OFFSET,
SFX_BANK_PACARD = CAR_SFX_BANKS_OFFSET,
SFX_BANK_PATHFINDER,
SFX_BANK_PORSCHE,
SFX_BANK_SPIDER,
SFX_BANK_MERC,
SFX_BANK_TRUCK,
SFX_BANK_HOTROD,
SFX_BANK_COBRA,
SFX_BANK_NONE,
PS2BANK(SAMPLEBANK_FRONTEND),
PS2BANK(SFX_BANK_FRONT_END_MENU),
PS2BANK(SAMPLEBANK_TRAIN),
PS2BANK(SFX_BANK_TRAIN),
PS2BANK(SAMPLEBANK_BUILDING_CLUB_1),
PS2BANK(SAMPLEBANK_BUILDING_CLUB_2),
PS2BANK(SAMPLEBANK_BUILDING_CLUB_3),
PS2BANK(SAMPLEBANK_BUILDING_CLUB_4),
PS2BANK(SAMPLEBANK_BUILDING_CLUB_5),
PS2BANK(SAMPLEBANK_BUILDING_CLUB_6),
PS2BANK(SAMPLEBANK_BUILDING_CLUB_7),
PS2BANK(SAMPLEBANK_BUILDING_CLUB_8),
PS2BANK(SAMPLEBANK_BUILDING_CLUB_9),
PS2BANK(SAMPLEBANK_BUILDING_CLUB_10),
PS2BANK(SAMPLEBANK_BUILDING_CLUB_11),
PS2BANK(SAMPLEBANK_BUILDING_CLUB_12),
PS2BANK(SAMPLEBANK_BUILDING_CLUB_RAGGA),
PS2BANK(SAMPLEBANK_BUILDING_STRIP_CLUB_1),
PS2BANK(SAMPLEBANK_BUILDING_STRIP_CLUB_2),
PS2BANK(SAMPLEBANK_BUILDING_WORKSHOP),
PS2BANK(SAMPLEBANK_BUILDING_PIANO_BAR),
PS2BANK(SAMPLEBANK_BUILDING_SAWMILL),
PS2BANK(SAMPLEBANK_BUILDING_DOG_FOOD_FACTORY),
PS2BANK(SAMPLEBANK_BUILDING_LAUNDERETTE),
PS2BANK(SAMPLEBANK_BUILDING_RESTAURANT_CHINATOWN),
PS2BANK(SAMPLEBANK_BUILDING_RESTAURANT_ITALY),
PS2BANK(SAMPLEBANK_BUILDING_RESTAURANT_GENERIC_1),
PS2BANK(SAMPLEBANK_BUILDING_RESTAURANT_GENERIC_2),
PS2BANK(SAMPLEBANK_BUILDING_AIRPORT),
PS2BANK(SAMPLEBANK_BUILDING_SHOP),
PS2BANK(SAMPLEBANK_BUILDING_CINEMA),
PS2BANK(SAMPLEBANK_BUILDING_DOCKS),
PS2BANK(SAMPLEBANK_BUILDING_HOME),
PS2BANK(SAMPLEBANK_BUILDING_PORN_1),
PS2BANK(SAMPLEBANK_BUILDING_PORN_2),
PS2BANK(SAMPLEBANK_BUILDING_PORN_3),
PS2BANK(SAMPLEBANK_BUILDING_POLICE_BALL),
PS2BANK(SAMPLEBANK_BUILDING_BANK_ALARM),
PS2BANK(SAMPLEBANK_BUILDING_RAVE_INDUSTRIAL),
PS2BANK(SAMPLEBANK_BUILDING_RAVE_COMMERCIAL),
PS2BANK(SAMPLEBANK_BUILDING_RAVE_SUBURBAN),
PS2BANK(SAMPLEBANK_BUILDING_RAVE_COMMERCIAL_2),
PS2BANK(SFX_BANK_BUILDING_CLUB_1),
PS2BANK(SFX_BANK_BUILDING_CLUB_2),
PS2BANK(SFX_BANK_BUILDING_CLUB_3),
PS2BANK(SFX_BANK_BUILDING_CLUB_4),
PS2BANK(SFX_BANK_BUILDING_CLUB_5),
PS2BANK(SFX_BANK_BUILDING_CLUB_6),
PS2BANK(SFX_BANK_BUILDING_CLUB_7),
PS2BANK(SFX_BANK_BUILDING_CLUB_8),
PS2BANK(SFX_BANK_BUILDING_CLUB_9),
PS2BANK(SFX_BANK_BUILDING_CLUB_10),
PS2BANK(SFX_BANK_BUILDING_CLUB_11),
PS2BANK(SFX_BANK_BUILDING_CLUB_12),
PS2BANK(SFX_BANK_BUILDING_CLUB_RAGGA),
PS2BANK(SFX_BANK_BUILDING_STRIP_CLUB_1),
PS2BANK(SFX_BANK_BUILDING_STRIP_CLUB_2),
PS2BANK(SFX_BANK_BUILDING_WORKSHOP),
PS2BANK(SFX_BANK_BUILDING_PIANO_BAR),
PS2BANK(SFX_BANK_BUILDING_SAWMILL),
PS2BANK(SFX_BANK_BUILDING_DOG_FOOD_FACTORY),
PS2BANK(SFX_BANK_BUILDING_LAUNDERETTE),
PS2BANK(SFX_BANK_BUILDING_RESTAURANT_CHINATOWN),
PS2BANK(SFX_BANK_BUILDING_RESTAURANT_ITALY),
PS2BANK(SFX_BANK_BUILDING_RESTAURANT_GENERIC_1),
PS2BANK(SFX_BANK_BUILDING_RESTAURANT_GENERIC_2),
PS2BANK(SFX_BANK_BUILDING_AIRPORT),
PS2BANK(SFX_BANK_BUILDING_SHOP),
PS2BANK(SFX_BANK_BUILDING_CINEMA),
PS2BANK(SFX_BANK_BUILDING_DOCKS),
PS2BANK(SFX_BANK_BUILDING_HOME),
PS2BANK(SFX_BANK_BUILDING_PORN_1),
PS2BANK(SFX_BANK_BUILDING_PORN_2),
PS2BANK(SFX_BANK_BUILDING_PORN_3),
PS2BANK(SFX_BANK_BUILDING_POLICE_BALL),
PS2BANK(SFX_BANK_BUILDING_BANK_ALARM),
PS2BANK(SFX_BANK_BUILDING_RAVE_INDUSTRIAL),
PS2BANK(SFX_BANK_BUILDING_RAVE_COMMERCIAL),
PS2BANK(SFX_BANK_BUILDING_RAVE_SUBURBAN),
PS2BANK(SFX_BANK_BUILDING_RAVE_COMMERCIAL_2),
PS2BANK(SAMPLEBANK_BUILDING_39),
PS2BANK(SAMPLEBANK_BUILDING_40),
PS2BANK(SAMPLEBANK_BUILDING_41),
PS2BANK(SAMPLEBANK_BUILDING_42),
PS2BANK(SAMPLEBANK_BUILDING_43),
PS2BANK(SAMPLEBANK_BUILDING_44),
PS2BANK(SAMPLEBANK_BUILDING_45),
PS2BANK(SAMPLEBANK_BUILDING_46),
PS2BANK(SAMPLEBANK_BUILDING_47),
PS2BANK(SFX_BANK_BUILDING_39),
PS2BANK(SFX_BANK_BUILDING_40),
PS2BANK(SFX_BANK_BUILDING_41),
PS2BANK(SFX_BANK_BUILDING_42),
PS2BANK(SFX_BANK_BUILDING_43),
PS2BANK(SFX_BANK_BUILDING_44),
PS2BANK(SFX_BANK_BUILDING_45),
PS2BANK(SFX_BANK_BUILDING_46),
PS2BANK(SFX_BANK_BUILDING_47),
PS2BANK(SAMPLEBANK_EXTRAS),
PS2BANK(SFX_BANK_GENERIC_EXTRA),
SAMPLEBANK_PED,
MAX_SAMPLEBANKS,
SAMPLEBANK_INVALID
SFX_BANK_PED_COMMENTS,
MAX_SFX_BANKS,
INVALID_SFX_BANK
};
#define MAX_PEDSFX 7
@ -216,7 +216,7 @@ public:
};
extern cSampleManager SampleManager;
extern uint32 BankStartOffset[MAX_SAMPLEBANKS];
extern uint32 BankStartOffset[MAX_SFX_BANKS];
#ifdef AUDIO_OPUS
static char StreamedNameTable[][25] = {

View file

@ -21,7 +21,7 @@
#pragma comment( lib, "mss32.lib" )
cSampleManager SampleManager;
uint32 BankStartOffset[MAX_SAMPLEBANKS];
uint32 BankStartOffset[MAX_SFX_BANKS];
///////////////////////////////////////////////////////////////
char SampleBankDescFilename[] = "AUDIO\\SFX.SDT";
@ -29,10 +29,10 @@ char SampleBankDataFilename[] = "AUDIO\\SFX.RAW";
FILE *fpSampleDescHandle;
FILE *fpSampleDataHandle;
bool bSampleBankLoaded [MAX_SAMPLEBANKS];
int32 nSampleBankDiscStartOffset [MAX_SAMPLEBANKS];
int32 nSampleBankSize [MAX_SAMPLEBANKS];
int32 nSampleBankMemoryStartAddress[MAX_SAMPLEBANKS];
bool bSampleBankLoaded [MAX_SFX_BANKS];
int32 nSampleBankDiscStartOffset [MAX_SFX_BANKS];
int32 nSampleBankSize [MAX_SFX_BANKS];
int32 nSampleBankMemoryStartAddress[MAX_SFX_BANKS];
int32 _nSampleDataEndOffset;
int32 nPedSlotSfx [MAX_PEDSFX];
@ -896,7 +896,7 @@ cSampleManager::Initialise(void)
_nSampleDataEndOffset = 0;
for ( int32 i = 0; i < MAX_SAMPLEBANKS; i++ )
for ( int32 i = 0; i < MAX_SFX_BANKS; i++ )
{
bSampleBankLoaded[i] = false;
nSampleBankDiscStartOffset[i] = 0;
@ -948,14 +948,14 @@ cSampleManager::Initialise(void)
return false;
}
nSampleBankMemoryStartAddress[SAMPLEBANK_MAIN] = (int32)AIL_mem_alloc_lock(nSampleBankSize[SAMPLEBANK_MAIN]);
if ( !nSampleBankMemoryStartAddress[SAMPLEBANK_MAIN] )
nSampleBankMemoryStartAddress[SFX_BANK_0] = (int32)AIL_mem_alloc_lock(nSampleBankSize[SFX_BANK_0]);
if ( !nSampleBankMemoryStartAddress[SFX_BANK_0] )
{
Terminate();
return false;
}
nSampleBankMemoryStartAddress[SAMPLEBANK_PED] = (int32)AIL_mem_alloc_lock(PED_BLOCKSIZE*MAX_PEDSFX);
nSampleBankMemoryStartAddress[SFX_BANK_PED_COMMENTS] = (int32)AIL_mem_alloc_lock(PED_BLOCKSIZE*MAX_PEDSFX);
}
@ -1176,7 +1176,7 @@ cSampleManager::Initialise(void)
TRACE("bank");
LoadSampleBank(SAMPLEBANK_MAIN);
LoadSampleBank(SFX_BANK_0);
// mp3
TRACE("mp3");
@ -1271,16 +1271,16 @@ cSampleManager::Terminate(void)
_DeleteMP3Entries();
if ( nSampleBankMemoryStartAddress[SAMPLEBANK_MAIN] != 0 )
if ( nSampleBankMemoryStartAddress[SFX_BANK_0] != 0 )
{
AIL_mem_free_lock((void *)nSampleBankMemoryStartAddress[SAMPLEBANK_MAIN]);
nSampleBankMemoryStartAddress[SAMPLEBANK_MAIN] = 0;
AIL_mem_free_lock((void *)nSampleBankMemoryStartAddress[SFX_BANK_0]);
nSampleBankMemoryStartAddress[SFX_BANK_0] = 0;
}
if ( nSampleBankMemoryStartAddress[SAMPLEBANK_PED] != 0 )
if ( nSampleBankMemoryStartAddress[SFX_BANK_PED_COMMENTS] != 0 )
{
AIL_mem_free_lock((void *)nSampleBankMemoryStartAddress[SAMPLEBANK_PED]);
nSampleBankMemoryStartAddress[SAMPLEBANK_PED] = 0;
AIL_mem_free_lock((void *)nSampleBankMemoryStartAddress[SFX_BANK_PED_COMMENTS]);
nSampleBankMemoryStartAddress[SFX_BANK_PED_COMMENTS] = 0;
}
if ( DIG )
@ -1429,7 +1429,7 @@ cSampleManager::LoadSampleBank(uint8 nBank)
if ( MusicManager.IsInitialised()
&& MusicManager.GetMusicMode() == MUSICMODE_CUTSCENE
&& nBank != SAMPLEBANK_MAIN )
&& nBank != SFX_BANK_0 )
{
return false;
}
@ -1526,10 +1526,10 @@ cSampleManager::LoadPedComment(uint32 nComment)
if ( fseek(fpSampleDataHandle, m_aSamples[nComment].nOffset, SEEK_SET) != 0 )
return false;
if ( fread((void *)(nSampleBankMemoryStartAddress[SAMPLEBANK_PED] + PED_BLOCKSIZE*nCurrentPedSlot), 1, m_aSamples[nComment].nSize, fpSampleDataHandle) != m_aSamples[nComment].nSize )
if ( fread((void *)(nSampleBankMemoryStartAddress[SFX_BANK_PED_COMMENTS] + PED_BLOCKSIZE*nCurrentPedSlot), 1, m_aSamples[nComment].nSize, fpSampleDataHandle) != m_aSamples[nComment].nSize )
return false;
nPedSlotSfxAddr[nCurrentPedSlot] = nSampleBankMemoryStartAddress[SAMPLEBANK_PED] + PED_BLOCKSIZE*nCurrentPedSlot;
nPedSlotSfxAddr[nCurrentPedSlot] = nSampleBankMemoryStartAddress[SFX_BANK_PED_COMMENTS] + PED_BLOCKSIZE*nCurrentPedSlot;
nPedSlotSfx [nCurrentPedSlot] = nComment;
if ( ++nCurrentPedSlot >= MAX_PEDSFX )
@ -1541,13 +1541,13 @@ cSampleManager::LoadPedComment(uint32 nComment)
int32
cSampleManager::GetBankContainingSound(uint32 offset)
{
if ( offset >= BankStartOffset[SAMPLEBANK_PED] )
return SAMPLEBANK_PED;
if ( offset >= BankStartOffset[SFX_BANK_PED_COMMENTS] )
return SFX_BANK_PED_COMMENTS;
if ( offset >= BankStartOffset[SAMPLEBANK_MAIN] )
return SAMPLEBANK_MAIN;
if ( offset >= BankStartOffset[SFX_BANK_0] )
return SFX_BANK_0;
return SAMPLEBANK_INVALID;
return INVALID_SFX_BANK;
}
int32
@ -2289,7 +2289,7 @@ cSampleManager::IsStreamPlaying(uint8 nStream)
bool
cSampleManager::InitialiseSampleBanks(void)
{
int32 nBank = SAMPLEBANK_MAIN;
int32 nBank = SFX_BANK_0;
fpSampleDescHandle = fopen(SampleBankDescFilename, "rb");
if ( fpSampleDescHandle == NULL )
@ -2316,17 +2316,17 @@ cSampleManager::InitialiseSampleBanks(void)
for ( int32 i = 0; i < TOTAL_AUDIO_SAMPLES; i++ )
{
#ifdef FIX_BUGS
if (nBank >= MAX_SAMPLEBANKS) break;
if (nBank >= MAX_SFX_BANKS) break;
#endif
if ( BankStartOffset[nBank] == BankStartOffset[SAMPLEBANK_MAIN] + i )
if ( BankStartOffset[nBank] == BankStartOffset[SFX_BANK_0] + i )
{
nSampleBankDiscStartOffset[nBank] = m_aSamples[i].nOffset;
nBank++;
}
}
nSampleBankSize[SAMPLEBANK_MAIN] = nSampleBankDiscStartOffset[SAMPLEBANK_PED] - nSampleBankDiscStartOffset[SAMPLEBANK_MAIN];
nSampleBankSize[SAMPLEBANK_PED] = _nSampleDataEndOffset - nSampleBankDiscStartOffset[SAMPLEBANK_PED];
nSampleBankSize[SFX_BANK_0] = nSampleBankDiscStartOffset[SFX_BANK_PED_COMMENTS] - nSampleBankDiscStartOffset[SFX_BANK_0];
nSampleBankSize[SFX_BANK_PED_COMMENTS] = _nSampleDataEndOffset - nSampleBankDiscStartOffset[SFX_BANK_PED_COMMENTS];
return true;
}

View file

@ -6,7 +6,7 @@
cSampleManager SampleManager;
bool _bSampmanInitialised = false;
uint32 BankStartOffset[MAX_SAMPLEBANKS];
uint32 BankStartOffset[MAX_SFX_BANKS];
uint32 nNumMP3s;
cSampleManager::cSampleManager(void)
@ -131,20 +131,20 @@ cSampleManager::SetMonoMode(uint8 nMode)
bool
cSampleManager::LoadSampleBank(uint8 nBank)
{
ASSERT( nBank < MAX_SAMPLEBANKS );
ASSERT( nBank < MAX_SFX_BANKS );
return false;
}
void
cSampleManager::UnloadSampleBank(uint8 nBank)
{
ASSERT( nBank < MAX_SAMPLEBANKS );
ASSERT( nBank < MAX_SFX_BANKS );
}
bool
cSampleManager::IsSampleBankLoaded(uint8 nBank)
{
ASSERT( nBank < MAX_SAMPLEBANKS );
ASSERT( nBank < MAX_SFX_BANKS );
return false;
}
@ -174,7 +174,7 @@ cSampleManager::LoadPedComment(uint32 nComment)
int32
cSampleManager::GetBankContainingSound(uint32 offset)
{
return SAMPLEBANK_INVALID;
return INVALID_SFX_BANK;
}
int32

View file

@ -43,7 +43,7 @@
cSampleManager SampleManager;
bool _bSampmanInitialised = false;
uint32 BankStartOffset[MAX_SAMPLEBANKS];
uint32 BankStartOffset[MAX_SFX_BANKS];
int prevprovider=-1;
int curprovider=-1;
@ -77,10 +77,10 @@ OggOpusFile *fpSampleDataHandle;
#else
FILE *fpSampleDataHandle;
#endif
bool bSampleBankLoaded [MAX_SAMPLEBANKS];
int32 nSampleBankDiscStartOffset [MAX_SAMPLEBANKS];
int32 nSampleBankSize [MAX_SAMPLEBANKS];
uintptr nSampleBankMemoryStartAddress[MAX_SAMPLEBANKS];
bool bSampleBankLoaded [MAX_SFX_BANKS];
int32 nSampleBankDiscStartOffset [MAX_SFX_BANKS];
int32 nSampleBankSize [MAX_SFX_BANKS];
uintptr nSampleBankMemoryStartAddress[MAX_SFX_BANKS];
int32 _nSampleDataEndOffset;
int32 nPedSlotSfx [MAX_PEDSFX];
@ -541,7 +541,7 @@ cSampleManager::Initialise(void)
fpSampleDescHandle = NULL;
fpSampleDataHandle = NULL;
for ( int32 i = 0; i < MAX_SAMPLEBANKS; i++ )
for ( int32 i = 0; i < MAX_SFX_BANKS; i++ )
{
bSampleBankLoaded[i] = false;
nSampleBankDiscStartOffset[i] = 0;
@ -586,17 +586,17 @@ cSampleManager::Initialise(void)
return false;
}
nSampleBankMemoryStartAddress[SAMPLEBANK_MAIN] = (uintptr)malloc(nSampleBankSize[SAMPLEBANK_MAIN]);
ASSERT(nSampleBankMemoryStartAddress[SAMPLEBANK_MAIN] != 0);
nSampleBankMemoryStartAddress[SFX_BANK_0] = (uintptr)malloc(nSampleBankSize[SFX_BANK_0]);
ASSERT(nSampleBankMemoryStartAddress[SFX_BANK_0] != 0);
if ( nSampleBankMemoryStartAddress[SAMPLEBANK_MAIN] == 0 )
if ( nSampleBankMemoryStartAddress[SFX_BANK_0] == 0 )
{
Terminate();
return false;
}
nSampleBankMemoryStartAddress[SAMPLEBANK_PED] = (uintptr)malloc(PED_BLOCKSIZE*MAX_PEDSFX);
ASSERT(nSampleBankMemoryStartAddress[SAMPLEBANK_PED] != 0);
nSampleBankMemoryStartAddress[SFX_BANK_PED_COMMENTS] = (uintptr)malloc(PED_BLOCKSIZE*MAX_PEDSFX);
ASSERT(nSampleBankMemoryStartAddress[SFX_BANK_PED_COMMENTS] != 0);
}
@ -644,7 +644,7 @@ cSampleManager::Initialise(void)
#endif
}
LoadSampleBank(SAMPLEBANK_MAIN);
LoadSampleBank(SFX_BANK_0);
return true;
}
@ -666,16 +666,16 @@ cSampleManager::Terminate(void)
CStream::Terminate();
if ( nSampleBankMemoryStartAddress[SAMPLEBANK_MAIN] != 0 )
if ( nSampleBankMemoryStartAddress[SFX_BANK_0] != 0 )
{
free((void *)nSampleBankMemoryStartAddress[SAMPLEBANK_MAIN]);
nSampleBankMemoryStartAddress[SAMPLEBANK_MAIN] = 0;
free((void *)nSampleBankMemoryStartAddress[SFX_BANK_0]);
nSampleBankMemoryStartAddress[SFX_BANK_0] = 0;
}
if ( nSampleBankMemoryStartAddress[SAMPLEBANK_PED] != 0 )
if ( nSampleBankMemoryStartAddress[SFX_BANK_PED_COMMENTS] != 0 )
{
free((void *)nSampleBankMemoryStartAddress[SAMPLEBANK_PED]);
nSampleBankMemoryStartAddress[SAMPLEBANK_PED] = 0;
free((void *)nSampleBankMemoryStartAddress[SFX_BANK_PED_COMMENTS]);
nSampleBankMemoryStartAddress[SFX_BANK_PED_COMMENTS] = 0;
}
_bSampmanInitialised = false;
@ -751,14 +751,14 @@ cSampleManager::SetMonoMode(uint8 nMode)
bool
cSampleManager::LoadSampleBank(uint8 nBank)
{
ASSERT( nBank < MAX_SAMPLEBANKS );
ASSERT( nBank < MAX_SFX_BANKS );
if ( CTimer::GetIsCodePaused() )
return false;
if ( MusicManager.IsInitialised()
&& MusicManager.GetMusicMode() == MUSICMODE_CUTSCENE
&& nBank != SAMPLEBANK_MAIN )
&& nBank != SFX_BANK_0 )
{
return false;
}
@ -792,7 +792,7 @@ cSampleManager::LoadSampleBank(uint8 nBank)
void
cSampleManager::UnloadSampleBank(uint8 nBank)
{
ASSERT( nBank < MAX_SAMPLEBANKS );
ASSERT( nBank < MAX_SFX_BANKS );
bSampleBankLoaded[nBank] = false;
}
@ -800,7 +800,7 @@ cSampleManager::UnloadSampleBank(uint8 nBank)
bool
cSampleManager::IsSampleBankLoaded(uint8 nBank)
{
ASSERT( nBank < MAX_SAMPLEBANKS );
ASSERT( nBank < MAX_SFX_BANKS );
return bSampleBankLoaded[nBank];
}
@ -881,7 +881,7 @@ cSampleManager::LoadPedComment(uint32 nComment)
int samplesSize = m_aSamples[nComment].nSize / 2;
op_pcm_seek(fpSampleDataHandle, m_aSamples[nComment].nOffset / 2);
while (samplesSize > 0) {
int size = op_read(fpSampleDataHandle, (opus_int16 *)(nSampleBankMemoryStartAddress[SAMPLEBANK_PED] + PED_BLOCKSIZE * nCurrentPedSlot + samplesRead),
int size = op_read(fpSampleDataHandle, (opus_int16 *)(nSampleBankMemoryStartAddress[SFX_BANK_PED_COMMENTS] + PED_BLOCKSIZE * nCurrentPedSlot + samplesRead),
samplesSize, NULL);
if (size <= 0) {
return false;
@ -893,7 +893,7 @@ cSampleManager::LoadPedComment(uint32 nComment)
if ( fseek(fpSampleDataHandle, m_aSamples[nComment].nOffset, SEEK_SET) != 0 )
return false;
if ( fread((void *)(nSampleBankMemoryStartAddress[SAMPLEBANK_PED] + PED_BLOCKSIZE*nCurrentPedSlot), 1, m_aSamples[nComment].nSize, fpSampleDataHandle) != m_aSamples[nComment].nSize )
if ( fread((void *)(nSampleBankMemoryStartAddress[SFX_BANK_PED_COMMENTS] + PED_BLOCKSIZE*nCurrentPedSlot), 1, m_aSamples[nComment].nSize, fpSampleDataHandle) != m_aSamples[nComment].nSize )
return false;
#endif
@ -901,7 +901,7 @@ cSampleManager::LoadPedComment(uint32 nComment)
alBufferData(pedBuffers[nCurrentPedSlot],
AL_FORMAT_MONO16,
(void *)(nSampleBankMemoryStartAddress[SAMPLEBANK_PED] + PED_BLOCKSIZE*nCurrentPedSlot),
(void *)(nSampleBankMemoryStartAddress[SFX_BANK_PED_COMMENTS] + PED_BLOCKSIZE*nCurrentPedSlot),
m_aSamples[nComment].nSize,
m_aSamples[nComment].nFrequency);
@ -914,13 +914,13 @@ cSampleManager::LoadPedComment(uint32 nComment)
int32
cSampleManager::GetBankContainingSound(uint32 offset)
{
if ( offset >= BankStartOffset[SAMPLEBANK_PED] )
return SAMPLEBANK_PED;
if ( offset >= BankStartOffset[SFX_BANK_PED_COMMENTS] )
return SFX_BANK_PED_COMMENTS;
if ( offset >= BankStartOffset[SAMPLEBANK_MAIN] )
return SAMPLEBANK_MAIN;
if ( offset >= BankStartOffset[SFX_BANK_0] )
return SFX_BANK_0;
return SAMPLEBANK_INVALID;
return INVALID_SFX_BANK;
}
int32
@ -1421,7 +1421,7 @@ cSampleManager::Service(void)
bool
cSampleManager::InitialiseSampleBanks(void)
{
int32 nBank = SAMPLEBANK_MAIN;
int32 nBank = SFX_BANK_0;
fpSampleDescHandle = fopen(SampleBankDescFilename, "rb");
if ( fpSampleDescHandle == NULL )
@ -1453,17 +1453,17 @@ cSampleManager::InitialiseSampleBanks(void)
for ( int32 i = 0; i < TOTAL_AUDIO_SAMPLES; i++ )
{
#ifdef FIX_BUGS
if (nBank >= MAX_SAMPLEBANKS) break;
if (nBank >= MAX_SFX_BANKS) break;
#endif
if ( BankStartOffset[nBank] == BankStartOffset[SAMPLEBANK_MAIN] + i )
if ( BankStartOffset[nBank] == BankStartOffset[SFX_BANK_0] + i )
{
nSampleBankDiscStartOffset[nBank] = m_aSamples[i].nOffset;
nBank++;
}
}
nSampleBankSize[SAMPLEBANK_MAIN] = nSampleBankDiscStartOffset[SAMPLEBANK_PED] - nSampleBankDiscStartOffset[SAMPLEBANK_MAIN];
nSampleBankSize[SAMPLEBANK_PED] = _nSampleDataEndOffset - nSampleBankDiscStartOffset[SAMPLEBANK_PED];
nSampleBankSize[SFX_BANK_0] = nSampleBankDiscStartOffset[SFX_BANK_PED_COMMENTS] - nSampleBankDiscStartOffset[SFX_BANK_0];
nSampleBankSize[SFX_BANK_PED_COMMENTS] = _nSampleDataEndOffset - nSampleBankDiscStartOffset[SFX_BANK_PED_COMMENTS];
return true;
}

View file

@ -1886,7 +1886,13 @@ CVehicle* CStoredCar::RestoreCar()
#ifdef FIX_BUGS
if (pVehicle->IsCar())
#endif
{
((CAutomobile*)pVehicle)->m_bombType = m_nCarBombType;
#ifdef FIX_BUGS
if (m_nCarBombType != CARBOMB_NONE)
((CAutomobile*)pVehicle)->m_pBombRigger = FindPlayerPed();
#endif
}
pVehicle->bHasBeenOwnedByPlayer = true;
pVehicle->m_nDoorLock = CARLOCK_UNLOCKED;
pVehicle->bBulletProof = m_bBulletproof;

View file

@ -744,7 +744,7 @@ 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) != DOOR_STATUS_MISSING){
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);
}
@ -768,14 +768,14 @@ void CReplay::ProcessCarUpdate(CVehicle *vehicle, float interpolation, CAddressI
car->Damage.SetDoorStatus(DOOR_REAR_RIGHT, DOOR_STATUS_MISSING);
car->SetDoorDamage(CAR_DOOR_RR, DOOR_REAR_RIGHT, true);
}
vehicle->bEngineOn = true;
if (vehicle->IsCar())
((CAutomobile*)vehicle)->m_nDriveWheelsOnGround = 4;
CWorld::Remove(vehicle);
CWorld::Add(vehicle);
if (vehicle->IsBoat())
((CBoat*)vehicle)->m_bIsAnchored = false;
}
vehicle->bEngineOn = true;
if (vehicle->IsCar())
((CAutomobile*)vehicle)->m_nDriveWheelsOnGround = 4;
CWorld::Remove(vehicle);
CWorld::Add(vehicle);
if (vehicle->IsBoat())
((CBoat*)vehicle)->m_bIsAnchored = false;
}
bool CReplay::PlayBackThisFrameInterpolation(CAddressInReplayBuffer *buffer, float interpolation, uint32 *pTimer){

View file

@ -9614,7 +9614,7 @@ int8 CRunningScript::ProcessCommands900To999(int32 command)
CBaseModelInfo* pInfo = CModelInfo::GetModelInfo(model);
script_assert(pInfo->GetModelType() == MITYPE_VEHICLE);
CVehicleModelInfo* pVehicleInfo = (CVehicleModelInfo*)pInfo;
if (pVehicleInfo->m_vehicleType != VEHICLE_TYPE_CAR) {
if (pVehicleInfo->m_vehicleType == VEHICLE_TYPE_CAR) {
switch (model) {
case MI_LANDSTAL:
case MI_LINERUN:

View file

@ -74,7 +74,7 @@ bool bDidWeProcessAnyCinemaCam;
CCamera::CCamera(void)
{
#ifdef GTA3_1_1_PATCH
#if defined(GTA3_1_1_PATCH) || defined(FIX_BUGS)
m_fMouseAccelHorzntl = 0.0025f;
m_fMouseAccelVertical = 0.003f;
#endif
@ -88,7 +88,7 @@ CCamera::CCamera(float)
void
CCamera::Init(void)
{
#ifdef GTA3_1_1_PATCH
#if defined(GTA3_1_1_PATCH) || defined(FIX_BUGS)
float fMouseAccelHorzntl = m_fMouseAccelHorzntl;
float fMouseAccelVertical = m_fMouseAccelVertical;
#endif
@ -104,7 +104,7 @@ CCamera::Init(void)
memset(this, 0, sizeof(CCamera)); // getting rid of vtable, eh?
#endif
#ifdef GTA3_1_1_PATCH
#if defined(GTA3_1_1_PATCH) || defined(FIX_BUGS)
m_fMouseAccelHorzntl = fMouseAccelHorzntl;
m_fMouseAccelVertical = fMouseAccelVertical;
#endif
@ -237,7 +237,7 @@ CCamera::Init(void)
m_uiTransitionState = 0;
m_uiTimeTransitionStart = 0;
m_bLookingAtPlayer = true;
#ifndef GTA3_1_1_PATCH
#if !defined(GTA3_1_1_PATCH) && !defined(FIX_BUGS)
m_fMouseAccelHorzntl = 0.0025f;
m_fMouseAccelVertical = 0.003f;
#endif

View file

@ -106,12 +106,14 @@ CdStreamInit(int32 numChannels)
GetDiskFreeSpace(nil, &SectorsPerCluster, &BytesPerSector, &NumberOfFreeClusters, &TotalNumberOfClusters);
_gdwCdStreamFlags = 0;
#ifndef FIX_BUGS // this just slows down streaming
if ( BytesPerSector <= CDSTREAM_SECTOR_SIZE )
{
_gdwCdStreamFlags |= FILE_FLAG_NO_BUFFERING;
debug("Using no buffered loading for streaming\n");
}
#endif
_gbCdStreamOverlapped = TRUE;

View file

@ -235,32 +235,25 @@ const char* MenuFilenames[][2] = {
{ nil, nil }
};
#define MENU_X_RIGHT_ALIGNED(x) SCALE_AND_CENTER_X(DEFAULT_SCREEN_WIDTH - (x))
#ifdef ASPECT_RATIO_SCALE
// All of the defines below replace the StretchX function. Otherwise use SCREEN_SCALE_X.
#define MENU_X_LEFT_ALIGNED(x) ScaleAndCenterX(x)
#define MENU_X_RIGHT_ALIGNED(x) ScaleAndCenterX(DEFAULT_SCREEN_WIDTH - (x))
#define MENU_X_LEFT_ALIGNED(x) SCALE_AND_CENTER_X(x)
#define MENU_X(x) SCREEN_SCALE_X(x)
#define MENU_Y(y) SCREEN_SCALE_Y(y)
float
ScaleAndCenterX(float x)
{
if (SCREEN_WIDTH == DEFAULT_SCREEN_WIDTH)
return x;
else {
if (x > DEFAULT_SCREEN_WIDTH / 2) {
return SCREEN_WIDTH / 2 + SCREEN_SCALE_X(x - DEFAULT_SCREEN_WIDTH / 2);
} else {
return SCREEN_WIDTH / 2 - SCREEN_SCALE_X(DEFAULT_SCREEN_WIDTH / 2 - x);
}
}
}
#else
#define MENU_X_LEFT_ALIGNED(x) StretchX(x)
#define MENU_X_RIGHT_ALIGNED(x) SCREEN_STRETCH_FROM_RIGHT(x)
#define MENU_X(x) StretchX(x)
#define MENU_Y(y) StretchY(y)
#endif
#ifdef PS2_LIKE_MENU
#define PAGE_NAME_X MENU_X_RIGHT_ALIGNED
#else
#define PAGE_NAME_X SCREEN_SCALE_FROM_RIGHT
#endif
#ifdef PS2_LIKE_MENU
#define ChangeScreen(screen, option, updateDelay, withReverseAlpha) \
do { \
@ -272,7 +265,7 @@ ScaleAndCenterX(float x)
if (updateDelay) \
m_nScreenChangeDelayTimer = CTimer::GetTimeInMillisecondsPauseMode(); \
} \
if (withReverseAlpha) { \
if (withReverseAlpha && !m_bRenderGameInMenu) { \
pendingOption = option; \
pendingScreen = screen; \
reverseAlpha = true; \
@ -827,7 +820,7 @@ CMenuManager::Draw()
if (aScreens[m_nCurrScreen].m_ScreenName[0] != '\0') {
PREPARE_MENU_HEADER
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(MENUHEADER_POS_X), SCREEN_SCALE_FROM_BOTTOM(MENUHEADER_POS_Y), TheText.Get(aScreens[m_nCurrScreen].m_ScreenName));
CFont::PrintString(PAGE_NAME_X(MENUHEADER_POS_X), SCREEN_SCALE_FROM_BOTTOM(MENUHEADER_POS_Y), TheText.Get(aScreens[m_nCurrScreen].m_ScreenName));
// Weird place to put that.
nextYToUse += 24.0f + 10.0f;
@ -1418,10 +1411,16 @@ CMenuManager::Draw()
if (!m_bRenderGameInMenu)
#endif
if (i == m_nCurrOption && itemsAreSelectable) {
#ifdef PS2_LIKE_MENU
CSprite2d::DrawRect(CRect(MENU_X_LEFT_ALIGNED(29.0f), MENU_Y(bitAboveNextItemY),
MENU_X_RIGHT_ALIGNED(29.0f), MENU_Y(usableLineHeight + nextItemY)),
CRGBA(100, 200, 50, FadeIn(50)));
#else
// We keep stretching, because we also stretch background image and we want that bar to be aligned with borders of background
CSprite2d::DrawRect(CRect(StretchX(10.0f), MENU_Y(bitAboveNextItemY),
SCREEN_STRETCH_FROM_RIGHT(11.0f), MENU_Y(usableLineHeight + nextItemY)),
CRGBA(100, 200, 50, FadeIn(50)));
SCREEN_STRETCH_FROM_RIGHT(11.0f), MENU_Y(usableLineHeight + nextItemY)),
CRGBA(100, 200, 50, FadeIn(50)));
#endif
}
CFont::SetColor(CRGBA(0, 0, 0, FadeIn(90)));
@ -2047,11 +2046,11 @@ CMenuManager::DrawControllerSetupScreen()
switch (m_ControlMethod) {
case CONTROL_STANDARD:
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(MENUHEADER_POS_X), SCREEN_SCALE_FROM_BOTTOM(MENUHEADER_POS_Y),
CFont::PrintString(PAGE_NAME_X(MENUHEADER_POS_X), SCREEN_SCALE_FROM_BOTTOM(MENUHEADER_POS_Y),
TheText.Get(aScreens[m_nCurrScreen].m_ScreenName));
break;
case CONTROL_CLASSIC:
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(MENUHEADER_POS_X), SCREEN_SCALE_FROM_BOTTOM(MENUHEADER_POS_Y),
CFont::PrintString(PAGE_NAME_X(MENUHEADER_POS_X), SCREEN_SCALE_FROM_BOTTOM(MENUHEADER_POS_Y),
TheText.Get("FET_CTI"));
break;
default:
@ -2335,12 +2334,11 @@ CMenuManager::DrawFrontEndNormal()
if (!m_bGameNotLoaded) {
CSprite2d *bg = LoadSplash(nil);
bg->Draw(CRect(0.0f, 0.0f, SCREEN_WIDTH, SCREEN_HEIGHT), CRGBA(255, 255, 255, 255));
bg->Draw(CRect(0.0f, 0.0f, SCREEN_WIDTH, SCREEN_HEIGHT), CRGBA(48, 48, 48, 255));
} else {
CSprite2d::DrawRect(CRect(0.0f, 0.0f, SCREEN_WIDTH, SCREEN_HEIGHT), CRGBA(0, 0, 0, 255));
}
RwRenderStateSet(rwRENDERSTATETEXTUREFILTER, (void*)rwFILTERNEAREST);
RwRenderStateSet(rwRENDERSTATEZTESTENABLE, (void*)FALSE);
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)FALSE);
@ -2448,6 +2446,46 @@ CMenuManager::DrawFrontEndNormal()
break;
}
// Positions/style from PS2 menu, credits to Fire_Head
/* Draw controller buttons */
CFont::SetFontStyle(FONT_BANK);
CFont::SetBackgroundOff();
CFont::SetScale(SCREEN_SCALE_X(0.35f), SCREEN_SCALE_Y(0.64f));
CFont::SetPropOn();
CFont::SetCentreOff();
CFont::SetJustifyOn();
CFont::SetRightJustifyOff();
CFont::SetBackGroundOnlyTextOn();
CFont::SetWrapx(MENU_X_RIGHT_ALIGNED(40.0f)); // 600.0f
CFont::SetColor(CRGBA(16, 16, 16, 255));
switch (m_nCurrScreen) {
// Page names overlaps buttons on those.
case MENUPAGE_MOUSE_CONTROLS:
case MENUPAGE_KEYBOARD_CONTROLS:
break;
default:
{
CFont::PrintString(MENU_X_LEFT_ALIGNED(52.0f), MENU_Y(360.0f), TheText.Get("FEDS_SE"));
CFont::PrintString(MENU_X_LEFT_ALIGNED(52.0f), MENU_Y(372.0f), TheText.Get("FEDS_BA"));
if (!m_bGameNotLoaded)
CFont::PrintString(MENU_X_LEFT_ALIGNED(52.0f), MENU_Y(384.0f), TheText.Get("FEDS_ST"));
if (bottomBarActive)
CFont::PrintString(MENU_X_LEFT_ALIGNED(242.0f), MENU_Y(372.0f), TheText.Get("FEDS_AM")); // <>-CHANGE MENU
else if (m_nCurrScreen != MENUPAGE_STATS && m_nCurrScreen != MENUPAGE_BRIEFS) {
CFont::PrintString(MENU_X_LEFT_ALIGNED(242.0f), MENU_Y(360.0f + 3.5f), TheText.Get("FEA_UP")); // ;
CFont::PrintString(MENU_X_LEFT_ALIGNED(242.0f), MENU_Y(384.0f - 3.5f), TheText.Get("FEA_DO")); // =
CFont::PrintString(MENU_X_LEFT_ALIGNED(242.0f - 10.0f), MENU_Y(372.0f), TheText.Get("FEA_LE")); // <
CFont::PrintString(MENU_X_LEFT_ALIGNED(242.0f + 11.0f), MENU_Y(372.0f), TheText.Get("FEA_RI")); // >
CFont::PrintString(MENU_X_LEFT_ALIGNED(242.0f + 20.0f), MENU_Y(372.0f), TheText.Get("FEDSAS3")); // - CHANGE SELECTION
}
break;
}
}
#define optionWidth MENU_X(66.0f)
#define rawOptionHeight 22.0f
#define optionBottom SCREEN_SCALE_FROM_BOTTOM(20.0f)
@ -2753,7 +2791,7 @@ CMenuManager::DrawPlayerSetupScreen()
PREPARE_MENU_HEADER
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(MENUHEADER_POS_X), SCREEN_SCALE_FROM_BOTTOM(MENUHEADER_POS_Y), TheText.Get("FET_PS"));
CFont::PrintString(PAGE_NAME_X(MENUHEADER_POS_X), SCREEN_SCALE_FROM_BOTTOM(MENUHEADER_POS_Y), TheText.Get("FET_PS"));
// lstrcpy's changed with strcpy
@ -3547,15 +3585,15 @@ CMenuManager::MessageScreen(const char *text)
CFont::SetPropOn();
CFont::SetJustifyOn();
CFont::SetBackGroundOnlyTextOn();
CFont::SetWrapx(SCREEN_SCALE_FROM_RIGHT(170.0f));
CFont::SetRightJustifyWrap(SCREEN_SCALE_FROM_RIGHT(170.0f));
CSprite2d::DrawRect(CRect(SCREEN_SCALE_X(120.0f), SCREEN_SCALE_Y(150.0f), SCREEN_SCALE_FROM_RIGHT(120.0f), SCREEN_SCALE_FROM_BOTTOM(220.0f)), CRGBA(50, 50, 50, 210));
CFont::SetWrapx(SCREEN_WIDTH - StretchX(170.0f));
CFont::SetRightJustifyWrap(SCREEN_WIDTH - StretchX(170.0f));
CSprite2d::DrawRect(CRect(StretchX(120.0f), StretchY(150.0f), SCREEN_WIDTH - StretchX(120.0f), SCREEN_HEIGHT - StretchY(220.0f)), CRGBA(50, 50, 50, 210));
CFont::SetFontStyle(FONT_LOCALE(FONT_BANK));
CFont::SetCentreSize(SCREEN_SCALE_X(380.0f));
CFont::SetCentreSize(SCREEN_STRETCH_X(380.0f));
CFont::SetCentreOn();
CFont::SetColor(CRGBA(255, 217, 106, 255));
CFont::SetScale(SCREEN_SCALE_X(SMALLTEXT_X_SCALE), SCREEN_SCALE_Y(SMALLTEXT_Y_SCALE));
CFont::PrintString(SCREEN_SCALE_X(320.0f), SCREEN_SCALE_Y(170.0f), TheText.Get(text));
CFont::PrintString(StretchX(320.0f), StretchY(170.0f), TheText.Get(text));
CFont::DrawFonts();
DoRWStuffEndOfFrame();
}
@ -3737,7 +3775,7 @@ CMenuManager::PrintStats()
// ::Draw already does that.
/*
PREPARE_MENU_HEADER
CFont::PrintString(MENU_X_RIGHT_ALIGNED(MENUHEADER_POS_X), SCREEN_SCALE_FROM_BOTTOM(MENUHEADER_POS_Y), TheText.Get(aScreens[m_nCurrScreen].m_ScreenName));
CFont::PrintString(PAGE_NAME_X(MENUHEADER_POS_X), SCREEN_SCALE_FROM_BOTTOM(MENUHEADER_POS_Y), TheText.Get(aScreens[m_nCurrScreen].m_ScreenName));
*/
CFont::SetScale(MENU_X(MENU_TEXT_SIZE_X), MENU_Y(MENU_TEXT_SIZE_Y));
}
@ -4513,30 +4551,41 @@ CMenuManager::ProcessButtonPresses(void)
bottomBarActive = false;
curBottomBarOption = hoveredBottomBarOption;
ChangeScreen(bbNames[curBottomBarOption].screenId, 0, true, false);
if (bbNames[curBottomBarOption].screenId == MENUPAGE_SOUND_SETTINGS)
DMAudio.PlayFrontEndTrack(m_PrefsRadioStation, 1);
return;
} else if (bottomBarActive) {
if (CPad::GetPad(0)->GetEnterJustDown() || CPad::GetPad(0)->GetCrossJustDown()) {
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_NAVIGATION, 0);
bottomBarActive = false;
if (bbNames[curBottomBarOption].screenId == MENUPAGE_SOUND_SETTINGS)
DMAudio.PlayFrontEndTrack(m_PrefsRadioStation, 1);
// If there's a menu change with fade ongoing, finish it now
if (reverseAlpha)
m_nMenuFadeAlpha = 0;
return;
} else if (CPad::GetPad(0)->GetLeftJustDown() || CPad::GetPad(0)->GetAnaloguePadLeft() || CPad::GetPad(0)->GetDPadLeftJustDown()
|| CPad::GetPad(0)->GetUpJustDown() || CPad::GetPad(0)->GetAnaloguePadUp() || CPad::GetPad(0)->GetDPadUpJustDown()) {
if (reverseAlpha && m_nMenuFadeAlpha > 30)
return;
m_bShowMouse = false;
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_NAVIGATION, 0);
if (curBottomBarOption > 0)
curBottomBarOption--;
curBottomBarOption = ((curBottomBarOption + bbTabCount) - 1) % bbTabCount;
ChangeScreen(bbNames[curBottomBarOption].screenId, 0, true, true);
return;
} else if (CPad::GetPad(0)->GetRightJustDown() || CPad::GetPad(0)->GetAnaloguePadRight() || CPad::GetPad(0)->GetDPadRightJustDown()
|| CPad::GetPad(0)->GetDownJustDown() || CPad::GetPad(0)->GetAnaloguePadDown() || CPad::GetPad(0)->GetDPadDownJustDown()) {
if (reverseAlpha && m_nMenuFadeAlpha > 30)
return;
m_bShowMouse = false;
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_NAVIGATION, 0);
if (curBottomBarOption < bbTabCount-1)
curBottomBarOption++;
curBottomBarOption = ((curBottomBarOption + bbTabCount) + 1) % bbTabCount;
ChangeScreen(bbNames[curBottomBarOption].screenId, 0, true, true);
return;
}
@ -5103,7 +5152,7 @@ CMenuManager::ProcessButtonPresses(void)
return;
#endif
}
#ifdef PS2_LIKE_MENU
#ifdef PS2_SAVE_DIALOG
else if (m_nCurrScreen == MENUPAGE_CHOOSE_SAVE_SLOT || m_nCurrScreen == MENUPAGE_SAVE) {
#else
else if (m_nCurrScreen == MENUPAGE_CHOOSE_SAVE_SLOT) {

View file

@ -203,6 +203,19 @@ static const char* FrontendFilenames[][2] =
{"fe_radio9", "" },
};
#ifdef CUTSCENE_BORDERS_SWITCH
bool CMenuManager::m_PrefsCutsceneBorders = true;
#endif
#ifdef MULTISAMPLING
int8 CMenuManager::m_nPrefsMSAALevel = 0;
int8 CMenuManager::m_nDisplayMSAALevel = 0;
#endif
#ifdef NO_ISLAND_LOADING
int8 CMenuManager::m_DisplayIslandLoading = ISLAND_LOADING_LOW;
int8 CMenuManager::m_PrefsIslandLoading = ISLAND_LOADING_LOW;
#endif
int32 CMenuManager::m_PrefsSfxVolume = 102;
int32 CMenuManager::m_PrefsMusicVolume = 102;

View file

@ -160,7 +160,30 @@ public:
static int32 m_PrefsLanguage;
static CONTRCONFIG m_PrefsControllerConfig;
static bool m_PrefsUseVibration;
#ifdef NO_ISLAND_LOADING
enum
{
ISLAND_LOADING_LOW = 0,
ISLAND_LOADING_MEDIUM,
ISLAND_LOADING_HIGH
};
static int8 m_DisplayIslandLoading;
static int8 m_PrefsIslandLoading;
#define ISLAND_LOADING_IS(p) if (CMenuManager::m_PrefsIslandLoading == CMenuManager::ISLAND_LOADING_##p)
#define ISLAND_LOADING_ISNT(p) if (CMenuManager::m_PrefsIslandLoading != CMenuManager::ISLAND_LOADING_##p)
#else
#define ISLAND_LOADING_IS(p)
#define ISLAND_LOADING_ISNT(p)
#endif
#ifdef CUTSCENE_BORDERS_SWITCH
static bool m_PrefsCutsceneBorders;
#endif
#ifdef MULTISAMPLING
static int8 m_nPrefsMSAALevel;
static int8 m_nDisplayMSAALevel;
#endif
#ifdef GTA_PC
bool m_bQuitGameNoCD;

View file

@ -1100,6 +1100,10 @@ int CRadar::SetCoordBlip(eBlipType type, CVector pos, int32 color, eBlipDisplay
if (!ms_RadarTrace[nextBlip].m_bInUse)
break;
}
#ifdef FIX_BUGS
if (nextBlip == NUMRADARBLIPS)
return -1;
#endif
ms_RadarTrace[nextBlip].m_eBlipType = type;
ms_RadarTrace[nextBlip].m_nColor = color;
ms_RadarTrace[nextBlip].m_bDim = 1;
@ -1121,6 +1125,10 @@ int CRadar::SetEntityBlip(eBlipType type, int32 handle, int32 color, eBlipDispla
if (!ms_RadarTrace[nextBlip].m_bInUse)
break;
}
#ifdef FIX_BUGS
if (nextBlip == NUMRADARBLIPS)
return -1;
#endif
ms_RadarTrace[nextBlip].m_eBlipType = type;
ms_RadarTrace[nextBlip].m_nColor = color;
ms_RadarTrace[nextBlip].m_bDim = 1;
@ -1452,6 +1460,10 @@ CRadar::ToggleTargetMarker(float x, float y)
if (!ms_RadarTrace[nextBlip].m_bInUse)
break;
}
#ifdef FIX_BUGS
if (nextBlip == NUMRADARBLIPS)
return;
#endif
ms_RadarTrace[nextBlip].m_eBlipType = BLIP_COORD;
ms_RadarTrace[nextBlip].m_nColor = 0x333333FF;
ms_RadarTrace[nextBlip].m_bDim = 1;

View file

@ -144,8 +144,11 @@ inline uint32 ldb(uint32 p, uint32 s, uint32 w)
#ifdef ASPECT_RATIO_SCALE
#define SCREEN_SCALE_AR(a) ((a) * DEFAULT_ASPECT_RATIO / SCREEN_ASPECT_RATIO)
extern float ScaleAndCenterX(float x);
#define SCALE_AND_CENTER_X(x) ScaleAndCenterX(x)
#else
#define SCREEN_SCALE_AR(a) (a)
#define SCALE_AND_CENTER_X(x) SCREEN_STRETCH_X(x)
#endif
#include "maths.h"

View file

@ -235,20 +235,20 @@ enum Config {
// Hud, frontend and radar
#define HUD_ENHANCEMENTS // Adjusts some aspects to make the HUD look/behave a little bit better.
#define BETA_SLIDING_TEXT
// #define BETA_SLIDING_TEXT
#define TRIANGULAR_BLIPS // height indicating triangular radar blips, as in VC
#define PC_MENU
#ifndef PC_MENU
# define PS2_MENU
//# define PS2_MENU_USEALLPAGEICONS
# define PS2_SAVE_DIALOG // PS2 style save dialog with transparent black box
//# define PS2_LIKE_MENU // An effort to recreate PS2 menu, cycling through tabs, different bg etc.
#else
# define MENU_MAP // VC-like menu map. Make sure you have new menu.txd
# define SCROLLABLE_STATS_PAGE // only draggable by mouse atm
# define TRIANGLE_BACK_BUTTON
//# define CIRCLE_BACK_BUTTON
//# define PS2_LIKE_MENU // An effort to recreate PS2 menu, cycling through tabs, different bg etc.
//# define PS2_SAVE_DIALOG // PS2 style save dialog with transparent black box
# define CUSTOM_FRONTEND_OPTIONS
# define GRAPHICS_MENU_OPTIONS // otherwise Advanced Options menu will appear if Display is full
#endif

View file

@ -757,12 +757,13 @@ DisplayGameDebugText()
{
static bool bDisplayPosn = false;
static bool bDisplayRate = false;
#ifndef FINAL
{
SETTWEAKPATH("GameDebugText");
TWEAKBOOL(bDisplayPosn);
TWEAKBOOL(bDisplayRate);
}
#endif
char str[200];
@ -1111,6 +1112,7 @@ Idle(void *arg)
#endif
#ifdef FIX_BUGS
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void *)FALSE); // TODO: temp? this fixes OpenGL render but there should be a better place for this
// This has to be done BEFORE RwCameraBeginUpdate
RwCameraSetFarClipPlane(Scene.camera, CTimeCycle::GetFarClip());
RwCameraSetFogDistance(Scene.camera, CTimeCycle::GetFogStart());

View file

@ -267,6 +267,7 @@ void PS2AlphaTestChange(int8 displayedValue)
// Important: Make sure to read the warnings/informations in frontendoption.h!!
// For texts: Either use TheText.Get, or use wcsdup(wchar version of strdup)
void
CustomFrontendOptionsPopulate(void)
{
@ -369,7 +370,7 @@ CustomFrontendOptionsPopulate(void)
#ifdef FREE_CAM
SWITCH_TO_DISPLAY_MENU
static const wchar* text = (wchar*)L"FREE CAM";
static const wchar* text = (wchar*)wcsdup(L"FREE CAM");
FrontendOptionAddSelect(text, off_on, 2, (int8*)&TheCamera.bFreeCam, false, FreeCamChange, nil, true);
#endif

View file

@ -476,7 +476,11 @@ CCoronas::RenderReflections(void)
int intensity = distanceFade*heightFade * 230.0 * CWeather::WetRoads;
CSprite::RenderBufferedOneXLUSprite(
#ifdef FIX_BUGS
spriteCoors.x, spriteCoors.y, spriteCoors.z,
#else
spriteCoors.x, spriteCoors.y, RwIm2DGetNearScreenZ(),
#endif
spritew * aCoronas[i].size * 0.75f,
spriteh * aCoronas[i].size * 2.0f,
(intensity * CCoronas::aCoronas[i].red)>>8,

View file

@ -39,11 +39,11 @@ CCredits::PrintCreditSpace(float space, uint32 &line)
void
CCredits::PrintCreditText(float scaleX, float scaleY, wchar *text, uint32 &lineoffset, float scrolloffset)
{
float start = SCREEN_HEIGHT + 50.0f;
float start = DEFAULT_SCREEN_HEIGHT + 50.0f;
float y = lineoffset + start - scrolloffset;
if(y > -50.0f && y < start){
CFont::SetScale(scaleX, scaleY);
CFont::PrintString(SCREEN_WIDTH/2.0f, y, (uint16*)text);
CFont::SetScale(SCREEN_SCALE_X(scaleX), SCREEN_SCALE_Y(scaleY));
CFont::PrintString(SCREEN_WIDTH/2.0f, SCREEN_SCALE_Y(y), (uint16*)text);
}
lineoffset += scaleY*25.0f;
}
@ -62,7 +62,7 @@ CCredits::Render(void)
scrolloffset = (CTimer::GetTimeInMilliseconds() - CreditsStartTime) / 24.0f;
CFont::SetJustifyOff();
CFont::SetBackgroundOff();
CFont::SetCentreSize(SCREEN_WIDTH - 20);
CFont::SetCentreSize(SCALE_AND_CENTER_X(DEFAULT_SCREEN_WIDTH - 20));
CFont::SetCentreOn();
CFont::SetPropOn();
CFont::SetColor(CRGBA(220, 220, 220, 220));
@ -489,11 +489,11 @@ CCredits::Render(void)
if(TheCamera.m_WideScreenOn)
TheCamera.DrawBordersForWideScreen();
if(lineoffset + SCREEN_HEIGHT - scrolloffset < -10.0f)
if(lineoffset + DEFAULT_SCREEN_HEIGHT - scrolloffset < -10.0f)
bCreditsGoing = false;
}
bool CCredits::AreCreditsDone(void)
{
return !bCreditsGoing;
}
}

View file

@ -70,3 +70,14 @@ CDraw::SetFOV(float fov)
#endif
ms_fFOV = fov;
}
#ifdef ASPECT_RATIO_SCALE
float
ScaleAndCenterX(float x)
{
if (SCREEN_WIDTH == DEFAULT_SCREEN_WIDTH)
return x;
else
return (SCREEN_WIDTH - SCREEN_SCALE_X(DEFAULT_SCREEN_WIDTH)) / 2 + SCREEN_SCALE_X(x);
}
#endif

View file

@ -244,8 +244,8 @@ CFont::Initialise(void)
SetColor(CRGBA(0xFF, 0xFF, 0xFF, 0));
SetJustifyOff();
SetCentreOff();
SetWrapx(DEFAULT_SCREEN_WIDTH);
SetCentreSize(DEFAULT_SCREEN_WIDTH);
SetWrapx(SCREEN_STRETCH_X(DEFAULT_SCREEN_WIDTH));
SetCentreSize(SCREEN_STRETCH_X(DEFAULT_SCREEN_WIDTH));
SetBackgroundOff();
SetBackgroundColor(CRGBA(0x80, 0x80, 0x80, 0x80));
SetBackGroundOnlyTextOff();

View file

@ -336,7 +336,7 @@ void CHud::Draw()
CFont::SetScale(SCREEN_SCALE_X(0.4f), SCREEN_SCALE_Y(0.6f));
CFont::SetJustifyOff();
CFont::SetCentreOn();
CFont::SetCentreSize(SCREEN_SCALE_X(640.0f));
CFont::SetCentreSize(SCREEN_WIDTH);
CFont::SetPropOn();
CFont::SetFontStyle(FONT_BANK);
@ -740,7 +740,7 @@ void CHud::Draw()
CFont::SetRightJustifyWrap(0.0f);
CFont::SetFontStyle(FONT_LOCALE(FONT_HEADING));
CFont::SetColor(CRGBA(244, 20, 20, 255));
CFont::SetWrapx(SCREEN_SCALE_X(640.0f));
CFont::SetWrapx(SCREEN_STRETCH_X(DEFAULT_SCREEN_WIDTH));
CFont::SetPropOff();
CFont::SetBackGroundOnlyTextOn();
@ -869,8 +869,8 @@ void CHud::Draw()
else
CFont::SetCentreOff();
CFont::SetWrapx(SCREEN_SCALE_X(CTheScripts::IntroTextLines[i].m_fWrapX));
CFont::SetCentreSize(SCREEN_SCALE_X(CTheScripts::IntroTextLines[i].m_fCenterSize));
CFont::SetWrapx(SCALE_AND_CENTER_X(CTheScripts::IntroTextLines[i].m_fWrapX));
CFont::SetCentreSize(SCALE_AND_CENTER_X(CTheScripts::IntroTextLines[i].m_fCenterSize));
if (CTheScripts::IntroTextLines[i].m_bBackground)
CFont::SetBackgroundOn();
@ -890,7 +890,7 @@ void CHud::Draw()
CFont::SetPropOff();
CFont::SetFontStyle(FONT_LOCALE(CTheScripts::IntroTextLines[i].m_nFont));
CFont::PrintString(SCREEN_SCALE_X(DEFAULT_SCREEN_WIDTH - CTheScripts::IntroTextLines[i].m_fAtX), SCREEN_SCALE_Y(DEFAULT_SCREEN_HEIGHT - CTheScripts::IntroTextLines[i].m_fAtY), CTheScripts::IntroTextLines[i].m_Text);
CFont::PrintString(SCALE_AND_CENTER_X(DEFAULT_SCREEN_WIDTH - CTheScripts::IntroTextLines[i].m_fAtX), SCREEN_SCALE_Y(DEFAULT_SCREEN_HEIGHT - CTheScripts::IntroTextLines[i].m_fAtY), CTheScripts::IntroTextLines[i].m_Text);
}
}
for (int i = 0; i < ARRAY_SIZE(CTheScripts::IntroRectangles); i++) {
@ -957,9 +957,11 @@ void CHud::Draw()
CFont::SetScale(SCREEN_SCALE_X(1.8f), SCREEN_SCALE_Y(1.8f));
CFont::SetPropOn();
CFont::SetCentreOn();
CFont::SetCentreSize(SCREEN_SCALE_X(615.0f));
CFont::SetCentreSize(SCREEN_SCALE_FROM_RIGHT(25.0f));
CFont::SetFontStyle(FONT_HEADING);
// Appearently sliding text in here was abandoned very early, since this text is centered now.
if (BigMessageX[0] >= SCREEN_SCALE_FROM_RIGHT(20.0f)) {
BigMessageInUse[0] += CTimer::GetTimeStep();
@ -974,7 +976,7 @@ void CHud::Draw()
}
}
else {
BigMessageX[0] += (CTimer::GetTimeStepInMilliseconds() * 0.3f);
BigMessageX[0] += SCREEN_SCALE_X((CTimer::GetTimeStepInMilliseconds() * 0.3f));
BigMessageAlpha[0] += (CTimer::GetTimeStepInMilliseconds() * 0.3f);
if (BigMessageAlpha[0] > 255.0f)
@ -983,17 +985,19 @@ void CHud::Draw()
CFont::SetColor(CRGBA(0, 0, 0, BigMessageAlpha[0]));
#ifdef FIX_BUGS
CFont::PrintString(SCREEN_WIDTH / 2 + SCREEN_SCALE_X(2.0f), (SCREEN_HEIGHT / 2) - SCREEN_SCALE_Y(18.0f) + SCREEN_SCALE_Y(2.0f), m_BigMessage[0]);
#define Y_OFFSET 18.0f
#else
CFont::PrintString(SCREEN_WIDTH / 2 + SCREEN_SCALE_X(2.0f), (SCREEN_HEIGHT / 2) - SCREEN_SCALE_Y(20.0f) + SCREEN_SCALE_Y(2.0f), m_BigMessage[0]);
#define Y_OFFSET 20.0f
#endif
CFont::PrintString(SCREEN_WIDTH / 2 + SCREEN_SCALE_X(2.0f), (SCREEN_HEIGHT / 2) - SCREEN_SCALE_Y(Y_OFFSET) + SCREEN_SCALE_Y(2.0f), m_BigMessage[0]);
CFont::SetColor(CRGBA(BIGMESSAGE_COLOR.r, BIGMESSAGE_COLOR.g, BIGMESSAGE_COLOR.b, BigMessageAlpha[0]));
CFont::PrintString(SCREEN_WIDTH / 2, (SCREEN_HEIGHT / 2) - SCREEN_SCALE_Y(18.0f), m_BigMessage[0]);
#undef Y_OFFSET
}
else {
BigMessageAlpha[0] = 0.0f;
BigMessageX[0] = -60.0f;
BigMessageX[0] = SCALE_AND_CENTER_X(-60.0f);
BigMessageInUse[0] = 1.0f;
}
}
@ -1162,8 +1166,8 @@ void CHud::DrawAfterFade()
else
CFont::SetCentreOff();
CFont::SetWrapx(SCREEN_SCALE_X(line.m_fWrapX));
CFont::SetCentreSize(SCREEN_SCALE_X(line.m_fCenterSize));
CFont::SetWrapx(SCALE_AND_CENTER_X(line.m_fWrapX));
CFont::SetCentreSize(SCALE_AND_CENTER_X(line.m_fCenterSize));
if (line.m_bBackground)
CFont::SetBackgroundOn();
else
@ -1181,7 +1185,7 @@ void CHud::DrawAfterFade()
CFont::SetPropOff();
CFont::SetFontStyle(line.m_nFont);
CFont::PrintString(SCREEN_SCALE_X(DEFAULT_SCREEN_WIDTH - line.m_fAtX), SCREEN_SCALE_Y(DEFAULT_SCREEN_HEIGHT - line.m_fAtY), line.m_Text);
CFont::PrintString(SCALE_AND_CENTER_X(DEFAULT_SCREEN_WIDTH - line.m_fAtX), SCREEN_SCALE_Y(DEFAULT_SCREEN_HEIGHT - line.m_fAtY), line.m_Text);
}
}
for (int i = 0; i < ARRAY_SIZE(CTheScripts::IntroRectangles); i++) {
@ -1209,7 +1213,7 @@ void CHud::DrawAfterFade()
CFont::SetScale(SCREEN_SCALE_X(1.2f), SCREEN_SCALE_Y(1.5f));
CFont::SetCentreOn();
CFont::SetPropOn();
CFont::SetCentreSize(SCREEN_SCALE_X(600.0f));
CFont::SetCentreSize(SCREEN_SCALE_FROM_RIGHT(40.0f));
CFont::SetFontStyle(FONT_LOCALE(FONT_BANK));
CFont::SetColor(CRGBA(0, 0, 0, 255));
@ -1225,7 +1229,7 @@ void CHud::DrawAfterFade()
CFont::SetScale(SCREEN_SCALE_X(1.2f), SCREEN_SCALE_Y(1.5f));
CFont::SetCentreOn();
CFont::SetPropOn();
CFont::SetCentreSize(SCREEN_SCALE_X(620.0f));
CFont::SetCentreSize(SCREEN_SCALE_FROM_RIGHT(20.0f));
CFont::SetColor(CRGBA(0, 0, 0, 255));
CFont::SetFontStyle(FONT_LOCALE(FONT_BANK));
@ -1329,7 +1333,7 @@ void CHud::DrawAfterFade()
BigMessageAlpha[1] = 0.0f;
}
} else {
BigMessageX[1] += (CTimer::GetTimeStepInMilliseconds() * 0.3f);
BigMessageX[1] += SCREEN_SCALE_X((CTimer::GetTimeStepInMilliseconds() * 0.3f));
BigMessageAlpha[1] += (CTimer::GetTimeStepInMilliseconds() * 0.3f);
if (BigMessageAlpha[1] > 255.0f)
@ -1337,14 +1341,21 @@ void CHud::DrawAfterFade()
}
CFont::SetColor(CRGBA(40, 40, 40, BigMessageAlpha[1]));
#ifdef BETA_SLIDING_TEXT
CFont::PrintString(SCREEN_SCALE_X(2.0f) + BigMessageX[1], SCREEN_SCALE_FROM_BOTTOM(120.0f) + SCREEN_SCALE_Y(2.0f), m_BigMessage[1]);
CFont::SetColor(CRGBA(MISSIONTITLE_COLOR.r, MISSIONTITLE_COLOR.g, MISSIONTITLE_COLOR.b, BigMessageAlpha[1]));
CFont::PrintString(BigMessageX[1], SCREEN_SCALE_FROM_BOTTOM(120.0f), m_BigMessage[1]);
#else
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(20.0f) + SCREEN_SCALE_X(2.0f), SCREEN_SCALE_FROM_BOTTOM(120.0f) + SCREEN_SCALE_Y(2.0f), m_BigMessage[1]);
CFont::SetColor(CRGBA(MISSIONTITLE_COLOR.r, MISSIONTITLE_COLOR.g, MISSIONTITLE_COLOR.b, BigMessageAlpha[1]));
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(20.0f), SCREEN_SCALE_FROM_BOTTOM(120.0f), m_BigMessage[1]);
#endif
}
else {
BigMessageAlpha[1] = 0.0f;
BigMessageX[1] = -60.0f;
BigMessageX[1] = SCALE_AND_CENTER_X(-60.0f);
BigMessageInUse[1] = 1.0f;
}
}

View file

@ -1,5 +1,15 @@
#if defined RW_GL3 && !defined LIBRW_SDL2
#ifdef _WIN32
#include <windows.h>
#include <mmsystem.h>
#include <shellapi.h>
#include <windowsx.h>
#include <basetsd.h>
#include <regstr.h>
#include <shlobj.h>
#endif
#define WITHWINDOWS
#include "common.h"
@ -812,12 +822,28 @@ void joysChangeCB(int jid, int event);
bool IsThisJoystickBlacklisted(int i)
{
const char *joyname = glfwGetJoystickName(i);
if (glfwJoystickIsGamepad(i))
return false;
const char* joyname = glfwGetJoystickName(i);
// this is just a keyboard and mouse
// Microsoft Microsoft® 2.4GHz Transceiver v8.0 Consumer Control
// Microsoft Microsoft® 2.4GHz Transceiver v8.0 System Control
if(strstr(joyname, "2.4GHz Transceiver"))
if (strstr(joyname, "2.4GHz Transceiver"))
return true;
// COMPANY USB Device System Control
// COMPANY USB Device Consumer Control
if (strstr(joyname, "COMPANY USB"))
return true;
// i.e. Synaptics TM2438-005
if (strstr(joyname, "Synaptics "))
return true;
// i.e. ELAN Touchscreen
if (strstr(joyname, "ELAN "))
return true;
// i.e. Primax Electronics, Ltd HP Wireless Keyboard Mouse Kit Consumer Control
if (strstr(joyname, "Keyboard"))
return true;
return false;
@ -1180,7 +1206,11 @@ void resizeCB(GLFWwindow* window, int width, int height) {
* memory things don't work.
*/
/* redraw window */
if (RwInitialised && (gGameState == GS_PLAYING_GAME || gGameState == GS_ANIMVIEWER))
if (RwInitialised && (gGameState == GS_PLAYING_GAME
#ifndef MASTER
|| gGameState == GS_ANIMVIEWER
#endif
))
{
RsEventHandler((gGameState == GS_PLAYING_GAME ? rsIDLE : rsANIMVIEWER), (void*)TRUE);
}
@ -1610,6 +1640,72 @@ main(int argc, char *argv[])
break;
}
case GS_INIT_LOGO_MPEG:
{
//if (!startupDeactivate)
// PlayMovieInWindow(cmdShow, "movies\\Logo.mpg");
gGameState = GS_LOGO_MPEG;
TRACE("gGameState = GS_LOGO_MPEG;");
break;
}
case GS_LOGO_MPEG:
{
// CPad::UpdatePads();
// if (startupDeactivate || ControlsManager.GetJoyButtonJustDown() != 0)
++gGameState;
// else if (CPad::GetPad(0)->GetLeftMouseJustDown())
// ++gGameState;
// else if (CPad::GetPad(0)->GetEnterJustDown())
// ++gGameState;
// else if (CPad::GetPad(0)->GetCharJustDown(' '))
// ++gGameState;
// else if (CPad::GetPad(0)->GetAltJustDown())
// ++gGameState;
// else if (CPad::GetPad(0)->GetTabJustDown())
// ++gGameState;
break;
}
case GS_INIT_INTRO_MPEG:
{
//#ifndef NO_MOVIES
// CloseClip();
// CoUninitialize();
//#endif
//
// if (CMenuManager::OS_Language == LANG_FRENCH || CMenuManager::OS_Language == LANG_GERMAN)
// PlayMovieInWindow(cmdShow, "movies\\GTAtitlesGER.mpg");
// else
// PlayMovieInWindow(cmdShow, "movies\\GTAtitles.mpg");
gGameState = GS_INTRO_MPEG;
TRACE("gGameState = GS_INTRO_MPEG;");
break;
}
case GS_INTRO_MPEG:
{
// CPad::UpdatePads();
//
// if (startupDeactivate || ControlsManager.GetJoyButtonJustDown() != 0)
++gGameState;
// else if (CPad::GetPad(0)->GetLeftMouseJustDown())
// ++gGameState;
// else if (CPad::GetPad(0)->GetEnterJustDown())
// ++gGameState;
// else if (CPad::GetPad(0)->GetCharJustDown(' '))
// ++gGameState;
// else if (CPad::GetPad(0)->GetAltJustDown())
// ++gGameState;
// else if (CPad::GetPad(0)->GetTabJustDown())
// ++gGameState;
break;
}
case GS_INIT_ONCE:
{
//CoUninitialize();
@ -1625,7 +1721,6 @@ main(int argc, char *argv[])
#else
LoadingScreen(nil, nil, "loadsc0");
#endif
if ( !CGame::InitialiseOnceAfterRW() )
RsGlobal.quit = TRUE;
@ -1638,6 +1733,7 @@ main(int argc, char *argv[])
break;
}
#ifndef PS2_MENU
case GS_INIT_FRONTEND:
{
LoadingScreen(nil, nil, "loadsc0");
@ -1658,7 +1754,6 @@ main(int argc, char *argv[])
break;
}
#ifndef PS2_MENU
case GS_FRONTEND:
{
if(!glfwGetWindowAttrib(PSGLOBAL(window), GLFW_ICONIFIED))
@ -1818,8 +1913,10 @@ main(int argc, char *argv[])
{
if ( gGameState == GS_PLAYING_GAME )
CGame::ShutDown();
#ifndef MASTER
else if ( gGameState == GS_ANIMVIEWER )
CAnimViewer::Shutdown();
#endif
CTimer::Stop();
@ -1843,8 +1940,10 @@ main(int argc, char *argv[])
if ( gGameState == GS_PLAYING_GAME )
CGame::ShutDown();
#ifndef MASTER
else if ( gGameState == GS_ANIMVIEWER )
CAnimViewer::Shutdown();
#endif
DMAudio.Terminate();
@ -1932,11 +2031,11 @@ void CapturePad(RwInt32 padID)
// Gamepad axes are guaranteed to return 0.0f if that particular gamepad doesn't have that axis.
if ( glfwPad != -1 ) {
leftStickPos.x = ControlsManager.m_NewState.isGamepad ? gamepadState.axes[0] : numAxes >= 0 ? axes[0] : 0.0f;
leftStickPos.y = ControlsManager.m_NewState.isGamepad ? gamepadState.axes[1] : numAxes >= 1 ? axes[1] : 0.0f;
leftStickPos.x = ControlsManager.m_NewState.isGamepad ? gamepadState.axes[0] : numAxes >= 1 ? axes[0] : 0.0f;
leftStickPos.y = ControlsManager.m_NewState.isGamepad ? gamepadState.axes[1] : numAxes >= 2 ? axes[1] : 0.0f;
rightStickPos.x = ControlsManager.m_NewState.isGamepad ? gamepadState.axes[2] : numAxes >= 2 ? axes[2] : 0.0f;
rightStickPos.y = ControlsManager.m_NewState.isGamepad ? gamepadState.axes[3] : numAxes >= 3 ? axes[3] : 0.0f;
rightStickPos.x = ControlsManager.m_NewState.isGamepad ? gamepadState.axes[2] : numAxes >= 3 ? axes[2] : 0.0f;
rightStickPos.y = ControlsManager.m_NewState.isGamepad ? gamepadState.axes[3] : numAxes >= 4 ? axes[3] : 0.0f;
}
{

View file

@ -1095,8 +1095,11 @@ MainWndProc(HWND window, UINT message, WPARAM wParam, LPARAM lParam)
if ( wParam == VK_SHIFT )
_InputTranslateShiftKeyUpDown(&ks);
#ifdef FIX_BUGS
break;
#else
return 0L;
#endif
}
case WM_KEYUP:
@ -1109,7 +1112,11 @@ MainWndProc(HWND window, UINT message, WPARAM wParam, LPARAM lParam)
if ( wParam == VK_SHIFT )
_InputTranslateShiftKeyUpDown(&ks);
#ifdef FIX_BUGS
break;
#else
return 0L;
#endif
}
case WM_SYSKEYDOWN:
@ -1122,7 +1129,11 @@ MainWndProc(HWND window, UINT message, WPARAM wParam, LPARAM lParam)
if ( wParam == VK_SHIFT )
_InputTranslateShiftKeyUpDown(&ks);
#ifdef FIX_BUGS
break;
#else
return 0L;
#endif
}
case WM_SYSKEYUP:
@ -1135,7 +1146,11 @@ MainWndProc(HWND window, UINT message, WPARAM wParam, LPARAM lParam)
if ( wParam == VK_SHIFT )
_InputTranslateShiftKeyUpDown(&ks);
#ifdef FIX_BUGS
break;
#else
return 0L;
#endif
}
case WM_ACTIVATEAPP:
@ -2498,8 +2513,10 @@ WinMain(HINSTANCE instance,
{
if ( gGameState == GS_PLAYING_GAME )
CGame::ShutDown();
#ifndef MASTER
else if ( gGameState == GS_ANIMVIEWER )
CAnimViewer::Shutdown();
#endif
CTimer::Stop();
@ -2523,8 +2540,10 @@ WinMain(HINSTANCE instance,
if ( gGameState == GS_PLAYING_GAME )
CGame::ShutDown();
#ifndef MASTER
else if ( gGameState == GS_ANIMVIEWER )
CAnimViewer::Shutdown();
#endif
DMAudio.Terminate();

View file

@ -42,8 +42,10 @@ CDamageManager::FuckCarCompletely(void)
#endif
}
// Why set to no damage?
#ifndef FIX_BUGS
m_lightStatus = 0;
m_panelStatus = 0;
#endif
SetEngineStatus(250);
}

View file

@ -1608,6 +1608,9 @@ CWeapon::FireM16_1stPerson(CEntity *shooter)
if ( shooter == FindPlayerPed() )
{
#ifdef FIX_BUGS
CStats::InstantHitsFiredByPlayer++;
#endif
CPad::GetPad(0)->StartShake_Distance(240, 128, FindPlayerPed()->GetPosition().x, FindPlayerPed()->GetPosition().y, FindPlayerPed()->GetPosition().z);
if ( m_eWeaponType == WEAPONTYPE_M16 )

2
vendor/opus vendored

@ -1 +1 @@
Subproject commit 6bae366f9fef25191fc812c430e8abd40a13a233
Subproject commit 034c1b61a250457649d788bbf983b3f0fb63f02e

2
vendor/opusfile vendored

@ -1 +1 @@
Subproject commit 6452e838e68e8f4fc0b3599523c760ac6276ce89
Subproject commit f94a1764b0dcdd84ee8c13c040de9f4c1a67e4df