diff --git a/hw/xwin/winnativegdi.c b/hw/xwin/winnativegdi.c index b0a551a5c..4d7afe898 100644 --- a/hw/xwin/winnativegdi.c +++ b/hw/xwin/winnativegdi.c @@ -301,28 +301,9 @@ winAdjustVideoModeNativeGDI (ScreenPtr pScreen) break; } - /* GDI cannot change the screen depth */ - if (pScreenInfo->dwBPP == WIN_DEFAULT_BPP) - { - /* No -depth parameter passed, let the user know the depth being used */ - ErrorF ("winAdjustVideoModeNativeGDI - Using Windows display " - "depth of %d bits per pixel, %d depth\n", - (int) dwBPP, (int) pScreenInfo->dwDepth); + /* GDI cannot change the screen depth, so we'll use GDI's depth */ + pScreenInfo->dwBPP = dwBPP; - /* Use GDI's depth */ - pScreenInfo->dwBPP = dwBPP; - } - else if (dwBPP != pScreenInfo->dwBPP) - { - /* Warn user if GDI depth is different than -depth parameter */ - ErrorF ("winAdjustVideoModeNativeGDI - Command line bpp: %d, "\ - "using bpp: %d\n", - (int) pScreenInfo->dwBPP, (int) dwBPP); - - /* We'll use GDI's depth */ - pScreenInfo->dwBPP = dwBPP; - } - /* Release our DC */ ReleaseDC (NULL, hdc); diff --git a/hw/xwin/winpfbdd.c b/hw/xwin/winpfbdd.c index 41457170a..c0bca71e3 100644 --- a/hw/xwin/winpfbdd.c +++ b/hw/xwin/winpfbdd.c @@ -436,33 +436,13 @@ winAdjustVideoModePrimaryDD (ScreenPtr pScreen) dwBPP = GetDeviceCaps (hdc, BITSPIXEL); /* DirectDraw can only change the depth in fullscreen mode */ - if (pScreenInfo->dwBPP == WIN_DEFAULT_BPP) + if (!(pScreenInfo->fFullScreen && + (pScreenInfo->dwBPP != WIN_DEFAULT_BPP))) { - /* No -depth parameter passed, let the user know the depth being used */ - ErrorF ("winAdjustVideoModePrimaryDD - Using Windows display " - "depth of %d bits per pixel\n", (int) dwBPP); - - /* Use GDI's depth */ + /* Otherwise, We'll use GDI's depth */ pScreenInfo->dwBPP = dwBPP; } - else if (pScreenInfo->fFullScreen - && pScreenInfo->dwBPP != dwBPP) - { - /* FullScreen, and GDI depth differs from -depth parameter */ - ErrorF ("winAdjustVideoModePrimaryDD - FullScreen, using command " - "line depth: %d\n", (int) pScreenInfo->dwBPP); - } - else if (dwBPP != pScreenInfo->dwBPP) - { - /* Windowed, and GDI depth differs from -depth parameter */ - ErrorF ("winAdjustVideoModePrimaryDD - Windowed, command line " - "depth: %d, using depth: %d\n", - (int) pScreenInfo->dwBPP, (int) dwBPP); - /* We'll use GDI's depth */ - pScreenInfo->dwBPP = dwBPP; - } - /* Release our DC */ ReleaseDC (NULL, hdc); diff --git a/hw/xwin/winscrinit.c b/hw/xwin/winscrinit.c index 699ed949e..691237e6f 100644 --- a/hw/xwin/winscrinit.c +++ b/hw/xwin/winscrinit.c @@ -91,6 +91,7 @@ winScreenInit (int index, winScreenInfoPtr pScreenInfo = &g_ScreenInfo[index]; winPrivScreenPtr pScreenPriv; HDC hdc; + DWORD dwInitialBPP; #if CYGDEBUG || YES winDebug ("winScreenInit - dwWidth: %ld dwHeight: %ld\n", @@ -127,12 +128,29 @@ winScreenInit (int index, } /* Horribly misnamed function: Allow engine to adjust BPP for screen */ + dwInitialBPP = pScreenInfo->dwBPP; + if (!(*pScreenPriv->pwinAdjustVideoMode) (pScreen)) { ErrorF ("winScreenInit - winAdjustVideoMode () failed\n"); return FALSE; } + if (dwInitialBPP == WIN_DEFAULT_BPP) + { + /* No -depth parameter was passed, let the user know the depth being used */ + ErrorF ("winScreenInit - Using Windows display depth of %d bits per pixel\n", (int) pScreenInfo->dwBPP); + } + else if (dwInitialBPP != pScreenInfo->dwBPP) + { + /* Warn user if engine forced a depth different to -depth parameter */ + ErrorF ("winScreenInit - Command line depth of %d bpp overidden by engine, using %d bpp\n", (int) dwInitialBPP, (int) pScreenInfo->dwBPP); + } + else + { + ErrorF ("winScreenInit - Using command line depth of %d bpp\n", (int) pScreenInfo->dwBPP); + } + /* Check for supported display depth */ if (!(WIN_SUPPORTED_BPPS & (1 << (pScreenInfo->dwBPP - 1)))) { diff --git a/hw/xwin/winshaddd.c b/hw/xwin/winshaddd.c index b551bef7e..b14d0a962 100644 --- a/hw/xwin/winshaddd.c +++ b/hw/xwin/winshaddd.c @@ -909,31 +909,13 @@ winAdjustVideoModeShadowDD (ScreenPtr pScreen) dwBPP = GetDeviceCaps (hdc, BITSPIXEL); /* DirectDraw can only change the depth in fullscreen mode */ - if (pScreenInfo->dwBPP == WIN_DEFAULT_BPP) + if (!(pScreenInfo->fFullScreen && + (pScreenInfo->dwBPP != WIN_DEFAULT_BPP))) { - /* No -depth parameter passed, let the user know the depth being used */ - ErrorF ("winAdjustVideoModeShadowDD - Using Windows display " - "depth of %d bits per pixel\n", (int) dwBPP); - - /* Use GDI's depth */ + /* Otherwise, We'll use GDI's depth */ pScreenInfo->dwBPP = dwBPP; } - else if (pScreenInfo->fFullScreen - && pScreenInfo->dwBPP != dwBPP) - { - /* FullScreen, and GDI depth differs from -depth parameter */ - ErrorF ("winAdjustVideoModeShadowDD - FullScreen, using command line " - "bpp: %d\n", (int) pScreenInfo->dwBPP); - } - else if (dwBPP != pScreenInfo->dwBPP) - { - /* Windowed, and GDI depth differs from -depth parameter */ - ErrorF ("winAdjustVideoModeShadowDD - Windowed, command line bpp: " - "%d, using bpp: %d\n", (int) pScreenInfo->dwBPP, (int) dwBPP); - /* We'll use GDI's depth */ - pScreenInfo->dwBPP = dwBPP; - } /* Release our DC */ ReleaseDC (NULL, hdc); return TRUE; diff --git a/hw/xwin/winshadddnl.c b/hw/xwin/winshadddnl.c index 52a4ce26d..c74a2ff14 100644 --- a/hw/xwin/winshadddnl.c +++ b/hw/xwin/winshadddnl.c @@ -983,30 +983,10 @@ winAdjustVideoModeShadowDDNL (ScreenPtr pScreen) dwBPP = GetDeviceCaps (hdc, BITSPIXEL); /* DirectDraw can only change the depth in fullscreen mode */ - if (pScreenInfo->dwBPP == WIN_DEFAULT_BPP) + if (!(pScreenInfo->fFullScreen && + (pScreenInfo->dwBPP != WIN_DEFAULT_BPP))) { - /* No -depth parameter passed, let the user know the depth being used */ - winErrorFVerb (2, "winAdjustVideoModeShadowDDNL - Using Windows display " - "depth of %d bits per pixel\n", (int) dwBPP); - - /* Use GDI's depth */ - pScreenInfo->dwBPP = dwBPP; - } - else if (pScreenInfo->fFullScreen - && pScreenInfo->dwBPP != dwBPP) - { - /* FullScreen, and GDI depth differs from -depth parameter */ - winErrorFVerb (2, "winAdjustVideoModeShadowDDNL - FullScreen, using command " - "line bpp: %d\n", (int) pScreenInfo->dwBPP); - } - else if (dwBPP != pScreenInfo->dwBPP) - { - /* Windowed, and GDI depth differs from -depth parameter */ - winErrorFVerb (2, "winAdjustVideoModeShadowDDNL - Windowed, command line " - "bpp: %d, using bpp: %d\n", - (int) pScreenInfo->dwBPP, (int) dwBPP); - - /* We'll use GDI's depth */ + /* Otherwise, We'll use GDI's depth */ pScreenInfo->dwBPP = dwBPP; } diff --git a/hw/xwin/winshadgdi.c b/hw/xwin/winshadgdi.c index e9c51ee64..499037656 100644 --- a/hw/xwin/winshadgdi.c +++ b/hw/xwin/winshadgdi.c @@ -798,26 +798,9 @@ winAdjustVideoModeShadowGDI (ScreenPtr pScreen) /* Query GDI for current display depth */ dwBPP = GetDeviceCaps (hdc, BITSPIXEL); - /* GDI cannot change the screen depth */ - if (pScreenInfo->dwBPP == WIN_DEFAULT_BPP) - { - /* No -depth parameter passed, let the user know the depth being used */ - ErrorF ("winAdjustVideoModeShadowGDI - Using Windows display " - "depth of %d bits per pixel\n", (int) dwBPP); + /* GDI cannot change the screen depth, so always use GDI's depth */ + pScreenInfo->dwBPP = dwBPP; - /* Use GDI's depth */ - pScreenInfo->dwBPP = dwBPP; - } - else if (dwBPP != pScreenInfo->dwBPP) - { - /* Warn user if GDI depth is different than -depth parameter */ - ErrorF ("winAdjustVideoModeShadowGDI - Command line bpp: %d, "\ - "using bpp: %d\n", (int) pScreenInfo->dwBPP, (int) dwBPP); - - /* We'll use GDI's depth */ - pScreenInfo->dwBPP = dwBPP; - } - /* Release our DC */ ReleaseDC (NULL, hdc); hdc = NULL;