From: bones_was_here Date: Mon, 15 Apr 2024 20:06:54 +0000 (+1000) Subject: vid: clean up some globals X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=ff5f416d359dfc5b18f6169dd2fa20cd9b22e787;p=xonotic%2Fdarkplaces.git vid: clean up some globals Fixes vid_stick_mouse assuming window width and height couldn't change Signed-off-by: bones_was_here --- diff --git a/vid.h b/vid.h index e360c712..182d6e38 100644 --- a/vid.h +++ b/vid.h @@ -95,8 +95,6 @@ typedef struct viddef_s // global video state extern viddef_t vid; -extern void (*vid_menudrawfn)(void); -extern void (*vid_menukeyfn)(int key); #define MAXJOYAXIS 16 // if this is changed, the corresponding code in vid_shared.c must be updated diff --git a/vid_sdl.c b/vid_sdl.c index 742dd0b1..2a9bb0c3 100644 --- a/vid_sdl.c +++ b/vid_sdl.c @@ -77,9 +77,6 @@ static cvar_t joy_sdl2_trigger_deadzone = {CF_ARCHIVE | CF_CLIENT, "joy_sdl2_tri static cvar_t *steelstorm_showing_map = NULL; // detect but do not create the cvar static cvar_t *steelstorm_showing_mousecursor = NULL; // detect but do not create the cvar -static int win_half_width = 50; -static int win_half_height = 50; - static SDL_GLContext context; static SDL_Window *window; @@ -981,6 +978,8 @@ void IN_Move( void ) { // have the mouse stuck in the middle, example use: prevent expose effect of beryl during the game when not using // window grabbing. --blub + int win_half_width = vid.mode.width>>1; + int win_half_height = vid.mode.height>>1; // we need 2 frames to initialize the center position if(!stuck) @@ -1679,9 +1678,6 @@ static qbool VID_InitModeGL(viddef_mode_t *mode) vid.yPos = SDL_WINDOWPOS_CENTERED_DISPLAY(vid.displayindex); vid_wmborder_waiting = vid_wmborderless = false; - win_half_width = mode->width>>1; - win_half_height = mode->height>>1; - if(vid_resizable.integer) windowflags |= SDL_WINDOW_RESIZABLE;