mirror of
https://github.com/FunkyFr3sh/cnc-ddraw.git
synced 2025-03-24 17:49:52 +01:00
set default values in SetDisplayMode
This commit is contained in:
parent
c13483248f
commit
07a9ba78db
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)
|
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)
|
if (dwBPP != 8 && dwBPP != 16 && dwBPP != 32)
|
||||||
return DDERR_INVALIDMODE;
|
return DDERR_INVALIDMODE;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user