[Scummvm-cvs-logs] SF.net SVN: scummvm:[44701] scummvm/trunk/engines/sci
m_kiewitz at users.sourceforge.net
m_kiewitz at users.sourceforge.net
Tue Oct 6 18:36:28 CEST 2009
Revision: 44701
http://scummvm.svn.sourceforge.net/scummvm/?rev=44701&view=rev
Author: m_kiewitz
Date: 2009-10-06 16:36:28 +0000 (Tue, 06 Oct 2009)
Log Message:
-----------
SCI/newgui: kHiLite support
Modified Paths:
--------------
scummvm/trunk/engines/sci/engine/kgraphics.cpp
scummvm/trunk/engines/sci/gui/gui.cpp
scummvm/trunk/engines/sci/gui/gui.h
scummvm/trunk/engines/sci/gui32/gui32.cpp
scummvm/trunk/engines/sci/gui32/gui32.h
Modified: scummvm/trunk/engines/sci/engine/kgraphics.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kgraphics.cpp 2009-10-06 16:25:34 UTC (rev 44700)
+++ scummvm/trunk/engines/sci/engine/kgraphics.cpp 2009-10-06 16:36:28 UTC (rev 44701)
@@ -1394,7 +1394,7 @@
return s->r_acc;
}
-static void _k_draw_control(EngineState *s, reg_t obj, bool inverse) {
+static void _k_draw_control(EngineState *s, reg_t obj, bool hilite) {
SegManager *segMan = s->_segMan;
int x = (int16)GET_SEL32V(obj, nsLeft);
int y = (int16)GET_SEL32V(obj, nsTop);
@@ -1423,13 +1423,13 @@
switch (type) {
case K_CONTROL_BUTTON:
debugC(2, kDebugLevelGraphics, "drawing button %04x:%04x to %d,%d\n", PRINT_REG(obj), x, y);
- s->gui->drawControlButton(rect, obj, s->strSplit(text.c_str(), NULL).c_str(), font_nr, state, inverse);
+ s->gui->drawControlButton(rect, obj, s->strSplit(text.c_str(), NULL).c_str(), font_nr, state, hilite);
return;
case K_CONTROL_TEXT:
mode = (gfx_alignment_t) GET_SEL32V(obj, mode);
debugC(2, kDebugLevelGraphics, "drawing text %04x:%04x ('%s') to %d,%d, mode=%d\n", PRINT_REG(obj), text.c_str(), x, y, mode);
- s->gui->drawControlText(rect, obj, s->strSplit(text.c_str(), NULL).c_str(), font_nr, mode, state, inverse);
+ s->gui->drawControlText(rect, obj, s->strSplit(text.c_str(), NULL).c_str(), font_nr, mode, state, hilite);
return;
case K_CONTROL_EDIT:
@@ -1442,12 +1442,12 @@
cursor = text.size();
// update_cursor_limits(&s->save_dir_edit_offset, &cursor, max); FIXME: get rid of this?
- ADD_TO_CURRENT_PICTURE_PORT(sciw_new_edit_control(s->port, obj, area, text.c_str(), font_nr, (unsigned)cursor, (int8)inverse));
+ ADD_TO_CURRENT_PICTURE_PORT(sciw_new_edit_control(s->port, obj, area, text.c_str(), font_nr, (unsigned)cursor, (int8)hilite));
break;
case K_CONTROL_ICON:
debugC(2, kDebugLevelGraphics, "drawing icon control %04x:%04x to %d,%d\n", PRINT_REG(obj), x, y - 1);
- s->gui->drawControlIcon(rect, obj, view, loop, cel, state, inverse);
+ s->gui->drawControlIcon(rect, obj, view, loop, cel, state, hilite);
return;
case K_CONTROL_CONTROL:
@@ -1506,7 +1506,7 @@
}
ADD_TO_CURRENT_PICTURE_PORT(sciw_new_list_control(s->port, obj, area, font_nr, entries_list, entries_nr,
- list_top, selection, (int8)inverse));
+ list_top, selection, (int8)hilite));
free(entries_list);
delete[] strings;
}
Modified: scummvm/trunk/engines/sci/gui/gui.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui.cpp 2009-10-06 16:25:34 UTC (rev 44700)
+++ scummvm/trunk/engines/sci/gui/gui.cpp 2009-10-06 16:36:28 UTC (rev 44701)
@@ -279,36 +279,48 @@
_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();
}
Modified: scummvm/trunk/engines/sci/gui/gui.h
===================================================================
--- scummvm/trunk/engines/sci/gui/gui.h 2009-10-06 16:25:34 UTC (rev 44700)
+++ scummvm/trunk/engines/sci/gui/gui.h 2009-10-06 16:36:28 UTC (rev 44701)
@@ -65,9 +65,9 @@
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);
Modified: scummvm/trunk/engines/sci/gui32/gui32.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui32/gui32.cpp 2009-10-06 16:25:34 UTC (rev 44700)
+++ scummvm/trunk/engines/sci/gui32/gui32.cpp 2009-10-06 16:36:28 UTC (rev 44701)
@@ -583,27 +583,27 @@
FULL_REDRAW();
}
-void SciGui32::drawControlButton(Common::Rect rect, reg_t obj, const char *text, int16 fontId, int16 style, bool inverse) {
+void SciGui32::drawControlButton(Common::Rect rect, reg_t obj, const char *text, int16 fontId, int16 style, bool hilite) {
rect_t area = gfx_rect(rect.left, rect.top, rect.width(), rect.height());
ADD_TO_CURRENT_PICTURE_PORT(sciw_new_button_control(s->port, obj, area, text, fontId,
- (int8)(style & kControlStateFramed), (int8)inverse, (int8)(style & kControlStateDisabled)));
+ (int8)(style & kControlStateFramed), (int8)hilite, (int8)(style & kControlStateDisabled)));
if (!s->pic_not_valid) FULL_REDRAW();
}
-void SciGui32::drawControlText(Common::Rect rect, reg_t obj, const char *text, int16 fontId, int16 mode, int16 style, bool inverse) {
+void SciGui32::drawControlText(Common::Rect rect, reg_t obj, const char *text, int16 fontId, int16 mode, int16 style, bool hilite) {
rect_t area = gfx_rect(rect.left, rect.top, rect.width(), rect.height());
ADD_TO_CURRENT_PICTURE_PORT(sciw_new_text_control(s->port, obj, area, text, fontId, (gfx_alignment_t) mode,
- (int8)(!!(style & kControlStateDitherFramed)), (int8)inverse));
+ (int8)(!!(style & kControlStateDitherFramed)), (int8)hilite));
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) {
+void SciGui32::drawControlIcon(Common::Rect rect, reg_t obj, GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo cellNo, int16 style, bool hilite) {
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));
+ (int8)(style & kControlStateFramed), (int8)hilite));
if (!s->pic_not_valid) FULL_REDRAW();
}
Modified: scummvm/trunk/engines/sci/gui32/gui32.h
===================================================================
--- scummvm/trunk/engines/sci/gui32/gui32.h 2009-10-06 16:25:34 UTC (rev 44700)
+++ scummvm/trunk/engines/sci/gui32/gui32.h 2009-10-06 16:36:28 UTC (rev 44701)
@@ -59,9 +59,9 @@
void drawStatus(const char *text, int16 colorPen, int16 colorBack);
void drawPicture(GuiResourceId pictureId, uint16 showStyle, uint16 flags, int16 EGApaletteNo);
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 drawControlButton(Common::Rect rect, reg_t obj, const char *text, int16 fontId, int16 style, bool hilite);
+ void drawControlText(Common::Rect rect, reg_t obj, const char *text, int16 fontId, int16 mode, int16 style, bool hilite);
+ void drawControlIcon(Common::Rect rect, reg_t obj, GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo, int16 style, bool hilite);
void graphFillBoxForeground(Common::Rect rect);
void graphFillBoxBackground(Common::Rect rect);
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