From d763e294f44eb38b94bf7e2055b77a982b72b7c0 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sun, 16 Aug 2009 17:34:00 +0000 Subject: more constness --- src/ui/paint.cc | 49 +++++++++++++++++++++++++------------------------ 1 file changed, 25 insertions(+), 24 deletions(-) (limited to 'src/ui/paint.cc') diff --git a/src/ui/paint.cc b/src/ui/paint.cc index e6f2402..576484e 100644 --- a/src/ui/paint.cc +++ b/src/ui/paint.cc @@ -42,10 +42,10 @@ void border(const math::Vector2f &location, const math::Vector2f &size) using namespace gl; begin(LineLoop); - vertex(location.x +1 , location.y); - vertex(location.x + size.x, location.y); - vertex(location.x + size.x, location.y + size.y -1); - vertex(location.x +1, location.y + size.y - 1); + vertex(location.x(), location.y()); + vertex(location.x() + size.width(), location.y()); + vertex(location.x() + size.width(), location.y() + size.height()); + vertex(location.x(), location.y() + size.height()); end(); } @@ -54,10 +54,10 @@ void rectangle(const math::Vector2f &location, const math::Vector2f &size) using namespace gl; begin(Quads); - vertex(location.x +1 , location.y); - vertex(location.x + size.x, location.y); - vertex(location.x + size.x, location.y + size.y -1); - vertex(location.x +1, location.y + size.y - 1); + vertex(location.x(), location.y()); + vertex(location.x() + size.width(), location.y()); + vertex(location.x() + size.width(), location.y() + size.height()); + vertex(location.x(), location.y() + size.height()); end(); } @@ -70,16 +70,17 @@ void bitmap(const math::Vector2f &location, const math::Vector2f &size, std::str gl::begin(gl::Quads); glTexCoord2f(0.0f, 0.0f); - gl::vertex(location.x +1 , location.y); - + gl::vertex(location.x(), location.y()); + glTexCoord2f(1.0f, 0.0f); - gl::vertex(location.x + size.x, location.y); - + gl::vertex(location.x() + size.width(), location.y()); + glTexCoord2f(1.0f, 1.0f); - gl::vertex(location.x + size.x, location.y + size.y -1); - + gl::vertex(location.x() + size.width(), location.y() + size.height()); + glTexCoord2f(0.0f, 1.0f); - gl::vertex(location.x +1, location.y + size.y - 1); + gl::vertex(location.x(), location.y() + size.height()); + gl::end(); gl::disable(GL_TEXTURE_2D); @@ -112,29 +113,29 @@ void label(const math::Vector2f &location, const math::Vector2f &size, const Fon switch (align_horizontal) { case AlignLeft: - v.x += font->width(); + v[0] += font->width(); break; case AlignHCenter: - v.x += (size.x - text_width) / 2.0f; + v[0] += (size.width() - text_width) / 2.0f; break; case AlignRight: - v.x += size.x - text_width - font->width(); + v[0] += size.width() - text_width - font->width(); break; } switch (align_vertical) { case AlignTop: - v.y += font->height()*0.5f; + v[1] += font->height()*0.5f; break; case AlignVCenter: - v.y += (size.y - text_height) / 2.0f; + v[1] += (size.height() - text_height) / 2.0f; break; case AlignBottom: - v.y += size.y - text_height - font->height()*0.5f; + v[1] += size.height() - text_height - font->height()*0.5f; break; } - render::Text::draw(v.x, v.y, text); + render::Text::draw(v.x(), v.y(), text); // disable OpenGL textures gl::disable(GL_TEXTURE_2D); @@ -149,7 +150,7 @@ void text(const math::Vector2f &location, const math::Vector2f &size, const Font // enable OpenGL textures gl::enable(GL_TEXTURE_2D); - render::Text::draw(location.x, location.y, text); + render::Text::draw(location.x(), location.y(), text); // disable OpenGL textures gl::disable(GL_TEXTURE_2D); @@ -164,7 +165,7 @@ void text(const math::Vector2f &location, const math::Vector2f &size, const Font // enable OpenGL textures gl::enable(GL_TEXTURE_2D); - render::Text::draw(location.x, location.y, textstream); + render::Text::draw(location.x(), location.y(), textstream); // disable OpenGL textures gl::disable(GL_TEXTURE_2D); -- cgit v1.2.3