summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2020-07-13 17:10:17 +0200
committerSergeanur <s.anureev@yandex.ua>2020-07-13 17:10:17 +0200
commitd0f5464200be032ee464218cfe415f3ce0b119a7 (patch)
treedd6f068286bb29c72192689bf741c43fcb505ae1 /src/core
parentMerge pull request #654 from erorcun/miami (diff)
parentRename LEVEL_NONE to LEVEL_GENERIC (diff)
downloadre3-d0f5464200be032ee464218cfe415f3ce0b119a7.tar
re3-d0f5464200be032ee464218cfe415f3ce0b119a7.tar.gz
re3-d0f5464200be032ee464218cfe415f3ce0b119a7.tar.bz2
re3-d0f5464200be032ee464218cfe415f3ce0b119a7.tar.lz
re3-d0f5464200be032ee464218cfe415f3ce0b119a7.tar.xz
re3-d0f5464200be032ee464218cfe415f3ce0b119a7.tar.zst
re3-d0f5464200be032ee464218cfe415f3ce0b119a7.zip
Diffstat (limited to 'src/core')
-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
15 files changed, 89 insertions, 33 deletions
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