aboutsummaryrefslogtreecommitdiff
path: root/src/renderer/Renderer.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/renderer/Renderer.hpp')
-rw-r--r--src/renderer/Renderer.hpp23
1 files changed, 10 insertions, 13 deletions
diff --git a/src/renderer/Renderer.hpp b/src/renderer/Renderer.hpp
index 47837ee..da57e29 100644
--- a/src/renderer/Renderer.hpp
+++ b/src/renderer/Renderer.hpp
@@ -29,7 +29,7 @@ enum REntityType : int32_t {
struct REntity_AlphaBitmap {
REntityType type;
AlphaBitmap& bitmap;
- V3F32 pos;
+ V2F32 pos;
Color color;
};
@@ -49,7 +49,7 @@ struct REntity_Text {
REntityType type;
std::u32string& text;
Font& font;
- V3F32 pos;
+ V2F32 pos;
Color color;
};
@@ -62,9 +62,9 @@ union REntity {
REntity_Text text;
};
-struct RSortEntry {
- float z;
- size_t entity_index;
+struct RZBuffEntry {
+ uint32_t z;
+ uint32_t entity_index;
};
@@ -82,15 +82,14 @@ public:
void SetScreenSize(int32_t w, int32_t h);
void SetCameraSize(float w, float h);
- void PushAlphaBitmap(AlphaBitmap& bitmap, V3F32 pos, Color color);
- void PushRectangle(Rectangle rect, Color color, float z);
- void PushCircle(Circle circle, Color color, float z);
- void PushText(std::u32string& text, Font& font, V3F32 pos, Color color);
+ void PushAlphaBitmap(AlphaBitmap& bitmap, V2F32 pos, Color color, uint32_t z);
+ void PushRectangle(Rectangle rect, Color color, uint32_t z);
+ void PushCircle(Circle circle, Color color, uint32_t z);
+ void PushText(std::u32string& text, Font& font, V2F32 pos, Color color, uint32_t z);
/* helper functions */
-
int32_t WorldXToScreenX(float x);
int32_t WorldYToScreenY(float y);
int32_t WorldWidthToScreenWidth(float w);
@@ -109,11 +108,9 @@ public:
Color m_clear_color {};
std::vector<REntity> m_render_entities;
- std::vector<RSortEntry> m_sort_entries;
+ std::vector<RZBuffEntry> m_z_buff;
std::unique_ptr<RSoftwareBackend> m_backend;
-
-
friend class RSoftwareBackend;
};