diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2023-09-16 16:43:00 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2023-09-20 20:25:52 +0200 |
commit | 02f712a439ef3f59569c4e942024b496eeb24370 (patch) | |
tree | 38c9650021890f128e5afea5acc55bf6dec60052 /src | |
parent | fb287a0caf3c129150c19a4b6db6188a5ff2053d (diff) |
scenery: externalize door z-offset
Diffstat (limited to 'src')
-rw-r--r-- | src/scenery.cpp | 9 | ||||
-rw-r--r-- | src/scenery.hpp | 3 |
2 files changed, 2 insertions, 10 deletions
diff --git a/src/scenery.cpp b/src/scenery.cpp index 29198b0f..f3a11f6d 100644 --- a/src/scenery.cpp +++ b/src/scenery.cpp @@ -93,15 +93,6 @@ float scenery::depth_offset() const constexpr auto inv_tile_size = 1.f/TILE_SIZE2; Vector2 offset; offset += Vector2(atlas->group(r).depth_offset) * inv_tile_size; - if (sc_type == scenery_type::door) - { - const bool is_open = frame != atlas->info().nframes-1; - constexpr auto off_opened = Vector2(-1, 0); - constexpr auto off_closed = Vector2(-1, 0); - const auto vec = is_open ? off_opened : off_closed; - const auto pt = rotate_point(vec, rotation::N, r); - offset += pt; - } float ret = 0; ret += offset[1]*TILE_MAX_DIM + offset[0]; ret += tile_shader::scenery_depth_offset; diff --git a/src/scenery.hpp b/src/scenery.hpp index 1c3b03ad..70b7733c 100644 --- a/src/scenery.hpp +++ b/src/scenery.hpp @@ -14,7 +14,8 @@ struct anim_atlas; struct world; enum class scenery_type : unsigned char { - none, generic, door, + none, generic, + door, // todo remove it }; constexpr inline size_t scenery_type_BITS = 3; |