summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederico Linhares <fred@linhares.blue>2023-07-18 17:09:30 -0300
committerFrederico Linhares <fred@linhares.blue>2023-07-18 17:09:30 -0300
commite1399befee43ab4549c31ce179e900ad71651edc (patch)
tree062f3e299ff5a326c92e08f1e8222afa1e663602
parent3d2b8451970a36d8942932fc017f5b74ec3f6391 (diff)
fixt Invert drawing order for sprites
* src/vk/graphics_pipeline_2d_solid.cpp: Drawing sprites with a higher z-index on top is more intuitive than the opposite.
-rw-r--r--src/vk/graphics_pipeline_2d_solid.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/vk/graphics_pipeline_2d_solid.cpp b/src/vk/graphics_pipeline_2d_solid.cpp
index 380bb65..13800dc 100644
--- a/src/vk/graphics_pipeline_2d_solid.cpp
+++ b/src/vk/graphics_pipeline_2d_solid.cpp
@@ -305,8 +305,8 @@ GraphicsPipeline2DSolid::draw(
// FIXME: I know sorting is expensive, but I need to figure out better what
// to do here.
- std::sort(view->sprites_to_draw[current_frame].rbegin(),
- view->sprites_to_draw[current_frame].rend());
+ std::sort(view->sprites_to_draw[current_frame].begin(),
+ view->sprites_to_draw[current_frame].end());
// Draw sprites
for(auto& sprite_to_draw: view->sprites_to_draw[current_frame])