diff options
author | Max Horn | 2004-02-28 12:58:13 +0000 |
---|---|---|
committer | Max Horn | 2004-02-28 12:58:13 +0000 |
commit | c6752cccf5186fb04c97e2bb4a64c52fc9447073 (patch) | |
tree | 91f3f0264b1542a839cc3504b52603a8034547cb /gui | |
parent | 56102a1d02925abbe9fc0504751de1a270a34ff3 (diff) | |
download | scummvm-rg350-c6752cccf5186fb04c97e2bb4a64c52fc9447073.tar.gz scummvm-rg350-c6752cccf5186fb04c97e2bb4a64c52fc9447073.tar.bz2 scummvm-rg350-c6752cccf5186fb04c97e2bb4a64c52fc9447073.zip |
renamed more OSystem methods to follow our naming scheme; renamed NewGuiColor to OverlayColor; fixed some calls to error() in the SDL backend
svn-id: r13087
Diffstat (limited to 'gui')
-rw-r--r-- | gui/ScrollBarWidget.cpp | 2 | ||||
-rw-r--r-- | gui/TabWidget.cpp | 2 | ||||
-rw-r--r-- | gui/newgui.cpp | 46 | ||||
-rw-r--r-- | gui/newgui.h | 30 | ||||
-rw-r--r-- | gui/widget.cpp | 4 |
5 files changed, 42 insertions, 42 deletions
diff --git a/gui/ScrollBarWidget.cpp b/gui/ScrollBarWidget.cpp index 6e77087959..cf86aac0ed 100644 --- a/gui/ScrollBarWidget.cpp +++ b/gui/ScrollBarWidget.cpp @@ -241,7 +241,7 @@ void ScrollBarWidget::drawWidget(bool hilite) { (hilite && _part == kSliderPart) ? gui->_textcolorhi : gui->_textcolor); gui->frameRect(_x, _y + _sliderPos, _w, _sliderHeight, gui->_color); int y = _y + _sliderPos + _sliderHeight / 2; - NewGuiColor color = (hilite && _part == kSliderPart) ? gui->_color : gui->_shadowcolor; + OverlayColor color = (hilite && _part == kSliderPart) ? gui->_color : gui->_shadowcolor; gui->hLine(_x + 2, y - 2, _x + _w - 3, color); gui->hLine(_x + 2, y, _x + _w - 3, color); gui->hLine(_x + 2, y + 2, _x + _w-3, color); diff --git a/gui/TabWidget.cpp b/gui/TabWidget.cpp index c914515adf..c15e2d1a60 100644 --- a/gui/TabWidget.cpp +++ b/gui/TabWidget.cpp @@ -127,7 +127,7 @@ void TabWidget::drawWidget(bool hilite) { // Iterate over all tabs and draw them int i, x = _x + kTabLeftOffset; for (i = 0; i < (int)_tabs.size(); ++i) { - NewGuiColor color = (i == _activeTab) ? gui->_color : gui->_shadowcolor; + OverlayColor color = (i == _activeTab) ? gui->_color : gui->_shadowcolor; int yOffset = (i == _activeTab) ? 0 : 2; gui->box(x, _y + yOffset, _tabWidth, kTabHeight - yOffset, color, color); gui->drawString(_tabs[i].title, x + kTabPadding, _y + yOffset / 2 + (kTabHeight - kLineHeight - 1), _tabWidth - 2 * kTabPadding, gui->_textcolor, kTextAlignCenter); diff --git a/gui/newgui.cpp b/gui/newgui.cpp index df8c16a2d3..37ebdc9b4b 100644 --- a/gui/newgui.cpp +++ b/gui/newgui.cpp @@ -146,7 +146,7 @@ void NewGui::runLoop() { } animateCursor(); - _system->update_screen(); + _system->updateScreen(); OSystem::Event event; uint32 time = _system->get_msecs(); @@ -239,7 +239,7 @@ void NewGui::saveState() { // whatever is visible on the screen rught now. int sys_height = _system->get_overlay_height(); int sys_width = _system->get_overlay_width(); - _screen = (NewGuiColor*)calloc(sys_width * sys_height, sizeof(NewGuiColor)); + _screen = (OverlayColor*)calloc(sys_width * sys_height, sizeof(OverlayColor)); _screenPitch = sys_width; _system->grab_overlay(_screen, _screenPitch); @@ -260,7 +260,7 @@ void NewGui::restoreState() { _screen = 0; } - _system->update_screen(); + _system->updateScreen(); _stateIsSaved = false; } @@ -282,11 +282,11 @@ void NewGui::closeTopDialog() { #pragma mark - -NewGuiColor *NewGui::getBasePtr(int x, int y) { +OverlayColor *NewGui::getBasePtr(int x, int y) { return _screen + x + y * _screenPitch; } -void NewGui::box(int x, int y, int width, int height, NewGuiColor colorA, NewGuiColor colorB) { +void NewGui::box(int x, int y, int width, int height, OverlayColor colorA, OverlayColor colorB) { hLine(x + 1, y, x + width - 2, colorA); hLine(x, y + 1, x + width - 1, colorA); vLine(x, y + 1, y + height - 2, colorA); @@ -298,8 +298,8 @@ void NewGui::box(int x, int y, int width, int height, NewGuiColor colorA, NewGui vLine(x + width - 2, y + 1, y + height - 1, colorB); } -void NewGui::line(int x, int y, int x2, int y2, NewGuiColor color) { - NewGuiColor *ptr; +void NewGui::line(int x, int y, int x2, int y2, OverlayColor color) { + OverlayColor *ptr; if (x2 < x) SWAP(x2, x); @@ -323,7 +323,7 @@ void NewGui::line(int x, int y, int x2, int y2, NewGuiColor color) { } } -void NewGui::blendRect(int x, int y, int w, int h, NewGuiColor color, int level) { +void NewGui::blendRect(int x, int y, int w, int h, OverlayColor color, int level) { #ifdef NEWGUI_256 fillRect(x, y, w, h, color); #else @@ -334,7 +334,7 @@ void NewGui::blendRect(int x, int y, int w, int h, NewGuiColor color, int level) g = ag * level; b = ab * level; - NewGuiColor *ptr = getBasePtr(x, y); + OverlayColor *ptr = getBasePtr(x, y); while (h--) { for (int i = 0; i < w; i++) { @@ -348,9 +348,9 @@ void NewGui::blendRect(int x, int y, int w, int h, NewGuiColor color, int level) #endif } -void NewGui::fillRect(int x, int y, int w, int h, NewGuiColor color) { +void NewGui::fillRect(int x, int y, int w, int h, OverlayColor color) { int i; - NewGuiColor *ptr = getBasePtr(x, y); + OverlayColor *ptr = getBasePtr(x, y); while (h--) { for (i = 0; i < w; i++) { @@ -360,9 +360,9 @@ void NewGui::fillRect(int x, int y, int w, int h, NewGuiColor color) { } } -void NewGui::checkerRect(int x, int y, int w, int h, NewGuiColor color) { +void NewGui::checkerRect(int x, int y, int w, int h, OverlayColor color) { int i; - NewGuiColor *ptr = getBasePtr(x, y); + OverlayColor *ptr = getBasePtr(x, y); while (h--) { for (i = 0; i < w; i++) { @@ -373,9 +373,9 @@ void NewGui::checkerRect(int x, int y, int w, int h, NewGuiColor color) { } } -void NewGui::frameRect(int x, int y, int w, int h, NewGuiColor color) { +void NewGui::frameRect(int x, int y, int w, int h, OverlayColor color) { int i; - NewGuiColor *ptr, *basePtr = getBasePtr(x, y); + OverlayColor *ptr, *basePtr = getBasePtr(x, y); if (basePtr == NULL) return; @@ -397,12 +397,12 @@ void NewGui::addDirtyRect(int x, int y, int w, int h) { // For now we don't keep yet another list of dirty rects but simply // blit the affected area directly to the overlay. At least for our current // GUI/widget/dialog code that is just fine. - NewGuiColor *buf = getBasePtr(x, y); + OverlayColor *buf = getBasePtr(x, y); _system->copy_rect_overlay(buf, _screenPitch, x, y, w, h); } -void NewGui::drawChar(byte chr, int xx, int yy, NewGuiColor color) { - NewGuiColor *ptr = getBasePtr(xx, yy); +void NewGui::drawChar(byte chr, int xx, int yy, OverlayColor color) { + OverlayColor *ptr = getBasePtr(xx, yy); uint x, y; #ifdef NEW_FONT_CODE @@ -480,7 +480,7 @@ int NewGui::getCharWidth(byte c) { #endif } -void NewGui::drawString(const String &s, int x, int y, int w, NewGuiColor color, int align, int deltax, bool useEllipsis) { +void NewGui::drawString(const String &s, int x, int y, int w, OverlayColor color, int align, int deltax, bool useEllipsis) { const int leftX = x, rightX = x + w; uint i; int width = getStringWidth(s); @@ -553,7 +553,7 @@ void NewGui::drawString(const String &s, int x, int y, int w, NewGuiColor color, // Blit from a buffer to the display // void NewGui::blitFromBuffer(int x, int y, int w, int h, const byte *buf, int pitch) { - NewGuiColor *ptr = getBasePtr(x, y); + OverlayColor *ptr = getBasePtr(x, y); assert(buf); while (h--) { @@ -567,7 +567,7 @@ void NewGui::blitFromBuffer(int x, int y, int w, int h, const byte *buf, int pit // Blit from the display to a buffer // void NewGui::blitToBuffer(int x, int y, int w, int h, byte *buf, int pitch) { - NewGuiColor *ptr = getBasePtr(x, y); + OverlayColor *ptr = getBasePtr(x, y); assert(buf); while (h--) { @@ -580,8 +580,8 @@ void NewGui::blitToBuffer(int x, int y, int w, int h, byte *buf, int pitch) { // // Draw an 8x8 bitmap at location (x,y) // -void NewGui::drawBitmap(uint32 *bitmap, int x, int y, NewGuiColor color, int h) { - NewGuiColor *ptr = getBasePtr(x, y); +void NewGui::drawBitmap(uint32 *bitmap, int x, int y, OverlayColor color, int h) { + OverlayColor *ptr = getBasePtr(x, y); for (y = 0; y < h; y++) { uint32 mask = 0xF0000000; diff --git a/gui/newgui.h b/gui/newgui.h index 419e31aec3..1866845fa5 100644 --- a/gui/newgui.h +++ b/gui/newgui.h @@ -92,7 +92,7 @@ public: protected: OSystem *_system; - NewGuiColor *_screen; + OverlayColor *_screen; int _screenPitch; bool _needRedraw; @@ -134,28 +134,28 @@ protected: public: // Theme colors - NewGuiColor _color, _shadowcolor; - NewGuiColor _bgcolor; - NewGuiColor _textcolor; - NewGuiColor _textcolorhi; + OverlayColor _color, _shadowcolor; + OverlayColor _bgcolor; + OverlayColor _textcolor; + OverlayColor _textcolorhi; // Drawing primitives - NewGuiColor *getBasePtr(int x, int y); - void box(int x, int y, int width, int height, NewGuiColor colorA, NewGuiColor colorB); - void line(int x, int y, int x2, int y2, NewGuiColor color); - void blendRect(int x, int y, int w, int h, NewGuiColor color, int level = 3); - void fillRect(int x, int y, int w, int h, NewGuiColor color); - void checkerRect(int x, int y, int w, int h, NewGuiColor color); - void frameRect(int x, int y, int w, int h, NewGuiColor color); - void drawChar(byte c, int x, int y, NewGuiColor color); + 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 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); int getStringWidth(const String &str); int getCharWidth(byte c); - void drawString(const String &str, int x, int y, int w, NewGuiColor color, int align = kTextAlignLeft, int deltax = 0, bool useEllipsis = true); + void drawString(const String &str, int x, int y, int w, OverlayColor color, int align = kTextAlignLeft, int deltax = 0, bool useEllipsis = true); void blitFromBuffer(int x, int y, int w, int h, const byte *buf, int pitch); void blitToBuffer(int x, int y, int w, int h, byte *buf, int pitch); - void drawBitmap(uint32 *bitmap, int x, int y, NewGuiColor color, int h = 8); + void drawBitmap(uint32 *bitmap, int x, int y, OverlayColor color, int h = 8); void addDirtyRect(int x, int y, int w, int h); }; diff --git a/gui/widget.cpp b/gui/widget.cpp index 6c7f2f91f6..3285ac14af 100644 --- a/gui/widget.cpp +++ b/gui/widget.cpp @@ -57,8 +57,8 @@ void Widget::draw() { // Draw border if (_flags & WIDGET_BORDER) { - NewGuiColor colorA = gui->_color; - NewGuiColor colorB = gui->_shadowcolor; + OverlayColor colorA = gui->_color; + OverlayColor colorB = gui->_shadowcolor; if ((_flags & WIDGET_INV_BORDER) == WIDGET_INV_BORDER) SWAP(colorA, colorB); gui->box(_x, _y, _w, _h, colorA, colorB); |