1
0
Fork 0
mirror of https://git.rip/DMCA_FUCKER/re3.git synced 2024-12-23 07:40:01 +00:00

NO_ISLAND_LOADING ported from re3

This commit is contained in:
Sergeanur 2020-12-27 18:26:30 +02:00
parent 76e744bb7b
commit 7959b7fd1f
7 changed files with 77 additions and 45 deletions

View file

@ -173,7 +173,7 @@ CColStore::LoadCollision(const CVector2D &pos)
if(GetBoundingBox(i).IsPointInside(pos) || if(GetBoundingBox(i).IsPointInside(pos) ||
bLoadAtSecondPosition && GetBoundingBox(i).IsPointInside(secondPosition, -119.0f) || bLoadAtSecondPosition && GetBoundingBox(i).IsPointInside(secondPosition, -119.0f) ||
CGeneral::faststrcmp(GetColName(i), "yacht") == 0){ strcmp(GetColName(i), "yacht") == 0){
wantThisOne = true; wantThisOne = true;
}else{ }else{
for (int j = 0; j < MAX_CLEANUP; j++) { for (int j = 0; j < MAX_CLEANUP; j++) {

View file

@ -527,6 +527,10 @@ CMenuManager::CMenuManager()
m_fMapCenterY = MENU_Y(225.0f); m_fMapCenterY = MENU_Y(225.0f);
DMAudio.SetMusicMasterVolume(m_PrefsMusicVolume); DMAudio.SetMusicMasterVolume(m_PrefsMusicVolume);
DMAudio.SetEffectsMasterVolume(m_PrefsSfxVolume); DMAudio.SetEffectsMasterVolume(m_PrefsSfxVolume);
#ifdef NO_ISLAND_LOADING
m_PrefsIslandLoading = ISLAND_LOADING_LOW;
#endif
} }
void void

View file

@ -698,10 +698,10 @@ public:
ISLAND_LOADING_HIGH ISLAND_LOADING_HIGH
}; };
static int8 m_PrefsIslandLoading; int8 m_PrefsIslandLoading;
#define ISLAND_LOADING_IS(p) if (CMenuManager::m_PrefsIslandLoading == CMenuManager::ISLAND_LOADING_##p) #define ISLAND_LOADING_IS(p) if (FrontEndMenuManager.m_PrefsIslandLoading == CMenuManager::ISLAND_LOADING_##p)
#define ISLAND_LOADING_ISNT(p) if (CMenuManager::m_PrefsIslandLoading != CMenuManager::ISLAND_LOADING_##p) #define ISLAND_LOADING_ISNT(p) if (FrontEndMenuManager.m_PrefsIslandLoading != CMenuManager::ISLAND_LOADING_##p)
#else #else
#define ISLAND_LOADING_IS(p) #define ISLAND_LOADING_IS(p)
#define ISLAND_LOADING_ISNT(p) #define ISLAND_LOADING_ISNT(p)

View file

