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>
This commit is contained in:
parent
3f7339a7c5
commit
625ab9701f
|
@ -301,27 +301,8 @@ winAdjustVideoModeNativeGDI (ScreenPtr pScreen)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* GDI cannot change the screen depth */
|
/* GDI cannot change the screen depth, so we'll use GDI's 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;
|
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 */
|
/* Release our DC */
|
||||||
ReleaseDC (NULL, hdc);
|
ReleaseDC (NULL, hdc);
|
||||||
|
|
|
@ -436,30 +436,10 @@ winAdjustVideoModePrimaryDD (ScreenPtr pScreen)
|
||||||
dwBPP = GetDeviceCaps (hdc, BITSPIXEL);
|
dwBPP = GetDeviceCaps (hdc, BITSPIXEL);
|
||||||
|
|
||||||
/* DirectDraw can only change the depth in fullscreen mode */
|
/* 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 */
|
/* Otherwise, We'll use GDI's depth */
|
||||||
ErrorF ("winAdjustVideoModePrimaryDD - 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 */
|
|
||||||
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;
|
pScreenInfo->dwBPP = dwBPP;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -91,6 +91,7 @@ winScreenInit (int index,
|
||||||
winScreenInfoPtr pScreenInfo = &g_ScreenInfo[index];
|
winScreenInfoPtr pScreenInfo = &g_ScreenInfo[index];
|
||||||
winPrivScreenPtr pScreenPriv;
|
winPrivScreenPtr pScreenPriv;
|
||||||
HDC hdc;
|
HDC hdc;
|
||||||
|
DWORD dwInitialBPP;
|
||||||
|
|
||||||
#if CYGDEBUG || YES
|
#if CYGDEBUG || YES
|
||||||
winDebug ("winScreenInit - dwWidth: %ld dwHeight: %ld\n",
|
winDebug ("winScreenInit - dwWidth: %ld dwHeight: %ld\n",
|
||||||
|
@ -127,12 +128,29 @@ winScreenInit (int index,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Horribly misnamed function: Allow engine to adjust BPP for screen */
|
/* Horribly misnamed function: Allow engine to adjust BPP for screen */
|
||||||
|
dwInitialBPP = pScreenInfo->dwBPP;
|
||||||
|
|
||||||
if (!(*pScreenPriv->pwinAdjustVideoMode) (pScreen))
|
if (!(*pScreenPriv->pwinAdjustVideoMode) (pScreen))
|
||||||
{
|
{
|
||||||
ErrorF ("winScreenInit - winAdjustVideoMode () failed\n");
|
ErrorF ("winScreenInit - winAdjustVideoMode () failed\n");
|
||||||
return FALSE;
|
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 */
|
/* Check for supported display depth */
|
||||||
if (!(WIN_SUPPORTED_BPPS & (1 << (pScreenInfo->dwBPP - 1))))
|
if (!(WIN_SUPPORTED_BPPS & (1 << (pScreenInfo->dwBPP - 1))))
|
||||||
{
|
{
|
||||||
|
|
|
@ -909,31 +909,13 @@ winAdjustVideoModeShadowDD (ScreenPtr pScreen)
|
||||||
dwBPP = GetDeviceCaps (hdc, BITSPIXEL);
|
dwBPP = GetDeviceCaps (hdc, BITSPIXEL);
|
||||||
|
|
||||||
/* DirectDraw can only change the depth in fullscreen mode */
|
/* 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 */
|
/* Otherwise, We'll use GDI's depth */
|
||||||
ErrorF ("winAdjustVideoModeShadowDD - Using Windows display "
|
|
||||||
"depth of %d bits per pixel\n", (int) dwBPP);
|
|
||||||
|
|
||||||
/* Use GDI's depth */
|
|
||||||
pScreenInfo->dwBPP = dwBPP;
|
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 */
|
/* Release our DC */
|
||||||
ReleaseDC (NULL, hdc);
|
ReleaseDC (NULL, hdc);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
|
@ -983,30 +983,10 @@ winAdjustVideoModeShadowDDNL (ScreenPtr pScreen)
|
||||||
dwBPP = GetDeviceCaps (hdc, BITSPIXEL);
|
dwBPP = GetDeviceCaps (hdc, BITSPIXEL);
|
||||||
|
|
||||||
/* DirectDraw can only change the depth in fullscreen mode */
|
/* 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 */
|
/* Otherwise, We'll use GDI's depth */
|
||||||
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 */
|
|
||||||
pScreenInfo->dwBPP = dwBPP;
|
pScreenInfo->dwBPP = dwBPP;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -798,25 +798,8 @@ winAdjustVideoModeShadowGDI (ScreenPtr pScreen)
|
||||||
/* Query GDI for current display depth */
|
/* Query GDI for current display depth */
|
||||||
dwBPP = GetDeviceCaps (hdc, BITSPIXEL);
|
dwBPP = GetDeviceCaps (hdc, BITSPIXEL);
|
||||||
|
|
||||||
/* GDI cannot change the screen depth */
|
/* GDI cannot change the screen depth, so always use GDI's 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;
|
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 */
|
/* Release our DC */
|
||||||
ReleaseDC (NULL, hdc);
|
ReleaseDC (NULL, hdc);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user