Ticket #4575: 20120625-scumm-smush-flag-2.patch

File 20120625-scumm-smush-flag-2.patch, 1.6 KB (added by digitall, 12 years ago)

Proposed Patch to correct SMUSH Text Flags meanings

  • engines/scumm/smush/smush_player.cpp

    diff --git a/engines/scumm/smush/smush_player.cpp b/engines/scumm/smush/smush_player.cpp
    index a53b808..ddb2ea4 100644
    a b void SmushPlayer::handleTextResource(uint32 subType, int32 subSize, Common::Seek  
    614614        }
    615615
    616616        // flags:
    617         // bit 0 - center       1
    618         // bit 1 - not used     2
    619         // bit 2 - ???          4
    620         // bit 3 - wrap around  8
    621         switch (flags & 9) {
     617        // bit 0 (0x01) - center align
     618        // bit 1 (0x02) - right align (flag not used)
     619        // bit 2 (0x04) - wrap around
     620        // bit 3 (0x08) - text is subtitle i.e. if clear, text display is
     621        //                not conditional on subtitles being enabled.
     622        debugC(DEBUG_SMUSH, "SmushPlayer::handleTextResource(..) flags:%d str:\"%s\"", flags, str);
     623        switch (flags & 5) {
    622624        case 0:
    623625                sf->drawString(str, _dst, _width, _height, pos_x, pos_y, false);
    624626                break;
    625627        case 1:
    626628                sf->drawString(str, _dst, _width, _height, pos_x, MAX(pos_y, top), true);
    627629                break;
    628         case 8:
     630        case 4:
    629631                // FIXME: Is 'right' the maximum line width here, just
    630632                // as it is in the next case? It's used several times
    631633                // in The Dig's intro, where 'left' and 'right' are
    void SmushPlayer::handleTextResource(uint32 subType, int32 subSize, Common::Seek  
    633635                // handle that correctly.
    634636                sf->drawStringWrap(str, _dst, _width, _height, pos_x, MAX(pos_y, top), left, right, false);
    635637                break;
    636         case 9:
     638        case 5:
    637639                // In this case, the 'right' parameter is actually the
    638640                // maximum line width. This explains why it's sometimes
    639641                // smaller than 'left'.