From 769d40e3c58651274b2310fc3c241666965e1622 Mon Sep 17 00:00:00 2001 From: Deve Date: Sat, 15 Dec 2018 22:50:00 +0100 Subject: [PATCH 1/6] Revert "Fix #3168" This reverts commit 59f29ca975974a9add5090984dd4354c48b226ef. --- src/karts/controller/local_player_controller.cpp | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/src/karts/controller/local_player_controller.cpp b/src/karts/controller/local_player_controller.cpp index 8c7e35fe1..d2cc59e7c 100644 --- a/src/karts/controller/local_player_controller.cpp +++ b/src/karts/controller/local_player_controller.cpp @@ -178,22 +178,10 @@ bool LocalPlayerController::action(PlayerAction action, int value, } } - // Check if skid key is pressed and if turn button is in disagreement - // with the current steering dominant, ignore the skid key press, see #3168 - if (action == PA_DRIFT && value != 0) - { - if ((!PlayerController::action(PA_STEER_LEFT, 0, /*dry_run*/true) && - m_controls->getSteer() < 0.0f) || - (!PlayerController::action(PA_STEER_RIGHT, 0, /*dry_run*/true) && - m_controls->getSteer() > 0.0f)) - return false; - } - // If this event does not change the control state (e.g. // it's a (auto) repeat event), do nothing. This especially // optimises traffic to the server and other clients. - if (!PlayerController::action(action, value, /*dry_run*/true)) - return false; + if (!PlayerController::action(action, value, /*dry_run*/true)) return false; // Register event with history if(!history->replayHistory()) From 24926bcb1d13122b23407478d24785c501ba2411 Mon Sep 17 00:00:00 2001 From: Deve Date: Sat, 15 Dec 2018 23:04:08 +0100 Subject: [PATCH 2/6] Avoid skidding in wrong direction. It was possible when kart speed was near getSkidMinSpeed() when you left up left/right key, because skidding key was autorepeating. --- src/karts/controller/player_controller.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/karts/controller/player_controller.cpp b/src/karts/controller/player_controller.cpp index 2875456a5..05f15ccda 100644 --- a/src/karts/controller/player_controller.cpp +++ b/src/karts/controller/player_controller.cpp @@ -222,15 +222,21 @@ bool PlayerController::action(PlayerAction action, int value, bool dry_run) break; case PA_DRIFT: if (value == 0) + { SET_OR_TEST_GETTER(SkidControl, KartControl::SC_NONE); - else + } + else if (m_controls->getSkidControl() == KartControl::SC_NONE) { if (m_steer_val == 0) + { SET_OR_TEST_GETTER(SkidControl, KartControl::SC_NO_DIRECTION); + } else + { SET_OR_TEST_GETTER(SkidControl, m_steer_val<0 ? KartControl::SC_RIGHT : KartControl::SC_LEFT ); + } } break; case PA_PAUSE_RACE: From 19c853949c8606bd8e357f4646c913c368be5685 Mon Sep 17 00:00:00 2001 From: Deve Date: Sat, 15 Dec 2018 23:57:37 +0100 Subject: [PATCH 3/6] Revert "Revert "Fix #3168"" This reverts commit 769d40e3c58651274b2310fc3c241666965e1622. --- src/karts/controller/local_player_controller.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/karts/controller/local_player_controller.cpp b/src/karts/controller/local_player_controller.cpp index d2cc59e7c..8c7e35fe1 100644 --- a/src/karts/controller/local_player_controller.cpp +++ b/src/karts/controller/local_player_controller.cpp @@ -178,10 +178,22 @@ bool LocalPlayerController::action(PlayerAction action, int value, } } + // Check if skid key is pressed and if turn button is in disagreement + // with the current steering dominant, ignore the skid key press, see #3168 + if (action == PA_DRIFT && value != 0) + { + if ((!PlayerController::action(PA_STEER_LEFT, 0, /*dry_run*/true) && + m_controls->getSteer() < 0.0f) || + (!PlayerController::action(PA_STEER_RIGHT, 0, /*dry_run*/true) && + m_controls->getSteer() > 0.0f)) + return false; + } + // If this event does not change the control state (e.g. // it's a (auto) repeat event), do nothing. This especially // optimises traffic to the server and other clients. - if (!PlayerController::action(action, value, /*dry_run*/true)) return false; + if (!PlayerController::action(action, value, /*dry_run*/true)) + return false; // Register event with history if(!history->replayHistory()) From 1a12f65c876e7a7a6e075427949e966e3bf09840 Mon Sep 17 00:00:00 2001 From: Deve Date: Sat, 15 Dec 2018 23:57:49 +0100 Subject: [PATCH 4/6] Revert "Avoid skidding in wrong direction." This reverts commit 24926bcb1d13122b23407478d24785c501ba2411. --- src/karts/controller/player_controller.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/karts/controller/player_controller.cpp b/src/karts/controller/player_controller.cpp index 05f15ccda..2875456a5 100644 --- a/src/karts/controller/player_controller.cpp +++ b/src/karts/controller/player_controller.cpp @@ -222,21 +222,15 @@ bool PlayerController::action(PlayerAction action, int value, bool dry_run) break; case PA_DRIFT: if (value == 0) - { SET_OR_TEST_GETTER(SkidControl, KartControl::SC_NONE); - } - else if (m_controls->getSkidControl() == KartControl::SC_NONE) + else { if (m_steer_val == 0) - { SET_OR_TEST_GETTER(SkidControl, KartControl::SC_NO_DIRECTION); - } else - { SET_OR_TEST_GETTER(SkidControl, m_steer_val<0 ? KartControl::SC_RIGHT : KartControl::SC_LEFT ); - } } break; case PA_PAUSE_RACE: From 093f815d2c9459fa81c82752e5cd9f35cefe08a1 Mon Sep 17 00:00:00 2001 From: Deve Date: Sun, 16 Dec 2018 21:57:19 +0100 Subject: [PATCH 5/6] Restore larger row height for android --- src/states_screens/online/server_selection.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/states_screens/online/server_selection.cpp b/src/states_screens/online/server_selection.cpp index 69db29a4a..7f9d9bfb0 100755 --- a/src/states_screens/online/server_selection.cpp +++ b/src/states_screens/online/server_selection.cpp @@ -140,8 +140,11 @@ void ServerSelection::init() m_searcher->clearListeners(); m_searcher->addListener(this); m_icon_bank->setScale((float)getHeight() / 15.0f / 128.0f); - m_server_list_widget->setIcons(m_icon_bank, - int(getHeight() / 15.0f)); + + int row_height = UserConfigParams::m_hidpi_enabled ? getHeight() / 12.0f + : getHeight() / 15.0f; + + m_server_list_widget->setIcons(m_icon_bank, row_height); m_sort_desc = false; /** Triggers the loading of the server list in the servers manager. */ refresh(true); From efd502c8082c77c978d6a03426fdbfa10ee57c33 Mon Sep 17 00:00:00 2001 From: Deve Date: Mon, 17 Dec 2018 00:36:12 +0100 Subject: [PATCH 6/6] Use larger list for android in two more places --- src/states_screens/ghost_replay_selection.cpp | 10 ++++++++-- src/states_screens/online/networking_lobby.cpp | 13 +++++++++++-- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/states_screens/ghost_replay_selection.cpp b/src/states_screens/ghost_replay_selection.cpp index 628c5a40b..2af82358b 100644 --- a/src/states_screens/ghost_replay_selection.cpp +++ b/src/states_screens/ghost_replay_selection.cpp @@ -19,6 +19,7 @@ #include "states_screens/ghost_replay_selection.hpp" #include "config/player_manager.hpp" +#include "config/user_config.hpp" #include "graphics/material.hpp" #include "guiengine/CGUISpriteBank.hpp" #include "karts/kart_properties.hpp" @@ -171,12 +172,17 @@ void GhostReplaySelection::init() { Screen::init(); m_cur_difficulty = race_manager->getDifficulty(); + + int icon_height = UserConfigParams::m_hidpi_enabled ? getHeight() / 15 + : getHeight() / 24; - int icon_height = getHeight()/24; + int row_height = UserConfigParams::m_hidpi_enabled ? getHeight() / 12 + : getHeight() / 24; + // 128 is the height of the image file m_icon_bank->setScale(icon_height/128.0f); m_icon_bank->setTargetIconSize(128, 128); - m_replay_list_widget->setIcons(m_icon_bank, (int)icon_height); + m_replay_list_widget->setIcons(m_icon_bank, (int)row_height); refresh(/*reload replay files*/ false, /* update columns */ true); } // init diff --git a/src/states_screens/online/networking_lobby.cpp b/src/states_screens/online/networking_lobby.cpp index a69ad445b..78fdc4448 100644 --- a/src/states_screens/online/networking_lobby.cpp +++ b/src/states_screens/online/networking_lobby.cpp @@ -129,8 +129,17 @@ void NetworkingLobby::loadedFromFile() m_icon_bank->addTextureAsSprite(icon_3); m_icon_bank->addTextureAsSprite(icon_4); m_icon_bank->addTextureAsSprite(icon_5); - const int screen_width = irr_driver->getFrameSize().Width; - m_icon_bank->setScale(screen_width > 1280 ? 0.4f : 0.25f); + + + if (UserConfigParams::m_hidpi_enabled) + { + m_icon_bank->setScale(getHeight() / 15.0f / 128.0f); + } + else + { + const int screen_width = irr_driver->getFrameSize().Width; + m_icon_bank->setScale(screen_width > 1280 ? 0.4f : 0.25f); + } } // loadedFromFile // ---------------------------------------------------------------------------