hmm?
This commit is contained in:
parent
ea0067dc0a
commit
112e6bf86b
11 changed files with 1586 additions and 1253 deletions
|
|
@ -1,5 +1,5 @@
|
|||
import { CELL_SIZE, MAP_H, MAP_W, indexOf } from "./mapUtils.js";
|
||||
import { generateTerrainAndRivers } from "./mapTerrain.js";
|
||||
import { generateInitialTerrainRect, generateTerrainAndRivers } from "./mapTerrain.js";
|
||||
import { generateMapFeatures } from "./mapFeatures.js";
|
||||
import { finishMapOutput } from "./mapOutput.js";
|
||||
import { generateAdminLayout } from "./mapAdminStage.js";
|
||||
|
|
@ -8,6 +8,21 @@ import { finalizeAdminAwareTransport } from "./mapPostAdminTransport.js";
|
|||
|
||||
export { CELL_SIZE, MAP_H, MAP_W, indexOf } from "./mapUtils.js";
|
||||
|
||||
function generateInitialTerrain(seed, options = {}) {
|
||||
// The original high-detail terrain system remains the default for full-map
|
||||
// generation. Rect-native terrain is available as an explicit option and is
|
||||
// used by patch generation, but the historical noise/natural-compartment
|
||||
// pipeline is still the visual baseline for ordinary maps.
|
||||
if (options?.rectNativeInitial === true) return generateInitialTerrainRect(seed, options);
|
||||
return generateTerrainAndRivers(seed, options);
|
||||
}
|
||||
|
||||
function terrainStageLabel(options = {}) {
|
||||
return options?.rectNativeInitial === true
|
||||
? "Rect-native terrain, rivers, and natural compartments"
|
||||
: "Terrain, rivers, and natural compartments";
|
||||
}
|
||||
|
||||
function nowMs() {
|
||||
return typeof performance !== "undefined" && performance.now ? performance.now() : Date.now();
|
||||
}
|
||||
|
|
@ -51,7 +66,7 @@ export function generateMap(seedInput = 114514, options = {}) {
|
|||
const generationTimings = [];
|
||||
const stage = (key, label, fn) => timedStage(generationTimings, options, key, label, fn);
|
||||
|
||||
const terrain = stage("terrain", "Terrain, rivers, and natural compartments", () => generateTerrainAndRivers(seed, options));
|
||||
const terrain = stage("terrain", terrainStageLabel(options), () => generateInitialTerrain(seed, options));
|
||||
const {
|
||||
elevation,
|
||||
slope,
|
||||
|
|
@ -134,7 +149,7 @@ export async function generateMapAsync(seedInput = 114514, options = {}) {
|
|||
const generationTimings = [];
|
||||
const stage = (key, label, fn) => timedStageAsync(generationTimings, options, key, label, fn);
|
||||
|
||||
const terrain = await stage("terrain", "Terrain, rivers, and natural compartments", () => generateTerrainAndRivers(seed, options));
|
||||
const terrain = await stage("terrain", terrainStageLabel(options), () => generateInitialTerrain(seed, options));
|
||||
const {
|
||||
elevation,
|
||||
slope,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue