diff options
Diffstat (limited to 'src/render.cpp')
-rw-r--r-- | src/render.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/render.cpp b/src/render.cpp index b80dcbd..2c8f7a4 100644 --- a/src/render.cpp +++ b/src/render.cpp @@ -135,8 +135,13 @@ void state_t::render(game::state_t *game) ents = game->world.get_render_entities(bbox); ents.sort( [](const world::entity_t *x, const world::entity_t *y) -> bool - { - return x->render_bounds[1][1] < y->render_bounds[1][1]; + { + if (x->render_layer < y->render_layer) + return true; + else if (x->render_layer > y->render_layer) + return false; + else + return x->render_bounds[1][1] < y->render_bounds[1][1]; }); for (world::entity_t *ent : ents) { |