1
0
Fork 0
mirror of https://git.rip/DMCA_FUCKER/re3.git synced 2024-12-22 17:10:01 +00:00

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

View file

@ -10017,15 +10017,21 @@ 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);
#ifdef NO_ISLAND_LOADING
if (CMenuManager::m_PrefsIslandLoading == CMenuManager::ISLAND_LOADING_LOW)
#endif
{
CStreaming::RemoveUnusedBigBuildings(CGame::currLevel);
CStreaming::RemoveUnusedBuildings(CGame::currLevel);
}
CCollision::SortOutCollisionAfterLoad();
#ifndef NO_ISLAND_LOADING
CStreaming::RequestIslands(CGame::currLevel);
CStreaming::LoadAllRequestedModels(true);
#ifdef NO_ISLAND_LOADING
if (CMenuManager::m_PrefsIslandLoading != CMenuManager::ISLAND_LOADING_HIGH)
#endif
{
CStreaming::RequestIslands(CGame::currLevel);
CStreaming::LoadAllRequestedModels(true);
}
CTimer::Update();
return 0;
}
@ -10641,24 +10647,40 @@ 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();
#ifdef NO_ISLAND_LOADING
if (CMenuManager::m_PrefsIslandLoading == CMenuManager::ISLAND_LOADING_LOW)
#endif
{
DMAudio.SetEffectsFadeVol(0);
CPad::StopPadsShaking();
CCollision::LoadCollisionScreen(CGame::currLevel);
DMAudio.Service();
}
CPopulation::DealWithZoneChange(CCollision::ms_collisionInMemory, CGame::currLevel, false);
#ifndef NO_ISLAND_LOADING
CStreaming::RemoveUnusedBigBuildings(CGame::currLevel);
CStreaming::RemoveUnusedBuildings(CGame::currLevel);
#ifdef NO_ISLAND_LOADING
if (CMenuManager::m_PrefsIslandLoading == CMenuManager::ISLAND_LOADING_LOW)
#endif
{
CStreaming::RemoveUnusedBigBuildings(CGame::currLevel);
CStreaming::RemoveUnusedBuildings(CGame::currLevel);
}
CCollision::SortOutCollisionAfterLoad();
#ifndef NO_ISLAND_LOADING
CStreaming::RequestIslands(CGame::currLevel);
CStreaming::RequestBigBuildings(CGame::currLevel);
CStreaming::LoadAllRequestedModels(true);
DMAudio.SetEffectsFadeVol(127);
#ifdef NO_ISLAND_LOADING
if (CMenuManager::m_PrefsIslandLoading != CMenuManager::ISLAND_LOADING_HIGH)
#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();
return 0;

View file

