summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon TURNEY <jon.turney@dronecode.org.uk>2010-08-31 13:45:43 +0100
committerJon TURNEY <jon.turney@dronecode.org.uk>2011-01-19 14:02:36 +0000
commit625ab9701fd75b879c1dafc05fa979591eea87c0 (patch)
treefc1ee25f5a2ef526442474e05e96d080b1c95633
parent3f7339a7c5d3dcd05909b041865125f4cb6fa29e (diff)
Cygwin/X: Simplify and consolidate reporting of the bpp value we are going to use
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> Tested-by: Colin Harrison <colin.harrison@virgin.net>
-rw-r--r--hw/xwin/winnativegdi.c23
-rw-r--r--hw/xwin/winpfbdd.c26
-rw-r--r--hw/xwin/winscrinit.c18
-rw-r--r--hw/xwin/winshaddd.c24
-rw-r--r--hw/xwin/winshadddnl.c26
-rw-r--r--hw/xwin/winshadgdi.c21
6 files changed, 31 insertions, 107 deletions
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);
-
- /* 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);
+ /* GDI cannot change the screen depth, so we'll use GDI's depth */
+ pScreenInfo->dwBPP = 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);
-
- /* 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);
+ /* GDI cannot change the screen depth, so always use GDI's depth */
+ pScreenInfo->dwBPP = dwBPP;
- /* We'll use GDI's depth */
- pScreenInfo->dwBPP = dwBPP;
- }
-
/* Release our DC */
ReleaseDC (NULL, hdc);
hdc = NULL;