Ticket #9323: newscummcharset.patch

File newscummcharset.patch, 3.2 KB (added by SF/*anonymous, 14 years ago)
  • engines/scumm/charset.cpp

    diff --git a/engines/scumm/charset.cpp b/engines/scumm/charset.cpp
    index 861e448..283935b 100644
    a b int CharsetRendererClassic::getCharWidth(uint16 chr) {  
    401401                                        spacing++;
    402402                                }
    403403                        }
    404                        
     404
    405405                } else if (chr >= 0x80) {
    406406                        return _vm->_2byteWidth / 2;
    407407                }
    int CharsetRendererV3::getCharWidth(uint16 chr) {  
    618618                                spacing = 4;
    619619                } else if (chr & 0x80) {
    620620                        spacing = _vm->_2byteWidth / 2;
    621                 }       
     621                }
    622622        }
    623623
    624         if (!spacing)
     624        if (!spacing) {
    625625                spacing = *(_widthTable + chr);
     626        }
    626627
    627628        return spacing;
    628629}
    void CharsetRenderer::processTownsCharsetColors(uint8 bytesPerPixel) {  
    857858        if (_vm->_game.platform == Common::kPlatformFMTowns) {
    858859                for (int i = 0; i < (1 << bytesPerPixel); i++) {
    859860                        uint8 c = _vm->_charsetColorMap[i];
    860                                                
     861
    861862                        if (c > 16) {
    862863                                uint8 t = (_vm->_currentPalette[c * 3] < 32) ? 4 : 12;
    863864                                t |= ((_vm->_currentPalette[c * 3 + 1] < 32) ? 2 : 10);
    864865                                t |= ((_vm->_currentPalette[c * 3 + 1] < 32) ? 1 : 9);
    865866                                c = t;
    866867                        }
    867                        
     868
    868869                        if (c == 0)
    869870                                c = _vm->_townsOverrideShadowColor;
    870                        
     871
    871872                        c = ((c & 0x0f) << 4) | (c & 0x0f);
    872873                        _vm->_townsCharsetColorMap[i] = c;
    873874                }
    void CharsetRendererClassic::printChar(int chr, bool ignoreCharsetMask) {  
    920921                        noSjis = true;
    921922                }
    922923        }
    923        
     924
    924925        if (useTownsFontRomCharacter(chr) && !noSjis) {
    925926                charPtr = 0;
    926927                _vm->_cjkChar = chr;
    927928                enableShadow(true);
    928                
     929
    929930                width = getCharWidth(chr);
    930931                // For whatever reason MI1 uses a different font width
    931932                // for alignment calculation and for drawing when
    void CharsetRendererClassic::printChar(int chr, bool ignoreCharsetMask) {  
    947948                        height++;
    948949                }
    949950        } else
    950 #endif 
     951#endif
    951952        {
    952953                uint32 charOffs = READ_LE_UINT32(_fontPtr + chr * 4 + 4);
    953954                assert(charOffs < 0x14000);
    void CharsetRendererCommon::drawBits1(const Graphics::Surface &s, byte *dst, con  
    12591260#ifndef DISABLE_TOWNS_DUAL_LAYER_MODE
    12601261        byte *dst3 = dst2;
    12611262        byte *dst4 = dst2;
    1262         if (scale2x) {         
     1263        if (scale2x) {
    12631264                dst3 = dst2 + s.pitch;
    12641265                dst4 = dst3 + s.pitch;
    12651266                pitch <<= 1;
    12661267        }
    12671268        if (_vm->_game.platform == Common::kPlatformFMTowns && _vm->_game.version == 5)
    12681269                col = _vm->_townsCharsetColorMap[1];
    1269 #endif                 
     1270#endif
    12701271
    12711272        for (y = 0; y < height && y + drawTop < s.h; y++) {
    12721273                for (x = 0; x < width; x++) {
    void CharsetRendererCommon::drawBits1(const Graphics::Surface &s, byte *dst, con  
    12871288                                                if (scale2x) {
    12881289                                                        dst[2] = dst[3] = dst2[2] = dst2[3] = _shadowColor;
    12891290                                                        dst3[0] = dst4[0] = dst3[1] = dst4[1] = _shadowColor;
    1290                                                 } else 
     1291                                                } else
    12911292#endif
    12921293                                                {
    12931294                                                        dst[1] = dst2[0] = _shadowColor;
    12941295                                                        if (_shadowMode != kFMTOWNSShadowMode)
    12951296                                                                dst2[1] = _shadowColor;
    1296                                                 }                                               
     1297                                                }
    12971298                                        }
    12981299                                        dst[0] = col;
    12991300
    13001301#ifndef DISABLE_TOWNS_DUAL_LAYER_MODE
    13011302                                        if (scale2x)
    1302                                                 dst[1] = dst2[0] = dst2[1] = col;                                       
     1303                                                dst[1] = dst2[0] = dst2[1] = col;
    13031304#endif
    13041305                                }
    13051306                        }
    void CharsetRendererCommon::drawBits1(const Graphics::Surface &s, byte *dst, con  
    13171318
    13181319                dst += pitch;
    13191320                dst2 += pitch;
    1320 #ifndef DISABLE_TOWNS_DUAL_LAYER_MODE           
     1321#ifndef DISABLE_TOWNS_DUAL_LAYER_MODE
    13211322                dst3 += pitch;
    13221323                dst4 += pitch;
    13231324#endif