From 03f4b76a321841312479fe230c5f7d939e8d6f58 Mon Sep 17 00:00:00 2001 From: hiker Date: Tue, 9 May 2017 09:34:37 +1000 Subject: [PATCH] Fixed various compiler warnings. --- src/graphics/spherical_harmonics.cpp | 2 +- src/guiengine/message_queue.cpp | 2 +- src/guiengine/screen_keyboard.cpp | 4 ++-- src/states_screens/dialogs/multitouch_settings_dialog.cpp | 2 +- src/states_screens/race_gui_multitouch.cpp | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/graphics/spherical_harmonics.cpp b/src/graphics/spherical_harmonics.cpp index c94149bbf..1b5ca8e6f 100644 --- a/src/graphics/spherical_harmonics.cpp +++ b/src/graphics/spherical_harmonics.cpp @@ -95,7 +95,7 @@ namespace { v *= (1.0f/255.0f); if( v <= 0.04045f ) - v = v * (1.0f/12.92); + v = v * (1.0f/12.92f); else v = pow( ( v + 0.055f ) * (1.0f/1.055f), 2.4f ); return v; diff --git a/src/guiengine/message_queue.cpp b/src/guiengine/message_queue.cpp index d4fec45c3..2cbed4902 100644 --- a/src/guiengine/message_queue.cpp +++ b/src/guiengine/message_queue.cpp @@ -225,7 +225,7 @@ public: { const unsigned width = irr_driver->getActualScreenSize().Width; const unsigned height = irr_driver->getActualScreenSize().Height; - core::dimension2du dim(width * 0.75f, height * 0.05f); + core::dimension2du dim(int(width * 0.75f), int(height * 0.05f)); int x = (width - dim.Width) / 2; int y = height - int(1.5f * dim.Height); m_area = irr::core::recti(x, y, x + dim.Width, diff --git a/src/guiengine/screen_keyboard.cpp b/src/guiengine/screen_keyboard.cpp index 8738bb8b7..49e5cdccd 100644 --- a/src/guiengine/screen_keyboard.cpp +++ b/src/guiengine/screen_keyboard.cpp @@ -108,8 +108,8 @@ void ScreenKeyboard::init() const core::dimension2d& frame_size = irr_driver->getFrameSize(); int margin = 15; - int w = frame_size.Width * m_percent_width; - int h = frame_size.Height * m_percent_height; + int w = int(frame_size.Width * m_percent_width); + int h = int(frame_size.Height * m_percent_height); int x = frame_size.Width/2 - w/2; int y = frame_size.Height - h - margin; diff --git a/src/states_screens/dialogs/multitouch_settings_dialog.cpp b/src/states_screens/dialogs/multitouch_settings_dialog.cpp index 7eea08379..2bdc7f9c8 100644 --- a/src/states_screens/dialogs/multitouch_settings_dialog.cpp +++ b/src/states_screens/dialogs/multitouch_settings_dialog.cpp @@ -162,7 +162,7 @@ void MultitouchSettingsDialog::updateValues() CheckBoxWidget* buttons_en = getWidget("buttons_enabled"); assert(buttons_en != NULL); - buttons_en->setState(UserConfigParams::m_multitouch_mode); + buttons_en->setState(UserConfigParams::m_multitouch_mode!=0); CheckBoxWidget* accelerometer; accelerometer = getWidget("accelerometer_disabled"); diff --git a/src/states_screens/race_gui_multitouch.cpp b/src/states_screens/race_gui_multitouch.cpp index db027b284..9538439ab 100644 --- a/src/states_screens/race_gui_multitouch.cpp +++ b/src/states_screens/race_gui_multitouch.cpp @@ -271,8 +271,8 @@ void RaceGUIMultitouch::drawMultitouchSteering(const AbstractKart* kart, float scale = UserConfigParams::m_multitouch_scale * (float)(irr_driver->getActualScreenSize().Height) / 720.0f; - m_race_gui->drawEnergyMeter(button->x + button->width * 1.15f, - button->y + button->height * 1.35f, + m_race_gui->drawEnergyMeter(int(button->x + button->width * 1.15f), + int(button->y + button->height * 1.35f), kart, viewport, core::vector2df(scale, scale)); }