diff options
| author | Stanislaw Halik <sthalik@misaki.pl> | 2022-11-06 19:20:03 +0100 |
|---|---|---|
| committer | Stanislaw Halik <sthalik@misaki.pl> | 2022-11-06 19:20:11 +0100 |
| commit | b82ebb0339a15cc05e26f9cdca646022e6b71ef4 (patch) | |
| tree | 1e8bb27a0f5d0c84de4790465cf280d77c785a33 /editor/scenery-editor.cpp | |
| parent | edc3ad8c86cb1a042134f82c738029004b116d86 (diff) | |
a
Diffstat (limited to 'editor/scenery-editor.cpp')
| -rw-r--r-- | editor/scenery-editor.cpp | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/editor/scenery-editor.cpp b/editor/scenery-editor.cpp new file mode 100644 index 00000000..c3b29c9d --- /dev/null +++ b/editor/scenery-editor.cpp @@ -0,0 +1,40 @@ +#include "scenery-editor.hpp" +#include "src/anim-atlas.hpp" + +namespace floormat { + +using rotation_ = enum rotation; +using rotation_t = std::underlying_type_t<rotation_>; + +scenery_editor::scenery_editor() noexcept +{ +} + +void scenery_editor::set_rotation(enum rotation r) +{ + _selected.s.r = r; +} + +rotation scenery_editor::rotation() const +{ + return _selected.s.r; +} + +void scenery_editor::next_rotation() +{ + auto r_1 = (rotation_t)_selected.s.r + 1; + auto rot = (rotation_)r_1; + if (rot >= rotation_::COUNT) + rot = (rotation_)0; + _selected.s.r = rot; +} + +void scenery_editor::prev_rotation() +{ + if (_selected.s.r == (rotation_)0) + _selected.s.r = (rotation_)((rotation_t)rotation_::COUNT - 1); + else + _selected.s.r = (rotation_)((rotation_t)_selected.s.r - 1); +} + +} // namespace floormat |
