summaryrefslogtreecommitdiffhomepage
path: root/src/scenery.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-04-12 00:08:56 +0200
committerStanislaw Halik <sthalik@misaki.pl>2023-04-12 00:08:56 +0200
commit903e1644fce5652a621803a6eb3617d605d22434 (patch)
treece088b04f92ffc8bdb5e6c1d31e3981e20a5b2bb /src/scenery.cpp
parent993d828c3c2cdab6174e460c39a605dbd31d192c (diff)
wip
Diffstat (limited to 'src/scenery.cpp')
-rw-r--r--src/scenery.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/scenery.cpp b/src/scenery.cpp
index fadc0471..a07a69a5 100644
--- a/src/scenery.cpp
+++ b/src/scenery.cpp
@@ -90,22 +90,19 @@ Vector2 scenery::ordinal_offset(Vector2b offset) const
Vector2 scenery::depth_offset() const
{
- constexpr auto sc_offset = tile_shader::scenery_depth_offset;
constexpr auto inv_tile_size = 1.f/TILE_SIZE2;
Vector2 ret;
ret += Vector2(atlas->group(r).depth_offset) * inv_tile_size;
if (sc_type == scenery_type::door)
{
const bool is_open = frame != atlas->info().nframes-1;
- ret += Vector2(sc_offset * is_open, 0);
- constexpr auto off_opened = Vector2(-1, 0);
+ constexpr auto off_opened = Vector2(-1, 0) + Vector2();
constexpr auto off_closed = Vector2(0, 0);
const auto vec = is_open ? off_opened : off_closed;
const auto offset = rotate_point(vec, rotation::N, r);
ret += offset;
}
- else
- ret += Vector2(sc_offset, 0);
+ ret += Vector2(tile_shader::scenery_depth_offset, 0);
return ret;
}