Island loading and PS2 alpha test added to options

This commit is contained in:
Sergeanur 2020-08-16 17:26:44 +03:00
parent a728a542be
commit 732681db08
14 changed files with 417 additions and 104 deletions

Binary file not shown.

View File

@ -9,6 +9,7 @@
#include "Timer.h" #include "Timer.h"
#include "VehicleModelInfo.h" #include "VehicleModelInfo.h"
#include "World.h" #include "World.h"
#include "Frontend.h"
uint16 CRecordDataForGame::RecordingState; uint16 CRecordDataForGame::RecordingState;
uint8* CRecordDataForGame::pDataBuffer; uint8* CRecordDataForGame::pDataBuffer;
@ -439,10 +440,11 @@ void CRecordDataForChase::StartChaseScene(float startTime)
Status = STATE_PLAYBACK; Status = STATE_PLAYBACK;
AnimTime = startTime; AnimTime = startTime;
AnimStartTime = CTimer::GetTimeInMilliseconds(); AnimStartTime = CTimer::GetTimeInMilliseconds();
#ifndef NO_ISLAND_LOADING #ifdef NO_ISLAND_LOADING
RemoveUnusedCollision(); if (CMenuManager::m_PrefsIslandLoading == CMenuManager::ISLAND_LOADING_LOW)
CStreaming::RemoveIslandsNotUsed(LEVEL_SUBURBAN);
#endif #endif
RemoveUnusedCollision();
CStreaming::RemoveIslandsNotUsed(LEVEL_SUBURBAN);
CGame::TidyUpMemory(true, true); CGame::TidyUpMemory(true, true);
CStreaming::ImGonnaUseStreamingMemory(); CStreaming::ImGonnaUseStreamingMemory();
CFileMgr::SetDir("data\\paths"); CFileMgr::SetDir("data\\paths");

View File

@ -10017,15 +10017,21 @@ int8 CRunningScript::ProcessCommands1000To1099(int32 command)
CollectParameters(&m_nIp, 1); CollectParameters(&m_nIp, 1);
CTimer::Stop(); CTimer::Stop();
CGame::currLevel = (eLevelName)ScriptParams[0]; CGame::currLevel = (eLevelName)ScriptParams[0];
#ifndef NO_ISLAND_LOADING #ifdef NO_ISLAND_LOADING
CStreaming::RemoveUnusedBigBuildings(CGame::currLevel); if (CMenuManager::m_PrefsIslandLoading == CMenuManager::ISLAND_LOADING_LOW)
CStreaming::RemoveUnusedBuildings(CGame::currLevel);
#endif #endif
{
CStreaming::RemoveUnusedBigBuildings(CGame::currLevel);
CStreaming::RemoveUnusedBuildings(CGame::currLevel);
}
CCollision::SortOutCollisionAfterLoad(); CCollision::SortOutCollisionAfterLoad();
#ifndef NO_ISLAND_LOADING #ifdef NO_ISLAND_LOADING
CStreaming::RequestIslands(CGame::currLevel); if (CMenuManager::m_PrefsIslandLoading != CMenuManager::ISLAND_LOADING_HIGH)
CStreaming::LoadAllRequestedModels(true);
#endif #endif
{
CStreaming::RequestIslands(CGame::currLevel);
CStreaming::LoadAllRequestedModels(true);
}
CTimer::Update(); CTimer::Update();
return 0; return 0;
} }
@ -10641,24 +10647,40 @@ int8 CRunningScript::ProcessCommands1100To1199(int32 command)
CTimer::Stop(); CTimer::Stop();
CGame::currLevel = (eLevelName)ScriptParams[0]; CGame::currLevel = (eLevelName)ScriptParams[0];
if (CGame::currLevel != CCollision::ms_collisionInMemory) { if (CGame::currLevel != CCollision::ms_collisionInMemory) {
#ifndef NO_ISLAND_LOADING #ifdef NO_ISLAND_LOADING
DMAudio.SetEffectsFadeVol(0); if (CMenuManager::m_PrefsIslandLoading == CMenuManager::ISLAND_LOADING_LOW)
CPad::StopPadsShaking();
CCollision::LoadCollisionScreen(CGame::currLevel);
DMAudio.Service();
#endif #endif
{
DMAudio.SetEffectsFadeVol(0);
CPad::StopPadsShaking();
CCollision::LoadCollisionScreen(CGame::currLevel);
DMAudio.Service();
}
CPopulation::DealWithZoneChange(CCollision::ms_collisionInMemory, CGame::currLevel, false); CPopulation::DealWithZoneChange(CCollision::ms_collisionInMemory, CGame::currLevel, false);
#ifndef NO_ISLAND_LOADING #ifdef NO_ISLAND_LOADING
CStreaming::RemoveUnusedBigBuildings(CGame::currLevel); if (CMenuManager::m_PrefsIslandLoading == CMenuManager::ISLAND_LOADING_LOW)
CStreaming::RemoveUnusedBuildings(CGame::currLevel);
#endif #endif
{
CStreaming::RemoveUnusedBigBuildings(CGame::currLevel);
CStreaming::RemoveUnusedBuildings(CGame::currLevel);
}
CCollision::SortOutCollisionAfterLoad(); CCollision::SortOutCollisionAfterLoad();
#ifndef NO_ISLAND_LOADING #ifdef NO_ISLAND_LOADING
CStreaming::RequestIslands(CGame::currLevel); if (CMenuManager::m_PrefsIslandLoading != CMenuManager::ISLAND_LOADING_HIGH)
CStreaming::RequestBigBuildings(CGame::currLevel);
CStreaming::LoadAllRequestedModels(true);
DMAudio.SetEffectsFadeVol(127);
#endif #endif
CStreaming::RequestIslands(CGame::currLevel);
#ifdef NO_ISLAND_LOADING
if (CMenuManager::m_PrefsIslandLoading == CMenuManager::ISLAND_LOADING_LOW)
#endif
CStreaming::RequestBigBuildings(CGame::currLevel);
#ifdef NO_ISLAND_LOADING
if (CMenuManager::m_PrefsIslandLoading != CMenuManager::ISLAND_LOADING_HIGH)
#endif
CStreaming::LoadAllRequestedModels(true);
#ifdef NO_ISLAND_LOADING
if (CMenuManager::m_PrefsIslandLoading == CMenuManager::ISLAND_LOADING_LOW)
#endif
DMAudio.SetEffectsFadeVol(127);
} }
CTimer::Update(); CTimer::Update();
return 0; return 0;

