Tile &tile = tiles[x+y*width];
if(tile.nodes[i].elevation==ref)
{
- tile.nodes[i].elevation = elev;
+ tile.set_node_elevation(i, elev);
signal_tile_changed.emit(x, y);
}
}
}
else
{
- tiles[c.x+c.y*width].nodes[c.i].elevation = elev;
+ tiles[c.x+c.y*width].set_node_elevation(c.i, elev);
signal_tile_changed.emit(c.x, c.y);
}
}
secondary_axis(false)
{ }
+void Terrain::Tile::set_node_elevation(unsigned i, float e)
+{
+ nodes[i].elevation = e;
+ secondary_axis = ((nodes[1].elevation+nodes[2].elevation) < (nodes[0].elevation+nodes[3].elevation));
+}
+
void Terrain::Tile::save(list<DataFile::Statement> &st) const
{
bool flat = true;