summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-12-07 14:37:59 +0100
committerStanislaw Halik <sthalik@misaki.pl>2023-12-09 05:08:49 +0100
commitb16dea7c2fa9a4138a1f7cf45822cf5372294432 (patch)
tree0cefd49378387df67fc1d38a72d5a4a957b89c43 /src
parent820d129a06155dd2b05064cbda63841b4c4bd4dd (diff)
wipshit
Diffstat (limited to 'src')
-rw-r--r--src/chunk-walls.cpp15
-rw-r--r--src/chunk.hpp2
-rw-r--r--src/wall-atlas.hpp6
3 files changed, 18 insertions, 5 deletions
diff --git a/src/chunk-walls.cpp b/src/chunk-walls.cpp
index 1d976932..0e3c3d31 100644
--- a/src/chunk-walls.cpp
+++ b/src/chunk-walls.cpp
@@ -17,6 +17,13 @@ namespace floormat {
using namespace floormat::Quads;
using Wall::Group_;
+namespace {
+
+constexpr Vector2 half_tile = TILE_SIZE2*.5f;
+constexpr float hx = half_tile.x(), hy = half_tile.y();
+constexpr float tile_height = TILE_SIZE.z();
+
+} // namespace
void chunk::ensure_alloc_walls()
{
@@ -27,7 +34,13 @@ void chunk::ensure_alloc_walls()
// -----------------------
// wall north
-template<> auto chunk::make_wall_vertex_data<Group_::wall, false>(size_t tile, float depth) -> vertex
+template<> std::array<Vector3, 4> chunk::make_wall_vertex_data<Group_::wall, false>(Vector2 center, float depth)
+{
+ auto quad = wall_quad_N(Vector3(center, tile_height), TILE_SIZE);
+}
+
+// wall west
+template<> std::array<Vector3, 4> chunk::make_wall_vertex_data<Group_::wall, true>(Vector2 center, float depth)
{
}
diff --git a/src/chunk.hpp b/src/chunk.hpp
index 0c10e1be..32d72d77 100644
--- a/src/chunk.hpp
+++ b/src/chunk.hpp
@@ -135,7 +135,7 @@ private:
bool empty() const { return count_N == 0 && count_W == 0; }
};
- template<Wall::Group_ G, bool IsWest> static vertex make_wall_vertex_data(size_t tile, float depth);
+ template<Wall::Group_ G, bool IsWest> static std::array<Vector3, 4> make_wall_vertex_data(Vector2 center, float depth);
Pointer<ground_stuff> _ground;
Pointer<wall_stuff> _walls;
diff --git a/src/wall-atlas.hpp b/src/wall-atlas.hpp
index 1a30adbe..c08a53e7 100644
--- a/src/wall-atlas.hpp
+++ b/src/wall-atlas.hpp
@@ -91,14 +91,14 @@ struct wall_atlas_def final
Wall::Info header;
std::vector<Wall::Frame> frames;
std::vector<Wall::Direction> direction_array;
- std::array<Wall::DirArrayIndex, Direction_COUNT> direction_map;
- std::bitset<Direction_COUNT> direction_mask{0};
+ std::array<Wall::DirArrayIndex, Wall::Direction_COUNT> direction_map;
+ std::bitset<Wall::Direction_COUNT> direction_mask{0};
static wall_atlas_def deserialize(StringView filename);
void serialize(StringView filename) const;
static void serialize(StringView filename, const Wall::Info& header, ArrayView<const Wall::Frame> frames,
ArrayView<const Wall::Direction> dir_array,
- std::array<Wall::DirArrayIndex, Direction_COUNT> dir_map);
+ std::array<Wall::DirArrayIndex, Wall::Direction_COUNT> dir_map);
};
class wall_atlas final