fixes a bug of not being able to open a high-res window and failing. now it tries a lower resolution before giving up

This commit is contained in:
Asad M. Zaman 2004-08-24 22:48:22 +00:00
parent 5eeb0c7eed
commit a7521b518e
2 changed files with 22 additions and 2 deletions

View File

@ -1448,13 +1448,23 @@ search_for_device(wdxGraphicsPipe8 *dxpipe, DXDeviceInfo *device_info) {
<< (bCouldntFindValidZBuf ? "Couldnt find valid zbuffer format to go with FullScreen mode" : "No supported FullScreen modes") << (bCouldntFindValidZBuf ? "Couldnt find valid zbuffer format to go with FullScreen mode" : "No supported FullScreen modes")
<< " at " << dwRenderWidth << "x" << dwRenderHeight << " for device #" << _wcontext.CardIDNum <<endl; << " at " << dwRenderWidth << "x" << dwRenderHeight << " for device #" << _wcontext.CardIDNum <<endl;
// if it failed because of a size constraints (for non-default case), try with default size
if (!bUseDefaultSize) {
wdxdisplay8_cat.info() << "was not a default: but trying 800x600 size in verbose mode\n";
dwRenderWidth=800;
dwRenderHeight=600;
}
// run it again in verbose mode to get more dbg info to log // run it again in verbose mode to get more dbg info to log
dxpipe->search_for_valid_displaymode(_wcontext,dwRenderWidth, dwRenderHeight, dxpipe->search_for_valid_displaymode(_wcontext,dwRenderWidth, dwRenderHeight,
bNeedZBuffer, bWantStencil, bNeedZBuffer, bWantStencil,
&_wcontext.SupportedScreenDepthsMask, &_wcontext.SupportedScreenDepthsMask,
&bCouldntFindValidZBuf, &bCouldntFindValidZBuf,
&pixFmt, dx_force_16bpp_zbuffer, true); &pixFmt, dx_force_16bpp_zbuffer, true);
return false;
// if still D3DFMT_UNKNOWN return false
if (pixFmt == D3DFMT_UNKNOWN)
return false;
} }
} }
} else { } else {

View File

@ -1435,13 +1435,23 @@ search_for_device(wdxGraphicsPipe9 *dxpipe, DXDeviceInfo *device_info) {
<< (bCouldntFindValidZBuf ? "Couldnt find valid zbuffer format to go with FullScreen mode" : "No supported FullScreen modes") << (bCouldntFindValidZBuf ? "Couldnt find valid zbuffer format to go with FullScreen mode" : "No supported FullScreen modes")
<< " at " << dwRenderWidth << "x" << dwRenderHeight << " for device #" << _wcontext.CardIDNum <<endl; << " at " << dwRenderWidth << "x" << dwRenderHeight << " for device #" << _wcontext.CardIDNum <<endl;
// if it failed because of a size constraints (for non-default case), try with default size
if (!bUseDefaultSize) {
wdxdisplay9_cat.info() << "was not a default: but trying 800x600 size in verbose mode\n";
dwRenderWidth=800;
dwRenderHeight=600;
}
// run it again in verbose mode to get more dbg info to log // run it again in verbose mode to get more dbg info to log
dxpipe->search_for_valid_displaymode(_wcontext,dwRenderWidth, dwRenderHeight, dxpipe->search_for_valid_displaymode(_wcontext,dwRenderWidth, dwRenderHeight,
bNeedZBuffer, bWantStencil, bNeedZBuffer, bWantStencil,
&_wcontext.SupportedScreenDepthsMask, &_wcontext.SupportedScreenDepthsMask,
&bCouldntFindValidZBuf, &bCouldntFindValidZBuf,
&pixFmt, dx_force_16bpp_zbuffer, true); &pixFmt, dx_force_16bpp_zbuffer, true);
return false;
// if still D3DFMT_UNKNOWN return false
if (pixFmt == D3DFMT_UNKNOWN)
return false;
} }
} }
} else { } else {