Ticket #8625: dialog_charset_glitch.patch
File dialog_charset_glitch.patch, 2.2 KB (added by , 17 years ago) |
---|
-
engines/scumm/string.cpp
646 646 647 647 void ScummEngine::drawString(int a, const byte *msg) { 648 648 byte buf[270]; 649 byte *space;649 //byte *space; 650 650 int i, c; 651 651 byte fontHeight = 0; 652 652 uint color; … … 688 688 689 689 fontHeight = _charset->getFontHeight(); 690 690 691 //* REPLACED: Is trimming necessary? Trimming deletes spaces when 692 //* editing a savegame name in the original SAVE/LOAD-dialog of Scumm-V3 games, e.g. Indy3. 693 //* When entering a name in those dialogs trailing spaces will not be shown because they are trimmed. 694 //* If it's needed, trim only if (_charset->_center == true) or 695 //* trim a copy of buf to determine the string-width for centering. 696 //* Disabling this section also fixes the Indy3 Grail Diary issue mentioned below. 697 // 691 698 // trim from the right 692 byte *tmp = buf; 693 space = NULL; 694 while (*tmp) { 695 if (*tmp == ' ') { 696 if (!space) 697 space = tmp; 698 } else { 699 space = NULL; 700 } 701 tmp++; 702 } 703 if (space) 704 *space = '\0'; 699 //byte *tmp = buf; 700 //space = NULL; 701 //while (*tmp) { 702 // if (*tmp == ' ') { 703 // if (!space) 704 // space = tmp; 705 // } else { 706 // space = NULL; 707 // } 708 // tmp++; 709 //} 710 //if (space) 711 // *space = '\0'; 712 705 713 if (_charset->_center) { 706 714 _charset->_left -= _charset->getStringWidth(a, buf) / 2; 707 715 } 708 716 709 717 if (!buf[0]) { 710 buf[0] = ' '; 711 buf[1] = 0; 718 //* REPLACED: Does not work with the original SAVE/LOAD-dialog (e.g. indy3). 719 //* If you clicked on an empty savegame slot the name was displayed as " " instead 720 //* of "". 721 //buf[0] = ' '; 722 //buf[1] = 0; 723 724 _charset->_str.left = _charset->_left; 725 _charset->_str.top = _charset->_top; 726 _charset->_str.right = _charset->_left; 727 _charset->_str.bottom = _charset->_top; 712 728 } 713 729 714 730 for (i = 0; (c = buf[i++]) != 0;) { … … 798 814 _nextTop = _charset->_top; 799 815 } 800 816 801 _string[a].xpos = _charset->_str.right + 8; //Indy3: Fixes Grail Diary text positioning817 _string[a].xpos = _charset->_str.right; // + 8; Indy3: Fixes Grail Diary text positioning 802 818 } 803 819 804 820 int ScummEngine::convertMessageToString(const byte *msg, byte *dst, int dstSize) {