diff --git a/source/build/include/baselayer.h b/source/build/include/baselayer.h index f4f8fe953..1e3bfd363 100644 --- a/source/build/include/baselayer.h +++ b/source/build/include/baselayer.h @@ -25,7 +25,6 @@ extern int32_t newaspect_enable; extern int32_t r_fpgrouscan; extern int32_t setaspect_new_use_dimen; extern int32_t xres, yres, bpp; -extern double refreshfreq; int32_t videoCheckMode(int32_t *x, int32_t *y, int32_t c, int32_t fs, int32_t forced); int32_t videoSetMode(int32_t x, int32_t y, int32_t c, int32_t fs); diff --git a/source/common/engine/i_interface.cpp b/source/common/engine/i_interface.cpp index 803317a81..fbeb4dfaa 100644 --- a/source/common/engine/i_interface.cpp +++ b/source/common/engine/i_interface.cpp @@ -2,7 +2,6 @@ // Some global engine variables taken out of the backend code. SystemCallbacks *sysCallbacks; -double refreshfreq; FString endoomName; bool batchrun; diff --git a/source/common/platform/posix/sdl/sdlglvideo.cpp b/source/common/platform/posix/sdl/sdlglvideo.cpp index 857abe981..e9ef2267c 100644 --- a/source/common/platform/posix/sdl/sdlglvideo.cpp +++ b/source/common/platform/posix/sdl/sdlglvideo.cpp @@ -75,7 +75,6 @@ // PRIVATE FUNCTION PROTOTYPES --------------------------------------------- // EXTERNAL DATA DECLARATIONS ---------------------------------------------- -extern double refreshfreq; extern IVideo *Video; EXTERN_CVAR (Int, vid_adapter) @@ -451,19 +450,6 @@ SDLVideo::SDLVideo () Priv::CreateWindow(SDL_WINDOW_HIDDEN); } #endif - - // Get refresh rate for current display. - SDL_DisplayMode display; - - if(SDL_GetCurrentDisplayMode(vid_adapter, &display) == 0) - { - refreshfreq = display.refresh_rate; - } - else - { - fprintf(stderr, "Failed to get refresh rate: %s\n", SDL_GetError()); - return; - } } SDLVideo::~SDLVideo () diff --git a/source/common/platform/win32/base_sysfb.cpp b/source/common/platform/win32/base_sysfb.cpp index d470bd5fa..9455dbae6 100644 --- a/source/common/platform/win32/base_sysfb.cpp +++ b/source/common/platform/win32/base_sysfb.cpp @@ -58,7 +58,6 @@ extern "C" { __declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001; __declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1; } -void GetRefreshRate(HWND hWnd); EXTERN_CVAR(Int, vid_defwidth) EXTERN_CVAR(Int, vid_defheight) @@ -339,7 +338,6 @@ void SystemBaseFrameBuffer::PositionWindow(bool fullscreen, bool initialcall) } m_Fullscreen = fullscreen; SetSize(GetClientWidth(), GetClientHeight()); - GetRefreshRate(Window); } //========================================================================== diff --git a/source/common/platform/win32/i_input.cpp b/source/common/platform/win32/i_input.cpp index 8e9af9fa6..c9cc13609 100644 --- a/source/common/platform/win32/i_input.cpp +++ b/source/common/platform/win32/i_input.cpp @@ -135,8 +135,7 @@ LPDIRECTINPUT g_pdi3; extern bool AppActive; int SessionState = 0; -int BlockMouseMove; -extern double refreshfreq; +int BlockMouseMove; static bool EventHandlerResultForNativeMouse; @@ -345,22 +344,6 @@ bool CallHook(FInputDevice *device, HWND hWnd, UINT message, WPARAM wParam, LPAR return device->WndProcHook(hWnd, message, wParam, lParam, result); } -void GetRefreshRate(HWND hWnd) -{ - HMONITOR moni = MonitorFromWindow(hWnd, MONITOR_DEFAULTTONEAREST); - MONITORINFOEXA moninf; - moninf.cbSize = sizeof(moninf); - if (GetMonitorInfoA(moni, (LPMONITORINFO)&moninf)) - { - DEVMODEA dm; - dm.dmSize = sizeof(DEVMODEA); - if (EnumDisplaySettingsA(moninf.szDevice, ENUM_CURRENT_SETTINGS, &dm)) - { - refreshfreq = dm.dmDisplayFrequency; - } - } -} - LRESULT CALLBACK WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { LRESULT result; @@ -446,7 +429,6 @@ LRESULT CALLBACK WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) break; case WM_SETFOCUS: - GetRefreshRate(hWnd); I_CheckNativeMouse (false, EventHandlerResultForNativeMouse); // This cannot call the event handler. Doing it from here is unsafe. break; @@ -491,8 +473,6 @@ LRESULT CALLBACK WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) break; case WM_DISPLAYCHANGE: - GetRefreshRate(hWnd); - // fall through case WM_STYLECHANGED: return DefWindowProc(hWnd, message, wParam, lParam);