1
0
mirror of https://github.com/FunkyFr3sh/cnc-ddraw.git synced 2025-03-24 17:49:52 +01:00

rename hidemouse to handlemouse since it got a lot more functionality now

This commit is contained in:
FunkyFr3sh 2018-11-16 08:58:39 +01:00
parent ec435d21d3
commit 55328cb497
7 changed files with 33 additions and 29 deletions

View File

@ -106,7 +106,7 @@ typedef struct IDirectDrawImpl
BOOL fullscreen; BOOL fullscreen;
BOOL maintas; BOOL maintas;
BOOL noactivateapp; BOOL noactivateapp;
BOOL hidemouse; BOOL handlemouse;
char shader[MAX_PATH]; char shader[MAX_PATH];
BOOL wine; BOOL wine;
LONG minimized; LONG minimized;

View File

@ -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->boxing = This->maintas = maintas = FALSE;
This->render.viewport.width = This->render.width; 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); RedrawWindow(hWnd, NULL, NULL, RDW_INVALIDATE | RDW_ALLCHILDREN);
return DefWindowProc(hWnd, uMsg, wParam, lParam); /* Carmageddon fix */ 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); InterlockedExchange(&ddraw->minimized, FALSE);
} }
if (!ddraw->hidemouse) if (!ddraw->handlemouse)
RedrawWindow(hWnd, NULL, NULL, RDW_INVALIDATE | RDW_ALLCHILDREN); RedrawWindow(hWnd, NULL, NULL, RDW_INVALIDATE | RDW_ALLCHILDREN);
} }
else if (wParam == WA_INACTIVE) 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) // let it pass through once (tiberian sun)
static BOOL oneTime; static BOOL oneTime;
if (wParam && !oneTime && !ddraw->hidemouse && ddraw->noactivateapp) if (wParam && !oneTime && !ddraw->handlemouse && ddraw->noactivateapp)
{ {
oneTime = TRUE; oneTime = TRUE;
break; 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 //Workaround for invisible menu on Load/Save/Delete in Tiberian Sun
case WM_PARENTNOTIFY: case WM_PARENTNOTIFY:
{ {
if (!ddraw->hidemouse && LOWORD(wParam) == WM_DESTROY) if (!ddraw->handlemouse && LOWORD(wParam) == WM_DESTROY)
redrawCount = 2; redrawCount = 2;
break; break;
} }
case WM_PAINT: case WM_PAINT:
{ {
if (!ddraw->hidemouse && redrawCount > 0) if (!ddraw->handlemouse && redrawCount > 0)
{ {
redrawCount--; redrawCount--;
RedrawWindow(hWnd, NULL, NULL, RDW_INVALIDATE | RDW_ALLCHILDREN); RedrawWindow(hWnd, NULL, NULL, RDW_INVALIDATE | RDW_ALLCHILDREN);

View File

@ -124,7 +124,7 @@ BOOL WINAPI fake_ClipCursor(const RECT *lpRect)
int WINAPI fake_ShowCursor(BOOL bShow) int WINAPI fake_ShowCursor(BOOL bShow)
{ {
if (ddraw && !ddraw->hidemouse) if (ddraw && !ddraw->handlemouse)
return ShowCursor(bShow); return ShowCursor(bShow);
return TRUE; return TRUE;
@ -132,7 +132,7 @@ int WINAPI fake_ShowCursor(BOOL bShow)
HCURSOR WINAPI fake_SetCursor(HCURSOR hCursor) HCURSOR WINAPI fake_SetCursor(HCURSOR hCursor)
{ {
if (ddraw && !ddraw->hidemouse) if (ddraw && !ddraw->handlemouse)
return SetCursor(hCursor); return SetCursor(hCursor);
return NULL; return NULL;
@ -207,7 +207,7 @@ void mouse_lock()
if (ddraw->devmode) if (ddraw->devmode)
{ {
if (ddraw->hidemouse) if (ddraw->handlemouse)
while(ShowCursor(FALSE) > 0); while(ShowCursor(FALSE) > 0);
return; return;
@ -250,7 +250,7 @@ void mouse_lock()
SetCursorPos(rc.left + ddraw->cursor.x, rc.top + ddraw->cursor.y - yAdjust); SetCursorPos(rc.left + ddraw->cursor.x, rc.top + ddraw->cursor.y - yAdjust);
} }
if (ddraw->hidemouse) if (ddraw->handlemouse)
{ {
SetCapture(ddraw->hWnd); SetCapture(ddraw->hWnd);
ClipCursor(&rc); ClipCursor(&rc);
@ -276,7 +276,7 @@ void mouse_unlock()
if (ddraw->devmode) if (ddraw->devmode)
{ {
if (ddraw->hidemouse) if (ddraw->handlemouse)
while(ShowCursor(TRUE) < 0); while(ShowCursor(TRUE) < 0);
return; return;
@ -301,7 +301,7 @@ void mouse_unlock()
ClientToScreen(ddraw->hWnd, &pt2); ClientToScreen(ddraw->hWnd, &pt2);
SetRect(&rc, pt.x, pt.y, pt2.x, pt2.y); SetRect(&rc, pt.x, pt.y, pt2.x, pt2.y);
if (ddraw->hidemouse) if (ddraw->handlemouse)
{ {
while (ShowCursor(TRUE) < 0); while (ShowCursor(TRUE) < 0);
SetCursor(LoadCursor(NULL, IDC_ARROW)); SetCursor(LoadCursor(NULL, IDC_ARROW));

View File

@ -645,7 +645,7 @@ static void Render()
UseOpenGL = FALSE; UseOpenGL = FALSE;
} }
if (!ddraw->hidemouse) if (!ddraw->handlemouse)
{ {
ChildWindowExists = FALSE; ChildWindowExists = FALSE;
EnumChildWindows(ddraw->hWnd, EnumChildProc, (LPARAM)ddraw->primary); EnumChildWindows(ddraw->hWnd, EnumChildProc, (LPARAM)ddraw->primary);

View File

@ -376,7 +376,7 @@ DWORD WINAPI render_d3d9_main(void)
} }
} }
if (!ddraw->hidemouse) if (!ddraw->handlemouse)
{ {
ChildWindowExists = FALSE; ChildWindowExists = FALSE;
EnumChildWindows(ddraw->hWnd, EnumChildProc, (LPARAM)ddraw->primary); EnumChildWindows(ddraw->hWnd, EnumChildProc, (LPARAM)ddraw->primary);

View File

@ -66,7 +66,7 @@ DWORD WINAPI render_soft_main(void)
if (ddraw->vhack) if (ddraw->vhack)
InterlockedExchange(&ddraw->incutscene, scaleCutscene); InterlockedExchange(&ddraw->incutscene, scaleCutscene);
if (!ddraw->hidemouse) if (!ddraw->handlemouse)
{ {
ChildWindowExists = FALSE; ChildWindowExists = FALSE;
EnumChildWindows(ddraw->hWnd, EnumChildProc, (LPARAM)ddraw->primary); EnumChildWindows(ddraw->hWnd, EnumChildProc, (LPARAM)ddraw->primary);

View File

@ -54,7 +54,7 @@ void Settings_Load()
if ((ddraw->fullscreen = GetBool("fullscreen", FALSE))) if ((ddraw->fullscreen = GetBool("fullscreen", FALSE)))
WindowRect.left = WindowRect.top = -32000; WindowRect.left = WindowRect.top = -32000;
if (!(ddraw->hidemouse = GetBool("hidemouse", TRUE))) if (!(ddraw->handlemouse = GetBool("handlemouse", TRUE)))
ddraw->adjmouse = TRUE; ddraw->adjmouse = TRUE;
if (GetBool("singlecpu", TRUE)) if (GetBool("singlecpu", TRUE))
@ -182,9 +182,11 @@ static void CreateSettingsIni()
"border=true\n" "border=true\n"
"\n" "\n"
"; Maintain aspect ratio\n" "; Maintain aspect ratio\n"
"; Note: Works only for games that support 'handlemouse=true'\n"
"maintas=false\n" "maintas=false\n"
"\n" "\n"
"; Windowboxing / Integer Scaling\n" "; Windowboxing / Integer Scaling\n"
"; Note: Works only for games that support 'handlemouse=true'\n"
"boxing=false\n" "boxing=false\n"
"\n" "\n"
"; Real rendering rate, -1 = screen rate, 0 = unlimited, n = cap (OpenGL / Direct3D only)\n" "; Real rendering rate, -1 = screen rate, 0 = unlimited, n = cap (OpenGL / Direct3D only)\n"
@ -195,6 +197,7 @@ static void CreateSettingsIni()
"\n" "\n"
"; Automatic mouse sensitivity scaling\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: 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" "adjmouse=false\n"
"\n" "\n"
"; Enable C&C video resize hack - Stretches C&C cutscenes to fullscreen\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" "; Max game ticks per second, possible values: 1-1000 (Can be used to slow down a too fast running game)\n"
"maxgameticks=0\n" "maxgameticks=0\n"
"\n" "\n"
"; Hide/Show the mouse cursor on lock/unlock (Ctrl+Tab)\n" "; Gives cnc-ddraw full control over the mouse cursor (required for adjmouse/boxing/maintas)\n"
"hidemouse=true\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"
"\n" "\n"
"; Game specific settings - The following settings override all settings above, section name = executable name\n" "; Game specific settings - The following settings override all settings above, section name = executable name\n"
@ -244,19 +248,19 @@ static void CreateSettingsIni()
"\n" "\n"
"; Age of Empires\n" "; Age of Empires\n"
"[empires]\n" "[empires]\n"
"hidemouse=false\n" "handlemouse=false\n"
"\n" "\n"
"; Age of Empires: The Rise of Rome\n" "; Age of Empires: The Rise of Rome\n"
"[empiresx]\n" "[empiresx]\n"
"hidemouse=false\n" "handlemouse=false\n"
"\n" "\n"
"; Age of Empires II\n" "; Age of Empires II\n"
"[EMPIRES2]\n" "[EMPIRES2]\n"
"hidemouse=false\n" "handlemouse=false\n"
"\n" "\n"
"; Age of Empires II: The Conquerors\n" "; Age of Empires II: The Conquerors\n"
"[age2_x1]\n" "[age2_x1]\n"
"hidemouse=false\n" "handlemouse=false\n"
"\n" "\n"
"; Outlaws\n" "; Outlaws\n"
"[olwin]\n" "[olwin]\n"
@ -269,11 +273,11 @@ static void CreateSettingsIni()
"\n" "\n"
"; Star Wars: Galactic Battlegrounds\n" "; Star Wars: Galactic Battlegrounds\n"
"[battlegrounds]\n" "[battlegrounds]\n"
"hidemouse=false\n" "handlemouse=false\n"
"\n" "\n"
"; Star Wars: Galactic Battlegrounds: Clone Campaigns\n" "; Star Wars: Galactic Battlegrounds: Clone Campaigns\n"
"[battlegrounds_x1]\n" "[battlegrounds_x1]\n"
"hidemouse=false\n" "handlemouse=false\n"
"\n" "\n"
"; Carmageddon 2\n" "; Carmageddon 2\n"
"[Carma2_SW]\n" "[Carma2_SW]\n"
@ -296,22 +300,22 @@ static void CreateSettingsIni()
"; Command & Conquer: Tiberian Sun\n" "; Command & Conquer: Tiberian Sun\n"
"[game]\n" "[game]\n"
"noactivateapp=true\n" "noactivateapp=true\n"
"hidemouse=false\n" "handlemouse=false\n"
"\n" "\n"
"; Command & Conquer: Tiberian Sun Online\n" "; Command & Conquer: Tiberian Sun Online\n"
"[ts-spawn]\n" "[ts-spawn]\n"
"noactivateapp=true\n" "noactivateapp=true\n"
"hidemouse=false\n" "handlemouse=false\n"
"\n" "\n"
"; Command & Conquer: Red Alert 2: Yuri's Revenge\n" "; Command & Conquer: Red Alert 2: Yuri's Revenge\n"
"[gamemd]\n" "[gamemd]\n"
"noactivateapp=true\n" "noactivateapp=true\n"
"hidemouse=false\n" "handlemouse=false\n"
"\n" "\n"
"; Command & Conquer: Red Alert 2: Yuri's Revenge Online\n" "; Command & Conquer: Red Alert 2: Yuri's Revenge Online\n"
"[gamemd-spawn]\n" "[gamemd-spawn]\n"
"noactivateapp=true\n" "noactivateapp=true\n"
"hidemouse=false\n" "handlemouse=false\n"
"\n" "\n"
, fh); , fh);