diff options
| author | Stanislaw Halik <sthalik@misaki.pl> | 2023-03-17 23:20:46 +0100 |
|---|---|---|
| committer | Stanislaw Halik <sthalik@misaki.pl> | 2023-03-17 23:23:12 +0100 |
| commit | 90c43f035f41cf901832794f0b4e00c2b5569723 (patch) | |
| tree | 4cb7bc4f09509c03bbeb3cb3fcf6b115fca910f0 /editor | |
| parent | c17cef93bd6bbc1b071dcd82df0dbc9420e52ef4 (diff) | |
dddd
Diffstat (limited to 'editor')
| -rw-r--r-- | editor/imgui-inspect.cpp | 3 | ||||
| -rw-r--r-- | editor/inspect-types.cpp | 9 | ||||
| -rw-r--r-- | editor/update.cpp | 3 |
3 files changed, 6 insertions, 9 deletions
diff --git a/editor/imgui-inspect.cpp b/editor/imgui-inspect.cpp index 3fdbc2af..510fcf32 100644 --- a/editor/imgui-inspect.cpp +++ b/editor/imgui-inspect.cpp @@ -6,7 +6,6 @@ #include "src/world.hpp" #include "src/anim-atlas.hpp" #include "imgui-raii.hpp" -#include "chunk.inl" #include "loader/loader.hpp" namespace floormat { @@ -49,7 +48,7 @@ void app::draw_inspector() if (s.type == entity_type::scenery) { auto& s2 = static_cast<scenery&>(s); - c.with_scenery_update(s, [&] { return entities::inspect_type(s2); }); + entities::inspect_type(s2); } } if (!is_open) diff --git a/editor/inspect-types.cpp b/editor/inspect-types.cpp index dcbd534c..85b77e46 100644 --- a/editor/inspect-types.cpp +++ b/editor/inspect-types.cpp @@ -6,7 +6,6 @@ #include "inspect.hpp" #include "loader/loader.hpp" #include "chunk.hpp" -#include "chunk.inl" #include <Corrade/Containers/ArrayViewStl.h> //#define TEST_STR @@ -40,21 +39,21 @@ struct entity_accessors<scenery> { }, entity::type<Vector2b>::field{"offset"_s, [](const scenery& x) { return x.offset; }, - [](scenery& x, Vector2b value) { x.offset = value; }, + [](scenery& x, Vector2b value) { x.set_bbox(value, x.bbox_offset, x.bbox_size, x.pass); }, constantly(constraints::range{Vector2b(iTILE_SIZE2/-2), Vector2b(iTILE_SIZE2/2)}) }, entity::type<pass_mode>::field{"pass-mode"_s, [](const scenery& x) { return x.pass; }, - [](scenery& x, pass_mode value) { x.chunk().with_scenery_update(x, [&] { x.pass = value; }); }, + [](scenery& x, pass_mode value) { x.set_bbox(x.offset, x.bbox_offset, x.bbox_size, value); } }, entity::type<Vector2b>::field{"bbox-offset"_s, [](const scenery& x) { return x.bbox_offset; }, - [](scenery& x, Vector2b value) { x.chunk().with_scenery_update(x, [&] { x.bbox_offset = value; }); }, + [](scenery& x, Vector2b value) { x.set_bbox(x.offset, value, x.bbox_size, x.pass); }, [](const scenery& x) { return x.pass == pass_mode::pass ? field_status::readonly : field_status::enabled; }, }, entity::type<Vector2ub>::field{"bbox-size"_s, [](const scenery& x) { return x.bbox_size; }, - [](scenery& x, Vector2ub value) { x.chunk().with_scenery_update(x, [&] { x.bbox_size = value; }); }, + [](scenery& x, Vector2ub value) { x.set_bbox(x.offset, x.bbox_offset, value, x.pass); }, [](const scenery& x) { return x.pass == pass_mode::pass ? field_status::readonly : field_status::enabled; }, }, entity::type<bool>::field{"interactive"_s, diff --git a/editor/update.cpp b/editor/update.cpp index 7b3198ee..b16821f8 100644 --- a/editor/update.cpp +++ b/editor/update.cpp @@ -6,7 +6,6 @@ #include "floormat/events.hpp" #include "floormat/main.hpp" #include "character.hpp" -#include "chunk.inl" namespace floormat { @@ -192,7 +191,7 @@ void app::update_world(float dt) for (auto i = size-1; i != (std::size_t)-1; i--) { auto& e = *es[i]; - c.with_scenery_update(e, [&] { return e.update(i, dt); }); + e.update(i, dt); } } } |
