diff -ur ScummVM-cvs20020928/scummvm/scumm/gfx.cpp ScummVM-cvs20020928+hack/scummvm/scumm/gfx.cpp
old
|
new
|
|
924 | 924 | } |
925 | 925 | } |
926 | 926 | CHECK_HEAP; |
927 | | if (flag & dbDrawMaskOnBoth) { |
928 | | _z_plane_ptr = zplane_list[1] + READ_LE_UINT16(zplane_list[1] + stripnr * 2 + 8); |
929 | | _mask_ptr_dest = _vm->getResourceAddress(rtBuffer, 9) + y * NUM_STRIPS + x; |
930 | | if (_useOrDecompress && flag & dbAllowMaskOr) |
931 | | decompressMaskImgOr(); |
932 | | else |
933 | | decompressMaskImg(); |
934 | | } |
935 | | |
936 | | for (i = 1; i < numzbuf; i++) { |
937 | | uint16 offs; |
938 | | |
939 | | if (!zplane_list[i]) |
940 | | continue; |
941 | | |
942 | | if (_vm->_features & GF_SMALL_HEADER) |
943 | | if (_vm->_features & GF_OLD256) |
944 | | offs = READ_LE_UINT16(zplane_list[i] + stripnr * 2 + 4); |
945 | | else |
946 | | offs = READ_LE_UINT16(zplane_list[i] + stripnr * 2 + 2); |
947 | | else |
948 | | offs = READ_LE_UINT16(zplane_list[i] + stripnr * 2 + 8); |
949 | | |
950 | | _mask_ptr_dest = _vm->getResourceAddress(rtBuffer, 9) + y * NUM_STRIPS + x + _imgBufOffs[i]; |
951 | 927 | |
952 | | if (offs) { |
953 | | _z_plane_ptr = zplane_list[i] + offs; |
| 928 | // Sam & Max uses dbDrawMaskOnAll for things like the inventory |
| 929 | // box and the speech icons. While these objects only have one |
| 930 | // mask, it should be applied to all the Z-planes in the room, |
| 931 | // i.e. they should mask every actor. |
| 932 | // |
| 933 | // This flag used to be called dbDrawMaskOnBoth, and all it |
| 934 | // would do was to mask Z-plane 0. (Z-plane 1 would also be |
| 935 | // masked, because what is now the else-clause used to be run |
| 936 | // always.) While this seems to be the only way there is to |
| 937 | // mask Z-plane 0, this wasn't good enough since actors in |
| 938 | // Z-planes >= 2 would not be masked. |
| 939 | // |
| 940 | // The flag is also used by The Dig and Full Throttle, but I |
| 941 | // don't know what for. At the time of writing, these games |
| 942 | // are still too unstable for me to investigate. |
954 | 943 | |
| 944 | if (flag & dbDrawMaskOnAll) { |
| 945 | _z_plane_ptr = zplane_list[1] + READ_LE_UINT16(zplane_list[1] + stripnr * 2 + 8); |
| 946 | for (i = 0; i < numzbuf; i++) { |
| 947 | _mask_ptr_dest = _vm->getResourceAddress(rtBuffer, 9) + y * NUM_STRIPS + x + _imgBufOffs[i]; |
955 | 948 | if (_useOrDecompress && flag & dbAllowMaskOr) |
956 | 949 | decompressMaskImgOr(); |
957 | 950 | else |
958 | 951 | decompressMaskImg(); |
959 | | } else { |
960 | | if (_useOrDecompress && flag & dbAllowMaskOr); /* nothing */ |
961 | | else |
962 | | for (int h = 0; h < _numLinesToProcess; h++) |
963 | | _mask_ptr_dest[h * NUM_STRIPS] = 0; |
964 | | /* needs better abstraction, FIXME */ |
| 952 | } |
| 953 | } else { |
| 954 | for (i = 1; i < numzbuf; i++) { |
| 955 | uint16 offs; |
| 956 | |
| 957 | if (!zplane_list[i]) |
| 958 | continue; |
| 959 | |
| 960 | if (_vm->_features & GF_SMALL_HEADER) { |
| 961 | if (_vm->_features & GF_OLD256) |
| 962 | offs = READ_LE_UINT16(zplane_list[i] + stripnr * 2 + 4); |
| 963 | else |
| 964 | offs = READ_LE_UINT16(zplane_list[i] + stripnr * 2 + 2); |
| 965 | } else |
| 966 | offs = READ_LE_UINT16(zplane_list[i] + stripnr * 2 + 8); |
| 967 | |
| 968 | _mask_ptr_dest = _vm->getResourceAddress(rtBuffer, 9) + y * NUM_STRIPS + x + _imgBufOffs[i]; |
| 969 | |
| 970 | if (offs) { |
| 971 | _z_plane_ptr = zplane_list[i] + offs; |
| 972 | |
| 973 | if (_useOrDecompress && flag & dbAllowMaskOr) |
| 974 | decompressMaskImgOr(); |
| 975 | else |
| 976 | decompressMaskImg(); |
| 977 | } else { |
| 978 | if (!(_useOrDecompress && flag & dbAllowMaskOr)); |
| 979 | for (int h = 0; h < _numLinesToProcess; h++) |
| 980 | _mask_ptr_dest[h * NUM_STRIPS] = 0; |
| 981 | /* needs better abstraction, FIXME */ |
| 982 | } |
965 | 983 | } |
966 | 984 | } |
967 | 985 | CHECK_HEAP; |
diff -ur ScummVM-cvs20020928/scummvm/scumm/gfx.h ScummVM-cvs20020928+hack/scummvm/scumm/gfx.h
old
|
new
|
|
184 | 184 | |
185 | 185 | enum DrawBitmapFlags { |
186 | 186 | dbAllowMaskOr = 1, |
187 | | dbDrawMaskOnBoth = 2, |
| 187 | dbDrawMaskOnAll = 2, |
188 | 188 | dbClear = 4 |
189 | 189 | }; |
190 | 190 | }; |
diff -ur ScummVM-cvs20020928/scummvm/scumm/object.cpp ScummVM-cvs20020928+hack/scummvm/scumm/object.cpp
old
|
new
|
|
378 | 378 | // Sam & Max needs this to fix object-layering problems with |
379 | 379 | // the inventory and conversation icons. |
380 | 380 | if ((_features & GF_AFTER_V7 || _gameId == GID_SAMNMAX) && getClass(od->obj_nr, 22)) |
381 | | flags |= Gdi::dbDrawMaskOnBoth; |
| 381 | flags |= Gdi::dbDrawMaskOnAll; |
382 | 382 | gdi.drawBitmap(ptr, _curVirtScreen, x, ypos, height, x - xpos, numstrip, flags); |
383 | 383 | } |
384 | 384 | } |