Ticket #8955: bs1_no_subtitle.patch

File bs1_no_subtitle.patch, 1.6 KB (added by criezy, 15 years ago)

No subtitle patch

  • engines/sword1/objectman.cpp

    diff -ruN scummvm-20090214-orig/engines/sword1/objectman.cpp scummvm-20090214/engines/sword1/objectman.cpp
    old new  
    109109        uint32 offset = _resMan->readUint32(addr + ((textId & ITM_ID) + 1)* 4);
    110110        if (offset == 0) {
    111111                warning("ObjectMan::lockText(%d): text number has no text lines", textId);
    112                 return _errorStr;
     112                return _missingSubTitleStr;
    113113        }
    114114        return addr + offset;
    115115}
     
    161161        memcpy(dest, _liveList, TOTAL_SECTIONS * sizeof(uint16));
    162162}
    163163
    164 char ObjectMan::_errorStr[] = "Error: Text not found.";
     164// String displayed when a subtitle sentence is missing in the cluster file.
     165// It happens with at least on sentence in Syria in some langages (see bug #1977094).
     166// Note: an empty string or a null pointer causes a crash.
     167char ObjectMan::_missingSubTitleStr[] = " ";
    165168
    166169} // End of namespace Sword1
  • engines/sword1/objectman.h

    diff -ruN scummvm-20090214-orig/engines/sword1/objectman.h scummvm-20090214/engines/sword1/objectman.h
    old new  
    6161        static const uint32 _textList[TOTAL_SECTIONS][7];       //a table of pointers to text files
    6262        uint16  _liveList[TOTAL_SECTIONS];                                      //which sections are active
    6363        uint8 *_cptData[TOTAL_SECTIONS];
    64         static char _errorStr[];
     64        static char _missingSubTitleStr[];
    6565};
    6666
    6767} // End of namespace Sword1