View File

@ -21,6 +21,7 @@
#include "SurfaceTable.h" #include "SurfaceTable.h"
#include "Lines.h" #include "Lines.h"
#include "Collision.h" #include "Collision.h"
#include "Frontend.h"
// TODO: where do these go? // TODO: where do these go?
@ -519,74 +520,101 @@ CCollision::LoadCollisionWhenINeedIt(bool forceChange)
} }
} }
if(level == CGame::currLevel || forceChange){ if (level == CGame::currLevel || forceChange) {
CTimer::Stop(); CTimer::Stop();
#ifndef NO_ISLAND_LOADING #ifdef NO_ISLAND_LOADING
DMAudio.SetEffectsFadeVol(0); if (CMenuManager::m_PrefsIslandLoading == CMenuManager::ISLAND_LOADING_LOW)
CPad::StopPadsShaking();
LoadCollisionScreen(CGame::currLevel);
DMAudio.Service();
#endif #endif
{
DMAudio.SetEffectsFadeVol(0);
CPad::StopPadsShaking();
LoadCollisionScreen(CGame::currLevel);
DMAudio.Service();
}
CPopulation::DealWithZoneChange(ms_collisionInMemory, CGame::currLevel, false); CPopulation::DealWithZoneChange(ms_collisionInMemory, CGame::currLevel, false);
#ifndef NO_ISLAND_LOADING #ifdef NO_ISLAND_LOADING
CStreaming::RemoveIslandsNotUsed(LEVEL_INDUSTRIAL); if (CMenuManager::m_PrefsIslandLoading != CMenuManager::ISLAND_LOADING_HIGH)
CStreaming::RemoveIslandsNotUsed(LEVEL_COMMERCIAL);
CStreaming::RemoveIslandsNotUsed(LEVEL_SUBURBAN);
CStreaming::RemoveBigBuildings(LEVEL_INDUSTRIAL);
CStreaming::RemoveBigBuildings(LEVEL_COMMERCIAL);
CStreaming::RemoveBigBuildings(LEVEL_SUBURBAN);
CModelInfo::RemoveColModelsFromOtherLevels(CGame::currLevel);
CStreaming::RemoveUnusedModelsInLoadedList();
CGame::TidyUpMemory(true, true);
CFileLoader::LoadCollisionFromDatFile(CGame::currLevel);
#endif #endif
{
CStreaming::RemoveIslandsNotUsed(LEVEL_INDUSTRIAL);
CStreaming::RemoveIslandsNotUsed(LEVEL_COMMERCIAL);
CStreaming::RemoveIslandsNotUsed(LEVEL_SUBURBAN);
}
#ifdef NO_ISLAND_LOADING
if (CMenuManager::m_PrefsIslandLoading == CMenuManager::ISLAND_LOADING_LOW)
#endif
{
CStreaming::RemoveBigBuildings(LEVEL_INDUSTRIAL);
CStreaming::RemoveBigBuildings(LEVEL_COMMERCIAL);
CStreaming::RemoveBigBuildings(LEVEL_SUBURBAN);
CModelInfo::RemoveColModelsFromOtherLevels(CGame::currLevel);
CStreaming::RemoveUnusedModelsInLoadedList();
CGame::TidyUpMemory(true, true);
CFileLoader::LoadCollisionFromDatFile(CGame::currLevel);
}
ms_collisionInMemory = CGame::currLevel; ms_collisionInMemory = CGame::currLevel;
CReplay::EmptyReplayBuffer(); CReplay::EmptyReplayBuffer();
#ifndef NO_ISLAND_LOADING #ifdef NO_ISLAND_LOADING
if(CGame::currLevel != LEVEL_GENERIC) if (CMenuManager::m_PrefsIslandLoading == CMenuManager::ISLAND_LOADING_LOW)
LoadSplash(GetLevelSplashScreen(CGame::currLevel)); #endif
CStreaming::RemoveUnusedBigBuildings(CGame::currLevel); {
CStreaming::RemoveUnusedBuildings(CGame::currLevel); if (CGame::currLevel != LEVEL_GENERIC)
CStreaming::RequestBigBuildings(CGame::currLevel); LoadSplash(GetLevelSplashScreen(CGame::currLevel));
CStreaming::RemoveUnusedBigBuildings(CGame::currLevel);
CStreaming::RemoveUnusedBuildings(CGame::currLevel);
CStreaming::RequestBigBuildings(CGame::currLevel);
}
#ifdef NO_ISLAND_LOADING
else if (CMenuManager::m_PrefsIslandLoading == CMenuManager::ISLAND_LOADING_MEDIUM)
CStreaming::RequestIslands(CGame::currLevel);
#endif #endif
CStreaming::LoadAllRequestedModels(true); CStreaming::LoadAllRequestedModels(true);
#ifndef NO_ISLAND_LOADING #ifdef NO_ISLAND_LOADING
CStreaming::HaveAllBigBuildingsLoaded(CGame::currLevel); if (CMenuManager::m_PrefsIslandLoading == CMenuManager::ISLAND_LOADING_LOW)
#endif
{
CStreaming::HaveAllBigBuildingsLoaded(CGame::currLevel);
CGame::TidyUpMemory(true, true); CGame::TidyUpMemory(true, true);
#endif }
CTimer::Update(); CTimer::Update();
#ifndef NO_ISLAND_LOADING #ifdef NO_ISLAND_LOADING
DMAudio.SetEffectsFadeVol(127); if (CMenuManager::m_PrefsIslandLoading == CMenuManager::ISLAND_LOADING_LOW)
#endif #endif
DMAudio.SetEffectsFadeVol(127);
} }
} }
#ifdef NO_ISLAND_LOADING
bool CCollision::bAlreadyLoaded = false;
#endif
void void
CCollision::SortOutCollisionAfterLoad(void) CCollision::SortOutCollisionAfterLoad(void)
{ {
if(ms_collisionInMemory == CGame::currLevel) if(ms_collisionInMemory == CGame::currLevel)
return; return;
#ifndef NO_ISLAND_LOADING #ifdef NO_ISLAND_LOADING
CModelInfo::RemoveColModelsFromOtherLevels(CGame::currLevel); if (CMenuManager::m_PrefsIslandLoading == CMenuManager::ISLAND_LOADING_LOW)
#endif #endif
CModelInfo::RemoveColModelsFromOtherLevels(CGame::currLevel);
if (CGame::currLevel != LEVEL_GENERIC) { if (CGame::currLevel != LEVEL_GENERIC) {
#ifdef NO_ISLAND_LOADING #ifdef NO_ISLAND_LOADING
static bool bAlreadyLoaded = false; if (CMenuManager::m_PrefsIslandLoading != CMenuManager::ISLAND_LOADING_LOW) {
if (bAlreadyLoaded) { if (bAlreadyLoaded) {
ms_collisionInMemory = CGame::currLevel; ms_collisionInMemory = CGame::currLevel;
return; return;
} }
bAlreadyLoaded = true; bAlreadyLoaded = true;
CFileLoader::LoadCollisionFromDatFile(LEVEL_INDUSTRIAL); CFileLoader::LoadCollisionFromDatFile(LEVEL_INDUSTRIAL);
CFileLoader::LoadCollisionFromDatFile(LEVEL_COMMERCIAL); CFileLoader::LoadCollisionFromDatFile(LEVEL_COMMERCIAL);
CFileLoader::LoadCollisionFromDatFile(LEVEL_SUBURBAN); CFileLoader::LoadCollisionFromDatFile(LEVEL_SUBURBAN);
#else } else
CFileLoader::LoadCollisionFromDatFile(CGame::currLevel);
#endif #endif
CFileLoader::LoadCollisionFromDatFile(CGame::currLevel);
if(!CGame::playingIntro) if(!CGame::playingIntro)
LoadSplash(GetLevelSplashScreen(CGame::currLevel)); LoadSplash(GetLevelSplashScreen(CGame::currLevel));
} }

View File

@ -212,6 +212,9 @@ class CCollision
public: public:
static eLevelName ms_collisionInMemory; static eLevelName ms_collisionInMemory;
static CLinkList<CColModel*> ms_colModelCache; static CLinkList<CColModel*> ms_colModelCache;
#ifdef NO_ISLAND_LOADING
static bool bAlreadyLoaded;
#endif
static void Init(void); static void Init(void);
static void Shutdown(void); static void Shutdown(void);

View File

@ -122,6 +122,11 @@ int8 CMenuManager::m_nPrefsMSAALevel = 0;
int8 CMenuManager::m_nDisplayMSAALevel = 0; int8 CMenuManager::m_nDisplayMSAALevel = 0;
#endif #endif
#ifdef NO_ISLAND_LOADING
int8 CMenuManager::m_DisplayIslandLoading = ISLAND_LOADING_LOW;
int8 CMenuManager::m_PrefsIslandLoading = ISLAND_LOADING_LOW;
#endif
char CMenuManager::m_PrefsSkinFile[256] = DEFAULT_SKIN_NAME; char CMenuManager::m_PrefsSkinFile[256] = DEFAULT_SKIN_NAME;
int32 CMenuManager::m_KeyPressedCode = -1; int32 CMenuManager::m_KeyPressedCode = -1;
@ -155,6 +160,10 @@ int32 MouseButtonJustClicked;
int32 JoyButtonJustClicked; int32 JoyButtonJustClicked;
//int32 *pControlTemp = 0; //int32 *pControlTemp = 0;
#ifdef PS2_ALPHA_TEST
extern bool gPS2alphaTest;
#endif
#ifndef MASTER #ifndef MASTER
bool CMenuManager::m_PrefsMarketing = false; bool CMenuManager::m_PrefsMarketing = false;
bool CMenuManager::m_PrefsDisableTutorials = false; bool CMenuManager::m_PrefsDisableTutorials = false;
@ -1189,6 +1198,21 @@ CMenuManager::Draw()
break; break;
} }
break; break;
#endif
#ifdef NO_ISLAND_LOADING
case MENUACTION_ISLANDLOADING:
switch (m_DisplayIslandLoading) {
case ISLAND_LOADING_LOW:
rightText = TheText.Get("FEM_LOW");
break;
case ISLAND_LOADING_MEDIUM:
rightText = TheText.Get("FEM_MED");
break;
case ISLAND_LOADING_HIGH:
rightText = TheText.Get("FEM_HIG");
break;
}
break;
#endif #endif
case MENUACTION_AUDIOHW: case MENUACTION_AUDIOHW:
if (m_nPrefsAudio3DProviderIndex == -1) if (m_nPrefsAudio3DProviderIndex == -1)
@ -1245,6 +1269,11 @@ CMenuManager::Draw()
rightText = TheText.Get(m_PrefsCutsceneBorders ? "FEM_ON" : "FEM_OFF"); rightText = TheText.Get(m_PrefsCutsceneBorders ? "FEM_ON" : "FEM_OFF");
break; break;
#endif #endif
#ifdef PS2_ALPHA_TEST
case MENUACTION_PS2_ALPHA_TEST:
rightText = TheText.Get(gPS2alphaTest ? "FEM_ON" : "FEM_OFF");
break;
#endif
#ifdef CUSTOM_FRONTEND_OPTIONS #ifdef CUSTOM_FRONTEND_OPTIONS
case MENUACTION_TRIGGERFUNC: case MENUACTION_TRIGGERFUNC:
FrontendOption& option = customFrontendOptions[aScreens[m_nCurrScreen].m_aEntries[i].m_TargetMenu]; FrontendOption& option = customFrontendOptions[aScreens[m_nCurrScreen].m_aEntries[i].m_TargetMenu];
@ -1389,6 +1418,12 @@ CMenuManager::Draw()
if (!strcmp(aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_EntryName, "FED_AAS") && m_nHelperTextMsgId == 1) if (!strcmp(aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_EntryName, "FED_AAS") && m_nHelperTextMsgId == 1)
ResetHelperText(); ResetHelperText();
} }
#endif
#ifdef NO_ISLAND_LOADING
if (m_DisplayIslandLoading == m_PrefsIslandLoading) {
if (!strcmp(aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_EntryName, "FEM_ISL") && m_nHelperTextMsgId == 1)
ResetHelperText();
}
#endif #endif
if (m_nPrefsAudio3DProviderIndex != DMAudio.GetCurrent3DProviderIndex()) { if (m_nPrefsAudio3DProviderIndex != DMAudio.GetCurrent3DProviderIndex()) {
if (!strcmp(aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_EntryName, "FEA_3DH")) if (!strcmp(aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_EntryName, "FEA_3DH"))
@ -1409,6 +1444,12 @@ CMenuManager::Draw()
if (!strcmp(aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_EntryName, "FED_AAS")) if (!strcmp(aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_EntryName, "FED_AAS"))
SetHelperText(1); SetHelperText(1);
} }
#endif
#ifdef NO_ISLAND_LOADING
if (m_DisplayIslandLoading != m_PrefsIslandLoading) {
if (!strcmp(aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_EntryName, "FEM_ISL"))
SetHelperText(1);
}
#endif #endif
if (m_nPrefsAudio3DProviderIndex != DMAudio.GetCurrent3DProviderIndex()) { if (m_nPrefsAudio3DProviderIndex != DMAudio.GetCurrent3DProviderIndex()) {
if (strcmp(aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_EntryName, "FEA_3DH") != 0 if (strcmp(aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_EntryName, "FEA_3DH") != 0
@ -3333,6 +3374,13 @@ CMenuManager::LoadSettings()
CFileMgr::Read(fileHandle, (char *)&m_nPrefsMSAALevel, 1); CFileMgr::Read(fileHandle, (char *)&m_nPrefsMSAALevel, 1);
m_nDisplayMSAALevel = m_nPrefsMSAALevel; m_nDisplayMSAALevel = m_nPrefsMSAALevel;
#endif #endif
#ifdef NO_ISLAND_LOADING
CFileMgr::Read(fileHandle, (char *)&CMenuManager::m_PrefsIslandLoading, 1);
CMenuManager::m_DisplayIslandLoading = CMenuManager::m_PrefsIslandLoading;
#endif
#ifdef PS2_ALPHA_TEST
CFileMgr::Read(fileHandle, (char *)&gPS2alphaTest, 1);
#endif // PS2_ALPHA_TEST
} }
} }
@ -3432,6 +3480,12 @@ CMenuManager::SaveSettings()
#ifdef MULTISAMPLING #ifdef MULTISAMPLING
CFileMgr::Write(fileHandle, (char *)&CMenuManager::m_nPrefsMSAALevel, 1); CFileMgr::Write(fileHandle, (char *)&CMenuManager::m_nPrefsMSAALevel, 1);
#endif #endif
#ifdef NO_ISLAND_LOADING
CFileMgr::Write(fileHandle, (char *)&CMenuManager::m_PrefsIslandLoading, 1);
#endif
#ifdef PS2_ALPHA_TEST
CFileMgr::Write(fileHandle, (char *)&gPS2alphaTest, 1);
#endif // PS2_ALPHA_TEST
} }
CFileMgr::CloseFile(fileHandle); CFileMgr::CloseFile(fileHandle);
@ -4769,6 +4823,45 @@ CMenuManager::ProcessButtonPresses(void)
SaveSettings(); SaveSettings();
} }
break; break;
#endif
#ifdef NO_ISLAND_LOADING
case MENUACTION_ISLANDLOADING:
if (m_DisplayIslandLoading != m_PrefsIslandLoading) {
if (!m_bGameNotLoaded) {
if (m_DisplayIslandLoading > ISLAND_LOADING_LOW) {
if (m_DisplayIslandLoading == ISLAND_LOADING_HIGH)
CStreaming::RemoveIslandsNotUsed(LEVEL_GENERIC);
if (m_PrefsIslandLoading == 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;
m_PrefsIslandLoading = m_DisplayIslandLoading;
CStreaming::RequestBigBuildings(CGame::currLevel);
} else if (m_PrefsIslandLoading == ISLAND_LOADING_HIGH) {
m_PrefsIslandLoading = m_DisplayIslandLoading;
CStreaming::RequestIslands(CGame::currLevel);
} else
m_PrefsIslandLoading = m_DisplayIslandLoading;
} else { // low
m_PrefsIslandLoading = m_DisplayIslandLoading;
CCollision::bAlreadyLoaded = false;
CModelInfo::RemoveColModelsFromOtherLevels(CGame::currLevel);
CStreaming::RemoveUnusedBigBuildings(CGame::currLevel);
CStreaming::RemoveUnusedBuildings(CGame::currLevel);
CStreaming::RequestIslands(CGame::currLevel);
}
CStreaming::LoadAllRequestedModels(true);
} else
m_PrefsIslandLoading = m_DisplayIslandLoading;
SetHelperText(0);
SaveSettings();
}
break;
#endif #endif
case MENUACTION_AUDIOHW: case MENUACTION_AUDIOHW:
{ {
@ -4842,6 +4935,43 @@ CMenuManager::ProcessButtonPresses(void)
#ifdef CUTSCENE_BORDERS_SWITCH #ifdef CUTSCENE_BORDERS_SWITCH
m_PrefsCutsceneBorders = true; m_PrefsCutsceneBorders = true;
#endif #endif
#ifdef NO_ISLAND_LOADING
m_DisplayIslandLoading = ISLAND_LOADING_LOW;
if (!m_bGameNotLoaded) {
if (m_DisplayIslandLoading > ISLAND_LOADING_LOW) {
if (m_DisplayIslandLoading == ISLAND_LOADING_HIGH)
CStreaming::RemoveIslandsNotUsed(LEVEL_GENERIC);
if (m_PrefsIslandLoading == 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;
m_PrefsIslandLoading = m_DisplayIslandLoading;
CStreaming::RequestBigBuildings(CGame::currLevel);
} else if (m_PrefsIslandLoading == ISLAND_LOADING_HIGH) {
m_PrefsIslandLoading = m_DisplayIslandLoading;
CStreaming::RequestIslands(CGame::currLevel);
} else
m_PrefsIslandLoading = m_DisplayIslandLoading;
} else { // low
m_PrefsIslandLoading = m_DisplayIslandLoading;
CCollision::bAlreadyLoaded = false;
CModelInfo::RemoveColModelsFromOtherLevels(CGame::currLevel);
CStreaming::RemoveUnusedBigBuildings(CGame::currLevel);
CStreaming::RemoveUnusedBuildings(CGame::currLevel);
CStreaming::RequestIslands(CGame::currLevel);
}
CStreaming::LoadAllRequestedModels(true);
} else
m_PrefsIslandLoading = m_DisplayIslandLoading;
#endif // NO_ISLAND_LOADING
#ifdef PS2_ALPHA_TEST
gPS2alphaTest = false;
#endif // PS2_ALPHA_TEST
SaveSettings(); SaveSettings();
#else #else
} else if (m_nCurrScreen == MENUPAGE_DISPLAY_SETTINGS) { } else if (m_nCurrScreen == MENUPAGE_DISPLAY_SETTINGS) {
@ -4870,6 +5000,43 @@ CMenuManager::ProcessButtonPresses(void)
#else #else
CMBlur::BlurOn = true; CMBlur::BlurOn = true;
#endif // GTA3_1_1_PATCH #endif // GTA3_1_1_PATCH
#ifdef NO_ISLAND_LOADING
m_DisplayIslandLoading = ISLAND_LOADING_LOW;
if (!m_bGameNotLoaded) {
if (m_DisplayIslandLoading > ISLAND_LOADING_LOW) {
if (m_DisplayIslandLoading == ISLAND_LOADING_HIGH)
CStreaming::RemoveIslandsNotUsed(LEVEL_GENERIC);
if (m_PrefsIslandLoading == 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;
m_PrefsIslandLoading = m_DisplayIslandLoading;
CStreaming::RequestBigBuildings(CGame::currLevel);
} else if (m_PrefsIslandLoading == ISLAND_LOADING_HIGH) {
m_PrefsIslandLoading = m_DisplayIslandLoading;
CStreaming::RequestIslands(CGame::currLevel);
} else
m_PrefsIslandLoading = m_DisplayIslandLoading;
} else { // low
m_PrefsIslandLoading = m_DisplayIslandLoading;
CCollision::bAlreadyLoaded = false;
CModelInfo::RemoveColModelsFromOtherLevels(CGame::currLevel);
CStreaming::RemoveUnusedBigBuildings(CGame::currLevel);
CStreaming::RemoveUnusedBuildings(CGame::currLevel);
CStreaming::RequestIslands(CGame::currLevel);
}
CStreaming::LoadAllRequestedModels(true);
} else
m_PrefsIslandLoading = m_DisplayIslandLoading;
#endif // NO_ISLAND_LOADING
#ifdef PS2_ALPHA_TEST
gPS2alphaTest = false;
#endif // PS2_ALPHA_TEST
SaveSettings(); SaveSettings();
#endif // GRAPHICS_MENU_OPTIONS #endif // GRAPHICS_MENU_OPTIONS
} else if ((m_nCurrScreen != MENUPAGE_SKIN_SELECT_OLD) && (m_nCurrScreen == MENUPAGE_CONTROLLER_PC)) { } else if ((m_nCurrScreen != MENUPAGE_SKIN_SELECT_OLD) && (m_nCurrScreen == MENUPAGE_CONTROLLER_PC)) {
@ -5155,6 +5322,15 @@ CMenuManager::ProcessButtonPresses(void)
m_nDisplayMSAALevel = 0; m_nDisplayMSAALevel = 0;
} }
break; break;
#endif
#ifdef NO_ISLAND_LOADING
case MENUACTION_ISLANDLOADING:
m_DisplayIslandLoading += changeValueBy;
if (m_DisplayIslandLoading > ISLAND_LOADING_HIGH)
m_DisplayIslandLoading = ISLAND_LOADING_LOW;
else if (m_DisplayIslandLoading < ISLAND_LOADING_LOW)
m_DisplayIslandLoading = ISLAND_LOADING_HIGH;
break;
#endif #endif
case MENUACTION_AUDIOHW: case MENUACTION_AUDIOHW:
if (m_nPrefsAudio3DProviderIndex != -1) { if (m_nPrefsAudio3DProviderIndex != -1) {
@ -5327,6 +5503,13 @@ CMenuManager::ProcessOnOffMenuOptions()
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_SETTING_CHANGE, 0); DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_SETTING_CHANGE, 0);
SaveSettings(); SaveSettings();
break; break;
#endif
#ifdef PS2_ALPHA_TEST
case MENUACTION_PS2_ALPHA_TEST:
gPS2alphaTest = !gPS2alphaTest;
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_SETTING_CHANGE, 0);
SaveSettings();
break;
#endif #endif
} }
} }

