Remove compiler warnings

This commit is contained in:
Benau 2018-07-26 08:54:38 +08:00
parent 007f611c10
commit 7538f36bed
8 changed files with 16 additions and 18 deletions

View File

@ -387,8 +387,6 @@ void EventHandler::deallocate()
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
const bool NAVIGATION_DEBUG = false;
#if 0 #if 0
#pragma mark - #pragma mark -
#pragma mark Private methods #pragma mark Private methods

View File

@ -912,19 +912,19 @@ void Skin::drawRibbon(const core::recti &rect, Widget* widget,
{ {
} // drawRibbon } // drawRibbon
SColorf GetPlayerColor(int player_id) // ----------------------------------------------------------------------------
SColorf Skin::getPlayerColor(int player_id)
{ {
SColorHSL col = { 0,100,50 }; SColorHSL col = { 0,100,50 };
col.Hue += (360 / 4) * (player_id % 4); col.Hue += (360 / 4) * (player_id % 4);
int color_id = player_id % 4;
SColorf color_rgb = { 0,0,0,1 }; SColorf color_rgb = { 0,0,0,1 };
col.Saturation = col.Saturation *
col.Saturation = col.Saturation * (1.0f / (floorf(float(player_id / 4)) + 1) ); (1.0f / (floorf(float(player_id / 4)) + 1));
col.toRGB(color_rgb); col.toRGB(color_rgb);
return color_rgb; return color_rgb;
} } // getPlayerColor
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
/** /**
* @param focused whether this element is focus by the master player (whether * @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 green_previous = parentRibbonWidget->m_skin_g;
short blue_previous = parentRibbonWidget->m_skin_b; 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_r = short(color_rgb.r * 255.0f);
parentRibbonWidget->m_skin_g = short(color_rgb.g * 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[ params = &SkinConfig::m_render_params[
"spinner::deactivated"]; "spinner::deactivated"];
color_rgb = GetPlayerColor(player_id); color_rgb = getPlayerColor(player_id);
texture = "squareFocusHaloBW::neutral"; texture = "squareFocusHaloBW::neutral";
} }

View File

@ -316,7 +316,7 @@ namespace GUIEngine
const bool pressed, const bool bottomArrow); const bool pressed, const bool bottomArrow);
void drawTooltip(Widget* widget, bool atMouse); void drawTooltip(Widget* widget, bool atMouse);
irr::video::SColorf getPlayerColor(int player_id);
public: public:

2
src/karts/controller/network_player_controller.hpp Executable file → Normal file
View File

@ -49,7 +49,7 @@ public:
* latency the predicted path will curve way too much. By automatically * latency the predicted path will curve way too much. By automatically
* reducing it, this error is reduced. And even if the player steers more * reducing it, this error is reduced. And even if the player steers more
* the error is hopefully acceptable. */ * the error is hopefully acceptable. */
virtual void update(int ticks) virtual void update(int ticks) OVERRIDE
{ {
PlayerController::update(ticks); PlayerController::update(ticks);
if (NetworkConfig::get()->isClient()) if (NetworkConfig::get()->isClient())

View File

@ -81,7 +81,7 @@ void InitAndroidDialog::beforeAddingWidgets()
Widget* accelerometer = &control_type->getChildren()[index]; Widget* accelerometer = &control_type->getChildren()[index];
accelerometer->setActive(false); accelerometer->setActive(false);
if (UserConfigParams::m_multitouch_controls = 2) if (UserConfigParams::m_multitouch_controls == 2)
{ {
UserConfigParams::m_multitouch_controls = 1; UserConfigParams::m_multitouch_controls = 1;
} }

View File

@ -216,9 +216,10 @@ GUIEngine::EventPropagation SelectChallengeDialog::processEvent(const std::strin
//StateManager::get()->resetActivePlayers(); //StateManager::get()->resetActivePlayers();
// Use latest used device // Use latest used device
#ifdef DEBUG
InputDevice* device = input_manager->getDeviceManager()->getLatestUsedDevice(); InputDevice* device = input_manager->getDeviceManager()->getLatestUsedDevice();
assert(device != NULL); assert(device != NULL);
#endif
// Set up race manager appropriately // Set up race manager appropriately
race_manager->setNumPlayers(1); race_manager->setNumPlayers(1);
race_manager->setPlayerKart(0, UserConfigParams::m_default_kart); race_manager->setPlayerKart(0, UserConfigParams::m_default_kart);

View File

@ -69,9 +69,10 @@ void EasterEggScreen::eventCallback(Widget* widget, const std::string& name, con
if (selection == "random_track") if (selection == "random_track")
{ {
#ifdef DEBUG
RibbonWidget* tabs = this->getWidget<RibbonWidget>("trackgroups"); RibbonWidget* tabs = this->getWidget<RibbonWidget>("trackgroups");
assert( tabs != NULL ); assert( tabs != NULL );
#endif
if (m_random_track_list.empty()) return; if (m_random_track_list.empty()) return;
std::string track = m_random_track_list.front(); std::string track = m_random_track_list.front();

View File

@ -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) // 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_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 // Rotations for karts to go to in Stage 2
const float KARTS_AND_PODIUMS_FINAL_ROTATION[3] = { 270.0f, 270.0f, 270.0f }; const float KARTS_AND_PODIUMS_FINAL_ROTATION[3] = { 270.0f, 270.0f, 270.0f };