Fixed a werid case when setdisplay mode does not working.

tested with ati hd2400 that does not official support 256 color in windows. 
with the official drv I have

svn path=/trunk/; revision=31077
This commit is contained in:
Magnus Olsen
2007-12-08 13:40:07 +00:00
parent 794e87f37f
commit eea85cc484
2 changed files with 22 additions and 9 deletions
@@ -205,6 +205,8 @@ Main_DirectDraw_EnumDisplayModes4(LPDDRAWI_DIRECTDRAW_INT This, DWORD dwFlags,
HRESULT WINAPI
Main_DirectDraw_SetDisplayMode (LPDDRAWI_DIRECTDRAW_INT This, DWORD dwWidth, DWORD dwHeight, DWORD dwBPP)
{
DX_WINDBG_trace();
return Main_DirectDraw_SetDisplayMode2 (This, dwWidth, dwHeight, dwBPP, 0, 0 );
}
@@ -255,12 +257,23 @@ Main_DirectDraw_SetDisplayMode2 (LPDDRAWI_DIRECTDRAW_INT This, DWORD dwWidth, DW
DevMode.dmBitsPerPel = dwBPP;
DevMode.dmDisplayFrequency = dwRefreshRate;
DX_WINDBG_trace_res(dwHeight, dwWidth, dwBPP, dwRefreshRate);
retval = ChangeDisplaySettings(&DevMode, CDS_FULLSCREEN);
/* FIXME: Are we supposed to set CDS_SET_PRIMARY as well ? */
if(retval == DISP_CHANGE_BADMODE)
{
ret = DDERR_UNSUPPORTED;
/* Note : it seam ms ddraw ignore this and try using the bad mode any case.
* tested with Ati HD2400 that only support 16 and 32 Bpp in windows
*/
DX_STUB_str("Warning ChangeDisplaySettings return DISP_CHANGE_BADMODE, but ddraw.dll ignore it\n");
//ret = DDERR_UNSUPPORTED;
BOOL ModeChanged;
This->lpLcl->lpGbl->hDD = This->lpLcl->hDD;
DdReenableDirectDrawObject(This->lpLcl->lpGbl, &ModeChanged);
StartDirectDraw((LPDIRECTDRAW)This, 0, TRUE);
}
else if(retval != DISP_CHANGE_SUCCESSFUL)
{
+8 -8
View File
@@ -257,14 +257,14 @@ VOID Hal_DirectDraw_Release (LPDIRECTDRAW7);
#define DX_WINDBG_trace_res(width,height,bpp, freq) \
static BOOL firstcallxx = TRUE; \
if (firstcallxx) \
{ \
char buffer[1024]; \
sprintf ( buffer, "Setmode have been req width=%d, height=%d bpp=%d freq = %d\n",width,height,bpp, freq); \
OutputDebugStringA(buffer); \
firstcallxx = FALSE; \
}
static BOOL firstcallxx = TRUE; \
if (firstcallxx) \
{ \
char buffer[1024]; \
sprintf ( buffer, "Setmode have been req width=%d, height=%d bpp=%d freq = %d\n",width,height,bpp, freq); \
OutputDebugStringA(buffer); \
firstcallxx = TRUE; \
}
#else
#define DX_WINDBG_trace() //
#define DX_WINDBG_trace_res(width,height,bpp, freq) \\