@ -21,6 +21,7 @@
#include "SurfaceTable.h"
#include "Lines.h"
#include "Collision.h"
#include "Frontend.h"
// 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();
#ifndef NO_ISLAND_LOADING
DMAudio.SetEffectsFadeVol(0);
CPad::StopPadsShaking();
LoadCollisionScreen(CGame::currLevel);
DMAudio.Service();
#ifdef NO_ISLAND_LOADING
if (CMenuManager::m_PrefsIslandLoading == CMenuManager::ISLAND_LOADING_LOW)
#endif
{
DMAudio.SetEffectsFadeVol(0);
CPad::StopPadsShaking();
LoadCollisionScreen(CGame::currLevel);
DMAudio.Service();
}
CPopulation::DealWithZoneChange(ms_collisionInMemory, CGame::currLevel, false);
#ifndef NO_ISLAND_LOADING
CStreaming::RemoveIslandsNotUsed(LEVEL_INDUSTRIAL);
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);
#ifdef NO_ISLAND_LOADING
if (CMenuManager::m_PrefsIslandLoading != CMenuManager::ISLAND_LOADING_HIGH)
#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;
CReplay::EmptyReplayBuffer();
#ifndef NO_ISLAND_LOADING
if(CGame::currLevel != LEVEL_GENERIC)
LoadSplash(GetLevelSplashScreen(CGame::currLevel));
CStreaming::RemoveUnusedBigBuildings(CGame::currLevel);
CStreaming::RemoveUnusedBuildings(CGame::currLevel);
CStreaming::RequestBigBuildings(CGame::currLevel);
#ifdef NO_ISLAND_LOADING
if (CMenuManager::m_PrefsIslandLoading == CMenuManager::ISLAND_LOADING_LOW)
#endif
{
if (CGame::currLevel != LEVEL_GENERIC)
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
CStreaming::LoadAllRequestedModels(true);
#ifndef NO_ISLAND_LOADING
CStreaming::HaveAllBigBuildingsLoaded(CGame::currLevel);
#ifdef NO_ISLAND_LOADING
if (CMenuManager::m_PrefsIslandLoading == CMenuManager::ISLAND_LOADING_LOW)
#endif
{
CStreaming::HaveAllBigBuildingsLoaded(CGame::currLevel);
CGame::TidyUpMemory(true, true);
#endif
CGame::TidyUpMemory(true, true);
}
CTimer::Update();
#ifndef NO_ISLAND_LOADING
DMAudio.SetEffectsFadeVol(127);
#ifdef NO_ISLAND_LOADING
if (CMenuManager::m_PrefsIslandLoading == CMenuManager::ISLAND_LOADING_LOW)
#endif
DMAudio.SetEffectsFadeVol(127);
}
}
#ifdef NO_ISLAND_LOADING
bool CCollision::bAlreadyLoaded = false;
#endif
void
CCollision::SortOutCollisionAfterLoad(void)
{
if(ms_collisionInMemory == CGame::currLevel)
return;
#ifndef NO_ISLAND_LOADING
CModelInfo::RemoveColModelsFromOtherLevels(CGame::currLevel);
#ifdef NO_ISLAND_LOADING
if (CMenuManager::m_PrefsIslandLoading == CMenuManager::ISLAND_LOADING_LOW)
#endif
CModelInfo::RemoveColModelsFromOtherLevels(CGame::currLevel);
if (CGame::currLevel != LEVEL_GENERIC) {
#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);
if (CMenuManager::m_PrefsIslandLoading != CMenuManager::ISLAND_LOADING_LOW) {
if (bAlreadyLoaded) {
ms_collisionInMemory = CGame::currLevel;
return;
}
bAlreadyLoaded = true;
CFileLoader::LoadCollisionFromDatFile(LEVEL_INDUSTRIAL);
CFileLoader::LoadCollisionFromDatFile(LEVEL_COMMERCIAL);
CFileLoader::LoadCollisionFromDatFile(LEVEL_SUBURBAN);
} else
#endif
CFileLoader::LoadCollisionFromDatFile(CGame::currLevel);
if(!CGame::playingIntro)
LoadSplash(GetLevelSplashScreen(CGame::currLevel));
}

View file

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

View file

@ -122,6 +122,11 @@ int8 CMenuManager::m_nPrefsMSAALevel = 0;
int8 CMenuManager::m_nDisplayMSAALevel = 0;
#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;
int32 CMenuManager::m_KeyPressedCode = -1;
@ -155,6 +160,10 @@ int32 MouseButtonJustClicked;
int32 JoyButtonJustClicked;
//int32 *pControlTemp = 0;
#ifdef PS2_ALPHA_TEST
extern bool gPS2alphaTest;
#endif
#ifndef MASTER
bool CMenuManager::m_PrefsMarketing = false;
bool CMenuManager::m_PrefsDisableTutorials = false;
@ -1189,6 +1198,21 @@ CMenuManager::Draw()
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
case MENUACTION_AUDIOHW:
if (m_nPrefsAudio3DProviderIndex == -1)
@ -1245,6 +1269,11 @@ CMenuManager::Draw()
rightText = TheText.Get(m_PrefsCutsceneBorders ? "FEM_ON" : "FEM_OFF");
break;
#endif
#ifdef PS2_ALPHA_TEST
case MENUACTION_PS2_ALPHA_TEST:
rightText = TheText.Get(gPS2alphaTest ? "FEM_ON" : "FEM_OFF");
break;
#endif
#ifdef CUSTOM_FRONTEND_OPTIONS
case MENUACTION_TRIGGERFUNC:
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)
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
if (m_nPrefsAudio3DProviderIndex != DMAudio.GetCurrent3DProviderIndex()) {
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"))
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
if (m_nPrefsAudio3DProviderIndex != DMAudio.GetCurrent3DProviderIndex()) {
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);
m_nDisplayMSAALevel = m_nPrefsMSAALevel;
#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
CFileMgr::Write(fileHandle, (char *)&CMenuManager::m_nPrefsMSAALevel, 1);
#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);
@ -4769,6 +4823,45 @@ CMenuManager::ProcessButtonPresses(void)
SaveSettings();
}
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
case MENUACTION_AUDIOHW:
{
@ -4842,6 +4935,43 @@ CMenuManager::ProcessButtonPresses(void)
#ifdef CUTSCENE_BORDERS_SWITCH
m_PrefsCutsceneBorders = true;
#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();
#else
} else if (m_nCurrScreen == MENUPAGE_DISPLAY_SETTINGS) {
@ -4870,6 +5000,43 @@ CMenuManager::ProcessButtonPresses(void)
#else
CMBlur::BlurOn = true;
#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();
#endif // GRAPHICS_MENU_OPTIONS
} else if ((m_nCurrScreen != MENUPAGE_SKIN_SELECT_OLD) && (m_nCurrScreen == MENUPAGE_CONTROLLER_PC)) {
@ -5155,6 +5322,15 @@ CMenuManager::ProcessButtonPresses(void)
m_nDisplayMSAALevel = 0;
}
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
case MENUACTION_AUDIOHW:
if (m_nPrefsAudio3DProviderIndex != -1) {
@ -5327,6 +5503,13 @@ CMenuManager::ProcessOnOffMenuOptions()
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_SETTING_CHANGE, 0);
SaveSettings();
break;
#endif
#ifdef PS2_ALPHA_TEST
case MENUACTION_PS2_ALPHA_TEST:
gPS2alphaTest = !gPS2alphaTest;
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_SETTING_CHANGE, 0);
SaveSettings();
break;
#endif
}
}

