diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2022-11-07 15:27:08 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2022-11-07 15:27:08 +0100 |
commit | 151e1f9a56bce31c2703610980c00fc8f527aa6a (patch) | |
tree | c4663ffca0ff35dc2dda04f3cd8e54966683faa2 /editor | |
parent | 9e390f58ea6e4c50d7ba104c5fe3ad97f74fe6f0 (diff) |
wip
Diffstat (limited to 'editor')
-rw-r--r-- | editor/app.cpp | 4 | ||||
-rw-r--r-- | editor/app.hpp | 2 | ||||
-rw-r--r-- | editor/update.cpp | 1 |
3 files changed, 6 insertions, 1 deletions
diff --git a/editor/app.cpp b/editor/app.cpp index 77f77f83..a2c8b104 100644 --- a/editor/app.cpp +++ b/editor/app.cpp @@ -4,6 +4,7 @@ #include "floormat/settings.hpp" #include "src/loader.hpp" #include "world.hpp" +#include "src/anim-atlas.hpp" #include <algorithm> #include <Corrade/Utility/Arguments.h> @@ -14,7 +15,8 @@ app::app(fm_settings&& opts) : _floor1{loader.tile_atlas("floor-tiles", {44, 4})}, _floor2{loader.tile_atlas("metal1", {2, 2})}, _wall1{loader.tile_atlas("wood2", {2, 1})}, - _wall2{loader.tile_atlas("wood1", {2, 1})} + _wall2{loader.tile_atlas("wood1", {2, 1})}, + _door{loader.anim_atlas("door_close")} { world& w = M->world(); chunk_coords coord{0 ,0}; diff --git a/editor/app.hpp b/editor/app.hpp index aa4f6490..d784fe9a 100644 --- a/editor/app.hpp +++ b/editor/app.hpp @@ -24,6 +24,7 @@ struct floormat_main; struct tile_atlas; struct tile_editor; struct fm_settings; +struct anim_atlas; struct cursor_state final { std::optional<Vector2i> pixel; @@ -98,6 +99,7 @@ private: Containers::Pointer<floormat_main> M; ImGuiIntegration::Context _imgui{NoCreate}; std::shared_ptr<tile_atlas> _floor1, _floor2, _wall1, _wall2; + std::shared_ptr<anim_atlas> _door; wireframe_mesh<wireframe::quad_floor> _wireframe_quad; wireframe_mesh<wireframe::quad_wall_n> _wireframe_wall_n; wireframe_mesh<wireframe::quad_wall_w> _wireframe_wall_w; diff --git a/editor/update.cpp b/editor/update.cpp index 569d81dc..ed9c2561 100644 --- a/editor/update.cpp +++ b/editor/update.cpp @@ -29,6 +29,7 @@ void app::maybe_initialize_chunk_(const chunk_coords& pos, chunk& c) c[{K, K }].wall_west() = { _wall2, 0 }; c[{K, K+1}].wall_north() = { _wall1, 0 }; c[{K+1, K }].wall_west() = { _wall2, 0 }; + c[{K+1, K+1}].scenery() = { _door, {rotation::N, 0} }; } void app::maybe_initialize_chunk([[maybe_unused]] const chunk_coords& pos, [[maybe_unused]] chunk& c) |