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));
+ update_axis();
+}
+
+void Terrain::Tile::update_axis()
+{
+ secondary_axis = (abs(nodes[1].elevation-nodes[2].elevation) < abs(nodes[0].elevation-nodes[3].elevation));
}
void Terrain::Tile::save(list<DataFile::Statement> &st) const
Tile &t = obj.tiles[next_tile];
Tile::Loader ldr(obj, t);
load_sub_with(ldr);
+ t.update_axis();
unsigned x = next_tile%obj.width;
unsigned y = next_tile/obj.width;
++next_tile;