diff options
author | dec05eba <dec05eba@protonmail.com> | 2021-06-12 04:37:50 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2021-06-12 04:37:50 +0200 |
commit | a462f8bcea50c7ad9f33eefc62c03f9ed6fd890b (patch) | |
tree | 86c67707c46755e0d84d382ec1135f7f248f42d1 /src | |
parent | f903b027871a989c1956e6bf16b47e302a01c763 (diff) |
Revert back to optimized shaders
Diffstat (limited to 'src')
-rw-r--r-- | src/RoundedRectangle.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/RoundedRectangle.cpp b/src/RoundedRectangle.cpp index 5baeac6..735c182 100644 --- a/src/RoundedRectangle.cpp +++ b/src/RoundedRectangle.cpp @@ -12,8 +12,9 @@ namespace QuickMedia { vertices[1].texCoords = sf::Vector2f(1.0f, 0.0f); vertices[2].texCoords = sf::Vector2f(1.0f, 1.0f); vertices[3].texCoords = sf::Vector2f(0.0f, 1.0f); - set_color(color); - set_size(size); + + for(size_t i = 0; i < 4; ++i) + vertices[i].color = color; const sf::Color shadow_color(0, 0, 0, 50); @@ -49,7 +50,6 @@ namespace QuickMedia { vertices[2].position = pos + sf::Vector2f(size.x, size.y); vertices[3].position = pos + sf::Vector2f(0.0f, size.y); - const sf::Color shadow_color(0, 0, 0, 100); const float shadow_radius = 5.0f; // Top @@ -83,10 +83,8 @@ namespace QuickMedia { } void RoundedRectangle::set_color(sf::Color color) { - vertices[0].color = color; - vertices[1].color = color; - vertices[2].color = color; - vertices[3].color = color; + for(size_t i = 0; i < 4; ++i) + vertices[i].color = color; } sf::Vector2f RoundedRectangle::get_position() const { |