View file

@ -372,6 +372,12 @@ enum eMenuAction
#ifdef MULTISAMPLING
MENUACTION_MULTISAMPLING,
#endif
#ifdef NO_ISLAND_LOADING
MENUACTION_ISLANDLOADING,
#endif
#ifdef PS2_ALPHA_TEST
MENUACTION_PS2_ALPHA_TEST,
#endif
#ifdef CUTSCENE_BORDERS_SWITCH
MENUACTION_CUTSCENEBORDERS,
#endif
@ -622,6 +628,18 @@ public:
void PrintMap();
#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:
static void BuildStatLine(Const char *text, void *stat, bool itsFloat, void *stat2);
static void CentreMousePointer();

View file

@ -30,6 +30,18 @@
#define MENU_MULTISAMPLING(screen)
#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[] = {
// MENUPAGE_NONE = 0
{ "", 1, MENUPAGE_DISABLED, MENUPAGE_DISABLED, 0, 0, },
@ -84,6 +96,8 @@ CMenuScreen aScreens[] = {
MENU_CUTSCENE_BORDERS_SWITCH(MENUPAGE_DISPLAY_SETTINGS)
MENU_MIPMAPS(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)
MENUACTION_WIDESCREEN, "FED_WIS", SAVESLOT_NONE, MENUPAGE_DISPLAY_SETTINGS,
MENU_IMPROVED_VIDEOMODE(MENUPAGE_DISPLAY_SETTINGS)
@ -502,6 +516,8 @@ CMenuScreen aScreens[] = {
MENUACTION_WIDESCREEN, "FED_WIS", SAVESLOT_NONE, MENUPAGE_GRAPHICS_SETTINGS,
MENU_MIPMAPS(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_IMPROVED_VIDEOMODE(MENUPAGE_GRAPHICS_SETTINGS)
MENUACTION_SCREENRES, "FED_RES", SAVESLOT_NONE, MENUPAGE_GRAPHICS_SETTINGS,

View file

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

View file

@ -205,7 +205,7 @@ enum Config {
#define PS2_ALPHA_TEST // emulate ps2 alpha test
#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 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
//#define EXTENDED_COLOURFILTER // more options for colour filter (replaces mblur)

View file

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

View file

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

View file

@ -562,17 +562,23 @@ 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);
#ifdef NO_ISLAND_LOADING
if (CMenuManager::m_PrefsIslandLoading == CMenuManager::ISLAND_LOADING_LOW)
#endif
{
CStreaming::RemoveUnusedBigBuildings(CGame::currLevel);
CStreaming::RemoveUnusedBuildings(CGame::currLevel);
}
CCollision::SortOutCollisionAfterLoad();
#ifndef NO_ISLAND_LOADING
CStreaming::RequestBigBuildings(CGame::currLevel);
CStreaming::LoadAllRequestedModels(false);
CStreaming::HaveAllBigBuildingsLoaded(CGame::currLevel);
CGame::TidyUpMemory(true, false);
#ifdef NO_ISLAND_LOADING
if (CMenuManager::m_PrefsIslandLoading == CMenuManager::ISLAND_LOADING_LOW)
#endif
{
CStreaming::RequestBigBuildings(CGame::currLevel);
CStreaming::LoadAllRequestedModels(false);
CStreaming::HaveAllBigBuildingsLoaded(CGame::currLevel);
CGame::TidyUpMemory(true, false);
}
if (CloseFile(file)) {
return true;
} else {

View file

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