summaryrefslogtreecommitdiffhomepage
path: root/src/chunk-scenery.hpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-03-26 20:46:58 +0200
committerStanislaw Halik <sthalik@misaki.pl>2023-03-26 21:00:31 +0200
commit5bcdf8483bef409a3aaf1ee80d4a5e9c496c7034 (patch)
tree4319b29a0fb13307ec672adf67ce4729f7324bb7 /src/chunk-scenery.hpp
parent4933abff981f39a69fb3032eecdf99d01cb666b2 (diff)
src/chunk: add sprite topological sort
Diffstat (limited to 'src/chunk-scenery.hpp')
-rw-r--r--src/chunk-scenery.hpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/chunk-scenery.hpp b/src/chunk-scenery.hpp
index 0e24f6ff..56efdfd7 100644
--- a/src/chunk-scenery.hpp
+++ b/src/chunk-scenery.hpp
@@ -7,17 +7,19 @@ namespace floormat {
struct chunk::topo_sort_data
{
+ enum m : uint8_t { mode_none, mode_static, mode_character, };
+
+ const entity* in = nullptr;
Vector2i min, max, center;
float slope = 0, ord;
- bool visited : 1 = false;
- bool is_character : 1;
+ m mode : 2 = mode_none;
+ uint8_t visited : 1 = false;
bool intersects(const topo_sort_data& other) const;
- friend bool operator<(const topo_sort_data& a, const topo_sort_data& b);
};
struct chunk::draw_entity
{
- entity* e;
+ const entity *e;
float ord;
topo_sort_data data;
};