diff --git a/include/gui/RectangleShape.hpp b/include/gui/RectangleShape.hpp index 016a541b..656747a9 100644 --- a/include/gui/RectangleShape.hpp +++ b/include/gui/RectangleShape.hpp @@ -23,17 +23,17 @@ class RectangleShape : public IDrawable, public Transformable { public: RectangleShape() = default; - RectangleShape(u16 width, u16 height, const Color &color = Color::black); + RectangleShape(float width, float height, const Color &color = Color::black); const Color &color() const { return m_color; } void setColor(const Color &color) { m_color = color; updateVertexBuffer(); } void setWireframeMode(bool wireframeMode) { m_wireframeMode = wireframeMode; } - u16 width() const { return m_width; } - u16 height() const { return m_height; } + float width() const { return m_width; } + float height() const { return m_height; } - void setSize(u16 width, u16 height) { m_width = width; m_height = height; updateVertexBuffer(); } + void setSize(float width, float height) { m_width = width; m_height = height; updateVertexBuffer(); } private: void updateVertexBuffer() const; diff --git a/resources/shaders/basic.f.glsl b/resources/shaders/basic.f.glsl index 6b3e0877..6883a255 100644 --- a/resources/shaders/basic.f.glsl +++ b/resources/shaders/basic.f.glsl @@ -6,7 +6,7 @@ varying float v_faceValue; uniform sampler2D u_tex; -// uniform int u_renderType; +uniform int u_renderType; void main() { vec4 color = v_color; diff --git a/source/gui/RectangleShape.cpp b/source/gui/RectangleShape.cpp index ec47c808..5243badd 100644 --- a/source/gui/RectangleShape.cpp +++ b/source/gui/RectangleShape.cpp @@ -19,7 +19,7 @@ #include "Shader.hpp" #include "Vertex.hpp" -RectangleShape::RectangleShape(u16 width, u16 height, const Color &color) { +RectangleShape::RectangleShape(float width, float height, const Color &color) { m_color = color; setSize(width, height); diff --git a/source/hud/Crosshair.cpp b/source/hud/Crosshair.cpp index 6ebcb46d..3350621b 100644 --- a/source/hud/Crosshair.cpp +++ b/source/hud/Crosshair.cpp @@ -25,9 +25,9 @@ Crosshair::Crosshair() { float xFactor = SCREEN_WIDTH * SCREEN_HEIGHT / 100; float yFactor = SCREEN_HEIGHT * SCREEN_WIDTH / 100; - m_hShape.setSize(0.002 * xFactor, 0.0004 * yFactor); - m_vShape1.setSize(0.0004 * xFactor, 0.001 * yFactor - m_hShape.height() / 2); - m_vShape2.setSize(0.0004 * xFactor, 0.001 * yFactor - m_hShape.height() / 2); + m_hShape.setSize(0.002 * xFactor, 0.0002 * yFactor); + m_vShape1.setSize(0.0002 * xFactor, 0.001 * yFactor - m_hShape.height() / 2); + m_vShape2.setSize(0.0002 * xFactor, 0.001 * yFactor - m_hShape.height() / 2); m_hShape.setColor(Color{200, 200, 200, 180}); m_vShape1.setColor(Color{200, 200, 200, 180}); @@ -46,12 +46,8 @@ void Crosshair::draw(RenderTarget &target, RenderStates states) const { // m_shader.setUniform("u_renderType", -1); // Shader::bind(nullptr); - // glBlendFunc(GL_ONE_MINUS_DST_COLOR, GL_ZERO); - target.draw(m_hShape, states); target.draw(m_vShape1, states); target.draw(m_vShape2, states); - - // glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); }