aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm
diff options
context:
space:
mode:
authorTravis Howell2009-08-22 13:32:56 +0000
committerTravis Howell2009-08-22 13:32:56 +0000
commitee0e1bfceac7eb626737f321e851ef0cdcea08d3 (patch)
treeac11df4cf5f4b3de587f4aa9bf582e91194c9cf8 /engines/scumm
parent57ea8cc3192072ffdb1908d8e1fd521fbfe47373 (diff)
downloadscummvm-rg350-ee0e1bfceac7eb626737f321e851ef0cdcea08d3.tar.gz
scummvm-rg350-ee0e1bfceac7eb626737f321e851ef0cdcea08d3.tar.bz2
scummvm-rg350-ee0e1bfceac7eb626737f321e851ef0cdcea08d3.zip
Fix endian regression, when clearing the buffer of non-cursor images.
svn-id: r43649
Diffstat (limited to 'engines/scumm')
-rw-r--r--engines/scumm/he/wiz_he.cpp15
-rw-r--r--engines/scumm/he/wiz_he.h1
2 files changed, 12 insertions, 4 deletions
diff --git a/engines/scumm/he/wiz_he.cpp b/engines/scumm/he/wiz_he.cpp
index 5280dc097f..9ddc1ea22f 100644
--- a/engines/scumm/he/wiz_he.cpp
+++ b/engines/scumm/he/wiz_he.cpp
@@ -40,6 +40,7 @@ Wiz::Wiz(ScummEngine_v71he *vm) : _vm(vm) {
_imagesNum = 0;
memset(&_images, 0, sizeof(_images));
memset(&_polygons, 0, sizeof(_polygons));
+ _cursorImage = false;
_rectOverrideEnabled = false;
}
@@ -1503,8 +1504,13 @@ uint8 *Wiz::drawWizImage(int resNum, int state, int maskNum, int maskState, int
if (_vm->_bitDepth == 2) {
uint8 *tmpPtr = dst;
for (uint i = 0; i < height; i++) {
- for (uint j = 0; j < width; j++)
- WRITE_UINT16(tmpPtr + j * 2, transColor);
+ for (uint j = 0; j < width; j++) {
+ if (_cursorImage) {
+ WRITE_UINT16(tmpPtr + j * 2, transColor);
+ } else {
+ WRITE_LE_UINT16(tmpPtr + j * 2, transColor);
+ }
+ }
tmpPtr += width * 2;
}
} else {
@@ -1967,8 +1973,7 @@ void Wiz::drawWizPolygonImage(uint8 *dst, const uint8 *src, const uint8 *mask, i
y_acc += pra->y_step;
if (bitDepth == 2) {
if (transColor == -1 || transColor != READ_LE_UINT16(src + src_offs * 2)) {
- //if (transColor == -1 || READ_UINT16(dstPtr) != transColor)
- writeColor(dstPtr, dstType, READ_LE_UINT16(src + src_offs * 2));
+ writeColor(dstPtr, dstType, READ_LE_UINT16(src + src_offs * 2));
}
} else {
if (transColor == -1 || transColor != src[src_offs])
@@ -2012,7 +2017,9 @@ void Wiz::loadWizCursor(int resId, int palette) {
}
const Common::Rect *r = NULL;
+ _cursorImage = true;
uint8 *cursor = drawWizImage(resId, 0, 0, 0, 0, 0, 0, 0, 0, r, kWIFBlitToMemBuffer, 0, _vm->getHEPaletteSlot(palette));
+ _cursorImage = false;
int32 cw, ch;
getWizImageDim(resId, 0, cw, ch);
diff --git a/engines/scumm/he/wiz_he.h b/engines/scumm/he/wiz_he.h
index a212ac4d29..1fa9564486 100644
--- a/engines/scumm/he/wiz_he.h
+++ b/engines/scumm/he/wiz_he.h
@@ -165,6 +165,7 @@ public:
void clearWizBuffer();
Common::Rect _rectOverride;
+ bool _cursorImage;
bool _rectOverrideEnabled;
void polygonClear();