mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-23 12:44:02 +00:00
SCI/newgui: kHiLite support
svn-id: r44701
This commit is contained in:
parent
d2fdc8fc79
commit
ca9f08c624
@ -1394,7 +1394,7 @@ reg_t kEditControl(EngineState *s, int argc, reg_t *argv) {
|
||||
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 @@ static void _k_draw_control(EngineState *s, reg_t obj, bool inverse) {
|
||||
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 @@ static void _k_draw_control(EngineState *s, reg_t obj, bool inverse) {
|
||||
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 @@ static void _k_draw_control(EngineState *s, reg_t obj, bool inverse) {
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
@ -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();
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -583,27 +583,27 @@ void SciGui32::drawCel(GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo
|
||||
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();
|
||||
}
|
||||
|
||||
|
@ -59,9 +59,9 @@ public:
|
||||
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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user