1
0
Fork 0

(svn r26946) -Fix (r26945): MSVC doesn't seem to have round yet

release/1.5
rubidium 2014-10-02 17:40:45 +00:00
parent a14fad13ed
commit 2a786aa264
1 changed files with 2 additions and 2 deletions

View File

@ -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++) {