diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2023-03-01 17:23:27 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2023-03-01 17:23:27 +0100 |
commit | 257c2420545eb632a53c0fe3cd317be613dcb272 (patch) | |
tree | 95dfb97898f84ea60b293e60453bef1c57088fa4 /editor/update.cpp | |
parent | f6aed5a3ae2e6b2b2eb822deee0a579ca66cd13f (diff) |
editor: update bboxes from a central place
Diffstat (limited to 'editor/update.cpp')
-rw-r--r-- | editor/update.cpp | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/editor/update.cpp b/editor/update.cpp index f9afa6c9..a907117a 100644 --- a/editor/update.cpp +++ b/editor/update.cpp @@ -165,17 +165,7 @@ void app::update_world(float dt) for (std::int16_t x = minx; x <= maxx; x++) for (auto& c = world[chunk_coords{x, y}]; auto [x, k, pt] : c) if (auto sc = x.scenery()) - { - auto [atlas, s] = x.scenery(); - auto pass0 = s.passability; - auto offset0 = s.offset; - auto bb_offset0 = s.bbox_offset; - auto bb_size0 = s.bbox_size; - sc.update(dt); - if (pass0 != s.passability || offset0 != s.offset || - bb_offset0 != s.bbox_offset || bb_size0 != s.bbox_size) - c.mark_scenery_modified(); - } + c.with_scenery_bbox_update(sc.index(), [&] { sc.update(dt); }); } void app::set_cursor() |