Weltkarte Klippen: Schraffierung, Zoom-abhängige Linienstärke, Wald-Stil

- Kliff-Bereiche: diagonale Schraffierung (45°, ~5.5px Abstand) im gleichen
  Grauton via gc.clip() auf die Marching-Squares-Pfade
- Klippen- und Wald-Konturlinien: 1.2px bei Zoom 0-2, 2.5px bei Zoom 3,
  3.5px bei Zoom 4 (deutlich dicker zum Reinzoomen)
- Wald-Umrandung: selber Stil und Dicke wie Klippen, aber dunkelgrün (28/78/12)
- Render-Reihenfolge bleibt: Klippen → Wasser → Wald

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-09-03 17:47:19 +02:00
parent 81c9512244
commit 972d5d6e0b

View File

@@ -557,6 +557,15 @@ public class WorldMapView extends VBox {
return (v00*(1-tx)+v10*tx)*(1-tz)+(v01*(1-tx)+v11*tx)*tz;
}
/** Linienstärke für Klippen- und Wald-Konturen – steigt bei hohem Zoom deutlich an. */
private double overlayLineWidth() {
return switch (zoomLevelIdx) {
case 3 -> 2.5;
case 4 -> 3.5;
default -> 1.2;
};
}
private void drawForestOverlay(GraphicsContext gc) {
double cW = canvas.getWidth(), cH = canvas.getHeight();
if (bakedForestOverlay != null) {
@@ -564,8 +573,8 @@ public class WorldMapView extends VBox {
}
if (!forestPaths.isEmpty()) {
gc.save();
gc.setStroke(Color.rgb(45, 99, 22, 0.85));
gc.setLineWidth(Math.max(1.0, 1.5 / scale));
gc.setStroke(Color.rgb(28, 78, 12, 0.88));
gc.setLineWidth(overlayLineWidth());
gc.setLineDashes();
for (float[][] path : forestPaths) {
drawCoastPath(gc, path, cW, cH, 8);
@@ -580,9 +589,31 @@ public class WorldMapView extends VBox {
gc.drawImage(bakedCliffOverlay, -panX / scale, -panY / scale, cW / scale, cH / scale, 0, 0, cW, cH);
}
if (!cliffPaths.isEmpty()) {
// Schraffierung: diagonale Linien, geclippt auf Kliff-Bereiche
gc.save();
gc.beginPath();
for (float[][] path : cliffPaths) {
if (path.length < 2) { continue; }
gc.moveTo(toCanvasX(path[0][0]), toCanvasZ(path[0][1]));
for (int i = 1; i < path.length; i++) {
gc.lineTo(toCanvasX(path[i][0]), toCanvasZ(path[i][1]));
}
gc.closePath();
}
gc.clip();
gc.setStroke(Color.rgb(120, 115, 115, 0.45));
gc.setLineWidth(0.8);
gc.setLineDashes();
double hatchSpacing = 5.5;
for (double d = -cH; d < cW + cH; d += hatchSpacing) {
gc.strokeLine(d, 0, d + cH, cH);
}
gc.restore();
// Konturlinie
gc.save();
gc.setStroke(Color.rgb(80, 72, 72, 0.80));
gc.setLineWidth(Math.max(1.0, 1.5 / scale));
gc.setLineWidth(overlayLineWidth());
gc.setLineDashes();
for (float[][] path : cliffPaths) {
drawCoastPath(gc, path, cW, cH, 8);