aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorMartin Kiewitz2009-10-05 11:42:04 +0000
committerMartin Kiewitz2009-10-05 11:42:04 +0000
commit6e38de3905ec7f5cbbfb991b4a4f960027550b3a (patch)
tree43c8cfe8d0e02fb8891ac0836caaae5f6c8e1acc /engines
parent55e7c29d95b6d77c4e59f1deeae5760f4cf0b29e (diff)
downloadscummvm-rg350-6e38de3905ec7f5cbbfb991b4a4f960027550b3a.tar.gz
scummvm-rg350-6e38de3905ec7f5cbbfb991b4a4f960027550b3a.tar.bz2
scummvm-rg350-6e38de3905ec7f5cbbfb991b4a4f960027550b3a.zip
SCI/newgui: kDrawControl on icon implemented
svn-id: r44658
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/engine/kgraphics.cpp7
-rw-r--r--engines/sci/gui/gui.cpp7
-rw-r--r--engines/sci/gui/gui.h1
-rw-r--r--engines/sci/gui32/gui32.cpp8
-rw-r--r--engines/sci/gui32/gui32.h1
5 files changed, 19 insertions, 5 deletions
diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp
index a824b974a7..92a494f051 100644
--- a/engines/sci/engine/kgraphics.cpp
+++ b/engines/sci/engine/kgraphics.cpp
@@ -1451,12 +1451,9 @@ static void _k_draw_control(EngineState *s, reg_t obj, bool inverse) {
break;
case K_CONTROL_ICON:
-
debugC(2, kDebugLevelGraphics, "drawing icon control %04x:%04x to %d,%d\n", PRINT_REG(obj), x, y - 1);
-
- ADD_TO_CURRENT_PICTURE_PORT(sciw_new_icon_control(s->port, obj, area, view, loop, cel,
- (int8)(state & kControlStateFramed), (int8)inverse));
- break;
+ s->gui->drawControlIcon(rect, obj, view, loop, cel, state, inverse);
+ return;
case K_CONTROL_CONTROL:
case K_CONTROL_CONTROL_ALIAS: {
diff --git a/engines/sci/gui/gui.cpp b/engines/sci/gui/gui.cpp
index 2baf08c43f..a66f0e9d55 100644
--- a/engines/sci/gui/gui.cpp
+++ b/engines/sci/gui/gui.cpp
@@ -281,6 +281,13 @@ void SciGui::drawControlText(Common::Rect rect, reg_t obj, const char *text, int
_screen->updateScreen();
}
+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::graphFillBoxForeground(Common::Rect rect) {
_gfx->PaintRect(rect);
_screen->updateScreen();
diff --git a/engines/sci/gui/gui.h b/engines/sci/gui/gui.h
index febf5d363d..c172763927 100644
--- a/engines/sci/gui/gui.h
+++ b/engines/sci/gui/gui.h
@@ -65,6 +65,7 @@ public:
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 graphFillBoxForeground(Common::Rect rect);
virtual void graphFillBoxBackground(Common::Rect rect);
diff --git a/engines/sci/gui32/gui32.cpp b/engines/sci/gui32/gui32.cpp
index 718b96dc7f..4d7097a77f 100644
--- a/engines/sci/gui32/gui32.cpp
+++ b/engines/sci/gui32/gui32.cpp
@@ -584,6 +584,14 @@ void SciGui32::drawControlText(Common::Rect rect, reg_t obj, const char *text, i
if (!s->pic_not_valid) FULL_REDRAW();
}
+void SciGui32::drawControlIcon(Common::Rect rect, reg_t obj, GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo cellNo, int16 style, bool inverse) {
+ rect_t area = gfx_rect(rect.left, rect.top, rect.width(), rect.height());
+
+ ADD_TO_CURRENT_PICTURE_PORT(sciw_new_icon_control(s->port, obj, area, viewId, loopNo, cellNo,
+ (int8)(style & kControlStateFramed), (int8)inverse));
+ if (!s->pic_not_valid) FULL_REDRAW();
+}
+
static gfx_color_t graph_map_color(EngineState *s, int color, int priority, int control) {
gfx_color_t retval;
diff --git a/engines/sci/gui32/gui32.h b/engines/sci/gui32/gui32.h
index d49fcfa503..839607dbab 100644
--- a/engines/sci/gui32/gui32.h
+++ b/engines/sci/gui32/gui32.h
@@ -60,6 +60,7 @@ public:
void drawCel(GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo celNo, uint16 leftPos, uint16 topPos, int16 priority, uint16 paletteNo);
void drawControlButton(Common::Rect rect, reg_t obj, const char *text, int16 fontId, int16 style, bool inverse);
void drawControlText(Common::Rect rect, reg_t obj, const char *text, int16 fontId, int16 mode, int16 style, bool inverse);
+ void drawControlIcon(Common::Rect rect, reg_t obj, GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo, int16 style, bool inverse);
void graphFillBoxForeground(Common::Rect rect);
void graphFillBoxBackground(Common::Rect rect);