From 657225474ff281cbe1bbe9823cdc63451d2f0ec8 Mon Sep 17 00:00:00 2001 From: Magnus Olsen Date: Sun, 30 Oct 2005 09:49:29 +0000 Subject: [PATCH] Forgot cleanup the code. in Main_setDisplayMode. svn path=/trunk/; revision=18875 --- reactos/lib/ddraw/main/ddraw.c | 49 +++------------------------------- 1 file changed, 3 insertions(+), 46 deletions(-) diff --git a/reactos/lib/ddraw/main/ddraw.c b/reactos/lib/ddraw/main/ddraw.c index dbbf5d3b30c..295afe5c580 100644 --- a/reactos/lib/ddraw/main/ddraw.c +++ b/reactos/lib/ddraw/main/ddraw.c @@ -90,54 +90,11 @@ HRESULT WINAPI Main_DirectDraw_SetDisplayMode (LPDIRECTDRAW7 iface, DWORD dwWidt dwBPP, dwRefreshRate, dwFlags)) == DD_OK) { return ret; - } + } - if((ret = Hel_DirectDraw_SetDisplayMode(iface, dwWidth, dwHeight, - dwBPP, dwRefreshRate, dwFlags)) == DD_OK) - { - return ret; - } + ret = Hel_DirectDraw_SetDisplayMode(iface, dwWidth, dwHeight, dwBPP, dwRefreshRate, dwFlags); - return DDERR_NOTINITIALIZED; - - IDirectDrawImpl* This = (IDirectDrawImpl*)iface; - - // this only for exclusive mode - if(!(This->cooperative_level & DDSCL_EXCLUSIVE)) - return DDERR_NOEXCLUSIVEMODE; - - // change the resolution using normal WinAPI function - DEVMODE mode; - mode.dmSize = sizeof(mode); - mode.dmPelsWidth = dwWidth; - mode.dmPelsHeight = dwHeight; - mode.dmBitsPerPel = dwBPP; - mode.dmDisplayFrequency = dwRefreshRate; - mode.dmFields = 0; - - if(dwWidth) - mode.dmFields |= DM_PELSWIDTH; - if(dwHeight) - mode.dmFields |= DM_PELSHEIGHT; - if(dwBPP) - mode.dmFields |= DM_BITSPERPEL; - if(dwRefreshRate) - mode.dmFields |= DM_DISPLAYFREQUENCY; - - if (ChangeDisplaySettings(&mode, CDS_FULLSCREEN) != DISP_CHANGE_SUCCESSFUL) - return DDERR_UNSUPPORTEDMODE; - - // TODO: reactivate ddraw object, maximize window, set it in foreground - // and set excluive mode (if implemented by the driver) - - if(dwWidth) - This->Height = dwWidth; - if(dwHeight) - This->Width = dwHeight; - if(dwBPP) - This->Bpp = dwBPP; - - return DD_OK; + return ret; } ULONG WINAPI Main_DirectDraw_AddRef (LPDIRECTDRAW7 iface)