diff -ur ScummVM/scummvm/scumm/costume.cpp ScummVM+hack/scummvm/scumm/costume.cpp
old
|
new
|
|
299 | 299 | if (masking || charsetmask) { |
300 | 300 | _mask_ptr = _vm->getResourceAddress(rtBuffer, 9) + _ypos * _numStrips + _vm->_screenStartStrip; |
301 | 301 | _imgbufoffs = _vm->gdi._imgBufOffs[_zbuf]; |
302 | | if (!charsetmask && _zbuf != 0) |
| 302 | if (!charsetmask && _zbuf != 0) { |
303 | 303 | _mask_ptr += _imgbufoffs; |
| 304 | _imgbufoffs = 0; |
| 305 | } |
304 | 306 | _mask_ptr_dest = _mask_ptr + _xpos / 8; |
305 | 307 | } |
306 | 308 | |
307 | 309 | CHECK_HEAP |
308 | 310 | if (_shadow_mode) { |
309 | | proc_special((masking << 1) + charsetmask); |
| 311 | proc_special((masking << 1) | (charsetmask ? 1 : 0)); |
310 | 312 | return b; |
311 | 313 | } |
312 | 314 | |
… |
… |
|
652 | 654 | } |
653 | 655 | |
654 | 656 | void CostumeRenderer::proc1() { |
655 | | byte *mask, *src, *dst, *dstorg; |
| 657 | byte *mask, *src, *dst; |
656 | 658 | byte maskbit, len, height, pcolor, width; |
657 | 659 | int color, t; |
658 | 660 | uint y; |
… |
… |
|
661 | 663 | maskbit = revBitMask[_xpos & 7]; |
662 | 664 | y = _ypos; |
663 | 665 | src = _srcptr; |
664 | | dstorg = dst = _backbuff_ptr; |
| 666 | dst = _backbuff_ptr; |
665 | 667 | len = _replen; |
666 | 668 | color = _repcolor; |
667 | 669 | height = _height2; |
… |
… |
|
1078 | 1080 | } |
1079 | 1081 | |
1080 | 1082 | void CostumeRenderer::proc_special(byte mask2) { |
1081 | | byte *mask, *src, *dst, *dstorg; |
| 1083 | byte *mask, *src, *dst; |
1082 | 1084 | byte maskbit, len, height, pcolor, width; |
| 1085 | int color, t; |
1083 | 1086 | uint y; |
1084 | | int color; |
1085 | | int t; |
1086 | 1087 | |
1087 | 1088 | byte shadow1; |
1088 | 1089 | byte shadow2; |
… |
… |
|
1096 | 1097 | shadow4 = _shadow_mode & 0x10; |
1097 | 1098 | shadow5 = _shadow_mode & 0x0F; |
1098 | 1099 | |
1099 | | mask = _mask_ptr = _mask_ptr_dest; |
1100 | | maskbit = revBitMask[_xpos & 7]; |
1101 | | y = _ypos; |
1102 | | |
1103 | | mask = _mask_ptr_dest; |
1104 | | dstorg = dst = _backbuff_ptr; |
1105 | | height = _height2; |
1106 | | width = _width2; |
1107 | | len = _replen; |
1108 | | color = _repcolor; |
1109 | | src = _srcptr; |
1110 | | |
1111 | 1100 | if (_mirror == 0) |
1112 | 1101 | shadow5 = -shadow5; |
1113 | 1102 | |
| 1103 | mask = _mask_ptr_dest; |
1114 | 1104 | maskbit = revBitMask[_xpos & 7]; |
1115 | | |
| 1105 | y = _ypos; |
| 1106 | src = _srcptr; |
1116 | 1107 | dst = _backbuff_ptr; |
1117 | | |
1118 | | if (mask2 != 0 && mask2 < 3) |
1119 | | _imgbufoffs = 0; |
| 1108 | len = _replen; |
| 1109 | color = _repcolor; |
| 1110 | height = _height2; |
| 1111 | width = _width2; |
1120 | 1112 | |
1121 | 1113 | if (_docontinue) |
1122 | 1114 | goto StartPos; |
… |
… |
|
1128 | 1120 | if (!len) |
1129 | 1121 | len = *src++; |
1130 | 1122 | |
1131 | | do { // ok |
1132 | | if (cost_scaleTable[_scaleIndexY++] < _scaleY) { |
1133 | | if (color && y < _outheight) { |
1134 | | if (!mask2 || (mask2 && !((*mask | mask[_imgbufoffs]) & maskbit))) { |
1135 | | if (shadow3 == 0) { |
1136 | | pcolor = _palette[color]; |
1137 | | if (pcolor != 13) |
1138 | | goto proc_special_end; |
1139 | | |
1140 | | } |
1141 | | if (shadow2 != 0) { |
1142 | | warning("proc_special: shadow2 unimplemented"); |
1143 | | pcolor = 0; |
1144 | | } else // we don't need all the random stuff, just the background copy |
1145 | | { |
1146 | | pcolor = _vm->_proc_special_palette[*dst]; |
1147 | | } |
1148 | | proc_special_end:; |
1149 | | *dst = pcolor; |
| 1123 | do { |
| 1124 | if (_scaleY == 255 || cost_scaleTable[_scaleIndexY++] < _scaleY) { |
| 1125 | if (color && y < _outheight && (!mask2 || !((*mask | mask[_imgbufoffs]) & maskbit))) { |
| 1126 | if (shadow3 == 0) { |
| 1127 | pcolor = _palette[color]; |
| 1128 | if (pcolor != 13) |
| 1129 | goto proc_special_end; |
1150 | 1130 | } |
| 1131 | if (shadow2 != 0) { |
| 1132 | warning("proc_special: shadow2 unimplemented"); |
| 1133 | pcolor = 0; |
| 1134 | } else { |
| 1135 | // we don't need all the random stuff, just the background copy |
| 1136 | pcolor = _vm->_proc_special_palette[*dst]; |
| 1137 | } |
| 1138 | proc_special_end:; |
| 1139 | *dst = pcolor; |
1151 | 1140 | } |
1152 | 1141 | dst += _vm->_screenWidth; |
1153 | 1142 | mask += _numStrips; |
… |
… |
|
1161 | 1150 | _scaleIndexY = _scaleIndexYTop; |
1162 | 1151 | t = _scaleIndexX; |
1163 | 1152 | _scaleIndexX = t + _scaleIndexXStep; |
1164 | | if (cost_scaleTable[t] < _scaleX) { |
| 1153 | if (_scaleX == 255 || cost_scaleTable[t] < _scaleX) { |
1165 | 1154 | _xpos += _scaleIndexXStep; |
1166 | 1155 | if (_xpos < 0 || _xpos >= _vm->_screenWidth) |
1167 | 1156 | return; |
diff -ur ScummVM/scummvm/scumm/gfx.cpp ScummVM+hack/scummvm/scumm/gfx.cpp
old
|
new
|
|
3104 | 3104 | int g = (int) (*curPtr++ * greenScale) >> 8; |
3105 | 3105 | int b = (int) (*curPtr++ * blueScale) >> 8; |
3106 | 3106 | |
3107 | | searchPtr = palPtr; |
| 3107 | searchPtr = palPtr + from * 3; |
3108 | 3108 | bestResult = 32000; |
3109 | | currentIndex = 0; |
| 3109 | currentIndex = from; |
3110 | 3110 | |
3111 | 3111 | for (j = from; j < to; j++) { |
3112 | 3112 | int ar = (*searchPtr++); |