From 374af05d5f6d9fa0713eb061c3943868869b416d Mon Sep 17 00:00:00 2001 From: LaurentGom Date: Sun, 12 Jul 2009 13:28:44 +0000 Subject: [PATCH] Replaces glColor4f with glColor4ub in internal code git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1174 4e206d99-4929-0410-ac5d-dfc041789085 --- src/SFML/Graphics/Drawable.cpp | 2 +- src/SFML/Graphics/PostFX.cpp | 2 +- src/SFML/Graphics/Shape.cpp | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/SFML/Graphics/Drawable.cpp b/src/SFML/Graphics/Drawable.cpp index ecf571829..02ae9bd5a 100644 --- a/src/SFML/Graphics/Drawable.cpp +++ b/src/SFML/Graphics/Drawable.cpp @@ -388,7 +388,7 @@ void Drawable::Draw(RenderTarget& target) const } // Set color - GLCheck(glColor4f(myColor.r / 255.f, myColor.g / 255.f, myColor.b / 255.f, myColor.a / 255.f)); + GLCheck(glColor4ub(myColor.r, myColor.g, myColor.b, myColor.a)); // Let the derived class render the object geometry Render(target); diff --git a/src/SFML/Graphics/PostFX.cpp b/src/SFML/Graphics/PostFX.cpp index 41193a2f6..8317ce5e9 100644 --- a/src/SFML/Graphics/PostFX.cpp +++ b/src/SFML/Graphics/PostFX.cpp @@ -299,7 +299,7 @@ void PostFX::Render(RenderTarget& target) const it++; } - // Compute the texture coordinates (in case the texture is larger than the screen, or flipped) + // Compute the texture coordinates (it may not be (0, 0, 1, 1) if the texture is padded or flipped) IntRect frameBufferRect(0, 0, myFrameBuffer.GetWidth(), myFrameBuffer.GetHeight()); FloatRect texCoords = myFrameBuffer.GetTexCoords(frameBufferRect); diff --git a/src/SFML/Graphics/Shape.cpp b/src/SFML/Graphics/Shape.cpp index dc21f977f..866f0316a 100644 --- a/src/SFML/Graphics/Shape.cpp +++ b/src/SFML/Graphics/Shape.cpp @@ -302,13 +302,13 @@ void Shape::Render(RenderTarget&) const for (std::vector::const_iterator i = myPoints.begin(); i != myPoints.end(); ++i) { Color color = i->Col * GetColor(); - glColor4f(color.r / 255.f, color.g / 255.f, color.b / 255.f, color.a / 255.f); + glColor4ub(color.r, color.g, color.b, color.a); glVertex2f(i->Position.x, i->Position.y); } // Close the shape by duplicating the first point at the end Color color = myPoints[1].Col * GetColor(); - glColor4f(color.r / 255.f, color.g / 255.f, color.b / 255.f, color.a / 255.f); + glColor4ub(color.r, color.g, color.b, color.a); glVertex2f(myPoints[1].Position.x, myPoints[1].Position.y); } glEnd(); @@ -322,17 +322,17 @@ void Shape::Render(RenderTarget&) const for (std::size_t i = 1; i < myPoints.size(); ++i) { Color color = myPoints[i].OutlineCol * GetColor(); - glColor4f(color.r / 255.f, color.g / 255.f, color.b / 255.f, color.a / 255.f); + glColor4ub(color.r, color.g, color.b, color.a); glVertex2f(myPoints[i].Position.x, myPoints[i].Position.y); - glColor4f(color.r / 255.f, color.g / 255.f, color.b / 255.f, color.a / 255.f); + glColor4ub(color.r, color.g, color.b, color.a); glVertex2f(myPoints[i].Position.x + myPoints[i].Normal.x * myOutline, myPoints[i].Position.y + myPoints[i].Normal.y * myOutline); } // Close the shape by duplicating the first point at the end Color color = myPoints[1].OutlineCol * GetColor(); - glColor4f(color.r / 255.f, color.g / 255.f, color.b / 255.f, color.a / 255.f); + glColor4ub(color.r, color.g, color.b, color.a); glVertex2f(myPoints[1].Position.x, myPoints[1].Position.y); - glColor4f(color.r / 255.f, color.g / 255.f, color.b / 255.f, color.a / 255.f); + glColor4ub(color.r, color.g, color.b, color.a); glVertex2f(myPoints[1].Position.x + myPoints[1].Normal.x * myOutline, myPoints[1].Position.y + myPoints[1].Normal.y * myOutline); } glEnd();