summaryrefslogtreecommitdiffstats
path: root/src/core/Frontend.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/Frontend.cpp')
-rw-r--r--src/core/Frontend.cpp534
1 files changed, 383 insertions, 151 deletions
diff --git a/src/core/Frontend.cpp b/src/core/Frontend.cpp
index 95d5f6e6..d82c5df4 100644
--- a/src/core/Frontend.cpp
+++ b/src/core/Frontend.cpp
@@ -36,7 +36,6 @@
#include "Stats.h"
#include "Messages.h"
#include "FileLoader.h"
-#include "frontendoption.h"
#define TIDY_UP_PBP // ProcessButtonPresses
#define MAX_VISIBLE_LIST_ROW 30
@@ -116,6 +115,17 @@ int32 CMenuManager::m_PrefsSfxVolume = 102;
bool CMenuManager::m_PrefsCutsceneBorders = true;
#endif
+
+#ifdef MULTISAMPLING
+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;
@@ -149,6 +159,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;
@@ -399,8 +413,15 @@ CMenuManager::ThingsToDoBeforeGoingBack()
DMAudio.StopFrontEndTrack();
OutputDebugString("FRONTEND AUDIO TRACK STOPPED");
#endif
+#ifdef GRAPHICS_MENU_OPTIONS
} else if (m_nCurrScreen == MENUPAGE_GRAPHICS_SETTINGS) {
+#else
+ } else if (m_nCurrScreen == MENUPAGE_DISPLAY_SETTINGS) {
+#endif
m_nDisplayVideoMode = m_nPrefsVideoMode;
+#ifdef MULTISAMPLING
+ m_nDisplayMSAALevel = m_nPrefsMSAALevel;
+#endif
}
if (m_nCurrScreen == MENUPAGE_SKIN_SELECT) {
@@ -410,46 +431,12 @@ CMenuManager::ThingsToDoBeforeGoingBack()
if ((m_nCurrScreen == MENUPAGE_SKIN_SELECT) || (m_nCurrScreen == MENUPAGE_KEYBOARD_CONTROLS)) {
m_nTotalListRow = 0;
}
-
-#ifdef CUSTOM_FRONTEND_OPTIONS
- for (int i = 0; i < numCustomFrontendOptions; i++) {
- FrontendOption &option = customFrontendOptions[i];
- if (option.type != FEOPTION_REDIRECT && option.type != FEOPTION_GOBACK && m_nCurrScreen == option.screen) {
- if (option.returnPrevPageFunc)
- option.returnPrevPageFunc();
-
- if (m_nCurrOption == option.screenOptionOrder && option.type == FEOPTION_DYNAMIC)
- option.buttonPressFunc(FEOPTION_ACTION_FOCUSLOSS);
-
- if (option.onlyApplyOnEnter)
- option.displayedValue = *option.value;
- }
- }
-#endif
}
int8
CMenuManager::GetPreviousPageOption()
{
-#ifndef CUSTOM_FRONTEND_OPTIONS
- return !m_bGameNotLoaded ? aScreens[m_nCurrScreen].m_ParentEntry[1] : aScreens[m_nCurrScreen].m_ParentEntry[0];
-#else
- int8 prevPage = !m_bGameNotLoaded ? aScreens[m_nCurrScreen].m_PreviousPage[1] : aScreens[m_nCurrScreen].m_PreviousPage[0];
-
- if (prevPage == -1) // Game also does same
- return 0;
-
- prevPage = prevPage == MENUPAGE_NONE ? (!m_bGameNotLoaded ? MENUPAGE_PAUSE_MENU : MENUPAGE_START_MENU) : prevPage;
-
- for (int i = 0; i < NUM_MENUROWS; i++) {
- if (aScreens[prevPage].m_aEntries[i].m_TargetMenu == m_nCurrScreen) {
- return i;
- }
- }
-
- // Couldn't find current screen option on previous page, use default behaviour (maybe save-related screen?)
return !m_bGameNotLoaded ? aScreens[m_nCurrScreen].m_ParentEntry[1] : aScreens[m_nCurrScreen].m_ParentEntry[0];
-#endif
}
// ------ Functions not in the game/inlined ends
@@ -848,7 +835,7 @@ CMenuManager::Draw()
CFont::SetCentreOn();
break;
case MENUPAGE_SOUND_SETTINGS:
- case MENUPAGE_GRAPHICS_SETTINGS:
+ case MENUPAGE_DISPLAY_SETTINGS:
case MENUPAGE_MULTIPLAYER_CREATE:
case MENUPAGE_SKIN_SELECT_OLD:
case MENUPAGE_CONTROLLER_PC_OLD1:
@@ -856,7 +843,10 @@ CMenuManager::Draw()
case MENUPAGE_CONTROLLER_PC_OLD3:
case MENUPAGE_CONTROLLER_PC_OLD4:
case MENUPAGE_CONTROLLER_DEBUG:
- case MENUPAGE_MOUSE_CONTROLS:
+ case MENUPAGE_MOUSE_CONTROLS:
+#ifdef GRAPHICS_MENU_OPTIONS
+ case MENUPAGE_GRAPHICS_SETTINGS:
+#endif
columnWidth = 50;
headerHeight = 0;
lineHeight = 20;
@@ -965,14 +955,7 @@ CMenuManager::Draw()
}
#endif
-#ifdef CUSTOM_FRONTEND_OPTIONS
- static int lastOption = m_nCurrOption;
-#endif
-
for (int i = 0; i < NUM_MENUROWS; ++i) {
-#ifdef CUSTOM_FRONTEND_OPTIONS
- bool isOptionDisabled = false;
-#endif
if (aScreens[m_nCurrScreen].m_aEntries[i].m_Action != MENUACTION_LABEL && aScreens[m_nCurrScreen].m_aEntries[i].m_EntryName[0] != '\0') {
wchar *rightText = nil;
wchar *leftText;
@@ -1155,6 +1138,40 @@ CMenuManager::Draw()
AsciiToUnicode(_psGetVideoModeList()[m_nDisplayVideoMode], unicodeTemp);
rightText = unicodeTemp;
break;
+#ifdef IMPROVED_VIDEOMODE
+ case MENUACTION_SCREENFORMAT:
+ rightText = TheText.Get(FrontEndMenuManager.m_nSelectedScreenMode ? "FED_WND" : "FED_FLS");
+ break;
+#endif
+#ifdef MULTISAMPLING
+ case MENUACTION_MULTISAMPLING:
+ switch (m_nDisplayMSAALevel) {
+ case 0:
+ rightText = TheText.Get("FEM_OFF");
+ break;
+ default:
+ sprintf(gString, "%iX", 1 << (m_nDisplayMSAALevel));
+ AsciiToUnicode(gString, unicodeTemp);
+ rightText = unicodeTemp;
+ 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)
rightText = TheText.Get("FEA_NAH");
@@ -1205,27 +1222,14 @@ CMenuManager::Draw()
case MENUACTION_MOUSESTEER:
rightText = TheText.Get(CVehicle::m_bDisableMouseSteering ? "FEM_OFF" : "FEM_ON");
break;
-#ifdef CUSTOM_FRONTEND_OPTIONS
- case MENUACTION_TRIGGERFUNC:
- FrontendOption& option = customFrontendOptions[aScreens[m_nCurrScreen].m_aEntries[i].m_TargetMenu];
- if (m_nCurrScreen == option.screen && i == option.screenOptionOrder) {
- leftText = (wchar*)option.leftText;
- if (option.type == FEOPTION_SELECT) {
- if (option.displayedValue >= option.numRightTexts || option.displayedValue < 0)
- option.displayedValue = 0;
-
- rightText = (wchar*)option.rightTexts[option.displayedValue];
-
- } else if (option.type == FEOPTION_DYNAMIC) {
- if (option.drawFunc) {
- rightText = option.drawFunc(&isOptionDisabled);
- }
- }
- } else {
- debug("A- screen:%d option:%d - totalCo: %d, coId: %d, coScreen:%d, coOption:%d\n", m_nCurrScreen, i, numCustomFrontendOptions, aScreens[m_nCurrScreen].m_aEntries[i].m_TargetMenu, option.screen, option.screenOptionOrder);
- assert(0 && "Custom frontend options is borked");
- }
-
+#ifdef CUTSCENE_BORDERS_SWITCH
+ case MENUACTION_CUTSCENEBORDERS:
+ 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
}
@@ -1306,12 +1310,15 @@ CMenuManager::Draw()
CFont::SetRightJustifyOn();
if(textLayer == 1)
- if(!strcmp(aScreens[m_nCurrScreen].m_aEntries[i].m_EntryName, "FED_RES")
- && !m_bGameNotLoaded
-#ifdef CUSTOM_FRONTEND_OPTIONS
- || isOptionDisabled
+ if((!strcmp(aScreens[m_nCurrScreen].m_aEntries[i].m_EntryName, "FED_RES")
+#ifdef IMPROVED_VIDEOMODE
+ || !strcmp(aScreens[m_nCurrScreen].m_aEntries[i].m_EntryName, "FEM_SCF")
+#endif
+#ifdef MULTISAMPLING
+ || !strcmp(aScreens[m_nCurrScreen].m_aEntries[i].m_EntryName, "FED_AAS")
#endif
)
+ && !m_bGameNotLoaded)
CFont::SetColor(CRGBA(155, 117, 6, FadeIn(255)));
CFont::PrintString(MENU_X_RIGHT_ALIGNED(columnWidth - textLayer), itemY, rightText);
@@ -1331,6 +1338,24 @@ CMenuManager::Draw()
if (!strcmp(aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_EntryName, "FED_RES") && m_nHelperTextMsgId == 1)
ResetHelperText();
}
+#ifdef IMPROVED_VIDEOMODE
+ if (m_nSelectedScreenMode == m_nPrefsWindowed) {
+ if (!strcmp(aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_EntryName, "FEM_SCF") && m_nHelperTextMsgId == 1)
+ ResetHelperText();
+ }
+#endif
+#ifdef MULTISAMPLING
+ if (m_nDisplayMSAALevel == m_nPrefsMSAALevel) {
+ 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"))
SetHelperText(1);
@@ -1339,6 +1364,24 @@ CMenuManager::Draw()
if (!strcmp(aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_EntryName, "FED_RES"))
SetHelperText(1);
}
+#ifdef IMPROVED_VIDEOMODE
+ if (m_nSelectedScreenMode != m_nPrefsWindowed) {
+ if (!strcmp(aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_EntryName, "FEM_SCF"))
+ SetHelperText(1);
+ }
+#endif
+#ifdef MULTISAMPLING
+ if (m_nDisplayMSAALevel != m_nPrefsMSAALevel) {
+ 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
&& m_nCurrScreen == MENUPAGE_SOUND_SETTINGS && m_nPrefsAudio3DProviderIndex != -1) {
@@ -1349,22 +1392,38 @@ CMenuManager::Draw()
}
if (m_nDisplayVideoMode != m_nPrefsVideoMode) {
if (strcmp(aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_EntryName, "FED_RES") != 0
- && m_nCurrScreen == MENUPAGE_GRAPHICS_SETTINGS) {
+#ifdef GRAPHICS_MENU_OPTIONS
+ && m_nCurrScreen == MENUPAGE_GRAPHICS_SETTINGS) {
+#else
+ && m_nCurrScreen == MENUPAGE_DISPLAY_SETTINGS) {
+#endif
m_nDisplayVideoMode = m_nPrefsVideoMode;
SetHelperText(3);
}
}
-
-#ifdef CUSTOM_FRONTEND_OPTIONS
- if (aScreens[m_nCurrScreen].m_aEntries[i].m_Action == MENUACTION_TRIGGERFUNC) {
- FrontendOption &option = customFrontendOptions[aScreens[m_nCurrScreen].m_aEntries[i].m_TargetMenu];
- if (option.onlyApplyOnEnter && m_nCurrOption != i)
- option.displayedValue = *option.value;
-
- if (m_nCurrOption != lastOption && lastOption == i) {
- FrontendOption &oldOption = customFrontendOptions[aScreens[m_nCurrScreen].m_aEntries[lastOption].m_TargetMenu];
- if (oldOption.type == FEOPTION_DYNAMIC)
- oldOption.buttonPressFunc(FEOPTION_ACTION_FOCUSLOSS);
+#ifdef IMPROVED_VIDEOMODE
+ if (m_nSelectedScreenMode != m_nPrefsWindowed) {
+ if (strcmp(aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_EntryName, "FEM_SCF") != 0
+#ifdef GRAPHICS_MENU_OPTIONS
+ && m_nCurrScreen == MENUPAGE_GRAPHICS_SETTINGS) {
+#else
+ && m_nCurrScreen == MENUPAGE_DISPLAY_SETTINGS) {
+#endif
+ m_nSelectedScreenMode = m_nPrefsWindowed;
+ SetHelperText(3);
+ }
+ }
+#endif
+#ifdef MULTISAMPLING
+ if (m_nSelectedScreenMode != m_nPrefsWindowed) {
+ if (strcmp(aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_EntryName, "FED_AAS") != 0
+#ifdef GRAPHICS_MENU_OPTIONS
+ && m_nCurrScreen == MENUPAGE_GRAPHICS_SETTINGS) {
+#else
+ && m_nCurrScreen == MENUPAGE_DISPLAY_SETTINGS) {
+#endif
+ m_nDisplayMSAALevel = m_nPrefsMSAALevel;
+ SetHelperText(3);
}
}
#endif
@@ -1412,17 +1471,16 @@ CMenuManager::Draw()
}
}
-#ifdef CUSTOM_FRONTEND_OPTIONS
- lastOption = m_nCurrOption;
-#endif
-
switch (m_nCurrScreen) {
case MENUPAGE_CONTROLLER_SETTINGS:
case MENUPAGE_SOUND_SETTINGS:
- case MENUPAGE_GRAPHICS_SETTINGS:
+ case MENUPAGE_DISPLAY_SETTINGS:
case MENUPAGE_SKIN_SELECT:
case MENUPAGE_CONTROLLER_PC:
case MENUPAGE_MOUSE_CONTROLS:
+#ifdef GRAPHICS_MENU_OPTIONS
+ case MENUPAGE_GRAPHICS_SETTINGS:
+#endif
DisplayHelperText();
break;
}
@@ -2079,7 +2137,7 @@ CMenuManager::DrawFrontEnd()
bbNames[0] = { "FEB_SAV",MENUPAGE_NEW_GAME };
bbNames[1] = { "FEB_CON",MENUPAGE_CONTROLLER_PC };
bbNames[2] = { "FEB_AUD",MENUPAGE_SOUND_SETTINGS };
- bbNames[3] = { "FEB_DIS",MENUPAGE_GRAPHICS_SETTINGS };
+ bbNames[3] = { "FEB_DIS",MENUPAGE_DISPLAY_SETTINGS };
bbNames[4] = { "FEB_LAN",MENUPAGE_LANGUAGE_SETTINGS };
bbNames[5] = { "FESZ_QU",MENUPAGE_EXIT };
bbTabCount = 6;
@@ -2091,7 +2149,7 @@ CMenuManager::DrawFrontEnd()
bbNames[2] = { "FEB_BRI",MENUPAGE_BRIEFS };
bbNames[3] = { "FEB_CON",MENUPAGE_CONTROLLER_PC };
bbNames[4] = { "FEB_AUD",MENUPAGE_SOUND_SETTINGS };
- bbNames[5] = { "FEB_DIS",MENUPAGE_GRAPHICS_SETTINGS };
+ bbNames[5] = { "FEB_DIS",MENUPAGE_DISPLAY_SETTINGS };
bbNames[6] = { "FEB_LAN",MENUPAGE_LANGUAGE_SETTINGS };
bbNames[7] = { "FESZ_QU",MENUPAGE_EXIT };
bbTabCount = 8;
@@ -2212,7 +2270,7 @@ CMenuManager::DrawFrontEndNormal()
case MENUPAGE_DELETE_SLOT_CONFIRM:
currentSprite = FE_ICONSAVE;
break;
- case MENUPAGE_GRAPHICS_SETTINGS:
+ case MENUPAGE_DISPLAY_SETTINGS:
currentSprite = FE_ICONDISPLAY;
break;
case MENUPAGE_SOUND_SETTINGS:
@@ -3070,10 +3128,6 @@ CMenuManager::InitialiseChangedLanguageSettings()
default:
break;
}
-
-#ifdef CUSTOM_FRONTEND_OPTIONS
- CustomFrontendOptionsPopulate();
-#endif
}
}
@@ -3225,6 +3279,17 @@ CMenuManager::LoadSettings()
#ifdef CUTSCENE_BORDERS_SWITCH
CFileMgr::Read(fileHandle, (char *)&CMenuManager::m_PrefsCutsceneBorders, 1);
#endif
+#ifdef MULTISAMPLING
+ 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
}
}
@@ -3321,6 +3386,15 @@ CMenuManager::SaveSettings()
#ifdef CUTSCENE_BORDERS_SWITCH
CFileMgr::Write(fileHandle, (char *)&CMenuManager::m_PrefsCutsceneBorders, 1);
#endif
+#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);
@@ -4638,7 +4712,66 @@ CMenuManager::ProcessButtonPresses(void)
SetHelperText(0);
SaveSettings();
}
+ break;
+#ifdef IMPROVED_VIDEOMODE
+ case MENUACTION_SCREENFORMAT:
+ if (m_nSelectedScreenMode != m_nPrefsWindowed) {
+ m_nPrefsWindowed = m_nSelectedScreenMode;
+ _psSelectScreenVM(m_nPrefsVideoMode);
+ SetHelperText(0);
+ SaveSettings();
+ }
break;
+#endif
+#ifdef MULTISAMPLING
+ case MENUACTION_MULTISAMPLING:
+ if (m_nDisplayMSAALevel != m_nPrefsMSAALevel) {
+ m_nPrefsMSAALevel = m_nDisplayMSAALevel;
+ _psSelectScreenVM(m_nPrefsVideoMode);
+ SetHelperText(0);
+ 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:
{
int selectedProvider = m_nPrefsAudio3DProviderIndex;
@@ -4685,7 +4818,8 @@ CMenuManager::ProcessButtonPresses(void)
DMAudio.SetRadioInCar(m_PrefsRadioStation);
DMAudio.PlayFrontEndTrack(m_PrefsRadioStation, 1);
SaveSettings();
- } else if (m_nCurrScreen == MENUPAGE_GRAPHICS_SETTINGS) {
+#ifndef GRAPHICS_MENU_OPTIONS
+ } else if (m_nCurrScreen == MENUPAGE_DISPLAY_SETTINGS) {
m_PrefsFrameLimiter = true;
m_PrefsBrightness = 256;
m_PrefsVsyncDisp = true;
@@ -4707,7 +4841,113 @@ CMenuManager::ProcessButtonPresses(void)
#else
CMBlur::BlurOn = true;
#endif
+#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) {
+ m_PrefsBrightness = 256;
+ m_PrefsShowSubtitles = true;
+#ifdef CUTSCENE_BORDERS_SWITCH
+ m_PrefsCutsceneBorders = true;
+#endif
+ SaveSettings();
+ } else if (m_nCurrScreen == MENUPAGE_GRAPHICS_SETTINGS) {
+ m_PrefsFrameLimiter = true;
+ m_PrefsUseWideScreen = false;
+ m_PrefsVsyncDisp = true;
+ m_PrefsLOD = 1.2f;
+ m_PrefsVsync = true;
+ CRenderer::ms_lodDistScale = 1.2f;
+ m_nDisplayVideoMode = m_nPrefsVideoMode;
+#ifdef GTA3_1_1_PATCH
+ if (_dwOperatingSystemVersion == OS_WIN98) {
+ CMBlur::BlurOn = false;
+ CMBlur::MotionBlurClose();
+ } else {
+ CMBlur::BlurOn = true;
+ CMBlur::MotionBlurOpen(Scene.camera);
+ }
+#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)) {
ControlsManager.MakeControllerActionsBlank();
ControlsManager.InitDefaultControlConfiguration();
@@ -4766,33 +5006,6 @@ CMenuManager::ProcessButtonPresses(void)
RetryMission(2, 0);
return;
#endif
-#ifdef CUSTOM_FRONTEND_OPTIONS
- case MENUACTION_TRIGGERFUNC:
- FrontendOption& option = customFrontendOptions[aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_TargetMenu];
- if (m_nCurrScreen == option.screen && m_nCurrOption == option.screenOptionOrder) {
- if (option.type == FEOPTION_SELECT) {
- if (!option.onlyApplyOnEnter) {
- option.displayedValue++;
- if (option.displayedValue >= option.numRightTexts || option.displayedValue < 0)
- option.displayedValue = 0;
- }
- option.changeFunc(option.displayedValue);
- *option.value = option.displayedValue;
-
- } else if (option.type == FEOPTION_DYNAMIC) {
- option.buttonPressFunc(FEOPTION_ACTION_SELECT);
- } else if (option.type == FEOPTION_REDIRECT) {
- ChangeScreen(option.to, option.option, true, option.fadeIn);
- } else if (option.type == FEOPTION_GOBACK) {
- goBack = true;
- }
- } else {
- debug("B- screen:%d option:%d - totalCo: %d, coId: %d, coScreen:%d, coOption:%d\n", m_nCurrScreen, m_nCurrOption, numCustomFrontendOptions, aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_TargetMenu, option.screen, option.screenOptionOrder);
- assert(0 && "Custom frontend options are borked");
- }
-
- break;
-#endif
}
}
ProcessOnOffMenuOptions();
@@ -4966,6 +5179,41 @@ CMenuManager::ProcessButtonPresses(void)
}
}
break;
+#ifdef IMPROVED_VIDEOMODE
+ case MENUACTION_SCREENFORMAT:
+ if (m_bGameNotLoaded) {
+ FrontEndMenuManager.m_nSelectedScreenMode = !FrontEndMenuManager.m_nSelectedScreenMode;
+ }
+ break;
+#endif
+#ifdef MULTISAMPLING
+ case MENUACTION_MULTISAMPLING:
+ if (m_bGameNotLoaded) {
+ m_nDisplayMSAALevel += changeValueBy;
+
+ int i = 0;
+ int maxAA = RwD3D8EngineGetMaxMultiSamplingLevels();
+ while (maxAA != 1) {
+ i++;
+ maxAA >>= 1;
+ }
+
+ if (m_nDisplayMSAALevel < 0)
+ m_nDisplayMSAALevel = i;
+ else if (m_nDisplayMSAALevel > i)
+ 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) {
m_nPrefsAudio3DProviderIndex += changeValueBy;
@@ -4988,36 +5236,6 @@ CMenuManager::ProcessButtonPresses(void)
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_SETTING_CHANGE, 0);
SaveSettings();
break;
-#ifdef CUSTOM_FRONTEND_OPTIONS
- case MENUACTION_TRIGGERFUNC:
- FrontendOption& option = customFrontendOptions[aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_TargetMenu];
- if (m_nCurrScreen == option.screen && m_nCurrOption == option.screenOptionOrder) {
- if (option.type == FEOPTION_SELECT) {
- if (changeValueBy > 0) {
- option.displayedValue++;
- if (option.displayedValue >= option.numRightTexts)
- option.displayedValue = 0;
- } else {
- option.displayedValue--;
- if (option.displayedValue < 0)
- option.displayedValue = option.numRightTexts - 1;
- }
- if (!option.onlyApplyOnEnter) {
- option.changeFunc(option.displayedValue);
- *option.value = option.displayedValue;
- }
- } else if (option.type == FEOPTION_DYNAMIC) {
- option.buttonPressFunc(changeValueBy > 0 ? FEOPTION_ACTION_RIGHT : FEOPTION_ACTION_LEFT);
- }
- DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_SETTING_CHANGE, 0);
- }
- else {
- debug("C- screen:%d option:%d - totalCo: %d, coId: %d, coScreen:%d, coOption:%d\n", m_nCurrScreen, m_nCurrOption, numCustomFrontendOptions, aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_TargetMenu, option.screen, option.screenOptionOrder);
- assert(0 && "Custom frontend options are borked");
- }
-
- break;
-#endif
}
ProcessOnOffMenuOptions();
if (m_nCurrScreen == MENUPAGE_KEYBOARD_CONTROLS) {
@@ -5131,6 +5349,20 @@ CMenuManager::ProcessOnOffMenuOptions()
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_SETTING_CHANGE, 0);
SaveSettings();
break;
+#ifdef CUTSCENE_BORDERS_SWITCH
+ case MENUACTION_CUTSCENEBORDERS:
+ m_PrefsCutsceneBorders = !m_PrefsCutsceneBorders;
+ 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
}
}