diff options
-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); |