diff --git a/src/common/platform/posix/cocoa/i_video.mm b/src/common/platform/posix/cocoa/i_video.mm index 2950f7e352..bfefd0deca 100644 --- a/src/common/platform/posix/cocoa/i_video.mm +++ b/src/common/platform/posix/cocoa/i_video.mm @@ -519,7 +519,6 @@ static SystemBaseFrameBuffer* frameBuffer; SystemBaseFrameBuffer::SystemBaseFrameBuffer(void*, const bool fullscreen) -: DFrameBuffer(vid_defwidth, vid_defheight) , m_fullscreen(false) , m_hiDPI(false) , m_window(nullptr) diff --git a/src/common/platform/posix/sdl/gl_sysfb.h b/src/common/platform/posix/sdl/gl_sysfb.h index e9491d098c..f6ed350f8a 100644 --- a/src/common/platform/posix/sdl/gl_sysfb.h +++ b/src/common/platform/posix/sdl/gl_sysfb.h @@ -11,7 +11,7 @@ class SystemBaseFrameBuffer : public DFrameBuffer public: // this must have the same parameters as the Windows version, even if they are not used! - SystemBaseFrameBuffer (void *hMonitor, bool fullscreen); + SystemBaseFrameBuffer(void *hMonitor, bool fullscreen); bool IsFullscreen() override; diff --git a/src/common/platform/posix/sdl/sdlglvideo.cpp b/src/common/platform/posix/sdl/sdlglvideo.cpp index 2bd54c2aa3..7c2da2d74c 100644 --- a/src/common/platform/posix/sdl/sdlglvideo.cpp +++ b/src/common/platform/posix/sdl/sdlglvideo.cpp @@ -200,7 +200,7 @@ public: SDLVideo (); ~SDLVideo (); - DFrameBuffer *CreateFrameBuffer (bool fullscreen); + DFrameBuffer *CreateFrameBuffer(bool fullscreen); private: #ifdef HAVE_VULKAN @@ -436,7 +436,7 @@ SDLVideo::~SDLVideo () #endif } -DFrameBuffer *SDLVideo::CreateFrameBuffer (bool fullscreen) +DFrameBuffer *SDLVideo::CreateFrameBuffer(bool fullscreen) { SystemBaseFrameBuffer *fb = nullptr; @@ -491,8 +491,7 @@ IVideo *gl_CreateVideo() // FrameBuffer Implementation ----------------------------------------------- -SystemBaseFrameBuffer::SystemBaseFrameBuffer (void *, bool fullscreen) -: DFrameBuffer (vid_defwidth, vid_defheight) +SystemBaseFrameBuffer::SystemBaseFrameBuffer(void *, bool fullscreen) { if (Priv::window != nullptr) { @@ -656,7 +655,7 @@ SystemGLFrameBuffer::SystemGLFrameBuffer(void *hMonitor, bool fullscreen) } } -SystemGLFrameBuffer::~SystemGLFrameBuffer () +SystemGLFrameBuffer::~SystemGLFrameBuffer() { if (Priv::window) { diff --git a/src/common/rendering/v_framebuffer.cpp b/src/common/rendering/v_framebuffer.cpp index c0ebb4c25d..ad67fa73fd 100644 --- a/src/common/rendering/v_framebuffer.cpp +++ b/src/common/rendering/v_framebuffer.cpp @@ -70,9 +70,8 @@ EXTERN_CVAR(Int, screenblocks) // //========================================================================== -DFrameBuffer::DFrameBuffer (int width, int height) +DFrameBuffer::DFrameBuffer() { - SetSize(width, height); } DFrameBuffer::~DFrameBuffer() diff --git a/src/common/rendering/v_video.cpp b/src/common/rendering/v_video.cpp index 11af0e65e1..7426e65e98 100644 --- a/src/common/rendering/v_video.cpp +++ b/src/common/rendering/v_video.cpp @@ -146,8 +146,7 @@ class DDummyFrameBuffer : public DFrameBuffer { typedef DFrameBuffer Super; public: - DDummyFrameBuffer (int width, int height) - : DFrameBuffer (0, 0) + DDummyFrameBuffer(int width, int height) { SetVirtualSize(width, height); } @@ -372,9 +371,9 @@ void V_InitScreenSize () vid_defheight = height; } -void V_InitScreen() +void V_InitScreen(int width, int height) { - screen = new DDummyFrameBuffer (vid_defwidth, vid_defheight); + screen = new DDummyFrameBuffer(width, height); } void V_Init2() diff --git a/src/common/rendering/v_video.h b/src/common/rendering/v_video.h index db61130d0d..2826e312f6 100644 --- a/src/common/rendering/v_video.h +++ b/src/common/rendering/v_video.h @@ -156,7 +156,7 @@ public: double scaleFactor = 1.; public: - DFrameBuffer (int width=1, int height=1); + DFrameBuffer(); virtual ~DFrameBuffer(); virtual void InitializeState() = 0; // For stuff that needs 'screen' set. virtual bool IsVulkan() { return false; } @@ -303,7 +303,7 @@ EXTERN_CVAR (Float, vid_gamma) // Allocates buffer screens, call before R_Init. void V_InitScreenSize(); -void V_InitScreen(); +void V_InitScreen(int, int); // Initializes graphics mode for the first time. void V_Init2 (); diff --git a/src/d_main.cpp b/src/d_main.cpp index 36447ef893..ce09abd200 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -195,6 +195,8 @@ EXTERN_CVAR (Bool, sv_unlimited_pickup) EXTERN_CVAR (Bool, r_drawplayersprites) EXTERN_CVAR (Bool, show_messages) EXTERN_CVAR(Bool, ticker) +EXTERN_CVAR(Int, vid_defwidth) +EXTERN_CVAR(Int, vid_defheight) extern bool setmodeneeded; extern bool demorecording; @@ -3114,7 +3116,7 @@ static int D_InitGame(const FIWADInfo* iwad_info, TArray& allwads, TArr { V_InitScreenSize(); // This allocates a dummy framebuffer as a stand-in until V_Init2 is called. - V_InitScreen (); + V_InitScreen (vid_defwidth, vid_defheight); if (StartScreen != nullptr) {