From b11563ddff86a452354930aecf21b79c8610938b Mon Sep 17 00:00:00 2001 From: elexis Date: Wed, 24 Jan 2018 04:10:00 +0000 Subject: [PATCH] Delete InitMap and ExportMap proxies and let the random map define the RandomMap object, refs #4804. Eventually there should be no direct reference to g_Map in the library, refs #4964. This was SVN commit r20995. --- .../data/mods/public/maps/random/aegean_sea.js | 4 ++-- .../mods/public/maps/random/african_plains.js | 4 ++-- .../data/mods/public/maps/random/alpine_lakes.js | 4 ++-- .../data/mods/public/maps/random/alpine_valley.js | 4 ++-- binaries/data/mods/public/maps/random/ambush.js | 4 ++-- .../mods/public/maps/random/anatolian_plateau.js | 4 ++-- .../data/mods/public/maps/random/archipelago.js | 4 ++-- .../data/mods/public/maps/random/arctic_summer.js | 4 ++-- .../mods/public/maps/random/ardennes_forest.js | 4 ++-- .../mods/public/maps/random/atlas_mountains.js | 4 ++-- .../mods/public/maps/random/belgian_uplands.js | 4 ++-- .../mods/public/maps/random/botswanan_haven.js | 4 ++-- .../mods/public/maps/random/caledonian_meadows.js | 4 ++-- .../public/maps/random/cantabrian_highlands.js | 4 ++-- binaries/data/mods/public/maps/random/canyon.js | 4 ++-- .../data/mods/public/maps/random/continent.js | 4 ++-- .../mods/public/maps/random/corinthian_isthmus.js | 4 ++-- binaries/data/mods/public/maps/random/corsica.js | 4 ++-- .../public/maps/random/cycladic_archipelago.js | 4 ++-- binaries/data/mods/public/maps/random/danubius.js | 4 ++-- .../data/mods/public/maps/random/deep_forest.js | 4 ++-- binaries/data/mods/public/maps/random/empire.js | 4 ++-- .../mods/public/maps/random/english_channel.js | 4 ++-- .../mods/public/maps/random/extinct_volcano.js | 4 ++-- binaries/data/mods/public/maps/random/flood.js | 4 ++-- binaries/data/mods/public/maps/random/fortress.js | 4 ++-- binaries/data/mods/public/maps/random/frontier.js | 4 ++-- binaries/data/mods/public/maps/random/gear.js | 4 ++-- .../mods/public/maps/random/guadalquivir_river.js | 4 ++-- .../mods/public/maps/random/gulf_of_bothnia.js | 4 ++-- binaries/data/mods/public/maps/random/harbor.js | 4 ++-- .../data/mods/public/maps/random/hells_pass.js | 4 ++-- .../mods/public/maps/random/hyrcanian_shores.js | 4 ++-- binaries/data/mods/public/maps/random/india.js | 4 ++-- .../mods/public/maps/random/island_stronghold.js | 4 ++-- binaries/data/mods/public/maps/random/islands.js | 4 ++-- binaries/data/mods/public/maps/random/kerala.js | 4 ++-- binaries/data/mods/public/maps/random/lake.js | 4 ++-- binaries/data/mods/public/maps/random/latium.js | 4 ++-- .../data/mods/public/maps/random/lions_den.js | 4 ++-- .../mods/public/maps/random/lorraine_plain.js | 4 ++-- binaries/data/mods/public/maps/random/mainland.js | 4 ++-- .../data/mods/public/maps/random/migration.js | 4 ++-- .../public/maps/random/neareastern_badlands.js | 4 ++-- .../data/mods/public/maps/random/new_rms_test.js | 4 ++-- .../mods/public/maps/random/northern_lights.js | 4 ++-- binaries/data/mods/public/maps/random/oasis.js | 4 ++-- .../mods/public/maps/random/persian_highlands.js | 4 ++-- .../mods/public/maps/random/phoenician_levant.js | 4 ++-- .../data/mods/public/maps/random/polar_sea.js | 4 ++-- .../mods/public/maps/random/pyrenean_sierra.js | 4 ++-- .../mods/public/maps/random/rhine_marshlands.js | 4 ++-- .../mods/public/maps/random/river_archipelago.js | 4 ++-- binaries/data/mods/public/maps/random/rivers.js | 4 ++-- .../data/mods/public/maps/random/rmgen/library.js | 15 --------------- .../data/mods/public/maps/random/saharan_oases.js | 4 ++-- binaries/data/mods/public/maps/random/sahel.js | 4 ++-- .../public/maps/random/sahel_watering_holes.js | 4 ++-- .../data/mods/public/maps/random/schwarzwald.js | 4 ++-- .../mods/public/maps/random/snowflake_searocks.js | 4 ++-- .../data/mods/public/maps/random/stronghold.js | 4 ++-- .../public/maps/random/survivalofthefittest.js | 4 ++-- binaries/data/mods/public/maps/random/syria.js | 4 ++-- binaries/data/mods/public/maps/random/the_nile.js | 4 ++-- .../maps/random/the_unknown/unknown_common.js | 2 +- binaries/data/mods/public/maps/random/unknown.js | 2 +- .../data/mods/public/maps/random/unknown_land.js | 2 +- .../mods/public/maps/random/volcanic_lands.js | 4 ++-- .../data/mods/public/maps/random/wall_demo.js | 4 ++-- .../data/mods/public/maps/random/wild_lake.js | 4 ++-- 70 files changed, 135 insertions(+), 150 deletions(-) diff --git a/binaries/data/mods/public/maps/random/aegean_sea.js b/binaries/data/mods/public/maps/random/aegean_sea.js index 799c9f412a..f87797c289 100644 --- a/binaries/data/mods/public/maps/random/aegean_sea.js +++ b/binaries/data/mods/public/maps/random/aegean_sea.js @@ -52,7 +52,7 @@ const heightShore = 1; const heightLand = 2; const heightIsland = 6; -InitMap(heightShore, tHill); +var g_Map = new RandomMap(heightShore, tHill); const numPlayers = getNumPlayers(); const mapCenter = getMapCenter(); @@ -306,4 +306,4 @@ setPPContrast(0.62); setPPSaturation(0.51); setPPBloom(0.12); -ExportMap(); +g_Map.ExportMap(); diff --git a/binaries/data/mods/public/maps/random/african_plains.js b/binaries/data/mods/public/maps/random/african_plains.js index 67c6764cc5..0f89f6aee6 100644 --- a/binaries/data/mods/public/maps/random/african_plains.js +++ b/binaries/data/mods/public/maps/random/african_plains.js @@ -41,7 +41,7 @@ var heightSeaGround = -5; var heightLand = 2; var heightCliff = 3; -InitMap(heightLand, tPrimary); +var g_Map = new RandomMap(heightLand, tPrimary); const numPlayers = getNumPlayers(); const mapSize = getMapSize(); @@ -283,4 +283,4 @@ setWaterMurkiness(5.92); setWaterWaviness(0); setWaterType("clap"); -ExportMap(); +g_Map.ExportMap(); diff --git a/binaries/data/mods/public/maps/random/alpine_lakes.js b/binaries/data/mods/public/maps/random/alpine_lakes.js index 627b7b6c3f..2235e8873b 100644 --- a/binaries/data/mods/public/maps/random/alpine_lakes.js +++ b/binaries/data/mods/public/maps/random/alpine_lakes.js @@ -83,7 +83,7 @@ const pForest = [tForestFloor + TERRAIN_SEPARATOR + oPine, tForestFloor]; var heightSeaGround = -5; var heightLand = 3; -InitMap(heightLand, tPrimary); +var g_Map = new RandomMap(heightLand, tPrimary); const numPlayers = getNumPlayers(); const mapSize = getMapSize(); @@ -266,4 +266,4 @@ setWaterMurkiness(0.82); setWaterWaviness(3.0); setWaterType("clap"); -ExportMap(); +g_Map.ExportMap(); diff --git a/binaries/data/mods/public/maps/random/alpine_valley.js b/binaries/data/mods/public/maps/random/alpine_valley.js index 8a787b4edf..47971168e6 100644 --- a/binaries/data/mods/public/maps/random/alpine_valley.js +++ b/binaries/data/mods/public/maps/random/alpine_valley.js @@ -283,7 +283,7 @@ var heightMountain = 30; const pForest = [tForestFloor + TERRAIN_SEPARATOR + oPine, tForestFloor]; -InitMap(heightLand, tPrimary); +var g_Map = new RandomMap(heightLand, tPrimary); const numPlayers = getNumPlayers(); const mapCenter = getMapCenter(); @@ -539,4 +539,4 @@ setWaterMurkiness(0.72); setWaterWaviness(2.0); setWaterType("lake"); -ExportMap(); +g_Map.ExportMap(); diff --git a/binaries/data/mods/public/maps/random/ambush.js b/binaries/data/mods/public/maps/random/ambush.js index 4202395483..2884815363 100644 --- a/binaries/data/mods/public/maps/random/ambush.js +++ b/binaries/data/mods/public/maps/random/ambush.js @@ -6,7 +6,7 @@ setSelectedBiome(); var heightLand = 2; -InitMap(heightLand, g_Terrains.mainTerrain); +var g_Map = new RandomMap(heightLand, g_Terrains.mainTerrain); initTileClasses(); @@ -207,4 +207,4 @@ placePlayersNomad( g_TileClasses.mountain, 4, g_TileClasses.animals, 2)); -ExportMap(); +g_Map.ExportMap(); diff --git a/binaries/data/mods/public/maps/random/anatolian_plateau.js b/binaries/data/mods/public/maps/random/anatolian_plateau.js index ea3858db93..ce393d1e96 100644 --- a/binaries/data/mods/public/maps/random/anatolian_plateau.js +++ b/binaries/data/mods/public/maps/random/anatolian_plateau.js @@ -32,7 +32,7 @@ const pForest = [tForestFloor + TERRAIN_SEPARATOR + oPoplar, tForestFloor]; var heightLand = 1; var heightOffsetBump = 2; -InitMap(heightLand, tPrimary); +var g_Map = new RandomMap(heightLand, tPrimary); var numPlayers = getNumPlayers(); @@ -245,4 +245,4 @@ setPPSaturation(0.45); setPPContrast(0.62); setPPBloom(0.2); -ExportMap(); +g_Map.ExportMap(); diff --git a/binaries/data/mods/public/maps/random/archipelago.js b/binaries/data/mods/public/maps/random/archipelago.js index 275654e8aa..88e459718c 100644 --- a/binaries/data/mods/public/maps/random/archipelago.js +++ b/binaries/data/mods/public/maps/random/archipelago.js @@ -47,7 +47,7 @@ var heightSeaGround = -5; var heightLand = 3; var heightShore = 1; -InitMap(heightSeaGround, tWater); +var g_Map = new RandomMap(heightSeaGround, tWater); const numPlayers = getNumPlayers(); @@ -264,4 +264,4 @@ placePlayersNomad( setWaterWaviness(4.0); setWaterType("ocean"); -ExportMap(); +g_Map.ExportMap(); diff --git a/binaries/data/mods/public/maps/random/arctic_summer.js b/binaries/data/mods/public/maps/random/arctic_summer.js index 0351adb8ad..d44ecdf058 100644 --- a/binaries/data/mods/public/maps/random/arctic_summer.js +++ b/binaries/data/mods/public/maps/random/arctic_summer.js @@ -42,7 +42,7 @@ const pForest = [tForestFloor + TERRAIN_SEPARATOR + oBush, tForestFloor + TERRAI var heightSeaGround = -5; var heightLand = 2; -InitMap(heightLand, tPrimary); +var g_Map = new RandomMap(heightLand, tPrimary); const numPlayers = getNumPlayers(); @@ -322,4 +322,4 @@ setWaterMurkiness(0.92); setWaterWaviness(1); setWaterType("clap"); -ExportMap(); +g_Map.ExportMap(); diff --git a/binaries/data/mods/public/maps/random/ardennes_forest.js b/binaries/data/mods/public/maps/random/ardennes_forest.js index 3f034a60b0..d176e8ec23 100644 --- a/binaries/data/mods/public/maps/random/ardennes_forest.js +++ b/binaries/data/mods/public/maps/random/ardennes_forest.js @@ -53,7 +53,7 @@ const heightRavineHill = 40; const heightHill = 50; const heightOffsetRavine = 10; -InitMap(heightHill, tPrimary); +var g_Map = new RandomMap(heightHill, tPrimary); const numPlayers = getNumPlayers(); const mapSize = getMapSize(); @@ -459,4 +459,4 @@ placePlayersNomad(clPlayer, avoidClasses(clForest, 1, clMetal, 4, clRock, 4, clH setTerrainAmbientColor(0.44,0.51,0.56); setUnitsAmbientColor(0.44,0.51,0.56); -ExportMap(); +g_Map.ExportMap(); diff --git a/binaries/data/mods/public/maps/random/atlas_mountains.js b/binaries/data/mods/public/maps/random/atlas_mountains.js index fa58a40948..d8b44d30fa 100644 --- a/binaries/data/mods/public/maps/random/atlas_mountains.js +++ b/binaries/data/mods/public/maps/random/atlas_mountains.js @@ -37,7 +37,7 @@ const pForest2 = [tForestFloor + TERRAIN_SEPARATOR + oAleppoPine, tForestFloor]; const heightLand = 3; -InitMap(heightLand, tPrimary); +var g_Map = new RandomMap(heightLand, tPrimary); const numPlayers = getNumPlayers(); @@ -220,4 +220,4 @@ setPPContrast(0.45); setPPSaturation(0.56); setPPBloom(0.1); -ExportMap(); +g_Map.ExportMap(); diff --git a/binaries/data/mods/public/maps/random/belgian_uplands.js b/binaries/data/mods/public/maps/random/belgian_uplands.js index 20fde9148b..3c322e5d91 100644 --- a/binaries/data/mods/public/maps/random/belgian_uplands.js +++ b/binaries/data/mods/public/maps/random/belgian_uplands.js @@ -6,7 +6,7 @@ const tPrimary = ["temp_grass", "temp_grass_b", "temp_grass_c", "temp_grass_d", const heightLand = 0; -InitMap(heightLand, tPrimary); +var g_Map = new RandomMap(heightLand, tPrimary); var numPlayers = getNumPlayers(); var mapSize = getMapSize(); @@ -410,4 +410,4 @@ else } } -ExportMap(); +g_Map.ExportMap(); diff --git a/binaries/data/mods/public/maps/random/botswanan_haven.js b/binaries/data/mods/public/maps/random/botswanan_haven.js index c42b5574fa..3f19a872d0 100644 --- a/binaries/data/mods/public/maps/random/botswanan_haven.js +++ b/binaries/data/mods/public/maps/random/botswanan_haven.js @@ -49,7 +49,7 @@ const heightHill = 15; const heightOffsetBump1 = 2; const heightOffsetBump2 = 1; -InitMap(heightLand, tShoreBlend); +var g_Map = new RandomMap(heightLand, tShoreBlend); const numPlayers = getNumPlayers(); @@ -394,4 +394,4 @@ setPPEffect("hdr"); setPPSaturation(0.44); setPPBloom(0.3); -ExportMap(); +g_Map.ExportMap(); diff --git a/binaries/data/mods/public/maps/random/caledonian_meadows.js b/binaries/data/mods/public/maps/random/caledonian_meadows.js index ea9148b94d..fcc7509630 100644 --- a/binaries/data/mods/public/maps/random/caledonian_meadows.js +++ b/binaries/data/mods/public/maps/random/caledonian_meadows.js @@ -2,7 +2,7 @@ Engine.LoadLibrary("rmgen"); Engine.LoadLibrary("rmbiome"); Engine.LoadLibrary("heightmap"); -InitMap(0, "whiteness"); +var g_Map = new RandomMap(0, "whiteness"); /** * Drags a path to a target height smoothing it at the edges and return some points along the path. @@ -444,4 +444,4 @@ for (let i = 0; i < resourceSpots.length; ++i) placeCamp(resourceSpots[i]); } -ExportMap(); +g_Map.ExportMap(); diff --git a/binaries/data/mods/public/maps/random/cantabrian_highlands.js b/binaries/data/mods/public/maps/random/cantabrian_highlands.js index bfabf03286..2d9812dbca 100644 --- a/binaries/data/mods/public/maps/random/cantabrian_highlands.js +++ b/binaries/data/mods/public/maps/random/cantabrian_highlands.js @@ -46,7 +46,7 @@ const heightSeaGround = -7; const heightLand = 3; const heightHill = 20; -InitMap(heightLand, tPrimary); +var g_Map = new RandomMap(heightLand, tPrimary); var numPlayers = getNumPlayers(); var mapSize = getMapSize(); @@ -279,4 +279,4 @@ setPPSaturation(0.62); setPPContrast(0.62); setPPBloom(0.3); -ExportMap(); +g_Map.ExportMap(); diff --git a/binaries/data/mods/public/maps/random/canyon.js b/binaries/data/mods/public/maps/random/canyon.js index d33f2a2bca..b685867ca2 100644 --- a/binaries/data/mods/public/maps/random/canyon.js +++ b/binaries/data/mods/public/maps/random/canyon.js @@ -43,7 +43,7 @@ const pForest2 = [tForestFloor1 + TERRAIN_SEPARATOR + oTree4, tForestFloor1 + TE const heightLand = 3; const heightHill = 30; -InitMap(heightHill, tMainTerrain); +var g_Map = new RandomMap(heightHill, tMainTerrain); var numPlayers = getNumPlayers(); var mapSize = getMapSize(); @@ -344,4 +344,4 @@ placePlayersNomad( clPlayer, [stayClasses(clLand, 4), avoidClasses(clForest, 1, clMetal, 4, clRock, 4, clHill, 4, clHill2, 4, clFood, 2)]); -ExportMap(); +g_Map.ExportMap(); diff --git a/binaries/data/mods/public/maps/random/continent.js b/binaries/data/mods/public/maps/random/continent.js index a56d6daf2e..c148496688 100644 --- a/binaries/data/mods/public/maps/random/continent.js +++ b/binaries/data/mods/public/maps/random/continent.js @@ -43,7 +43,7 @@ const pForest2 = [tForestFloor1 + TERRAIN_SEPARATOR + oTree4, tForestFloor1 + TE const heightSeaGround = -5; const heightLand = 3; -InitMap(heightSeaGround, tWater); +var g_Map = new RandomMap(heightSeaGround, tWater); var numPlayers = getNumPlayers(); var mapSize = getMapSize(); @@ -253,4 +253,4 @@ placePlayersNomad( setWaterWaviness(1.0); setWaterType("ocean"); -ExportMap(); +g_Map.ExportMap(); diff --git a/binaries/data/mods/public/maps/random/corinthian_isthmus.js b/binaries/data/mods/public/maps/random/corinthian_isthmus.js index 64b3e93f91..35c007d5cd 100644 --- a/binaries/data/mods/public/maps/random/corinthian_isthmus.js +++ b/binaries/data/mods/public/maps/random/corinthian_isthmus.js @@ -44,7 +44,7 @@ const pForest = [tForestFloor, tForestFloor + TERRAIN_SEPARATOR + oCarob, tFores var heightSeaGround = -4; var heightLand = 3; -InitMap(heightLand, tHill); +var g_Map = new RandomMap(heightLand, tHill); const numPlayers = getNumPlayers(); const mapSize = getMapSize(); @@ -265,4 +265,4 @@ setPPContrast(0.62); setPPSaturation(0.51); setPPBloom(0.12); -ExportMap(); +g_Map.ExportMap(); diff --git a/binaries/data/mods/public/maps/random/corsica.js b/binaries/data/mods/public/maps/random/corsica.js index a7e4a9e391..f669a21200 100644 --- a/binaries/data/mods/public/maps/random/corsica.js +++ b/binaries/data/mods/public/maps/random/corsica.js @@ -49,7 +49,7 @@ var heightOffsetLevel2 = 8; var heightOffsetBumps = 2; var heightOffsetAntiBumps = -5; -InitMap(heightSeaGround, tVeryDeepWater); +var g_Map = new RandomMap(heightSeaGround, tVeryDeepWater); var numPlayers = getNumPlayers(); var mapSize = getMapSize(); @@ -516,4 +516,4 @@ setWaterMurkiness(0.72); setWaterWaviness(2.0); setWaterType("ocean"); -ExportMap(); +g_Map.ExportMap(); diff --git a/binaries/data/mods/public/maps/random/cycladic_archipelago.js b/binaries/data/mods/public/maps/random/cycladic_archipelago.js index 0bb047813f..26f3cb9bcd 100644 --- a/binaries/data/mods/public/maps/random/cycladic_archipelago.js +++ b/binaries/data/mods/public/maps/random/cycladic_archipelago.js @@ -47,7 +47,7 @@ const heightLand = 3; const heightHill = 12; const heightOffsetBump = 2; -InitMap(heightSeaGround, tWater); +var g_Map = new RandomMap(heightSeaGround, tWater); const numPlayers = getNumPlayers(); const mapSize = getMapSize(); @@ -359,4 +359,4 @@ setWaterMurkiness(0.72); setWaterWaviness(3.0); setWaterType("ocean"); -ExportMap(); +g_Map.ExportMap(); diff --git a/binaries/data/mods/public/maps/random/danubius.js b/binaries/data/mods/public/maps/random/danubius.js index ef6972ee92..147b7f1569 100644 --- a/binaries/data/mods/public/maps/random/danubius.js +++ b/binaries/data/mods/public/maps/random/danubius.js @@ -125,7 +125,7 @@ const heightLand = 3; const heightPath = 5; const heightIsland = 6; -InitMap(heightLand, tPrimary); +var g_Map = new RandomMap(heightLand, tPrimary); const numPlayers = getNumPlayers(); const mapSize = getMapSize(); @@ -811,4 +811,4 @@ setWaterType("lake"); setWaterMurkiness(0.97); setWaterHeight(21); -ExportMap(); +g_Map.ExportMap(); diff --git a/binaries/data/mods/public/maps/random/deep_forest.js b/binaries/data/mods/public/maps/random/deep_forest.js index e43292ed28..c3077e9b03 100644 --- a/binaries/data/mods/public/maps/random/deep_forest.js +++ b/binaries/data/mods/public/maps/random/deep_forest.js @@ -27,7 +27,7 @@ var heightPath = -2; var heightLand = 0; var heightOffsetRandomPath = 1; -InitMap(heightLand, terrainPrimary); +var g_Map = new RandomMap(heightLand, terrainPrimary); var mapSize = getMapSize(); var mapRadius = mapSize/2; @@ -199,4 +199,4 @@ Engine.SetProgress(95); placePlayersNomad(clPlayer, avoidClasses(clForest, 1, clBaseResource, 4)); -ExportMap(); +g_Map.ExportMap(); diff --git a/binaries/data/mods/public/maps/random/empire.js b/binaries/data/mods/public/maps/random/empire.js index 77cb374d70..b6122f9867 100644 --- a/binaries/data/mods/public/maps/random/empire.js +++ b/binaries/data/mods/public/maps/random/empire.js @@ -4,7 +4,7 @@ Engine.LoadLibrary("rmbiome"); setSelectedBiome(); -InitMap(2, g_Terrains.mainTerrain); +var g_Map = new RandomMap(2, g_Terrains.mainTerrain); initTileClasses(); @@ -230,4 +230,4 @@ placePlayersNomad( g_TileClasses.mountain, 4, g_TileClasses.animals, 2)); -ExportMap(); +g_Map.ExportMap(); diff --git a/binaries/data/mods/public/maps/random/english_channel.js b/binaries/data/mods/public/maps/random/english_channel.js index 8d46c9efe0..278632da94 100644 --- a/binaries/data/mods/public/maps/random/english_channel.js +++ b/binaries/data/mods/public/maps/random/english_channel.js @@ -43,7 +43,7 @@ var heightSeaGround = -4; var heightShore = 1; var heightLand = 3; -InitMap(heightShore, tPrimary); +var g_Map = new RandomMap(heightShore, tPrimary); const numPlayers = getNumPlayers(); const mapCenter = getMapCenter(); @@ -263,4 +263,4 @@ setPPBloom(0.37); placePlayersNomad(clPlayer, avoidClasses(clWater, 4, clForest, 1, clMetal, 4, clRock, 4, clHill, 4, clFood, 2)); -ExportMap(); +g_Map.ExportMap(); diff --git a/binaries/data/mods/public/maps/random/extinct_volcano.js b/binaries/data/mods/public/maps/random/extinct_volcano.js index f1bd526b7f..67edc21d00 100644 --- a/binaries/data/mods/public/maps/random/extinct_volcano.js +++ b/binaries/data/mods/public/maps/random/extinct_volcano.js @@ -55,7 +55,7 @@ var heightLand = 1; var heightHill = 18; var heightPlayerHill = 25; -InitMap(heightLand, tHillMedium1); +var g_Map = new RandomMap(heightLand, tHillMedium1); var numPlayers = getNumPlayers(); var mapCenter = getMapCenter(); @@ -462,4 +462,4 @@ setWaterMurkiness(0.9); setPPEffect("hdr"); -ExportMap(); +g_Map.ExportMap(); diff --git a/binaries/data/mods/public/maps/random/flood.js b/binaries/data/mods/public/maps/random/flood.js index b68f994732..975424c710 100644 --- a/binaries/data/mods/public/maps/random/flood.js +++ b/binaries/data/mods/public/maps/random/flood.js @@ -50,7 +50,7 @@ const heightSeaGround = -2; const heightLand = 2; const shoreRadius = 6; -InitMap(heightSeaGround, tWater); +var g_Map = new RandomMap(heightSeaGround, tWater); const clPlayer = createTileClass(); const clHill = createTileClass(); @@ -300,4 +300,4 @@ placePlayersNomad( setSkySet(pickRandom(["cloudless", "cumulus", "overcast"])); setWaterMurkiness(0.4); -ExportMap(); +g_Map.ExportMap(); diff --git a/binaries/data/mods/public/maps/random/fortress.js b/binaries/data/mods/public/maps/random/fortress.js index d620451a09..afed0a6399 100644 --- a/binaries/data/mods/public/maps/random/fortress.js +++ b/binaries/data/mods/public/maps/random/fortress.js @@ -43,7 +43,7 @@ const pForestP = [tForestFloor + TERRAIN_SEPARATOR + oPine, tForestFloor]; var heightSeaGround = -4; var heightLand = 3; -InitMap(heightLand, tGrass); +var g_Map = new RandomMap(heightLand, tGrass); const numPlayers = getNumPlayers(); const mapSize = getMapSize(); @@ -305,4 +305,4 @@ setPPContrast(0.56); setPPBloom(0.38); setPPEffect("hdr"); -ExportMap(); +g_Map.ExportMap(); diff --git a/binaries/data/mods/public/maps/random/frontier.js b/binaries/data/mods/public/maps/random/frontier.js index cd8d678f16..ffb3b0417d 100644 --- a/binaries/data/mods/public/maps/random/frontier.js +++ b/binaries/data/mods/public/maps/random/frontier.js @@ -9,7 +9,7 @@ var randElevation = randIntInclusive(0, 29); if (randElevation < 25) randElevation = randIntInclusive(1, 4); -InitMap(randElevation, g_Terrains.mainTerrain); +var g_Map = new RandomMap(randElevation, g_Terrains.mainTerrain); initTileClasses(); createArea( @@ -278,4 +278,4 @@ placePlayersNomad( g_TileClasses.plateau, 4, g_TileClasses.animals, 2)); -ExportMap(); +g_Map.ExportMap(); diff --git a/binaries/data/mods/public/maps/random/gear.js b/binaries/data/mods/public/maps/random/gear.js index 9c0e155155..6faee0590c 100644 --- a/binaries/data/mods/public/maps/random/gear.js +++ b/binaries/data/mods/public/maps/random/gear.js @@ -48,7 +48,7 @@ var heightLand = 3; var heightRing = 4; var heightHill = 20; -InitMap(heightLand, tMainTerrain); +var g_Map = new RandomMap(heightLand, tMainTerrain); const numPlayers = getNumPlayers(); const mapSize = getMapSize(); @@ -309,4 +309,4 @@ createStragglerTrees( placePlayersNomad(clPlayer, avoidClasses(clWater, 4, clForest, 1, clMetal, 4, clRock, 4, clHill, 4, clFood, 2)); -ExportMap(); +g_Map.ExportMap(); diff --git a/binaries/data/mods/public/maps/random/guadalquivir_river.js b/binaries/data/mods/public/maps/random/guadalquivir_river.js index 01d156aa30..d92b335455 100644 --- a/binaries/data/mods/public/maps/random/guadalquivir_river.js +++ b/binaries/data/mods/public/maps/random/guadalquivir_river.js @@ -40,7 +40,7 @@ var heightShallow = -1.5; var heightShore = 2; var heightLand = 3; -InitMap(heightSeaGround, tWater); +var g_Map = new RandomMap(heightSeaGround, tWater); const numPlayers = getNumPlayers(); const mapSize = getMapSize(); @@ -282,4 +282,4 @@ setPPContrast(0.62); setPPSaturation(0.51); setPPBloom(0.12); -ExportMap(); +g_Map.ExportMap(); diff --git a/binaries/data/mods/public/maps/random/gulf_of_bothnia.js b/binaries/data/mods/public/maps/random/gulf_of_bothnia.js index c0d6bdf3ef..7865beee33 100644 --- a/binaries/data/mods/public/maps/random/gulf_of_bothnia.js +++ b/binaries/data/mods/public/maps/random/gulf_of_bothnia.js @@ -136,7 +136,7 @@ else if (biome == "frozen_lake") const pForest = [tForestFloor + TERRAIN_SEPARATOR + oPine, tForestFloor]; -InitMap(heightLand, tPrimary); +var g_Map = new RandomMap(heightLand, tPrimary); const numPlayers = getNumPlayers(); const mapSize = getMapSize(); @@ -333,4 +333,4 @@ setWaterWaviness(5.0); setWaterType("lake"); setWaterMurkiness(0.88); -ExportMap(); +g_Map.ExportMap(); diff --git a/binaries/data/mods/public/maps/random/harbor.js b/binaries/data/mods/public/maps/random/harbor.js index 9cc9163488..20a8c078d7 100644 --- a/binaries/data/mods/public/maps/random/harbor.js +++ b/binaries/data/mods/public/maps/random/harbor.js @@ -8,7 +8,7 @@ var heightSeaGround = -18; var heightLand = 2; var heightOffsetHarbor = -11; -InitMap(heightLand, g_Terrains.mainTerrain); +var g_Map = new RandomMap(heightLand, g_Terrains.mainTerrain); initTileClasses(); @@ -289,7 +289,7 @@ placePlayersNomad( g_TileClasses.mountain, 4, g_TileClasses.animals, 2)); -ExportMap(); +g_Map.ExportMap(); function addCenterLake() { diff --git a/binaries/data/mods/public/maps/random/hells_pass.js b/binaries/data/mods/public/maps/random/hells_pass.js index 78bb0f45da..fda8046a9b 100644 --- a/binaries/data/mods/public/maps/random/hells_pass.js +++ b/binaries/data/mods/public/maps/random/hells_pass.js @@ -7,7 +7,7 @@ setSelectedBiome(); const heightLand = 1; const heightBarrier = 30; -InitMap(heightLand, g_Terrains.mainTerrain); +var g_Map = new RandomMap(heightLand, g_Terrains.mainTerrain); initTileClasses(); @@ -244,7 +244,7 @@ placePlayersNomad( g_TileClasses.mountain, 4, g_TileClasses.animals, 2)); -ExportMap(); +g_Map.ExportMap(); function placeBarriers() { diff --git a/binaries/data/mods/public/maps/random/hyrcanian_shores.js b/binaries/data/mods/public/maps/random/hyrcanian_shores.js index 39ac8beb06..8c1f126ac0 100644 --- a/binaries/data/mods/public/maps/random/hyrcanian_shores.js +++ b/binaries/data/mods/public/maps/random/hyrcanian_shores.js @@ -45,7 +45,7 @@ const heightLand = 1; const heightOffsetBump = 4; const heightHill = 15; -InitMap(heightLand, tPrimary); +var g_Map = new RandomMap(heightLand, tPrimary); const mapCenter = getMapCenter(); const mapBounds = getMapBounds(); @@ -340,4 +340,4 @@ setWaterWaviness(2.0); setWaterType("ocean"); setWaterMurkiness(0.83); -ExportMap(); +g_Map.ExportMap(); diff --git a/binaries/data/mods/public/maps/random/india.js b/binaries/data/mods/public/maps/random/india.js index b80ddb0d6a..17a25ec423 100644 --- a/binaries/data/mods/public/maps/random/india.js +++ b/binaries/data/mods/public/maps/random/india.js @@ -27,7 +27,7 @@ const heightLand = 1; const heightShore = 3; const heightOffsetBump = 2; -InitMap(heightLand, tGrass1); +var g_Map = new RandomMap(heightLand, tGrass1); var numPlayers = getNumPlayers(); var mapSize = getMapSize(); @@ -268,4 +268,4 @@ setPPEffect("hdr"); setPPContrast(0.57031); setPPBloom(0.34); -ExportMap(); +g_Map.ExportMap(); diff --git a/binaries/data/mods/public/maps/random/island_stronghold.js b/binaries/data/mods/public/maps/random/island_stronghold.js index 145ac0c687..b3201b1b13 100644 --- a/binaries/data/mods/public/maps/random/island_stronghold.js +++ b/binaries/data/mods/public/maps/random/island_stronghold.js @@ -49,7 +49,7 @@ const heightSeaGround = -10; const heightLand = 3; const heightHill = 18; -InitMap(heightSeaGround, tWater); +var g_Map = new RandomMap(heightSeaGround, tWater); const numPlayers = getNumPlayers(); const mapSize = getMapSize(); @@ -406,4 +406,4 @@ setWaterWaviness(2); Engine.SetProgress(100); -ExportMap(); +g_Map.ExportMap(); diff --git a/binaries/data/mods/public/maps/random/islands.js b/binaries/data/mods/public/maps/random/islands.js index 40cedfe7df..6900a2e211 100644 --- a/binaries/data/mods/public/maps/random/islands.js +++ b/binaries/data/mods/public/maps/random/islands.js @@ -49,7 +49,7 @@ const heightLand = 3; const heightOffsetBump = 2; const heightHill = 18; -InitMap(heightSeaGround, tWater); +var g_Map = new RandomMap(heightSeaGround, tWater); const numPlayers = getNumPlayers(); const mapSize = getMapSize(); @@ -361,4 +361,4 @@ setSunRotation(randomAngle()); setSunElevation(randFloat(1/5, 1/3) * Math.PI); setWaterWaviness(2); -ExportMap(); +g_Map.ExportMap(); diff --git a/binaries/data/mods/public/maps/random/kerala.js b/binaries/data/mods/public/maps/random/kerala.js index 48ca85e13c..b295207860 100644 --- a/binaries/data/mods/public/maps/random/kerala.js +++ b/binaries/data/mods/public/maps/random/kerala.js @@ -36,7 +36,7 @@ const heightSeaGround = -5; const heightLand = 3; const heightHill = 25; -InitMap(heightLand, tGrass); +var g_Map = new RandomMap(heightLand, tGrass); const numPlayers = getNumPlayers(); const mapCenter = getMapCenter(); @@ -333,4 +333,4 @@ setPPSaturation(0.65); setPPBloom(0.6); setSkySet("cirrus"); -ExportMap(); +g_Map.ExportMap(); diff --git a/binaries/data/mods/public/maps/random/lake.js b/binaries/data/mods/public/maps/random/lake.js index 62786a8221..9fa8789b9b 100644 --- a/binaries/data/mods/public/maps/random/lake.js +++ b/binaries/data/mods/public/maps/random/lake.js @@ -43,7 +43,7 @@ const pForest2 = [tForestFloor1 + TERRAIN_SEPARATOR + oTree4, tForestFloor1 + TE const heightSeaGround = -3; const heightLand = 3; -InitMap(heightLand, tMainTerrain); +var g_Map = new RandomMap(heightLand, tMainTerrain); const numPlayers = getNumPlayers(); const mapSize = getMapSize(); @@ -249,4 +249,4 @@ placePlayersNomad(clPlayer, avoidClasses(clWater, 4, clHill, 2, clForest, 1, clM setWaterWaviness(4.0); setWaterType("lake"); -ExportMap(); +g_Map.ExportMap(); diff --git a/binaries/data/mods/public/maps/random/latium.js b/binaries/data/mods/public/maps/random/latium.js index c3cda938f0..ea9e6bf926 100644 --- a/binaries/data/mods/public/maps/random/latium.js +++ b/binaries/data/mods/public/maps/random/latium.js @@ -54,7 +54,7 @@ const heightLand = 0; const heightPlayer = 5; const heightHill = 12; -InitMap(heightLand, tGrass); +var g_Map = new RandomMap(heightLand, tGrass); const numPlayers = getNumPlayers(); const mapSize = getMapSize(); @@ -477,4 +477,4 @@ setWaterWaviness(2.5); setWaterType("ocean"); setWaterMurkiness(0.8); -ExportMap(); +g_Map.ExportMap(); diff --git a/binaries/data/mods/public/maps/random/lions_den.js b/binaries/data/mods/public/maps/random/lions_den.js index 4d3e68ce17..ac1d0fa37e 100644 --- a/binaries/data/mods/public/maps/random/lions_den.js +++ b/binaries/data/mods/public/maps/random/lions_den.js @@ -11,7 +11,7 @@ const heightPath = 10; const heightDen = 15; const heightHill = 50; -InitMap(heightHill, topTerrain); +var g_Map = new RandomMap(heightHill, topTerrain); const mapCenter = getMapCenter(); const numPlayers = getNumPlayers(); @@ -422,7 +422,7 @@ placePlayersNomad( g_TileClasses.animals, 2) ]); -ExportMap(); +g_Map.ExportMap(); function createSunkenTerrain() { diff --git a/binaries/data/mods/public/maps/random/lorraine_plain.js b/binaries/data/mods/public/maps/random/lorraine_plain.js index b41e071ef9..0384d74196 100644 --- a/binaries/data/mods/public/maps/random/lorraine_plain.js +++ b/binaries/data/mods/public/maps/random/lorraine_plain.js @@ -41,7 +41,7 @@ const heightShallows = -2; const heightLand = 3; const heightOffsetBump = 2; -InitMap(heightLand, tPrimary); +var g_Map = new RandomMap(heightLand, tPrimary); const numPlayers = getNumPlayers(); const mapSize = getMapSize(); @@ -318,4 +318,4 @@ setWaterWaviness(3.0); setWaterType("lake"); setWaterMurkiness(0.80); -ExportMap(); +g_Map.ExportMap(); diff --git a/binaries/data/mods/public/maps/random/mainland.js b/binaries/data/mods/public/maps/random/mainland.js index 3182be869c..acac179562 100644 --- a/binaries/data/mods/public/maps/random/mainland.js +++ b/binaries/data/mods/public/maps/random/mainland.js @@ -39,7 +39,7 @@ const pForest2 = [tForestFloor1 + TERRAIN_SEPARATOR + oTree4, tForestFloor1 + TE const heightLand = 3; -InitMap(heightLand, tMainTerrain); +var g_Map = new RandomMap(heightLand, tMainTerrain); const numPlayers = getNumPlayers(); @@ -193,4 +193,4 @@ createStragglerTrees( placePlayersNomad(clPlayer, avoidClasses(clForest, 1, clMetal, 4, clRock, 4, clHill, 4, clFood, 2)); -ExportMap(); +g_Map.ExportMap(); diff --git a/binaries/data/mods/public/maps/random/migration.js b/binaries/data/mods/public/maps/random/migration.js index d9ac135577..27f86a8a2c 100644 --- a/binaries/data/mods/public/maps/random/migration.js +++ b/binaries/data/mods/public/maps/random/migration.js @@ -47,7 +47,7 @@ const heightLand = 3; const heightHill = 18; const heightOffsetBump = 2; -InitMap(heightSeaGround, tWater); +var g_Map = new RandomMap(heightSeaGround, tWater); const numPlayers = getNumPlayers(); const mapSize = getMapSize(); @@ -369,4 +369,4 @@ setWaterWaviness(2); placePlayersNomad(clPlayer, [stayClasses(clIsland, 4), avoidClasses(clForest, 1, clMetal, 4, clRock, 4, clHill, 4, clFood, 2)]); -ExportMap(); +g_Map.ExportMap(); diff --git a/binaries/data/mods/public/maps/random/neareastern_badlands.js b/binaries/data/mods/public/maps/random/neareastern_badlands.js index 51f66fecaf..cf80d07707 100644 --- a/binaries/data/mods/public/maps/random/neareastern_badlands.js +++ b/binaries/data/mods/public/maps/random/neareastern_badlands.js @@ -45,7 +45,7 @@ const heightOffsetHill2 = 16; const heightOffsetHill3 = 16; const heightOffsetBump = 2; -InitMap(heightLand, tPrimary); +var g_Map = new RandomMap(heightLand, tPrimary); const numPlayers = getNumPlayers(); const mapSize = getMapSize(); @@ -355,4 +355,4 @@ setWaterType("clap"); setWaterMurkiness(0.75); setWaterHeight(20); -ExportMap(); +g_Map.ExportMap(); diff --git a/binaries/data/mods/public/maps/random/new_rms_test.js b/binaries/data/mods/public/maps/random/new_rms_test.js index a2e4b0a7c7..9fbadbfbc1 100644 --- a/binaries/data/mods/public/maps/random/new_rms_test.js +++ b/binaries/data/mods/public/maps/random/new_rms_test.js @@ -1,6 +1,6 @@ Engine.LoadLibrary("rmgen"); -InitMap(0, "grass1_spring"); +var g_Map = new RandomMap(0, "grass1_spring"); placePlayerBases({ "PlayerPlacement": playerPlacementCircle(fractionToTiles(0.39)) @@ -8,4 +8,4 @@ placePlayerBases({ placePlayersNomad(createTileClass()); -ExportMap(); +g_Map.ExportMap(); diff --git a/binaries/data/mods/public/maps/random/northern_lights.js b/binaries/data/mods/public/maps/random/northern_lights.js index fdd28cdebe..47bb46d0d7 100644 --- a/binaries/data/mods/public/maps/random/northern_lights.js +++ b/binaries/data/mods/public/maps/random/northern_lights.js @@ -31,7 +31,7 @@ const heightLake = -4; const heightLand = 3; const heightHill = 25; -InitMap(heightLand, tSnowA); +var g_Map = new RandomMap(heightLand, tSnowA); const numPlayers = getNumPlayers(); const mapSize = getMapSize(); @@ -285,4 +285,4 @@ setPPSaturation(0.28); setPPEffect("hdr"); setSkySet("fog"); -ExportMap(); +g_Map.ExportMap(); diff --git a/binaries/data/mods/public/maps/random/oasis.js b/binaries/data/mods/public/maps/random/oasis.js index c726f4866e..c28428f250 100644 --- a/binaries/data/mods/public/maps/random/oasis.js +++ b/binaries/data/mods/public/maps/random/oasis.js @@ -42,7 +42,7 @@ const heightOasisPath = 4; const heightOffsetBump = 4; const heightOffsetDune = 18; -InitMap(heightLand, tSand); +var g_Map = new RandomMap(heightLand, tSand); const numPlayers = getNumPlayers(); const mapSize = getMapSize(); @@ -338,4 +338,4 @@ setWaterMurkiness(0.5); setTerrainAmbientColor(0.45, 0.5, 0.6); setUnitsAmbientColor(0.501961, 0.501961, 0.501961); -ExportMap(); +g_Map.ExportMap(); diff --git a/binaries/data/mods/public/maps/random/persian_highlands.js b/binaries/data/mods/public/maps/random/persian_highlands.js index 801a373308..183d4351dd 100644 --- a/binaries/data/mods/public/maps/random/persian_highlands.js +++ b/binaries/data/mods/public/maps/random/persian_highlands.js @@ -50,7 +50,7 @@ const pForestO = [tForestFloor + TERRAIN_SEPARATOR + oOak, tForestFloor + TERRAI const heightLand = 10; const heightOffsetValley = -10; -InitMap(heightLand, tDirtMain); +var g_Map = new RandomMap(heightLand, tDirtMain); const numPlayers = getNumPlayers(); const mapSize = getMapSize(); @@ -326,4 +326,4 @@ setPPBloom(0.3); placePlayersNomad(clPlayer, avoidClasses(clForest, 1, clMetal, 4, clRock, 4, clHill, 4, clFood, 2)); -ExportMap(); +g_Map.ExportMap(); diff --git a/binaries/data/mods/public/maps/random/phoenician_levant.js b/binaries/data/mods/public/maps/random/phoenician_levant.js index 66e9c2af24..9e0be887dd 100644 --- a/binaries/data/mods/public/maps/random/phoenician_levant.js +++ b/binaries/data/mods/public/maps/random/phoenician_levant.js @@ -46,7 +46,7 @@ const heightIsland = 6; const heightHill = 15; const heightOffsetBump = 2; -InitMap(heightLand, tHill); +var g_Map = new RandomMap(heightLand, tHill); const numPlayers = getNumPlayers(); const mapSize = getMapSize(); @@ -329,4 +329,4 @@ setPPBloom(0.52); placePlayersNomad(clPlayer, avoidClasses(clWater, 4, clForest, 1, clMetal, 4, clRock, 4, clHill, 4, clFood, 2)); -ExportMap(); +g_Map.ExportMap(); diff --git a/binaries/data/mods/public/maps/random/polar_sea.js b/binaries/data/mods/public/maps/random/polar_sea.js index 5996c80715..fff2debe4a 100644 --- a/binaries/data/mods/public/maps/random/polar_sea.js +++ b/binaries/data/mods/public/maps/random/polar_sea.js @@ -31,7 +31,7 @@ var heightSeaGround = -4; var heightLand = 2; var heightCliff = 3; -InitMap(heightLand, tPrimary); +var g_Map = new RandomMap(heightLand, tPrimary); const numPlayers = getNumPlayers(); const mapSize = getMapSize(); @@ -286,4 +286,4 @@ setPPContrast(0.6); setPPSaturation(0.45); setPPBloom(0.4); -ExportMap(); +g_Map.ExportMap(); diff --git a/binaries/data/mods/public/maps/random/pyrenean_sierra.js b/binaries/data/mods/public/maps/random/pyrenean_sierra.js index 25102abebe..755da724f7 100644 --- a/binaries/data/mods/public/maps/random/pyrenean_sierra.js +++ b/binaries/data/mods/public/maps/random/pyrenean_sierra.js @@ -68,7 +68,7 @@ const heightMountain = heightHighRocks + 20; const heightOffsetHill = 7; const heightOffsetHillRandom = 2; -InitMap(heightInit, tGrass); +var g_Map = new RandomMap(heightInit, tGrass); const numPlayers = getNumPlayers(); const mapSize = getMapSize(); @@ -480,4 +480,4 @@ setWaterType("ocean"); setWaterMurkiness(0.83); setWaterHeight(heightWaterLevel); -ExportMap(); +g_Map.ExportMap(); diff --git a/binaries/data/mods/public/maps/random/rhine_marshlands.js b/binaries/data/mods/public/maps/random/rhine_marshlands.js index 21b093235e..f3c94509bc 100644 --- a/binaries/data/mods/public/maps/random/rhine_marshlands.js +++ b/binaries/data/mods/public/maps/random/rhine_marshlands.js @@ -39,7 +39,7 @@ const heightLand = 1; const heightOffsetBumpWater = 1; const heightOffsetBumpLand = 2; -InitMap(heightLand, tGrass); +var g_Map = new RandomMap(heightLand, tGrass); const numPlayers = getNumPlayers(); @@ -305,4 +305,4 @@ setPPEffect("hdr"); setPPSaturation(0.44); setPPBloom(0.3); -ExportMap(); +g_Map.ExportMap(); diff --git a/binaries/data/mods/public/maps/random/river_archipelago.js b/binaries/data/mods/public/maps/random/river_archipelago.js index f6983a9c9a..35a67d6f29 100644 --- a/binaries/data/mods/public/maps/random/river_archipelago.js +++ b/binaries/data/mods/public/maps/random/river_archipelago.js @@ -43,7 +43,7 @@ const heightSeaGround = -8; const heightLand = 3; const heightHill = 25; -InitMap(heightSeaGround, tGrass); +var g_Map = new RandomMap(heightSeaGround, tGrass); const numPlayers = getNumPlayers(); const mapCenter = getMapCenter(); @@ -497,4 +497,4 @@ setPPSaturation(0.65); setPPBloom(0.6); setSkySet("stratus"); -ExportMap(); +g_Map.ExportMap(); diff --git a/binaries/data/mods/public/maps/random/rivers.js b/binaries/data/mods/public/maps/random/rivers.js index 913fc260e0..68b9422787 100644 --- a/binaries/data/mods/public/maps/random/rivers.js +++ b/binaries/data/mods/public/maps/random/rivers.js @@ -50,7 +50,7 @@ const heightSeaGround = -3; const heightShallows = -1; const heightLand = 1; -InitMap(heightLand, tMainTerrain); +var g_Map = new RandomMap(heightLand, tMainTerrain); const numPlayers = getNumPlayers(); const mapSize = getMapSize(); @@ -286,4 +286,4 @@ placePlayersNomad(clPlayer, avoidClasses(clWater, 4, clForest, 1, clMetal, 4, cl setWaterWaviness(3.0); setWaterType("lake"); -ExportMap(); +g_Map.ExportMap(); diff --git a/binaries/data/mods/public/maps/random/rmgen/library.js b/binaries/data/mods/public/maps/random/rmgen/library.js index 2573e5bd68..099cad6997 100644 --- a/binaries/data/mods/public/maps/random/rmgen/library.js +++ b/binaries/data/mods/public/maps/random/rmgen/library.js @@ -31,21 +31,6 @@ const g_CivData = deepfreeze(loadCivFiles(false)); */ var TILE_CENTERED_HEIGHT_MAP = false; -/** - * Main RandomMap object. - */ -var g_Map; - -function InitMap(baseHeight, baseTerrain) -{ - g_Map = new RandomMap(baseHeight, baseTerrain); -} - -function ExportMap() -{ - g_Map.ExportMap(); -} - function fractionToTiles(f) { return g_MapSettings.Size * f; diff --git a/binaries/data/mods/public/maps/random/saharan_oases.js b/binaries/data/mods/public/maps/random/saharan_oases.js index 93f9f69c15..ceafa9f1f4 100644 --- a/binaries/data/mods/public/maps/random/saharan_oases.js +++ b/binaries/data/mods/public/maps/random/saharan_oases.js @@ -36,7 +36,7 @@ const pForest = [tLush + TERRAIN_SEPARATOR + oDatePalm, tLush + TERRAIN_SEPARATO const heightLand = 1; const heightOffsetOasis = -3; -InitMap(heightLand, tPrimary); +var g_Map = new RandomMap(heightLand, tPrimary); const numPlayers = getNumPlayers(); const mapSize = getMapSize(); @@ -237,4 +237,4 @@ setWaterWaviness(1.0); setWaterType("clap"); setWaterMurkiness(0.5); -ExportMap(); +g_Map.ExportMap(); diff --git a/binaries/data/mods/public/maps/random/sahel.js b/binaries/data/mods/public/maps/random/sahel.js index 6e840afdc7..28e6b74159 100644 --- a/binaries/data/mods/public/maps/random/sahel.js +++ b/binaries/data/mods/public/maps/random/sahel.js @@ -30,7 +30,7 @@ const aRock = "actor|geology/stone_savanna_med.xml"; const heightSeaGround = -5; const heightLand = 1; -InitMap(heightLand, tPrimary); +var g_Map = new RandomMap(heightLand, tPrimary); var numPlayers = getNumPlayers(); var mapSize = getMapSize(); @@ -238,4 +238,4 @@ setPPEffect("hdr"); setPPContrast(0.57031); setPPBloom(0.34); -ExportMap(); +g_Map.ExportMap(); diff --git a/binaries/data/mods/public/maps/random/sahel_watering_holes.js b/binaries/data/mods/public/maps/random/sahel_watering_holes.js index 286606b185..31354da761 100644 --- a/binaries/data/mods/public/maps/random/sahel_watering_holes.js +++ b/binaries/data/mods/public/maps/random/sahel_watering_holes.js @@ -41,7 +41,7 @@ const heightLand = 3; const heightHill = 35; const heightOffsetBump = 2; -InitMap(heightLand, tGrass); +var g_Map = new RandomMap(heightLand, tGrass); const numPlayers = getNumPlayers(); const mapSize = getMapSize(); @@ -388,4 +388,4 @@ setWaterMurkiness(0.87); setWaterWaviness(0.5); setWaterType("clap"); -ExportMap(); +g_Map.ExportMap(); diff --git a/binaries/data/mods/public/maps/random/schwarzwald.js b/binaries/data/mods/public/maps/random/schwarzwald.js index 97feab8d24..7a57d16a9d 100644 --- a/binaries/data/mods/public/maps/random/schwarzwald.js +++ b/binaries/data/mods/public/maps/random/schwarzwald.js @@ -66,7 +66,7 @@ var tWaterBorder = ['dirt_brown_d']; const heightLand = 1; const heightOffsetPath = -0.1; -InitMap(heightLand, terrainPrimary); +var g_Map = new RandomMap(heightLand, terrainPrimary); var clPlayer = createTileClass(); var clPath = createTileClass(); @@ -317,4 +317,4 @@ placePlayersNomad(clPlayer, avoidClasses(clWater, 4, clForest, 1, clFood, 2, clM Engine.SetProgress(100); -ExportMap(); +g_Map.ExportMap(); diff --git a/binaries/data/mods/public/maps/random/snowflake_searocks.js b/binaries/data/mods/public/maps/random/snowflake_searocks.js index ba87a537e5..c9394dce43 100644 --- a/binaries/data/mods/public/maps/random/snowflake_searocks.js +++ b/binaries/data/mods/public/maps/random/snowflake_searocks.js @@ -41,7 +41,7 @@ const pForest2 = [tForestFloor1 + TERRAIN_SEPARATOR + oTree4, tForestFloor1 + TE const heightIsland = 20; const heightSeaGround = -5; -InitMap(heightSeaGround, tWater); +var g_Map = new RandomMap(heightSeaGround, tWater); const numPlayers = getNumPlayers(); const mapSize = getMapSize(); @@ -437,4 +437,4 @@ setSkySet(pickRandom(["cirrus", "cumulus", "sunny"])); setSunRotation(randomAngle()); setSunElevation(Math.PI * randFloat(1/5, 1/3)); -ExportMap(); +g_Map.ExportMap(); diff --git a/binaries/data/mods/public/maps/random/stronghold.js b/binaries/data/mods/public/maps/random/stronghold.js index 61898ea338..03582b1065 100644 --- a/binaries/data/mods/public/maps/random/stronghold.js +++ b/binaries/data/mods/public/maps/random/stronghold.js @@ -6,7 +6,7 @@ setSelectedBiome(); const heightLand = 30; -InitMap(heightLand, g_Terrains.mainTerrain); +var g_Map = new RandomMap(heightLand, g_Terrains.mainTerrain); initTileClasses(); @@ -256,4 +256,4 @@ placePlayersNomad( g_TileClasses.mountain, 4, g_TileClasses.animals, 2)); -ExportMap(); +g_Map.ExportMap(); diff --git a/binaries/data/mods/public/maps/random/survivalofthefittest.js b/binaries/data/mods/public/maps/random/survivalofthefittest.js index 9fbf6007fa..823ad5e545 100644 --- a/binaries/data/mods/public/maps/random/survivalofthefittest.js +++ b/binaries/data/mods/public/maps/random/survivalofthefittest.js @@ -42,7 +42,7 @@ const triggerPointTreasures = [ const heightLand = 3; const heightHill = 30; -InitMap(heightHill, tMainTerrain); +var g_Map = new RandomMap(heightHill, tMainTerrain); var numPlayers = getNumPlayers(); var mapSize = getMapSize(); @@ -200,4 +200,4 @@ createStragglerTrees( clForest, stragglerTrees); -ExportMap(); +g_Map.ExportMap(); diff --git a/binaries/data/mods/public/maps/random/syria.js b/binaries/data/mods/public/maps/random/syria.js index 25f3ca5442..87f06ebf26 100644 --- a/binaries/data/mods/public/maps/random/syria.js +++ b/binaries/data/mods/public/maps/random/syria.js @@ -35,7 +35,7 @@ const heightLand = 1; const heightHill = 22; const heightOffsetBump = 2; -InitMap(heightLand, tMainDirt); +var g_Map = new RandomMap(heightLand, tMainDirt); const mapCenter = getMapCenter(); const numPlayers = getNumPlayers(); @@ -274,4 +274,4 @@ setPPContrast(0.65); setPPSaturation(0.42); setPPBloom(0.6); -ExportMap(); +g_Map.ExportMap(); diff --git a/binaries/data/mods/public/maps/random/the_nile.js b/binaries/data/mods/public/maps/random/the_nile.js index c16d3bf412..8b91677bac 100644 --- a/binaries/data/mods/public/maps/random/the_nile.js +++ b/binaries/data/mods/public/maps/random/the_nile.js @@ -45,7 +45,7 @@ const heightPonds = -7; const heightSeaGround = -3; const heightOffsetBump = 2; -InitMap(heightLand, tPrimary); +var g_Map = new RandomMap(heightLand, tPrimary); const mapSize = getMapSize(); const mapCenter = getMapCenter(); @@ -408,4 +408,4 @@ setWaterMurkiness(1); setWaterWaviness(3.0); setWaterType("lake"); -ExportMap(); +g_Map.ExportMap(); diff --git a/binaries/data/mods/public/maps/random/the_unknown/unknown_common.js b/binaries/data/mods/public/maps/random/the_unknown/unknown_common.js index 64c946a7d2..d14b32fbf8 100644 --- a/binaries/data/mods/public/maps/random/the_unknown/unknown_common.js +++ b/binaries/data/mods/public/maps/random/the_unknown/unknown_common.js @@ -56,7 +56,7 @@ const heightCliff = 3.12; const heightHill = 18; const heightOffsetBump = 2; -InitMap(heightSeaGround, tWater); +var g_Map = new RandomMap(heightSeaGround, tWater); const numPlayers = getNumPlayers(); const mapSize = getMapSize(); diff --git a/binaries/data/mods/public/maps/random/unknown.js b/binaries/data/mods/public/maps/random/unknown.js index a9e4e9d789..f3077eae4a 100644 --- a/binaries/data/mods/public/maps/random/unknown.js +++ b/binaries/data/mods/public/maps/random/unknown.js @@ -6,4 +6,4 @@ g_AllowNaval = true; createUnknownMap(); -ExportMap(); +g_Map.ExportMap(); diff --git a/binaries/data/mods/public/maps/random/unknown_land.js b/binaries/data/mods/public/maps/random/unknown_land.js index e1bfcad566..a507b4231e 100644 --- a/binaries/data/mods/public/maps/random/unknown_land.js +++ b/binaries/data/mods/public/maps/random/unknown_land.js @@ -6,4 +6,4 @@ g_AllowNaval = false; createUnknownMap(); -ExportMap(); +g_Map.ExportMap(); diff --git a/binaries/data/mods/public/maps/random/volcanic_lands.js b/binaries/data/mods/public/maps/random/volcanic_lands.js index a89835585f..0e04cce0b8 100644 --- a/binaries/data/mods/public/maps/random/volcanic_lands.js +++ b/binaries/data/mods/public/maps/random/volcanic_lands.js @@ -25,7 +25,7 @@ var pForestP = [tGrassB + TERRAIN_SEPARATOR + oTree, tGrassB]; const heightLand = 1; const heightHill = 18; -InitMap(heightLand, tGrassB); +var g_Map = new RandomMap(heightLand, tGrassB); var numPlayers = getNumPlayers(); var mapCenter = getMapCenter(); @@ -182,4 +182,4 @@ createStragglerTrees( placePlayersNomad(clPlayer, avoidClasses(clForest, 1, clMetal, 4, clRock, 4, clHill, 4)); -ExportMap(); +g_Map.ExportMap(); diff --git a/binaries/data/mods/public/maps/random/wall_demo.js b/binaries/data/mods/public/maps/random/wall_demo.js index aa0d813666..394ea04720 100644 --- a/binaries/data/mods/public/maps/random/wall_demo.js +++ b/binaries/data/mods/public/maps/random/wall_demo.js @@ -1,6 +1,6 @@ Engine.LoadLibrary("rmgen"); -InitMap(0, "grass1"); +var g_Map = new RandomMap(0, "grass1"); /** * Demonstration code for wall placement. @@ -327,4 +327,4 @@ for (let styleIndex in wallStyleList) placeLinearWall(startX, startY, endX, endY, wallPart, style, playerID); } -ExportMap(); +g_Map.ExportMap(); diff --git a/binaries/data/mods/public/maps/random/wild_lake.js b/binaries/data/mods/public/maps/random/wild_lake.js index 2938be4da7..190a66f335 100644 --- a/binaries/data/mods/public/maps/random/wild_lake.js +++ b/binaries/data/mods/public/maps/random/wild_lake.js @@ -2,7 +2,7 @@ Engine.LoadLibrary("rmgen"); Engine.LoadLibrary("rmbiome"); Engine.LoadLibrary("heightmap"); -InitMap(0, "whiteness"); +var g_Map = new RandomMap(0, "whiteness"); /** * getArray - To ensure a terrain texture is contained within an array @@ -634,4 +634,4 @@ for (let i = 0; i < resourceSpots.length; ++i) } } -ExportMap(); +g_Map.ExportMap();