diff options
author | Martin Kiewitz | 2009-10-13 18:49:10 +0000 |
---|---|---|
committer | Martin Kiewitz | 2009-10-13 18:49:10 +0000 |
commit | f5b73061e45cafe17e409f42046660524e6d278d (patch) | |
tree | 69ada3044445c5a0da8e3331279f062a904d6187 /engines/sci | |
parent | 0b396ed37c80deb7475c53d194253c435203e78a (diff) | |
download | scummvm-rg350-f5b73061e45cafe17e409f42046660524e6d278d.tar.gz scummvm-rg350-f5b73061e45cafe17e409f42046660524e6d278d.tar.bz2 scummvm-rg350-f5b73061e45cafe17e409f42046660524e6d278d.zip |
SCI/newgui: K_CONTROL_* renamed to SCI_CONTROLS_TYPE_*
svn-id: r45035
Diffstat (limited to 'engines/sci')
-rw-r--r-- | engines/sci/engine/kgraphics.cpp | 31 | ||||
-rw-r--r-- | engines/sci/gui/gui.cpp | 2 | ||||
-rw-r--r-- | engines/sci/gui/gui.h | 11 |
3 files changed, 22 insertions, 22 deletions
diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp index f807efadc2..ff1f4e528e 100644 --- a/engines/sci/engine/kgraphics.cpp +++ b/engines/sci/engine/kgraphics.cpp @@ -986,17 +986,6 @@ reg_t kPalette(EngineState *s, int argc, reg_t *argv) { return s->r_acc; } -// Control types and flags -enum { - K_CONTROL_BUTTON = 1, - K_CONTROL_TEXT = 2, - K_CONTROL_TEXTEDIT = 3, - K_CONTROL_ICON = 4, - K_CONTROL_LIST = 6, - K_CONTROL_LIST_ALIAS = 7, - K_CONTROL_PERCENTAGE = 10 -}; - static void disableCertainButtons(SegManager *segMan, Common::String gameName, reg_t obj) { reg_t text_pos = GET_SEL32(obj, text); Common::String text; @@ -1025,7 +1014,7 @@ static void disableCertainButtons(SegManager *segMan, Common::String gameName, r * that game - bringing the save/load dialog on a par with SCI0. */ // NOTE: This _only_ works with the English version - if (type == K_CONTROL_BUTTON && (gameName == "sq4") && + if (type == SCI_CONTROLS_TYPE_BUTTON && (gameName == "sq4") && getSciVersion() < SCI_VERSION_1_1 && text == " Delete ") { PUT_SEL32V(obj, state, (state | kControlStateDisabled) & ~kControlStateEnabled); } @@ -1033,7 +1022,7 @@ static void disableCertainButtons(SegManager *segMan, Common::String gameName, r // Disable the "Change Directory" button, as we don't allow the game engine to // change the directory where saved games are placed // NOTE: This _only_ works with the English version - if (type == K_CONTROL_BUTTON && text == "Change\r\nDirectory") { + if (type == SCI_CONTROLS_TYPE_BUTTON && text == "Change\r\nDirectory") { PUT_SEL32V(obj, state, (state | kControlStateDisabled) & ~kControlStateEnabled); } } @@ -1063,18 +1052,18 @@ void _k_GenericDrawControl(EngineState *s, reg_t controlObject, bool hilite) { text = segMan->getString(textReference); switch (type) { - case K_CONTROL_BUTTON: + case SCI_CONTROLS_TYPE_BUTTON: debugC(2, kDebugLevelGraphics, "drawing button %04x:%04x to %d,%d\n", PRINT_REG(controlObject), x, y); s->_gui->drawControlButton(rect, controlObject, s->strSplit(text.c_str(), NULL).c_str(), fontId, style, hilite); return; - case K_CONTROL_TEXT: + case SCI_CONTROLS_TYPE_TEXT: mode = GET_SEL32V(controlObject, mode); debugC(2, kDebugLevelGraphics, "drawing text %04x:%04x ('%s') to %d,%d, mode=%d\n", PRINT_REG(controlObject), text.c_str(), x, y, mode); s->_gui->drawControlText(rect, controlObject, s->strSplit(text.c_str(), NULL).c_str(), fontId, mode, style, hilite); return; - case K_CONTROL_TEXTEDIT: + case SCI_CONTROLS_TYPE_TEXTEDIT: mode = GET_SEL32V(controlObject, mode); maxChars = GET_SEL32V(controlObject, max); cursorPos = GET_SEL32V(controlObject, cursor); @@ -1082,7 +1071,7 @@ void _k_GenericDrawControl(EngineState *s, reg_t controlObject, bool hilite) { s->_gui->drawControlTextEdit(rect, controlObject, s->strSplit(text.c_str(), NULL).c_str(), fontId, mode, style, cursorPos, maxChars, hilite); return; - case K_CONTROL_ICON: + case SCI_CONTROLS_TYPE_ICON: viewId = GET_SEL32V(controlObject, view); loopNo = sign_extend_byte(GET_SEL32V(controlObject, loop)); celNo = sign_extend_byte(GET_SEL32V(controlObject, cel)); @@ -1090,9 +1079,9 @@ void _k_GenericDrawControl(EngineState *s, reg_t controlObject, bool hilite) { s->_gui->drawControlIcon(rect, controlObject, viewId, loopNo, celNo, style, hilite); return; - case K_CONTROL_LIST: - case K_CONTROL_LIST_ALIAS: - if (type == K_CONTROL_LIST_ALIAS) + case SCI_CONTROLS_TYPE_LIST: + case SCI_CONTROLS_TYPE_LIST_ALIAS: + if (type == SCI_CONTROLS_TYPE_LIST_ALIAS) isAlias = true; maxChars = GET_SEL32V(controlObject, x); // max chars per entry @@ -1141,7 +1130,7 @@ void _k_GenericDrawControl(EngineState *s, reg_t controlObject, bool hilite) { delete[] listStrings; return; - case K_CONTROL_PERCENTAGE: + case SCI_CONTROLS_TYPE_PERCENTAGE: // TODO: Implement this return; diff --git a/engines/sci/gui/gui.cpp b/engines/sci/gui/gui.cpp index 88c0185f21..8600d4a472 100644 --- a/engines/sci/gui/gui.cpp +++ b/engines/sci/gui/gui.cpp @@ -408,7 +408,7 @@ void SciGui::editControl(reg_t controlObject, reg_t eventObject) { SegManager *segMan = _s->_segMan; int16 controlType = GET_SEL32V(controlObject, type); - if (controlType == 3) { + if (controlType == SCI_CONTROLS_TYPE_TEXTEDIT) { // Only process textedit controls in here _gfx->TexteditChange(controlObject, eventObject); } diff --git a/engines/sci/gui/gui.h b/engines/sci/gui/gui.h index 0d8e75f214..eea965e182 100644 --- a/engines/sci/gui/gui.h +++ b/engines/sci/gui/gui.h @@ -30,6 +30,17 @@ namespace Sci { +// Control types and flags +enum { + SCI_CONTROLS_TYPE_BUTTON = 1, + SCI_CONTROLS_TYPE_TEXT = 2, + SCI_CONTROLS_TYPE_TEXTEDIT = 3, + SCI_CONTROLS_TYPE_ICON = 4, + SCI_CONTROLS_TYPE_LIST = 6, + SCI_CONTROLS_TYPE_LIST_ALIAS = 7, + SCI_CONTROLS_TYPE_PERCENTAGE = 10 +}; + class SciGuiScreen; class SciGuiPalette; class SciGuiCursor; |