aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/graphics/gui.cpp
diff options
context:
space:
mode:
authorMartin Kiewitz2010-01-31 22:20:55 +0000
committerMartin Kiewitz2010-01-31 22:20:55 +0000
commitd31f696d1f5c9f5fb79be0524a6142e967308220 (patch)
tree6a805b593551bb089dd8846b15eca183b1ea01e4 /engines/sci/graphics/gui.cpp
parent12d983eaf41bd8353849ee8776fc2bbc59808870 (diff)
downloadscummvm-rg350-d31f696d1f5c9f5fb79be0524a6142e967308220.tar.gz
scummvm-rg350-d31f696d1f5c9f5fb79be0524a6142e967308220.tar.bz2
scummvm-rg350-d31f696d1f5c9f5fb79be0524a6142e967308220.zip
SCI: rename Controls to GfxControls, gets directly called now
svn-id: r47783
Diffstat (limited to 'engines/sci/graphics/gui.cpp')
-rw-r--r--engines/sci/graphics/gui.cpp106
1 files changed, 2 insertions, 104 deletions
diff --git a/engines/sci/graphics/gui.cpp b/engines/sci/graphics/gui.cpp
index 111038dcd0..a1aeee2033 100644
--- a/engines/sci/graphics/gui.cpp
+++ b/engines/sci/graphics/gui.cpp
@@ -59,7 +59,8 @@ SciGui::SciGui(EngineState *state, GfxScreen *screen, GfxPalette *palette, GfxCa
_animate = new GfxAnimate(_s, _cache, _ports, _paint16, _screen, _palette, _cursor, _transitions);
_s->_gfxAnimate = _animate;
_text16 = new GfxText16(_s->resMan, _cache, _ports, _paint16, _screen);
- _controls = new Controls(_s->_segMan, _ports, _paint16, _text16);
+ _controls = new GfxControls(_s->_segMan, _ports, _paint16, _text16, _screen);
+ _s->_gfxControls = _controls;
_menu = new Menu(_s->_event, _s->_segMan, this, _ports, _paint16, _text16, _screen, _cursor);
}
@@ -320,109 +321,6 @@ void SciGui::drawCel(GuiResourceId viewId, int16 loopNo, int16 celNo, uint16 lef
_palette->setOnScreen();
}
-int SciGui::getControlPicNotValid() {
- if (getSciVersion() >= SCI_VERSION_1_1)
- return _screen->_picNotValidSci11;
- return _screen->_picNotValid;
-}
-
-void SciGui::drawControlButton(Common::Rect rect, reg_t obj, const char *text, int16 fontId, int16 style, bool hilite) {
- if (!hilite) {
- rect.grow(1);
- _paint16->eraseRect(rect);
- _paint16->frameRect(rect);
- rect.grow(-2);
- _ports->textGreyedOutput(style & 1 ? false : true);
- _text16->Box(text, 0, rect, SCI_TEXT16_ALIGNMENT_CENTER, fontId);
- _ports->textGreyedOutput(false);
- rect.grow(1);
- if (style & 8) // selected
- _paint16->frameRect(rect);
- if (!getControlPicNotValid()) {
- rect.grow(1);
- _paint16->bitsShow(rect);
- }
- } else {
- _paint16->invertRect(rect);
- _paint16->bitsShow(rect);
- }
-}
-
-void SciGui::drawControlText(Common::Rect rect, reg_t obj, const char *text, int16 fontId, TextAlignment alignment, int16 style, bool hilite) {
- if (!hilite) {
- rect.grow(1);
- _paint16->eraseRect(rect);
- rect.grow(-1);
- _text16->Box(text, 0, rect, alignment, fontId);
- if (style & 8) { // selected
- _paint16->frameRect(rect);
- }
- rect.grow(1);
- if (!getControlPicNotValid())
- _paint16->bitsShow(rect);
- } else {
- _paint16->invertRect(rect);
- _paint16->bitsShow(rect);
- }
-}
-
-void SciGui::drawControlTextEdit(Common::Rect rect, reg_t obj, const char *text, int16 fontId, int16 mode, int16 style, int16 cursorPos, int16 maxChars, bool hilite) {
- Common::Rect textRect = rect;
- uint16 oldFontId = _text16->GetFontId();
-
- rect.grow(1);
- _controls->TexteditCursorErase();
- _paint16->eraseRect(rect);
- _text16->Box(text, 0, textRect, SCI_TEXT16_ALIGNMENT_LEFT, fontId);
- _paint16->frameRect(rect);
- if (style & 8) {
- _text16->SetFont(fontId);
- rect.grow(-1);
- _controls->TexteditCursorDraw(rect, text, cursorPos);
- _text16->SetFont(oldFontId);
- rect.grow(1);
- }
- if (!getControlPicNotValid())
- _paint16->bitsShow(rect);
-}
-
-void SciGui::drawControlIcon(Common::Rect rect, reg_t obj, GuiResourceId viewId, int16 loopNo, int16 celNo, int16 priority, int16 style, bool hilite) {
- if (!hilite) {
- _paint16->drawCelAndShow(viewId, loopNo, celNo, rect.left, rect.top, priority, 0);
- if (style & 0x20) {
- _paint16->frameRect(rect);
- }
- if (!getControlPicNotValid())
- _paint16->bitsShow(rect);
- } else {
- _paint16->invertRect(rect);
- _paint16->bitsShow(rect);
- }
-}
-
-void SciGui::drawControlList(Common::Rect rect, reg_t obj, int16 maxChars, int16 count, const char **entries, GuiResourceId fontId, int16 style, int16 upperPos, int16 cursorPos, bool isAlias, bool hilite) {
- if (!hilite) {
- _controls->drawListControl(rect, obj, maxChars, count, entries, fontId, upperPos, cursorPos, isAlias);
- rect.grow(1);
- if (isAlias && (style & 8)) {
- _paint16->frameRect(rect);
- }
- if (!getControlPicNotValid())
- _paint16->bitsShow(rect);
- }
-}
-
-void SciGui::editControl(reg_t controlObject, reg_t eventObject) {
- int16 controlType = GET_SEL32V(_s->_segMan, controlObject, type);
-
- switch (controlType) {
- case SCI_CONTROLS_TYPE_TEXTEDIT:
- // Only process textedit controls in here
- _controls->TexteditChange(controlObject, eventObject);
- return;
- }
-}
-
void SciGui::graphFillBoxForeground(Common::Rect rect) {
_paint16->paintRect(rect);
}