From 7538f36bed702bc34614d54512f1c0f13fb5385f Mon Sep 17 00:00:00 2001 From: Benau Date: Thu, 26 Jul 2018 08:54:38 +0800 Subject: [PATCH] Remove compiler warnings --- src/guiengine/event_handler.cpp | 2 -- src/guiengine/skin.cpp | 18 +++++++++--------- src/guiengine/skin.hpp | 2 +- .../controller/network_player_controller.hpp | 2 +- .../dialogs/init_android_dialog.cpp | 2 +- .../dialogs/select_challenge.cpp | 3 ++- src/states_screens/easter_egg_screen.cpp | 3 ++- src/states_screens/grand_prix_win.cpp | 2 -- 8 files changed, 16 insertions(+), 18 deletions(-) mode change 100755 => 100644 src/karts/controller/network_player_controller.hpp diff --git a/src/guiengine/event_handler.cpp b/src/guiengine/event_handler.cpp index f2e3029f2..788f4e107 100644 --- a/src/guiengine/event_handler.cpp +++ b/src/guiengine/event_handler.cpp @@ -387,8 +387,6 @@ void EventHandler::deallocate() // ----------------------------------------------------------------------------- // ----------------------------------------------------------------------------- -const bool NAVIGATION_DEBUG = false; - #if 0 #pragma mark - #pragma mark Private methods diff --git a/src/guiengine/skin.cpp b/src/guiengine/skin.cpp index e0821b01f..bc9495047 100644 --- a/src/guiengine/skin.cpp +++ b/src/guiengine/skin.cpp @@ -912,19 +912,19 @@ void Skin::drawRibbon(const core::recti &rect, Widget* widget, { } // drawRibbon -SColorf GetPlayerColor(int player_id) +// ---------------------------------------------------------------------------- +SColorf Skin::getPlayerColor(int player_id) { - SColorHSL col = { 0,100,50 }; col.Hue += (360 / 4) * (player_id % 4); - int color_id = player_id % 4; SColorf color_rgb = { 0,0,0,1 }; - - - col.Saturation = col.Saturation * (1.0f / (floorf(float(player_id / 4)) + 1) ); + + col.Saturation = col.Saturation * + (1.0f / (floorf(float(player_id / 4)) + 1)); col.toRGB(color_rgb); return color_rgb; -} +} // getPlayerColor + // ---------------------------------------------------------------------------- /** * @param focused whether this element is focus by the master player (whether @@ -1209,7 +1209,7 @@ void Skin::drawRibbonChild(const core::recti &rect, Widget* widget, short green_previous = parentRibbonWidget->m_skin_g; short blue_previous = parentRibbonWidget->m_skin_b; - SColorf color_rgb = GetPlayerColor(i); + SColorf color_rgb = getPlayerColor(i); parentRibbonWidget->m_skin_r = short(color_rgb.r * 255.0f); parentRibbonWidget->m_skin_g = short(color_rgb.g * 255.0f); @@ -1304,7 +1304,7 @@ void Skin::drawSpinnerBody(const core::recti &rect, Widget* widget, params = &SkinConfig::m_render_params[ "spinner::deactivated"]; - color_rgb = GetPlayerColor(player_id); + color_rgb = getPlayerColor(player_id); texture = "squareFocusHaloBW::neutral"; } diff --git a/src/guiengine/skin.hpp b/src/guiengine/skin.hpp index 6a617d897..85ebcf9b0 100644 --- a/src/guiengine/skin.hpp +++ b/src/guiengine/skin.hpp @@ -316,7 +316,7 @@ namespace GUIEngine const bool pressed, const bool bottomArrow); void drawTooltip(Widget* widget, bool atMouse); - + irr::video::SColorf getPlayerColor(int player_id); public: diff --git a/src/karts/controller/network_player_controller.hpp b/src/karts/controller/network_player_controller.hpp old mode 100755 new mode 100644 index 0aca2962c..2e143e2d3 --- a/src/karts/controller/network_player_controller.hpp +++ b/src/karts/controller/network_player_controller.hpp @@ -49,7 +49,7 @@ public: * latency the predicted path will curve way too much. By automatically * reducing it, this error is reduced. And even if the player steers more * the error is hopefully acceptable. */ - virtual void update(int ticks) + virtual void update(int ticks) OVERRIDE { PlayerController::update(ticks); if (NetworkConfig::get()->isClient()) diff --git a/src/states_screens/dialogs/init_android_dialog.cpp b/src/states_screens/dialogs/init_android_dialog.cpp index 5141ce7b8..bdc43c1cb 100644 --- a/src/states_screens/dialogs/init_android_dialog.cpp +++ b/src/states_screens/dialogs/init_android_dialog.cpp @@ -81,7 +81,7 @@ void InitAndroidDialog::beforeAddingWidgets() Widget* accelerometer = &control_type->getChildren()[index]; accelerometer->setActive(false); - if (UserConfigParams::m_multitouch_controls = 2) + if (UserConfigParams::m_multitouch_controls == 2) { UserConfigParams::m_multitouch_controls = 1; } diff --git a/src/states_screens/dialogs/select_challenge.cpp b/src/states_screens/dialogs/select_challenge.cpp index b2e7221f9..e9ecd04dc 100644 --- a/src/states_screens/dialogs/select_challenge.cpp +++ b/src/states_screens/dialogs/select_challenge.cpp @@ -216,9 +216,10 @@ GUIEngine::EventPropagation SelectChallengeDialog::processEvent(const std::strin //StateManager::get()->resetActivePlayers(); // Use latest used device +#ifdef DEBUG InputDevice* device = input_manager->getDeviceManager()->getLatestUsedDevice(); assert(device != NULL); - +#endif // Set up race manager appropriately race_manager->setNumPlayers(1); race_manager->setPlayerKart(0, UserConfigParams::m_default_kart); diff --git a/src/states_screens/easter_egg_screen.cpp b/src/states_screens/easter_egg_screen.cpp index e478a840f..6460d53bc 100644 --- a/src/states_screens/easter_egg_screen.cpp +++ b/src/states_screens/easter_egg_screen.cpp @@ -69,9 +69,10 @@ void EasterEggScreen::eventCallback(Widget* widget, const std::string& name, con if (selection == "random_track") { +#ifdef DEBUG RibbonWidget* tabs = this->getWidget("trackgroups"); assert( tabs != NULL ); - +#endif if (m_random_track_list.empty()) return; std::string track = m_random_track_list.front(); diff --git a/src/states_screens/grand_prix_win.cpp b/src/states_screens/grand_prix_win.cpp index 6f289ab31..ef182922f 100644 --- a/src/states_screens/grand_prix_win.cpp +++ b/src/states_screens/grand_prix_win.cpp @@ -84,8 +84,6 @@ const float KARTS_INITIAL_Z[3] = { 44.9f, 40.9f, 36.9f }; // Locations for karts to go to, should be the locations of the podiums (End Stage 1) const float KARTS_PODIUM_X[3] = { 20.5f, 20.75f, 21.0f }; -const float KARTS_PODIUM_Y[3] = {KARTS_INITIAL_Y[0], KARTS_INITIAL_Y[1], KARTS_INITIAL_Y[2]}; -const float KARTS_PODIUM_Z[3] = {KARTS_INITIAL_Z[0], KARTS_INITIAL_Z[1], KARTS_INITIAL_Z[2]}; // Rotations for karts to go to in Stage 2 const float KARTS_AND_PODIUMS_FINAL_ROTATION[3] = { 270.0f, 270.0f, 270.0f };