aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine/kgraphics.cpp
diff options
context:
space:
mode:
authorMartin Kiewitz2010-07-11 16:55:08 +0000
committerMartin Kiewitz2010-07-11 16:55:08 +0000
commit30a28ec107dc254d8db0d9361cd0d7d34a089ec2 (patch)
tree52db304f43835da0f948f8d749368fabe6217950 /engines/sci/engine/kgraphics.cpp
parent38d79f60e3217debbf99c971a87ea581c00f007f (diff)
downloadscummvm-rg350-30a28ec107dc254d8db0d9361cd0d7d34a089ec2.tar.gz
scummvm-rg350-30a28ec107dc254d8db0d9361cd0d7d34a089ec2.tar.bz2
scummvm-rg350-30a28ec107dc254d8db0d9361cd0d7d34a089ec2.zip
SCI: remove "a:" from default export hero quest 1 filename "a:hq1_hero.sav"
svn-id: r50803
Diffstat (limited to 'engines/sci/engine/kgraphics.cpp')
-rw-r--r--engines/sci/engine/kgraphics.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp
index 13f2bd4875..e621e1b85a 100644
--- a/engines/sci/engine/kgraphics.cpp
+++ b/engines/sci/engine/kgraphics.cpp
@@ -790,6 +790,11 @@ void _k_GenericDrawControl(EngineState *s, reg_t controlObject, bool hilite) {
mode = readSelectorValue(s->_segMan, controlObject, SELECTOR(mode));
maxChars = readSelectorValue(s->_segMan, controlObject, SELECTOR(max));
cursorPos = readSelectorValue(s->_segMan, controlObject, SELECTOR(cursor));
+ if (cursorPos > text.size()) {
+ // if cursor is outside of text, adjust accordingly
+ cursorPos = text.size();
+ writeSelectorValue(s->_segMan, controlObject, SELECTOR(cursor), cursorPos);
+ }
debugC(2, kDebugLevelGraphics, "drawing edit control %04x:%04x (text %04x:%04x, '%s') to %d,%d", PRINT_REG(controlObject), PRINT_REG(textReference), text.c_str(), x, y);
g_sci->_gfxControls->kernelDrawTextEdit(rect, controlObject, g_sci->strSplit(text.c_str(), NULL).c_str(), fontId, mode, style, cursorPos, maxChars, hilite);
return;
@@ -880,6 +885,18 @@ reg_t kDrawControl(EngineState *s, int argc, reg_t *argv) {
int state = readSelectorValue(s->_segMan, controlObject, SELECTOR(state));
writeSelectorValue(s->_segMan, controlObject, SELECTOR(state), (state | SCI_CONTROLS_STYLE_DISABLED) & ~SCI_CONTROLS_STYLE_ENABLED);
}
+ if (objName == "DEdit") {
+ reg_t textReference = readSelector(s->_segMan, controlObject, SELECTOR(text));
+ if (!textReference.isNull()) {
+ Common::String text = s->_segMan->getString(textReference);
+ if (text == "a:hq1_hero.sav") {
+ // Remove "a:" from hero quest export default filename
+ text.deleteChar(0);
+ text.deleteChar(0);
+ s->_segMan->strcpy(textReference, text.c_str());
+ }
+ }
+ }
_k_GenericDrawControl(s, controlObject, false);
return NULL_REG;