From 15c2729faa691be459172c51ee6def40bfe4c723 Mon Sep 17 00:00:00 2001 From: Brett Date: Sun, 14 Apr 2024 17:37:17 -0400 Subject: [PATCH] z index --- CMakeLists.txt | 2 +- include/blt/gfx/renderer/batch_2d_renderer.h | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 96086ae..1148f95 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.25) -set(BLT_GRAPHICS_VERSION 0.9.8) +set(BLT_GRAPHICS_VERSION 0.9.9) set(BLT_GRAPHICS_TEST_VERSION 0.0.1) project(BLT_WITH_GRAPHICS VERSION ${BLT_GRAPHICS_VERSION}) diff --git a/include/blt/gfx/renderer/batch_2d_renderer.h b/include/blt/gfx/renderer/batch_2d_renderer.h index a321ac6..35fa8b1 100644 --- a/include/blt/gfx/renderer/batch_2d_renderer.h +++ b/include/blt/gfx/renderer/batch_2d_renderer.h @@ -144,54 +144,54 @@ namespace blt::gfx { const static blt::vec4 empty{0, 0, 0, 1}; const static blt::vec4 full{1, 1, 1, 1}; - complex_rectangles[texture][empty][full].emplace_back(z_index, rectangle); + complex_rectangles[texture][empty][full].emplace_back(-z_index, rectangle); } inline void drawRectangle(const blt::vec4& color, const rectangle2d_t& rectangle, blt::f32 z_index = 0) { const static blt::vec4 empty{0, 0, 0, 0}; - complex_rectangles[""][color][empty].emplace_back(z_index, rectangle); + complex_rectangles[""][color][empty].emplace_back(-z_index, rectangle); } inline void drawRectangle(const draw_state& draw_info, const rectangle2d_t& rectangle, blt::f32 z_index = 0) { - complex_rectangles[draw_info.texture_name][draw_info.color][draw_info.blend].emplace_back(z_index, rectangle); + complex_rectangles[draw_info.texture_name][draw_info.color][draw_info.blend].emplace_back(-z_index, rectangle); } inline void drawLine(std::string_view texture, const line2d_t& line, blt::f32 z_index = 0) { const static blt::vec4 empty{0, 0, 0, 1}; const static blt::vec4 full{1, 1, 1, 1}; - complex_lines[texture][empty][full].emplace_back(z_index, line); + complex_lines[texture][empty][full].emplace_back(-z_index, line); } inline void drawLine(const blt::vec4& color, const line2d_t& line, blt::f32 z_index = 0) { const static blt::vec4 empty{0, 0, 0, 0}; - complex_lines[""][color][empty].emplace_back(z_index, line); + complex_lines[""][color][empty].emplace_back(-z_index, line); } inline void drawLine(const draw_state& draw_info, const line2d_t& line, blt::f32 z_index = 0) { - complex_lines[draw_info.texture_name][draw_info.color][draw_info.blend].emplace_back(z_index, line); + complex_lines[draw_info.texture_name][draw_info.color][draw_info.blend].emplace_back(-z_index, line); } inline void drawPoint(std::string_view texture, const point2d_t& point, blt::f32 z_index = 0) { const static blt::vec4 empty{0, 0, 0, 1}; const static blt::vec4 full{1, 1, 1, 1}; - complex_points[texture][empty][full].emplace_back(z_index, point); + complex_points[texture][empty][full].emplace_back(-z_index, point); } inline void drawPoint(const blt::vec4& color, const point2d_t& point, blt::f32 z_index = 0) { const static blt::vec4 empty{0, 0, 0, 0}; - complex_points[""][color][empty].emplace_back(z_index, point); + complex_points[""][color][empty].emplace_back(-z_index, point); } inline void drawPoint(const draw_state& draw_info, const point2d_t& point, blt::f32 z_index = 0) { - complex_points[draw_info.texture_name][draw_info.color][draw_info.blend].emplace_back(z_index, point); + complex_points[draw_info.texture_name][draw_info.color][draw_info.blend].emplace_back(-z_index, point); } template