summaryrefslogtreecommitdiff
path: root/src/fontengine.cpp
diff options
context:
space:
mode:
authorLoic Blot <loic.blot@unix-experience.fr>2018-04-04 07:42:40 +0200
committerLoic Blot <loic.blot@unix-experience.fr>2018-04-04 07:42:40 +0200
commit8e0b80aa369df7d1142053f077df928106c6ce8c (patch)
tree7f12869eef1a18364be9d8db67e01d060bc11d60 /src/fontengine.cpp
parenta90d27e1e23fa1c369c05a4d9c6083aa86ef7f52 (diff)
downloadminetest-8e0b80aa369df7d1142053f077df928106c6ce8c.tar.gz
minetest-8e0b80aa369df7d1142053f077df928106c6ce8c.tar.bz2
minetest-8e0b80aa369df7d1142053f077df928106c6ce8c.zip
Fix last performance-type-promotion-in-math-fn problems
Diffstat (limited to 'src/fontengine.cpp')
-rw-r--r--src/fontengine.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/fontengine.cpp b/src/fontengine.cpp
index b40e1ef0f..dc98fb1e4 100644
--- a/src/fontengine.cpp
+++ b/src/fontengine.cpp
@@ -18,6 +18,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
*/
#include "fontengine.h"
+#include <cmath>
#include "client/renderingengine.h"
#include "config.h"
#include "porting.h"
@@ -309,10 +310,10 @@ void FontEngine::initFont(unsigned int basesize, FontMode mode)
}
#if USE_FREETYPE
else {
- if (! is_yes(m_settings->get("freetype"))) {
+ if (!is_yes(m_settings->get("freetype"))) {
return;
}
- unsigned int size = floor(RenderingEngine::getDisplayDensity() *
+ u32 size = std::floor(RenderingEngine::getDisplayDensity() *
m_settings->getFloat("gui_scaling") * basesize);
u32 font_shadow = 0;
u32 font_shadow_alpha = 0;
@@ -428,7 +429,7 @@ void FontEngine::initSimpleFont(unsigned int basesize, FontMode mode)
if (basesize == FONT_SIZE_UNSPECIFIED)
basesize = DEFAULT_FONT_SIZE;
- unsigned int size = floor(
+ u32 size = std::floor(
RenderingEngine::getDisplayDensity() *
m_settings->getFloat("gui_scaling") *
basesize);