aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/gui
diff options
context:
space:
mode:
authorMartin Kiewitz2009-10-06 16:36:28 +0000
committerMartin Kiewitz2009-10-06 16:36:28 +0000
commitca9f08c6244a51098669993ccd829afefe33ff72 (patch)
treec9b2464b8aa8c6e9032de9cb618f678c4523a5a7 /engines/sci/gui
parentd2fdc8fc79839ebb7cc2b2e61644651d534e34a5 (diff)
downloadscummvm-rg350-ca9f08c6244a51098669993ccd829afefe33ff72.tar.gz
scummvm-rg350-ca9f08c6244a51098669993ccd829afefe33ff72.tar.bz2
scummvm-rg350-ca9f08c6244a51098669993ccd829afefe33ff72.zip
SCI/newgui: kHiLite support
svn-id: r44701
Diffstat (limited to 'engines/sci/gui')
-rw-r--r--engines/sci/gui/gui.cpp52
-rw-r--r--engines/sci/gui/gui.h6
2 files changed, 35 insertions, 23 deletions
diff --git a/engines/sci/gui/gui.cpp b/engines/sci/gui/gui.cpp
index 33189cd015..acb04cf428 100644
--- a/engines/sci/gui/gui.cpp
+++ b/engines/sci/gui/gui.cpp
@@ -279,36 +279,48 @@ void SciGui::drawCel(GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo ce
_screen->copyToScreen();
}
-void SciGui::drawControlButton(Common::Rect rect, reg_t obj, const char *text, int16 fontId, int16 style, bool inverse) {
- rect.grow(1);
- _gfx->EraseRect(rect);
- _gfx->FrameRect(rect);
- rect.grow(-2);
- _gfx->TextFace(style & 1 ? 0 : 1);
- _gfx->TextBox(text, 0, rect, 1, fontId);
- _gfx->TextFace(0);
- if (style & 8) { // selected
+void SciGui::drawControlButton(Common::Rect rect, reg_t obj, const char *text, int16 fontId, int16 style, bool hilite) {
+ if (!hilite) {
rect.grow(1);
+ _gfx->EraseRect(rect);
_gfx->FrameRect(rect);
+ rect.grow(-2);
+ _gfx->TextFace(style & 1 ? 0 : 1);
+ _gfx->TextBox(text, 0, rect, 1, fontId);
+ _gfx->TextFace(0);
+ if (style & 8) { // selected
+ rect.grow(1);
+ _gfx->FrameRect(rect);
+ }
+ } else {
+ _gfx->InvertRect(rect);
}
_screen->copyToScreen();
}
-void SciGui::drawControlText(Common::Rect rect, reg_t obj, const char *text, int16 fontId, int16 mode, int16 style, bool inverse) {
- rect.grow(1);
- _gfx->EraseRect(rect);
- rect.grow(-1);
- _gfx->TextBox(text, 0, rect, mode, fontId);
- if (style & 8) { // selected
- _gfx->FrameRect(rect);
+void SciGui::drawControlText(Common::Rect rect, reg_t obj, const char *text, int16 fontId, int16 mode, int16 style, bool hilite) {
+ if (!hilite) {
+ rect.grow(1);
+ _gfx->EraseRect(rect);
+ rect.grow(-1);
+ _gfx->TextBox(text, 0, rect, mode, fontId);
+ if (style & 8) { // selected
+ _gfx->FrameRect(rect);
+ }
+ } else {
+ _gfx->InvertRect(rect);
}
_screen->copyToScreen();
}
-void SciGui::drawControlIcon(Common::Rect rect, reg_t obj, GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo celNo, int16 style, bool inverse) {
- _gfx->drawCel(viewId, loopNo, celNo, rect.left, rect.top, 255, 0);
- if (style & 0x20) {
- _gfx->FrameRect(rect);
+void SciGui::drawControlIcon(Common::Rect rect, reg_t obj, GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo celNo, int16 style, bool hilite) {
+ if (!hilite) {
+ _gfx->drawCel(viewId, loopNo, celNo, rect.left, rect.top, 255, 0);
+ if (style & 0x20) {
+ _gfx->FrameRect(rect);
+ }
+ } else {
+ _gfx->InvertRect(rect);
}
_screen->copyToScreen();
}
diff --git a/engines/sci/gui/gui.h b/engines/sci/gui/gui.h
index 79185deddf..a6262771a9 100644
--- a/engines/sci/gui/gui.h
+++ b/engines/sci/gui/gui.h
@@ -65,9 +65,9 @@ public:
virtual void drawStatus(const char *text, int16 colorPen, int16 colorBack);
virtual void drawPicture(GuiResourceId pictureId, uint16 showStyle, uint16 flags, int16 EGApaletteNo);
virtual void drawCel(GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo celNo, uint16 leftPos, uint16 topPos, int16 priority, uint16 paletteNo);
- virtual void drawControlButton(Common::Rect rect, reg_t obj, const char *text, int16 fontId, int16 style, bool inverse);
- virtual void drawControlText(Common::Rect rect, reg_t obj, const char *text, int16 fontId, int16 mode, int16 style, bool inverse);
- virtual void drawControlIcon(Common::Rect rect, reg_t obj, GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo celNo, int16 style, bool inverse);
+ virtual void drawControlButton(Common::Rect rect, reg_t obj, const char *text, int16 fontId, int16 style, bool hilite);
+ virtual void drawControlText(Common::Rect rect, reg_t obj, const char *text, int16 fontId, int16 mode, int16 style, bool hilite);
+ virtual void drawControlIcon(Common::Rect rect, reg_t obj, GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo celNo, int16 style, bool hilite);
virtual void graphFillBoxForeground(Common::Rect rect);
virtual void graphFillBoxBackground(Common::Rect rect);