Remove unused code

This commit is contained in:
Benau 2020-07-12 10:26:37 +08:00
parent 8ede6dcaa7
commit f202bcd48c
3 changed files with 3 additions and 31 deletions

View File

@ -902,7 +902,7 @@ namespace UserConfigParams
PARAM_PREFIX IntUserConfigParam m_swap_interval PARAM_PREFIX IntUserConfigParam m_swap_interval
PARAM_DEFAULT( IntUserConfigParam(0, "swap_interval", PARAM_DEFAULT( IntUserConfigParam(0, "swap_interval",
&m_graphics_quality, &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_PREFIX BoolUserConfigParam m_motionblur
PARAM_DEFAULT( BoolUserConfigParam(false, PARAM_DEFAULT( BoolUserConfigParam(false,
"motionblur_enabled", &m_graphics_quality, "motionblur_enabled", &m_graphics_quality,

View File

@ -87,16 +87,6 @@ InputManager::InputManager() : m_mode(BOOTSTRAP),
m_timer_in_use = false; m_timer_in_use = false;
m_master_player_only = false; m_master_player_only = false;
m_timer = 0; 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) switch (event.type)
{ {
#if !defined(_IRR_COMPILE_WITH_SDL_DEVICE_)
case SDL_QUIT:
{
exit(-1);
break;
}
#endif
case SDL_JOYDEVICEADDED: case SDL_JOYDEVICEADDED:
{ {
std::unique_ptr<SDLController> c( std::unique_ptr<SDLController> c(
@ -181,12 +164,6 @@ void InputManager::update(float dt)
wiimote_manager->update(); wiimote_manager->update();
#endif #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) if(m_timer_in_use)
{ {
m_timer -= dt; m_timer -= dt;
@ -212,9 +189,6 @@ InputManager::~InputManager()
m_sdl_controller.clear(); m_sdl_controller.clear();
#endif #endif
delete m_device_manager; delete m_device_manager;
#if !defined(SERVER_ONLY) && !defined(_IRR_COMPILE_WITH_SDL_DEVICE_)
SDL_Quit();
#endif
} // ~InputManager } // ~InputManager
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------

View File

@ -225,8 +225,8 @@ void OptionsScreenVideo::init()
vsync->addLabel(_("Disabled")); vsync->addLabel(_("Disabled"));
//I18N: In the video options, full vertical sync (usually 60fps) //I18N: In the video options, full vertical sync (usually 60fps)
vsync->addLabel(_("Full")); vsync->addLabel(_("Full"));
//I18N: In the video options, half vertical sync (usually 30fps) if (UserConfigParams::m_swap_interval > 1)
vsync->addLabel(_("Half")); UserConfigParams::m_swap_interval = 1;
vsync->setValue(UserConfigParams::m_swap_interval); 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. //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. //I18N: in graphical options.
vsync_tooltip = vsync_tooltip + L"\n" + _("Full: one frame per monitor refresh"); vsync_tooltip = vsync_tooltip + L"\n" + _("Full: one frame per monitor refresh");
//I18N: in graphical options. //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_tooltip = vsync_tooltip + L"\n" + _("Vsync will not work if your drivers don't support it.");
vsync->setTooltip(vsync_tooltip); vsync->setTooltip(vsync_tooltip);