ref: a06d40ddad9fc1445d25821f94afeded981fd055
parent: f6dd57602af20eaf9a4094a80bb60452f2593b50
author: Simon Howard <[email protected]>
date: Tue Jan 5 18:53:03 EST 2016
video: Fix jump after mouse grab. Call SDL_GetRelativeMouseState() after setting mouse grab to clear out any artificial mouse movement generated by the mode switch. This stops the player from turning abruptly when toggling the main menu.
--- a/src/i_video.c
+++ b/src/i_video.c
@@ -238,6 +238,7 @@
// When the cursor is hidden, grab the input.
// Relative mode implicitly hides the cursor.
SDL_SetRelativeMouseMode(!show);
+ SDL_GetRelativeMouseState(NULL, NULL);
}
}