From e5ebae1085f40e25d9e939c5bd3ed29c2fd513c1 Mon Sep 17 00:00:00 2001 From: rubidium Date: Sun, 20 Dec 2009 14:18:22 +0000 Subject: [PATCH] (svn r18565) -Fix [FS#3391] (r18541): some older GCC warn about implicitly casting from floats to integers --- src/tgp.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tgp.cpp b/src/tgp.cpp index 99ef12bb95..b1a3dc129f 100644 --- a/src/tgp.cpp +++ b/src/tgp.cpp @@ -578,7 +578,7 @@ static void HeightMapCurves(uint level) /* Get our X grid positions and bi-linear ratio */ float fx = (float)(sx * x) / _height_map.size_x + 0.5f; - uint x1 = fx; + uint x1 = (uint)fx; uint x2 = x1; float xr = 2.0f * (fx - x1) - 1.0f; xr = sin(xr * M_PI_2); @@ -595,7 +595,7 @@ static void HeightMapCurves(uint level) /* Get our Y grid position and bi-linear ratio */ float fy = (float)(sy * y) / _height_map.size_y + 0.5f; - uint y1 = fy; + uint y1 = (uint)fy; uint y2 = y1; float yr = 2.0f * (fy - y1) - 1.0f; yr = sin(yr * M_PI_2); @@ -640,7 +640,7 @@ static void HeightMapCurves(uint level) } /* Apply interpolation of curve map results. */ - *h = (ht[corner_a] * yri + ht[corner_b] * yr) * xri + (ht[corner_c] * yri + ht[corner_d] * yr) * xr; + *h = (height_t)((ht[corner_a] * yri + ht[corner_b] * yr) * xri + (ht[corner_c] * yri + ht[corner_d] * yr) * xr); } } }