diff --git a/inc/main.h b/inc/main.h index f4d6eae..6b6f194 100644 --- a/inc/main.h +++ b/inc/main.h @@ -106,7 +106,7 @@ typedef struct IDirectDrawImpl BOOL fullscreen; BOOL maintas; BOOL noactivateapp; - BOOL hidemouse; + BOOL handlemouse; char shader[MAX_PATH]; BOOL wine; LONG minimized; diff --git a/src/main.c b/src/main.c index fbe39e8..f005473 100644 --- a/src/main.c +++ b/src/main.c @@ -571,7 +571,7 @@ HRESULT __stdcall ddraw_SetDisplayMode(IDirectDrawImpl *This, DWORD width, DWORD } } - if (!ddraw->hidemouse) + if (!ddraw->handlemouse) This->boxing = This->maintas = maintas = FALSE; This->render.viewport.width = This->render.width; @@ -960,7 +960,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) } } - if (!ddraw->hidemouse) + if (!ddraw->handlemouse) RedrawWindow(hWnd, NULL, NULL, RDW_INVALIDATE | RDW_ALLCHILDREN); return DefWindowProc(hWnd, uMsg, wParam, lParam); /* Carmageddon fix */ @@ -998,7 +998,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) InterlockedExchange(&ddraw->minimized, FALSE); } - if (!ddraw->hidemouse) + if (!ddraw->handlemouse) RedrawWindow(hWnd, NULL, NULL, RDW_INVALIDATE | RDW_ALLCHILDREN); } else if (wParam == WA_INACTIVE) @@ -1053,7 +1053,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { // let it pass through once (tiberian sun) static BOOL oneTime; - if (wParam && !oneTime && !ddraw->hidemouse && ddraw->noactivateapp) + if (wParam && !oneTime && !ddraw->handlemouse && ddraw->noactivateapp) { oneTime = TRUE; break; @@ -1166,13 +1166,13 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) //Workaround for invisible menu on Load/Save/Delete in Tiberian Sun case WM_PARENTNOTIFY: { - if (!ddraw->hidemouse && LOWORD(wParam) == WM_DESTROY) + if (!ddraw->handlemouse && LOWORD(wParam) == WM_DESTROY) redrawCount = 2; break; } case WM_PAINT: { - if (!ddraw->hidemouse && redrawCount > 0) + if (!ddraw->handlemouse && redrawCount > 0) { redrawCount--; RedrawWindow(hWnd, NULL, NULL, RDW_INVALIDATE | RDW_ALLCHILDREN); diff --git a/src/mouse.c b/src/mouse.c index 21417cf..1eb3952 100644 --- a/src/mouse.c +++ b/src/mouse.c @@ -124,7 +124,7 @@ BOOL WINAPI fake_ClipCursor(const RECT *lpRect) int WINAPI fake_ShowCursor(BOOL bShow) { - if (ddraw && !ddraw->hidemouse) + if (ddraw && !ddraw->handlemouse) return ShowCursor(bShow); return TRUE; @@ -132,7 +132,7 @@ int WINAPI fake_ShowCursor(BOOL bShow) HCURSOR WINAPI fake_SetCursor(HCURSOR hCursor) { - if (ddraw && !ddraw->hidemouse) + if (ddraw && !ddraw->handlemouse) return SetCursor(hCursor); return NULL; @@ -207,7 +207,7 @@ void mouse_lock() if (ddraw->devmode) { - if (ddraw->hidemouse) + if (ddraw->handlemouse) while(ShowCursor(FALSE) > 0); return; @@ -250,7 +250,7 @@ void mouse_lock() SetCursorPos(rc.left + ddraw->cursor.x, rc.top + ddraw->cursor.y - yAdjust); } - if (ddraw->hidemouse) + if (ddraw->handlemouse) { SetCapture(ddraw->hWnd); ClipCursor(&rc); @@ -276,7 +276,7 @@ void mouse_unlock() if (ddraw->devmode) { - if (ddraw->hidemouse) + if (ddraw->handlemouse) while(ShowCursor(TRUE) < 0); return; @@ -301,7 +301,7 @@ void mouse_unlock() ClientToScreen(ddraw->hWnd, &pt2); SetRect(&rc, pt.x, pt.y, pt2.x, pt2.y); - if (ddraw->hidemouse) + if (ddraw->handlemouse) { while (ShowCursor(TRUE) < 0); SetCursor(LoadCursor(NULL, IDC_ARROW)); diff --git a/src/render.c b/src/render.c index f446c05..6ddd363 100644 --- a/src/render.c +++ b/src/render.c @@ -645,7 +645,7 @@ static void Render() UseOpenGL = FALSE; } - if (!ddraw->hidemouse) + if (!ddraw->handlemouse) { ChildWindowExists = FALSE; EnumChildWindows(ddraw->hWnd, EnumChildProc, (LPARAM)ddraw->primary); diff --git a/src/render_d3d9.c b/src/render_d3d9.c index 9d0ce77..2a82042 100644 --- a/src/render_d3d9.c +++ b/src/render_d3d9.c @@ -376,7 +376,7 @@ DWORD WINAPI render_d3d9_main(void) } } - if (!ddraw->hidemouse) + if (!ddraw->handlemouse) { ChildWindowExists = FALSE; EnumChildWindows(ddraw->hWnd, EnumChildProc, (LPARAM)ddraw->primary); diff --git a/src/render_soft.c b/src/render_soft.c index 9c186c8..0728e32 100644 --- a/src/render_soft.c +++ b/src/render_soft.c @@ -66,7 +66,7 @@ DWORD WINAPI render_soft_main(void) if (ddraw->vhack) InterlockedExchange(&ddraw->incutscene, scaleCutscene); - if (!ddraw->hidemouse) + if (!ddraw->handlemouse) { ChildWindowExists = FALSE; EnumChildWindows(ddraw->hWnd, EnumChildProc, (LPARAM)ddraw->primary); diff --git a/src/settings.c b/src/settings.c index c73fc85..7c747c9 100644 --- a/src/settings.c +++ b/src/settings.c @@ -54,7 +54,7 @@ void Settings_Load() if ((ddraw->fullscreen = GetBool("fullscreen", FALSE))) WindowRect.left = WindowRect.top = -32000; - if (!(ddraw->hidemouse = GetBool("hidemouse", TRUE))) + if (!(ddraw->handlemouse = GetBool("handlemouse", TRUE))) ddraw->adjmouse = TRUE; if (GetBool("singlecpu", TRUE)) @@ -182,9 +182,11 @@ static void CreateSettingsIni() "border=true\n" "\n" "; Maintain aspect ratio\n" + "; Note: Works only for games that support 'handlemouse=true'\n" "maintas=false\n" "\n" "; Windowboxing / Integer Scaling\n" + "; Note: Works only for games that support 'handlemouse=true'\n" "boxing=false\n" "\n" "; Real rendering rate, -1 = screen rate, 0 = unlimited, n = cap (OpenGL / Direct3D only)\n" @@ -195,6 +197,7 @@ static void CreateSettingsIni() "\n" "; Automatic mouse sensitivity scaling\n" "; Note: Only works if stretching is enabled. Sensitivity will be adjusted according to the size of the window\n" + "; Note: Works only for games that support 'handlemouse=true'\n" "adjmouse=false\n" "\n" "; Enable C&C video resize hack - Stretches C&C cutscenes to fullscreen\n" @@ -222,8 +225,9 @@ static void CreateSettingsIni() "; Max game ticks per second, possible values: 1-1000 (Can be used to slow down a too fast running game)\n" "maxgameticks=0\n" "\n" - "; Hide/Show the mouse cursor on lock/unlock (Ctrl+Tab)\n" - "hidemouse=true\n" + "; Gives cnc-ddraw full control over the mouse cursor (required for adjmouse/boxing/maintas)\n" + "; Note: This option only works for games that draw their own cursor and must be disabled for all other games\n" + "handlemouse=true\n" "\n" "\n" "; Game specific settings - The following settings override all settings above, section name = executable name\n" @@ -244,19 +248,19 @@ static void CreateSettingsIni() "\n" "; Age of Empires\n" "[empires]\n" - "hidemouse=false\n" + "handlemouse=false\n" "\n" "; Age of Empires: The Rise of Rome\n" "[empiresx]\n" - "hidemouse=false\n" + "handlemouse=false\n" "\n" "; Age of Empires II\n" "[EMPIRES2]\n" - "hidemouse=false\n" + "handlemouse=false\n" "\n" "; Age of Empires II: The Conquerors\n" "[age2_x1]\n" - "hidemouse=false\n" + "handlemouse=false\n" "\n" "; Outlaws\n" "[olwin]\n" @@ -269,11 +273,11 @@ static void CreateSettingsIni() "\n" "; Star Wars: Galactic Battlegrounds\n" "[battlegrounds]\n" - "hidemouse=false\n" + "handlemouse=false\n" "\n" "; Star Wars: Galactic Battlegrounds: Clone Campaigns\n" "[battlegrounds_x1]\n" - "hidemouse=false\n" + "handlemouse=false\n" "\n" "; Carmageddon 2\n" "[Carma2_SW]\n" @@ -296,22 +300,22 @@ static void CreateSettingsIni() "; Command & Conquer: Tiberian Sun\n" "[game]\n" "noactivateapp=true\n" - "hidemouse=false\n" + "handlemouse=false\n" "\n" "; Command & Conquer: Tiberian Sun Online\n" "[ts-spawn]\n" "noactivateapp=true\n" - "hidemouse=false\n" + "handlemouse=false\n" "\n" "; Command & Conquer: Red Alert 2: Yuri's Revenge\n" "[gamemd]\n" "noactivateapp=true\n" - "hidemouse=false\n" + "handlemouse=false\n" "\n" "; Command & Conquer: Red Alert 2: Yuri's Revenge Online\n" "[gamemd-spawn]\n" "noactivateapp=true\n" - "hidemouse=false\n" + "handlemouse=false\n" "\n" , fh);