summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2020-07-09 18:18:42 +0200
committerSergeanur <s.anureev@yandex.ua>2020-07-09 18:18:42 +0200
commitcf69f22a0ce5b808a4d945a5cef1d9d4c51c0b5c (patch)
treef8a4337f1394c0c55b1be4e8ee62e49e713ba1c7 /src
parentRemove console and fix sth (diff)
downloadre3-cf69f22a0ce5b808a4d945a5cef1d9d4c51c0b5c.tar
re3-cf69f22a0ce5b808a4d945a5cef1d9d4c51c0b5c.tar.gz
re3-cf69f22a0ce5b808a4d945a5cef1d9d4c51c0b5c.tar.bz2
re3-cf69f22a0ce5b808a4d945a5cef1d9d4c51c0b5c.tar.lz
re3-cf69f22a0ce5b808a4d945a5cef1d9d4c51c0b5c.tar.xz
re3-cf69f22a0ce5b808a4d945a5cef1d9d4c51c0b5c.tar.zst
re3-cf69f22a0ce5b808a4d945a5cef1d9d4c51c0b5c.zip
Diffstat (limited to 'src')
-rw-r--r--src/control/Script.cpp10
-rw-r--r--src/core/Collision.cpp29
-rw-r--r--src/core/Streaming.cpp14
-rw-r--r--src/core/config.h1
-rw-r--r--src/modelinfo/ModelInfo.cpp2
-rw-r--r--src/render/Renderer.cpp10
-rw-r--r--src/save/GenericGameStorage.cpp5
7 files changed, 66 insertions, 5 deletions
diff --git a/src/control/Script.cpp b/src/control/Script.cpp
index 4de45e0d..3309dbd2 100644
--- a/src/control/Script.cpp
+++ b/src/control/Script.cpp
@@ -10027,11 +10027,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;
}
@@ -10647,18 +10651,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 23eaa8dd..cb8b4189 100644
--- a/src/core/Collision.cpp
+++ b/src/core/Collision.cpp
@@ -180,12 +180,16 @@ CCollision::LoadCollisionWhenINeedIt(bool forceChange)
if(level == CGame::currLevel || forceChange){
CTimer::Stop();
+#ifndef NO_ISLAND_LOADING
DMAudio.SetEffectsFadeVol(0);
CPad::StopPadsShaking();
LoadCollisionScreen(CGame::currLevel);
DMAudio.Service();
+#endif
CPopulation::DealWithZoneChange(ms_collisionInMemory, CGame::currLevel, false);
+
+#ifndef NO_ISLAND_LOADING
CStreaming::RemoveIslandsNotUsed(LEVEL_INDUSTRIAL);
CStreaming::RemoveIslandsNotUsed(LEVEL_COMMERCIAL);
CStreaming::RemoveIslandsNotUsed(LEVEL_SUBURBAN);
@@ -196,19 +200,27 @@ CCollision::LoadCollisionWhenINeedIt(bool forceChange)
CStreaming::RemoveUnusedModelsInLoadedList();
CGame::TidyUpMemory(true, true);
CFileLoader::LoadCollisionFromDatFile(CGame::currLevel);
+#endif
+
ms_collisionInMemory = CGame::currLevel;
CReplay::EmptyReplayBuffer();
+#ifndef NO_ISLAND_LOADING
if(CGame::currLevel != LEVEL_NONE)
LoadSplash(GetLevelSplashScreen(CGame::currLevel));
CStreaming::RemoveUnusedBigBuildings(CGame::currLevel);
CStreaming::RemoveUnusedBuildings(CGame::currLevel);
CStreaming::RequestBigBuildings(CGame::currLevel);
+#endif
CStreaming::LoadAllRequestedModels(true);
+#ifndef NO_ISLAND_LOADING
CStreaming::HaveAllBigBuildingsLoaded(CGame::currLevel);
CGame::TidyUpMemory(true, true);
+#endif
CTimer::Update();
+#ifndef NO_ISLAND_LOADING
DMAudio.SetEffectsFadeVol(127);
+#endif
}
}
@@ -217,10 +229,23 @@ CCollision::SortOutCollisionAfterLoad(void)
{
if(ms_collisionInMemory == CGame::currLevel)
return;
-
+#ifndef NO_ISLAND_LOADING
CModelInfo::RemoveColModelsFromOtherLevels(CGame::currLevel);
- if(CGame::currLevel != LEVEL_NONE){
+#endif
+ if (CGame::currLevel != LEVEL_NONE) {
+#ifdef NO_ISLAND_LOADING
+ static bool bAlreadyLoaded = false;
+ if (bAlreadyLoaded) {
+ ms_collisionInMemory = CGame::currLevel;
+ return;
+ }
+ bAlreadyLoaded = true;
+ CFileLoader::LoadCollisionFromDatFile(LEVEL_INDUSTRIAL);
+ CFileLoader::LoadCollisionFromDatFile(LEVEL_COMMERCIAL);
+ CFileLoader::LoadCollisionFromDatFile(LEVEL_SUBURBAN);
+#else
CFileLoader::LoadCollisionFromDatFile(CGame::currLevel);
+#endif
if(!CGame::playingIntro)
LoadSplash(GetLevelSplashScreen(CGame::currLevel));
}
diff --git a/src/core/Streaming.cpp b/src/core/Streaming.cpp
index c961f53d..b701f43f 100644
--- a/src/core/Streaming.cpp
+++ b/src/core/Streaming.cpp
@@ -725,7 +725,11 @@ CStreaming::RequestBigBuildings(eLevelName level)
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
+ )
RequestModel(b->GetModelIndex(), BIGBUILDINGFLAGS);
}
RequestIslands(level);
@@ -735,6 +739,7 @@ CStreaming::RequestBigBuildings(eLevelName level)
void
CStreaming::RequestIslands(eLevelName level)
{
+#ifndef NO_ISLAND_LOADING
switch(level){
case LEVEL_INDUSTRIAL:
RequestModel(islandLODcomInd, BIGBUILDINGFLAGS);
@@ -750,6 +755,7 @@ CStreaming::RequestIslands(eLevelName level)
break;
default: break;
}
+#endif
}
void
@@ -935,12 +941,14 @@ CStreaming::RemoveBuildings(eLevelName level)
void
CStreaming::RemoveUnusedBigBuildings(eLevelName level)
{
+#ifndef NO_ISLAND_LOADING
if(level != LEVEL_INDUSTRIAL)
RemoveBigBuildings(LEVEL_INDUSTRIAL);
if(level != LEVEL_COMMERCIAL)
RemoveBigBuildings(LEVEL_COMMERCIAL);
if(level != LEVEL_SUBURBAN)
RemoveBigBuildings(LEVEL_SUBURBAN);
+#endif
RemoveIslandsNotUsed(level);
}
@@ -960,6 +968,7 @@ DeleteIsland(CEntity *island)
void
CStreaming::RemoveIslandsNotUsed(eLevelName level)
{
+#ifndef NO_ISLAND_LOADING
switch(level){
case LEVEL_INDUSTRIAL:
DeleteIsland(pIslandLODindustEntity);
@@ -977,13 +986,16 @@ CStreaming::RemoveIslandsNotUsed(eLevelName level)
DeleteIsland(pIslandLODcomIndEntity);
break;
default:
+#endif // !NO_ISLAND_LOADING
DeleteIsland(pIslandLODindustEntity);
DeleteIsland(pIslandLODcomIndEntity);
DeleteIsland(pIslandLODcomSubEntity);
DeleteIsland(pIslandLODsubIndEntity);
DeleteIsland(pIslandLODsubComEntity);
+#ifndef NO_ISLAND_LOADING
break;
}
+#endif // !NO_ISLAND_LOADING
}
void
diff --git a/src/core/config.h b/src/core/config.h
index 9d9577ff..5010ed3d 100644
--- a/src/core/config.h
+++ b/src/core/config.h
@@ -198,6 +198,7 @@ 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 NO_ISLAND_LOADING // disable loadscreen between islands via loading all island data at once, consumes more memory and CPU
//#define USE_TEXTURE_POOL
// Particle
diff --git a/src/modelinfo/ModelInfo.cpp b/src/modelinfo/ModelInfo.cpp
index da09bdfa..713600fd 100644
--- a/src/modelinfo/ModelInfo.cpp
+++ b/src/modelinfo/ModelInfo.cpp
@@ -217,6 +217,7 @@ CModelInfo::IsBikeModel(int32 id)
void
CModelInfo::RemoveColModelsFromOtherLevels(eLevelName level)
{
+#ifndef NO_ISLAND_LOADING
int i;
CBaseModelInfo *mi;
CColModel *colmodel;
@@ -229,6 +230,7 @@ CModelInfo::RemoveColModelsFromOtherLevels(eLevelName level)
colmodel->RemoveCollisionVolumes();
}
}
+#endif
}
void
diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp
index 8a48eb11..53181e52 100644
--- a/src/render/Renderer.cpp
+++ b/src/render/Renderer.cpp
@@ -700,8 +700,16 @@ CRenderer::ScanWorld(void)
poly[2].y = CWorld::GetSectorY(vectors[CORNER_LOD_RIGHT].y);
}
ScanSectorPoly(poly, 3, ScanSectorList);
-
+#ifdef NO_ISLAND_LOADING
+ ScanBigBuildingList(CWorld::GetBigBuildingList(LEVEL_INDUSTRIAL));
+ ScanBigBuildingList(CWorld::GetBigBuildingList(LEVEL_COMMERCIAL));
+ ScanBigBuildingList(CWorld::GetBigBuildingList(LEVEL_SUBURBAN));
+#else
+ #ifdef FIX_BUGS
+ if (CCollision::ms_collisionInMemory != LEVEL_NONE)
+ #endif
ScanBigBuildingList(CWorld::GetBigBuildingList(CCollision::ms_collisionInMemory));
+#endif
ScanBigBuildingList(CWorld::GetBigBuildingList(LEVEL_NONE));
}
}
diff --git a/src/save/GenericGameStorage.cpp b/src/save/GenericGameStorage.cpp
index eff0f2ff..1ac17982 100644
--- a/src/save/GenericGameStorage.cpp
+++ b/src/save/GenericGameStorage.cpp
@@ -562,14 +562,17 @@ RestoreForStartLoad()
ReadDataFromBufferPointer(_buf, TheCamera.GetMatrix().GetPosition().x);
ReadDataFromBufferPointer(_buf, TheCamera.GetMatrix().GetPosition().y);
ReadDataFromBufferPointer(_buf, TheCamera.GetMatrix().GetPosition().z);
+#ifndef NO_ISLAND_LOADING
CStreaming::RemoveUnusedBigBuildings(CGame::currLevel);
CStreaming::RemoveUnusedBuildings(CGame::currLevel);
+#endif
CCollision::SortOutCollisionAfterLoad();
+#ifndef NO_ISLAND_LOADING
CStreaming::RequestBigBuildings(CGame::currLevel);
CStreaming::LoadAllRequestedModels(false);
CStreaming::HaveAllBigBuildingsLoaded(CGame::currLevel);
CGame::TidyUpMemory(true, false);
-
+#endif
if (CloseFile(file)) {
return true;
} else {