[Scummvm-cvs-logs] SF.net SVN: scummvm:[44487] scummvm/trunk/engines/kyra
lordhoto at users.sourceforge.net
lordhoto at users.sourceforge.net
Wed Sep 30 16:53:35 CEST 2009
Revision: 44487
http://scummvm.svn.sourceforge.net/scummvm/?rev=44487&view=rev
Author: lordhoto
Date: 2009-09-30 14:53:34 +0000 (Wed, 30 Sep 2009)
Log Message:
-----------
Cleanup: got rid of Screen::ShadeType.
Modified Paths:
--------------
scummvm/trunk/engines/kyra/gui.cpp
scummvm/trunk/engines/kyra/gui_lol.cpp
scummvm/trunk/engines/kyra/screen.cpp
scummvm/trunk/engines/kyra/screen.h
scummvm/trunk/engines/kyra/screen_lol.cpp
scummvm/trunk/engines/kyra/screen_lol.h
Modified: scummvm/trunk/engines/kyra/gui.cpp
===================================================================
--- scummvm/trunk/engines/kyra/gui.cpp 2009-09-30 14:53:07 UTC (rev 44486)
+++ scummvm/trunk/engines/kyra/gui.cpp 2009-09-30 14:53:34 UTC (rev 44487)
@@ -83,7 +83,7 @@
int menu_y2 = menu.height + menu.y - 1;
_screen->fillRect(menu.x + 2, menu.y + 2, menu_x2 - 2, menu_y2 - 2, menu.bkgdColor);
- _screen->drawShadedBox(menu.x, menu.y, menu_x2, menu_y2, menu.color1, menu.color2, _vm->gameFlags().gameID == GI_LOL ? Screen::kShadeTypeLol : Screen::kShadeTypeKyra);
+ _screen->drawShadedBox(menu.x, menu.y, menu_x2, menu_y2, menu.color1, menu.color2);
if (menu.titleX != -1)
textX = menu.titleX;
@@ -127,7 +127,7 @@
}
_screen->fillRect(x1, y1, x2, y2, menu.item[i].bkgdColor);
- _screen->drawShadedBox(x1, y1, x2, y2, menu.item[i].color1, menu.item[i].color2, _vm->gameFlags().gameID == GI_LOL ? Screen::kShadeTypeLol : Screen::kShadeTypeKyra);
+ _screen->drawShadedBox(x1, y1, x2, y2, menu.item[i].color1, menu.item[i].color2);
if (getMenuItemTitle(menu.item[i])) {
if (menu.item[i].titleX != -1)
Modified: scummvm/trunk/engines/kyra/gui_lol.cpp
===================================================================
--- scummvm/trunk/engines/kyra/gui_lol.cpp 2009-09-30 14:53:07 UTC (rev 44486)
+++ scummvm/trunk/engines/kyra/gui_lol.cpp 2009-09-30 14:53:34 UTC (rev 44487)
@@ -2291,7 +2291,7 @@
if (!_displayMenu || _vm->gameFlags().use16ColorMode)
return 0;
- _screen->drawShadedBox(button->x, button->y, button->x + button->width, button->y + button->height, 223, 227, Screen::kShadeTypeLol);
+ _screen->drawShadedBox(button->x, button->y, button->x + button->width, button->y + button->height, 223, 227);
return 0;
}
@@ -2465,7 +2465,7 @@
int my = d->sy - 1;
int mw = (d->w << 3) + 1;
int mh = d->h + 1;
- _screen->drawShadedBox(mx, my, mx + mw, my + mh, 227, 223, Screen::kShadeTypeLol);
+ _screen->drawShadedBox(mx, my, mx + mw, my + mh, 227, 223);
int pg = _screen->setCurPage(0);
_vm->_txt->clearDim(8);
textCursorTimer = 0;
Modified: scummvm/trunk/engines/kyra/screen.cpp
===================================================================
--- scummvm/trunk/engines/kyra/screen.cpp 2009-09-30 14:53:07 UTC (rev 44486)
+++ scummvm/trunk/engines/kyra/screen.cpp 2009-09-30 14:53:34 UTC (rev 44487)
@@ -996,30 +996,18 @@
drawClippedLine(x1, y2, x2, y2, color);
}
-void Screen::drawShadedBox(int x1, int y1, int x2, int y2, int color1, int color2, ShadeType shadeType) {
+void Screen::drawShadedBox(int x1, int y1, int x2, int y2, int color1, int color2) {
assert(x1 >= 0 && y1 >= 0);
hideMouse();
fillRect(x1, y1, x2, y1 + 1, color1);
- if (shadeType == kShadeTypeLol)
- fillRect(x1, y1, x1 + 1, y2, color1);
- else
- fillRect(x2 - 1, y1, x2, y2, color1);
+ fillRect(x2 - 1, y1, x2, y2, color1);
- if (shadeType == kShadeTypeLol) {
- drawClippedLine(x2, y1, x2, y2, color2);
- drawClippedLine(x2 - 1, y1 + 1, x2 - 1, y2 - 1, color2);
- drawClippedLine(x1 + 1, y2 - 1, x2, y2 - 1, color2);
- } else {
- drawClippedLine(x1, y1, x1, y2, color2);
- drawClippedLine(x1 + 1, y1 + 1, x1 + 1, y2 - 1, color2);
- drawClippedLine(x1, y2 - 1, x2 - 1, y2 - 1, color2);
- }
+ drawClippedLine(x1, y1, x1, y2, color2);
+ drawClippedLine(x1 + 1, y1 + 1, x1 + 1, y2 - 1, color2);
+ drawClippedLine(x1, y2 - 1, x2 - 1, y2 - 1, color2);
drawClippedLine(x1, y2, x2, y2, color2);
- if (shadeType == kShadeTypeLol && _use16ColorMode)
- drawBox(x1, y1, x2, y2, 0);
-
showMouse();
}
Modified: scummvm/trunk/engines/kyra/screen.h
===================================================================
--- scummvm/trunk/engines/kyra/screen.h 2009-09-30 14:53:07 UTC (rev 44486)
+++ scummvm/trunk/engines/kyra/screen.h 2009-09-30 14:53:34 UTC (rev 44487)
@@ -364,13 +364,9 @@
void copyPalette(const int dst, const int src);
// gui specific (processing on _curPage)
- enum ShadeType {
- kShadeTypeKyra,
- kShadeTypeLol
- };
void drawLine(bool vertical, int x, int y, int length, int color);
void drawClippedLine(int x1, int y1, int x2, int y2, int color);
- void drawShadedBox(int x1, int y1, int x2, int y2, int color1, int color2, ShadeType shadeType = kShadeTypeKyra);
+ virtual void drawShadedBox(int x1, int y1, int x2, int y2, int color1, int color2);
void drawBox(int x1, int y1, int x2, int y2, int color);
// font/text handling
Modified: scummvm/trunk/engines/kyra/screen_lol.cpp
===================================================================
--- scummvm/trunk/engines/kyra/screen_lol.cpp 2009-09-30 14:53:07 UTC (rev 44486)
+++ scummvm/trunk/engines/kyra/screen_lol.cpp 2009-09-30 14:53:34 UTC (rev 44487)
@@ -149,6 +149,24 @@
printText(buffer, x, y, c1, c2);
}
+void Screen_LoL::drawShadedBox(int x1, int y1, int x2, int y2, int color1, int color2) {
+ assert(x1 >= 0 && y1 >= 0);
+ hideMouse();
+
+ fillRect(x1, y1, x2, y1 + 1, color1);
+ fillRect(x1, y1, x1 + 1, y2, color1);
+
+ drawClippedLine(x2, y1, x2, y2, color2);
+ drawClippedLine(x2 - 1, y1 + 1, x2 - 1, y2 - 1, color2);
+ drawClippedLine(x1 + 1, y2 - 1, x2, y2 - 1, color2);
+ drawClippedLine(x1, y2, x2, y2, color2);
+
+ if (_use16ColorMode)
+ drawBox(x1, y1, x2, y2, 0);
+
+ showMouse();
+}
+
void Screen_LoL::generateGrayOverlay(const Palette &srcPal, uint8 *grayOverlay, int factor, int addR, int addG, int addB, int lastColor, bool skipSpecialColors) {
Palette tmpPal(lastColor);
Modified: scummvm/trunk/engines/kyra/screen_lol.h
===================================================================
--- scummvm/trunk/engines/kyra/screen_lol.h 2009-09-30 14:53:07 UTC (rev 44486)
+++ scummvm/trunk/engines/kyra/screen_lol.h 2009-09-30 14:53:34 UTC (rev 44487)
@@ -49,6 +49,8 @@
void fprintString(const char *format, int x, int y, uint8 col1, uint8 col2, uint16 flags, ...) GCC_PRINTF(2, 8);
void fprintStringIntro(const char *format, int x, int y, uint8 c1, uint8 c2, uint8 c3, uint16 flags, ...) GCC_PRINTF(2, 9);
+ void drawShadedBox(int x1, int y1, int x2, int y2, int color1, int color2);
+
void drawGridBox(int x, int y, int w, int h, int col);
void fadeClearSceneWindow(int delay);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list