From f202bcd48cad19b6231c188fce6d90d95f682c4f Mon Sep 17 00:00:00 2001 From: Benau Date: Sun, 12 Jul 2020 10:26:37 +0800 Subject: [PATCH] Remove unused code --- src/config/user_config.hpp | 2 +- src/input/input_manager.cpp | 26 ------------------- .../options/options_screen_video.cpp | 6 ++--- 3 files changed, 3 insertions(+), 31 deletions(-) diff --git a/src/config/user_config.hpp b/src/config/user_config.hpp index 2b26819ef..d9b4c13a4 100644 --- a/src/config/user_config.hpp +++ b/src/config/user_config.hpp @@ -902,7 +902,7 @@ namespace UserConfigParams PARAM_PREFIX IntUserConfigParam m_swap_interval PARAM_DEFAULT( IntUserConfigParam(0, "swap_interval", &m_graphics_quality, - "Swap interval for vsync: 0 = disabled, 1 = full, 2 = half") ); + "Swap interval for vsync: 0 = disabled, 1 = full") ); PARAM_PREFIX BoolUserConfigParam m_motionblur PARAM_DEFAULT( BoolUserConfigParam(false, "motionblur_enabled", &m_graphics_quality, diff --git a/src/input/input_manager.cpp b/src/input/input_manager.cpp index 46422a744..4fe67eb88 100644 --- a/src/input/input_manager.cpp +++ b/src/input/input_manager.cpp @@ -87,16 +87,6 @@ InputManager::InputManager() : m_mode(BOOTSTRAP), m_timer_in_use = false; m_master_player_only = false; m_timer = 0; -#if !defined(SERVER_ONLY) && !defined(_IRR_COMPILE_WITH_SDL_DEVICE_) - SDL_SetMainReady(); - SDL_SetHint(SDL_HINT_NO_SIGNAL_HANDLERS, "1"); - SDL_SetHint(SDL_HINT_ACCELEROMETER_AS_JOYSTICK, "0"); - if (SDL_Init(SDL_INIT_GAMECONTROLLER) != 0) - { - Log::error("InputManager", "Unable to initialize SDL: %s", - SDL_GetError()); - } -#endif } // ----------------------------------------------------------------------------- @@ -115,13 +105,6 @@ void InputManager::handleJoystick(SDL_Event& event) { switch (event.type) { -#if !defined(_IRR_COMPILE_WITH_SDL_DEVICE_) - case SDL_QUIT: - { - exit(-1); - break; - } -#endif case SDL_JOYDEVICEADDED: { std::unique_ptr c( @@ -181,12 +164,6 @@ void InputManager::update(float dt) wiimote_manager->update(); #endif -#if !defined(SERVER_ONLY) && !defined(_IRR_COMPILE_WITH_SDL_DEVICE_) - SDL_Event event; - while (SDL_PollEvent(&event)) - handleJoystick(event); -#endif - if(m_timer_in_use) { m_timer -= dt; @@ -212,9 +189,6 @@ InputManager::~InputManager() m_sdl_controller.clear(); #endif delete m_device_manager; -#if !defined(SERVER_ONLY) && !defined(_IRR_COMPILE_WITH_SDL_DEVICE_) - SDL_Quit(); -#endif } // ~InputManager //----------------------------------------------------------------------------- diff --git a/src/states_screens/options/options_screen_video.cpp b/src/states_screens/options/options_screen_video.cpp index 40fa15a0c..b87b71e92 100644 --- a/src/states_screens/options/options_screen_video.cpp +++ b/src/states_screens/options/options_screen_video.cpp @@ -225,8 +225,8 @@ void OptionsScreenVideo::init() vsync->addLabel(_("Disabled")); //I18N: In the video options, full vertical sync (usually 60fps) vsync->addLabel(_("Full")); - //I18N: In the video options, half vertical sync (usually 30fps) - vsync->addLabel(_("Half")); + if (UserConfigParams::m_swap_interval > 1) + UserConfigParams::m_swap_interval = 1; vsync->setValue(UserConfigParams::m_swap_interval); //I18N: in graphical options. The \n is a newline character, place it where appropriate, two can be used if required. @@ -235,8 +235,6 @@ void OptionsScreenVideo::init() //I18N: in graphical options. vsync_tooltip = vsync_tooltip + L"\n" + _("Full: one frame per monitor refresh"); //I18N: in graphical options. - vsync_tooltip = vsync_tooltip + L"\n" + _("Half: one frame every two monitor refreshes"); - //I18N: in graphical options. vsync_tooltip = vsync_tooltip + L"\n" + _("Vsync will not work if your drivers don't support it."); vsync->setTooltip(vsync_tooltip);