From 9b063b749faedd17fd8f6d76a25d84f066a92814 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 21 Nov 2022 12:01:48 +0100 Subject: scenery work --- editor/scenery-editor.cpp | 6 +++--- editor/scenery-editor.hpp | 2 +- editor/update.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'editor') diff --git a/editor/scenery-editor.cpp b/editor/scenery-editor.cpp index 1f2fabf3..482b2131 100644 --- a/editor/scenery-editor.cpp +++ b/editor/scenery-editor.cpp @@ -29,7 +29,7 @@ void scenery_editor::next_rotation() { auto r_1 = (rotation_t)_selected.r + 1; auto rot = (rotation_)r_1; - if (rot >= rotation_::COUNT) + if (rot >= rotation_COUNT) rot = (rotation_)0; _selected.r = rot; } @@ -37,7 +37,7 @@ void scenery_editor::next_rotation() void scenery_editor::prev_rotation() { if (_selected.r == (rotation_)0) - _selected.r = (rotation_)((rotation_t)rotation_::COUNT - 1); + _selected.r = (rotation_)((rotation_t)rotation_COUNT - 1); else _selected.r = (rotation_)((rotation_t)_selected.r - 1); } @@ -52,7 +52,7 @@ void scenery_editor::select_tile(const std::shared_ptr& atlas, rotat void scenery_editor::clear_selection() { - _selected = { nullptr, rotation_::COUNT, scenery::NO_FRAME }; + _selected = { nullptr, rotation_COUNT, scenery::NO_FRAME }; } auto scenery_editor::get_selected() -> pair diff --git a/editor/scenery-editor.hpp b/editor/scenery-editor.hpp index 9b89d2da..85ccd3be 100644 --- a/editor/scenery-editor.hpp +++ b/editor/scenery-editor.hpp @@ -14,7 +14,7 @@ struct scenery_editor final struct pair final { std::shared_ptr atlas; - enum rotation r = rotation::COUNT; + enum rotation r = rotation_COUNT; frame_t frame = scenery::NO_FRAME; operator bool() const; }; diff --git a/editor/update.cpp b/editor/update.cpp index cc765268..60d012d2 100644 --- a/editor/update.cpp +++ b/editor/update.cpp @@ -29,7 +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, scenery{0, rotation::N} }; + c[{K+1, K+1}].scenery() = { scenery::door, rotation::N, _door, false }; c.mark_modified(); } -- cgit v1.2.3