diff --git a/polymer/eduke32/build/src/winlayer.c b/polymer/eduke32/build/src/winlayer.c index 1e675bf19..88c663a9e 100644 --- a/polymer/eduke32/build/src/winlayer.c +++ b/polymer/eduke32/build/src/winlayer.c @@ -71,6 +71,8 @@ // undefine to restrict windowed resolutions to conventional sizes #define ANY_WINDOWED_SIZE +#define FAKE_FS(x, y, bpp) (bpp == 8 && x == desktopxdim && y == desktopydim) + static mutex_t m_initprintf; static int32_t winlayer_have_ATI = 0; @@ -1838,6 +1840,17 @@ void getvalidmodes(void) } } } + + for (i=0; i0; i++, n--) curpalettefaded[i].f = lpal.palPalEntry[i].peFlags = PC_NOCOLLAPSE; - - if (fullscreen) + + if (fullscreen && !FAKE_FS(xres, yres, bpp)) { if (!lpDDPalette) return -1; result = IDirectDrawPalette_SetEntries(lpDDPalette, 0, 0, 256, (LPPALETTEENTRY)lpal.palPalEntry); @@ -2105,7 +2118,7 @@ return 0; // static int32_t setgammaramp(WORD gt[3][256]) { - if (!fullscreen || bpp > 8) + if (!fullscreen || bpp > 8 || FAKE_FS(xres, yres, bpp)) { // GL and windowed mode use DIB method int32_t i; @@ -2178,8 +2191,9 @@ int32_t setgamma(void) static int32_t getgammaramp(WORD gt[3][256]) { + return -1; if (!hWindow) return -1; - if (!fullscreen || bpp > 8) + if (!fullscreen || bpp > 8 || FAKE_FS(xres, yres, bpp)) { int32_t i; HDC hDC = GetDC(hWindow); @@ -2978,8 +2992,13 @@ static BOOL CreateAppWindow(int32_t modenum) ShowWindow(hWindow, SW_HIDE); // so Windows redraws what's behind if the window shrinks } - - if (fs) + + if (fs && FAKE_FS(width, height, bitspp)) + { + stylebitsex = 0; + stylebits = WS_POPUP | WS_MAXIMIZE | WS_VISIBLE | WS_CLIPSIBLINGS; + } + else if (fs) { stylebitsex = WS_EX_TOPMOST; stylebits = WS_POPUP; @@ -3020,7 +3039,7 @@ static BOOL CreateAppWindow(int32_t modenum) } // resize the window - if (!fs) + if (!fs && !FAKE_FS(width, height, bitspp)) { rect.left = 0; rect.top = 0; @@ -3054,7 +3073,7 @@ static BOOL CreateAppWindow(int32_t modenum) SetWindowPos(hWindow, HWND_TOP, windowpos?windowx:x, windowpos?windowy:y, w, h, 0); // fullscreen? - if (!fs) + if (!fs || FAKE_FS(width, height, bitspp)) { if (bitspp > 8) {