Ticket #8191: cmi-object-line2.diff

File cmi-object-line2.diff, 4.3 KB (added by eriktorbjorn, 21 years ago)

Patch against a March 31 CVS snapshot

  • scummvm/scumm/bundle.cpp

    diff -ur ScummVM-cvs20030331/scummvm/scumm/bundle.cpp ScummVM-cvs20030331+hack/scummvm/scumm/bundle.cpp
    old new  
    361361                        return final_size;
    362362                }
    363363        }
    364         warning("Failed finding voice %s", name);
     364        debug(2, "Failed finding voice %s", name);
    365365        return final_size;
    366366}
    367367
  • scummvm/scumm/script_v8.cpp

    diff -ur ScummVM-cvs20030331/scummvm/scumm/script_v8.cpp ScummVM-cvs20030331+hack/scummvm/scumm/script_v8.cpp
    old new  
    515515                        }
    516516                        pointer[j] = 0;
    517517
    518                         // Stop any talking that's still going on
    519                         if (_sound->_talkChannel > -1)
    520                                 _mixer->stop(_sound->_talkChannel);
     518                        int new_sound = _sound->playBundleSound(pointer);
     519                        if (new_sound != -1) {
     520                                // Stop any talking that's still going on
     521                                if (_sound->_talkChannel > -1)
     522                                        _mixer->stop(_sound->_talkChannel);
     523                                _sound->_talkChannel = new_sound;
     524                        }
    521525
    522                         _sound->_talkChannel = _sound->playBundleSound(pointer);
    523526                        _messagePtr = _transText;
    524527                }
    525528               
     
    607610                                _charset->_nextTop = _charset->_top;
    608611                        }
    609612                } while (c);
     613
     614                _blastTextQueue[i].left = _charset->_strLeft;
     615                _blastTextQueue[i].right = _charset->_strRight;
     616                _blastTextQueue[i].top = _charset->_strTop;
     617                _blastTextQueue[i].bottom = _charset->_strBottom;
    610618        }
    611619        _charset->_ignoreCharsetMask = false;
    612620}
    613621
     622void Scumm::removeBlastTexts() {
     623        int i;
     624
     625        for (i = 0; i < _blastTextQueuePos; i++) {
     626                restoreBG(_blastTextQueue[i].left, _blastTextQueue[i].top, _blastTextQueue[i].right, _blastTextQueue[i].bottom);
     627        }
     628        _blastTextQueuePos = 0;
     629}
     630
    614631void Scumm_v8::o8_mod() {
    615632        int a = pop();
    616633        push(pop() % a);
     
    16141631                // scripts. Probably a wrong push/pop somewhere. For now override to correct value.
    16151632                array = 658;
    16161633                ArrayHeader *ah = (ArrayHeader *)getResourceAddress(rtString, readVar(array));
    1617                 if (!strcmp((char *)ah->data, "Saveload Page"))
     1634                if (!strcmp((char *)ah->data, "Saveload Page") || !strcmp((char *)ah->data, "Object Names"))
    16181635                        push(1);
    16191636                else
    16201637                        push(0);
  • scummvm/scumm/scumm.h

    diff -ur ScummVM-cvs20030331/scummvm/scumm/scumm.h ScummVM-cvs20030331+hack/scummvm/scumm/scumm.h
    old new  
    116116
    117117struct BlastText {
    118118        int16 xpos, ypos;
     119        int16 left, right, top, bottom;
    119120        byte color;
    120121        byte charset;
    121122        bool center;
     
    876877
    877878        void enqueueText(byte *text, int x, int y, byte color, byte charset, bool center);
    878879        void drawBlastTexts();
    879         void removeBlastTexts() { _blastTextQueuePos = 0; }
     880        void removeBlastTexts();
    880881
    881882        void enqueueObject(int objectNumber, int objectX, int objectY, int objectWidth,
    882883                           int objectHeight, int scaleX, int scaleY, int image, int mode);
  • scummvm/scumm/string.cpp

    diff -ur ScummVM-cvs20030331/scummvm/scumm/string.cpp ScummVM-cvs20030331+hack/scummvm/scumm/string.cpp
    old new  
    857857        if (_gameId == GID_CMI) {
    858858                if ((text[0] == '/') && (_existLanguageFile == true)) {
    859859                        struct langIndexNode target;
    860                         struct langIndexNode *found;
     860                        struct langIndexNode *found = NULL;
    861861
    862862                        // copy name from text /..../
    863863                        for (l = 0; (l < 8) && (text[l + 1] != '/'); l++)
    864864                                target.tag[l] = toupper(text[l + 1]);
    865865                        target.tag[l] = 0;
    866866
    867                         found = (struct langIndexNode *)bsearch(&target, _languageIndex, _languageStrCount, sizeof(struct langIndexNode), indexCompare);
     867                        // HACK: These are used for the object line when
     868                        // using one object on another. I don't know if the
     869                        // text in the language file is a placeholder or if
     870                        // we're supposed to use it, but at least in the
     871                        // English version things will work so much better if
     872                        // we can't find translations for these.
    868873
     874                        if (strcmp(target.tag, "PU_M001") != 0 && strcmp(target.tag, "PU_M002") != 0)
     875                                found = (struct langIndexNode *)bsearch(&target, _languageIndex, _languageStrCount, sizeof(struct langIndexNode), indexCompare);
    869876                        if (found != NULL) {
    870877                                File file;
    871878