From fd65658be026011967f9c476b5726ccf7218f61f Mon Sep 17 00:00:00 2001 From: mittorn Date: Wed, 9 Dec 2015 02:32:57 +0600 Subject: [PATCH] Fix mouse position on old clients in window mode --- engine/client/cl_game.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/engine/client/cl_game.c b/engine/client/cl_game.c index f168d4c00..1415e488e 100644 --- a/engine/client/cl_game.c +++ b/engine/client/cl_game.c @@ -1774,7 +1774,11 @@ GetWindowCenterX */ static int pfnGetWindowCenterX( void ) { - return host.window_center_x; + int x = 0; +#ifdef XASH_SDL + SDL_GetWindowPosition( host.hWnd, &x, NULL ); +#endif + return host.window_center_x + x; } /* @@ -1785,7 +1789,11 @@ GetWindowCenterY */ static int pfnGetWindowCenterY( void ) { - return host.window_center_y; + int y = 0; +#ifdef XASH_SDL + SDL_GetWindowPosition( host.hWnd, NULL, &y ); +#endif + return host.window_center_y + y; } /*