View File

@ -372,6 +372,12 @@ enum eMenuAction
#ifdef MULTISAMPLING #ifdef MULTISAMPLING
MENUACTION_MULTISAMPLING, MENUACTION_MULTISAMPLING,
#endif #endif
#ifdef NO_ISLAND_LOADING
MENUACTION_ISLANDLOADING,
#endif
#ifdef PS2_ALPHA_TEST
MENUACTION_PS2_ALPHA_TEST,
#endif
#ifdef CUTSCENE_BORDERS_SWITCH #ifdef CUTSCENE_BORDERS_SWITCH
MENUACTION_CUTSCENEBORDERS, MENUACTION_CUTSCENEBORDERS,
#endif #endif
@ -622,6 +628,18 @@ public:
void PrintMap(); void PrintMap();
#endif #endif
#ifdef NO_ISLAND_LOADING
enum
{
ISLAND_LOADING_LOW = 0,
ISLAND_LOADING_MEDIUM,
ISLAND_LOADING_HIGH
};
static int8 m_DisplayIslandLoading;
static int8 m_PrefsIslandLoading;
#endif
public: public:
static void BuildStatLine(Const char *text, void *stat, bool itsFloat, void *stat2); static void BuildStatLine(Const char *text, void *stat, bool itsFloat, void *stat2);
static void CentreMousePointer(); static void CentreMousePointer();

