Ticket #8105: codec5-fix.diff

File codec5-fix.diff, 2.4 KB (added by eriktorbjorn, 22 years ago)

Patch against an October 23 CVS snapshot

  • scummvm/scumm/akos.cpp

    diff -ur ScummVM-cvs20021023/scummvm/scumm/akos.cpp ScummVM-cvs20021023+hack/scummvm/scumm/akos.cpp
    old new  
    845845
    846846void AkosRenderer::codec5()
    847847{
    848         VirtScreen *vs;
    849 
    850848        int left, right, top, bottom;
    851849        int clip_left, clip_right, clip_top, clip_bottom;
    852850
     
    866864        // What I do know is that drawBomp() doesn't care about masking and
    867865        // shadows, and these are both needed for Full Throttle and The Dig.
    868866       
    869         vs = &_vm->virtscr[0];
    870 
    871867        if (!mirror) {
    872868                left = (_x - move_x_cur - _width) + 1;
    873869        } else {
     
    878874        top = _y + move_y_cur;
    879875        bottom = top + _height;
    880876
    881         if (left >= _vm->_realWidth || top >= _vm->_realHeight)
     877        if (left >= (int) outwidth || top >= (int) outheight)
    882878                return;
    883879
    884880        // The actual drawing code shouldn't survive even if the image is
     
    886882        // be less tolerant...
    887883
    888884        clip_left = (left >= 0) ? left : 0;
    889         clip_right = (right > _vm->_realWidth) ? _vm->_realWidth : right;
     885        clip_right = (right > (int) outwidth) ? (int) outwidth : right;
    890886        clip_top = (top >= 0) ? top : 0;
    891         clip_bottom = (bottom > _vm->_realHeight) ? _vm->_realHeight : bottom;
     887        clip_bottom = (bottom > (int) outheight) ? (int) outheight : bottom;
    892888       
    893889        if (clip_top < draw_top)
    894890                draw_top = clip_top;
     
    922918        for (src_y = 0, dst_y = top; src_y < _height; src_y++) {
    923919                byte code, color;
    924920                uint num, i;
    925                 byte *d = dest + dst_y * _vm->_realWidth + left;
     921                byte *d = dest + dst_y * outwidth + left;
    926922                byte *s;
    927923                uint data_length;
    928924
    929925                data_length = READ_LE_UINT16(src) + 2;
    930926
    931                 if (dst_y < 0 || dst_y >= _vm->_realHeight) {
     927                if (dst_y < 0 || dst_y >= (int) outheight) {
    932928                        src += data_length;
    933929                        dst_y++;
    934930                        continue;
     
    944940                        if (code & 1) {
    945941                                color = *s++;
    946942                                for (i = 0; i < num; i++) {
    947                                         if (dst_x >= 0 && dst_x < _vm->_realWidth) {
     943                                        if (dst_x >= 0 && dst_x < (int) outwidth) {
    948944                                                if (color != 255) {
    949945                                                        if (v1.mask_ptr)
    950946                                                                mask = v1.mask_ptr + 40 * dst_y + (dst_x >> 3);
     
    962958                        } else {
    963959                                for (i = 0; i < num; i++) {
    964960                                        color = s[i];
    965                                         if (dst_x >= 0 && dst_x < _vm->_realWidth) {
     961                                        if (dst_x >= 0 && dst_x < (int) outwidth) {
    966962                                                if (color != 255) {
    967963                                                        if (v1.mask_ptr)
    968964                                                                mask = v1.mask_ptr + 40 * dst_y + (dst_x >> 3);