diff options
author | Robert Göffringmann | 2003-07-04 20:31:41 +0000 |
---|---|---|
committer | Robert Göffringmann | 2003-07-04 20:31:41 +0000 |
commit | 67ba28170f26080fed61ce97b4ae6bb5d81a9d03 (patch) | |
tree | 93c4f6460ee333d0012ad6d9bf937ba48ae89ea0 /sky/control.cpp | |
parent | f24ca1fcdc649e78dba89192ed994a9b06a29fb8 (diff) | |
download | scummvm-rg350-67ba28170f26080fed61ce97b4ae6bb5d81a9d03.tar.gz scummvm-rg350-67ba28170f26080fed61ce97b4ae6bb5d81a9d03.tar.bz2 scummvm-rg350-67ba28170f26080fed61ce97b4ae6bb5d81a9d03.zip |
don't let user enter too long save names
svn-id: r8749
Diffstat (limited to 'sky/control.cpp')
-rw-r--r-- | sky/control.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sky/control.cpp b/sky/control.cpp index f9f069db31..ff9878a5eb 100644 --- a/sky/control.cpp +++ b/sky/control.cpp @@ -739,6 +739,8 @@ void SkyControl::handleKeyPress(uint8 key, uint8 *textBuf) { textBuf++; textBuf[0] = 0; } else { + if (_enteredTextWidth >= PAN_LINE_WIDTH - 10) + return; if (((key >= 'A') && (key <= 'Z')) || ((key >= 'a') && (key <= 'z')) || ((key >= '0') && (key <= '9')) || checkKeyList(key)) { uint8 strLen = 0; @@ -771,9 +773,10 @@ void SkyControl::setUpGameSprites(uint8 *nameBuf, dataFileHeader **nameSprites, } nameBuf += MAX_TEXT_LEN; nameSprites[cnt] = (dataFileHeader*)textSpr.textData; - if (firstNum + cnt == selectedGame) + if (firstNum + cnt == selectedGame) { nameSprites[cnt]->flag = 1; - else + _enteredTextWidth = (uint16)textSpr.textWidth; + } else nameSprites[cnt]->flag = 0; } } |