Add 'devmode' ini variable for Nyerguds
This commit is contained in:
parent
924a5254a8
commit
40f196bc8f
2 changed files with 21 additions and 3 deletions
19
main.c
19
main.c
|
@ -216,7 +216,10 @@ HRESULT __stdcall ddraw_SetDisplayMode(IDirectDrawImpl *This, DWORD width, DWORD
|
|||
else
|
||||
{
|
||||
SetWindowPos(This->hWnd, HWND_TOPMOST, 0, 0, This->render.width, This->render.height, SWP_SHOWWINDOW);
|
||||
if(!This->devmode)
|
||||
{
|
||||
SendMessage(This->hWnd, WM_WINDOWPOSCHANGED, 0, 0);
|
||||
}
|
||||
|
||||
mouse_lock();
|
||||
|
||||
|
@ -231,7 +234,7 @@ HRESULT __stdcall ddraw_SetDisplayMode(IDirectDrawImpl *This, DWORD width, DWORD
|
|||
This->render.mode.dmBitsPerPel = This->render.bpp;
|
||||
}
|
||||
|
||||
if(ChangeDisplaySettings(&This->render.mode, CDS_FULLSCREEN) != DISP_CHANGE_SUCCESSFUL)
|
||||
if(!This->devmode && ChangeDisplaySettings(&This->render.mode, CDS_FULLSCREEN) != DISP_CHANGE_SUCCESSFUL)
|
||||
{
|
||||
This->render.run = FALSE;
|
||||
return DDERR_INVALIDMODE;
|
||||
|
@ -384,7 +387,10 @@ HRESULT __stdcall ddraw_SetCooperativeLevel(IDirectDrawImpl *This, HWND hWnd, DW
|
|||
mouse_init(hWnd);
|
||||
|
||||
This->WndProc = (LRESULT CALLBACK (*)(HWND, UINT, WPARAM, LPARAM))GetWindowLong(This->hWnd, GWL_WNDPROC);
|
||||
if(!This->devmode)
|
||||
{
|
||||
SetWindowLong(This->hWnd, GWL_WNDPROC, (LONG)WndProc);
|
||||
}
|
||||
|
||||
return DD_OK;
|
||||
}
|
||||
|
@ -601,6 +607,17 @@ HRESULT WINAPI DirectDrawCreate(GUID FAR* lpGUID, LPDIRECTDRAW FAR* lplpDD, IUnk
|
|||
This->mhack = FALSE;
|
||||
}
|
||||
|
||||
GetPrivateProfileStringA("ddraw", "devmode", "FALSE", tmp, sizeof(tmp), ini_path);
|
||||
if(tolower(tmp[0]) == 'y' || tolower(tmp[0]) == 't' || tmp[0] == '1')
|
||||
{
|
||||
This->devmode = TRUE;
|
||||
This->mhack = FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
This->devmode = FALSE;
|
||||
}
|
||||
|
||||
This->Ref = 0;
|
||||
ddraw_AddRef(This);
|
||||
|
||||
|
|
1
main.h
1
main.h
|
@ -70,6 +70,7 @@ typedef struct IDirectDrawImpl
|
|||
BOOL locked;
|
||||
BOOL adjmouse;
|
||||
BOOL mhack;
|
||||
BOOL devmode;
|
||||
|
||||
BOOL key_ctrl;
|
||||
BOOL key_tab;
|
||||
|
|
Loading…
Reference in a new issue