[Scummvm-cvs-logs] SF.net SVN: scummvm:[45035] scummvm/trunk/engines/sci
m_kiewitz at users.sourceforge.net
m_kiewitz at users.sourceforge.net
Tue Oct 13 20:49:10 CEST 2009
Revision: 45035
http://scummvm.svn.sourceforge.net/scummvm/?rev=45035&view=rev
Author: m_kiewitz
Date: 2009-10-13 18:49:10 +0000 (Tue, 13 Oct 2009)
Log Message:
-----------
SCI/newgui: K_CONTROL_* renamed to SCI_CONTROLS_TYPE_*
Modified Paths:
--------------
scummvm/trunk/engines/sci/engine/kgraphics.cpp
scummvm/trunk/engines/sci/gui/gui.cpp
scummvm/trunk/engines/sci/gui/gui.h
Modified: scummvm/trunk/engines/sci/engine/kgraphics.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kgraphics.cpp 2009-10-13 17:57:03 UTC (rev 45034)
+++ scummvm/trunk/engines/sci/engine/kgraphics.cpp 2009-10-13 18:49:10 UTC (rev 45035)
@@ -986,17 +986,6 @@
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 @@
* 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 @@
// 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 @@
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 @@
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 @@
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 @@
delete[] listStrings;
return;
- case K_CONTROL_PERCENTAGE:
+ case SCI_CONTROLS_TYPE_PERCENTAGE:
// TODO: Implement this
return;
Modified: scummvm/trunk/engines/sci/gui/gui.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui.cpp 2009-10-13 17:57:03 UTC (rev 45034)
+++ scummvm/trunk/engines/sci/gui/gui.cpp 2009-10-13 18:49:10 UTC (rev 45035)
@@ -408,7 +408,7 @@
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);
}
Modified: scummvm/trunk/engines/sci/gui/gui.h
===================================================================
--- scummvm/trunk/engines/sci/gui/gui.h 2009-10-13 17:57:03 UTC (rev 45034)
+++ scummvm/trunk/engines/sci/gui/gui.h 2009-10-13 18:49:10 UTC (rev 45035)
@@ -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;
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