shithub: duke3d

Download patch

ref: c1dd18824e8726270ac5beade8ad8b4990e5bb41
parent: 2c339b744a4a310f6875c59c2a9d2d1b1b44f105
author: Jacob Moody <[email protected]>
date: Wed Feb 8 02:14:43 EST 2023

disable mouse grab when menu is open

--- a/Game/src/menues.c
+++ b/Game/src/menues.c
@@ -1404,6 +1404,8 @@
 
     if( (ps[myconnectindex].gm&MODE_MENU) == 0 )
     {
+        if(SDL_GetRelativeMouseMode() == SDL_FALSE)
+            SDL_SetRelativeMouseMode(SDL_TRUE);
         tiles[MAXTILES-3].lock = 1;
         return;
     }
@@ -1419,6 +1421,9 @@
         vscrn();
 
 	// printf("Current menu=%d, game mode=%d, last menu =%d\n", current_menu, ps[myconnectindex].gm, last_menu);
+
+    if(SDL_GetRelativeMouseMode() == SDL_TRUE)
+        SDL_SetRelativeMouseMode(SDL_FALSE);
 
     switch(current_menu)
     {