summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/control/GameLogic.cpp12
-rw-r--r--src/control/Phones.cpp1
-rw-r--r--src/control/Replay.cpp6
-rw-r--r--src/control/Restart.cpp8
-rw-r--r--src/control/Script.cpp18
-rw-r--r--src/core/Collision.cpp16
-rw-r--r--src/core/Frontend.cpp10
-rw-r--r--src/core/Frontend.h4
-rw-r--r--src/core/Game.cpp6
-rw-r--r--src/core/Game.h2
-rw-r--r--src/core/PlayerInfo.cpp2
-rw-r--r--src/core/Stats.cpp4
-rw-r--r--src/core/Stats.h4
-rw-r--r--src/core/Streaming.cpp23
-rw-r--r--src/core/TempColModels.cpp6
-rw-r--r--src/core/World.cpp2
-rw-r--r--src/core/Zones.cpp8
-rw-r--r--src/core/config.h4
-rw-r--r--src/core/main.cpp17
-rw-r--r--src/core/re3.cpp14
-rw-r--r--src/entities/Building.cpp2
-rw-r--r--src/entities/Entity.cpp4
-rw-r--r--src/entities/Physical.cpp2
-rw-r--r--src/modelinfo/PedModelInfo.cpp2
-rw-r--r--src/peds/Population.cpp2
-rw-r--r--src/render/Draw.cpp6
-rw-r--r--src/render/Renderer.cpp2
-rw-r--r--src/save/GenericGameStorage.cpp2
-rw-r--r--src/skel/glfw/glfw.cpp9
-rw-r--r--src/vehicles/Plane.cpp2
30 files changed, 140 insertions, 60 deletions
diff --git a/src/control/GameLogic.cpp b/src/control/GameLogic.cpp
index af1680ae..2af9464c 100644
--- a/src/control/GameLogic.cpp
+++ b/src/control/GameLogic.cpp
@@ -155,8 +155,8 @@ CGameLogic::Update()
CCarCtrl::ClearInterestingVehicleList();
CWorld::ClearExcitingStuffFromArea(pPlayerInfo.GetPos(), 4000.0f, 1);
CRestart::FindClosestHospitalRestartPoint(pPlayerInfo.GetPos(), &vecRestartPos, &fRestartFloat);
- CRestart::OverrideHospitalLevel = LEVEL_NONE;
- CRestart::OverridePoliceStationLevel = LEVEL_NONE;
+ CRestart::OverrideHospitalLevel = LEVEL_GENERIC;
+ CRestart::OverridePoliceStationLevel = LEVEL_GENERIC;
PassTime(720);
RestorePlayerStuffDuringResurrection(pPlayerInfo.m_pPed, vecRestartPos, fRestartFloat);
AfterDeathArrestSetUpShortCutTaxi();
@@ -261,8 +261,8 @@ CGameLogic::Update()
CCarCtrl::ClearInterestingVehicleList();
CWorld::ClearExcitingStuffFromArea(pPlayerInfo.GetPos(), 4000.0f, 1);
CRestart::FindClosestPoliceRestartPoint(pPlayerInfo.GetPos(), &vecRestartPos, &fRestartFloat);
- CRestart::OverrideHospitalLevel = LEVEL_NONE;
- CRestart::OverridePoliceStationLevel = LEVEL_NONE;
+ CRestart::OverrideHospitalLevel = LEVEL_GENERIC;
+ CRestart::OverridePoliceStationLevel = LEVEL_GENERIC;
PassTime(720);
RestorePlayerStuffDuringResurrection(pPlayerInfo.m_pPed, vecRestartPos, fRestartFloat);
AfterDeathArrestSetUpShortCutTaxi();
@@ -313,8 +313,8 @@ CGameLogic::Update()
CCarCtrl::ClearInterestingVehicleList();
CWorld::ClearExcitingStuffFromArea(pPlayerInfo.GetPos(), 4000.0f, 1);
CRestart::FindClosestPoliceRestartPoint(pPlayerInfo.GetPos(), &vecRestartPos, &fRestartFloat);
- CRestart::OverridePoliceStationLevel = LEVEL_NONE;
- CRestart::OverrideHospitalLevel = LEVEL_NONE;
+ CRestart::OverridePoliceStationLevel = LEVEL_GENERIC;
+ CRestart::OverrideHospitalLevel = LEVEL_GENERIC;
RestorePlayerStuffDuringResurrection(pPlayerInfo.m_pPed, vecRestartPos, fRestartFloat);
SortOutStreamingAndMemory(pPlayerInfo.GetPos());
TheCamera.m_fCamShakeForce = 0.0f;
diff --git a/src/control/Phones.cpp b/src/control/Phones.cpp
index 4f1703f2..71f6c8e5 100644
--- a/src/control/Phones.cpp
+++ b/src/control/Phones.cpp
@@ -284,6 +284,7 @@ CPhoneInfo::Initialise(void)
CBuilding *building = pool->GetSlot(i);
if (building) {
if (building->GetModelIndex() == MI_PHONEBOOTH1) {
+ assert(m_nMax < ARRAY_SIZE(m_aPhones) && "NUMPHONES should be increased");
CPhone *maxPhone = &m_aPhones[m_nMax];
maxPhone->m_nState = PHONE_STATE_FREE;
maxPhone->m_vecPos = building->GetPosition();
diff --git a/src/control/Replay.cpp b/src/control/Replay.cpp
index 4407254c..8b34cc3b 100644
--- a/src/control/Replay.cpp
+++ b/src/control/Replay.cpp
@@ -170,7 +170,7 @@ static void ApplyPanelDamageToCar(uint32 panels, CAutomobile* vehicle, bool flyi
void PrintElementsInPtrList(void)
{
- for (CPtrNode* node = CWorld::GetBigBuildingList(LEVEL_NONE).first; node; node = node->next) {
+ for (CPtrNode* node = CWorld::GetBigBuildingList(LEVEL_GENERIC).first; node; node = node->next) {
/* Most likely debug print was present here */
}
}
@@ -1143,7 +1143,7 @@ void CReplay::StoreStuffInMem(void)
pWorld1 = new uint8[sizeof(CSector) * NUMSECTORS_X * NUMSECTORS_Y];
memcpy(pWorld1, CWorld::GetSector(0, 0), NUMSECTORS_X * NUMSECTORS_Y * sizeof(CSector));
WorldPtrList = CWorld::GetMovingEntityList().first; // why
- BigBuildingPtrList = CWorld::GetBigBuildingList(LEVEL_NONE).first;
+ BigBuildingPtrList = CWorld::GetBigBuildingList(LEVEL_GENERIC).first;
pPickups = new uint8[sizeof(CPickup) * NUMPICKUPS];
memcpy(pPickups, CPickups::aPickUps, NUMPICKUPS * sizeof(CPickup));
pReferences = new uint8[(sizeof(CReference) * NUMREFERENCES)];
@@ -1189,7 +1189,7 @@ void CReplay::RestoreStuffFromMem(void)
delete[] pWorld1;
pWorld1 = nil;
CWorld::GetMovingEntityList().first = WorldPtrList;
- CWorld::GetBigBuildingList(LEVEL_NONE).first = BigBuildingPtrList;
+ CWorld::GetBigBuildingList(LEVEL_GENERIC).first = BigBuildingPtrList;
memcpy(CPickups::aPickUps, pPickups, sizeof(CPickup) * NUMPICKUPS);
delete[] pPickups;
pPickups = nil;
diff --git a/src/control/Restart.cpp b/src/control/Restart.cpp
index 64cabf5d..8fa018d6 100644
--- a/src/control/Restart.cpp
+++ b/src/control/Restart.cpp
@@ -24,8 +24,8 @@ uint16 CRestart::NumberOfPoliceRestarts;
void
CRestart::Initialise()
{
- OverridePoliceStationLevel = LEVEL_NONE;
- OverrideHospitalLevel = LEVEL_NONE;
+ OverridePoliceStationLevel = LEVEL_GENERIC;
+ OverrideHospitalLevel = LEVEL_GENERIC;
bFadeInAfterNextArrest = true;
bFadeInAfterNextDeath = true;
OverrideHeading = 0.0f;
@@ -86,7 +86,7 @@ CRestart::FindClosestHospitalRestartPoint(const CVector &pos, CVector *outPos, f
// find closest point on this level
for (int i = 0; i < NumberOfHospitalRestarts; i++) {
- if (CTheZones::GetLevelFromPosition(&HospitalRestartPoints[i]) == (OverrideHospitalLevel != LEVEL_NONE ? OverrideHospitalLevel : curlevel)) {
+ if (CTheZones::GetLevelFromPosition(&HospitalRestartPoints[i]) == (OverrideHospitalLevel != LEVEL_GENERIC ? OverrideHospitalLevel : curlevel)) {
float dist = (pos - HospitalRestartPoints[i]).MagnitudeSqr();
if (fMinDist >= dist) {
fMinDist = dist;
@@ -133,7 +133,7 @@ CRestart::FindClosestPoliceRestartPoint(const CVector &pos, CVector *outPos, flo
// find closest point on this level
for (int i = 0; i < NumberOfPoliceRestarts; i++) {
- if (CTheZones::GetLevelFromPosition(&PoliceRestartPoints[i]) == (OverridePoliceStationLevel != LEVEL_NONE ? OverridePoliceStationLevel : curlevel)) {
+ if (CTheZones::GetLevelFromPosition(&PoliceRestartPoints[i]) == (OverridePoliceStationLevel != LEVEL_GENERIC ? OverridePoliceStationLevel : curlevel)) {
float dist = (pos - PoliceRestartPoints[i]).MagnitudeSqr();
if (fMinDist >= dist) {
fMinDist = dist;
diff --git a/src/control/Script.cpp b/src/control/Script.cpp
index 9407cc06..afc4fecb 100644
--- a/src/control/Script.cpp
+++ b/src/control/Script.cpp
@@ -9143,7 +9143,7 @@ int8 CRunningScript::ProcessCommands800To899(int32 command)
CEntity* apEntities[16];
CWorld::FindObjectsOfTypeInRange(mi, pos, range, true, &total, 16, apEntities, true, false, false, true, true);
if (total == 0)
- CWorld::FindObjectsOfTypeInRangeSectorList(mi, CWorld::GetBigBuildingList(LEVEL_NONE), pos, range, true, &total, 16, apEntities);
+ CWorld::FindObjectsOfTypeInRangeSectorList(mi, CWorld::GetBigBuildingList(LEVEL_GENERIC), pos, range, true, &total, 16, apEntities);
if (total == 0)
CWorld::FindObjectsOfTypeInRangeSectorList(mi, CWorld::GetBigBuildingList(CTheZones::GetLevelFromPosition(&pos)), pos, range, true, &total, 16, apEntities);
CEntity* pClosestEntity = nil;
@@ -9933,7 +9933,7 @@ int8 CRunningScript::ProcessCommands900To999(int32 command)
CEntity* apEntities[16];
CWorld::FindObjectsOfTypeInRange(mi1, pos, radius, true, &total, 16, apEntities, true, false, false, false, false);
if (total == 0)
- CWorld::FindObjectsOfTypeInRangeSectorList(mi1, CWorld::GetBigBuildingList(LEVEL_NONE), pos, radius, true, &total, 16, apEntities);
+ CWorld::FindObjectsOfTypeInRangeSectorList(mi1, CWorld::GetBigBuildingList(LEVEL_GENERIC), pos, radius, true, &total, 16, apEntities);
if (total == 0)
CWorld::FindObjectsOfTypeInRangeSectorList(mi1, CWorld::GetBigBuildingList(CTheZones::GetLevelFromPosition(&pos)), pos, radius, true, &total, 16, apEntities);
CEntity* pClosestEntity = nil;
@@ -10593,11 +10593,15 @@ int8 CRunningScript::ProcessCommands1000To1099(int32 command)
CollectParameters(&m_nIp, 1);
CTimer::Stop();
CGame::currLevel = (eLevelName)ScriptParams[0];
+#ifndef NO_ISLAND_LOADING
CStreaming::RemoveUnusedBigBuildings(CGame::currLevel);
CStreaming::RemoveUnusedBuildings(CGame::currLevel);
+#endif
CCollision::SortOutCollisionAfterLoad();
+#ifndef NO_ISLAND_LOADING
CStreaming::RequestIslands(CGame::currLevel);
CStreaming::LoadAllRequestedModels(true);
+#endif
CTimer::Update();
return 0;
}
@@ -10626,7 +10630,7 @@ int8 CRunningScript::ProcessCommands1000To1099(int32 command)
if (ScriptParams[1])
pVehicle->m_nZoneLevel = CTheZones::GetLevelFromPosition(&pVehicle->GetPosition());
else
- pVehicle->m_nZoneLevel = LEVEL_NONE;
+ pVehicle->m_nZoneLevel = LEVEL_GENERIC;
return 0;
}
case COMMAND_SET_CHAR_STAYS_IN_CURRENT_LEVEL:
@@ -10637,7 +10641,7 @@ int8 CRunningScript::ProcessCommands1000To1099(int32 command)
if (ScriptParams[1])
pPed->m_nZoneLevel = CTheZones::GetLevelFromPosition(&pPed->GetPosition());
else
- pPed->m_nZoneLevel = LEVEL_NONE;
+ pPed->m_nZoneLevel = LEVEL_GENERIC;
return 0;
}
*/
@@ -11275,18 +11279,24 @@ int8 CRunningScript::ProcessCommands1100To1199(int32 command)
CTimer::Stop();
CGame::currLevel = (eLevelName)ScriptParams[0];
if (CGame::currLevel != CCollision::ms_collisionInMemory) {
+#ifndef NO_ISLAND_LOADING
DMAudio.SetEffectsFadeVol(0);
CPad::StopPadsShaking();
CCollision::LoadCollisionScreen(CGame::currLevel);
DMAudio.Service();
+#endif
CPopulation::DealWithZoneChange(CCollision::ms_collisionInMemory, CGame::currLevel, false);
+#ifndef NO_ISLAND_LOADING
CStreaming::RemoveUnusedBigBuildings(CGame::currLevel);
CStreaming::RemoveUnusedBuildings(CGame::currLevel);
+#endif
CCollision::SortOutCollisionAfterLoad();
+#ifndef NO_ISLAND_LOADING
CStreaming::RequestIslands(CGame::currLevel);
CStreaming::RequestBigBuildings(CGame::currLevel);
CStreaming::LoadAllRequestedModels(true);
DMAudio.SetEffectsFadeVol(127);
+#endif
}
CTimer::Update();
return 0;
diff --git a/src/core/Collision.cpp b/src/core/Collision.cpp
index 76019c2f..fd172cb8 100644
--- a/src/core/Collision.cpp
+++ b/src/core/Collision.cpp
@@ -41,7 +41,7 @@ void
CCollision::Init(void)
{
ms_colModelCache.Init(NUMCOLCACHELINKS);
- ms_collisionInMemory = LEVEL_NONE;
+ ms_collisionInMemory = LEVEL_GENERIC;
CColStore::Initialise();
}
@@ -70,10 +70,10 @@ GetCollisionInSectorList(CPtrList &list)
for(node = list.first; node; node = node->next){
e = (CEntity*)node->item;
level = CModelInfo::GetModelInfo(e->GetModelIndex())->GetColModel()->level;
- if(level != LEVEL_NONE)
+ if(level != LEVEL_GENERIC)
return (eLevelName)level;
}
- return LEVEL_NONE;
+ return LEVEL_GENERIC;
}
//--MIAMI: unused
@@ -84,15 +84,15 @@ GetCollisionInSector(CSector &sect)
int level;
level = GetCollisionInSectorList(sect.m_lists[ENTITYLIST_BUILDINGS]);
- if(level == LEVEL_NONE)
+ if(level == LEVEL_GENERIC)
level = GetCollisionInSectorList(sect.m_lists[ENTITYLIST_BUILDINGS_OVERLAP]);
- if(level == LEVEL_NONE)
+ if(level == LEVEL_GENERIC)
level = GetCollisionInSectorList(sect.m_lists[ENTITYLIST_OBJECTS]);
- if(level == LEVEL_NONE)
+ if(level == LEVEL_GENERIC)
level = GetCollisionInSectorList(sect.m_lists[ENTITYLIST_OBJECTS_OVERLAP]);
- if(level == LEVEL_NONE)
+ if(level == LEVEL_GENERIC)
level = GetCollisionInSectorList(sect.m_lists[ENTITYLIST_DUMMIES]);
- if(level == LEVEL_NONE)
+ if(level == LEVEL_GENERIC)
level = GetCollisionInSectorList(sect.m_lists[ENTITYLIST_DUMMIES_OVERLAP]);
return (eLevelName)level;
}
diff --git a/src/core/Frontend.cpp b/src/core/Frontend.cpp
index ef8b3a15..4c205675 100644
--- a/src/core/Frontend.cpp
+++ b/src/core/Frontend.cpp
@@ -91,6 +91,10 @@ int curBottomBarOption = -1;
int hoveredBottomBarOption = -1;
#endif
+#ifdef CUTSCENE_BORDERS_SWITCH
+bool CMenuManager::m_PrefsCutsceneBorders = true;
+#endif
+
// Originally that was PS2 option color, they forget it here and used in PrintBriefs once(but didn't use the output anyway)
#ifdef PS2_LIKE_MENU
const CRGBA TEXT_COLOR = CRGBA(150, 110, 30, 255);
@@ -3166,6 +3170,9 @@ CMenuManager::LoadSettings()
CFileMgr::Read(fileHandle, (char*)&m_PrefsShowHud, 1);
CFileMgr::Read(fileHandle, (char*)&m_PrefsRadarMode, 1);
CFileMgr::Read(fileHandle, (char*)&m_PrefsShowLegends, 1);
+#ifdef CUTSCENE_BORDERS_SWITCH
+ CFileMgr::Read(fileHandle, (char *)&CMenuManager::m_PrefsCutsceneBorders, 1);
+#endif
}
}
@@ -3275,6 +3282,9 @@ CMenuManager::SaveSettings()
CFileMgr::Write(fileHandle, (char*)&m_PrefsShowHud, 1);
CFileMgr::Write(fileHandle, (char*)&m_PrefsRadarMode, 1);
CFileMgr::Write(fileHandle, (char*)&m_PrefsShowLegends, 1);
+#ifdef CUTSCENE_BORDERS_SWITCH
+ CFileMgr::Write(fileHandle, (char *)&CMenuManager::m_PrefsCutsceneBorders, 1);
+#endif
}
m_lastWorking3DAudioProvider = m_nPrefsAudio3DProviderIndex;
diff --git a/src/core/Frontend.h b/src/core/Frontend.h
index 48f62dbc..327bf6fa 100644
--- a/src/core/Frontend.h
+++ b/src/core/Frontend.h
@@ -598,6 +598,10 @@ public:
};
bool GetIsMenuActive() {return !!m_bMenuActive;}
+#ifdef CUTSCENE_BORDERS_SWITCH
+ static bool m_PrefsCutsceneBorders;
+#endif
+
#ifndef MASTER
static bool m_PrefsMarketing;
static bool m_PrefsDisableTutorials;
diff --git a/src/core/Game.cpp b/src/core/Game.cpp
index b21421b1..b5ba5b69 100644
--- a/src/core/Game.cpp
+++ b/src/core/Game.cpp
@@ -354,7 +354,7 @@ bool CGame::Initialise(const char* datFile)
LoadingScreen("Loading the Game", "Setup streaming", nil);
CStreaming::LoadInitialVehicles();
CStreaming::LoadInitialPeds();
- CStreaming::RequestBigBuildings(LEVEL_NONE);
+ CStreaming::RequestBigBuildings(LEVEL_GENERIC);
CStreaming::LoadAllRequestedModels(false);
printf("Streaming uses %dK of its memory", CStreaming::ms_memoryUsed / 1024);
LoadingScreen("Loading the Game", "Load animations", GetRandomSplashScreen());
@@ -505,7 +505,7 @@ void CGame::ReInitGameObjectVariables(void)
CTimeCycle::Initialise();
CDraw::SetFOV(120.0f);
CDraw::ms_fLODDistance = 500.0f;
- CStreaming::RequestBigBuildings(LEVEL_NONE);
+ CStreaming::RequestBigBuildings(LEVEL_GENERIC);
CStreaming::LoadAllRequestedModels(false);
CPed::Initialise();
CEventList::Initialise();
@@ -643,7 +643,7 @@ void CGame::InitialiseWhenRestarting(void)
CTimer::Initialise();
FrontEndMenuManager.m_bWantToLoad = false;
ReInitGameObjectVariables();
- currLevel = LEVEL_NONE;
+ currLevel = LEVEL_GENERIC;
CCollision::SortOutCollisionAfterLoad();
}
}
diff --git a/src/core/Game.h b/src/core/Game.h
index 49a3e67c..67d83c00 100644
--- a/src/core/Game.h
+++ b/src/core/Game.h
@@ -2,7 +2,7 @@
enum eLevelName {
LEVEL_IGNORE = -1, // beware, this is only used in CPhysical's m_nZoneLevel
- LEVEL_NONE = 0,
+ LEVEL_GENERIC = 0,
LEVEL_BEACH,
LEVEL_MAINLAND
};
diff --git a/src/core/PlayerInfo.cpp b/src/core/PlayerInfo.cpp
index 2511ce9a..3c01a176 100644
--- a/src/core/PlayerInfo.cpp
+++ b/src/core/PlayerInfo.cpp
@@ -560,7 +560,7 @@ CPlayerInfo::Process(void)
veh->m_nZoneLevel = LEVEL_IGNORE;
for (int i = 0; i < ARRAY_SIZE(veh->pPassengers); i++) {
if (veh->pPassengers[i])
- veh->pPassengers[i]->m_nZoneLevel = LEVEL_NONE;
+ veh->pPassengers[i]->m_nZoneLevel = LEVEL_GENERIC;
}
CStats::DistanceTravelledInVehicle += veh->m_fDistanceTravelled;
} else {
diff --git a/src/core/Stats.cpp b/src/core/Stats.cpp
index 6880fd99..2e3a27b2 100644
--- a/src/core/Stats.cpp
+++ b/src/core/Stats.cpp
@@ -21,8 +21,8 @@ int32 CStats::PedsKilledOfThisType[NUM_PEDTYPES];
int32 CStats::TimesDied;
int32 CStats::TimesArrested;
int32 CStats::KillsSinceLastCheckpoint;
-int32 CStats::DistanceTravelledInVehicle;
-int32 CStats::DistanceTravelledOnFoot;
+float CStats::DistanceTravelledInVehicle;
+float CStats::DistanceTravelledOnFoot;
int32 CStats::ProgressMade;
int32 CStats::TotalProgressInGame;
int32 CStats::CarsExploded;
diff --git a/src/core/Stats.h b/src/core/Stats.h
index 8c786bb8..7dd527ea 100644
--- a/src/core/Stats.h
+++ b/src/core/Stats.h
@@ -25,8 +25,8 @@ public:
static int32 TimesDied;
static int32 TimesArrested;
static int32 KillsSinceLastCheckpoint;
- static int32 DistanceTravelledInVehicle;
- static int32 DistanceTravelledOnFoot;
+ static float DistanceTravelledInVehicle;
+ static float DistanceTravelledOnFoot;
static int32 CarsExploded;
static int32 PeopleKilledByPlayer;
static int32 ProgressMade;
diff --git a/src/core/Streaming.cpp b/src/core/Streaming.cpp
index e712e3d6..484155d6 100644
--- a/src/core/Streaming.cpp
+++ b/src/core/Streaming.cpp
@@ -723,7 +723,11 @@ CStreaming::RequestBigBuildings(eLevelName level, const CVector &pos)
n = CPools::GetBuildingPool()->GetSize()-1;
for(i = n; i >= 0; i--){
b = CPools::GetBuildingPool()->GetSlot(i);
- if(b && b->bIsBIGBuilding && b->m_level == level)
+ if(b && b->bIsBIGBuilding
+#ifndef NO_ISLAND_LOADING
+ && b->m_level == level
+#endif
+ )
if(b->bStreamBIGBuilding){
if(CRenderer::ShouldModelBeStreamed(b, pos))
RequestModel(b->GetModelIndex(), 0);
@@ -795,6 +799,7 @@ CStreaming::InstanceLoadedModels(const CVector &pos)
void
CStreaming::RequestIslands(eLevelName level)
{
+#ifndef NO_ISLAND_LOADING
switch(level){
case LEVEL_MAINLAND:
if(islandLODbeach != -1)
@@ -806,6 +811,7 @@ CStreaming::RequestIslands(eLevelName level)
break;
default: break;
}
+#endif
}
//--MIAMI: TODO
@@ -1010,10 +1016,12 @@ CStreaming::RemoveBuildings(eLevelName level)
void
CStreaming::RemoveUnusedBigBuildings(eLevelName level)
{
+#ifndef NO_ISLAND_LOADING
if(level != LEVEL_BEACH)
RemoveBigBuildings(LEVEL_BEACH);
if(level != LEVEL_MAINLAND)
RemoveBigBuildings(LEVEL_MAINLAND);
+#endif
RemoveIslandsNotUsed(level);
}
@@ -1035,6 +1043,7 @@ DeleteIsland(CEntity *island)
void
CStreaming::RemoveIslandsNotUsed(eLevelName level)
{
+#ifndef NO_ISLAND_LOADING
int i;
if(pIslandLODmainlandEntity == nil)
for(i = CPools::GetBuildingPool()->GetSize()-1; i >= 0; i--){
@@ -1053,8 +1062,10 @@ CStreaming::RemoveIslandsNotUsed(eLevelName level)
break;
case LEVEL_BEACH:
DeleteIsland(pIslandLODbeachEntity);
+
break;
}
+#endif // !NO_ISLAND_LOADING
}
//--MIAMI: done
@@ -1594,7 +1605,7 @@ CStreaming::LoadBigBuildingsWhenNeeded(void)
if(CCutsceneMgr::IsCutsceneProcessing())
return;
- if(CTheZones::m_CurrLevel == LEVEL_NONE ||
+ if(CTheZones::m_CurrLevel == LEVEL_GENERIC ||
CTheZones::m_CurrLevel == CGame::currLevel)
return;
@@ -1612,7 +1623,7 @@ CStreaming::LoadBigBuildingsWhenNeeded(void)
CGame::TidyUpMemory(true, true);
CReplay::EmptyReplayBuffer();
- if(CGame::currLevel != LEVEL_NONE)
+ if(CGame::currLevel != LEVEL_GENERIC)
LoadSplash(GetLevelSplashScreen(CGame::currLevel));
CStreaming::RequestBigBuildings(CGame::currLevel, TheCamera.GetPosition());
@@ -2620,16 +2631,16 @@ CStreaming::LoadScene(const CVector &pos)
}
CRenderer::m_loadingPriority = false;
DeleteAllRwObjects();
- if(level == LEVEL_NONE)
+ if(level == LEVEL_GENERIC)
level = CGame::currLevel;
CGame::currLevel = level;
RemoveUnusedBigBuildings(level);
RequestBigBuildings(level, pos);
- RequestBigBuildings(LEVEL_NONE, pos);
+ RequestBigBuildings(LEVEL_GENERIC, pos);
RemoveIslandsNotUsed(level);
LoadAllRequestedModels(false);
InstanceBigBuildings(level, pos);
- InstanceBigBuildings(LEVEL_NONE, pos);
+ InstanceBigBuildings(LEVEL_GENERIC, pos);
AddModelsToRequestList(pos);
CRadar::StreamRadarSections(pos);
diff --git a/src/core/TempColModels.cpp b/src/core/TempColModels.cpp
index c6a9d368..e12b48dd 100644
--- a/src/core/TempColModels.cpp
+++ b/src/core/TempColModels.cpp
@@ -37,19 +37,19 @@ CTempColModels::Initialise(void)
#define SET_COLMODEL_SPHERES(colmodel, sphrs)\
colmodel.numSpheres = ARRAY_SIZE(sphrs);\
colmodel.spheres = sphrs;\
- colmodel.level = LEVEL_NONE;\
+ colmodel.level = LEVEL_GENERIC;\
colmodel.ownsCollisionVolumes = false;\
int i;
ms_colModelBBox.boundingSphere.Set(2.0f, CVector(0.0f, 0.0f, 0.0f));
ms_colModelBBox.boundingBox.Set(CVector(-2.0f, -2.0f, -2.0f), CVector(2.0f, 2.0f, 2.0f));
- ms_colModelBBox.level = LEVEL_NONE;
+ ms_colModelBBox.level = LEVEL_GENERIC;
for (i = 0; i < ARRAY_SIZE(ms_colModelCutObj); i++) {
ms_colModelCutObj[i].boundingSphere.Set(2.0f, CVector(0.0f, 0.0f, 0.0f));
ms_colModelCutObj[i].boundingBox.Set(CVector(-2.0f, -2.0f, -2.0f), CVector(2.0f, 2.0f, 2.0f));
- ms_colModelCutObj[i].level = LEVEL_NONE;
+ ms_colModelCutObj[i].level = LEVEL_GENERIC;
}
// Ped Spheres
diff --git a/src/core/World.cpp b/src/core/World.cpp
index 8399161f..7126b26f 100644
--- a/src/core/World.cpp
+++ b/src/core/World.cpp
@@ -1785,7 +1785,7 @@ CWorld::ClearForRestart(void)
CWorld::Remove(pEntity);
delete pEntity;
}
- for(CPtrNode *pNode = GetBigBuildingList(LEVEL_NONE).first; pNode; pNode = pNode->next) {
+ for(CPtrNode *pNode = GetBigBuildingList(LEVEL_GENERIC).first; pNode; pNode = pNode->next) {
CVehicle *pVehicle = (CVehicle *)pNode->item;
if(pVehicle && pVehicle->IsVehicle() && pVehicle->IsPlane()) {
CWorld::Remove(pVehicle);
diff --git a/src/core/Zones.cpp b/src/core/Zones.cpp
index 84b5ca29..87e85da5 100644
--- a/src/core/Zones.cpp
+++ b/src/core/Zones.cpp
@@ -93,7 +93,7 @@ CTheZones::Init(void)
InfoZoneArray[0].maxx = 1600.0f;
InfoZoneArray[0].maxy = 2000.0f;
InfoZoneArray[0].maxz = 500.0f;
- InfoZoneArray[0].level = LEVEL_NONE;
+ InfoZoneArray[0].level = LEVEL_GENERIC;
InfoZoneArray[0].type = ZONE_INFO;
strcpy(NavigationZoneArray[0].name, "VICE_C");
@@ -103,10 +103,10 @@ CTheZones::Init(void)
NavigationZoneArray[0].maxx = 1600.0f;
NavigationZoneArray[0].maxy = 2000.0f;
NavigationZoneArray[0].maxz = 500.0f;
- NavigationZoneArray[0].level = LEVEL_NONE;
+ NavigationZoneArray[0].level = LEVEL_GENERIC;
NavigationZoneArray[0].type = ZONE_NAVIG;
- m_CurrLevel = LEVEL_NONE;
+ m_CurrLevel = LEVEL_GENERIC;
for(i = 0; i < NUMMAPZONES; i++){
memset(&MapZoneArray[i], 0, sizeof(CZone));
@@ -120,7 +120,7 @@ CTheZones::Init(void)
MapZoneArray[0].maxx = 1600.0f;
MapZoneArray[0].maxy = 2000.0f;
MapZoneArray[0].maxz = 500.0f;
- MapZoneArray[0].level = LEVEL_NONE;
+ MapZoneArray[0].level = LEVEL_GENERIC;
}
//--MIAMI: done
diff --git a/src/core/config.h b/src/core/config.h
index 5ee9d918..95550dd6 100644
--- a/src/core/config.h
+++ b/src/core/config.h
@@ -213,7 +213,10 @@ enum Config {
#define DEFAULT_NATIVE_RESOLUTION // Set default video mode to your native resolution (fixes Windows 10 launch)
#define USE_TXD_CDIMAGE // generate and load textures from txd.img
#define IMPROVED_VIDEOMODE // save and load videomode parameters instead of a magic number
+//#define DISABLE_LOADING_SCREEN // disable the loading screen which vastly improves the loading time
+//#define NO_ISLAND_LOADING // disable loadscreen between islands via loading all island data at once, consumes more memory and CPU
//#define USE_TEXTURE_POOL
+#define CUTSCENE_BORDERS_SWITCH
// Water & Particle
#define PC_PARTICLE
@@ -281,6 +284,7 @@ enum Config {
#define VC_PED_PORTS // various ports from VC's CPed, mostly subtle
// #define NEW_WALK_AROUND_ALGORITHM // to make walking around vehicles/objects less awkward
#define CANCELLABLE_CAR_ENTER
+//#define PEDS_REPORT_CRIMES_ON_PHONE
// Camera
#define IMPROVED_CAMERA // Better Debug cam, and maybe more in the future
diff --git a/src/core/main.cpp b/src/core/main.cpp
index 6e6092f3..7d8bdb5e 100644
--- a/src/core/main.cpp
+++ b/src/core/main.cpp
@@ -249,7 +249,11 @@ DoFade(void)
}
// This is CCamera::GetScreenRect in VC
- if(TheCamera.m_WideScreenOn){
+ if(TheCamera.m_WideScreenOn
+#ifdef CUTSCENE_BORDERS_SWITCH
+ && CMenuManager::m_PrefsCutsceneBorders
+#endif
+ ){
float y = SCREEN_HEIGHT/2 * TheCamera.m_ScreenReductionPercentage/100.0f;
rect.left = 0.0f;
rect.right = SCREEN_WIDTH;
@@ -464,6 +468,11 @@ LoadingScreen(const char *str1, const char *str2, const char *splashscreen)
{
CSprite2d *splash;
+#ifdef DISABLE_LOADING_SCREEN
+ if (str1 && str2)
+ return;
+#endif
+
#ifndef RANDOMSPLASH
splashscreen = "LOADSC0";
#endif
@@ -885,7 +894,11 @@ Render2dStuff(void)
CReplay::Display();
CPickups::RenderPickUpText();
- if(TheCamera.m_WideScreenOn)
+ if(TheCamera.m_WideScreenOn
+#ifdef CUTSCENE_BORDERS_SWITCH
+ && CMenuManager::m_PrefsCutsceneBorders
+#endif
+ )
TheCamera.DrawBordersForWideScreen();
CPed *player = FindPlayerPed();
diff --git a/src/core/re3.cpp b/src/core/re3.cpp
index 7058c812..b11fb5c7 100644
--- a/src/core/re3.cpp
+++ b/src/core/re3.cpp
@@ -134,6 +134,14 @@ void ToggleFreeCam(int8 action)
}
#endif
+#ifdef CUTSCENE_BORDERS_SWITCH
+void BorderModeChange(int8 displayedValue)
+{
+ CMenuManager::m_PrefsCutsceneBorders = !!displayedValue;
+ FrontEndMenuManager.SaveSettings();
+}
+#endif
+
// Reloaded on language change, so you can use hardcoded wchar* and TheText.Get with peace of mind
void
CustomFrontendOptionsPopulate(void)
@@ -158,6 +166,12 @@ CustomFrontendOptionsPopulate(void)
FrontendOptionSetPosition(MENUPAGE_CONTROLLER_PC, 1);
FrontendOptionAddDynamic(text, nil, ToggleFreeCam, nil);
#endif
+
+#ifdef CUTSCENE_BORDERS_SWITCH
+ static const wchar *off_on[] = { TheText.Get("FEM_OFF"), TheText.Get("FEM_ON") };
+ FrontendOptionSetPosition(MENUPAGE_GRAPHICS_SETTINGS, 9);
+ FrontendOptionAddSelect((const wchar *)L"CUTSCENE BORDERS", off_on, 2, (int8 *)&CMenuManager::m_PrefsCutsceneBorders, false, BorderModeChange, nil);
+#endif
}
#endif
diff --git a/src/entities/Building.cpp b/src/entities/Building.cpp
index 3217e684..921055ce 100644
--- a/src/entities/Building.cpp
+++ b/src/entities/Building.cpp
@@ -17,7 +17,7 @@ CBuilding::ReplaceWithNewModel(int32 id)
m_modelIndex = id;
if(bIsBIGBuilding)
- if(m_level == LEVEL_NONE || m_level == CGame::currLevel)
+ if(m_level == LEVEL_GENERIC || m_level == CGame::currLevel)
CStreaming::RequestModel(id, STREAMFLAGS_DONT_REMOVE);
}
diff --git a/src/entities/Entity.cpp b/src/entities/Entity.cpp
index 394b8162..04d6d328 100644
--- a/src/entities/Entity.cpp
+++ b/src/entities/Entity.cpp
@@ -359,8 +359,8 @@ CEntity::SetupBigBuilding(void)
if(mi->m_lodDistances[0] <= 2000.0f)
bStreamBIGBuilding = true;
if(mi->m_lodDistances[0] > 2500.0f || mi->m_ignoreDrawDist)
- m_level = LEVEL_NONE;
- else if(m_level == LEVEL_NONE)
+ m_level = LEVEL_GENERIC;
+ else if(m_level == LEVEL_GENERIC)
printf("%s isn't in a level\n", mi->GetName());
}
diff --git a/src/entities/Physical.cpp b/src/entities/Physical.cpp
index 12345cc9..5fe29a79 100644
--- a/src/entities/Physical.cpp
+++ b/src/entities/Physical.cpp
@@ -75,7 +75,7 @@ CPhysical::CPhysical(void)
#ifdef FIX_BUGS
m_nSurfaceTouched = SURFACE_DEFAULT;
#endif
- m_nZoneLevel = LEVEL_NONE;
+ m_nZoneLevel = LEVEL_GENERIC;
bIsFrozen = false;
bDontLoadCollision = false;
diff --git a/src/modelinfo/PedModelInfo.cpp b/src/modelinfo/PedModelInfo.cpp
index a9caa867..8d07737f 100644
--- a/src/modelinfo/PedModelInfo.cpp
+++ b/src/modelinfo/PedModelInfo.cpp
@@ -110,7 +110,7 @@ CPedModelInfo::CreateHitColModelSkinned(RpClump *clump)
max.x = max.y = 0.5f;
max.z = 1.2f;
colmodel->boundingBox.Set(min, max);
- colmodel->level = LEVEL_NONE;
+ colmodel->level = LEVEL_GENERIC;
m_hitColModel = colmodel;
}
diff --git a/src/peds/Population.cpp b/src/peds/Population.cpp
index d3b1499a..70caf1f2 100644
--- a/src/peds/Population.cpp
+++ b/src/peds/Population.cpp
@@ -353,7 +353,7 @@ CPopulation::FindCollisionZoneForCoors(CVector *coors, int *safeZoneOut, eLevelN
}
// Then it's transition area
if (*safeZoneOut >= 0)
- *levelOut = LEVEL_NONE;
+ *levelOut = LEVEL_GENERIC;
else
*levelOut = CTheZones::GetLevelFromPosition(coors);
}
diff --git a/src/render/Draw.cpp b/src/render/Draw.cpp
index 3f7d89c7..ab360aac 100644
--- a/src/render/Draw.cpp
+++ b/src/render/Draw.cpp
@@ -3,6 +3,7 @@
#include "Draw.h"
#include "Frontend.h"
#include "Camera.h"
+#include "CutsceneMgr.h"
#ifdef ASPECT_RATIO_SCALE
float CDraw::ms_fAspectRatio = DEFAULT_ASPECT_RATIO;
@@ -61,7 +62,10 @@ void
CDraw::SetFOV(float fov)
{
#ifdef ASPECT_RATIO_SCALE
- ms_fScaledFOV = ConvertFOV(fov);
+ if (!CCutsceneMgr::IsRunning())
+ ms_fScaledFOV = ConvertFOV(fov);
+ else
+ ms_fScaledFOV = fov;
#endif
ms_fFOV = fov;
}
diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp
index becac84d..329a8c9a 100644
--- a/src/render/Renderer.cpp
+++ b/src/render/Renderer.cpp
@@ -779,7 +779,7 @@ CRenderer::ScanWorld(void)
ScanSectorPoly(poly, 3, ScanSectorList);
ScanBigBuildingList(CWorld::GetBigBuildingList(CGame::currLevel));
- ScanBigBuildingList(CWorld::GetBigBuildingList(LEVEL_NONE));
+ ScanBigBuildingList(CWorld::GetBigBuildingList(LEVEL_GENERIC));
}
}
}
diff --git a/src/save/GenericGameStorage.cpp b/src/save/GenericGameStorage.cpp
index 0f583221..52c1aef7 100644
--- a/src/save/GenericGameStorage.cpp
+++ b/src/save/GenericGameStorage.cpp
@@ -497,7 +497,7 @@ CheckDataNotCorrupt(int32 slot, char *name)
char filename[100];
int32 blocknum = 0;
- eLevelName level = LEVEL_NONE;
+ eLevelName level = LEVEL_GENERIC;
CheckSum = 0;
uint32 bytes_processed = 0;
sprintf(filename, "%s%i%s", DefaultPCSaveFileName, slot + 1, ".b");
diff --git a/src/skel/glfw/glfw.cpp b/src/skel/glfw/glfw.cpp
index d01e05b5..e1860179 100644
--- a/src/skel/glfw/glfw.cpp
+++ b/src/skel/glfw/glfw.cpp
@@ -1370,6 +1370,15 @@ WinMain(HINSTANCE instance,
RwInt32 argc;
RwChar** argv;
SystemParametersInfo(SPI_SETFOREGROUNDLOCKTIMEOUT, 0, nil, SPIF_SENDCHANGE);
+
+#if 0
+ // TODO: make this an option somewhere
+ AllocConsole();
+ freopen("CONIN$", "r", stdin);
+ freopen("CONOUT$", "w", stdout);
+ freopen("CONOUT$", "w", stderr);
+#endif
+
#else
int
main(int argc, char *argv[])
diff --git a/src/vehicles/Plane.cpp b/src/vehicles/Plane.cpp
index bc27ca32..c275ff6e 100644
--- a/src/vehicles/Plane.cpp
+++ b/src/vehicles/Plane.cpp
@@ -83,7 +83,7 @@ CPlane::CPlane(int32 id, uint8 CreatedBy)
SetStatus(STATUS_PLANE);
bIsBIGBuilding = true;
- m_level = LEVEL_NONE;
+ m_level = LEVEL_GENERIC;
#ifdef FIX_BUGS
m_isFarAway = true;