From b16dea7c2fa9a4138a1f7cf45822cf5372294432 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 7 Dec 2023 14:37:59 +0100 Subject: wipshit --- src/chunk-walls.cpp | 15 ++++++++++++++- src/chunk.hpp | 2 +- src/wall-atlas.hpp | 6 +++--- 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(size_t tile, float depth) -> vertex +template<> std::array chunk::make_wall_vertex_data(Vector2 center, float depth) +{ + auto quad = wall_quad_N(Vector3(center, tile_height), TILE_SIZE); +} + +// wall west +template<> std::array chunk::make_wall_vertex_data(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 static vertex make_wall_vertex_data(size_t tile, float depth); + template static std::array make_wall_vertex_data(Vector2 center, float depth); Pointer _ground; Pointer _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 frames; std::vector direction_array; - std::array direction_map; - std::bitset direction_mask{0}; + std::array direction_map; + std::bitset 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 frames, ArrayView dir_array, - std::array dir_map); + std::array dir_map); }; class wall_atlas final -- cgit v1.2.3