This commit is contained in:
33333-33333 2026-05-21 13:20:19 +09:00
commit b707dadec9
12 changed files with 4324 additions and 3065 deletions

View file

@ -118,6 +118,19 @@ function discreteColor(map, x, y, mode) {
];
const a = map.adminId[i];
color = a >= 0 ? palette[a % palette.length] : [220, 225, 220];
} else if (mode === "admin-debug" || mode === "borders-debug") {
const barrier = clamp(
map.ridgeField[i] * 0.88 +
Math.max(0, map.river[i] - 0.28) * 1.25 +
Math.max(0, map.flowAccum[i] - 0.36) * 0.72 +
map.slope[i] * 0.48 +
Math.max(0, map.elevation[i] - 0.54) * 0.34
);
color = [
Math.round(238 - barrier * 28),
Math.round(242 - barrier * 88),
Math.round(226 + barrier * 20),
];
} else {
color = terrainColorContinuous(map, x, y, "terrain");
}
@ -465,7 +478,8 @@ export function drawMap(canvas, map, options) {
for (const path of map.mainRivers) drawPath(ctx, path, waterBlue, 3.2);
drawHarborWorks(ctx, map);
if (map.regionalPrefectureBorders) drawSegments(ctx, map.regionalPrefectureBorders, mode === "all" ? "rgba(95,95,95,0.18)" : "rgba(95,95,95,0.30)", 1.0, false, mode === "all");
const debugBorders = mode === "admin-debug" || mode === "borders-debug";
if (map.regionalPrefectureBorders) drawSegments(ctx, map.regionalPrefectureBorders, debugBorders ? "rgba(40,40,40,0.82)" : mode === "all" ? "rgba(95,95,95,0.18)" : "rgba(95,95,95,0.30)", debugBorders ? 1.8 : 1.0, false, mode === "all");
drawSegments(ctx, map.prefectureBorder, "rgba(30,30,30,0.82)", 2.4, false, true);
drawSegments(ctx, map.prefectureBorder, "rgba(255,255,255,0.74)", 1.05, false, true);
@ -474,9 +488,9 @@ export function drawMap(canvas, map, options) {
const showHistory = ["history", "all", "terrain", "suitability"].includes(mode);
const showModern = ["modern", "all", "development", "landuse"].includes(mode);
const showRoads = ["roads", "all", "development", "landuse"].includes(mode);
const showAdmin = ["admin", "all"].includes(mode);
const showAdmin = ["admin", "all", "admin-debug", "borders-debug"].includes(mode);
if (showAdmin) drawSegments(ctx, map.adminBorders, mode === "all" ? "rgba(120,120,120,0.28)" : "rgba(120,120,120,0.65)", mode === "all" ? 0.9 : 1.3);
if (showAdmin) drawSegments(ctx, map.adminBorders, debugBorders ? "rgba(20,90,180,0.90)" : mode === "all" ? "rgba(120,120,120,0.28)" : "rgba(120,120,120,0.65)", debugBorders ? 1.5 : mode === "all" ? 0.9 : 1.3);
if (showHistory) {
for (const path of map.premodernRoads) drawPath(ctx, path, mode === "all" ? "rgba(150, 120, 90, 0.34)" : "rgba(150, 120, 90, 0.55)", mode === "all" ? 1.15 : 1.45, true);