Ports: Remove SRB2 mouse hacks

This patch builds off the previous commit and removes the mouse hacks
entirely as they are not needed anymore.

With this, Sonic Robo Blast 2 now correctly locks the mouse inside the
game and makes for a much better playing experience! :^)
This commit is contained in:
Refrag 2024-02-18 15:25:02 +01:00 committed by Jelle Raaijmakers
parent 33b772a7fa
commit f77e91e0f0
Notes: sideshowbarker 2024-07-16 19:57:55 +09:00
3 changed files with 2 additions and 66 deletions

View file

@ -1,56 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Refrag <R3FR4GYT@gmail.com>
Date: Sun, 4 Feb 2024 17:45:17 +0100
Subject: [PATCH] i_video.c: Mouse hacks
This patch works aroud the SDL relative mouse implementation as it is not implemented in the port.
SRB2 relies on it quite heavily to make the mouse work, not having this unfortunately means that the mouse doesn't reset back to the center and will get stuck at the window borders. Ultimately, we would want this relative mouse implementation to have a proper mouse support.
Removing the calls to the SDL relative mouse felt like the best option for now as otherwise the console gets spammed with this "No relative mode implementation available" messsage.
---
src/sdl/i_video.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/sdl/i_video.c b/src/sdl/i_video.c
index 590d7d142..18002f94c 100644
--- a/src/sdl/i_video.c
+++ b/src/sdl/i_video.c
@@ -402,8 +402,8 @@ static void SDLdoGrabMouse(void)
{
SDL_ShowCursor(SDL_DISABLE);
SDL_SetWindowGrab(window, SDL_TRUE);
- if (SDL_SetRelativeMouseMode(SDL_TRUE) == 0) // already warps mouse if successful
- wrapmouseok = SDL_TRUE; // TODO: is wrapmouseok or HalfWarpMouse needed anymore?
+ //if (SDL_SetRelativeMouseMode(SDL_TRUE) == 0) // already warps mouse if successful
+ wrapmouseok = SDL_TRUE; // TODO: is wrapmouseok or HalfWarpMouse needed anymore?
}
static void SDLdoUngrabMouse(void)
@@ -411,7 +411,7 @@ static void SDLdoUngrabMouse(void)
SDL_ShowCursor(SDL_ENABLE);
SDL_SetWindowGrab(window, SDL_FALSE);
wrapmouseok = SDL_FALSE;
- SDL_SetRelativeMouseMode(SDL_FALSE);
+ //SDL_SetRelativeMouseMode(SDL_FALSE);
}
void SDLforceUngrabMouse(void)
@@ -701,8 +701,8 @@ static void Impl_HandleMouseMotionEvent(SDL_MouseMotionEvent evt)
// If using relative mouse mode, don't post an event_t just now,
// add on the offsets so we can make an overall event later.
- if (SDL_GetRelativeMouseMode())
- {
+ //if (SDL_GetRelativeMouseMode())
+ //{
if (SDL_GetMouseFocus() == window && SDL_GetKeyboardFocus() == window)
{
mousemovex += evt.xrel;
@@ -711,7 +711,7 @@ static void Impl_HandleMouseMotionEvent(SDL_MouseMotionEvent evt)
}
firstmove = false;
return;
- }
+ //}
// If the event is from warping the pointer to middle
// of the screen then ignore it.

View file

@ -21,17 +21,9 @@ Disable Console Variables value checker sad path
For some reason, the value checker for console variables seems to not behave properly even with the default console variables value.
Disabling the error path resolves this issue and the game still works fine without it.
## `0004-i_video.c-mouse-hacks.patch`
i_video.c: Mouse hacks
This patch works aroud the SDL relative mouse implementation as it is not implemented in the port.
SRB2 relies on it quite heavily to make the mouse work, not having this unfortunately means that the mouse doesn't reset back to the center and will get stuck at the window borders. Ultimately, we would want this relative mouse implementation to have a proper mouse support.
Removing the calls to the SDL relative mouse felt like the best option for now as otherwise the console gets spammed with this "No relative mode implementation available" messsage.
## `0005-i_system.c-hacks.patch`
## `0004-i_system.c-hacks.patch`
i_system.c hacks
This patch disables / removes some code to get the game to build without issues.
These don't seem to matter much anyway as the game still runs.
These don't seem to matter much anyway as the game still runs.