diff options
author | Filippos Karapetis | 2007-08-25 17:10:31 +0000 |
---|---|---|
committer | Filippos Karapetis | 2007-08-25 17:10:31 +0000 |
commit | 3d823b250b0194d1bb08b194c4037081a48828ba (patch) | |
tree | 390e69023a7daed50fb8f8494ba05b2d8ec3c140 | |
parent | 8f2e60060168c33b81bd910616e7230a8434a2a3 (diff) | |
download | scummvm-rg350-3d823b250b0194d1bb08b194c4037081a48828ba.tar.gz scummvm-rg350-3d823b250b0194d1bb08b194c4037081a48828ba.tar.bz2 scummvm-rg350-3d823b250b0194d1bb08b194c4037081a48828ba.zip |
Properly limit the save title size in IHNM
svn-id: r28728
-rw-r--r-- | engines/saga/interface.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/engines/saga/interface.cpp b/engines/saga/interface.cpp index 0ff05c775e..f8b65f5b8e 100644 --- a/engines/saga/interface.cpp +++ b/engines/saga/interface.cpp @@ -1154,6 +1154,10 @@ bool Interface::processTextInput(uint16 ascii) { uint tempWidth; memset(tempString, 0, SAVE_TITLE_SIZE); ch[1] = 0; + // ITE has a maximum save title size of SAVE_TITLE_SIZE (28), but IHNM has a slightly smaller + // save title size (21). We only limit the save title size during text input, to preserve + // backwards compatibility with older save games + uint save_title_size = _vm->getGameType() == GType_ITE ? SAVE_TITLE_SIZE : SAVE_TITLE_SIZE - 6; switch (ascii) { case 13: @@ -1193,7 +1197,7 @@ bool Interface::processTextInput(uint16 ascii) { ((ascii >= '0') && (ascii <='9')) || ((ascii >= 'A') && (ascii <='Z')) || (ascii == ' ') || (ascii == '-') || (ascii == '_')) { - if (_textInputStringLength < SAVE_TITLE_SIZE - 1) { + if (_textInputStringLength < save_title_size - 1) { ch[0] = ascii; tempWidth = _vm->_font->getStringWidth(kKnownFontSmall, ch, 0, kFontNormal); tempWidth += _vm->_font->getStringWidth(kKnownFontSmall, _textInputString, 0, kFontNormal); |