mirror of
https://github.com/GTAmodding/re3.git
synced 2025-01-18 08:06:36 +00:00
Merge remote-tracking branch 'upstream/lcs' into lcs
This commit is contained in:
commit
776d46aacb
18 changed files with 110 additions and 93 deletions
9
.github/workflows/build-cmake-conan.yml
vendored
9
.github/workflows/build-cmake-conan.yml
vendored
|
@ -27,7 +27,7 @@ jobs:
|
||||||
platform: 'gl3'
|
platform: 'gl3'
|
||||||
gl3_gfxlib: 'glfw'
|
gl3_gfxlib: 'glfw'
|
||||||
audio: 'openal'
|
audio: 'openal'
|
||||||
# - os: 'ubuntu-latest'
|
# - os: 'ubuntu-18.04'
|
||||||
# platform: 'gl3'
|
# platform: 'gl3'
|
||||||
# gl3_gfxlib: 'sdl2'
|
# gl3_gfxlib: 'sdl2'
|
||||||
# audio: 'openal'
|
# audio: 'openal'
|
||||||
|
@ -63,8 +63,9 @@ jobs:
|
||||||
python -m pip install conan
|
python -m pip install conan
|
||||||
conan config init
|
conan config init
|
||||||
conan config set log.print_run_commands=True
|
conan config set log.print_run_commands=True
|
||||||
conan remote add bincrafters https://api.bintray.com/conan/bincrafters/public-conan
|
conan config set general.revisions_enabled=1
|
||||||
conan remote add madebr_ps2dev https://api.bintray.com/conan/madebr/ps2dev
|
conan remote add bincrafters https://bincrafters.jfrog.io/artifactory/api/conan/public-conan
|
||||||
|
# conan remote add madebr_ps2dev https://api.bintray.com/conan/madebr/ps2dev
|
||||||
- name: "Add os=playstation2 + gcc.version=3.2 to .conan/settings.yml"
|
- name: "Add os=playstation2 + gcc.version=3.2 to .conan/settings.yml"
|
||||||
shell: python
|
shell: python
|
||||||
run: |
|
run: |
|
||||||
|
@ -85,7 +86,7 @@ jobs:
|
||||||
fi
|
fi
|
||||||
- name: "Export Playstation 2 CMake toolchain conan recipe"
|
- name: "Export Playstation 2 CMake toolchain conan recipe"
|
||||||
run: |
|
run: |
|
||||||
conan export vendor/librw/cmake/ps2toolchain ps2dev-cmaketoolchain/master@
|
conan export vendor/librw/cmake/ps2/cmaketoolchain ps2dev-cmaketoolchain/master@
|
||||||
- name: "Export librw conan recipe"
|
- name: "Export librw conan recipe"
|
||||||
run: |
|
run: |
|
||||||
conan export vendor/librw librw/master@
|
conan export vendor/librw librw/master@
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# reLCS
|
# reLCS
|
||||||
[![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2FGTAmodding%2Fre3%2Fbadge%3Fref%3Dlcs&style=flat)](https://actions-badge.atrox.dev/GTAmodding/re3/goto?ref=lcs)
|
[![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2FGTAmodding%2Fre3%2Fbadge%3Fref%3Dlcs&style=flat)](https://actions-badge.atrox.dev/GTAmodding/re3/goto?ref=lcs)
|
||||||
<a href="https://discord.gg/ERYg58ttcE"><img src="https://img.shields.io/badge/discord-join-7289DA.svg?logo=discord&longCache=true&style=flat" /></a>
|
<a href="https://discord.gg/RFNbjsUMGg"><img src="https://img.shields.io/badge/discord-join-7289DA.svg?logo=discord&longCache=true&style=flat" /></a>
|
||||||
|
|
||||||
## Intro
|
## Intro
|
||||||
|
|
||||||
|
|
36
premake5.lua
36
premake5.lua
|
@ -154,12 +154,18 @@ workspace "reLCS"
|
||||||
filter { "platforms:*arm*" }
|
filter { "platforms:*arm*" }
|
||||||
architecture "ARM"
|
architecture "ARM"
|
||||||
|
|
||||||
filter { "platforms:macosx-arm64-*" }
|
filter { "platforms:macosx-arm64-*", "files:**.cpp"}
|
||||||
buildoptions { "-target", "arm64-apple-macos11", "-std=gnu++14" }
|
buildoptions { "-target", "arm64-apple-macos11", "-std=gnu++14" }
|
||||||
|
|
||||||
filter { "platforms:macosx-amd64-*" }
|
filter { "platforms:macosx-arm64-*", "files:**.c"}
|
||||||
|
buildoptions { "-target", "arm64-apple-macos11" }
|
||||||
|
|
||||||
|
filter { "platforms:macosx-amd64-*", "files:**.cpp"}
|
||||||
buildoptions { "-target", "x86_64-apple-macos10.12", "-std=gnu++14" }
|
buildoptions { "-target", "x86_64-apple-macos10.12", "-std=gnu++14" }
|
||||||
|
|
||||||
|
filter { "platforms:macosx-amd64-*", "files:**.c"}
|
||||||
|
buildoptions { "-target", "x86_64-apple-macos10.12" }
|
||||||
|
|
||||||
filter { "platforms:*librw_d3d9*" }
|
filter { "platforms:*librw_d3d9*" }
|
||||||
defines { "RW_D3D9" }
|
defines { "RW_D3D9" }
|
||||||
if(not _OPTIONS["with-librw"]) then
|
if(not _OPTIONS["with-librw"]) then
|
||||||
|
@ -219,8 +225,14 @@ project "librw"
|
||||||
includedirs { "/usr/local/include" }
|
includedirs { "/usr/local/include" }
|
||||||
libdirs { "/usr/local/lib" }
|
libdirs { "/usr/local/lib" }
|
||||||
|
|
||||||
filter "platforms:macosx*"
|
|
||||||
-- Support MacPorts and Homebrew
|
-- Support MacPorts and Homebrew
|
||||||
|
filter "platforms:macosx-arm64-*"
|
||||||
|
includedirs { "/opt/local/include" }
|
||||||
|
includedirs {"/opt/homebrew/include" }
|
||||||
|
libdirs { "/opt/local/lib" }
|
||||||
|
libdirs { "/opt/homebrew/lib" }
|
||||||
|
|
||||||
|
filter "platforms:macosx-amd64-*"
|
||||||
includedirs { "/opt/local/include" }
|
includedirs { "/opt/local/include" }
|
||||||
includedirs {"/usr/local/include" }
|
includedirs {"/usr/local/include" }
|
||||||
libdirs { "/opt/local/lib" }
|
libdirs { "/opt/local/lib" }
|
||||||
|
@ -386,6 +398,12 @@ project "reLCS"
|
||||||
|
|
||||||
filter "platforms:macosx*oal"
|
filter "platforms:macosx*oal"
|
||||||
links { "openal", "mpg123", "sndfile", "pthread" }
|
links { "openal", "mpg123", "sndfile", "pthread" }
|
||||||
|
|
||||||
|
filter "platforms:macosx-arm64-*oal"
|
||||||
|
includedirs { "/opt/homebrew/opt/openal-soft/include" }
|
||||||
|
libdirs { "/opt/homebrew/opt/openal-soft/lib" }
|
||||||
|
|
||||||
|
filter "platforms:macosx-amd64-*oal"
|
||||||
includedirs { "/usr/local/opt/openal-soft/include" }
|
includedirs { "/usr/local/opt/openal-soft/include" }
|
||||||
libdirs { "/usr/local/opt/openal-soft/lib" }
|
libdirs { "/usr/local/opt/openal-soft/lib" }
|
||||||
|
|
||||||
|
@ -437,10 +455,18 @@ project "reLCS"
|
||||||
includedirs { "/usr/local/include" }
|
includedirs { "/usr/local/include" }
|
||||||
libdirs { "/usr/local/lib" }
|
libdirs { "/usr/local/lib" }
|
||||||
|
|
||||||
filter "platforms:macosx*gl3_glfw*"
|
filter "platforms:macosx-arm64-*gl3_glfw*"
|
||||||
links { "glfw" }
|
links { "glfw" }
|
||||||
linkoptions { "-framework OpenGL" }
|
linkoptions { "-framework OpenGL" }
|
||||||
includedirs { "/opt/local/include" }
|
includedirs { "/opt/local/include" }
|
||||||
includedirs { "/usr/local/include" }
|
includedirs {"/opt/homebrew/include" }
|
||||||
|
libdirs { "/opt/local/lib" }
|
||||||
|
libdirs { "/opt/homebrew/lib" }
|
||||||
|
|
||||||
|
filter "platforms:macosx-amd64-*gl3_glfw*"
|
||||||
|
links { "glfw" }
|
||||||
|
linkoptions { "-framework OpenGL" }
|
||||||
|
includedirs { "/opt/local/include" }
|
||||||
|
includedirs {"/usr/local/include" }
|
||||||
libdirs { "/opt/local/lib" }
|
libdirs { "/opt/local/lib" }
|
||||||
libdirs { "/usr/local/lib" }
|
libdirs { "/usr/local/lib" }
|
||||||
|
|
24
printHash.sh
24
printHash.sh
|
@ -1,12 +1,14 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env sh
|
||||||
|
if [ -z "${1}" ]
|
||||||
> $1
|
then
|
||||||
|
printf "%s\n" "Input the path to the file for writing the commit hash to."
|
||||||
echo -n "#define GIT_SHA1 \"" > $1
|
else
|
||||||
|
printf "%s" "#define GIT_SHA1 \"" > $1
|
||||||
if (command -v "git" >/dev/null) then
|
|
||||||
git rev-parse --short HEAD | tr -d '\n' >> $1
|
if (command -v "git" >/dev/null) then
|
||||||
|
git rev-parse --short HEAD | tr -d '\n' >> $1
|
||||||
|
fi
|
||||||
|
|
||||||
|
printf "%s\n" "\"" >> $1
|
||||||
|
printf "%s\n" "const char* g_GIT_SHA1 = GIT_SHA1;" >> $1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "\"" >> $1
|
|
||||||
echo "const char* g_GIT_SHA1 = GIT_SHA1;" >> $1
|
|
|
@ -9447,7 +9447,7 @@ const MissionAudioData MissionAudioNameSfxAssoc[] = {
|
||||||
{"lanamu1", SFX_SFX_LANAMU1},
|
{"lanamu1", SFX_SFX_LANAMU1},
|
||||||
{"lanamu2", SFX_SFX_LANAMU2},
|
{"lanamu2", SFX_SFX_LANAMU2},
|
||||||
{"airhrnl", SFX_SFX_AIRHORN_LEFT},
|
{"airhrnl", SFX_SFX_AIRHORN_LEFT},
|
||||||
{"airhrnr", SFX_SFX_AIRHORN_RIGH},
|
{"airhrnr", SFX_SFX_AIRHORN_RIGHT},
|
||||||
{"sniper", SFX_SFX_SNIPER_SHOT_1},
|
{"sniper", SFX_SFX_SNIPER_SHOT_1},
|
||||||
{"snipsh", SFX_SFX_SNIPER_SHOT_2},
|
{"snipsh", SFX_SFX_SNIPER_SHOT_2},
|
||||||
{"bloroof", SFX_SFX_BLOW_ROOF},
|
{"bloroof", SFX_SFX_BLOW_ROOF},
|
||||||
|
@ -11293,9 +11293,8 @@ cAudioManager::PreloadMissionAudio(uint8 slot, Const char *name)
|
||||||
m_sMissionAudio.m_nLoadingStatus[slot] = LOADING_STATUS_NOT_LOADED;
|
m_sMissionAudio.m_nLoadingStatus[slot] = LOADING_STATUS_NOT_LOADED;
|
||||||
m_sMissionAudio.m_nPlayStatus[slot] = PLAY_STATUS_STOPPED;
|
m_sMissionAudio.m_nPlayStatus[slot] = PLAY_STATUS_STOPPED;
|
||||||
m_sMissionAudio.m_bIsPlaying[slot] = FALSE;
|
m_sMissionAudio.m_bIsPlaying[slot] = FALSE;
|
||||||
//m_sMissionAudio.m_nMissionAudioCounter[slot] = m_nTimeSpent * SampleManager.GetStreamedFileLength(missionAudioSfx) / 1000;
|
|
||||||
m_sMissionAudio.m_nMissionAudioCounter[slot] = m_nTimeSpent * SampleManager.GetSampleLength(missionAudioSfx) / SampleManager.GetSampleBaseFrequency(missionAudioSfx);
|
m_sMissionAudio.m_nMissionAudioCounter[slot] = m_nTimeSpent * SampleManager.GetSampleLength(missionAudioSfx) / SampleManager.GetSampleBaseFrequency(missionAudioSfx);
|
||||||
m_sMissionAudio.m_nMissionAudioCounter[slot] *= 4;
|
m_sMissionAudio.m_nMissionAudioCounter[slot] = 11 * m_sMissionAudio.m_nMissionAudioCounter[slot] / 10;
|
||||||
m_sMissionAudio.m_bIsPlayed[slot] = FALSE;
|
m_sMissionAudio.m_bIsPlayed[slot] = FALSE;
|
||||||
m_sMissionAudio.m_bPredefinedProperties[slot] = TRUE;
|
m_sMissionAudio.m_bPredefinedProperties[slot] = TRUE;
|
||||||
g_bMissionAudioLoadFailed[slot] = FALSE;
|
g_bMissionAudioLoadFailed[slot] = FALSE;
|
||||||
|
@ -11379,7 +11378,6 @@ cAudioManager::ClearMissionAudio(uint8 slot)
|
||||||
m_sMissionAudio.m_bPredefinedProperties[slot] = TRUE;
|
m_sMissionAudio.m_bPredefinedProperties[slot] = TRUE;
|
||||||
m_sMissionAudio.m_nMissionAudioCounter[slot] = 0;
|
m_sMissionAudio.m_nMissionAudioCounter[slot] = 0;
|
||||||
m_sMissionAudio.m_bIsMobile[slot] = FALSE;
|
m_sMissionAudio.m_bIsMobile[slot] = FALSE;
|
||||||
//SampleManager.StopStreamedFile(slot + 1);
|
|
||||||
SampleManager.StopChannel(slot + CHANNEL_MISSION_AUDIO_1);
|
SampleManager.StopChannel(slot + CHANNEL_MISSION_AUDIO_1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11401,9 +11399,8 @@ cAudioManager::ProcessMissionAudioSlot(uint8 slot)
|
||||||
|
|
||||||
switch (m_sMissionAudio.m_nLoadingStatus[slot]) {
|
switch (m_sMissionAudio.m_nLoadingStatus[slot]) {
|
||||||
case LOADING_STATUS_NOT_LOADED:
|
case LOADING_STATUS_NOT_LOADED:
|
||||||
//SampleManager.PreloadStreamedFile(m_sMissionAudio.m_nSampleIndex[slot], slot + 1);
|
// TODO: LoadMissionAudio
|
||||||
SampleManager.LoadPedComment(m_sMissionAudio.m_nSampleIndex[slot]);
|
SampleManager.LoadPedComment(m_sMissionAudio.m_nSampleIndex[slot]);
|
||||||
SampleManager.InitialiseChannel(slot + CHANNEL_MISSION_AUDIO_1, m_sMissionAudio.m_nSampleIndex[slot], SFX_BANK_PED_COMMENTS);
|
|
||||||
SampleManager.SetChannelFrequency(slot + CHANNEL_MISSION_AUDIO_1, SampleManager.GetSampleBaseFrequency(m_sMissionAudio.m_nSampleIndex[slot]));
|
SampleManager.SetChannelFrequency(slot + CHANNEL_MISSION_AUDIO_1, SampleManager.GetSampleBaseFrequency(m_sMissionAudio.m_nSampleIndex[slot]));
|
||||||
m_sMissionAudio.m_nLoadingStatus[slot] = LOADING_STATUS_LOADED;
|
m_sMissionAudio.m_nLoadingStatus[slot] = LOADING_STATUS_LOADED;
|
||||||
nFramesUntilFailedLoad[slot] = 0;
|
nFramesUntilFailedLoad[slot] = 0;
|
||||||
|
@ -11414,8 +11411,8 @@ cAudioManager::ProcessMissionAudioSlot(uint8 slot)
|
||||||
if (g_bMissionAudioLoadFailed[slot]) {
|
if (g_bMissionAudioLoadFailed[slot]) {
|
||||||
if (m_bTimerJustReset) {
|
if (m_bTimerJustReset) {
|
||||||
ClearMissionAudio(slot);
|
ClearMissionAudio(slot);
|
||||||
|
SampleManager.StopChannel(CHANNEL_POLICE_RADIO);
|
||||||
SampleManager.StopChannel(slot + CHANNEL_MISSION_AUDIO_1);
|
SampleManager.StopChannel(slot + CHANNEL_MISSION_AUDIO_1);
|
||||||
//SampleManager.StopStreamedFile(slot + 1);
|
|
||||||
nFramesForPretendPlaying[slot] = 0;
|
nFramesForPretendPlaying[slot] = 0;
|
||||||
nCheckPlayingDelay[slot] = 0;
|
nCheckPlayingDelay[slot] = 0;
|
||||||
nFramesUntilFailedLoad[slot] = 0;
|
nFramesUntilFailedLoad[slot] = 0;
|
||||||
|
@ -11434,18 +11431,20 @@ cAudioManager::ProcessMissionAudioSlot(uint8 slot)
|
||||||
if (MissionScriptAudioUsesPoliceChannel(m_sMissionAudio.m_nSampleIndex[slot])) {
|
if (MissionScriptAudioUsesPoliceChannel(m_sMissionAudio.m_nSampleIndex[slot])) {
|
||||||
SetMissionScriptPoliceAudio(m_sMissionAudio.m_nSampleIndex[slot]);
|
SetMissionScriptPoliceAudio(m_sMissionAudio.m_nSampleIndex[slot]);
|
||||||
} else {
|
} else {
|
||||||
|
SampleManager.InitialiseChannel(slot + CHANNEL_MISSION_AUDIO_1, m_sMissionAudio.m_nSampleIndex[slot], SFX_BANK_PED_COMMENTS);
|
||||||
if(m_nUserPause)
|
if(m_nUserPause)
|
||||||
// SampleManager.PauseStream(TRUE, slot + 1);
|
SampleManager.SetChannelFrequency(slot + CHANNEL_MISSION_AUDIO_1, 0);
|
||||||
SampleManager.StopChannel(slot + CHANNEL_MISSION_AUDIO_1);
|
else
|
||||||
|
SampleManager.SetChannelFrequency(slot + CHANNEL_MISSION_AUDIO_1, SampleManager.GetSampleBaseFrequency(m_sMissionAudio.m_nSampleIndex[slot]));
|
||||||
if (m_sMissionAudio.m_bPredefinedProperties[slot]) {
|
if (m_sMissionAudio.m_bPredefinedProperties[slot]) {
|
||||||
//if (m_sMissionAudio.m_nSampleIndex[slot] == STREAMED_SOUND_MISSION_CAMERAL)
|
|
||||||
// SampleManager.SetStreamedVolumeAndPan(80, 0, TRUE, slot + 1);
|
|
||||||
//else if (m_sMissionAudio.m_nSampleIndex[slot] == STREAMED_SOUND_MISSION_CAMERAR)
|
|
||||||
// SampleManager.SetStreamedVolumeAndPan(80, 127, TRUE, slot + 1);
|
|
||||||
//else
|
|
||||||
SampleManager.SetChannelPan(slot + CHANNEL_MISSION_AUDIO_1, 63);
|
|
||||||
SampleManager.SetChannelVolume(slot + CHANNEL_MISSION_AUDIO_1, 127);
|
SampleManager.SetChannelVolume(slot + CHANNEL_MISSION_AUDIO_1, 127);
|
||||||
//SampleManager.SetStreamedVolumeAndPan(80, 63, 1, slot + 1);
|
SampleManager.SetChannelPan(slot + CHANNEL_MISSION_AUDIO_1, 63);
|
||||||
|
if (m_sMissionAudio.m_nSampleIndex[slot] == SFX_SFX_CAMERA_LEFT || m_sMissionAudio.m_nSampleIndex[slot] == SFX_SFX_AIRHORN_LEFT)
|
||||||
|
SampleManager.SetChannelPan(slot + CHANNEL_MISSION_AUDIO_1, 0);
|
||||||
|
else if (m_sMissionAudio.m_nSampleIndex[slot] == SFX_SFX_CAMERA_RIGHT || m_sMissionAudio.m_nSampleIndex[slot] == SFX_SFX_AIRHORN_RIGHT)
|
||||||
|
SampleManager.SetChannelPan(slot + CHANNEL_MISSION_AUDIO_1, 127);
|
||||||
|
else
|
||||||
|
SampleManager.SetChannelPan(slot + CHANNEL_MISSION_AUDIO_1, 63);
|
||||||
} else {
|
} else {
|
||||||
distSquared = GetDistanceSquared(m_sMissionAudio.m_vecPos[slot]);
|
distSquared = GetDistanceSquared(m_sMissionAudio.m_vecPos[slot]);
|
||||||
if (distSquared >= SQR(80.0f)) {
|
if (distSquared >= SQR(80.0f)) {
|
||||||
|
@ -11460,22 +11459,18 @@ cAudioManager::ProcessMissionAudioSlot(uint8 slot)
|
||||||
TranslateEntity(&m_sMissionAudio.m_vecPos[slot], &vec);
|
TranslateEntity(&m_sMissionAudio.m_vecPos[slot], &vec);
|
||||||
pan = ComputePan(80.f, &vec);
|
pan = ComputePan(80.f, &vec);
|
||||||
}
|
}
|
||||||
SampleManager.SetChannelPan(slot + CHANNEL_MISSION_AUDIO_1, pan);
|
|
||||||
SampleManager.SetChannelVolume(slot + CHANNEL_MISSION_AUDIO_1, emittingVol);
|
SampleManager.SetChannelVolume(slot + CHANNEL_MISSION_AUDIO_1, emittingVol);
|
||||||
//SampleManager.SetStreamedVolumeAndPan(emittingVol, pan, 1, slot + 1);
|
SampleManager.SetChannelPan(slot + CHANNEL_MISSION_AUDIO_1, pan);
|
||||||
}
|
}
|
||||||
//SampleManager.StartPreloadedStreamedFile(slot + 1);
|
|
||||||
SampleManager.StartChannel(slot + CHANNEL_MISSION_AUDIO_1);
|
SampleManager.StartChannel(slot + CHANNEL_MISSION_AUDIO_1);
|
||||||
}
|
}
|
||||||
m_sMissionAudio.m_nPlayStatus[slot] = PLAY_STATUS_PLAYING;
|
m_sMissionAudio.m_nPlayStatus[slot] = PLAY_STATUS_PLAYING;
|
||||||
nCheckPlayingDelay[slot] = 30;
|
nCheckPlayingDelay[slot] = 30;
|
||||||
//if (m_sMissionAudio.m_nSampleIndex[slot] >= STREAMED_SOUND_MISSION_MOB_01A && m_sMissionAudio.m_nSampleIndex[slot] <= STREAMED_SOUND_MISSION_MOB_99A)
|
|
||||||
// m_sMissionAudio.m_bIsMobile[slot] = TRUE;
|
|
||||||
break;
|
break;
|
||||||
case PLAY_STATUS_PLAYING:
|
case PLAY_STATUS_PLAYING:
|
||||||
if (m_bTimerJustReset) {
|
if (m_bTimerJustReset) {
|
||||||
ClearMissionAudio(slot);
|
ClearMissionAudio(slot);
|
||||||
//SampleManager.StopStreamedFile(slot + 1);
|
SampleManager.StopChannel(CHANNEL_POLICE_RADIO);
|
||||||
SampleManager.StopChannel(slot + CHANNEL_MISSION_AUDIO_1);
|
SampleManager.StopChannel(slot + CHANNEL_MISSION_AUDIO_1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -11484,25 +11479,20 @@ cAudioManager::ProcessMissionAudioSlot(uint8 slot)
|
||||||
if (nCheckPlayingDelay[slot]) {
|
if (nCheckPlayingDelay[slot]) {
|
||||||
--nCheckPlayingDelay[slot];
|
--nCheckPlayingDelay[slot];
|
||||||
} else if ((g_bMissionAudioLoadFailed[slot] && m_sMissionAudio.m_nMissionAudioCounter[slot]-- == 0) || GetMissionScriptPoliceAudioPlayingStatus() == PLAY_STATUS_FINISHED) {
|
} else if ((g_bMissionAudioLoadFailed[slot] && m_sMissionAudio.m_nMissionAudioCounter[slot]-- == 0) || GetMissionScriptPoliceAudioPlayingStatus() == PLAY_STATUS_FINISHED) {
|
||||||
|
debug("FINISHED PLAYINGXXXXXXXXXXXXX");
|
||||||
m_sMissionAudio.m_nPlayStatus[slot] = PLAY_STATUS_FINISHED;
|
m_sMissionAudio.m_nPlayStatus[slot] = PLAY_STATUS_FINISHED;
|
||||||
//if (m_sMissionAudio.m_nSampleIndex[slot] >= STREAMED_SOUND_MISSION_MOB_01A && m_sMissionAudio.m_nSampleIndex[slot] <= STREAMED_SOUND_MISSION_MOB_99A)
|
|
||||||
// m_sMissionAudio.m_bIsMobile[slot] = FALSE;
|
|
||||||
m_sMissionAudio.m_nSampleIndex[slot] = NO_SAMPLE;
|
m_sMissionAudio.m_nSampleIndex[slot] = NO_SAMPLE;
|
||||||
//SampleManager.StopStreamedFile(slot + 1);
|
SampleManager.StopChannel(CHANNEL_POLICE_RADIO);
|
||||||
SampleManager.StopChannel(slot + CHANNEL_MISSION_AUDIO_1);
|
|
||||||
m_sMissionAudio.m_nMissionAudioCounter[slot] = 0;
|
m_sMissionAudio.m_nMissionAudioCounter[slot] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (m_sMissionAudio.m_bIsPlaying[slot]) {
|
} else if (m_sMissionAudio.m_bIsPlaying[slot]) {
|
||||||
//if (SampleManager.IsStreamPlaying(slot + 1) || m_nUserPause || m_nPreviousUserPause) {
|
|
||||||
if(SampleManager.GetChannelUsedFlag(slot + CHANNEL_MISSION_AUDIO_1) || m_nUserPause || m_nPreviousUserPause) {
|
if(SampleManager.GetChannelUsedFlag(slot + CHANNEL_MISSION_AUDIO_1) || m_nUserPause || m_nPreviousUserPause) {
|
||||||
if(m_nUserPause)
|
if(m_nUserPause)
|
||||||
//SampleManager.PauseStream(TRUE, slot + 1);
|
SampleManager.SetChannelFrequency(slot + CHANNEL_MISSION_AUDIO_1, 0);
|
||||||
SampleManager.StopChannel(slot + CHANNEL_MISSION_AUDIO_1);
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//SampleManager.PauseStream(FALSE, slot + 1);
|
SampleManager.SetChannelFrequency(slot + CHANNEL_MISSION_AUDIO_1, SampleManager.GetSampleBaseFrequency(m_sMissionAudio.m_nSampleIndex[slot]));
|
||||||
//SampleManager.StartChannel(slot + CHANNEL_MISSION_AUDIO_1);
|
|
||||||
if (!m_sMissionAudio.m_bPredefinedProperties[slot]) {
|
if (!m_sMissionAudio.m_bPredefinedProperties[slot]) {
|
||||||
distSquared = GetDistanceSquared(m_sMissionAudio.m_vecPos[slot]);
|
distSquared = GetDistanceSquared(m_sMissionAudio.m_vecPos[slot]);
|
||||||
if (distSquared >= SQR(80.0f)) {
|
if (distSquared >= SQR(80.0f)) {
|
||||||
|
@ -11517,19 +11507,13 @@ cAudioManager::ProcessMissionAudioSlot(uint8 slot)
|
||||||
TranslateEntity(&m_sMissionAudio.m_vecPos[slot], &vec);
|
TranslateEntity(&m_sMissionAudio.m_vecPos[slot], &vec);
|
||||||
pan = ComputePan(80.f, &vec);
|
pan = ComputePan(80.f, &vec);
|
||||||
}
|
}
|
||||||
SampleManager.SetChannelPan(slot + CHANNEL_MISSION_AUDIO_1, pan);
|
|
||||||
SampleManager.SetChannelVolume(slot + CHANNEL_MISSION_AUDIO_1, emittingVol);
|
SampleManager.SetChannelVolume(slot + CHANNEL_MISSION_AUDIO_1, emittingVol);
|
||||||
//SampleManager.SetStreamedVolumeAndPan(emittingVol, pan, 1, slot + 1);
|
SampleManager.SetChannelPan(slot + CHANNEL_MISSION_AUDIO_1, pan);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//} else if (m_sMissionAudio.m_nSampleIndex[slot] == STREAMED_SOUND_MISSION_ROK2_01) {
|
|
||||||
// m_sMissionAudio.m_nPlayStatus[slot] = PLAY_STATUS_STOPPED;
|
|
||||||
} else {
|
} else {
|
||||||
m_sMissionAudio.m_nPlayStatus[slot] = PLAY_STATUS_FINISHED;
|
m_sMissionAudio.m_nPlayStatus[slot] = PLAY_STATUS_FINISHED;
|
||||||
//if (m_sMissionAudio.m_nSampleIndex[slot] >= STREAMED_SOUND_MISSION_MOB_01A && m_sMissionAudio.m_nSampleIndex[slot] <= STREAMED_SOUND_MISSION_MOB_99A)
|
|
||||||
// m_sMissionAudio.m_bIsMobile[slot] = FALSE;
|
|
||||||
m_sMissionAudio.m_nSampleIndex[slot] = NO_SAMPLE;
|
m_sMissionAudio.m_nSampleIndex[slot] = NO_SAMPLE;
|
||||||
//SampleManager.StopStreamedFile(slot + 1);
|
|
||||||
SampleManager.StopChannel(slot + CHANNEL_MISSION_AUDIO_1);
|
SampleManager.StopChannel(slot + CHANNEL_MISSION_AUDIO_1);
|
||||||
m_sMissionAudio.m_nMissionAudioCounter[slot] = 0;
|
m_sMissionAudio.m_nMissionAudioCounter[slot] = 0;
|
||||||
}
|
}
|
||||||
|
@ -11537,7 +11521,6 @@ cAudioManager::ProcessMissionAudioSlot(uint8 slot)
|
||||||
if (m_nUserPause)
|
if (m_nUserPause)
|
||||||
break;
|
break;
|
||||||
if (nCheckPlayingDelay[slot]--) {
|
if (nCheckPlayingDelay[slot]--) {
|
||||||
//if (!SampleManager.IsStreamPlaying(slot + 1))
|
|
||||||
if (!SampleManager.GetChannelUsedFlag(slot + CHANNEL_MISSION_AUDIO_1))
|
if (!SampleManager.GetChannelUsedFlag(slot + CHANNEL_MISSION_AUDIO_1))
|
||||||
break;
|
break;
|
||||||
nCheckPlayingDelay[slot] = 0;
|
nCheckPlayingDelay[slot] = 0;
|
||||||
|
|
|
@ -447,9 +447,17 @@ cAudioManager::ServiceSoundEffects()
|
||||||
#endif
|
#endif
|
||||||
m_bFifthFrameFlag = (m_FrameCounter++ % 5) == 0;
|
m_bFifthFrameFlag = (m_FrameCounter++ % 5) == 0;
|
||||||
if (m_nUserPause && !m_nPreviousUserPause) {
|
if (m_nUserPause && !m_nPreviousUserPause) {
|
||||||
for (int32 i = 0; i < NUM_CHANNELS; i++)
|
for (int32 i = 0; i < NUM_CHANNELS_GENERIC; i++)
|
||||||
SampleManager.StopChannel(i);
|
SampleManager.StopChannel(i);
|
||||||
|
|
||||||
|
SampleManager.SetChannelFrequency(CHANNEL_POLICE_RADIO, 0);
|
||||||
|
SampleManager.SetChannelFrequency(CHANNEL_MISSION_AUDIO_1, 0);
|
||||||
|
SampleManager.SetChannelFrequency(CHANNEL_MISSION_AUDIO_2, 0);
|
||||||
|
|
||||||
|
// ps2 code just stops the sound here for some reason
|
||||||
|
//SampleManager.StopChannel(CHANNEL_MISSION_AUDIO_1);
|
||||||
|
//SampleManager.StopChannel(CHANNEL_MISSION_AUDIO_2);
|
||||||
|
|
||||||
ClearRequestedQueue();
|
ClearRequestedQueue();
|
||||||
if (m_nActiveSampleQueue) {
|
if (m_nActiveSampleQueue) {
|
||||||
m_nActiveSampleQueue = 0;
|
m_nActiveSampleQueue = 0;
|
||||||
|
|
|
@ -4017,7 +4017,7 @@ enum eSfxSample
|
||||||
SFX_SCUM_WOM_GUN_THREATENED_2,
|
SFX_SCUM_WOM_GUN_THREATENED_2,
|
||||||
SFX_SCUM_WOM_SHOCKED_1,
|
SFX_SCUM_WOM_SHOCKED_1,
|
||||||
SFX_SFX_AIRHORN_LEFT,
|
SFX_SFX_AIRHORN_LEFT,
|
||||||
SFX_SFX_AIRHORN_RIGH,
|
SFX_SFX_AIRHORN_RIGHT,
|
||||||
SFX_SFX_ANG1_AA,
|
SFX_SFX_ANG1_AA,
|
||||||
SFX_SFX_ANG1_AB,
|
SFX_SFX_ANG1_AB,
|
||||||
SFX_SFX_ANG1_AC,
|
SFX_SFX_ANG1_AC,
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
#define WITHWINDOWS
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
|
||||||
#ifdef AUDIO_MSS
|
#ifdef AUDIO_MSS
|
||||||
|
|
|
@ -114,7 +114,7 @@ cSampleManager::SetMusicMasterVolume(uint8 nVolume)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
cSampleManager::SetMusicMasterVolume(uint8 nVolume)
|
cSampleManager::SetMP3BoostVolume(uint8 nVolume)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -231,35 +231,35 @@ cSampleManager::InitialiseChannel(uint32 nChannel, uint32 nSfx, uint8 nBank)
|
||||||
void
|
void
|
||||||
cSampleManager::SetChannelEmittingVolume(uint32 nChannel, uint32 nVolume)
|
cSampleManager::SetChannelEmittingVolume(uint32 nChannel, uint32 nVolume)
|
||||||
{
|
{
|
||||||
ASSERT( nChannel != CHANNEL2D );
|
ASSERT( nChannel < MAXCHANNELS );
|
||||||
ASSERT( nChannel < MAXCHANNELS+MAX2DCHANNELS );
|
ASSERT( nChannel < MAXCHANNELS+MAX2DCHANNELS );
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
cSampleManager::SetChannel3DPosition(uint32 nChannel, float fX, float fY, float fZ)
|
cSampleManager::SetChannel3DPosition(uint32 nChannel, float fX, float fY, float fZ)
|
||||||
{
|
{
|
||||||
ASSERT( nChannel != CHANNEL2D );
|
ASSERT( nChannel < MAXCHANNELS );
|
||||||
ASSERT( nChannel < MAXCHANNELS+MAX2DCHANNELS );
|
ASSERT( nChannel < MAXCHANNELS+MAX2DCHANNELS );
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
cSampleManager::SetChannel3DDistances(uint32 nChannel, float fMax, float fMin)
|
cSampleManager::SetChannel3DDistances(uint32 nChannel, float fMax, float fMin)
|
||||||
{
|
{
|
||||||
ASSERT( nChannel != CHANNEL2D );
|
ASSERT( nChannel < MAXCHANNELS );
|
||||||
ASSERT( nChannel < MAXCHANNELS+MAX2DCHANNELS );
|
ASSERT( nChannel < MAXCHANNELS+MAX2DCHANNELS );
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
cSampleManager::SetChannelVolume(uint32 nChannel, uint32 nVolume)
|
cSampleManager::SetChannelVolume(uint32 nChannel, uint32 nVolume)
|
||||||
{
|
{
|
||||||
ASSERT( nChannel == CHANNEL2D );
|
ASSERT( nChannel >= MAXCHANNELS );
|
||||||
ASSERT( nChannel < MAXCHANNELS+MAX2DCHANNELS );
|
ASSERT( nChannel < MAXCHANNELS+MAX2DCHANNELS );
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
cSampleManager::SetChannelPan(uint32 nChannel, uint32 nPan)
|
cSampleManager::SetChannelPan(uint32 nChannel, uint32 nPan)
|
||||||
{
|
{
|
||||||
ASSERT(nChannel == CHANNEL2D);
|
ASSERT( nChannel >= MAXCHANNELS );
|
||||||
ASSERT( nChannel < MAXCHANNELS+MAX2DCHANNELS );
|
ASSERT( nChannel < MAXCHANNELS+MAX2DCHANNELS );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2573,20 +2573,16 @@ void CTheScripts::Shutdown()
|
||||||
int scriptToLoad = 0;
|
int scriptToLoad = 0;
|
||||||
const char *scriptfile = "main.scm";
|
const char *scriptfile = "main.scm";
|
||||||
|
|
||||||
#ifdef _WIN32
|
|
||||||
#include <Windows.h>
|
|
||||||
#endif
|
|
||||||
int open_script()
|
int open_script()
|
||||||
{
|
{
|
||||||
// glfwGetKey doesn't work because of CGame::Initialise is blocking
|
// glfwGetKey doesn't work because of CGame::Initialise is blocking
|
||||||
#ifdef _WIN32
|
CPad::UpdatePads();
|
||||||
if (GetAsyncKeyState('G') & 0x8000)
|
if (CPad::GetPad(0)->GetChar('G'))
|
||||||
scriptToLoad = 0;
|
scriptToLoad = 0;
|
||||||
if (GetAsyncKeyState('R') & 0x8000)
|
if (CPad::GetPad(0)->GetChar('R'))
|
||||||
scriptToLoad = 1;
|
scriptToLoad = 1;
|
||||||
if (GetAsyncKeyState('D') & 0x8000)
|
if (CPad::GetPad(0)->GetChar('D'))
|
||||||
scriptToLoad = 2;
|
scriptToLoad = 2;
|
||||||
#endif
|
|
||||||
switch (scriptToLoad) {
|
switch (scriptToLoad) {
|
||||||
case 0: scriptfile = "main.scm"; break;
|
case 0: scriptfile = "main.scm"; break;
|
||||||
case 1: scriptfile = "freeroam_lcs.scm"; break;
|
case 1: scriptfile = "freeroam_lcs.scm"; break;
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <sys/resource.h>
|
#include <sys/resource.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
#include <limits.h>
|
||||||
|
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
#include <sys/syscall.h>
|
#include <sys/syscall.h>
|
||||||
|
|
|
@ -4575,19 +4575,11 @@ CMenuManager::ProcessUserInput(uint8 goDown, uint8 goUp, uint8 optionSelected, u
|
||||||
|
|
||||||
#ifdef USE_DEBUG_SCRIPT_LOADER
|
#ifdef USE_DEBUG_SCRIPT_LOADER
|
||||||
if (m_nCurrScreen == MENUPAGE_START_MENU || m_nCurrScreen == MENUPAGE_NEW_GAME || m_nCurrScreen == MENUPAGE_NEW_GAME_RELOAD) {
|
if (m_nCurrScreen == MENUPAGE_START_MENU || m_nCurrScreen == MENUPAGE_NEW_GAME || m_nCurrScreen == MENUPAGE_NEW_GAME_RELOAD) {
|
||||||
#ifdef RW_GL3
|
if (CPad::GetPad(0)->GetChar('R')) {
|
||||||
if (glfwGetKey(PSGLOBAL(window), GLFW_KEY_R) == GLFW_PRESS) {
|
|
||||||
scriptToLoad = 1;
|
scriptToLoad = 1;
|
||||||
DoSettingsBeforeStartingAGame();
|
DoSettingsBeforeStartingAGame();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#elif defined _WIN32
|
|
||||||
if (GetAsyncKeyState('R') & 0x8000) {
|
|
||||||
scriptToLoad = 1;
|
|
||||||
DoSettingsBeforeStartingAGame();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -470,6 +470,11 @@ static_assert(false, "SUPPORT_XBOX_SCRIPT and SUPPORT_MOBILE_SCRIPT are mutually
|
||||||
#undef DISABLE_LOADING_SCREEN
|
#undef DISABLE_LOADING_SCREEN
|
||||||
#undef DISABLE_VSYNC_ON_TEXTURE_CONVERSION
|
#undef DISABLE_VSYNC_ON_TEXTURE_CONVERSION
|
||||||
|
|
||||||
|
#undef EXTENDED_COLOURFILTER
|
||||||
|
#undef EXTENDED_PIPELINES
|
||||||
|
#undef SCREEN_DROPLETS
|
||||||
|
#undef NEW_RENDERER
|
||||||
|
|
||||||
#undef FIX_SPRITES
|
#undef FIX_SPRITES
|
||||||
|
|
||||||
#define PC_WATER
|
#define PC_WATER
|
||||||
|
|
|
@ -387,7 +387,7 @@ DoRWStuffEndOfFrame(void)
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
if (CPad::GetPad(1)->GetLeftShockJustDown() || CPad::GetPad(0)->GetFJustDown(11)) {
|
if (CPad::GetPad(1)->GetLeftShockJustDown() || CPad::GetPad(0)->GetFJustDown(11)) {
|
||||||
sprintf(s, "screen_0%11lld.png", time(nil));
|
sprintf(s, "screen_%011lld.png", time(nil));
|
||||||
RwGrabScreen(Scene.camera, s);
|
RwGrabScreen(Scene.camera, s);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
#include <limits.h>
|
||||||
|
|
||||||
// This is the common include for platform/renderer specific skeletons(glfw.cpp, win.cpp etc.) and using cross platform things (like Windows directories wrapper, platform specific global arrays etc.)
|
// This is the common include for platform/renderer specific skeletons(glfw.cpp, win.cpp etc.) and using cross platform things (like Windows directories wrapper, platform specific global arrays etc.)
|
||||||
// Functions that's different on glfw and win but have same signature, should be located on platform.h.
|
// Functions that's different on glfw and win but have same signature, should be located on platform.h.
|
||||||
|
|
|
@ -817,11 +817,12 @@ CVehicle::ProcessWheel(CVector &wheelFwd, CVector &wheelRight, CVector &wheelCon
|
||||||
if(contactSpeedRight != 0.0f){
|
if(contactSpeedRight != 0.0f){
|
||||||
// exert opposing force
|
// exert opposing force
|
||||||
right = -contactSpeedRight/wheelsOnGround;
|
right = -contactSpeedRight/wheelsOnGround;
|
||||||
#ifdef FIX_BUGS
|
// BUG?
|
||||||
// contactSpeedRight is independent of framerate but right has timestep as a factor
|
// contactSpeedRight is independent of framerate but right has timestep as a factor
|
||||||
// so we probably have to fix this
|
// so we probably have to fix this
|
||||||
right *= CTimer::GetTimeStepFix();
|
// fixing this causes jittery cars at 15fps, and causes the car to move backwards slowly at 18fps
|
||||||
#endif
|
// at 19fps, the effects are gone ...
|
||||||
|
//right *= CTimer::GetTimeStepFix();
|
||||||
|
|
||||||
if(wheelStatus == WHEEL_STATUS_BURST){
|
if(wheelStatus == WHEEL_STATUS_BURST){
|
||||||
float fwdspeed = Min(contactSpeedFwd, fBurstSpeedMax);
|
float fwdspeed = Min(contactSpeedFwd, fBurstSpeedMax);
|
||||||
|
|
Binary file not shown.
2
vendor/librw
vendored
2
vendor/librw
vendored
|
@ -1 +1 @@
|
||||||
Subproject commit af20de45226f5152a035866da32517466e81142d
|
Subproject commit a5bc97232293250ae1bbd6ef6642532a541034ca
|
Loading…
Reference in a new issue