Add cutscene borders switch to the menu

This commit is contained in:
Sergeanur 2020-07-11 12:03:56 +03:00
parent 00bba630f6
commit 6eb8f6ae5a
6 changed files with 44 additions and 3 deletions

View File

@ -112,6 +112,10 @@ int8 CMenuManager::m_bFrontEnd_ReloadObrTxtGxt;
int32 CMenuManager::m_PrefsMusicVolume = 102;
int32 CMenuManager::m_PrefsSfxVolume = 102;
#ifdef CUTSCENE_BORDERS_SWITCH
bool CMenuManager::m_PrefsCutsceneBorders = true;
#endif
char CMenuManager::m_PrefsSkinFile[256] = DEFAULT_SKIN_NAME;
int32 CMenuManager::m_KeyPressedCode = -1;
@ -3217,6 +3221,9 @@ CMenuManager::LoadSettings()
CFileMgr::Read(fileHandle, (char*)&m_PrefsLanguage, 1);
#ifdef FREE_CAM
CFileMgr::Read(fileHandle, (char*)&TheCamera.bFreeCam, 1);
#endif
#ifdef CUTSCENE_BORDERS_SWITCH
CFileMgr::Read(fileHandle, (char *)&CMenuManager::m_PrefsCutsceneBorders, 1);
#endif
}
}
@ -3310,6 +3317,9 @@ CMenuManager::SaveSettings()
CFileMgr::Write(fileHandle, (char*)&m_PrefsLanguage, 1);
#ifdef FREE_CAM
CFileMgr::Write(fileHandle, (char*)&TheCamera.bFreeCam, 1);
#endif
#ifdef CUTSCENE_BORDERS_SWITCH
CFileMgr::Write(fileHandle, (char *)&CMenuManager::m_PrefsCutsceneBorders, 1);
#endif
}

View File

@ -582,6 +582,10 @@ public:
static uint8 m_PrefsPlayerGreen;
static uint8 m_PrefsPlayerBlue;
#ifdef CUTSCENE_BORDERS_SWITCH
static bool m_PrefsCutsceneBorders;
#endif
#ifndef MASTER
static bool m_PrefsMarketing;
static bool m_PrefsDisableTutorials;

View File

@ -201,6 +201,7 @@ enum Config {
#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 USE_TEXTURE_POOL
#define CUTSCENE_BORDERS_SWITCH
// Particle
//#define PC_PARTICLE

View File

@ -254,7 +254,11 @@ DoFade(void)
fadeColor.a = alpha;
}
if(TheCamera.m_WideScreenOn){
if(TheCamera.m_WideScreenOn
#ifdef CUTSCENE_BORDERS_SWITCH
&& CMenuManager::m_PrefsCutsceneBorders
#endif
){
// what's this?
float y = SCREEN_HEIGHT/2 * TheCamera.m_ScreenReductionPercentage/100.0f;
rect.left = 0.0f;
@ -862,7 +866,11 @@ Render2dStuff(void)
CReplay::Display();
CPickups::RenderPickUpText();
if(TheCamera.m_WideScreenOn)
if(TheCamera.m_WideScreenOn
#ifdef CUTSCENE_BORDERS_SWITCH
&& CMenuManager::m_PrefsCutsceneBorders
#endif
)
TheCamera.DrawBordersForWideScreen();
CPed *player = FindPlayerPed();

View File

@ -132,6 +132,14 @@ void ToggleFreeCam(int8 action)
}
#endif
#ifdef CUTSCENE_BORDERS_SWITCH
void BorderModeChange(int8 displayedValue)
{
CMenuManager::m_PrefsCutsceneBorders = !!displayedValue;
FrontEndMenuManager.SaveSettings();
}
#endif
// Reloaded on language change, so you can use hardcoded wchar* and TheText.Get with peace of mind
void
CustomFrontendOptionsPopulate(void)
@ -161,6 +169,12 @@ CustomFrontendOptionsPopulate(void)
FrontendOptionSetPosition(MENUPAGE_CONTROLLER_PC, 1);
FrontendOptionAddDynamic(text, nil, ToggleFreeCam, nil);
#endif
#ifdef CUTSCENE_BORDERS_SWITCH
static const wchar *off_on[] = { TheText.Get("FEM_OFF"), TheText.Get("FEM_ON") };
FrontendOptionSetPosition(MENUPAGE_GRAPHICS_SETTINGS, 9);
FrontendOptionAddSelect((const wchar *)L"CUTSCENE BORDERS", off_on, 2, (int8 *)&CMenuManager::m_PrefsCutsceneBorders, false, BorderModeChange, nil);
#endif
}
#endif

View File

@ -3,6 +3,7 @@
#include "Draw.h"
#include "Frontend.h"
#include "Camera.h"
#include "CutsceneMgr.h"
#ifdef ASPECT_RATIO_SCALE
float CDraw::ms_fAspectRatio = DEFAULT_ASPECT_RATIO;
@ -62,7 +63,10 @@ void
CDraw::SetFOV(float fov)
{
#ifdef ASPECT_RATIO_SCALE
ms_fScaledFOV = ConvertFOV(fov);
if (!CCutsceneMgr::IsRunning())
ms_fScaledFOV = ConvertFOV(fov);
else
ms_fScaledFOV = fov;
#endif
ms_fFOV = fov;
}