- renamed fullscreen CVar internally to vid_fullscreen to make searching for it easier.

The word 'fullscreen' appears a bit too frequently in the source.
This commit is contained in:
Christoph Oelckers 2020-04-11 13:05:58 +02:00
parent d523da1313
commit fdc14ca805
13 changed files with 37 additions and 32 deletions

View file

@ -438,6 +438,11 @@ void C_ForgetCVars (void);
F##type##CVar name (#name, def, flags, cvarfunc_##name); \
static void cvarfunc_##name(F##type##CVar &self)
#define CUSTOM_CVAR_NAMED(type,name,cname,def,flags) \
static void cvarfunc_##name(F##type##CVar &); \
F##type##CVar name (#cname, def, flags, cvarfunc_##name); \
static void cvarfunc_##name(F##type##CVar &self)
#define CVAR(type,name,def,flags) \
F##type##CVar name (#name, def, flags);

View file

@ -781,7 +781,7 @@ void D_Display ()
if (setmodeneeded)
{
setmodeneeded = false;
screen->ToggleFullscreen(fullscreen);
screen->ToggleFullscreen(vid_fullscreen);
V_OutputResized(screen->GetWidth(), screen->GetHeight());
}

View file

@ -42,7 +42,7 @@
CVAR(Int, menu_resolution_custom_width, 640, 0)
CVAR(Int, menu_resolution_custom_height, 480, 0)
EXTERN_CVAR(Bool, fullscreen)
EXTERN_CVAR(Bool, vid_fullscreen)
EXTERN_CVAR(Bool, win_maximized)
EXTERN_CVAR(Float, vid_scale_custompixelaspect)
EXTERN_CVAR(Int, vid_scale_customwidth)
@ -66,7 +66,7 @@ CCMD (menu_resolution_set_custom)
CCMD (menu_resolution_commit_changes)
{
int do_fullscreen = fullscreen;
int do_fullscreen = vid_fullscreen;
if (argv.argc() > 1)
{
do_fullscreen = atoi(argv[1]);
@ -81,7 +81,7 @@ CCMD (menu_resolution_commit_changes)
}
else
{
fullscreen = true;
vid_fullscreen = true;
vid_scalemode = 5;
vid_scalefactor = 1.;
vid_scale_customwidth = menu_resolution_custom_width;

View file

@ -430,7 +430,7 @@ public:
try
{
m_vulkanDevice = new VulkanDevice();
fb = new VulkanFrameBuffer(nullptr, fullscreen, m_vulkanDevice);
fb = new VulkanFrameBuffer(nullptr, vid_fullscreen, m_vulkanDevice);
}
catch (std::exception const&)
{
@ -445,7 +445,7 @@ public:
{
SetupOpenGLView(ms_window, OpenGLProfile::Legacy);
fb = new PolyFrameBuffer(nullptr, fullscreen);
fb = new PolyFrameBuffer(nullptr, vid_fullscreen);
}
else
{
@ -454,18 +454,18 @@ public:
if (fb == nullptr)
{
fb = new OpenGLRenderer::OpenGLFrameBuffer(0, fullscreen);
fb = new OpenGLRenderer::OpenGLFrameBuffer(0, vid_fullscreen);
}
fb->SetWindow(ms_window);
fb->SetMode(fullscreen, vid_hidpi);
fb->SetMode(vid_fullscreen, vid_hidpi);
fb->SetSize(fb->GetClientWidth(), fb->GetClientHeight());
// This lame hack is a temporary workaround for strange performance issues
// with fullscreen window and Core Animation's Metal layer
// It is somehow related to initial window level and flags
// Toggling fullscreen -> window -> fullscreen mysteriously solves the problem
if (ms_isVulkanEnabled && fullscreen)
if (ms_isVulkanEnabled && vid_fullscreen)
{
fb->SetMode(false, vid_hidpi);
fb->SetMode(true, vid_hidpi);
@ -542,10 +542,10 @@ void SystemBaseFrameBuffer::SetWindowSize(int width, int height)
return;
}
if (fullscreen)
if (vid_fullscreen)
{
// Enter windowed mode in order to calculate title bar height
fullscreen = false;
vid_fullscreen = false;
SetMode(false, m_hiDPI);
}

View file

@ -468,7 +468,7 @@ DFrameBuffer *SDLVideo::CreateFrameBuffer ()
{
assert(device == nullptr);
device = new VulkanDevice();
fb = new VulkanFrameBuffer(nullptr, fullscreen, device);
fb = new VulkanFrameBuffer(nullptr, vid_fullscreen, device);
}
catch (CVulkanError const&)
{
@ -484,12 +484,12 @@ DFrameBuffer *SDLVideo::CreateFrameBuffer ()
if (Priv::softpolyEnabled)
{
fb = new PolyFrameBuffer(nullptr, fullscreen);
fb = new PolyFrameBuffer(nullptr, vid_fullscreen);
}
if (fb == nullptr)
{
fb = new OpenGLRenderer::OpenGLFrameBuffer(0, fullscreen);
fb = new OpenGLRenderer::OpenGLFrameBuffer(0, vid_fullscreen);
}
return fb;
@ -569,7 +569,7 @@ void SystemBaseFrameBuffer::ToggleFullscreen(bool yes)
if ( !Priv::fullscreenSwitch )
{
Priv::fullscreenSwitch = true;
fullscreen = false;
vid_fullscreen = false;
}
else
{
@ -588,9 +588,9 @@ void SystemBaseFrameBuffer::SetWindowSize(int w, int h)
}
win_w = w;
win_h = h;
if ( fullscreen )
if (vid_fullscreen )
{
fullscreen = false;
vid_fullscreen = false;
}
else
{
@ -729,7 +729,7 @@ void ProcessSDLWindowEvent(const SDL_WindowEvent &event)
break;
case SDL_WINDOWEVENT_MOVED:
if (!fullscreen && Priv::GetWindowBordersSize)
if (!vid_fullscreen && Priv::GetWindowBordersSize)
{
int top = 0, left = 0;
Priv::GetWindowBordersSize(Priv::window, &top, &left, nullptr, nullptr);
@ -739,7 +739,7 @@ void ProcessSDLWindowEvent(const SDL_WindowEvent &event)
break;
case SDL_WINDOWEVENT_RESIZED:
if (!fullscreen && !Priv::fullscreenSwitch)
if (!vid_fullscreen && !Priv::fullscreenSwitch)
{
win_w = event.data1;
win_h = event.data2;

View file

@ -435,7 +435,7 @@ TArray<uint8_t> OpenGLFrameBuffer::GetScreenshotBuffer(int &pitch, ESSType &colo
// Screenshot should not use gamma correction if it was already applied to rendered image
gamma = 1;
if (vid_hdr_active && fullscreen)
if (vid_hdr_active && vid_fullscreen)
gamma *= 2.2f;
return ScreenshotBuffer;
}

View file

@ -755,7 +755,7 @@ void IVideo::DumpAdapters ()
Printf("Multi-monitor support unavailable.\n");
}
CUSTOM_CVAR(Bool, fullscreen, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_NOINITCALL)
CUSTOM_CVAR_NAMED(Bool, vid_fullscreen, fullscreen, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_NOINITCALL)
{
setmodeneeded = true;
}

View file

@ -122,7 +122,7 @@ void V_OutputResized (int width, int height);
void V_CalcCleanFacs (int designwidth, int designheight, int realwidth, int realheight, int *cleanx, int *cleany, int *cx1=NULL, int *cx2=NULL);
EXTERN_CVAR(Int, vid_rendermode)
EXTERN_CVAR(Bool, fullscreen)
EXTERN_CVAR(Bool, vid_fullscreen)
EXTERN_CVAR(Int, win_x)
EXTERN_CVAR(Int, win_y)
EXTERN_CVAR(Int, win_w)

View file

@ -251,7 +251,7 @@ void SystemBaseFrameBuffer::SetWindowSize(int w, int h)
KeepWindowOnScreen(winx, winy, winw, winh, scrwidth, scrheight);
}
if (!fullscreen)
if (!vid_fullscreen)
{
ShowWindow(Window, SW_SHOWNORMAL);
SetWindowPos(Window, nullptr, winx, winy, winw, winh, SWP_NOZORDER | SWP_FRAMECHANGED);
@ -266,7 +266,7 @@ void SystemBaseFrameBuffer::SetWindowSize(int w, int h)
win_w = winw;
win_h = winh;
win_maximized = false;
fullscreen = false;
vid_fullscreen = false;
}
}
}
@ -335,7 +335,7 @@ void SystemBaseFrameBuffer::PositionWindow(bool fullscreen, bool initialcall)
// This doesn't restore the window size properly so we must force a set size the next tic.
if (m_Fullscreen)
{
::fullscreen = false;
::vid_fullscreen = false;
}
}

View file

@ -547,7 +547,7 @@ BOOL CALLBACK IWADBoxCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM lPa
// Check the current video settings.
//SendDlgItemMessage( hDlg, vid_renderer ? IDC_WELCOME_OPENGL : IDC_WELCOME_SOFTWARE, BM_SETCHECK, BST_CHECKED, 0 );
SendDlgItemMessage( hDlg, IDC_WELCOME_FULLSCREEN, BM_SETCHECK, fullscreen ? BST_CHECKED : BST_UNCHECKED, 0 );
SendDlgItemMessage( hDlg, IDC_WELCOME_FULLSCREEN, BM_SETCHECK, vid_fullscreen ? BST_CHECKED : BST_UNCHECKED, 0 );
switch (vid_preferbackend)
{
case 1:
@ -605,7 +605,7 @@ BOOL CALLBACK IWADBoxCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM lPa
{
SetQueryIWad(hDlg);
// [SP] Upstreamed from Zandronum
fullscreen = SendDlgItemMessage( hDlg, IDC_WELCOME_FULLSCREEN, BM_GETCHECK, 0, 0 ) == BST_CHECKED;
vid_fullscreen = SendDlgItemMessage( hDlg, IDC_WELCOME_FULLSCREEN, BM_GETCHECK, 0, 0 ) == BST_CHECKED;
if (SendDlgItemMessage(hDlg, IDC_WELCOME_VULKAN3, BM_GETCHECK, 0, 0) == BST_CHECKED)
vid_preferbackend = 2;
else if (SendDlgItemMessage(hDlg, IDC_WELCOME_VULKAN2, BM_GETCHECK, 0, 0) == BST_CHECKED)

View file

@ -97,7 +97,7 @@ DFrameBuffer *Win32GLVideo::CreateFrameBuffer()
{
SystemGLFrameBuffer *fb;
fb = new OpenGLRenderer::OpenGLFrameBuffer(m_hMonitor, fullscreen);
fb = new OpenGLRenderer::OpenGLFrameBuffer(m_hMonitor, vid_fullscreen);
return fb;
}

View file

@ -4,7 +4,7 @@
#include "c_cvars.h"
#include "rendering/polyrenderer/backend/poly_framebuffer.h"
EXTERN_CVAR(Bool, fullscreen)
EXTERN_CVAR(Bool, vid_fullscreen)
class Win32PolyVideo : public Win32BaseVideo
{
@ -15,7 +15,7 @@ public:
DFrameBuffer *CreateFrameBuffer() override
{
auto fb = new PolyFrameBuffer(m_hMonitor, fullscreen);
auto fb = new PolyFrameBuffer(m_hMonitor, vid_fullscreen);
return fb;
}
};

View file

@ -5,7 +5,7 @@
#include "rendering/vulkan/system/vk_framebuffer.h"
EXTERN_CVAR(Bool, fullscreen)
EXTERN_CVAR(Bool, vid_fullscreen)
//==========================================================================
//
@ -35,7 +35,7 @@ public:
DFrameBuffer *CreateFrameBuffer() override
{
auto fb = new VulkanFrameBuffer(m_hMonitor, fullscreen, device);
auto fb = new VulkanFrameBuffer(m_hMonitor, vid_fullscreen, device);
return fb;
}