From 7826a8a751695820d49f90d92fdc715730de58d8 Mon Sep 17 00:00:00 2001 From: hiker Date: Wed, 6 Jan 2016 18:10:54 +1100 Subject: [PATCH] Removed compiler warnings. --- src/guiengine/ft_environment.cpp | 6 +++--- src/guiengine/scalable_font.cpp | 16 ++++++++-------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/guiengine/ft_environment.cpp b/src/guiengine/ft_environment.cpp index eb83dec25..f0a17008a 100644 --- a/src/guiengine/ft_environment.cpp +++ b/src/guiengine/ft_environment.cpp @@ -124,9 +124,9 @@ void FTEnvironment::loadFont() if (screen_width < 1200) scale = std::max(0, screen_width - 640) / 750.0f; if (screen_width < 900 || screen_height < 700) scale = std::min(scale, 0.05f); - const u32 normal_dpi = ((0.7f + 0.2f*scale)*27); - const u32 title_dpi = ((0.2f + 0.2f*scale)*120); - const u32 digit_dpi = ((0.7f + 0.2f*scale)*40); + const u32 normal_dpi = u32((0.7f + 0.2f*scale)*27); + const u32 title_dpi = u32((0.2f + 0.2f*scale)*120); + const u32 digit_dpi = u32((0.7f + 0.2f*scale)*40); Log::info("Freetype Environment", "DPI for Normal Font is %d.", normal_dpi); Log::info("Freetype Environment", "DPI for Title Font is %d.", title_dpi); diff --git a/src/guiengine/scalable_font.cpp b/src/guiengine/scalable_font.cpp index b250f7909..9e665cf19 100644 --- a/src/guiengine/scalable_font.cpp +++ b/src/guiengine/scalable_font.cpp @@ -878,27 +878,27 @@ void ScalableFont::doDraw(const core::stringw& text, if (charCollector == NULL) { //Try to use ceil to make offset calculate correctly when m_scale is smaller than 1 - s32 glyph_offset_x = ceil((float) area.bearingx* + s32 glyph_offset_x = (s32)((float) area.bearingx* (fallback[i] ? m_scale*m_fallback_font_scale : m_scale)); - s32 glyph_offset_y = ceil((float) area.offsety* + s32 glyph_offset_y = (s32)ceil((float) area.offsety* (fallback[i] ? m_scale*m_fallback_font_scale : m_scale)); offset.X += glyph_offset_x; - offset.Y += glyph_offset_y + floor(m_type == T_DIGIT ? 20*m_scale : 0); //Additional offset for digit text + offset.Y += s32(glyph_offset_y + floor(m_type == T_DIGIT ? 20*m_scale : 0)); //Additional offset for digit text offsets.push_back(offset); offset.X -= glyph_offset_x; - offset.Y -= glyph_offset_y + floor(m_type == T_DIGIT ? 20*m_scale : 0); + offset.Y -= s32(glyph_offset_y + floor(m_type == T_DIGIT ? 20*m_scale : 0)); } else //Billboard text specific { - s32 glyph_offset_x = ceil((float) area.bearingx* + s32 glyph_offset_x = (s32)ceil((float) area.bearingx* (fallback[i] ? m_scale*m_fallback_font_scale : m_scale)); - s32 glyph_offset_y = ceil((float) area.offsety_bt* + s32 glyph_offset_y = (s32)ceil((float) area.offsety_bt* (fallback[i] ? m_scale*m_fallback_font_scale : m_scale)); offset.X += glyph_offset_x; - offset.Y += glyph_offset_y + floor(m_type == T_DIGIT ? 20*m_scale : 0); //Additional offset for digit text + offset.Y += s32(glyph_offset_y + floor(m_type == T_DIGIT ? 20*m_scale : 0)); //Additional offset for digit text offsets.push_back(offset); offset.X -= glyph_offset_x; - offset.Y -= glyph_offset_y + floor(m_type == T_DIGIT ? 20*m_scale : 0); + offset.Y -= s32(glyph_offset_y + floor(m_type == T_DIGIT ? 20*m_scale : 0)); } // Invisible character. add something to the array anyway so that // indices from the various arrays remain in sync