Changeset - r21801:786b543cdd7a
[Not reviewed]
master
0 1 0
rubidium - 10 years ago 2014-10-02 17:40:45
rubidium@openttd.org
(svn r26946) -Fix (r26945): MSVC doesn't seem to have round yet
1 file changed with 2 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/tgp.cpp
Show inline comments
 
@@ -510,14 +510,14 @@ static void HeightMapCurves(uint level)
 
{
 
	height_t ht[lengthof(_curve_maps)];
 
	MemSetT(ht, 0, lengthof(ht));
 

	
 
	/* 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++) {
 
		c[i] = Random() % lengthof(_curve_maps);
 
	}
 

	
0 comments (0 inline, 0 general)