diff options
author | rubidium <rubidium@openttd.org> | 2014-10-02 17:40:45 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2014-10-02 17:40:45 +0000 |
commit | 2a786aa264af1e7f1414be880a79f15d04402cfd (patch) | |
tree | c23457115b0fb82c969f50b8c62960e75457ed01 /src/tgp.cpp | |
parent | a14fad13ed6dda49e8c5a93b08b7f9d5893b33b5 (diff) | |
download | openttd-2a786aa264af1e7f1414be880a79f15d04402cfd.tar.xz |
(svn r26946) -Fix (r26945): MSVC doesn't seem to have round yet
Diffstat (limited to 'src/tgp.cpp')
-rw-r--r-- | src/tgp.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/tgp.cpp b/src/tgp.cpp index 4a865ed55..8c66efa2b 100644 --- a/src/tgp.cpp +++ b/src/tgp.cpp @@ -513,8 +513,8 @@ static void HeightMapCurves(uint level) /* Set up a grid to choose curve maps based on location; attempt to get a somewhat square grid */ float factor = sqrt((float)_height_map.size_x / (float)_height_map.size_y); - uint sx = Clamp(round((1 << level) * factor), 1, 128); - uint sy = Clamp(round((1 << level) / factor), 1, 128); + uint sx = Clamp((int)(((1 << level) * factor) + 0.5), 1, 128); + uint sy = Clamp((int)(((1 << level) / factor) + 0.5), 1, 128); byte *c = AllocaM(byte, sx * sy); for (uint i = 0; i < sx * sy; i++) { |