diff options
author | Max Horn | 2004-11-25 23:35:02 +0000 |
---|---|---|
committer | Max Horn | 2004-11-25 23:35:02 +0000 |
commit | 5ad29fd7e08e08b2d82a8ea0b93b093576ad87a0 (patch) | |
tree | 5a41907a08986e50c5ef162ca4cb5cc664e93ba9 /gui | |
parent | f5da05f80d0a24ccb3e77ae5740c89ebed4cc2fe (diff) | |
download | scummvm-rg350-5ad29fd7e08e08b2d82a8ea0b93b093576ad87a0.tar.gz scummvm-rg350-5ad29fd7e08e08b2d82a8ea0b93b093576ad87a0.tar.bz2 scummvm-rg350-5ad29fd7e08e08b2d82a8ea0b93b093576ad87a0.zip |
Make use of the new graphic primitives
svn-id: r15886
Diffstat (limited to 'gui')
-rw-r--r-- | gui/newgui.cpp | 66 | ||||
-rw-r--r-- | gui/newgui.h | 1 |
2 files changed, 5 insertions, 62 deletions
diff --git a/gui/newgui.cpp b/gui/newgui.cpp index 4d9ec7f1b0..9bd08422b5 100644 --- a/gui/newgui.cpp +++ b/gui/newgui.cpp @@ -252,7 +252,7 @@ const Graphics::Font &NewGui::getFont() const { } OverlayColor *NewGui::getBasePtr(int x, int y) { - return (OverlayColor *)((byte *)_screen.pixels + x * _screen.bytesPerPixel + y * _screen.pitch); + return (OverlayColor *)_screen.getBasePtr(x, y); } void NewGui::box(int x, int y, int width, int height, OverlayColor colorA, OverlayColor colorB) { @@ -268,30 +268,11 @@ void NewGui::box(int x, int y, int width, int height, OverlayColor colorA, Overl } 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; - } + _screen.hLine(x, y, x2, color); } void NewGui::vLine(int x, int y, int y2, OverlayColor color) { - OverlayColor *ptr; - - if (y2 < y) - SWAP(y2, y); - - ptr = getBasePtr(x, y); - - while (y++ <= y2) { - *ptr = color; - ptr += _screenPitch; - } + _screen.vLine(x, y, y2, color); } void NewGui::blendRect(int x, int y, int w, int h, OverlayColor color, int level) { @@ -320,48 +301,11 @@ void NewGui::blendRect(int x, int y, int w, int h, OverlayColor color, int level } void NewGui::fillRect(int x, int y, int w, int h, OverlayColor color) { - int i; - OverlayColor *ptr = getBasePtr(x, y); - - while (h--) { - for (i = 0; i < w; i++) { - ptr[i] = color; - } - ptr += _screenPitch; - } -} - -void NewGui::checkerRect(int x, int y, int w, int h, OverlayColor color) { - int i; - OverlayColor *ptr = getBasePtr(x, y); - - while (h--) { - for (i = 0; i < w; i++) { - if ((h ^ i) & 1) - ptr[i] = color; - } - ptr += _screenPitch; - } + _screen.fillRect(Common::Rect(x, y, x+w, y+h), color); } void NewGui::frameRect(int x, int y, int w, int h, OverlayColor color) { - int i; - OverlayColor *ptr, *basePtr = getBasePtr(x, y); - if (basePtr == NULL) - return; - - ptr = basePtr; - for (i = 0; i < w; i++, ptr++) - *ptr = color; - ptr--; - for (i = 0; i < h; i++, ptr += _screenPitch) - *ptr = color; - ptr = basePtr; - for (i = 0; i < h; i++, ptr += _screenPitch) - *ptr = color; - ptr -= _screenPitch; - for (i = 0; i < w; i++, ptr++) - *ptr = color; + _screen.frameRect(Common::Rect(x, y, x+w, y+h), color); } void NewGui::addDirtyRect(int x, int y, int w, int h) { diff --git a/gui/newgui.h b/gui/newgui.h index 82b2af1a94..1d0b028093 100644 --- a/gui/newgui.h +++ b/gui/newgui.h @@ -126,7 +126,6 @@ public: 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); void frameRect(int x, int y, int w, int h, OverlayColor color); void drawChar(byte c, int x, int y, OverlayColor color, const Graphics::Font *font = 0); |