mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-09-21 20:06:40 +00:00
Fix some map load progress numbers
Differential Revision: https://code.wildfiregames.com/D1340 Reviewed by: elexis This was SVN commit r21388.
This commit is contained in:
@@ -33,7 +33,7 @@ function MountainRangeBuilder(args)
|
||||
/**
|
||||
* Array of Vector2D locations where a mountainrange can start or end.
|
||||
*/
|
||||
this.vertices = args.getPoints();
|
||||
this.vertices = args.points;
|
||||
|
||||
/**
|
||||
* Number of mountainranges starting or ending at the given point.
|
||||
@@ -204,7 +204,7 @@ MountainRangeBuilder.prototype.CreateMountainRanges = function()
|
||||
|
||||
while (this.possibleEdges.length)
|
||||
{
|
||||
Engine.SetProgress(20 + 15 * this.possibleEdges.length / max)
|
||||
Engine.SetProgress(35 - 15 * this.possibleEdges.length / max);
|
||||
|
||||
this.index = randIntExclusive(0, this.possibleEdges.length);
|
||||
this.UpdateCurrentEdge();
|
||||
|
||||
@@ -127,7 +127,7 @@ createLayeredPatches(
|
||||
scaleByMapSize(30, 90),
|
||||
clDirt);
|
||||
|
||||
Engine.SetProgress(55);
|
||||
Engine.SetProgress(60);
|
||||
|
||||
g_Map.log("Creating stone mines");
|
||||
var group = new SimpleGroup([new SimpleObject(oStoneSmall, 0, 2, 0, 4, 0, 2 * Math.PI, 1), new SimpleObject(oStoneLarge, 1, 1, 0, 4, 0, 2 * Math.PI, 4)], true, clRock);
|
||||
|
||||
@@ -117,7 +117,7 @@ var areaIsland = createArea(
|
||||
new RectPlacer(new Vector2D(fractionToTiles(0.4), mapBounds.top), new Vector2D(fractionToTiles(0.6), mapCenter.y), Infinity),
|
||||
new TileClassPainter(g_TileClasses.island),
|
||||
avoidClasses(g_TileClasses.water, 0));
|
||||
Engine.SetProgress(35);
|
||||
Engine.SetProgress(37);
|
||||
|
||||
g_Map.log("Painting shoreline");
|
||||
createArea(
|
||||
|
||||
@@ -102,7 +102,7 @@ placePlayerBases({
|
||||
"count": 2
|
||||
}
|
||||
});
|
||||
Engine.SetProgress(10);
|
||||
Engine.SetProgress(30);
|
||||
|
||||
g_Map.log("Painting paths");
|
||||
var pathBlending = numPlayers <= 4;
|
||||
|
||||
@@ -120,7 +120,7 @@ createAreas(
|
||||
],
|
||||
avoidClasses(clIsland, 6),
|
||||
scaleByMapSize(25, 80));
|
||||
Engine.SetProgress(30);
|
||||
Engine.SetProgress(20);
|
||||
|
||||
// Notice that the Constraints become much shorter when avoiding water rather than staying on islands
|
||||
g_Map.log("Marking water");
|
||||
@@ -128,7 +128,7 @@ createArea(
|
||||
new MapBoundsPlacer(),
|
||||
new TileClassPainter(clWater),
|
||||
new HeightConstraint(-Infinity, heightShoreLower));
|
||||
Engine.SetProgress(20);
|
||||
Engine.SetProgress(30);
|
||||
|
||||
g_Map.log("Creating undersea bumps");
|
||||
createAreas(
|
||||
@@ -176,8 +176,6 @@ createAreas(
|
||||
scaleByMapSize(4, 13));
|
||||
Engine.SetProgress(50);
|
||||
|
||||
Engine.SetProgress(50);
|
||||
|
||||
g_Map.log("Painting corals");
|
||||
paintTerrainBasedOnHeight(-Infinity, heightCoralsLower, Elevation_IncludeMin_ExcludeMax, tWater);
|
||||
paintTerrainBasedOnHeight(heightCoralsLower, heightCoralsUpper, Elevation_IncludeMin_ExcludeMax, tCoralsLower);
|
||||
@@ -287,7 +285,7 @@ createFood(
|
||||
avoidClasses(clWater, 1, clPlayer, 15, clVolcano, 4, clBaseResource, 4, clHill, 2, clMetal, 4, clRock, 4),
|
||||
clFood);
|
||||
|
||||
Engine.SetProgress(70);
|
||||
Engine.SetProgress(87);
|
||||
|
||||
createFood(
|
||||
[
|
||||
|
||||
@@ -502,7 +502,7 @@ createDecoration(
|
||||
aBushesIslands.map(bush => [new SimpleObject(bush, 0, 4, 2, 4)]),
|
||||
aBushesIslands.map(bush => scaleByMapSize(20, 150) * randIntInclusive(1, 3)),
|
||||
[stayClasses(clIsland, 0), avoidCollisions]);
|
||||
Engine.SetProgress(99);
|
||||
Engine.SetProgress(97);
|
||||
|
||||
createDecoration(
|
||||
[[new SimpleObject(aRock, 0, 4, 2, 4)]],
|
||||
|
||||
@@ -450,7 +450,7 @@ createObjectGroupsDeprecated(
|
||||
0,
|
||||
avoidClasses(clRain, 5),
|
||||
scaleByMapSize(80, 250));
|
||||
Engine.SetProgress(95);
|
||||
Engine.SetProgress(98);
|
||||
|
||||
placePlayersNomad(clPlayer, avoidClasses(clWater, 4, clHill, 4, clForest, 1, clMetal, 4, clRock, 4, clHill, 4, clFood, 2));
|
||||
|
||||
|
||||
@@ -272,7 +272,7 @@ createObjectGroupsDeprecated(group, 0,
|
||||
8 * scaleByMapSize(13, 200), 50
|
||||
);
|
||||
|
||||
Engine.SetProgress(95);
|
||||
Engine.SetProgress(96);
|
||||
|
||||
createStragglerTrees(
|
||||
[oTree, oPalm],
|
||||
@@ -290,7 +290,7 @@ createObjectGroupsDeprecated(group, 0,
|
||||
3 * numPlayers, 50
|
||||
);
|
||||
|
||||
Engine.SetProgress(75);
|
||||
Engine.SetProgress(97);
|
||||
|
||||
g_Map.log("Creating berry bush");
|
||||
group = new SimpleGroup(
|
||||
|
||||
@@ -369,7 +369,7 @@ Engine.SetProgress(90);
|
||||
g_Map.log("Creating hawk");
|
||||
for (let i = 0; i < scaleByMapSize(0, 2); ++i)
|
||||
g_Map.placeEntityAnywhere(oHawk, 0, mapCenter, randomAngle());
|
||||
Engine.SetProgress(90);
|
||||
Engine.SetProgress(91);
|
||||
|
||||
createDecoration(
|
||||
aBushes.map(bush => [new SimpleObject(bush, 0, 3, 2, 4)]),
|
||||
|
||||
@@ -130,7 +130,7 @@ createArea(
|
||||
new TileClassPainter(g_TileClasses.mountain),
|
||||
],
|
||||
new SlopeConstraint(2, Infinity));
|
||||
Engine.SetProgress(45);
|
||||
Engine.SetProgress(55);
|
||||
|
||||
if (!isNomad())
|
||||
{
|
||||
|
||||
@@ -229,7 +229,7 @@ createObjectGroupsDeprecated(group, 0,
|
||||
avoidClasses(clWater, 3, clForest, 1, clPlayer, 20, clMetal, 10, clRock, 5, clHill, 1),
|
||||
scaleByMapSize(8,32), 100
|
||||
);
|
||||
Engine.SetProgress(95);
|
||||
Engine.SetProgress(80);
|
||||
|
||||
createStragglerTrees(
|
||||
[oPine],
|
||||
@@ -247,7 +247,7 @@ createObjectGroupsDeprecated(group, 0,
|
||||
3 * numPlayers, 50
|
||||
);
|
||||
|
||||
Engine.SetProgress(75);
|
||||
Engine.SetProgress(90);
|
||||
|
||||
g_Map.log("Creating sheep");
|
||||
group = new SimpleGroup(
|
||||
|
||||
@@ -158,7 +158,7 @@ var areaVesuv = createArea(
|
||||
new TileClassPainter(g_TileClasses.lava)
|
||||
],
|
||||
new HeightConstraint(heightLavaVesuv, Infinity));
|
||||
Engine.SetProgress(20);
|
||||
Engine.SetProgress(46);
|
||||
|
||||
g_Map.log("Adding smoke...");
|
||||
createObjectGroupsByAreas(
|
||||
@@ -188,7 +188,7 @@ for (let i = 0; i < scaleByMapSize(2, 4); ++i)
|
||||
g_Map.placeEntityPassable(randBool(0.4) ? g_Gaia.dock : g_Gaia.dockRubble, 0, dockPosition, -positionLand.angleTo(dockPosition) + Math.PI / 2);
|
||||
g_TileClasses.dock.add(dockPosition);
|
||||
}
|
||||
Engine.SetProgress(10);
|
||||
Engine.SetProgress(47);
|
||||
|
||||
if (!isNomad())
|
||||
{
|
||||
@@ -208,7 +208,7 @@ if (!isNomad())
|
||||
new ClumpPlacer(diskArea(defaultPlayerBaseRadius() * 0.8), 0.95, 0.6, Infinity, position),
|
||||
new SmoothElevationPainter(ELEVATION_SET, g_Map.getHeight(position), 6));
|
||||
}
|
||||
Engine.SetProgress(50);
|
||||
Engine.SetProgress(48);
|
||||
|
||||
addElements([
|
||||
{
|
||||
|
||||
@@ -340,7 +340,7 @@ addElements([
|
||||
"amounts": ["few"]
|
||||
}
|
||||
]);
|
||||
Engine.SetProgress(85);
|
||||
Engine.SetProgress(95);
|
||||
|
||||
placePlayersNomad(
|
||||
g_Map.createTileClass(),
|
||||
|
||||
@@ -848,7 +848,7 @@ function createUnknownObjects()
|
||||
[avoidClasses(clPlayer, 15, clHill, randIntInclusive(6, 18)), stayClasses(clLand, 0)],
|
||||
randIntInclusive(0, scaleByMapSize(4, 8))*randIntInclusive(1, scaleByMapSize(4, 9))
|
||||
);
|
||||
Engine.SetProgress(50);
|
||||
Engine.SetProgress(30);
|
||||
|
||||
g_Map.log("Creating forests");
|
||||
let [numForest, numStragglers] = getTreeCounts(...rBiomeTreeCount(1));
|
||||
|
||||
@@ -577,7 +577,7 @@ for (let h = 0; h < heighLimits.length; ++h)
|
||||
if (actor)
|
||||
g_Map.placeEntityAnywhere(actor, 0, randomPositionOnTile(point), randomAngle());
|
||||
}
|
||||
Engine.SetProgress(80);
|
||||
Engine.SetProgress(40);
|
||||
|
||||
g_Map.log("Placing resources");
|
||||
let avoidPoints = playerPosition.map(pos => pos.clone());
|
||||
|
||||
Reference in New Issue
Block a user