summaryrefslogtreecommitdiff
path: root/src/OpenGLGraphics.cpp
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-04-22 16:13:43 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-04-22 16:13:43 (GMT)
commite38fd405af5f07667203c6f584a5cdb00ed20ca2 (patch)
treef5630c0e43cb848bb36a29c0d20599dcc324161c /src/OpenGLGraphics.cpp
parent553cf6552070aae93e1db031b57afdc8c9ba19e0 (diff)
downloadpowder-e38fd405af5f07667203c6f584a5cdb00ed20ca2.zip
powder-e38fd405af5f07667203c6f584a5cdb00ed20ca2.tar.gz
Correct quirks with drawrect and fillrect, change UI components accordingly, shorten save name in save button
Diffstat (limited to 'src/OpenGLGraphics.cpp')
-rw-r--r--src/OpenGLGraphics.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/OpenGLGraphics.cpp b/src/OpenGLGraphics.cpp
index ed2b2ab..61c422c 100644
--- a/src/OpenGLGraphics.cpp
+++ b/src/OpenGLGraphics.cpp
@@ -323,22 +323,24 @@ void Graphics::draw_line(int x, int y, int x2, int y2, int r, int g, int b, int
void Graphics::drawrect(int x, int y, int width, int height, int r, int g, int b, int a)
{
x++;
+ height--;
+ width--;
glColor4ub(r, g, b, a);
glBegin(GL_LINE_STRIP);
- glVertex2i(x, y);
- glVertex2i(x+width, y);
- glVertex2i(x+width, y+height);
- glVertex2i(x, y+height+1); //+1 is a hack to prevent squares from missing their corners, will make smoothed lines look like SHIT
- glVertex2i(x, y);
+ glVertex2f(x, y);
+ glVertex2f(x+width, y);
+ glVertex2f(x+width, y+height);
+ glVertex2f(x, y+height+1); //+1 is a hack to prevent squares from missing their corners, will make smoothed lines look like SHIT
+ glVertex2f(x, y);
glEnd();
}
void Graphics::fillrect(int x, int y, int width, int height, int r, int g, int b, int a)
{
- x++;
+ /*x++;
y++;
width-=1;
- height-=1;
+ height-=1;*/
glColor4ub(r, g, b, a);
glBegin(GL_QUADS);