aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scumm/charset.cpp3
-rw-r--r--scumm/gfx.cpp24
-rw-r--r--scumm/gfx.h2
3 files changed, 19 insertions, 10 deletions
diff --git a/scumm/charset.cpp b/scumm/charset.cpp
index f9d55c1e79..4916972ad1 100644
--- a/scumm/charset.cpp
+++ b/scumm/charset.cpp
@@ -1331,6 +1331,9 @@ void CharsetRendererClassic::printChar(int chr) {
src = dst;
src.moveTo(0, 0);
+ memset(_vm->gdi._wizImagePalette, 255, sizeof(_vm->gdi._wizImagePalette));
+ memcpy(_vm->gdi._wizImagePalette, _vm->_charsetColorMap, 16);
+
_vm->gdi.decompressWizImage(dstPtr, vs->w, dst, charPtr, src);
if (_blitAlso && vs->hasTwoBuffers)
diff --git a/scumm/gfx.cpp b/scumm/gfx.cpp
index 46fbce1446..39ab5c992c 100644
--- a/scumm/gfx.cpp
+++ b/scumm/gfx.cpp
@@ -583,16 +583,14 @@ void ScummEngine::initBGBuffers(int height) {
*/
void ScummEngine::redrawBGAreas() {
int i;
- int val;
int diff;
+ int val = 0;;
bool cont = true;
if (!(_features & GF_NEW_CAMERA))
if (camera._cur.x != camera._last.x && _charset->_hasMask && (_version > 3 && _gameId != GID_PASS))
stopTalk();
- val = 0;
-
if (_heversion >= 70) {
byte *room = getResourceAddress(rtRoomImage, _roomResource) + _IM00_offs;
if (findResource(MKID('BMAP'), room) != NULL) {
@@ -1479,6 +1477,9 @@ void Gdi::copyWizImage(uint8 *dst, const uint8 *src, int dstw, int dsth, int src
if (calcClipRects(dstw, dsth, srcx, srcy, srcw, srch, rect, r1, r2)) {
if (r1.isValidRect() && r2.isValidRect()) {
uint8 *dstPtr = dst + r2.left + r2.top * dstw;
+ for (int i = 0; i < 256; i++)
+ _wizImagePalette[i] = i;
+
decompressWizImage(dstPtr, dstw, r2, src, r1);
}
}
@@ -1491,6 +1492,7 @@ void Gdi::decompressWizImage(uint8 *dst, int dstPitch, const Common::Rect &dstRe
uint8 databit;
int h, w, xoff;
uint16 off;
+ int color;
dstPtr = dst;
dataPtr = src;
@@ -1558,26 +1560,28 @@ void Gdi::decompressWizImage(uint8 *dst, int dstPitch, const Common::Rect &dstRe
databit = code & 1;
code >>= 1;
if (databit) {
-dec_sub1: dstPtr += code;
+dec_sub1: dstPtr += code;
w -= code;
} else {
databit = code & 1;
code = (code >> 1) + 1;
if (databit) {
-dec_sub2: w -= code;
+dec_sub2: w -= code;
if (w < 0) {
code += w;
}
- memset(dstPtr, *dataPtr++, code);
+ color = _wizImagePalette[*dataPtr++];
+ memset(dstPtr, color, code);
dstPtr += code;
} else {
-dec_sub3: w -= code;
+dec_sub3: w -= code;
if (w < 0) {
code += w;
}
- memcpy(dstPtr, dataPtr, code);
- dstPtr += code;
- dataPtr += code;
+ while (code--) {
+ color = _wizImagePalette[*dataPtr++];
+ *dstPtr++ = color;
+ }
}
}
}
diff --git a/scumm/gfx.h b/scumm/gfx.h
index bf04918938..00e8e27a49 100644
--- a/scumm/gfx.h
+++ b/scumm/gfx.h
@@ -207,6 +207,8 @@ class Gdi {
ScummEngine *_vm;
public:
+ byte _wizImagePalette[256];
+
int _numZBuffer;
int _imgBufOffs[8];
int32 _numStrips;