1
0
mirror of https://github.com/FunkyFr3sh/cnc-ddraw.git synced 2025-03-15 06:04:49 +01:00

set default values in SetDisplayMode

This commit is contained in:
FunkyFr3sh 2024-05-27 23:33:47 +02:00
parent c13483248f
commit 07a9ba78db

View File

@ -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;