From adaf3ec8b4818f89e9f4d39fb2a14710b0f0bd5b Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 25 Sep 2009 09:13:33 +0000 Subject: SCUMM: Rename _bitDepth to _bytesPerPixel svn-id: r44336 --- engines/scumm/actor.cpp | 2 +- engines/scumm/akos.cpp | 18 +++++++++--------- engines/scumm/base-costume.cpp | 2 +- engines/scumm/charset.cpp | 14 +++++++------- engines/scumm/charset.h | 2 +- engines/scumm/cursor.cpp | 14 +++++++------- engines/scumm/gfx.cpp | 24 ++++++++++++------------ engines/scumm/he/animation_he.cpp | 2 +- engines/scumm/he/wiz_he.cpp | 36 ++++++++++++++++++------------------ engines/scumm/scumm.cpp | 8 ++++---- engines/scumm/scumm.h | 2 +- 11 files changed, 62 insertions(+), 62 deletions(-) diff --git a/engines/scumm/actor.cpp b/engines/scumm/actor.cpp index 9dab776b67..4fde436e2f 100644 --- a/engines/scumm/actor.cpp +++ b/engines/scumm/actor.cpp @@ -2451,7 +2451,7 @@ void ScummEngine_v71he::postProcessAuxQueue() { uint8 *dst2 = pvs->getBackPixels(0, pvs->topline); switch (comp) { case 1: - Wiz::copyAuxImage(dst1, dst2, axfd + 10, pvs->pitch, pvs->h, x, y, w, h, _bitDepth); + Wiz::copyAuxImage(dst1, dst2, axfd + 10, pvs->pitch, pvs->h, x, y, w, h, _bytesPerPixel); break; default: error("unimplemented compression type %d", comp); diff --git a/engines/scumm/akos.cpp b/engines/scumm/akos.cpp index f4bb8a2c8b..403fe72ba6 100644 --- a/engines/scumm/akos.cpp +++ b/engines/scumm/akos.cpp @@ -602,7 +602,7 @@ void AkosRenderer::codec1_genericDecode(Codec1 &v1) { pcolor = _shadow_table[pcolor]; } } - if (_vm->_bitDepth == 2) { + if (_vm->_bytesPerPixel == 2) { WRITE_UINT16(dst, pcolor); } else { *dst = pcolor; @@ -626,7 +626,7 @@ void AkosRenderer::codec1_genericDecode(Codec1 &v1) { if (v1.x < 0 || v1.x >= v1.boundsRect.right) return; maskbit = revBitMask(v1.x & 7); - v1.destptr += v1.scaleXstep * _vm->_bitDepth; + v1.destptr += v1.scaleXstep * _vm->_bytesPerPixel; skip_column = false; } else skip_column = true; @@ -996,7 +996,7 @@ byte AkosRenderer::codec1(int xmoveCur, int ymoveCur) { if (_draw_bottom < rect.bottom) _draw_bottom = rect.bottom; - v1.destptr = (byte *)_out.pixels + v1.y * _out.pitch + v1.x * _vm->_bitDepth; + v1.destptr = (byte *)_out.pixels + v1.y * _out.pitch + v1.x * _vm->_bytesPerPixel; codec1_genericDecode(v1); @@ -1190,7 +1190,7 @@ void AkosRenderer::akos16Decompress(byte *dest, int32 pitch, const byte *src, in } byte AkosRenderer::codec16(int xmoveCur, int ymoveCur) { - assert(_vm->_bitDepth == 1); + assert(_vm->_bytesPerPixel == 1); Common::Rect clip; int32 minx, miny, maxw, maxh; @@ -1294,7 +1294,7 @@ byte AkosRenderer::codec16(int xmoveCur, int ymoveCur) { int32 numskip_before = skip_x + (skip_y * _width); int32 numskip_after = _width - cur_x; - byte *dst = (byte *)_out.pixels + height_unk * _out.pitch + width_unk * _vm->_bitDepth; + byte *dst = (byte *)_out.pixels + height_unk * _out.pitch + width_unk * _vm->_bytesPerPixel; akos16Decompress(dst, _out.pitch, _srcptr, cur_x, out_height, dir, numskip_before, numskip_after, transparency, clip.left, clip.top, _zbuf); return 0; @@ -1364,14 +1364,14 @@ byte AkosRenderer::codec32(int xmoveCur, int ymoveCur) { palPtr = _vm->_hePalettes + _vm->_hePaletteSlot + 768; } - byte *dstPtr = (byte *)_out.pixels + dst.top * _out.pitch + dst.left * _vm->_bitDepth; + byte *dstPtr = (byte *)_out.pixels + dst.top * _out.pitch + dst.left * _vm->_bytesPerPixel; if (_shadow_mode == 3) { - Wiz::decompressWizImage(dstPtr, _out.pitch, kDstScreen, _srcptr, src, 0, palPtr, xmap, _vm->_bitDepth); + Wiz::decompressWizImage(dstPtr, _out.pitch, kDstScreen, _srcptr, src, 0, palPtr, xmap, _vm->_bytesPerPixel); } else { if (palPtr != NULL) { - Wiz::decompressWizImage(dstPtr, _out.pitch, kDstScreen, _srcptr, src, 0, palPtr, NULL, _vm->_bitDepth); + Wiz::decompressWizImage(dstPtr, _out.pitch, kDstScreen, _srcptr, src, 0, palPtr, NULL, _vm->_bytesPerPixel); } else { - Wiz::decompressWizImage(dstPtr, _out.pitch, kDstScreen, _srcptr, src, 0, NULL, NULL, _vm->_bitDepth); + Wiz::decompressWizImage(dstPtr, _out.pitch, kDstScreen, _srcptr, src, 0, NULL, NULL, _vm->_bytesPerPixel); } } #endif diff --git a/engines/scumm/base-costume.cpp b/engines/scumm/base-costume.cpp index ef706afaac..2aecb3dfdd 100644 --- a/engines/scumm/base-costume.cpp +++ b/engines/scumm/base-costume.cpp @@ -40,7 +40,7 @@ byte BaseCostumeRenderer::drawCostume(const VirtScreen &vs, int numStrips, const _out.pixels = vs.getPixels(0, 0); _actorX += _vm->_virtscr[kMainVirtScreen].xstart & 7; - _out.w = _out.pitch / _vm->_bitDepth; + _out.w = _out.pitch / _vm->_bytesPerPixel; _out.pixels = (byte *)_out.pixels - (_vm->_virtscr[kMainVirtScreen].xstart & 7); _numStrips = numStrips; diff --git a/engines/scumm/charset.cpp b/engines/scumm/charset.cpp index d6dfa4c5bb..26deaac18d 100644 --- a/engines/scumm/charset.cpp +++ b/engines/scumm/charset.cpp @@ -284,7 +284,7 @@ CharsetRenderer::~CharsetRenderer() { } CharsetRendererCommon::CharsetRendererCommon(ScummEngine *vm) - : CharsetRenderer(vm), _bitDepth(0), _fontHeight(0), _numChars(0) { + : CharsetRenderer(vm), _bytesPerPixel(0), _fontHeight(0), _numChars(0) { _shadowMode = kNoShadowMode; _shadowColor = 0; } @@ -306,7 +306,7 @@ void CharsetRendererCommon::setCurID(int32 id) { else _fontPtr += 29; - _bitDepth = _fontPtr[0]; + _bytesPerPixel = _fontPtr[0]; _fontHeight = _fontPtr[1]; _numChars = READ_LE_UINT16(_fontPtr + 2); } @@ -323,7 +323,7 @@ void CharsetRendererV3::setCurID(int32 id) { if (_fontPtr == 0) error("CharsetRendererCommon::setCurID: charset %d not found", id); - _bitDepth = 1; + _bytesPerPixel = 1; _numChars = _fontPtr[4]; _fontHeight = _fontPtr[5]; @@ -802,7 +802,7 @@ void CharsetRendererClassic::printCharIntern(bool is2byte, const byte *charPtr, byte *back = NULL; int drawTop = _top - vs->topline; - if ((_vm->_game.heversion >= 71 && _bitDepth >= 8) || (_vm->_game.heversion >= 90 && _bitDepth == 0)) { + if ((_vm->_game.heversion >= 71 && _bytesPerPixel >= 8) || (_vm->_game.heversion >= 90 && _bytesPerPixel == 0)) { #ifdef ENABLE_HE if (ignoreCharsetMask || !vs->hasTwoBuffers) { dstPtr = vs->getPixels(0, 0); @@ -815,13 +815,13 @@ void CharsetRendererClassic::printCharIntern(bool is2byte, const byte *charPtr, } Common::Rect rScreen(vs->w, vs->h); - if (_bitDepth >= 8) { + if (_bytesPerPixel >= 8) { byte imagePalette[256]; memset(imagePalette, 0, sizeof(imagePalette)); memcpy(imagePalette, _vm->_charsetColorMap, 4); - Wiz::copyWizImage(dstPtr, charPtr, vs->pitch, kDstScreen, vs->w, vs->h, _left, _top, origWidth, origHeight, &rScreen, 0, imagePalette, NULL, _vm->_bitDepth); + Wiz::copyWizImage(dstPtr, charPtr, vs->pitch, kDstScreen, vs->w, vs->h, _left, _top, origWidth, origHeight, &rScreen, 0, imagePalette, NULL, _vm->_bytesPerPixel); } else { - Wiz::copyWizImage(dstPtr, charPtr, vs->pitch, kDstScreen, vs->w, vs->h, _left, _top, origWidth, origHeight, &rScreen, 0, NULL, NULL, _vm->_bitDepth); + Wiz::copyWizImage(dstPtr, charPtr, vs->pitch, kDstScreen, vs->w, vs->h, _left, _top, origWidth, origHeight, &rScreen, 0, NULL, NULL, _vm->_bytesPerPixel); } if (_blitAlso && vs->hasTwoBuffers) { diff --git a/engines/scumm/charset.h b/engines/scumm/charset.h index 905849a977..3859903281 100644 --- a/engines/scumm/charset.h +++ b/engines/scumm/charset.h @@ -95,7 +95,7 @@ public: class CharsetRendererCommon : public CharsetRenderer { protected: const byte *_fontPtr; - int _bitDepth; + int _bytesPerPixel; int _fontHeight; int _numChars; diff --git a/engines/scumm/cursor.cpp b/engines/scumm/cursor.cpp index 7818d6a98e..f3104c2b9f 100644 --- a/engines/scumm/cursor.cpp +++ b/engines/scumm/cursor.cpp @@ -147,7 +147,7 @@ void ScummEngine::setCursorFromBuffer(const byte *ptr, int width, int height, in uint size; byte *dst; - size = width * height * _bitDepth; + size = width * height * _bytesPerPixel; if (size > sizeof(_grabbedCursor)) error("grabCursor: grabbed cursor too big"); @@ -157,8 +157,8 @@ void ScummEngine::setCursorFromBuffer(const byte *ptr, int width, int height, in dst = _grabbedCursor; for (; height; height--) { - memcpy(dst, ptr, width * _bitDepth); - dst += width * _bitDepth; + memcpy(dst, ptr, width * _bytesPerPixel); + dst += width * _bytesPerPixel; ptr += pitch; } @@ -176,7 +176,7 @@ void ScummEngine_v70he::setDefaultCursor() { 0xff, 0xff, 0xff, 0, 0, 0, 0, 0}; - if (_bitDepth == 2) { + if (_bytesPerPixel == 2) { for (i = 0; i < 1024; i++) WRITE_UINT16(_grabbedCursor + i * 2, 5); } else { @@ -194,13 +194,13 @@ void ScummEngine_v70he::setDefaultCursor() { for (j = 0; j < 32; j++) { switch ((p & (0x3 << 14)) >> 14) { case 1: - if (_bitDepth == 2) + if (_bytesPerPixel == 2) WRITE_UINT16(_grabbedCursor + 64 * i + j * 2, get16BitColor(palette[4], palette[5], palette[6])); else _grabbedCursor[32 * i + j] = 0xfe; break; case 2: - if (_bitDepth == 2) + if (_bytesPerPixel == 2) WRITE_UINT16(_grabbedCursor + 64 * i + j * 2, get16BitColor(palette[0], palette[1], palette[2])); else _grabbedCursor[32 * i + j] = 0xfd; @@ -215,7 +215,7 @@ void ScummEngine_v70he::setDefaultCursor() { } } - if (_bitDepth == 1) { + if (_bytesPerPixel == 1) { // Since white color position is not guaranteed // we setup our own palette if supported by backend CursorMan.replaceCursorPalette(palette, 0xfd, 3); diff --git a/engines/scumm/gfx.cpp b/engines/scumm/gfx.cpp index 008dfb3793..d1bb1d53b2 100644 --- a/engines/scumm/gfx.cpp +++ b/engines/scumm/gfx.cpp @@ -619,7 +619,7 @@ void ScummEngine::drawStripToScreen(VirtScreen *vs, int x, int width, int top, i vsPitch >>= 2; - if (_bitDepth == 2) { + if (_bytesPerPixel == 2) { // Sprites always seem to be used for subtitles in 16Bit color HE games, and not // the charset renderer, so charset masking isn't required. for (int h = height * m; h > 0; --h) { @@ -1975,12 +1975,12 @@ void Gdi::drawBMAPObject(const byte *ptr, VirtScreen *vs, int obj, int x, int y, assert(bmap_ptr); byte code = *bmap_ptr++; - int scrX = _vm->_screenStartStrip * 8 * _vm->_bitDepth; + int scrX = _vm->_screenStartStrip * 8 * _vm->_bytesPerPixel; if (code == 8 || code == 9) { Common::Rect rScreen(0, 0, vs->w, vs->h); byte *dst = (byte *)_vm->_virtscr[kMainVirtScreen].backBuf + scrX; - Wiz::copyWizImage(dst, bmap_ptr, vs->pitch, kDstScreen, vs->w, vs->h, x - scrX, y, w, h, &rScreen, 0, 0, 0, _vm->_bitDepth); + Wiz::copyWizImage(dst, bmap_ptr, vs->pitch, kDstScreen, vs->w, vs->h, x - scrX, y, w, h, &rScreen, 0, 0, 0, _vm->_bytesPerPixel); } Common::Rect rect1(x, y, x + w, y + h); @@ -2820,11 +2820,11 @@ void Gdi::drawStripHE(byte *dst, int dstPitch, const byte *src, int width, int h while (1) { if (!transpCheck || color != _transparentColor) writeRoomColor(dst, color); - dst += _vm->_bitDepth; + dst += _vm->_bytesPerPixel; --x; if (x == 0) { x = width; - dst += dstPitch - width * _vm->_bitDepth; + dst += dstPitch - width * _vm->_bytesPerPixel; --height; if (height == 0) return; @@ -2909,7 +2909,7 @@ void Gdi::drawStripComplex(byte *dst, int dstPitch, const byte *src, int height, FILL_BITS; if (!transpCheck || color != _transparentColor) writeRoomColor(dst, color); - dst += _vm->_bitDepth; + dst += _vm->_bytesPerPixel; againPos: if (!READ_BIT) { @@ -2930,13 +2930,13 @@ void Gdi::drawStripComplex(byte *dst, int dstPitch, const byte *src, int height, do { if (!--x) { x = 8; - dst += dstPitch - 8 * _vm->_bitDepth; + dst += dstPitch - 8 * _vm->_bytesPerPixel; if (!--height) return; } if (!transpCheck || color != _transparentColor) writeRoomColor(dst, color); - dst += _vm->_bitDepth; + dst += _vm->_bytesPerPixel; } while (--reps); bits >>= 8; bits |= (*src++) << (cl - 8); @@ -2944,7 +2944,7 @@ void Gdi::drawStripComplex(byte *dst, int dstPitch, const byte *src, int height, } } } while (--x); - dst += dstPitch - 8 * _vm->_bitDepth; + dst += dstPitch - 8 * _vm->_bytesPerPixel; } while (--height); } @@ -2961,7 +2961,7 @@ void Gdi::drawStripBasicH(byte *dst, int dstPitch, const byte *src, int height, FILL_BITS; if (!transpCheck || color != _transparentColor) writeRoomColor(dst, color); - dst += _vm->_bitDepth; + dst += _vm->_bytesPerPixel; if (!READ_BIT) { } else if (!READ_BIT) { FILL_BITS; @@ -2976,7 +2976,7 @@ void Gdi::drawStripBasicH(byte *dst, int dstPitch, const byte *src, int height, color += inc; } } while (--x); - dst += dstPitch - 8 * _vm->_bitDepth; + dst += dstPitch - 8 * _vm->_bytesPerPixel; } while (--height); } @@ -3061,7 +3061,7 @@ void Gdi::drawStripRaw(byte *dst, int dstPitch, const byte *src, int height, con for (x = 0; x < 8; x ++) { byte color = *src++; if (!transpCheck || color != _transparentColor) - writeRoomColor(dst + x * _vm->_bitDepth, color); + writeRoomColor(dst + x * _vm->_bytesPerPixel, color); } dst += dstPitch; } while (--height); diff --git a/engines/scumm/he/animation_he.cpp b/engines/scumm/he/animation_he.cpp index cf071fc4aa..11d7e87f34 100644 --- a/engines/scumm/he/animation_he.cpp +++ b/engines/scumm/he/animation_he.cpp @@ -115,7 +115,7 @@ void MoviePlayer::handleNextFrame() { assert(dstPtr); uint8 *dst = _vm->findWrappedBlock(MKID_BE('WIZD'), dstPtr, 0, 0); assert(dst); - copyFrameToBuffer(dst, kDstResource, 0, 0, _vm->_screenWidth * _vm->_bitDepth); + copyFrameToBuffer(dst, kDstResource, 0, 0, _vm->_screenWidth * _vm->_bytesPerPixel); } else if (_flags & 1) { copyFrameToBuffer(pvs->getBackPixels(0, 0), kDstScreen, 0, 0, pvs->pitch); diff --git a/engines/scumm/he/wiz_he.cpp b/engines/scumm/he/wiz_he.cpp index 9ddc1ea22f..d5513262ee 100644 --- a/engines/scumm/he/wiz_he.cpp +++ b/engines/scumm/he/wiz_he.cpp @@ -1498,10 +1498,10 @@ uint8 *Wiz::drawWizImage(int resNum, int state, int maskNum, int maskState, int int32 dstPitch, dstType, cw, ch; if (flags & kWIFBlitToMemBuffer) { - dst = (uint8 *)malloc(width * height * _vm->_bitDepth); + dst = (uint8 *)malloc(width * height * _vm->_bytesPerPixel); int transColor = (_vm->VAR_WIZ_TCOLOR != 0xFF) ? (_vm->VAR(_vm->VAR_WIZ_TCOLOR)) : 5; - if (_vm->_bitDepth == 2) { + if (_vm->_bytesPerPixel == 2) { uint8 *tmpPtr = dst; for (uint i = 0; i < height; i++) { for (uint j = 0; j < width; j++) { @@ -1518,7 +1518,7 @@ uint8 *Wiz::drawWizImage(int resNum, int state, int maskNum, int maskState, int } cw = width; ch = height; - dstPitch = cw * _vm->_bitDepth; + dstPitch = cw * _vm->_bytesPerPixel; dstType = kDstMemory; } else { if (dstResNum) { @@ -1527,7 +1527,7 @@ uint8 *Wiz::drawWizImage(int resNum, int state, int maskNum, int maskState, int dst = _vm->findWrappedBlock(MKID_BE('WIZD'), dstPtr, 0, 0); assert(dst); getWizImageDim(dstResNum, 0, cw, ch); - dstPitch = cw * _vm->_bitDepth; + dstPitch = cw * _vm->_bytesPerPixel; dstType = kDstResource; } else { VirtScreen *pvs = &_vm->_virtscr[kMainVirtScreen]; @@ -1559,7 +1559,7 @@ uint8 *Wiz::drawWizImage(int resNum, int state, int maskNum, int maskState, int } } - if (flags & kWIFRemapPalette && _vm->_bitDepth == 1) { + if (flags & kWIFRemapPalette && _vm->_bytesPerPixel == 1) { palPtr = rmap + 4; } @@ -1571,19 +1571,19 @@ uint8 *Wiz::drawWizImage(int resNum, int state, int maskNum, int maskState, int switch (comp) { case 0: - copyRawWizImage(dst, wizd, dstPitch, dstType, cw, ch, x1, y1, width, height, &rScreen, flags, palPtr, transColor, _vm->_bitDepth); + copyRawWizImage(dst, wizd, dstPitch, dstType, cw, ch, x1, y1, width, height, &rScreen, flags, palPtr, transColor, _vm->_bytesPerPixel); break; case 1: if (flags & 0x80) { dst = _vm->getMaskBuffer(0, 0, 1); - dstPitch /= _vm->_bitDepth; + dstPitch /= _vm->_bytesPerPixel; copyWizImageWithMask(dst, wizd, dstPitch, cw, ch, x1, y1, width, height, &rScreen, 0, 2); } else if (flags & 0x100) { dst = _vm->getMaskBuffer(0, 0, 1); - dstPitch /= _vm->_bitDepth; + dstPitch /= _vm->_bytesPerPixel; copyWizImageWithMask(dst, wizd, dstPitch, cw, ch, x1, y1, width, height, &rScreen, 0, 1); } else { - copyWizImage(dst, wizd, dstPitch, dstType, cw, ch, x1, y1, width, height, &rScreen, flags, palPtr, xmapPtr, _vm->_bitDepth); + copyWizImage(dst, wizd, dstPitch, dstType, cw, ch, x1, y1, width, height, &rScreen, flags, palPtr, xmapPtr, _vm->_bytesPerPixel); } break; #ifdef USE_RGB_COLOR @@ -1747,12 +1747,12 @@ void Wiz::captureWizPolygon(int resNum, int maskNum, int maskState, int id1, int dstw = wp->bound.width(); dsth = wp->bound.height(); - dstpitch = dstw * _vm->_bitDepth; - imageBuffer = (uint8 *)malloc(dstw * dsth * _vm->_bitDepth); + dstpitch = dstw * _vm->_bytesPerPixel; + imageBuffer = (uint8 *)malloc(dstw * dsth * _vm->_bytesPerPixel); assert(imageBuffer); const uint16 transColor = (_vm->VAR_WIZ_TCOLOR != 0xFF) ? _vm->VAR(_vm->VAR_WIZ_TCOLOR) : 5; - if (_vm->_bitDepth == 2) { + if (_vm->_bytesPerPixel == 2) { uint8 *tmpPtr = imageBuffer; for (i = 0; i < dsth; i++) { for (j = 0; j < dstw; j++) @@ -1764,7 +1764,7 @@ void Wiz::captureWizPolygon(int resNum, int maskNum, int maskState, int id1, int } Common::Rect bound; - drawWizPolygonImage(imageBuffer, src, NULL, dstpitch, kDstMemory, dstw, dsth, srcw, srch, bound, wp->vert, _vm->_bitDepth); + drawWizPolygonImage(imageBuffer, src, NULL, dstpitch, kDstMemory, dstw, dsth, srcw, srch, bound, wp->vert, _vm->_bytesPerPixel); captureImage(imageBuffer, dstpitch, dstw, dsth, resNum, wp->bound, compType); free(imageBuffer); @@ -1812,7 +1812,7 @@ void Wiz::drawWizPolygonTransform(int resNum, int state, Common::Point *wp, int srcWizBuf = drawWizImage(resNum, state, 0, 0, 0, 0, 0, shadow, 0, r, flags, 0, _vm->getHEPaletteSlot(palette)); } else { - assert(_vm->_bitDepth == 1); + assert(_vm->_bytesPerPixel == 1); uint8 *dataPtr = _vm->getResourceAddress(rtImage, resNum); assert(dataPtr); srcWizBuf = _vm->findWrappedBlock(MKID_BE('WIZD'), dataPtr, state, 0); @@ -1843,7 +1843,7 @@ void Wiz::drawWizPolygonTransform(int resNum, int state, Common::Point *wp, int dst = _vm->findWrappedBlock(MKID_BE('WIZD'), dstPtr, 0, 0); assert(dst); getWizImageDim(dstResNum, 0, dstw, dsth); - dstpitch = dstw * _vm->_bitDepth; + dstpitch = dstw * _vm->_bytesPerPixel; dstType = kDstResource; } else { if (flags & kWIFMarkBufferDirty) { @@ -1859,7 +1859,7 @@ void Wiz::drawWizPolygonTransform(int resNum, int state, Common::Point *wp, int Common::Rect bound; getWizImageDim(resNum, state, wizW, wizH); - drawWizPolygonImage(dst, srcWizBuf, 0, dstpitch, dstType, dstw, dsth, wizW, wizH, bound, wp, _vm->_bitDepth); + drawWizPolygonImage(dst, srcWizBuf, 0, dstpitch, dstType, dstw, dsth, wizW, wizH, bound, wp, _vm->_bytesPerPixel); if (flags & kWIFMarkBufferDirty) { _vm->markRectAsDirty(kMainVirtScreen, bound); @@ -1942,7 +1942,7 @@ void Wiz::drawWizPolygonImage(uint8 *dst, const uint8 *src, const uint8 *mask, i int16 width = ppa->xmax - ppa->xmin + 1; pra->x_step = ((ppa->x2 - ppa->x1) << 16) / width; pra->y_step = ((ppa->y2 - ppa->y1) << 16) / width; - pra->dst_offs = yoff + x1 * _vm->_bitDepth; + pra->dst_offs = yoff + x1 * _vm->_bytesPerPixel; pra->w = w; pra->x_s = ppa->x1 << 16; pra->y_s = ppa->y1 << 16; @@ -2024,7 +2024,7 @@ void Wiz::loadWizCursor(int resId, int palette) { int32 cw, ch; getWizImageDim(resId, 0, cw, ch); _vm->setCursorHotspot(x, y); - _vm->setCursorFromBuffer(cursor, cw, ch, cw * _vm->_bitDepth); + _vm->setCursorFromBuffer(cursor, cw, ch, cw * _vm->_bytesPerPixel); // Since we set up cursor palette for default cursor, disable it now CursorMan.disableCursorPalette(true); diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index 13a12c5480..74fa7ab9a3 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -254,7 +254,7 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr) _switchRoomEffect2 = 0; _switchRoomEffect = 0; - _bitDepth = 0; + _bytesPerPixel = 1; _doEffect = false; _snapScroll = false; _currentLights = 0; @@ -528,11 +528,11 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr) _screenHeight = 200; } - _bitDepth = (_game.features & GF_16BIT_COLOR) ? 2 : 1; + _bytesPerPixel = (_game.features & GF_16BIT_COLOR) ? 2 : 1; // Allocate gfx compositing buffer (not needed for V7/V8 games). if (_game.version < 7) - _compositeBuf = (byte *)malloc(_screenWidth * _screenHeight * _bitDepth); + _compositeBuf = (byte *)malloc(_screenWidth * _screenHeight * _bytesPerPixel); else _compositeBuf = 0; @@ -1225,7 +1225,7 @@ void ScummEngine::setupScumm() { } free(_compositeBuf); - _compositeBuf = (byte *)malloc(_screenWidth * _textSurfaceMultiplier * _screenHeight * _textSurfaceMultiplier * _bitDepth); + _compositeBuf = (byte *)malloc(_screenWidth * _textSurfaceMultiplier * _screenHeight * _textSurfaceMultiplier * _bytesPerPixel); } #ifdef ENABLE_SCUMM_7_8 diff --git a/engines/scumm/scumm.h b/engines/scumm/scumm.h index 940ea512d5..57094e0c59 100644 --- a/engines/scumm/scumm.h +++ b/engines/scumm/scumm.h @@ -963,7 +963,7 @@ public: int _screenTop; Common::RenderMode _renderMode; - uint8 _bitDepth; + uint8 _bytesPerPixel; protected: ColorCycle _colorCycle[16]; // Palette cycles -- cgit v1.2.3