From ff5f416d359dfc5b18f6169dd2fa20cd9b22e787 Mon Sep 17 00:00:00 2001 From: bones_was_here Date: Tue, 16 Apr 2024 06:06:54 +1000 Subject: [PATCH] vid: clean up some globals Fixes vid_stick_mouse assuming window width and height couldn't change Signed-off-by: bones_was_here --- vid.h | 2 -- vid_sdl.c | 8 ++------ 2 files changed, 2 insertions(+), 8 deletions(-) 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; -- 2.39.2