aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/scumm/he/moonbase/moonbase.cpp61
-rw-r--r--engines/scumm/he/wiz_he.cpp1
2 files changed, 61 insertions, 1 deletions
diff --git a/engines/scumm/he/moonbase/moonbase.cpp b/engines/scumm/he/moonbase/moonbase.cpp
index 9acc7a1694..8e8fd12722 100644
--- a/engines/scumm/he/moonbase/moonbase.cpp
+++ b/engines/scumm/he/moonbase/moonbase.cpp
@@ -39,6 +39,67 @@ void Moonbase::renderFOW() {
void Moonbase::blitT14WizImage(uint8 *dst, int dstw, int dsth, int dstPitch, const Common::Rect *clipBox,
uint8 *wizd, int srcx, int srcy, int rawROP, int paramROP) {
+ Common::Rect rScreen(dstw, dsth);
+ if (clipBox) {
+ Common::Rect clip(clipBox->left, clipBox->top, clipBox->right, clipBox->bottom);
+ if (rScreen.intersects(clip)) {
+ rScreen.clip(clip);
+ } else {
+ return;
+ }
+ }
+
+ int width = READ_LE_UINT16(wizd + 0x8 + 0);
+ int height = READ_LE_UINT16(wizd + 0x8 + 2);
+
+ int headerSize = READ_LE_UINT32(wizd + 0x4);
+ uint8 *dataPointer = &wizd[0x8 + headerSize];
+
+ warning("w: %d, h: %d, size: %d", width, height, headerSize);
+
+ for (int i = 0; i < height; i++) {
+ uint16 lineSize = READ_LE_UINT16(dataPointer + 0);
+ uint8 *singlesOffset = dataPointer + READ_LE_UINT16(dataPointer + 2);
+ uint8 *quadsOffset = dataPointer + READ_LE_UINT16(dataPointer + 4);
+
+ int linecount = width;
+ byte *dst1 = dst;
+
+ while (1) {
+ int code = *dataPointer - 2;
+
+ if (code == 0) { // quad
+ for (int c = 0; c < 4; c++) {
+ WRITE_LE_UINT16(dst1, READ_LE_UINT16(quadsOffset));
+ singlesOffset += 2;
+ dst1 += 2;
+ linecount--;
+ }
+ } else if (code < 0) { // single
+ WRITE_LE_UINT16(dst1, READ_LE_UINT16(singlesOffset));
+ singlesOffset += 2;
+ dst1 += 2;
+ linecount--;
+ } else { // skip
+ if ((code & 1) == 0) {
+ code >>= 1;
+ dst1 += code * 2;
+ linecount -= code;
+ } else { // special case
+ uint16 color = READ_LE_UINT16(dataPointer);
+ WRITE_LE_UINT16(dst, color);
+ singlesOffset += 2;
+ dst1 += 2;
+ }
+ }
+
+ if (linecount <= 0)
+ break;
+ }
+
+ dataPointer += lineSize;
+ dst += dstPitch;
+ }
}
} // End of namespace Scumm
diff --git a/engines/scumm/he/wiz_he.cpp b/engines/scumm/he/wiz_he.cpp
index a8baae866c..fdb89823b4 100644
--- a/engines/scumm/he/wiz_he.cpp
+++ b/engines/scumm/he/wiz_he.cpp
@@ -1773,7 +1773,6 @@ void Wiz::copy555WizImage(uint8 *dst, uint8 *wizd, int dstPitch, int dstType,
switch (rawROP) {
default:
case 1:
- warning("T14: MMX_PREMUL_ALPHA_COPY");
break;
case 2: