set default values in SetDisplayMode
This commit is contained in:
parent
c13483248f
commit
07a9ba78db
1 changed files with 24 additions and 0 deletions
24
src/dd.c
24
src/dd.c
|
@ -578,6 +578,30 @@ HRESULT dd_RestoreDisplayMode()
|
|||
|
||||
HRESULT dd_SetDisplayMode(DWORD dwWidth, DWORD dwHeight, DWORD dwBPP, DWORD dwFlags)
|
||||
{
|
||||
if (!dwWidth)
|
||||
{
|
||||
dwWidth = g_ddraw.width;
|
||||
|
||||
if (!dwWidth)
|
||||
dwWidth = 800;
|
||||
}
|
||||
|
||||
if (!dwHeight)
|
||||
{
|
||||
dwHeight = g_ddraw.height;
|
||||
|
||||
if (!dwHeight)
|
||||
dwHeight = 600;
|
||||
}
|
||||
|
||||
if (!dwBPP)
|
||||
{
|
||||
dwBPP = g_ddraw.bpp;
|
||||
|
||||
if (!dwBPP)
|
||||
dwBPP = 16;
|
||||
}
|
||||
|
||||
if (dwBPP != 8 && dwBPP != 16 && dwBPP != 32)
|
||||
return DDERR_INVALIDMODE;
|
||||
|
||||
|
|
Loading…
Reference in a new issue