View File

@ -30,6 +30,18 @@
#define MENU_MULTISAMPLING(screen) #define MENU_MULTISAMPLING(screen)
#endif #endif
#ifdef NO_ISLAND_LOADING
#define MENU_ISLAND_LOADING(screen) MENUACTION_ISLANDLOADING, "FEM_ISL", SAVESLOT_NONE, screen,
#else
#define MENU_ISLAND_LOADING(screen)
#endif
#ifdef PS2_ALPHA_TEST
#define MENU_PS2_ALPHA_TEST(screen) MENUACTION_PS2_ALPHA_TEST, "FEM_2PR", SAVESLOT_NONE, screen,
#else
#define MENU_PS2_ALPHA_TEST(screen)
#endif
CMenuScreen aScreens[] = { CMenuScreen aScreens[] = {
// MENUPAGE_NONE = 0 // MENUPAGE_NONE = 0
{ "", 1, MENUPAGE_DISABLED, MENUPAGE_DISABLED, 0, 0, }, { "", 1, MENUPAGE_DISABLED, MENUPAGE_DISABLED, 0, 0, },
@ -84,6 +96,8 @@ CMenuScreen aScreens[] = {
MENU_CUTSCENE_BORDERS_SWITCH(MENUPAGE_DISPLAY_SETTINGS) MENU_CUTSCENE_BORDERS_SWITCH(MENUPAGE_DISPLAY_SETTINGS)
MENU_MIPMAPS(MENUPAGE_DISPLAY_SETTINGS) MENU_MIPMAPS(MENUPAGE_DISPLAY_SETTINGS)
MENU_TEXTURE_FILTERING(MENUPAGE_DISPLAY_SETTINGS) MENU_TEXTURE_FILTERING(MENUPAGE_DISPLAY_SETTINGS)
MENU_ISLAND_LOADING(MENUPAGE_DISPLAY_SETTINGS)
MENU_PS2_ALPHA_TEST(MENUPAGE_DISPLAY_SETTINGS)
MENU_MULTISAMPLING(MENUPAGE_DISPLAY_SETTINGS) MENU_MULTISAMPLING(MENUPAGE_DISPLAY_SETTINGS)
MENUACTION_WIDESCREEN, "FED_WIS", SAVESLOT_NONE, MENUPAGE_DISPLAY_SETTINGS, MENUACTION_WIDESCREEN, "FED_WIS", SAVESLOT_NONE, MENUPAGE_DISPLAY_SETTINGS,
MENU_IMPROVED_VIDEOMODE(MENUPAGE_DISPLAY_SETTINGS) MENU_IMPROVED_VIDEOMODE(MENUPAGE_DISPLAY_SETTINGS)
@ -502,6 +516,8 @@ CMenuScreen aScreens[] = {
MENUACTION_WIDESCREEN, "FED_WIS", SAVESLOT_NONE, MENUPAGE_GRAPHICS_SETTINGS, MENUACTION_WIDESCREEN, "FED_WIS", SAVESLOT_NONE, MENUPAGE_GRAPHICS_SETTINGS,
MENU_MIPMAPS(MENUPAGE_GRAPHICS_SETTINGS) MENU_MIPMAPS(MENUPAGE_GRAPHICS_SETTINGS)
MENU_TEXTURE_FILTERING(MENUPAGE_GRAPHICS_SETTINGS) MENU_TEXTURE_FILTERING(MENUPAGE_GRAPHICS_SETTINGS)
MENU_ISLAND_LOADING(MENUPAGE_GRAPHICS_SETTINGS)
MENU_PS2_ALPHA_TEST(MENUPAGE_GRAPHICS_SETTINGS)
MENU_MULTISAMPLING(MENUPAGE_GRAPHICS_SETTINGS) MENU_MULTISAMPLING(MENUPAGE_GRAPHICS_SETTINGS)
MENU_IMPROVED_VIDEOMODE(MENUPAGE_GRAPHICS_SETTINGS) MENU_IMPROVED_VIDEOMODE(MENUPAGE_GRAPHICS_SETTINGS)
MENUACTION_SCREENRES, "FED_RES", SAVESLOT_NONE, MENUPAGE_GRAPHICS_SETTINGS, MENUACTION_SCREENRES, "FED_RES", SAVESLOT_NONE, MENUPAGE_GRAPHICS_SETTINGS,

View File

@ -32,6 +32,7 @@
#include "Replay.h" #include "Replay.h"
#endif #endif
#include "main.h" #include "main.h"
#include "Frontend.h"
bool CStreaming::ms_disableStreaming; bool CStreaming::ms_disableStreaming;
bool CStreaming::ms_bLoadingBigModel; bool CStreaming::ms_bLoadingBigModel;
@ -727,7 +728,9 @@ CStreaming::RequestBigBuildings(eLevelName level)
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
&& ((CMenuManager::m_PrefsIslandLoading != CMenuManager::ISLAND_LOADING_LOW) || (b->m_level == level))
#else
&& b->m_level == level && b->m_level == level
#endif #endif
) )
@ -740,7 +743,9 @@ CStreaming::RequestBigBuildings(eLevelName level)
void void
CStreaming::RequestIslands(eLevelName level) CStreaming::RequestIslands(eLevelName level)
{ {
#ifndef NO_ISLAND_LOADING #ifdef NO_ISLAND_LOADING
if (CMenuManager::m_PrefsIslandLoading != CMenuManager::ISLAND_LOADING_HIGH)
#endif
switch(level){ switch(level){
case LEVEL_INDUSTRIAL: case LEVEL_INDUSTRIAL:
RequestModel(islandLODcomInd, BIGBUILDINGFLAGS); RequestModel(islandLODcomInd, BIGBUILDINGFLAGS);
@ -756,7 +761,6 @@ CStreaming::RequestIslands(eLevelName level)
break; break;
default: break; default: break;
} }
#endif
} }
void void
@ -942,14 +946,17 @@ CStreaming::RemoveBuildings(eLevelName level)
void void
CStreaming::RemoveUnusedBigBuildings(eLevelName level) CStreaming::RemoveUnusedBigBuildings(eLevelName level)
{ {
#ifndef NO_ISLAND_LOADING #ifdef NO_ISLAND_LOADING
if(level != LEVEL_INDUSTRIAL) if (CMenuManager::m_PrefsIslandLoading == CMenuManager::ISLAND_LOADING_LOW)
RemoveBigBuildings(LEVEL_INDUSTRIAL);
if(level != LEVEL_COMMERCIAL)
RemoveBigBuildings(LEVEL_COMMERCIAL);
if(level != LEVEL_SUBURBAN)
RemoveBigBuildings(LEVEL_SUBURBAN);
#endif #endif
{
if (level != LEVEL_INDUSTRIAL)
RemoveBigBuildings(LEVEL_INDUSTRIAL);
if (level != LEVEL_COMMERCIAL)
RemoveBigBuildings(LEVEL_COMMERCIAL);
if (level != LEVEL_SUBURBAN)
RemoveBigBuildings(LEVEL_SUBURBAN);
}
RemoveIslandsNotUsed(level); RemoveIslandsNotUsed(level);
} }
@ -969,7 +976,15 @@ DeleteIsland(CEntity *island)
void void
CStreaming::RemoveIslandsNotUsed(eLevelName level) CStreaming::RemoveIslandsNotUsed(eLevelName level)
{ {
#ifndef NO_ISLAND_LOADING #ifdef NO_ISLAND_LOADING
if (CMenuManager::m_PrefsIslandLoading == CMenuManager::ISLAND_LOADING_HIGH) {
DeleteIsland(pIslandLODindustEntity);
DeleteIsland(pIslandLODcomIndEntity);
DeleteIsland(pIslandLODcomSubEntity);
DeleteIsland(pIslandLODsubIndEntity);
DeleteIsland(pIslandLODsubComEntity);
} else
#endif
switch(level){ switch(level){
case LEVEL_INDUSTRIAL: case LEVEL_INDUSTRIAL:
DeleteIsland(pIslandLODindustEntity); DeleteIsland(pIslandLODindustEntity);
@ -987,16 +1002,13 @@ CStreaming::RemoveIslandsNotUsed(eLevelName level)
DeleteIsland(pIslandLODcomIndEntity); DeleteIsland(pIslandLODcomIndEntity);
break; break;
default: default:
#endif // !NO_ISLAND_LOADING
DeleteIsland(pIslandLODindustEntity); DeleteIsland(pIslandLODindustEntity);
DeleteIsland(pIslandLODcomIndEntity); DeleteIsland(pIslandLODcomIndEntity);
DeleteIsland(pIslandLODcomSubEntity); DeleteIsland(pIslandLODcomSubEntity);
DeleteIsland(pIslandLODsubIndEntity); DeleteIsland(pIslandLODsubIndEntity);
DeleteIsland(pIslandLODsubComEntity); DeleteIsland(pIslandLODsubComEntity);
#ifndef NO_ISLAND_LOADING
break; break;
} }
#endif // !NO_ISLAND_LOADING
} }
void void

View File

@ -205,7 +205,7 @@ enum Config {
#define PS2_ALPHA_TEST // emulate ps2 alpha test #define PS2_ALPHA_TEST // emulate ps2 alpha test
#define IMPROVED_VIDEOMODE // save and load videomode parameters instead of a magic number #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 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 NO_ISLAND_LOADING // disable loadscreen between islands via loading all island data at once, consumes more memory and CPU
//#define USE_TEXTURE_POOL //#define USE_TEXTURE_POOL
#define CUTSCENE_BORDERS_SWITCH #define CUTSCENE_BORDERS_SWITCH
//#define EXTENDED_COLOURFILTER // more options for colour filter (replaces mblur) //#define EXTENDED_COLOURFILTER // more options for colour filter (replaces mblur)

View File

@ -4,6 +4,7 @@
#include "TempColModels.h" #include "TempColModels.h"
#include "ModelIndices.h" #include "ModelIndices.h"
#include "ModelInfo.h" #include "ModelInfo.h"
#include "Frontend.h"
CBaseModelInfo *CModelInfo::ms_modelInfoPtrs[MODELINFOSIZE]; CBaseModelInfo *CModelInfo::ms_modelInfoPtrs[MODELINFOSIZE];
@ -217,20 +218,23 @@ CModelInfo::IsBikeModel(int32 id)
void void
CModelInfo::RemoveColModelsFromOtherLevels(eLevelName level) CModelInfo::RemoveColModelsFromOtherLevels(eLevelName level)
{ {
#ifndef NO_ISLAND_LOADING #ifdef NO_ISLAND_LOADING
int i; if (CMenuManager::m_PrefsIslandLoading == CMenuManager::ISLAND_LOADING_LOW)
CBaseModelInfo *mi; #endif
CColModel *colmodel; {
int i;
CBaseModelInfo *mi;
CColModel *colmodel;
for(i = 0; i < MODELINFOSIZE; i++){ for (i = 0; i < MODELINFOSIZE; i++) {
mi = GetModelInfo(i); mi = GetModelInfo(i);
if(mi){ if (mi) {
colmodel = mi->GetColModel(); colmodel = mi->GetColModel();
if(colmodel && colmodel->level != LEVEL_GENERIC && colmodel->level != level) if (colmodel && colmodel->level != LEVEL_GENERIC && colmodel->level != level)
colmodel->RemoveCollisionVolumes(); colmodel->RemoveCollisionVolumes();
}
} }
} }
#endif
} }
void void

View File

@ -19,6 +19,7 @@
#include "Shadows.h" #include "Shadows.h"
#include "PointLights.h" #include "PointLights.h"
#include "Renderer.h" #include "Renderer.h"
#include "Frontend.h"
bool gbShowPedRoadGroups; bool gbShowPedRoadGroups;
bool gbShowCarRoadGroups; bool gbShowCarRoadGroups;
@ -710,15 +711,18 @@ CRenderer::ScanWorld(void)
ScanSectorPoly(poly, 3, ScanSectorList); ScanSectorPoly(poly, 3, ScanSectorList);
} }
#ifdef NO_ISLAND_LOADING #ifdef NO_ISLAND_LOADING
ScanBigBuildingList(CWorld::GetBigBuildingList(LEVEL_INDUSTRIAL)); if (CMenuManager::m_PrefsIslandLoading == CMenuManager::ISLAND_LOADING_HIGH) {
ScanBigBuildingList(CWorld::GetBigBuildingList(LEVEL_COMMERCIAL)); ScanBigBuildingList(CWorld::GetBigBuildingList(LEVEL_INDUSTRIAL));
ScanBigBuildingList(CWorld::GetBigBuildingList(LEVEL_SUBURBAN)); ScanBigBuildingList(CWorld::GetBigBuildingList(LEVEL_COMMERCIAL));
#else ScanBigBuildingList(CWorld::GetBigBuildingList(LEVEL_SUBURBAN));
} else
#endif
{
#ifdef FIX_BUGS #ifdef FIX_BUGS
if (CCollision::ms_collisionInMemory != LEVEL_GENERIC) if (CCollision::ms_collisionInMemory != LEVEL_GENERIC)
#endif #endif
ScanBigBuildingList(CWorld::GetBigBuildingList(CCollision::ms_collisionInMemory)); ScanBigBuildingList(CWorld::GetBigBuildingList(CCollision::ms_collisionInMemory));
#endif }
ScanBigBuildingList(CWorld::GetBigBuildingList(LEVEL_GENERIC)); ScanBigBuildingList(CWorld::GetBigBuildingList(LEVEL_GENERIC));
} }
} }

