From 1b306cc6c28d4301bcd8e242573ef50f72669d4e Mon Sep 17 00:00:00 2001 From: Pawel Kolodziejski Date: Sat, 9 Apr 2005 05:03:39 +0000 Subject: [PATCH] corrections for drawing rectangles --- driver_gl.cpp | 2 +- driver_tinygl.cpp | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/driver_gl.cpp b/driver_gl.cpp index f163878a844..eb0cefd1acc 100644 --- a/driver_gl.cpp +++ b/driver_gl.cpp @@ -719,7 +719,7 @@ void DriverGL::drawRectangle(PrimitiveObject *primitive) { if (primitive->isFilled()) { glBegin(GL_QUADS); } else { - glBegin(GL_LINES); + glBegin(GL_LINE_LOOP); } glVertex2f(x1, y1); diff --git a/driver_tinygl.cpp b/driver_tinygl.cpp index b9419ffbbe4..3ff51fb58f7 100644 --- a/driver_tinygl.cpp +++ b/driver_tinygl.cpp @@ -505,22 +505,22 @@ void DriverTinyGL::drawRectangle(PrimitiveObject *primitive) { uint16 c = ((color.red() & 0xF8) << 8) | ((color.green() & 0xFC) << 3) | (color.blue() >> 3); if (primitive->isFilled()) { - for (; y1 < y2; y1++) { - for (int x = x1; x < x2; x++) { + for (; y1 <= y2; y1++) { + for (int x = x1; x <= x2; x++) { WRITE_LE_UINT16(dst + 640 * y1 + x, c); } } } else { - for (int x = x1; x < x2; x++) { + for (int x = x1; x <= x2; x++) { WRITE_LE_UINT16(dst + 640 * y1 + x, c); } - for (int x = x1; x < x2; x++) { + for (int x = x1; x <= x2; x++) { WRITE_LE_UINT16(dst + 640 * y2 + x, c); } - for (int y = y1; y < y2; y++) { + for (int y = y1; y <= y2; y++) { WRITE_LE_UINT16(dst + 640 * y + x1, c); } - for (int y = y1; y < y2; y++) { + for (int y = y1; y <= y2; y++) { WRITE_LE_UINT16(dst + 640 * y + x2, c); } }