From f278cdb8b8b8fc80309f9f3dba4fad3076bf39d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Sun, 13 Dec 2015 20:05:20 -0800 Subject: [PATCH] Fixed clang warning. --- examples/27-terrain/terrain.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/examples/27-terrain/terrain.cpp b/examples/27-terrain/terrain.cpp index 703e1ef77..48911495d 100644 --- a/examples/27-terrain/terrain.cpp +++ b/examples/27-terrain/terrain.cpp @@ -305,10 +305,13 @@ class Terrain : public entry::AppI // Brush attenuation float a2 = (float)(area_x * area_x); float b2 = (float)(area_y * area_y); - float brushAttn = m_brush.m_size - sqrtf(a2 + b2); + float brushAttn = m_brush.m_size - bx::fsqrt(a2 + b2); // Raise/Lower and scale by brush power. - height += bx::fclamp(brushAttn * m_brush.m_power, 0.0, m_brush.m_power) * m_brush.m_raise ? 1.0 : -1.0; + height += (bx::fclamp(brushAttn * m_brush.m_power, 0.0, m_brush.m_power) * m_brush.m_raise) + ? 1.0 + : -1.0 + ; m_terrain.m_heightMap[heightMapPos] = (uint8_t)bx::fclamp(height, 0.0, 255.0); m_terrain.m_dirty = true;