summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/chunk-walls.cpp24
-rw-r--r--src/wall-atlas.cpp1
2 files changed, 16 insertions, 9 deletions
diff --git a/src/chunk-walls.cpp b/src/chunk-walls.cpp
index 77ab2673..8cfdaf64 100644
--- a/src/chunk-walls.cpp
+++ b/src/chunk-walls.cpp
@@ -119,26 +119,32 @@ template<> std::array<Vector3, 4> chunk::make_wall_vertex_data<Group_::side, tru
// top north
template<> std::array<Vector3, 4> chunk::make_wall_vertex_data<Group_::top, false>(float depth)
{
- auto top_right = Vector2{X , Y - depth },
+ auto top_right = Vector2{X, Y - depth },
bottom_right = Vector2{top_right.x(), Y },
top_left = Vector2{-X, top_right.y() },
bottom_left = Vector2{top_left.x(), bottom_right.y() };
- // br tr
- // tr tl
- // bl br
- // tl bl
return {{
- { top_right.x(), top_right.y(), Z },
- { top_left.x(), top_left.y(), Z },
- { bottom_right.x(), bottom_right.y(), Z },
- { bottom_left.x(), bottom_left.y(), Z }
+ { top_right.x(), top_right.y(), Z }, // br tr
+ { top_left.x(), top_left.y(), Z }, // tr tl
+ { bottom_right.x(), bottom_right.y(), Z }, // bl br
+ { bottom_left.x(), bottom_left.y(), Z }, // tl bl
}};
}
// top west
template<> std::array<Vector3, 4> chunk::make_wall_vertex_data<Group_::top, true>(float depth)
{
+ auto top_right = Vector2{-X, -Y },
+ top_left = Vector2{top_right.x() - depth, top_right.y() },
+ bottom_right = Vector2{-X, Y },
+ bottom_left = Vector2{bottom_right.x() - depth, bottom_right.y() };
+ return {{
+ { bottom_right.x(), bottom_right.y(), Z },
+ { top_right.x(), top_right.y(), Z },
+ { bottom_left.x(), bottom_left.y(), Z },
+ { top_left.x(), top_left.y(), Z },
+ }};
}
// -----------------------
diff --git a/src/wall-atlas.cpp b/src/wall-atlas.cpp
index e637007d..b08afbb3 100644
--- a/src/wall-atlas.cpp
+++ b/src/wall-atlas.cpp
@@ -45,6 +45,7 @@ wall_atlas::wall_atlas(wall_atlas_def def, String path, const ImageView2D& img)
_info{std::move(def.header)}, _path{std::move(path)},
_direction_map{def.direction_map}
{
+ // todo resolve `from_rotation` here
_texture.setLabel(_path)
.setWrapping(GL::SamplerWrapping::ClampToEdge)
.setMagnificationFilter(GL::SamplerFilter::Nearest)