Allow disabling mouse hacks
This commit is contained in:
parent
d881b92c1c
commit
924a5254a8
3 changed files with 21 additions and 4 deletions
15
main.c
15
main.c
|
@ -537,6 +537,8 @@ HRESULT WINAPI DirectDrawCreate(GUID FAR* lpGUID, LPDIRECTDRAW FAR* lplpDD, IUnk
|
|||
"filter=nearest\n"
|
||||
"; mouse sensitivity scaling\n"
|
||||
"adjmouse=false\n"
|
||||
"; enable C&C/RA mouse hack\n"
|
||||
"mhack=true\n"
|
||||
, fh);
|
||||
fclose(fh);
|
||||
}
|
||||
|
@ -578,7 +580,8 @@ HRESULT WINAPI DirectDrawCreate(GUID FAR* lpGUID, LPDIRECTDRAW FAR* lplpDD, IUnk
|
|||
{
|
||||
This->render.filter = 0;
|
||||
}
|
||||
GetPrivateProfileStringA("ddraw", "adjmouse", "TRUE", tmp, sizeof(tmp), ini_path);
|
||||
|
||||
GetPrivateProfileStringA("ddraw", "adjmouse", "FALSE", tmp, sizeof(tmp), ini_path);
|
||||
if(tolower(tmp[0]) == 'y' || tolower(tmp[0]) == 't' || tmp[0] == '1')
|
||||
{
|
||||
This->adjmouse = TRUE;
|
||||
|
@ -588,6 +591,16 @@ HRESULT WINAPI DirectDrawCreate(GUID FAR* lpGUID, LPDIRECTDRAW FAR* lplpDD, IUnk
|
|||
This->adjmouse = FALSE;
|
||||
}
|
||||
|
||||
GetPrivateProfileStringA("ddraw", "mhack", "TRUE", tmp, sizeof(tmp), ini_path);
|
||||
if(tolower(tmp[0]) == 'y' || tolower(tmp[0]) == 't' || tmp[0] == '1')
|
||||
{
|
||||
This->mhack = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
This->mhack = FALSE;
|
||||
}
|
||||
|
||||
This->Ref = 0;
|
||||
ddraw_AddRef(This);
|
||||
|
||||
|
|
1
main.h
1
main.h
|
@ -69,6 +69,7 @@ typedef struct IDirectDrawImpl
|
|||
RECT cursorclip;
|
||||
BOOL locked;
|
||||
BOOL adjmouse;
|
||||
BOOL mhack;
|
||||
|
||||
BOOL key_ctrl;
|
||||
BOOL key_tab;
|
||||
|
|
9
mouse.c
9
mouse.c
|
@ -168,7 +168,10 @@ void mouse_unlock()
|
|||
|
||||
void mouse_init(HWND hWnd)
|
||||
{
|
||||
SetCursor(LoadCursor(NULL, IDC_ARROW));
|
||||
hack_iat(&hacks[0]);
|
||||
mouse_active = TRUE;
|
||||
if(ddraw->mhack)
|
||||
{
|
||||
SetCursor(LoadCursor(NULL, IDC_ARROW));
|
||||
hack_iat(&hacks[0]);
|
||||
mouse_active = TRUE;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue