feat(editor): auto-texture roads with cobblestone on flatten

- paintAlongPath(): paints a texture along a line segment with
  configurable width and quadratic edge falloff
- Road mode now automatically applies Elwynn cobblestone texture
  when flattening a road path (flatten + texture in one operation)
- Quick distance check skips chunks far from the path for performance
- Alpha blending uses max() so overlapping paths don't wash out
This commit is contained in:
Kelsi 2026-05-05 08:16:40 -07:00
parent 8974cef9c0
commit 6de6da766d
3 changed files with 67 additions and 3 deletions

View file

@ -607,11 +607,15 @@ void EditorUI::renderBrushPanel(EditorApp& app) {
ImGui::SameLine();
if (ImGui::Button("Set End + Apply##path", ImVec2(140, 0)) && brush4.isActive() && pathStartSet) {
pathEnd = brush4.getPosition();
if (pathMode == 0)
if (pathMode == 0) {
app.getTerrainEditor().carveRiver(pathStart, pathEnd, pathWidth, pathDepth);
else
app.showToast("River carved");
} else {
app.getTerrainEditor().flattenRoad(pathStart, pathEnd, pathWidth);
app.showToast(pathMode == 0 ? "River carved" : "Road flattened");
app.getTexturePainter().paintAlongPath(pathStart, pathEnd, pathWidth,
"Tileset\\Elwynn\\ElwynnCobblestoneBase.blp");
app.showToast("Road flattened + textured");
}
pathStartSet = false;
}
if (pathStartSet)