Mercurial > hg > openttd
changeset 14023:5ec270a4cb43 draft
(svn r18565) -Fix [FS#3391] (r18541): some older GCC warn about implicitly casting from floats to integers
author | rubidium <rubidium@openttd.org> |
---|---|
date | Sun, 20 Dec 2009 14:18:22 +0000 |
parents | 9f643c6d1e45 |
children | 7b24b1bfb31b |
files | src/tgp.cpp |
diffstat | 1 files changed, 3 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/tgp.cpp +++ b/src/tgp.cpp @@ -578,7 +578,7 @@ /* 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 @@ /* 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 @@ } /* 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); } } }