diff -ur ScummVM-cvs20021025/scummvm/scumm/akos.h ScummVM-cvs20021025+hack/scummvm/scumm/akos.h
old
|
new
|
|
127 | 127 | AkosRenderer(Scumm *scumm) { |
128 | 128 | memset(this, 0, sizeof(AkosRenderer)); |
129 | 129 | _vm = scumm; |
130 | | _numStrips = _vm->gdi._numStrips; |
| 130 | _numStrips = MAX_NUM_STRIPS; |
131 | 131 | } |
132 | 132 | bool drawCostume(); |
133 | 133 | void setPalette(byte *palette); |
diff -ur ScummVM-cvs20021025/scummvm/scumm/costume.h ScummVM-cvs20021025+hack/scummvm/scumm/costume.h
old
|
new
|
|
108 | 108 | void setCostume(int costume); |
109 | 109 | |
110 | 110 | public: |
111 | | CostumeRenderer(Scumm *vm) : _vm(vm), _numStrips(vm->gdi._numStrips), _loaded(vm) {} |
| 111 | CostumeRenderer(Scumm *vm) : _vm(vm), _numStrips(MAX_NUM_STRIPS), _loaded(vm) {} |
112 | 112 | }; |
113 | 113 | |
114 | 114 | #endif |
diff -ur ScummVM-cvs20021025/scummvm/scumm/gfx.cpp ScummVM-cvs20021025+hack/scummvm/scumm/gfx.cpp
old
|
new
|
|
415 | 415 | assert(gdi._numZBuffer >= 1 && gdi._numZBuffer <= 5); |
416 | 416 | |
417 | 417 | if (_features & GF_AFTER_V7) |
418 | | itemsize = (virtscr[0].height + 4) * gdi._numStrips; |
| 418 | itemsize = (virtscr[0].height + 4) * MAX_NUM_STRIPS; |
419 | 419 | else |
420 | | itemsize = (_scrHeight + 4) * gdi._numStrips; |
| 420 | itemsize = (_scrHeight + 4) * MAX_NUM_STRIPS; |
421 | 421 | |
422 | 422 | |
423 | 423 | size = itemsize * gdi._numZBuffer; |
… |
… |
|
910 | 910 | else |
911 | 911 | _bgbak_ptr = _backbuff_ptr; |
912 | 912 | |
913 | | _mask_ptr = _vm->getResourceAddress(rtBuffer, 9) + (y * _numStrips + x); |
| 913 | _mask_ptr = _vm->getResourceAddress(rtBuffer, 9) + (y * MAX_NUM_STRIPS + x); |
914 | 914 | |
915 | 915 | where_draw_ptr = _bgbak_ptr; |
916 | 916 | decompressBitmap(); |
… |
… |
|
952 | 952 | if (flag & dbDrawMaskOnAll) { |
953 | 953 | _z_plane_ptr = zplane_list[1] + READ_LE_UINT16(zplane_list[1] + stripnr * 2 + 8); |
954 | 954 | for (i = 0; i < numzbuf; i++) { |
955 | | _mask_ptr_dest = _vm->getResourceAddress(rtBuffer, 9) + y * _numStrips + x + _imgBufOffs[i]; |
| 955 | _mask_ptr_dest = _vm->getResourceAddress(rtBuffer, 9) + y * MAX_NUM_STRIPS + x + _imgBufOffs[i]; |
956 | 956 | if (_useOrDecompress && flag & dbAllowMaskOr) |
957 | 957 | decompressMaskImgOr(); |
958 | 958 | else |
… |
… |
|
973 | 973 | } else |
974 | 974 | offs = READ_LE_UINT16(zplane_list[i] + stripnr * 2 + 8); |
975 | 975 | |
976 | | _mask_ptr_dest = _vm->getResourceAddress(rtBuffer, 9) + y * _numStrips + x + _imgBufOffs[i]; |
| 976 | _mask_ptr_dest = _vm->getResourceAddress(rtBuffer, 9) + y * MAX_NUM_STRIPS + x + _imgBufOffs[i]; |
977 | 977 | |
978 | 978 | if (offs) { |
979 | 979 | _z_plane_ptr = zplane_list[i] + offs; |
… |
… |
|
985 | 985 | } else { |
986 | 986 | if (!(_useOrDecompress && flag & dbAllowMaskOr)) |
987 | 987 | for (int height = 0; height < _numLinesToProcess; height++) |
988 | | _mask_ptr_dest[height * _numStrips] = 0; |
| 988 | _mask_ptr_dest[height * MAX_NUM_STRIPS] = 0; |
989 | 989 | /* needs better abstraction, FIXME */ |
990 | 990 | } |
991 | 991 | } |
… |
… |
|
1166 | 1166 | } |
1167 | 1167 | src += _vm->_realWidth; |
1168 | 1168 | dst += _vm->_realWidth; |
1169 | | mask += _numStrips; |
| 1169 | mask += MAX_NUM_STRIPS; |
1170 | 1170 | } while (--height); |
1171 | 1171 | } |
1172 | 1172 | |
… |
… |
|
1201 | 1201 | ((uint32 *)dst)[1] = 0; |
1202 | 1202 | } |
1203 | 1203 | dst += _vm->_realWidth; |
1204 | | mask += _numStrips; |
| 1204 | mask += MAX_NUM_STRIPS; |
1205 | 1205 | } while (--height); |
1206 | 1206 | } |
1207 | 1207 | |
… |
… |
|
1224 | 1224 | int height = _numLinesToProcess; |
1225 | 1225 | byte b, c; |
1226 | 1226 | |
1227 | | height--; // FIXME: This seems to fix The Dig nexus wrapping corrupting memory.. |
1228 | | // and doesn't break any other games.. but is it correct? If so, |
1229 | | // do we need to mirror this change anywhere else? |
1230 | 1227 | while (1) { |
1231 | 1228 | b = *src++; |
1232 | 1229 | |
… |
… |
|
1236 | 1233 | |
1237 | 1234 | do { |
1238 | 1235 | *dst = c; |
1239 | | dst += _numStrips; |
| 1236 | dst += MAX_NUM_STRIPS; |
1240 | 1237 | if (!--height) |
1241 | 1238 | return; |
1242 | 1239 | } while (--b); |
1243 | 1240 | } else { |
1244 | 1241 | do { |
1245 | 1242 | *dst = *src++; |
1246 | | dst += _numStrips; |
| 1243 | dst += MAX_NUM_STRIPS; |
1247 | 1244 | if (!--height) |
1248 | 1245 | return; |
1249 | 1246 | } while (--b); |
… |
… |
|
1266 | 1263 | |
1267 | 1264 | do { |
1268 | 1265 | *dst |= c; |
1269 | | dst += _numStrips; |
| 1266 | dst += MAX_NUM_STRIPS; |
1270 | 1267 | if (!--height) |
1271 | 1268 | return; |
1272 | 1269 | } while (--b); |
1273 | 1270 | } else { |
1274 | 1271 | do { |
1275 | 1272 | *dst |= *src++; |
1276 | | dst += _numStrips; |
| 1273 | dst += MAX_NUM_STRIPS; |
1277 | 1274 | if (!--height) |
1278 | 1275 | return; |
1279 | 1276 | } while (--b); |
… |
… |
|
1798 | 1795 | |
1799 | 1796 | backbuff = vs->screenPtr + height; |
1800 | 1797 | bgbak = getResourceAddress(rtBuffer, vs->number + 5) + height; |
1801 | | mask = getResourceAddress(rtBuffer, 9) + top * gdi._numStrips + (left >> 3) + _screenStartStrip; |
| 1798 | mask = getResourceAddress(rtBuffer, 9) + top * MAX_NUM_STRIPS + (left >> 3) + _screenStartStrip; |
1802 | 1799 | if (vs->number == 0) { |
1803 | 1800 | mask += vs->topline * 216; |
1804 | 1801 | } |
… |
… |
|
1812 | 1809 | if (vs->number == 0 && charset._hasMask && height) { |
1813 | 1810 | do { |
1814 | 1811 | memset(mask, 0, widthmod); |
1815 | | mask += gdi._numStrips; |
| 1812 | mask += MAX_NUM_STRIPS; |
1816 | 1813 | } while (--height); |
1817 | 1814 | } |
1818 | 1815 | } else { |
… |
… |
|
2692 | 2689 | vs->bdirty[strip] = bottom; |
2693 | 2690 | |
2694 | 2691 | offs = (top * _numStrips + _vm->_screenStartStrip + strip); |
2695 | | _mask_ptr = _vm->getResourceAddress(rtBuffer, 9) + offs; |
| 2692 | _mask_ptr = _vm->getResourceAddress(rtBuffer, 9) + top * MAX_NUM_STRIPS + _vm->_screenStartStrip + strip; |
2696 | 2693 | _bgbak_ptr = _vm->getResourceAddress(rtBuffer, 5) + (offs << 3); |
2697 | 2694 | _backbuff_ptr = vs->screenPtr + (offs << 3); |
2698 | 2695 | |
… |
… |
|
2734 | 2731 | t = 0; |
2735 | 2732 | |
2736 | 2733 | r >>= 3; |
2737 | | if (r > gdi._numStrips - 1) |
2738 | | r = gdi._numStrips - 1; |
| 2734 | if (r > MAX_NUM_STRIPS - 1) |
| 2735 | r = MAX_NUM_STRIPS - 1; |
2739 | 2736 | |
2740 | | mem += l + t * gdi._numStrips; |
| 2737 | mem += l + t * MAX_NUM_STRIPS; |
2741 | 2738 | |
2742 | 2739 | w = r - l; |
2743 | 2740 | h = b - t + 1; |
… |
… |
|
2747 | 2744 | if (mem[i]) { |
2748 | 2745 | return true; |
2749 | 2746 | } |
2750 | | mem += gdi._numStrips; |
| 2747 | mem += MAX_NUM_STRIPS; |
2751 | 2748 | } while (--h); |
2752 | 2749 | |
2753 | 2750 | return false; |
… |
… |
|
3246 | 3243 | for (i = 0; i < num; i++) { |
3247 | 3244 | if (bd->scale_x == 255 || scale_cols[src_x]) { |
3248 | 3245 | if (dst_x >= 0 && dst_x < bd->outwidth) { |
3249 | | if (!(*(mask + dst_y * 40 + (dst_x >> 3)) & revBitMask[dst_x & 7])) |
| 3246 | if (!(*(mask + dst_y * MAX_NUM_STRIPS + (dst_x >> 3)) & revBitMask[dst_x & 7])) |
3250 | 3247 | |
3251 | 3248 | *d = blend(_currentPalette, color, *d); |
3252 | 3249 | } |
… |
… |
|
3259 | 3256 | for (i = 0; i < num; i++) { |
3260 | 3257 | if (bd->scale_x == 255 || scale_cols[src_x]) { |
3261 | 3258 | if (dst_x >= 0 && dst_x < bd->outwidth) |
3262 | | if (!(*(mask + dst_y * 40 + (dst_x >> 3)) & revBitMask[dst_x & 7])) |
| 3259 | if (!(*(mask + dst_y * MAX_NUM_STRIPS + (dst_x >> 3)) & revBitMask[dst_x & 7])) |
3263 | 3260 | *d = blend(_currentPalette, src[i], *d); |
3264 | 3261 | d++; |
3265 | 3262 | dst_x++; |
diff -ur ScummVM-cvs20021025/scummvm/scumm/scumm.h ScummVM-cvs20021025+hack/scummvm/scumm/scumm.h
old
|
new
|
|
52 | 52 | NUM_LOCALSCRIPT = 60, |
53 | 53 | NUM_SHADOW_PALETTE = 8, |
54 | 54 | MAX_ACTORS = 30, |
55 | | KEY_SET_OPTIONS = 3456 // WinCE |
| 55 | KEY_SET_OPTIONS = 3456, // WinCE |
| 56 | MAX_NUM_STRIPS = 240 |
56 | 57 | }; |
57 | 58 | |
58 | 59 | enum { |
… |
… |
|
869 | 870 | uint16 _palManipCounter; |
870 | 871 | byte *_palManipPalette; |
871 | 872 | byte *_palManipIntermediatePal; |
872 | | uint32 gfxUsageBits[240]; |
| 873 | uint32 gfxUsageBits[MAX_NUM_STRIPS]; |
873 | 874 | byte *_shadowPalette; |
874 | 875 | int _shadowPaletteSize; |
875 | 876 | byte _currentPalette[0x300]; |
diff -ur ScummVM-cvs20021025/scummvm/scumm/string.cpp ScummVM-cvs20021025+hack/scummvm/scumm/string.cpp
old
|
new
|
|
1038 | 1038 | } |
1039 | 1039 | |
1040 | 1040 | _mask_ptr = _vm->getResourceAddress(rtBuffer, 9) |
1041 | | + _drawTop * 40 + _left / 8 + _vm->_screenStartStrip; |
| 1041 | + _drawTop * MAX_NUM_STRIPS + _left / 8 + _vm->_screenStartStrip; |
1042 | 1042 | |
1043 | 1043 | _virtScreenHeight = vs->height; |
1044 | 1044 | _charPtr += 4; |
… |
… |
|
1100 | 1100 | } |
1101 | 1101 | } |
1102 | 1102 | dst = (_dest_ptr += _vm->_realWidth); |
1103 | | mask += 40; |
| 1103 | mask += MAX_NUM_STRIPS; |
1104 | 1104 | y++; |
1105 | 1105 | } |
1106 | 1106 | } |