diff options
author | rubidium <rubidium@openttd.org> | 2009-12-20 14:18:22 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2009-12-20 14:18:22 +0000 |
commit | e5ebae1085f40e25d9e939c5bd3ed29c2fd513c1 (patch) | |
tree | d90a32f2ab8031d6b881c26815ce968059a4f613 /src | |
parent | 5ac036720be0f0f5416632839fbd8382b7d6775e (diff) | |
download | openttd-e5ebae1085f40e25d9e939c5bd3ed29c2fd513c1.tar.xz |
(svn r18565) -Fix [FS#3391] (r18541): some older GCC warn about implicitly casting from floats to integers
Diffstat (limited to 'src')
-rw-r--r-- | src/tgp.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/tgp.cpp b/src/tgp.cpp index 99ef12bb9..b1a3dc129 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); } } } |