mirror of
https://github.com/DrBeef/Raze.git
synced 2024-11-15 17:01:51 +00:00
sdlayer.h/winlayer.cpp: If a resolution is supported for fullscreen, also support the mode as a windowed resolution.
git-svn-id: https://svn.eduke32.com/eduke32@6696 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
5370beb026
commit
15b11232c3
2 changed files with 35 additions and 25 deletions
|
@ -37,26 +37,29 @@ int32_t SDL_WaitEventTimeout(SDL_Event *event, int32_t timeout);
|
|||
}
|
||||
|
||||
#define SDL_ADDMODE(x, y, c, f) \
|
||||
do \
|
||||
{ \
|
||||
if (validmodecnt < MAXVALIDMODES) \
|
||||
int fullscreen; \
|
||||
for (fullscreen = f; fullscreen >= 0; --fullscreen) \
|
||||
{ \
|
||||
int32_t mn; \
|
||||
for (mn = 0; mn < validmodecnt; mn++) \
|
||||
if (validmode[mn].xdim == x && validmode[mn].ydim == y && validmode[mn].bpp == c && \
|
||||
validmode[mn].fs == f) \
|
||||
break; \
|
||||
if (mn == validmodecnt) \
|
||||
if (validmodecnt < MAXVALIDMODES) \
|
||||
{ \
|
||||
validmode[validmodecnt].xdim = x; \
|
||||
validmode[validmodecnt].ydim = y; \
|
||||
validmode[validmodecnt].bpp = c; \
|
||||
validmode[validmodecnt].fs = f; \
|
||||
validmodecnt++; \
|
||||
/*initprintf(" - %dx%d %d-bit %s\n", x, y, c, (f&1)?"fullscreen":"windowed");*/ \
|
||||
int32_t mn; \
|
||||
for (mn = 0; mn < validmodecnt; mn++) \
|
||||
if (validmode[mn].xdim == x && validmode[mn].ydim == y && validmode[mn].bpp == c && \
|
||||
validmode[mn].fs == fullscreen) \
|
||||
break; \
|
||||
if (mn == validmodecnt) \
|
||||
{ \
|
||||
validmode[validmodecnt].xdim = x; \
|
||||
validmode[validmodecnt].ydim = y; \
|
||||
validmode[validmodecnt].bpp = c; \
|
||||
validmode[validmodecnt].fs = fullscreen; \
|
||||
validmodecnt++; \
|
||||
/*initprintf(" - %dx%d %d-bit %s\n", x, y, c, (fullscreen&1)?"fullscreen":"windowed");*/ \
|
||||
} \
|
||||
} \
|
||||
} \
|
||||
} while (0)
|
||||
}
|
||||
|
||||
#define SDL_CHECKMODE(w, h) ((w < MAXXDIM) && (h < MAXYDIM) && (w >= MINXDIM) && (h >= MINYDIM) && (((float)w/(float)h) >= 1.3f))
|
||||
|
||||
|
|
|
@ -1655,16 +1655,23 @@ int32_t setvideomode(int32_t x, int32_t y, int32_t c, int32_t fs)
|
|||
//
|
||||
// getvalidmodes() -- figure out what video modes are available
|
||||
//
|
||||
#define ADDMODE(x,y,c,f,n) if (validmodecnt<MAXVALIDMODES) { \
|
||||
validmode[validmodecnt].xdim=x; \
|
||||
validmode[validmodecnt].ydim=y; \
|
||||
validmode[validmodecnt].bpp=c; \
|
||||
validmode[validmodecnt].fs=f; \
|
||||
validmode[validmodecnt].extra=n; \
|
||||
validmodecnt++; \
|
||||
}
|
||||
/* initprintf(" - %dx%d %d-bit %s\n", x, y, c, (f&1)?"fullscreen":"windowed"); \
|
||||
} */
|
||||
#define ADDMODE(x,y,c,f,n) \
|
||||
{ \
|
||||
int fullscreen; \
|
||||
for (fullscreen = f; fullscreen >= 0; --fullscreen) \
|
||||
{ \
|
||||
if (validmodecnt<MAXVALIDMODES) \
|
||||
{ \
|
||||
validmode[validmodecnt].xdim=x; \
|
||||
validmode[validmodecnt].ydim=y; \
|
||||
validmode[validmodecnt].bpp=c; \
|
||||
validmode[validmodecnt].fs=fullscreen; \
|
||||
validmode[validmodecnt].extra=n; \
|
||||
validmodecnt++; \
|
||||
/* initprintf(" - %dx%d %d-bit %s\n", x, y, c, (fullscreen&1)?"fullscreen":"windowed");*/\
|
||||
} \
|
||||
} \
|
||||
}
|
||||
|
||||
#define CHECK(w,h) if ((w < maxx) && (h < maxy))
|
||||
|
||||
|
|
Loading…
Reference in a new issue