diff options
author | Max Horn | 2004-03-22 22:01:10 +0000 |
---|---|---|
committer | Max Horn | 2004-03-22 22:01:10 +0000 |
commit | 7b158941e75914b915b5d9fdbcb0676e0aa71873 (patch) | |
tree | 1d88d5850c07ef041dd6b4d3891a427f6148253e | |
parent | b483b05016ee0520be16380d1bf2df14369f8670 (diff) | |
download | scummvm-rg350-7b158941e75914b915b5d9fdbcb0676e0aa71873.tar.gz scummvm-rg350-7b158941e75914b915b5d9fdbcb0676e0aa71873.tar.bz2 scummvm-rg350-7b158941e75914b915b5d9fdbcb0676e0aa71873.zip |
cleanup
svn-id: r13364
-rw-r--r-- | gui/newgui.cpp | 26 | ||||
-rw-r--r-- | gui/newgui.h | 6 |
2 files changed, 16 insertions, 16 deletions
diff --git a/gui/newgui.cpp b/gui/newgui.cpp index a167fd9382..af59489e56 100644 --- a/gui/newgui.cpp +++ b/gui/newgui.cpp @@ -255,28 +255,30 @@ void NewGui::box(int x, int y, int width, int height, OverlayColor colorA, Overl vLine(x + width - 2, y + 1, y + height - 1, colorB); } -void NewGui::line(int x, int y, int x2, int y2, OverlayColor color) { +void NewGui::hLine(int x, int y, int x2, OverlayColor color) { OverlayColor *ptr; if (x2 < x) SWAP(x2, x); + ptr = getBasePtr(x, y); + + while (x++ <= x2) { + *ptr++ = color; + } +} + +void NewGui::vLine(int x, int y, int y2, OverlayColor color) { + OverlayColor *ptr; + if (y2 < y) SWAP(y2, y); ptr = getBasePtr(x, y); - if (x == x2) { - /* vertical line */ - while (y++ <= y2) { - *ptr = color; - ptr += _screenPitch; - } - } else if (y == y2) { - /* horizontal line */ - while (x++ <= x2) { - *ptr++ = color; - } + while (y++ <= y2) { + *ptr = color; + ptr += _screenPitch; } } diff --git a/gui/newgui.h b/gui/newgui.h index 19be0bbfb1..843f84eac1 100644 --- a/gui/newgui.h +++ b/gui/newgui.h @@ -35,9 +35,6 @@ namespace GUI { class Dialog; -#define hLine(x, y, x2, color) line(x, y, x2, y, color); -#define vLine(x, y, y2, color) line(x, y, x, y2, color); - #define g_gui (GUI::NewGui::instance()) @@ -140,7 +137,8 @@ public: // Drawing primitives OverlayColor *getBasePtr(int x, int y); void box(int x, int y, int width, int height, OverlayColor colorA, OverlayColor colorB); - void line(int x, int y, int x2, int y2, OverlayColor color); + void hLine(int x, int y, int x2, OverlayColor color); + void vLine(int x, int y, int y2, OverlayColor color); void blendRect(int x, int y, int w, int h, OverlayColor color, int level = 3); void fillRect(int x, int y, int w, int h, OverlayColor color); void checkerRect(int x, int y, int w, int h, OverlayColor color); |