[Scummvm-cvs-logs] SF.net SVN: scummvm:[50803] scummvm/trunk/engines/sci/engine/kgraphics.cpp
m_kiewitz at users.sourceforge.net
m_kiewitz at users.sourceforge.net
Sun Jul 11 18:55:08 CEST 2010
Revision: 50803
http://scummvm.svn.sourceforge.net/scummvm/?rev=50803&view=rev
Author: m_kiewitz
Date: 2010-07-11 16:55:08 +0000 (Sun, 11 Jul 2010)
Log Message:
-----------
SCI: remove "a:" from default export hero quest 1 filename "a:hq1_hero.sav"
Modified Paths:
--------------
scummvm/trunk/engines/sci/engine/kgraphics.cpp
Modified: scummvm/trunk/engines/sci/engine/kgraphics.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kgraphics.cpp 2010-07-11 16:50:18 UTC (rev 50802)
+++ scummvm/trunk/engines/sci/engine/kgraphics.cpp 2010-07-11 16:55:08 UTC (rev 50803)
@@ -790,6 +790,11 @@
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 @@
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;
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