diff options
author | Matthew Hoops | 2011-07-20 09:27:39 -0400 |
---|---|---|
committer | Matthew Hoops | 2011-07-20 09:27:39 -0400 |
commit | ad293b249e74dd1cfbdbd721d02145efbdaf9eca (patch) | |
tree | e568d96f6d7f64c5e58b4c7cd1c4fda7e649bfc7 /engines/kyra/gui_lol.cpp | |
parent | d7411acc2b1c7702280dbff1c3e1bafee528184b (diff) | |
parent | e25e85fbb047fef895ede97c3c2c73451631052c (diff) | |
download | scummvm-rg350-ad293b249e74dd1cfbdbd721d02145efbdaf9eca.tar.gz scummvm-rg350-ad293b249e74dd1cfbdbd721d02145efbdaf9eca.tar.bz2 scummvm-rg350-ad293b249e74dd1cfbdbd721d02145efbdaf9eca.zip |
Merge remote branch 'upstream/master' into pegasus
Diffstat (limited to 'engines/kyra/gui_lol.cpp')
-rw-r--r-- | engines/kyra/gui_lol.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/engines/kyra/gui_lol.cpp b/engines/kyra/gui_lol.cpp index fb11040168..c64d3e7723 100644 --- a/engines/kyra/gui_lol.cpp +++ b/engines/kyra/gui_lol.cpp @@ -2572,9 +2572,19 @@ void GUI_LoL::setupSaveMenuSlots(Menu &menu, int num) { slotOffs = 1; } + int saveSlotMaxLen = ((_screen->getScreenDim(8))->w << 3) - _screen->getCharWidth('W'); + for (int i = startSlot; i < num && _savegameOffset + i - slotOffs < _savegameListSize; ++i) { if (_savegameList[_saveSlots[i + _savegameOffset - slotOffs]]) { Common::strlcpy(s, _savegameList[_saveSlots[i + _savegameOffset - slotOffs]], 80); + + // Trim long GMM save descriptions to fit our save slots + int fC = _screen->getTextWidth(s); + while (s[0] && fC >= saveSlotMaxLen) { + s[strlen(s) - 1] = 0; + fC = _screen->getTextWidth(s); + } + menu.item[i].itemString = s; s += (strlen(s) + 1); menu.item[i].saveSlot = _saveSlots[i + _savegameOffset - slotOffs]; |