From e1399befee43ab4549c31ce179e900ad71651edc Mon Sep 17 00:00:00 2001 From: Frederico Linhares Date: Tue, 18 Jul 2023 17:09:30 -0300 Subject: 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. --- src/vk/graphics_pipeline_2d_solid.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') 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]) -- cgit v1.2.3