diff options
| author | Stanislaw Halik <sthalik@misaki.pl> | 2022-10-04 17:55:05 +0200 |
|---|---|---|
| committer | Stanislaw Halik <sthalik@misaki.pl> | 2022-10-04 17:55:05 +0200 |
| commit | b0bf26a6ff0071a4edb43c3bfb331110d025aae4 (patch) | |
| tree | 8296ac490fe12915c7474592136e31d8ce78d4b9 /main.cpp | |
| parent | eaa84e4cc36fbed509364d1084ddac368a745a33 (diff) | |
a
Diffstat (limited to 'main.cpp')
| -rw-r--r-- | main.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -4,6 +4,7 @@ #include "tile.hpp" #include "chunk.hpp" #include "floor-mesh.hpp" +#include "wall-mesh.hpp" #include "compat/defs.hpp" #include <bitset> @@ -65,6 +66,7 @@ struct app final : Platform::Application loader.tile_atlas("../share/game/images/metal2.tga", {2, 2}); chunk _chunk = make_test_chunk(); floor_mesh _floor_mesh; + wall_mesh _wall_mesh; Vector2 camera_offset; enum_bitset<key> keys; @@ -75,11 +77,15 @@ using namespace Math::Literals; chunk app::make_test_chunk() { + constexpr auto N = TILE_MAX_DIM; chunk c; c.foreach_tile([&, this](tile& x, std::size_t k, local_coords) { const auto& atlas = floor1; x.ground_image = { atlas, (std::uint8_t)(k % atlas->size()) }; }); + c[{N/2 + 1, N/2}].wall_north = { wall1, 0 }; + c[{N/2 + 1, N/2 + 1}].wall_north = { wall1, 0 }; + c[{N/2, N/2}].wall_north = { wall1, 0 }; return c; } @@ -92,6 +98,7 @@ void app::update_window_scale() void app::draw_chunk(chunk& c) { _floor_mesh.draw(_shader, c); + _wall_mesh.draw(_shader, c); } app::app(const Arguments& arguments): |
