1
0
forked from 0ad/0ad

Remove min/max mapsize constants from the rmgen library, refs #4034.

The removed values were in fact arbitrary GUI numbers no map script
should confuse with engine limits.

To not make it my words, quoting FeXoR from #4034:
"I agree removing MIN_MAP_SIZE and MAX_MAP_SIZE and make the parameters
of scaleByMapSize optional with the default being 128 to 512."

This was SVN commit r20368.
This commit is contained in:
elexis 2017-10-28 17:37:09 +00:00
parent c72d2b6dc0
commit 3647200e8f

View File

@ -4,8 +4,6 @@ const TERRAIN_SEPARATOR = "|";
const SEA_LEVEL = 20.0;
const CELL_SIZE = 4;
const HEIGHT_UNITS_PER_METRE = 92;
const MIN_MAP_SIZE = 128;
const MAX_MAP_SIZE = 512;
const MAP_BORDER_WIDTH = 3;
const FALLBACK_CIV = "athen";
/**
@ -37,9 +35,9 @@ function sizeToFraction(s)
return s / getMapArea();
}
function scaleByMapSize(min, max)
function scaleByMapSize(min, max, minMapSize = 128, maxMapSize = 512)
{
return min + (max - min) * (g_Map.size - MIN_MAP_SIZE) / (MAX_MAP_SIZE - MIN_MAP_SIZE);
return min + (max - min) * (g_Map.size - minMapSize) / (maxMapSize - minMapSize);
}
function cos(x)