Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/maps/random/rmgen/library.js
const PI = Math.PI; | const PI = Math.PI; | ||||
const TWO_PI = 2 * Math.PI; | const TWO_PI = 2 * Math.PI; | ||||
const TERRAIN_SEPARATOR = "|"; | const TERRAIN_SEPARATOR = "|"; | ||||
const SEA_LEVEL = 20.0; | const SEA_LEVEL = 20.0; | ||||
const HEIGHT_UNITS_PER_METRE = 92; | const HEIGHT_UNITS_PER_METRE = 92; | ||||
const MAP_BORDER_WIDTH = 3; | const MAP_BORDER_WIDTH = 3; | ||||
const FALLBACK_CIV = "athen"; | const FALLBACK_CIV = "athen"; | ||||
/** | /** | ||||
* Constants needed for heightmap_manipulation.js | * Constants needed for heightmap_manipulation.js | ||||
*/ | */ | ||||
const MAX_HEIGHT_RANGE = 0xFFFF / HEIGHT_UNITS_PER_METRE; // Engine limit, Roughly 700 meters | const MAX_HEIGHT_RANGE = 0xFFFF / HEIGHT_UNITS_PER_METRE; // Engine limit, Roughly 700 meters | ||||
const MIN_HEIGHT = - SEA_LEVEL; | const MIN_HEIGHT = - SEA_LEVEL; | ||||
/** | |||||
* Length of one tile of the terrain grid in metres. | |||||
* Useful to transform footprint sizes of templates to the coordinate system used by getMapSize. | |||||
*/ | |||||
const TERRAIN_TILE_SIZE = RMS.GetTerrainTileSize(); | |||||
const MAX_HEIGHT = MAX_HEIGHT_RANGE - SEA_LEVEL; | const MAX_HEIGHT = MAX_HEIGHT_RANGE - SEA_LEVEL; | ||||
// Default angle for buildings | // Default angle for buildings | ||||
const BUILDING_ORIENTATION = - PI / 4; | const BUILDING_ORIENTATION = - PI / 4; | ||||
function fractionToTiles(f) | function fractionToTiles(f) | ||||
{ | { | ||||
return g_Map.size * f; | return g_Map.size * f; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 501 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator