Skip to content

Commit

Permalink
Fix mouse position on old clients in window mode
Browse files Browse the repository at this point in the history
  • Loading branch information
mittorn committed Dec 8, 2015
1 parent 94d29ea commit fd65658
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions engine/client/cl_game.c
Expand Up @@ -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;
}

/*
Expand All @@ -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;
}

/*
Expand Down

0 comments on commit fd65658

Please sign in to comment.