Ignore video modes with resolutions less than 640x480 or with aspect ratios taller than around 4:3 when populating the mode lists used in the startup window and menus. Sorry to the two guys still using nasty 5:4 1280x1024 monitors in 2017; you'll have to set your resolution using the console now.

git-svn-id: https://svn.eduke32.com/eduke32@6435 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2017-08-27 10:20:41 +00:00
parent 6889b64da8
commit 5cde84e58a
4 changed files with 16 additions and 6 deletions

View file

@ -40,13 +40,15 @@ enum rendmode_t {
#define MAXWALLSV7 8192
#define MAXSPRITESV7 4096
#ifndef GEKKO
#if !defined GEKKO && !defined __OPENDINGUX__
# define MAXSECTORS MAXSECTORSV8
# define MAXWALLS MAXWALLSV8
# define MAXSPRITES MAXSPRITESV8
# define MAXXDIM 7680
# define MAXYDIM 3200
# define MINXDIM 640
# define MINYDIM 480
// additional space beyond wall, in walltypes:
# define M32_FIXME_WALLS 512
@ -56,9 +58,16 @@ enum rendmode_t {
# define MAXWALLS MAXWALLSV7
# define MAXSPRITES MAXSPRITESV7
# define MAXXDIM 860
# define MAXYDIM 490
#ifdef GEKKO
# define MAXXDIM 860
# define MAXYDIM 490
# else
# define MAXXDIM 320
# define MAXYDIM 200
# endif
# define MINXDIM MAXXDIM
# define MINYDIM MAXYDIM
# define M32_FIXME_WALLS 0
# define M32_FIXME_SECTORS 0
#endif

View file

@ -58,7 +58,7 @@ int32_t SDL_WaitEventTimeout(SDL_Event *event, int32_t timeout);
} \
} while (0)
#define SDL_CHECKMODE(w, h) ((w < maxx) && (h < maxy))
#define SDL_CHECKMODE(w, h) ((w < MAXXDIM) && (h < MAXYDIM) && (w >= MINXDIM) && (h >= MINYDIM) && (((float)w/(float)h) >= 1.3f))
#define SDL_CHECKFSMODES(w, h) \
if (w == 0 && h == 0) \

View file

@ -1160,7 +1160,8 @@ void getvalidmodes(void)
for (i = 0; i < SDL_GetNumDisplayModes(0); i++)
{
SDL_GetDisplayMode(0, i, &dispmode);
if ((dispmode.w > MAXXDIM) || (dispmode.h > MAXYDIM) ||
if (!SDL_CHECKMODE(dispmode.w, dispmode.h) ||
(maxrefreshfreq && (dispmode.refresh_rate > maxrefreshfreq)))
continue;

View file

@ -267,7 +267,7 @@ void getvalidmodes(void)
{
for (i = 0; modes[i]; i++)
{
if ((modes[i]->w > MAXXDIM) || (modes[i]->h > MAXYDIM))
if (!SDL_CHECKMODE(modes[i]->w, modes[i]->h > MAXYDIM))
continue;
SDL_ADDMODE(modes[i]->w, modes[i]->h, cdepths[j], 1);