mirror of
https://github.com/GTAmodding/re3.git
synced 2024-11-26 09:33:43 +00:00
Merge remote-tracking branch 'upstream/lcs' into lcs
This commit is contained in:
commit
62425b5866
18 changed files with 152 additions and 103 deletions
2
.github/workflows/reLCS_msvc_amd64.yml
vendored
2
.github/workflows/reLCS_msvc_amd64.yml
vendored
|
@ -34,7 +34,7 @@ jobs:
|
||||||
7z x ${{env.GLFW_FILE}}
|
7z x ${{env.GLFW_FILE}}
|
||||||
- name: Configure build
|
- name: Configure build
|
||||||
run: |
|
run: |
|
||||||
./premake5 vs2019 --with-librw --glfwdir64=${{env.GLFW_BASE}}
|
./premake5 vs2019 --with-librw --no-full-paths --glfwdir64=${{env.GLFW_BASE}}
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
msbuild -m build/reLCS.sln /property:Configuration=${{matrix.buildtype}} /property:Platform=${{matrix.platform}}
|
msbuild -m build/reLCS.sln /property:Configuration=${{matrix.buildtype}} /property:Platform=${{matrix.platform}}
|
||||||
|
|
2
.github/workflows/reLCS_msvc_x86.yml
vendored
2
.github/workflows/reLCS_msvc_x86.yml
vendored
|
@ -34,7 +34,7 @@ jobs:
|
||||||
7z x ${{env.GLFW_FILE}}
|
7z x ${{env.GLFW_FILE}}
|
||||||
- name: Configure build
|
- name: Configure build
|
||||||
run: |
|
run: |
|
||||||
./premake5 vs2019 --with-librw --glfwdir32=${{env.GLFW_BASE}}
|
./premake5 vs2019 --with-librw --no-full-paths --glfwdir32=${{env.GLFW_BASE}}
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
msbuild -m build/reLCS.sln /property:Configuration=${{matrix.buildtype}} /property:Platform=${{matrix.platform}}
|
msbuild -m build/reLCS.sln /property:Configuration=${{matrix.buildtype}} /property:Platform=${{matrix.platform}}
|
||||||
|
|
15
premake5.lua
15
premake5.lua
|
@ -27,14 +27,19 @@ newoption {
|
||||||
description = "Build with opus"
|
description = "Build with opus"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
newoption {
|
||||||
|
trigger = "with-lto",
|
||||||
|
description = "Build with link time optimization"
|
||||||
|
}
|
||||||
|
|
||||||
newoption {
|
newoption {
|
||||||
trigger = "no-git-hash",
|
trigger = "no-git-hash",
|
||||||
description = "Don't print git commit hash into binary"
|
description = "Don't print git commit hash into binary"
|
||||||
}
|
}
|
||||||
|
|
||||||
newoption {
|
newoption {
|
||||||
trigger = "lto",
|
trigger = "no-full-paths",
|
||||||
description = "Use link time optimization"
|
description = "Don't print full paths into binary"
|
||||||
}
|
}
|
||||||
|
|
||||||
if(_OPTIONS["with-librw"]) then
|
if(_OPTIONS["with-librw"]) then
|
||||||
|
@ -121,7 +126,7 @@ workspace "reLCS"
|
||||||
filter "configurations:not Debug"
|
filter "configurations:not Debug"
|
||||||
defines { "NDEBUG" }
|
defines { "NDEBUG" }
|
||||||
optimize "Speed"
|
optimize "Speed"
|
||||||
if(_OPTIONS["lto"]) then
|
if(_OPTIONS["with-lto"]) then
|
||||||
flags { "LinkTimeOptimization" }
|
flags { "LinkTimeOptimization" }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -338,6 +343,10 @@ project "reLCS"
|
||||||
linkoptions "/SAFESEH:NO"
|
linkoptions "/SAFESEH:NO"
|
||||||
characterset ("MBCS")
|
characterset ("MBCS")
|
||||||
targetextension ".exe"
|
targetextension ".exe"
|
||||||
|
if(_OPTIONS["no-full-paths"]) then
|
||||||
|
usefullpaths "off"
|
||||||
|
linkoptions "/PDBALTPATH:%_PDB%"
|
||||||
|
end
|
||||||
if(_OPTIONS["with-librw"]) then
|
if(_OPTIONS["with-librw"]) then
|
||||||
-- external librw is dynamic
|
-- external librw is dynamic
|
||||||
staticruntime "on"
|
staticruntime "on"
|
||||||
|
|
|
@ -1078,7 +1078,7 @@ void
|
||||||
cAudioManager::AdjustSamplesVolume()
|
cAudioManager::AdjustSamplesVolume()
|
||||||
{
|
{
|
||||||
for (int i = 0; i < m_SampleRequestQueuesStatus[m_nActiveSampleQueue]; i++) {
|
for (int i = 0; i < m_SampleRequestQueuesStatus[m_nActiveSampleQueue]; i++) {
|
||||||
tSound *pSample = &m_asSamples[m_nActiveSampleQueue][m_abSampleQueueIndexTable[m_nActiveSampleQueue][i] + 1];
|
tSound *pSample = &m_asSamples[m_nActiveSampleQueue][m_abSampleQueueIndexTable[m_nActiveSampleQueue][i]];
|
||||||
|
|
||||||
if (!pSample->m_bIs2D)
|
if (!pSample->m_bIs2D)
|
||||||
pSample->m_nEmittingVolume = ComputeEmittingVolume(pSample->m_nEmittingVolume, pSample->m_fSoundIntensity, pSample->m_fDistance);
|
pSample->m_nEmittingVolume = ComputeEmittingVolume(pSample->m_nEmittingVolume, pSample->m_fSoundIntensity, pSample->m_fDistance);
|
||||||
|
|
|
@ -292,7 +292,7 @@ CColStore::LoadCollision(const CVector &pos, eLevelName level)
|
||||||
}else{
|
}else{
|
||||||
for (int j = 0; j < MAX_CLEANUP; j++) {
|
for (int j = 0; j < MAX_CLEANUP; j++) {
|
||||||
CPhysical* pEntity = nil;
|
CPhysical* pEntity = nil;
|
||||||
cleanup_entity_struct* pCleanup = &CTheScripts::MissionCleanUp.m_sEntities[i];
|
cleanup_entity_struct* pCleanup = &CTheScripts::MissionCleanUp.m_sEntities[j];
|
||||||
if (pCleanup->type == CLEANUP_CAR) {
|
if (pCleanup->type == CLEANUP_CAR) {
|
||||||
pEntity = CPools::GetVehiclePool()->GetAt(pCleanup->id);
|
pEntity = CPools::GetVehiclePool()->GetAt(pCleanup->id);
|
||||||
if (!pEntity || pEntity->GetStatus() == STATUS_WRECKED)
|
if (!pEntity || pEntity->GetStatus() == STATUS_WRECKED)
|
||||||
|
|
|
@ -159,7 +159,7 @@ CGameLogic::Update()
|
||||||
#endif
|
#endif
|
||||||
CMessages::ClearMessages();
|
CMessages::ClearMessages();
|
||||||
CCarCtrl::ClearInterestingVehicleList();
|
CCarCtrl::ClearInterestingVehicleList();
|
||||||
CWorld::ClearExcitingStuffFromArea(pPlayerInfo.GetPos(), 4000.0f, 1);
|
CWorld::ClearExcitingStuffFromArea(pPlayerInfo.GetPos(), 4000.0f, true);
|
||||||
CRestart::FindClosestHospitalRestartPoint(pPlayerInfo.GetPos(), &vecRestartPos, &fRestartFloat);
|
CRestart::FindClosestHospitalRestartPoint(pPlayerInfo.GetPos(), &vecRestartPos, &fRestartFloat);
|
||||||
CRestart::OverrideHospitalLevel = LEVEL_GENERIC;
|
CRestart::OverrideHospitalLevel = LEVEL_GENERIC;
|
||||||
CRestart::OverridePoliceStationLevel = LEVEL_GENERIC;
|
CRestart::OverridePoliceStationLevel = LEVEL_GENERIC;
|
||||||
|
@ -192,7 +192,7 @@ CGameLogic::Update()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (!CTheScripts::IsPlayerOnAMission() && pPlayerInfo.m_nBustedAudioStatus == 0) {
|
if (!CTheScripts::IsPlayerOnAMission() && pPlayerInfo.m_nBustedAudioStatus == BUSTEDAUDIO_NONE) {
|
||||||
if (CGeneral::GetRandomNumberInRange(0, 4) == 0)
|
if (CGeneral::GetRandomNumberInRange(0, 4) == 0)
|
||||||
pPlayerInfo.m_nBustedAudioStatus = BUSTEDAUDIO_DONE;
|
pPlayerInfo.m_nBustedAudioStatus = BUSTEDAUDIO_DONE;
|
||||||
else {
|
else {
|
||||||
|
@ -268,7 +268,7 @@ CGameLogic::Update()
|
||||||
#endif
|
#endif
|
||||||
CMessages::ClearMessages();
|
CMessages::ClearMessages();
|
||||||
CCarCtrl::ClearInterestingVehicleList();
|
CCarCtrl::ClearInterestingVehicleList();
|
||||||
CWorld::ClearExcitingStuffFromArea(pPlayerInfo.GetPos(), 4000.0f, 1);
|
CWorld::ClearExcitingStuffFromArea(pPlayerInfo.GetPos(), 4000.0f, true);
|
||||||
CRestart::FindClosestPoliceRestartPoint(pPlayerInfo.GetPos(), &vecRestartPos, &fRestartFloat);
|
CRestart::FindClosestPoliceRestartPoint(pPlayerInfo.GetPos(), &vecRestartPos, &fRestartFloat);
|
||||||
CRestart::OverrideHospitalLevel = LEVEL_GENERIC;
|
CRestart::OverrideHospitalLevel = LEVEL_GENERIC;
|
||||||
CRestart::OverridePoliceStationLevel = LEVEL_GENERIC;
|
CRestart::OverridePoliceStationLevel = LEVEL_GENERIC;
|
||||||
|
@ -323,7 +323,7 @@ CGameLogic::Update()
|
||||||
#endif
|
#endif
|
||||||
CMessages::ClearMessages();
|
CMessages::ClearMessages();
|
||||||
CCarCtrl::ClearInterestingVehicleList();
|
CCarCtrl::ClearInterestingVehicleList();
|
||||||
CWorld::ClearExcitingStuffFromArea(pPlayerInfo.GetPos(), 4000.0f, 1);
|
CWorld::ClearExcitingStuffFromArea(pPlayerInfo.GetPos(), 4000.0f, true);
|
||||||
CRestart::FindClosestPoliceRestartPoint(pPlayerInfo.GetPos(), &vecRestartPos, &fRestartFloat);
|
CRestart::FindClosestPoliceRestartPoint(pPlayerInfo.GetPos(), &vecRestartPos, &fRestartFloat);
|
||||||
CRestart::OverridePoliceStationLevel = LEVEL_GENERIC;
|
CRestart::OverridePoliceStationLevel = LEVEL_GENERIC;
|
||||||
CRestart::OverrideHospitalLevel = LEVEL_GENERIC;
|
CRestart::OverrideHospitalLevel = LEVEL_GENERIC;
|
||||||
|
@ -380,10 +380,10 @@ CGameLogic::RestorePlayerStuffDuringResurrection(CPlayerPed *pPlayerPed, CVector
|
||||||
pPlayerPed->m_fRotationDest = pPlayerPed->m_fRotationCur;
|
pPlayerPed->m_fRotationDest = pPlayerPed->m_fRotationCur;
|
||||||
pPlayerPed->SetHeading(pPlayerPed->m_fRotationCur);
|
pPlayerPed->SetHeading(pPlayerPed->m_fRotationCur);
|
||||||
CTheScripts::ClearSpaceForMissionEntity(pos, pPlayerPed);
|
CTheScripts::ClearSpaceForMissionEntity(pos, pPlayerPed);
|
||||||
CWorld::ClearExcitingStuffFromArea(pos, 4000.0, 1);
|
CWorld::ClearExcitingStuffFromArea(pos, 4000.0f, true);
|
||||||
pPlayerPed->RestoreHeadingRate();
|
pPlayerPed->RestoreHeadingRate();
|
||||||
CGame::currArea = AREA_MAIN_MAP;
|
CGame::currArea = AREA_MAIN_MAP;
|
||||||
CStreaming::RemoveBuildingsNotInArea(0);
|
CStreaming::RemoveBuildingsNotInArea(AREA_MAIN_MAP);
|
||||||
TheCamera.SetCameraDirectlyInFrontForFollowPed_CamOnAString();
|
TheCamera.SetCameraDirectlyInFrontForFollowPed_CamOnAString();
|
||||||
TheCamera.Restore();
|
TheCamera.Restore();
|
||||||
CReferences::RemoveReferencesToPlayer();
|
CReferences::RemoveReferencesToPlayer();
|
||||||
|
@ -490,7 +490,7 @@ CGameLogic::UpdateShortCut()
|
||||||
pShortCutTaxi->AutoPilot.m_nTempAction = TEMPACT_GOFORWARD;
|
pShortCutTaxi->AutoPilot.m_nTempAction = TEMPACT_GOFORWARD;
|
||||||
pShortCutTaxi->AutoPilot.m_nTimeTempAction = CTimer::GetTimeInMilliseconds() + 2500;
|
pShortCutTaxi->AutoPilot.m_nTimeTempAction = CTimer::GetTimeInMilliseconds() + 2500;
|
||||||
TheCamera.SetFadeColour(0, 0, 0);
|
TheCamera.SetFadeColour(0, 0, 0);
|
||||||
TheCamera.Fade(2.5f, 0);
|
TheCamera.Fade(2.5f, FADE_OUT);
|
||||||
ShortCutState = SHORTCUT_TRANSITION;
|
ShortCutState = SHORTCUT_TRANSITION;
|
||||||
ShortCutTimer = CTimer::GetTimeInMilliseconds() + 3000;
|
ShortCutTimer = CTimer::GetTimeInMilliseconds() + 3000;
|
||||||
CMessages::AddBigMessage(TheText.Get("TAXI"), 4500, 1);
|
CMessages::AddBigMessage(TheText.Get("TAXI"), 4500, 1);
|
||||||
|
@ -510,7 +510,7 @@ CGameLogic::UpdateShortCut()
|
||||||
pShortCutTaxi->SetMoveSpeed(pShortCutTaxi->GetForward() * 0.4f);
|
pShortCutTaxi->SetMoveSpeed(pShortCutTaxi->GetForward() * 0.4f);
|
||||||
ShortCutTimer = CTimer::GetTimeInMilliseconds() + 1500;
|
ShortCutTimer = CTimer::GetTimeInMilliseconds() + 1500;
|
||||||
TheCamera.SetFadeColour(0, 0, 0);
|
TheCamera.SetFadeColour(0, 0, 0);
|
||||||
TheCamera.Fade(1.0f, 1);
|
TheCamera.Fade(1.0f, FADE_IN);
|
||||||
ShortCutState = SHORTCUT_ARRIVING;
|
ShortCutState = SHORTCUT_ARRIVING;
|
||||||
CTimer::Resume();
|
CTimer::Resume();
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,14 +9,15 @@
|
||||||
#include "OnscreenTimer.h"
|
#include "OnscreenTimer.h"
|
||||||
#include "Camera.h"
|
#include "Camera.h"
|
||||||
|
|
||||||
void COnscreenTimer::Init() {
|
void
|
||||||
|
COnscreenTimer::Init()
|
||||||
|
{
|
||||||
m_bDisabled = false;
|
m_bDisabled = false;
|
||||||
for(uint32 i = 0; i < NUMONSCREENCOUNTERS; i++) {
|
for(uint32 i = 0; i < NUMONSCREENCOUNTERS; i++) {
|
||||||
m_sCounters[i].m_nCounterOffset = 0;
|
m_sCounters[i].m_nCounterOffset = 0;
|
||||||
|
|
||||||
for(uint32 j = 0; j < ARRAY_SIZE(m_sCounters[0].m_aCounterText); j++) {
|
for(uint32 j = 0; j < ARRAY_SIZE(m_sCounters[0].m_aCounterText); j++)
|
||||||
m_sCounters[i].m_aCounterText[j] = 0;
|
m_sCounters[i].m_aCounterText[j] = '\0';
|
||||||
}
|
|
||||||
|
|
||||||
m_sCounters[i].m_nType = COUNTER_DISPLAY_NUMBER;
|
m_sCounters[i].m_nType = COUNTER_DISPLAY_NUMBER;
|
||||||
m_sCounters[i].m_bCounterProcessed = false;
|
m_sCounters[i].m_bCounterProcessed = false;
|
||||||
|
@ -24,24 +25,25 @@ void COnscreenTimer::Init() {
|
||||||
for(uint32 i = 0; i < NUMONSCREENCLOCKS; i++) {
|
for(uint32 i = 0; i < NUMONSCREENCLOCKS; i++) {
|
||||||
m_sClocks[i].m_nClockOffset = 0;
|
m_sClocks[i].m_nClockOffset = 0;
|
||||||
|
|
||||||
for(uint32 j = 0; j < ARRAY_SIZE(m_sClocks[0].m_aClockText); j++) {
|
for(uint32 j = 0; j < ARRAY_SIZE(m_sClocks[0].m_aClockText); j++)
|
||||||
m_sClocks[i].m_aClockText[j] = 0;
|
m_sClocks[i].m_aClockText[j] = '\0';
|
||||||
}
|
|
||||||
|
|
||||||
m_sClocks[i].m_bClockProcessed = false;
|
m_sClocks[i].m_bClockProcessed = false;
|
||||||
m_sClocks[i].m_bClockGoingDown = true;
|
m_sClocks[i].m_bClockGoingDown = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void COnscreenTimer::Process() {
|
void
|
||||||
if(!CReplay::IsPlayingBack() && !m_bDisabled) {
|
COnscreenTimer::Process()
|
||||||
for(uint32 i = 0; i < NUMONSCREENCLOCKS; i++) {
|
{
|
||||||
|
if(!CReplay::IsPlayingBack() && !m_bDisabled)
|
||||||
|
for(uint32 i = 0; i < NUMONSCREENCLOCKS; i++)
|
||||||
m_sClocks[i].Process();
|
m_sClocks[i].Process();
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void COnscreenTimer::ProcessForDisplay() {
|
void
|
||||||
|
COnscreenTimer::ProcessForDisplay()
|
||||||
|
{
|
||||||
if(CHud::m_Wants_To_Draw_Hud) {
|
if(CHud::m_Wants_To_Draw_Hud) {
|
||||||
m_bProcessed = false;
|
m_bProcessed = false;
|
||||||
for(uint32 i = 0; i < NUMONSCREENCLOCKS; i++) {
|
for(uint32 i = 0; i < NUMONSCREENCLOCKS; i++) {
|
||||||
|
@ -63,67 +65,67 @@ void COnscreenTimer::ProcessForDisplay() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void COnscreenTimer::ClearCounter(uint32 offset) {
|
void
|
||||||
|
COnscreenTimer::ClearCounter(uint32 offset)
|
||||||
|
{
|
||||||
for(uint32 i = 0; i < NUMONSCREENCOUNTERS; i++) {
|
for(uint32 i = 0; i < NUMONSCREENCOUNTERS; i++) {
|
||||||
if(offset == m_sCounters[i].m_nCounterOffset) {
|
if(offset == m_sCounters[i].m_nCounterOffset) {
|
||||||
m_sCounters[i].m_nCounterOffset = 0;
|
m_sCounters[i].m_nCounterOffset = 0;
|
||||||
m_sCounters[i].m_aCounterText[0] = 0;
|
m_sCounters[i].m_aCounterText[0] = '\0';
|
||||||
m_sCounters[i].m_nType = COUNTER_DISPLAY_NUMBER;
|
m_sCounters[i].m_nType = COUNTER_DISPLAY_NUMBER;
|
||||||
m_sCounters[i].m_bCounterProcessed = 0;
|
m_sCounters[i].m_bCounterProcessed = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void COnscreenTimer::ClearClock(uint32 offset) {
|
void
|
||||||
for(uint32 i = 0; i < NUMONSCREENCLOCKS; i++) {
|
COnscreenTimer::ClearClock(uint32 offset)
|
||||||
|
{
|
||||||
|
for(uint32 i = 0; i < NUMONSCREENCLOCKS; i++)
|
||||||
if(offset == m_sClocks[i].m_nClockOffset) {
|
if(offset == m_sClocks[i].m_nClockOffset) {
|
||||||
m_sClocks[i].m_nClockOffset = 0;
|
m_sClocks[i].m_nClockOffset = 0;
|
||||||
m_sClocks[i].m_aClockText[0] = 0;
|
m_sClocks[i].m_aClockText[0] = '\0';
|
||||||
m_sClocks[i].m_bClockProcessed = 0;
|
m_sClocks[i].m_bClockProcessed = false;
|
||||||
m_sClocks[i].m_bClockGoingDown = true;
|
m_sClocks[i].m_bClockGoingDown = true;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void COnscreenTimer::AddCounter(uint32 offset, uint16 type, char* text, uint16 pos) {
|
void
|
||||||
|
COnscreenTimer::AddCounter(uint32 offset, uint16 type, char* text, uint16 pos)
|
||||||
|
{
|
||||||
if (m_sCounters[pos].m_aCounterText[0] != '\0')
|
if (m_sCounters[pos].m_aCounterText[0] != '\0')
|
||||||
return;
|
return;
|
||||||
|
|
||||||
m_sCounters[pos].m_nCounterOffset = offset;
|
m_sCounters[pos].m_nCounterOffset = offset;
|
||||||
if(text) {
|
if(text)
|
||||||
strncpy(m_sCounters[pos].m_aCounterText, text, ARRAY_SIZE(m_sCounters[0].m_aCounterText));
|
strncpy(m_sCounters[pos].m_aCounterText, text, ARRAY_SIZE(m_sCounters[0].m_aCounterText));
|
||||||
} else {
|
else
|
||||||
m_sCounters[pos].m_aCounterText[0] = 0;
|
m_sCounters[pos].m_aCounterText[0] = '\0';
|
||||||
}
|
|
||||||
|
|
||||||
m_sCounters[pos].m_nType = type;
|
m_sCounters[pos].m_nType = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
void COnscreenTimer::AddClock(uint32 offset, char* text, bool bGoingDown) {
|
void
|
||||||
|
COnscreenTimer::AddClock(uint32 offset, char* text, bool bGoingDown)
|
||||||
// dead code in here
|
{
|
||||||
uint32 i;
|
for(uint32 i = 0; i < NUMONSCREENCLOCKS; i++) {
|
||||||
for(i = 0; i < NUMONSCREENCLOCKS; i++) {
|
|
||||||
if(m_sClocks[i].m_nClockOffset == 0) {
|
if(m_sClocks[i].m_nClockOffset == 0) {
|
||||||
|
m_sClocks[i].m_nClockOffset = offset;
|
||||||
|
m_sClocks[i].m_bClockGoingDown = bGoingDown;
|
||||||
|
if(text)
|
||||||
|
strncpy(m_sClocks[i].m_aClockText, text, ARRAY_SIZE(m_sClocks[0].m_aClockText));
|
||||||
|
else
|
||||||
|
m_sClocks[i].m_aClockText[0] = '\0';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_sClocks[i].m_nClockOffset = offset;
|
|
||||||
m_sClocks[i].m_bClockGoingDown = bGoingDown;
|
|
||||||
if(text) {
|
|
||||||
strncpy(m_sClocks[i].m_aClockText, text, ARRAY_SIZE(m_sClocks[0].m_aClockText));
|
|
||||||
} else {
|
|
||||||
m_sClocks[i].m_aClockText[0] = 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void COnscreenTimerEntry::Process() {
|
void
|
||||||
if(m_nClockOffset == 0) {
|
COnscreenTimerEntry::Process()
|
||||||
|
{
|
||||||
|
if(m_nClockOffset == 0)
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
int32* timerPtr = CTheScripts::GetPointerToScriptVariable(m_nClockOffset);
|
int32* timerPtr = CTheScripts::GetPointerToScriptVariable(m_nClockOffset);
|
||||||
int32 oldTime = *timerPtr;
|
int32 oldTime = *timerPtr;
|
||||||
|
@ -147,13 +149,17 @@ void COnscreenTimerEntry::Process() {
|
||||||
*timerPtr = oldTime + int32(CTimer::GetTimeStepInMilliseconds());
|
*timerPtr = oldTime + int32(CTimer::GetTimeStepInMilliseconds());
|
||||||
}
|
}
|
||||||
|
|
||||||
void COnscreenTimerEntry::ProcessForDisplayClock() {
|
void
|
||||||
|
COnscreenTimerEntry::ProcessForDisplayClock()
|
||||||
|
{
|
||||||
uint32 time = *CTheScripts::GetPointerToScriptVariable(m_nClockOffset);
|
uint32 time = *CTheScripts::GetPointerToScriptVariable(m_nClockOffset);
|
||||||
sprintf(m_aClockBuffer, "%02d:%02d", time / 1000 / 60 % 100,
|
sprintf(m_aClockBuffer, "%02d:%02d", time / 1000 / 60 % 100,
|
||||||
time / 1000 % 60);
|
time / 1000 % 60);
|
||||||
}
|
}
|
||||||
|
|
||||||
void COnscreenCounterEntry::ProcessForDisplayCounter() {
|
void
|
||||||
|
COnscreenCounterEntry::ProcessForDisplayCounter()
|
||||||
|
{
|
||||||
uint32 counter = *CTheScripts::GetPointerToScriptVariable(m_nCounterOffset);
|
uint32 counter = *CTheScripts::GetPointerToScriptVariable(m_nCounterOffset);
|
||||||
sprintf(m_aCounterBuffer, "%d", counter);
|
sprintf(m_aCounterBuffer, "%d", counter);
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@ class CCrimeBeingQd
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
eCrimeType m_nType;
|
eCrimeType m_nType;
|
||||||
uint32 m_nId;
|
int32 m_nId;
|
||||||
uint32 m_nTime;
|
uint32 m_nTime;
|
||||||
CVector m_vecPosn;
|
CVector m_vecPosn;
|
||||||
bool m_bReported;
|
bool m_bReported;
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
#include "ModelInfo.h"
|
#include "ModelInfo.h"
|
||||||
#include "Pad.h"
|
#include "Pad.h"
|
||||||
#include "ControllerConfig.h"
|
#include "ControllerConfig.h"
|
||||||
|
#include "DMAudio.h"
|
||||||
|
|
||||||
// Menu screens array is at the bottom of the file.
|
// Menu screens array is at the bottom of the file.
|
||||||
|
|
||||||
|
@ -194,6 +195,8 @@ void MultiSamplingButtonPress(int8 action) {
|
||||||
if (FrontEndMenuManager.m_nDisplayMSAALevel != FrontEndMenuManager.m_nPrefsMSAALevel) {
|
if (FrontEndMenuManager.m_nDisplayMSAALevel != FrontEndMenuManager.m_nPrefsMSAALevel) {
|
||||||
FrontEndMenuManager.m_nPrefsMSAALevel = FrontEndMenuManager.m_nDisplayMSAALevel;
|
FrontEndMenuManager.m_nPrefsMSAALevel = FrontEndMenuManager.m_nDisplayMSAALevel;
|
||||||
_psSelectScreenVM(FrontEndMenuManager.m_nPrefsVideoMode);
|
_psSelectScreenVM(FrontEndMenuManager.m_nPrefsVideoMode);
|
||||||
|
DMAudio.ChangeMusicMode(MUSICMODE_FRONTEND);
|
||||||
|
DMAudio.Service();
|
||||||
FrontEndMenuManager.SetHelperText(0);
|
FrontEndMenuManager.SetHelperText(0);
|
||||||
FrontEndMenuManager.SaveSettings();
|
FrontEndMenuManager.SaveSettings();
|
||||||
}
|
}
|
||||||
|
@ -255,6 +258,8 @@ const char* screenModes[] = { "FED_FLS", "FED_WND" };
|
||||||
void ScreenModeAfterChange(int8 before, int8 after)
|
void ScreenModeAfterChange(int8 before, int8 after)
|
||||||
{
|
{
|
||||||
_psSelectScreenVM(FrontEndMenuManager.m_nPrefsVideoMode); // apply same resolution
|
_psSelectScreenVM(FrontEndMenuManager.m_nPrefsVideoMode); // apply same resolution
|
||||||
|
DMAudio.ChangeMusicMode(MUSICMODE_FRONTEND);
|
||||||
|
DMAudio.Service();
|
||||||
FrontEndMenuManager.SetHelperText(0);
|
FrontEndMenuManager.SetHelperText(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -644,9 +644,6 @@ CCopPed::ProcessControl(void)
|
||||||
int numCopsNear = 0;
|
int numCopsNear = 0;
|
||||||
for (int i = 0; i < player->m_numNearPeds; ++i) {
|
for (int i = 0; i < player->m_numNearPeds; ++i) {
|
||||||
CPed *nearPed = player->m_nearPeds[i];
|
CPed *nearPed = player->m_nearPeds[i];
|
||||||
#ifdef FIX_BUGS
|
|
||||||
if (nearPed)
|
|
||||||
#endif
|
|
||||||
if (nearPed->m_nPedType == PEDTYPE_COP && nearPed->m_nPedState != PED_DEAD)
|
if (nearPed->m_nPedType == PEDTYPE_COP && nearPed->m_nPedState != PED_DEAD)
|
||||||
++numCopsNear;
|
++numCopsNear;
|
||||||
}
|
}
|
||||||
|
|
|
@ -403,6 +403,30 @@ CPed::~CPed(void)
|
||||||
CPopulation::NumMiamiViceCops--;
|
CPopulation::NumMiamiViceCops--;
|
||||||
CPopulation::UpdatePedCount((ePedType)m_nPedType, true);
|
CPopulation::UpdatePedCount((ePedType)m_nPedType, true);
|
||||||
DMAudio.DestroyEntity(m_audioEntityId);
|
DMAudio.DestroyEntity(m_audioEntityId);
|
||||||
|
|
||||||
|
// Because of the nature of ped lists in GTA, it can sometimes be outdated.
|
||||||
|
// Remove ourself from nearPeds list of the Peds in our nearPeds list.
|
||||||
|
#ifdef FIX_BUGS
|
||||||
|
for(int i = 0; i < m_numNearPeds; i++) {
|
||||||
|
CPed *nearPed = m_nearPeds[i];
|
||||||
|
assert(nearPed != nil);
|
||||||
|
if (!nearPed->IsPointerValid())
|
||||||
|
continue;
|
||||||
|
|
||||||
|
for(int j = 0; j < nearPed->m_numNearPeds;) {
|
||||||
|
assert(j == ARRAY_SIZE(m_nearPeds) - 1 || nearPed->m_nearPeds[j] || !nearPed->m_nearPeds[j+1]); // ensure nil comes after nil
|
||||||
|
|
||||||
|
if (nearPed->m_nearPeds[j] == this) {
|
||||||
|
for (int k = j; k < ARRAY_SIZE(m_nearPeds) - 1; k++) {
|
||||||
|
nearPed->m_nearPeds[k] = nearPed->m_nearPeds[k + 1];
|
||||||
|
nearPed->m_nearPeds[k + 1] = nil;
|
||||||
|
}
|
||||||
|
nearPed->m_numNearPeds--;
|
||||||
|
} else
|
||||||
|
j++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -519,13 +543,15 @@ CPed::BuildPedLists(void)
|
||||||
removePed = true;
|
removePed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
assert(i == ARRAY_SIZE(m_nearPeds) - 1 || m_nearPeds[i] || !m_nearPeds[i+1]); // ensure nil comes after nil
|
||||||
|
|
||||||
if (removePed) {
|
if (removePed) {
|
||||||
// If we arrive here, the ped we're checking isn't "near", so we should remove it.
|
// If we arrive here, the ped we're checking isn't "near", so we should remove it.
|
||||||
for (int j = i; j < ARRAY_SIZE(m_nearPeds) - 1; j++) {
|
for (int j = i; j < ARRAY_SIZE(m_nearPeds) - 1; j++) {
|
||||||
m_nearPeds[j] = m_nearPeds[j + 1];
|
m_nearPeds[j] = m_nearPeds[j + 1];
|
||||||
m_nearPeds[j + 1] = nil;
|
m_nearPeds[j + 1] = nil;
|
||||||
}
|
}
|
||||||
// Above loop won't work on last slot, so we need to empty it.
|
|
||||||
m_nearPeds[ARRAY_SIZE(m_nearPeds) - 1] = nil;
|
m_nearPeds[ARRAY_SIZE(m_nearPeds) - 1] = nil;
|
||||||
m_numNearPeds--;
|
m_numNearPeds--;
|
||||||
} else
|
} else
|
||||||
|
@ -2861,7 +2887,7 @@ CPed::ProcessEntityCollision(CEntity *collidingEnt, CColPoint *collidingPoints)
|
||||||
CColModel *hisCol = CModelInfo::GetModelInfo(collidingEnt->GetModelIndex())->GetColModel();
|
CColModel *hisCol = CModelInfo::GetModelInfo(collidingEnt->GetModelIndex())->GetColModel();
|
||||||
|
|
||||||
if (!bUsesCollision && !bJustCheckCollision)
|
if (!bUsesCollision && !bJustCheckCollision)
|
||||||
return false;
|
return 0;
|
||||||
|
|
||||||
if (collidingEnt->IsVehicle() && ((CVehicle*)collidingEnt)->IsBoat())
|
if (collidingEnt->IsVehicle() && ((CVehicle*)collidingEnt)->IsBoat())
|
||||||
collidedWithBoat = true;
|
collidedWithBoat = true;
|
||||||
|
@ -6749,7 +6775,7 @@ CPed::FollowPath(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
CPed::SetEvasiveStep(CEntity *reason, uint8 animType)
|
CPed::SetEvasiveStep(CPhysical *reason, uint8 animType)
|
||||||
{
|
{
|
||||||
AnimationId stepAnim;
|
AnimationId stepAnim;
|
||||||
|
|
||||||
|
@ -6767,22 +6793,23 @@ CPed::SetEvasiveStep(CEntity *reason, uint8 animType)
|
||||||
if (neededTurn > PI)
|
if (neededTurn > PI)
|
||||||
neededTurn = TWOPI - neededTurn;
|
neededTurn = TWOPI - neededTurn;
|
||||||
|
|
||||||
CVehicle *veh = (CVehicle*)reason;
|
if (reason->IsVehicle() && ((CVehicle*)reason)->IsCar()) {
|
||||||
if (reason->IsVehicle() && veh->IsCar()) {
|
CVehicle *veh = (CVehicle*)reason;
|
||||||
if (veh->m_nCarHornTimer != 0) {
|
if (veh->m_nCarHornTimer != 0) {
|
||||||
vehPressedHorn = true;
|
vehPressedHorn = true;
|
||||||
if (!IsPlayer())
|
if (!IsPlayer())
|
||||||
animType = 1;
|
animType = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (neededTurn <= DEGTORAD(90.0f) || veh->GetModelIndex() == MI_RCBANDIT || vehPressedHorn || animType != 0) {
|
|
||||||
SetLookFlag(veh, true);
|
if (neededTurn <= DEGTORAD(90.0f) || reason->GetModelIndex() == MI_RCBANDIT || vehPressedHorn || animType != 0) {
|
||||||
if ((CGeneral::GetRandomNumber() & 1) && veh->GetModelIndex() != MI_RCBANDIT && animType == 0) {
|
SetLookFlag(reason, true);
|
||||||
|
if ((CGeneral::GetRandomNumber() & 1) && reason->GetModelIndex() != MI_RCBANDIT && animType == 0) {
|
||||||
stepAnim = ANIM_STD_HAILTAXI;
|
stepAnim = ANIM_STD_HAILTAXI;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
float vehDirection = CGeneral::GetRadianAngleBetweenPoints(
|
float dangerDirection = CGeneral::GetRadianAngleBetweenPoints(
|
||||||
veh->m_vecMoveSpeed.x, veh->m_vecMoveSpeed.y,
|
reason->m_vecMoveSpeed.x, reason->m_vecMoveSpeed.y,
|
||||||
0.0f, 0.0f);
|
0.0f, 0.0f);
|
||||||
|
|
||||||
// Let's turn our back to the "reason"
|
// Let's turn our back to the "reason"
|
||||||
|
@ -6792,14 +6819,14 @@ CPed::SetEvasiveStep(CEntity *reason, uint8 animType)
|
||||||
angleToFace -= TWOPI;
|
angleToFace -= TWOPI;
|
||||||
|
|
||||||
// We don't want to run towards car's direction
|
// We don't want to run towards car's direction
|
||||||
float dangerZone = angleToFace - vehDirection;
|
float dangerZone = angleToFace - dangerDirection;
|
||||||
dangerZone = CGeneral::LimitRadianAngle(dangerZone);
|
dangerZone = CGeneral::LimitRadianAngle(dangerZone);
|
||||||
|
|
||||||
// So, add or subtract 90deg (jump to left/right) according to that
|
// So, add or subtract 90deg (jump to left/right) according to that
|
||||||
if (dangerZone > 0.0f)
|
if (dangerZone > 0.0f)
|
||||||
angleToFace = vehDirection - HALFPI;
|
angleToFace = dangerDirection - HALFPI;
|
||||||
else
|
else
|
||||||
angleToFace = vehDirection + HALFPI;
|
angleToFace = dangerDirection + HALFPI;
|
||||||
|
|
||||||
stepAnim = ANIM_STD_NUM;
|
stepAnim = ANIM_STD_NUM;
|
||||||
if (animType == 0 || animType == 1)
|
if (animType == 0 || animType == 1)
|
||||||
|
|
|
@ -871,7 +871,7 @@ public:
|
||||||
void SetAimFlag(CEntity* to);
|
void SetAimFlag(CEntity* to);
|
||||||
void SetAimFlag(float angle);
|
void SetAimFlag(float angle);
|
||||||
void SetAmmo(eWeaponType weaponType, uint32 ammo);
|
void SetAmmo(eWeaponType weaponType, uint32 ammo);
|
||||||
void SetEvasiveStep(CEntity*, uint8);
|
void SetEvasiveStep(CPhysical*, uint8);
|
||||||
void GrantAmmo(eWeaponType, uint32);
|
void GrantAmmo(eWeaponType, uint32);
|
||||||
void SetEvasiveDive(CPhysical*, uint8);
|
void SetEvasiveDive(CPhysical*, uint8);
|
||||||
void SetAttack(CEntity*);
|
void SetAttack(CEntity*);
|
||||||
|
|
|
@ -17,9 +17,9 @@ const RwV3d XaxisIK = { 1.0f, 0.0f, 0.0f};
|
||||||
const RwV3d YaxisIK = { 0.0f, 1.0f, 0.0f};
|
const RwV3d YaxisIK = { 0.0f, 1.0f, 0.0f};
|
||||||
const RwV3d ZaxisIK = { 0.0f, 0.0f, 1.0f};
|
const RwV3d ZaxisIK = { 0.0f, 0.0f, 1.0f};
|
||||||
|
|
||||||
CPedIK::CPedIK(CPed *ped)
|
CPedIK::CPedIK(CPed *ped) : m_ped(ped)
|
||||||
{
|
{
|
||||||
m_ped = ped;
|
assert(ped != nil);
|
||||||
m_flags = 0;
|
m_flags = 0;
|
||||||
m_headOrient.yaw = 0.0f;
|
m_headOrient.yaw = 0.0f;
|
||||||
m_headOrient.pitch = 0.0f;
|
m_headOrient.pitch = 0.0f;
|
||||||
|
|
|
@ -34,7 +34,7 @@ public:
|
||||||
AIMS_WITH_ARM = 4,
|
AIMS_WITH_ARM = 4,
|
||||||
};
|
};
|
||||||
|
|
||||||
CPed *m_ped;
|
CPed *Const m_ped;
|
||||||
LimbOrientation m_headOrient;
|
LimbOrientation m_headOrient;
|
||||||
LimbOrientation m_torsoOrient;
|
LimbOrientation m_torsoOrient;
|
||||||
LimbOrientation m_upperArmOrient;
|
LimbOrientation m_upperArmOrient;
|
||||||
|
|
|
@ -251,6 +251,11 @@ GenericSave(int file)
|
||||||
WriteSaveDataBlock(CStreaming::MemoryCardSave, "StreamingSize");
|
WriteSaveDataBlock(CStreaming::MemoryCardSave, "StreamingSize");
|
||||||
WriteSaveDataBlock(CPedType::Save, "PedTypeSize");
|
WriteSaveDataBlock(CPedType::Save, "PedTypeSize");
|
||||||
|
|
||||||
|
// sure just write garbage data repeatedly ...
|
||||||
|
#ifndef THIS_IS_STUPID
|
||||||
|
memset(work_buff, 0, sizeof(work_buff));
|
||||||
|
#endif
|
||||||
|
|
||||||
// Write padding
|
// Write padding
|
||||||
for (int i = 0; i < 4; i++) {
|
for (int i = 0; i < 4; i++) {
|
||||||
size = align4bytes(SIZE_OF_ONE_GAME_IN_BYTES - totalSize - 4);
|
size = align4bytes(SIZE_OF_ONE_GAME_IN_BYTES - totalSize - 4);
|
||||||
|
|
|
@ -83,29 +83,29 @@ WriteSaveBuf(uint8 *&buf, uint32 &length, const T &value)
|
||||||
|
|
||||||
#ifdef VALIDATE_SAVE_SIZE
|
#ifdef VALIDATE_SAVE_SIZE
|
||||||
#define CheckSaveHeader(buf, a, b, c, d, size) do { \
|
#define CheckSaveHeader(buf, a, b, c, d, size) do { \
|
||||||
char _C; uint32 _size;\
|
char _c; uint32 _size;\
|
||||||
ReadSaveBuf(&_C, buf);\
|
ReadSaveBuf(&_c, buf);\
|
||||||
assert(_C == a);\
|
assert(_c == a);\
|
||||||
ReadSaveBuf(&_C, buf);\
|
ReadSaveBuf(&_c, buf);\
|
||||||
assert(_C == b);\
|
assert(_c == b);\
|
||||||
ReadSaveBuf(&_C, buf);\
|
ReadSaveBuf(&_c, buf);\
|
||||||
assert(_C == c);\
|
assert(_c == c);\
|
||||||
ReadSaveBuf(&_C, buf);\
|
ReadSaveBuf(&_c, buf);\
|
||||||
assert(_C == d);\
|
assert(_c == d);\
|
||||||
ReadSaveBuf(&_size, buf);\
|
ReadSaveBuf(&_size, buf);\
|
||||||
assert(_size == size);\
|
assert(_size == size);\
|
||||||
} while(0)
|
} while(0)
|
||||||
|
|
||||||
#define CheckSaveHeaderWithLength(buf,len,a,b,c,d,size) do { \
|
#define CheckSaveHeaderWithLength(buf,len,a,b,c,d,size) do { \
|
||||||
char _C; uint32 _size;\
|
char _c; uint32 _size;\
|
||||||
ReadSaveBuf(&_C, buf, len);\
|
ReadSaveBuf(&_c, buf, len);\
|
||||||
assert(_C == a);\
|
assert(_c == a);\
|
||||||
ReadSaveBuf(&_C, buf, len);\
|
ReadSaveBuf(&_c, buf, len);\
|
||||||
assert(_C == b);\
|
assert(_c == b);\
|
||||||
ReadSaveBuf(&_C, buf, len);\
|
ReadSaveBuf(&_c, buf, len);\
|
||||||
assert(_C == c);\
|
assert(_c == c);\
|
||||||
ReadSaveBuf(&_C, buf, len);\
|
ReadSaveBuf(&_c, buf, len);\
|
||||||
assert(_C == d);\
|
assert(_c == d);\
|
||||||
ReadSaveBuf(&_size, buf, len);\
|
ReadSaveBuf(&_size, buf, len);\
|
||||||
assert(_size == size);\
|
assert(_size == size);\
|
||||||
} while(0)
|
} while(0)
|
||||||
|
|
|
@ -919,7 +919,7 @@ void _InputInitialiseJoys()
|
||||||
free(db);
|
free(db);
|
||||||
fclose(f);
|
fclose(f);
|
||||||
} else
|
} else
|
||||||
printf("You don't seem to have copied " SDL_GAMEPAD_DB_PATH " file from re3/gamefiles to GTA3 directory. Some gamepads may not be recognized.\n");
|
printf("You don't seem to have copied " SDL_GAMEPAD_DB_PATH " file from reVC/gamefiles to GTA: Vice City directory. Some gamepads may not be recognized.\n");
|
||||||
|
|
||||||
#undef SDL_GAMEPAD_DB_PATH
|
#undef SDL_GAMEPAD_DB_PATH
|
||||||
|
|
||||||
|
|
|
@ -1498,7 +1498,7 @@ psSelectDevice()
|
||||||
#ifdef DEFAULT_NATIVE_RESOLUTION
|
#ifdef DEFAULT_NATIVE_RESOLUTION
|
||||||
GcurSelVM = 1;
|
GcurSelVM = 1;
|
||||||
#else
|
#else
|
||||||
MessageBox(nil, "Cannot find 640x480 video mode", "GTA3", MB_OK);
|
MessageBox(nil, "Cannot find 640x480 video mode", "GTA: Vice City", MB_OK);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -1541,7 +1541,7 @@ psSelectDevice()
|
||||||
}
|
}
|
||||||
|
|
||||||
if(bestFsMode < 0){
|
if(bestFsMode < 0){
|
||||||
MessageBox(nil, "Cannot find desired video mode", "GTA3", MB_OK);
|
MessageBox(nil, "Cannot find desired video mode", "GTA: Vice City", MB_OK);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
GcurSelVM = bestFsMode;
|
GcurSelVM = bestFsMode;
|
||||||
|
|
Loading…
Reference in a new issue