summaryrefslogtreecommitdiff
path: root/ui/editNetwork.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ui/editNetwork.cpp')
-rw-r--r--ui/editNetwork.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/ui/editNetwork.cpp b/ui/editNetwork.cpp
index ac2d93d..c4c0297 100644
--- a/ui/editNetwork.cpp
+++ b/ui/editNetwork.cpp
@@ -4,7 +4,7 @@
#include "builders/straight.h"
#include "text.h"
#include <game/gamestate.h>
-#include <game/geoData.h>
+#include <game/terrain.h>
#include <gfx/gl/sceneShader.h>
#include <gfx/models/texture.h>
@@ -26,7 +26,7 @@ bool
EditNetwork::click(const SDL_MouseButtonEvent & e, const Ray<GlobalPosition3D> & ray)
{
if (builder && (e.button == SDL_BUTTON_LEFT || e.button == SDL_BUTTON_MIDDLE)) {
- builder->click(network, gameState->geoData.get(), e, ray);
+ builder->click(network, gameState->terrain.get(), e, ray);
return true;
}
return false;
@@ -36,7 +36,7 @@ bool
EditNetwork::move(const SDL_MouseMotionEvent & e, const Ray<GlobalPosition3D> & ray)
{
if (builder) {
- builder->move(network, gameState->geoData.get(), e, ray);
+ builder->move(network, gameState->terrain.get(), e, ray);
}
return false;
}
@@ -64,6 +64,17 @@ EditNetwork::Builder::render(const SceneShader & shader) const
}
void
+EditNetwork::Builder::setHeightsFor(Network * network, const Link::CCollection & links, GeoData::SetHeightsOpts opts)
+{
+ opts.surface = network->getBaseSurface();
+ const auto width = network->getBaseWidth();
+
+ for (const auto & link : links) {
+ gameState->terrain->setHeights(link->getBase(width), opts);
+ }
+}
+
+void
EditNetwork::render(const UIShader & shader, const UIComponent::Position & parentPos) const
{
if (builder) {