From ab16d3cd72502661bd2b173eaf1d76adbdf008d7 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 31 Mar 2019 09:13:22 +0200 Subject: [PATCH] - limit minimum screen size to 640x400. The current menu system simply does not work that well with 320x200, rendering the game hard to use at that tiny screen size. This is a clear case where the work required to keep it operational stands in no relation to the benefit. --- src/posix/cocoa/gl_sysfb.h | 4 ++-- src/posix/sdl/gl_sysfb.h | 4 ++-- src/r_videoscale.cpp | 17 +++++++++-------- src/v_framebuffer.cpp | 4 ++-- src/win32/i_input.cpp | 4 ++-- wadsrc/static/menudef.txt | 1 - 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/posix/cocoa/gl_sysfb.h b/src/posix/cocoa/gl_sysfb.h index a45f448f89..2a2b8a5d2e 100644 --- a/src/posix/cocoa/gl_sysfb.h +++ b/src/posix/cocoa/gl_sysfb.h @@ -91,8 +91,8 @@ private: int GetTitleBarHeight() const; - static const int MINIMUM_WIDTH = 320; - static const int MINIMUM_HEIGHT = 200; + static const int MINIMUM_WIDTH = 640; + static const int MINIMUM_HEIGHT = 400; }; #endif // COCOA_GL_SYSFB_H_INCLUDED diff --git a/src/posix/sdl/gl_sysfb.h b/src/posix/sdl/gl_sysfb.h index f7ac38dd30..6b1df1cc35 100644 --- a/src/posix/sdl/gl_sysfb.h +++ b/src/posix/sdl/gl_sysfb.h @@ -47,8 +47,8 @@ protected: void UpdateColors (); - static const int MIN_WIDTH = 320; - static const int MIN_HEIGHT = 200; + static const int MIN_WIDTH = 640; + static const int MIN_HEIGHT = 400; }; #endif // __POSIX_SDL_GL_SYSFB_H__ diff --git a/src/r_videoscale.cpp b/src/r_videoscale.cpp index d6254c9927..2a59c4a3b9 100644 --- a/src/r_videoscale.cpp +++ b/src/r_videoscale.cpp @@ -32,16 +32,16 @@ extern bool setsizeneeded; EXTERN_CVAR(Int, vid_aspect) -CUSTOM_CVAR(Int, vid_scale_customwidth, 320, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) +CUSTOM_CVAR(Int, vid_scale_customwidth, 640, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) { - if (self < 320) - self = 320; + if (self < 640) + self = 640; setsizeneeded = true; } -CUSTOM_CVAR(Int, vid_scale_customheight, 200, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) +CUSTOM_CVAR(Int, vid_scale_customheight, 400, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) { - if (self < 200) - self = 200; + if (self < 400) + self = 400; setsizeneeded = true; } CVAR(Bool, vid_scale_customlinear, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) @@ -66,7 +66,7 @@ namespace // isValid, isLinear, GetScaledWidth(), GetScaledHeight(), isScaled43, isCustom { true, false, [](uint32_t Width)->uint32_t { return Width; }, [](uint32_t Height)->uint32_t { return Height; }, false, false }, // 0 - Native { true, true, [](uint32_t Width)->uint32_t { return Width; }, [](uint32_t Height)->uint32_t { return Height; }, false, false }, // 1 - Native (Linear) - { true, false, [](uint32_t Width)->uint32_t { return 320; }, [](uint32_t Height)->uint32_t { return 200; }, true, false }, // 2 - 320x200 + { true, false, [](uint32_t Width)->uint32_t { return 640; }, [](uint32_t Height)->uint32_t { return 400; }, true, false }, // 2 - formerly 320x200 { true, false, [](uint32_t Width)->uint32_t { return 640; }, [](uint32_t Height)->uint32_t { return 400; }, true, false }, // 3 - 640x400 { true, true, [](uint32_t Width)->uint32_t { return 1280; }, [](uint32_t Height)->uint32_t { return 800; }, true, false }, // 4 - 1280x800 { true, true, [](uint32_t Width)->uint32_t { return vid_scale_customwidth; }, [](uint32_t Height)->uint32_t { return vid_scale_customheight; }, true, true }, // 5 - Custom @@ -90,7 +90,8 @@ CUSTOM_CVAR(Float, vid_scalefactor, 1.0, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR CUSTOM_CVAR(Int, vid_scalemode, 0, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) { setsizeneeded = true; - if (isOutOfBounds(self)) + if (self == 2) self = 3; // block 320x200 setting. + else if (isOutOfBounds(self)) self = 0; } diff --git a/src/v_framebuffer.cpp b/src/v_framebuffer.cpp index ec53fc7e86..3a569cb1d7 100644 --- a/src/v_framebuffer.cpp +++ b/src/v_framebuffer.cpp @@ -210,8 +210,8 @@ void DFrameBuffer::Update() int initialHeight = GetClientHeight(); int clientWidth = ViewportScaledWidth(initialWidth, initialHeight); int clientHeight = ViewportScaledHeight(initialWidth, initialHeight); - if (clientWidth < 320) clientWidth = 320; - if (clientHeight < 200) clientHeight = 200; + if (clientWidth < 640) clientWidth = 640; + if (clientHeight < 400) clientHeight = 400; if (clientWidth > 0 && clientHeight > 0 && (GetWidth() != clientWidth || GetHeight() != clientHeight)) { SetVirtualSize(clientWidth, clientHeight); diff --git a/src/win32/i_input.cpp b/src/win32/i_input.cpp index 676484a301..b8f5ba777e 100644 --- a/src/win32/i_input.cpp +++ b/src/win32/i_input.cpp @@ -525,8 +525,8 @@ LRESULT CALLBACK WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) } else { - mmi->ptMinTrackSize.x = 320; - mmi->ptMinTrackSize.y = 200; + mmi->ptMinTrackSize.x = 640; + mmi->ptMinTrackSize.y = 400; } return 0; } diff --git a/wadsrc/static/menudef.txt b/wadsrc/static/menudef.txt index 194096f0ed..ed702e345f 100644 --- a/wadsrc/static/menudef.txt +++ b/wadsrc/static/menudef.txt @@ -2132,7 +2132,6 @@ OptionValue ScaleModes { 0, "$OPTVAL_SCALENEAREST" 1, "$OPTVAL_SCALELINEAR" - 2, "320x200" 3, "640x400" 4, "1280x800" 5, "$OPTVAL_CUSTOM"