View File

@ -562,17 +562,23 @@ RestoreForStartLoad()
ReadDataFromBufferPointer(_buf, TheCamera.GetMatrix().GetPosition().x); ReadDataFromBufferPointer(_buf, TheCamera.GetMatrix().GetPosition().x);
ReadDataFromBufferPointer(_buf, TheCamera.GetMatrix().GetPosition().y); ReadDataFromBufferPointer(_buf, TheCamera.GetMatrix().GetPosition().y);
ReadDataFromBufferPointer(_buf, TheCamera.GetMatrix().GetPosition().z); ReadDataFromBufferPointer(_buf, TheCamera.GetMatrix().GetPosition().z);
#ifndef NO_ISLAND_LOADING #ifdef NO_ISLAND_LOADING
CStreaming::RemoveUnusedBigBuildings(CGame::currLevel); if (CMenuManager::m_PrefsIslandLoading == CMenuManager::ISLAND_LOADING_LOW)
CStreaming::RemoveUnusedBuildings(CGame::currLevel);
#endif #endif
{
CStreaming::RemoveUnusedBigBuildings(CGame::currLevel);
CStreaming::RemoveUnusedBuildings(CGame::currLevel);
}
CCollision::SortOutCollisionAfterLoad(); CCollision::SortOutCollisionAfterLoad();
#ifndef NO_ISLAND_LOADING #ifdef NO_ISLAND_LOADING
CStreaming::RequestBigBuildings(CGame::currLevel); if (CMenuManager::m_PrefsIslandLoading == CMenuManager::ISLAND_LOADING_LOW)
CStreaming::LoadAllRequestedModels(false);
CStreaming::HaveAllBigBuildingsLoaded(CGame::currLevel);
CGame::TidyUpMemory(true, false);
#endif #endif
{
CStreaming::RequestBigBuildings(CGame::currLevel);
CStreaming::LoadAllRequestedModels(false);
CStreaming::HaveAllBigBuildingsLoaded(CGame::currLevel);
CGame::TidyUpMemory(true, false);
}
if (CloseFile(file)) { if (CloseFile(file)) {
return true; return true;
} else { } else {

View File

@ -7987,6 +7987,21 @@ CUTSCENE BORDERS
[FEM_SCF] [FEM_SCF]
SCREEN FORMAT SCREEN FORMAT
[FEM_ISL]
MAP MEMORY USAGE
[FEM_LOW]
LOW
[FEM_MED]
MEDIUM
[FEM_HIG]
HIGH
[FEM_2PR]
PS2 ALPHA TEST
{ end of file } { end of file }
[DUMMY] [DUMMY]