@ -100,8 +100,6 @@ void RestoreDefGraphics(int8 action) {
#ifdef NO_ISLAND_LOADING #ifdef NO_ISLAND_LOADING
if (!FrontEndMenuManager.m_bGameNotLoaded) { if (!FrontEndMenuManager.m_bGameNotLoaded) {
FrontEndMenuManager.m_PrefsIslandLoading = FrontEndMenuManager.ISLAND_LOADING_LOW; FrontEndMenuManager.m_PrefsIslandLoading = FrontEndMenuManager.ISLAND_LOADING_LOW;
CCollision::bAlreadyLoaded = false;
CModelInfo::RemoveColModelsFromOtherLevels(CGame::currLevel);
CStreaming::RemoveUnusedBigBuildings(CGame::currLevel); CStreaming::RemoveUnusedBigBuildings(CGame::currLevel);
CStreaming::RemoveUnusedBuildings(CGame::currLevel); CStreaming::RemoveUnusedBuildings(CGame::currLevel);
CStreaming::RequestIslands(CGame::currLevel); CStreaming::RequestIslands(CGame::currLevel);
@ -151,16 +149,11 @@ void IslandLoadingAfterChange(int8 before, int8 after) {
if (after > FrontEndMenuManager.ISLAND_LOADING_LOW) { if (after > FrontEndMenuManager.ISLAND_LOADING_LOW) {
FrontEndMenuManager.m_PrefsIslandLoading = before; // calls below needs previous mode :shrug: FrontEndMenuManager.m_PrefsIslandLoading = before; // calls below needs previous mode :shrug:
if (after == FrontEndMenuManager.ISLAND_LOADING_HIGH) if (after == FrontEndMenuManager.ISLAND_LOADING_HIGH) {
CStreaming::RemoveIslandsNotUsed(LEVEL_GENERIC); CStreaming::RemoveIslandsNotUsed(LEVEL_BEACH);
CStreaming::RemoveIslandsNotUsed(LEVEL_MAINLAND);
}
if (before == FrontEndMenuManager.ISLAND_LOADING_LOW) { if (before == FrontEndMenuManager.ISLAND_LOADING_LOW) {
if (CGame::currLevel != LEVEL_INDUSTRIAL)
CFileLoader::LoadCollisionFromDatFile(LEVEL_INDUSTRIAL);
if (CGame::currLevel != LEVEL_COMMERCIAL)
CFileLoader::LoadCollisionFromDatFile(LEVEL_COMMERCIAL);
if (CGame::currLevel != LEVEL_SUBURBAN)
CFileLoader::LoadCollisionFromDatFile(LEVEL_SUBURBAN);
CCollision::bAlreadyLoaded = true;
FrontEndMenuManager.m_PrefsIslandLoading = after; FrontEndMenuManager.m_PrefsIslandLoading = after;
CStreaming::RequestBigBuildings(CGame::currLevel); CStreaming::RequestBigBuildings(CGame::currLevel);
@ -171,8 +164,6 @@ void IslandLoadingAfterChange(int8 before, int8 after) {
FrontEndMenuManager.m_PrefsIslandLoading = after; FrontEndMenuManager.m_PrefsIslandLoading = after;
} else { // low } else { // low
CCollision::bAlreadyLoaded = false;
CModelInfo::RemoveColModelsFromOtherLevels(CGame::currLevel);
CStreaming::RemoveUnusedBigBuildings(CGame::currLevel); CStreaming::RemoveUnusedBigBuildings(CGame::currLevel);
CStreaming::RemoveUnusedBuildings(CGame::currLevel); CStreaming::RemoveUnusedBuildings(CGame::currLevel);
CStreaming::RequestIslands(CGame::currLevel); CStreaming::RequestIslands(CGame::currLevel);

View file

@ -35,6 +35,7 @@
#include "MemoryMgr.h" #include "MemoryMgr.h"
#include "MemoryHeap.h" #include "MemoryHeap.h"
#include "Font.h" #include "Font.h"
#include "Frontend.h"
//--MIAMI: file done (possibly bugs) //--MIAMI: file done (possibly bugs)
@ -797,7 +798,15 @@ CStreaming::RequestBigBuildings(eLevelName level)
n = CPools::GetBuildingPool()->GetSize()-1; n = CPools::GetBuildingPool()->GetSize()-1;
for(i = n; i >= 0; i--){ for(i = n; i >= 0; i--){
b = CPools::GetBuildingPool()->GetSlot(i); b = CPools::GetBuildingPool()->GetSlot(i);
if(b && b->bIsBIGBuilding && b->m_level == level) if(b && b->bIsBIGBuilding
#ifdef NO_ISLAND_LOADING
&& (((FrontEndMenuManager.m_PrefsIslandLoading != CMenuManager::ISLAND_LOADING_LOW) && (b != pIslandLODmainlandEntity) &&
(b != pIslandLODbeachEntity)) ||
(b->m_level == level))
#else
&& b->m_level == level
#endif
)
if(!b->bStreamBIGBuilding) if(!b->bStreamBIGBuilding)
RequestModel(b->GetModelIndex(), BIGBUILDINGFLAGS); RequestModel(b->GetModelIndex(), BIGBUILDINGFLAGS);
} }
@ -814,7 +823,10 @@ CStreaming::RequestBigBuildings(eLevelName level, const CVector &pos)
for(i = n; i >= 0; i--){ for(i = n; i >= 0; i--){
b = CPools::GetBuildingPool()->GetSlot(i); b = CPools::GetBuildingPool()->GetSlot(i);
if(b && b->bIsBIGBuilding if(b && b->bIsBIGBuilding
#ifndef NO_ISLAND_LOADING #ifdef NO_ISLAND_LOADING
&& (((FrontEndMenuManager.m_PrefsIslandLoading != CMenuManager::ISLAND_LOADING_LOW) && (b != pIslandLODmainlandEntity) && (b != pIslandLODbeachEntity)
) || (b->m_level == level))
#else
&& b->m_level == level && b->m_level == level
#endif #endif
) )
@ -885,7 +897,7 @@ CStreaming::InstanceLoadedModels(const CVector &pos)
void void
CStreaming::RequestIslands(eLevelName level) CStreaming::RequestIslands(eLevelName level)
{ {
#ifndef NO_ISLAND_LOADING ISLAND_LOADING_ISNT(HIGH)
switch(level){ switch(level){
case LEVEL_MAINLAND: case LEVEL_MAINLAND:
if(islandLODbeach != -1) if(islandLODbeach != -1)
@ -897,7 +909,6 @@ CStreaming::RequestIslands(eLevelName level)
break; break;
default: break; default: break;
} }
#endif
} }
static char *IGnames[] = { static char *IGnames[] = {
@ -1227,12 +1238,13 @@ CStreaming::RemoveBuildingsNotInArea(int32 area)
void void
CStreaming::RemoveUnusedBigBuildings(eLevelName level) CStreaming::RemoveUnusedBigBuildings(eLevelName level)
{ {
#ifndef NO_ISLAND_LOADING ISLAND_LOADING_IS(LOW)
{
if(level != LEVEL_BEACH) if(level != LEVEL_BEACH)
RemoveBigBuildings(LEVEL_BEACH); RemoveBigBuildings(LEVEL_BEACH);
if(level != LEVEL_MAINLAND) if(level != LEVEL_MAINLAND)
RemoveBigBuildings(LEVEL_MAINLAND); RemoveBigBuildings(LEVEL_MAINLAND);
#endif }
RemoveIslandsNotUsed(level); RemoveIslandsNotUsed(level);
} }
@ -1252,7 +1264,6 @@ DeleteIsland(CEntity *island)
void void
CStreaming::RemoveIslandsNotUsed(eLevelName level) CStreaming::RemoveIslandsNotUsed(eLevelName level)
{ {
#ifndef NO_ISLAND_LOADING
int i; int i;
if(pIslandLODmainlandEntity == nil) if(pIslandLODmainlandEntity == nil)
for(i = CPools::GetBuildingPool()->GetSize()-1; i >= 0; i--){ for(i = CPools::GetBuildingPool()->GetSize()-1; i >= 0; i--){
@ -1264,7 +1275,12 @@ CStreaming::RemoveIslandsNotUsed(eLevelName level)
if(building->GetModelIndex() == islandLODbeach) if(building->GetModelIndex() == islandLODbeach)
pIslandLODbeachEntity = building; pIslandLODbeachEntity = building;
} }
#ifdef NO_ISLAND_LOADING
if(FrontEndMenuManager.m_PrefsIslandLoading == CMenuManager::ISLAND_LOADING_HIGH) {
DeleteIsland(pIslandLODmainlandEntity);
DeleteIsland(pIslandLODbeachEntity);
} else
#endif
switch(level){ switch(level){
case LEVEL_MAINLAND: case LEVEL_MAINLAND:
DeleteIsland(pIslandLODmainlandEntity); DeleteIsland(pIslandLODmainlandEntity);
@ -1274,7 +1290,6 @@ CStreaming::RemoveIslandsNotUsed(eLevelName level)
break; break;
} }
#endif // !NO_ISLAND_LOADING
} }
void void
@ -1875,6 +1890,8 @@ CStreaming::LoadBigBuildingsWhenNeeded(void)
CTimer::Suspend(); CTimer::Suspend();
CGame::currLevel = CTheZones::m_CurrLevel; CGame::currLevel = CTheZones::m_CurrLevel;
ISLAND_LOADING_IS(LOW)
{
DMAudio.SetEffectsFadeVol(0); DMAudio.SetEffectsFadeVol(0);
CPad::StopPadsShaking(); CPad::StopPadsShaking();
CCollision::LoadCollisionScreen(CGame::currLevel); CCollision::LoadCollisionScreen(CGame::currLevel);
@ -1884,16 +1901,24 @@ CStreaming::LoadBigBuildingsWhenNeeded(void)
RemoveUnusedBuildings(CGame::currLevel); RemoveUnusedBuildings(CGame::currLevel);
RemoveUnusedModelsInLoadedList(); RemoveUnusedModelsInLoadedList();
CGame::TidyUpMemory(true, true); CGame::TidyUpMemory(true, true);
}
CReplay::EmptyReplayBuffer(); CReplay::EmptyReplayBuffer();
if(CGame::currLevel != LEVEL_GENERIC) if(CGame::currLevel != LEVEL_GENERIC)
LoadSplash(GetLevelSplashScreen(CGame::currLevel)); LoadSplash(GetLevelSplashScreen(CGame::currLevel));
ISLAND_LOADING_IS(LOW)
CStreaming::RequestBigBuildings(CGame::currLevel, TheCamera.GetPosition()); CStreaming::RequestBigBuildings(CGame::currLevel, TheCamera.GetPosition());
else if(FrontEndMenuManager.m_PrefsIslandLoading == CMenuManager::ISLAND_LOADING_MEDIUM) {
RemoveIslandsNotUsed(CGame::currLevel);
CStreaming::RequestIslands(CGame::currLevel);
}
CStreaming::LoadAllRequestedModels(false); CStreaming::LoadAllRequestedModels(false);
CGame::TidyUpMemory(true, true); CGame::TidyUpMemory(true, true);
CTimer::Resume(); CTimer::Resume();
ISLAND_LOADING_IS(LOW)
DMAudio.SetEffectsFadeVol(127); DMAudio.SetEffectsFadeVol(127);
} }

View file

@ -310,7 +310,7 @@ enum Config {
# ifdef CUSTOM_FRONTEND_OPTIONS # ifdef CUSTOM_FRONTEND_OPTIONS
# define GRAPHICS_MENU_OPTIONS // otherwise Display settings will be scrollable # define GRAPHICS_MENU_OPTIONS // otherwise Display settings will be scrollable
//# define NO_ISLAND_LOADING // disable loadscreen between islands via loading all island data at once, consumes more memory and CPU # define NO_ISLAND_LOADING // disable loadscreen between islands via loading all island data at once, consumes more memory and CPU
# define CUTSCENE_BORDERS_SWITCH # define CUTSCENE_BORDERS_SWITCH
//# define MULTISAMPLING // adds MSAA option //# define MULTISAMPLING // adds MSAA option
# define INVERT_LOOK_FOR_PAD // enable the hidden option # define INVERT_LOOK_FOR_PAD // enable the hidden option

View file

@ -24,6 +24,7 @@
#include "Occlusion.h" #include "Occlusion.h"
#include "Renderer.h" #include "Renderer.h"
#include "custompipes.h" #include "custompipes.h"
#include "Frontend.h"
//--MIAMI: file done //--MIAMI: file done
@ -1397,7 +1398,18 @@ CRenderer::ScanWorld(void)
ScanSectorPoly(poly, 3, ScanSectorList); ScanSectorPoly(poly, 3, ScanSectorList);
} }
#ifdef NO_ISLAND_LOADING
if (FrontEndMenuManager.m_PrefsIslandLoading == CMenuManager::ISLAND_LOADING_HIGH) {
ScanBigBuildingList(CWorld::GetBigBuildingList(LEVEL_BEACH));
ScanBigBuildingList(CWorld::GetBigBuildingList(LEVEL_MAINLAND));
} else
#endif
{
#ifdef FIX_BUGS
if(CCollision::ms_collisionInMemory != LEVEL_GENERIC)
#endif
ScanBigBuildingList(CWorld::GetBigBuildingList(CGame::currLevel)); ScanBigBuildingList(CWorld::GetBigBuildingList(CGame::currLevel));
}
ScanBigBuildingList(CWorld::GetBigBuildingList(LEVEL_GENERIC)); ScanBigBuildingList(CWorld::GetBigBuildingList(LEVEL_GENERIC));
} }
} }