From 40444b0aeb11da5ccde497866bffdc80e18392b8 Mon Sep 17 00:00:00 2001 From: Colin Snover Date: Sun, 9 Oct 2016 10:52:08 -0500 Subject: SCI32: Clarify some identifiers transparentColor -> skipColor displace -> origin scaledWidth -> xResolution scaledHeight -> yResolution --- engines/sci/engine/kernel.h | 2 +- engines/sci/engine/kernel_tables.h | 2 +- engines/sci/engine/kgraphics32.cpp | 46 +++++++++---------- engines/sci/engine/seg_manager.cpp | 4 +- engines/sci/engine/seg_manager.h | 2 +- engines/sci/engine/segment.h | 28 ++++++------ engines/sci/graphics/celobj32.cpp | 80 +++++++++++++++++----------------- engines/sci/graphics/celobj32.h | 8 ++-- engines/sci/graphics/controls32.cpp | 2 +- engines/sci/graphics/cursor32.cpp | 2 +- engines/sci/graphics/frameout.cpp | 4 +- engines/sci/graphics/screen_item32.cpp | 76 ++++++++++++++++---------------- engines/sci/graphics/text32.cpp | 40 ++++++++--------- engines/sci/graphics/text32.h | 12 ++--- engines/sci/video/robot_decoder.cpp | 22 +++++----- 15 files changed, 165 insertions(+), 165 deletions(-) diff --git a/engines/sci/engine/kernel.h b/engines/sci/engine/kernel.h index 05e15daab4..cce9a223d3 100644 --- a/engines/sci/engine/kernel.h +++ b/engines/sci/engine/kernel.h @@ -563,7 +563,7 @@ reg_t kBitmapDrawText(EngineState *s, int argc, reg_t *argv); reg_t kBitmapDrawColor(EngineState *s, int argc, reg_t *argv); reg_t kBitmapDrawBitmap(EngineState *s, int argc, reg_t *argv); reg_t kBitmapInvert(EngineState *s, int argc, reg_t *argv); -reg_t kBitmapSetDisplace(EngineState *s, int argc, reg_t *argv); +reg_t kBitmapSetOrigin(EngineState *s, int argc, reg_t *argv); reg_t kBitmapCreateFromView(EngineState *s, int argc, reg_t *argv); reg_t kBitmapCopyPixels(EngineState *s, int argc, reg_t *argv); reg_t kBitmapClone(EngineState *s, int argc, reg_t *argv); diff --git a/engines/sci/engine/kernel_tables.h b/engines/sci/engine/kernel_tables.h index 6b3156972c..0f1210e0e1 100644 --- a/engines/sci/engine/kernel_tables.h +++ b/engines/sci/engine/kernel_tables.h @@ -391,7 +391,7 @@ static const SciKernelMapSubEntry kBitmap_subops[] = { { SIG_SINCE_SCI21, 5, MAP_CALL(BitmapDrawColor), "riiiii", NULL }, { SIG_SINCE_SCI21, 6, MAP_CALL(BitmapDrawBitmap), "rr(i)(i)(i)", NULL }, { SIG_SINCE_SCI21, 7, MAP_CALL(BitmapInvert), "riiiiii", NULL }, - { SIG_SINCE_SCI21MID, 8, MAP_CALL(BitmapSetDisplace), "rii", NULL }, + { SIG_SINCE_SCI21MID, 8, MAP_CALL(BitmapSetOrigin), "rii", NULL }, { SIG_SINCE_SCI21MID, 9, MAP_CALL(BitmapCreateFromView), "iii(i)(i)(i)([r0])", NULL }, { SIG_SINCE_SCI21MID, 10, MAP_CALL(BitmapCopyPixels), "rr", NULL }, { SIG_SINCE_SCI21MID, 11, MAP_CALL(BitmapClone), "r", NULL }, diff --git a/engines/sci/engine/kgraphics32.cpp b/engines/sci/engine/kgraphics32.cpp index b8dc3e45b8..e5b8da4620 100644 --- a/engines/sci/engine/kgraphics32.cpp +++ b/engines/sci/engine/kgraphics32.cpp @@ -75,14 +75,14 @@ reg_t kBaseSetter32(EngineState *s, int argc, reg_t *argv) { CelObjView celObj(viewId, loopNo, celNo); const int16 scriptWidth = g_sci->_gfxFrameout->getCurrentBuffer().scriptWidth; - const Ratio scaleX(scriptWidth, celObj._scaledWidth); + const Ratio scaleX(scriptWidth, celObj._xResolution); int16 brLeft; if (celObj._mirrorX) { - brLeft = x - ((celObj._width - celObj._displace.x) * scaleX).toInt(); + brLeft = x - ((celObj._width - celObj._origin.x) * scaleX).toInt(); } else { - brLeft = x - (celObj._displace.x * scaleX).toInt(); + brLeft = x - (celObj._origin.x * scaleX).toInt(); } const int16 brRight = brLeft + (celObj._width * scaleX).toInt() - 1; @@ -427,7 +427,7 @@ reg_t kCelHigh32(EngineState *s, int argc, reg_t *argv) { int16 loopNo = argv[1].toSint16(); int16 celNo = argv[2].toSint16(); CelObjView celObj(resourceId, loopNo, celNo); - return make_reg(0, mulru(celObj._height, Ratio(g_sci->_gfxFrameout->getCurrentBuffer().scriptHeight, celObj._scaledHeight))); + return make_reg(0, mulru(celObj._height, Ratio(g_sci->_gfxFrameout->getCurrentBuffer().scriptHeight, celObj._yResolution))); } reg_t kCelWide32(EngineState *s, int argc, reg_t *argv) { @@ -435,7 +435,7 @@ reg_t kCelWide32(EngineState *s, int argc, reg_t *argv) { int16 loopNo = argv[1].toSint16(); int16 celNo = argv[2].toSint16(); CelObjView celObj(resourceId, loopNo, celNo); - return make_reg(0, mulru(celObj._width, Ratio(g_sci->_gfxFrameout->getCurrentBuffer().scriptWidth, celObj._scaledWidth))); + return make_reg(0, mulru(celObj._width, Ratio(g_sci->_gfxFrameout->getCurrentBuffer().scriptWidth, celObj._xResolution))); } reg_t kCelInfo(EngineState *s, int argc, reg_t *argv) { @@ -448,10 +448,10 @@ reg_t kCelInfo(EngineState *s, int argc, reg_t *argv) { switch (argv[0].toUint16()) { case 0: - result = view._displace.x; + result = view._origin.x; break; case 1: - result = view._displace.y; + result = view._origin.y; break; case 2: case 3: @@ -616,13 +616,13 @@ reg_t kSetFontHeight(EngineState *s, int argc, reg_t *argv) { // of setting the fontHeight on the font manager, in // which case we could just get the font directly ourselves. g_sci->_gfxText32->setFont(argv[0].toUint16()); - g_sci->_gfxText32->_scaledHeight = (g_sci->_gfxText32->_font->getHeight() * g_sci->_gfxFrameout->getCurrentBuffer().scriptHeight + g_sci->_gfxText32->_scaledHeight - 1) / g_sci->_gfxText32->_scaledHeight; - return make_reg(0, g_sci->_gfxText32->_scaledHeight); + g_sci->_gfxText32->_yResolution = (g_sci->_gfxText32->_font->getHeight() * g_sci->_gfxFrameout->getCurrentBuffer().scriptHeight + g_sci->_gfxText32->_yResolution - 1) / g_sci->_gfxText32->_yResolution; + return make_reg(0, g_sci->_gfxText32->_yResolution); } reg_t kSetFontRes(EngineState *s, int argc, reg_t *argv) { - g_sci->_gfxText32->_scaledWidth = argv[0].toUint16(); - g_sci->_gfxText32->_scaledHeight = argv[1].toUint16(); + g_sci->_gfxText32->_xResolution = argv[0].toUint16(); + g_sci->_gfxText32->_yResolution = argv[1].toUint16(); return s->r_acc; } @@ -637,12 +637,12 @@ reg_t kBitmapCreate(EngineState *s, int argc, reg_t *argv) { int16 height = argv[1].toSint16(); int16 skipColor = argv[2].toSint16(); int16 backColor = argv[3].toSint16(); - int16 scaledWidth = argc > 4 ? argv[4].toSint16() : g_sci->_gfxText32->_scaledWidth; - int16 scaledHeight = argc > 5 ? argv[5].toSint16() : g_sci->_gfxText32->_scaledHeight; + int16 xResolution = argc > 4 ? argv[4].toSint16() : g_sci->_gfxText32->_xResolution; + int16 yResolution = argc > 5 ? argv[5].toSint16() : g_sci->_gfxText32->_yResolution; bool useRemap = argc > 6 ? argv[6].toSint16() : false; reg_t bitmapId; - SciBitmap &bitmap = *s->_segMan->allocateBitmap(&bitmapId, width, height, skipColor, 0, 0, scaledWidth, scaledHeight, 0, useRemap, true); + SciBitmap &bitmap = *s->_segMan->allocateBitmap(&bitmapId, width, height, skipColor, 0, 0, xResolution, yResolution, 0, useRemap, true); memset(bitmap.getPixels(), backColor, width * height); return bitmapId; } @@ -676,12 +676,12 @@ reg_t kBitmapDrawView(EngineState *s, int argc, reg_t *argv) { const int16 alignY = argc > 8 ? argv[8].toSint16() : -1; Common::Point position( - x == -1 ? bitmap.getDisplace().x : x, - y == -1 ? bitmap.getDisplace().y : y + x == -1 ? bitmap.getOrigin().x : x, + y == -1 ? bitmap.getOrigin().y : y ); - position.x -= alignX == -1 ? view._displace.x : alignX; - position.y -= alignY == -1 ? view._displace.y : alignY; + position.x -= alignX == -1 ? view._origin.x : alignX; + position.y -= alignY == -1 ? view._origin.y : alignY; Common::Rect drawRect( position.x, @@ -756,20 +756,20 @@ reg_t kBitmapInvert(EngineState *s, int argc, reg_t *argv) { return kStubNull(s, argc + 1, argv - 1); } -reg_t kBitmapSetDisplace(EngineState *s, int argc, reg_t *argv) { +reg_t kBitmapSetOrigin(EngineState *s, int argc, reg_t *argv) { SciBitmap &bitmap = *s->_segMan->lookupBitmap(argv[0]); - bitmap.setDisplace(Common::Point(argv[1].toSint16(), argv[2].toSint16())); + bitmap.setOrigin(Common::Point(argv[1].toSint16(), argv[2].toSint16())); return s->r_acc; } reg_t kBitmapCreateFromView(EngineState *s, int argc, reg_t *argv) { CelObjView view(argv[0].toUint16(), argv[1].toSint16(), argv[2].toSint16()); - const uint8 skipColor = argc > 3 && argv[3].toSint16() != -1 ? argv[3].toSint16() : view._transparentColor; - const uint8 backColor = argc > 4 && argv[4].toSint16() != -1 ? argv[4].toSint16() : view._transparentColor; + const uint8 skipColor = argc > 3 && argv[3].toSint16() != -1 ? argv[3].toSint16() : view._skipColor; + const uint8 backColor = argc > 4 && argv[4].toSint16() != -1 ? argv[4].toSint16() : view._skipColor; const bool useRemap = argc > 5 ? (bool)argv[5].toSint16() : false; reg_t bitmapId; - SciBitmap &bitmap = *s->_segMan->allocateBitmap(&bitmapId, view._width, view._height, skipColor, 0, 0, view._scaledWidth, view._scaledHeight, 0, useRemap, true); + SciBitmap &bitmap = *s->_segMan->allocateBitmap(&bitmapId, view._width, view._height, skipColor, 0, 0, view._xResolution, view._yResolution, 0, useRemap, true); Buffer &buffer = bitmap.getBuffer(); const Common::Rect viewRect(view._width, view._height); diff --git a/engines/sci/engine/seg_manager.cpp b/engines/sci/engine/seg_manager.cpp index ced3830a29..83e7495b3c 100644 --- a/engines/sci/engine/seg_manager.cpp +++ b/engines/sci/engine/seg_manager.cpp @@ -913,7 +913,7 @@ bool SegManager::isArray(reg_t addr) const { #pragma mark - #pragma mark Bitmaps -SciBitmap *SegManager::allocateBitmap(reg_t *addr, const int16 width, const int16 height, const uint8 skipColor, const int16 displaceX, const int16 displaceY, const int16 scaledWidth, const int16 scaledHeight, const uint32 paletteSize, const bool remap, const bool gc) { +SciBitmap *SegManager::allocateBitmap(reg_t *addr, const int16 width, const int16 height, const uint8 skipColor, const int16 originX, const int16 originY, const int16 xResolution, const int16 yResolution, const uint32 paletteSize, const bool remap, const bool gc) { BitmapTable *table; int offset; @@ -928,7 +928,7 @@ SciBitmap *SegManager::allocateBitmap(reg_t *addr, const int16 width, const int1 *addr = make_reg(_bitmapSegId, offset); SciBitmap &bitmap = table->at(offset); - bitmap.create(width, height, skipColor, displaceX, displaceY, scaledWidth, scaledHeight, paletteSize, remap, gc); + bitmap.create(width, height, skipColor, originX, originY, xResolution, yResolution, paletteSize, remap, gc); return &bitmap; } diff --git a/engines/sci/engine/seg_manager.h b/engines/sci/engine/seg_manager.h index 60d0ee5b83..c409744711 100644 --- a/engines/sci/engine/seg_manager.h +++ b/engines/sci/engine/seg_manager.h @@ -438,7 +438,7 @@ public: void freeArray(reg_t addr); bool isArray(reg_t addr) const; - SciBitmap *allocateBitmap(reg_t *addr, const int16 width, const int16 height, const uint8 skipColor = kDefaultSkipColor, const int16 displaceX = 0, const int16 displaceY = 0, const int16 scaledWidth = kLowResX, const int16 scaledHeight = kLowResY, const uint32 paletteSize = 0, const bool remap = false, const bool gc = true); + SciBitmap *allocateBitmap(reg_t *addr, const int16 width, const int16 height, const uint8 skipColor = kDefaultSkipColor, const int16 originX = 0, const int16 originY = 0, const int16 xResolution = kLowResX, const int16 yResolution = kLowResY, const uint32 paletteSize = 0, const bool remap = false, const bool gc = true); SciBitmap *lookupBitmap(reg_t addr); void freeBitmap(reg_t addr); #endif diff --git a/engines/sci/engine/segment.h b/engines/sci/engine/segment.h index e62b4fa8eb..361c1cb895 100644 --- a/engines/sci/engine/segment.h +++ b/engines/sci/engine/segment.h @@ -963,7 +963,7 @@ public: /** * Allocates and initialises a new bitmap. */ - inline void create(const int16 width, const int16 height, const uint8 skipColor, const int16 displaceX, const int16 displaceY, const int16 scaledWidth, const int16 scaledHeight, const uint32 paletteSize, const bool remap, const bool gc) { + inline void create(const int16 width, const int16 height, const uint8 skipColor, const int16 originX, const int16 originY, const int16 xResolution, const int16 yResolution, const uint32 paletteSize, const bool remap, const bool gc) { _dataSize = getBitmapSize(width, height) + paletteSize; _data = (byte *)realloc(_data, _dataSize); @@ -973,7 +973,7 @@ public: setWidth(width); setHeight(height); - setDisplace(Common::Point(displaceX, displaceY)); + setOrigin(Common::Point(originX, originY)); setSkipColor(skipColor); _data[9] = 0; WRITE_SCI11ENDIAN_UINT16(_data + 10, 0); @@ -984,8 +984,8 @@ public: setDataOffset(bitmapHeaderSize); setUncompressedDataOffset(bitmapHeaderSize); setControlOffset(0); - setScaledWidth(scaledWidth); - setScaledHeight(scaledHeight); + setXResolution(xResolution); + setYResolution(yResolution); _buffer = Buffer(getWidth(), getHeight(), getPixels()); } @@ -1017,16 +1017,16 @@ public: BITMAP_PROPERTY(16, Width, 0); BITMAP_PROPERTY(16, Height, 2); - inline Common::Point getDisplace() const { + inline Common::Point getOrigin() const { return Common::Point( (int16)READ_SCI11ENDIAN_UINT16(_data + 4), (int16)READ_SCI11ENDIAN_UINT16(_data + 6) ); } - inline void setDisplace(const Common::Point &displace) { - WRITE_SCI11ENDIAN_UINT16(_data + 4, (uint16)displace.x); - WRITE_SCI11ENDIAN_UINT16(_data + 6, (uint16)displace.y); + inline void setOrigin(const Common::Point &origin) { + WRITE_SCI11ENDIAN_UINT16(_data + 4, (uint16)origin.x); + WRITE_SCI11ENDIAN_UINT16(_data + 6, (uint16)origin.y); } inline uint8 getSkipColor() const { @@ -1075,7 +1075,7 @@ public: // NOTE: This property always seems to be zero BITMAP_PROPERTY(32, ControlOffset, 32); - inline uint16 getScaledWidth() const { + inline uint16 getXResolution() const { if (getDataOffset() >= 40) { return READ_SCI11ENDIAN_UINT16(_data + 36); } @@ -1084,13 +1084,13 @@ public: return 320; } - inline void setScaledWidth(uint16 scaledWidth) { + inline void setXResolution(uint16 xResolution) { if (getDataOffset() >= 40) { - WRITE_SCI11ENDIAN_UINT16(_data + 36, scaledWidth); + WRITE_SCI11ENDIAN_UINT16(_data + 36, xResolution); } } - inline uint16 getScaledHeight() const { + inline uint16 getYResolution() const { if (getDataOffset() >= 40) { return READ_SCI11ENDIAN_UINT16(_data + 38); } @@ -1099,9 +1099,9 @@ public: return 200; } - inline void setScaledHeight(uint16 scaledHeight) { + inline void setYResolution(uint16 yResolution) { if (getDataOffset() >= 40) { - WRITE_SCI11ENDIAN_UINT16(_data + 38, scaledHeight); + WRITE_SCI11ENDIAN_UINT16(_data + 38, yResolution); } } diff --git a/engines/sci/graphics/celobj32.cpp b/engines/sci/graphics/celobj32.cpp index f538bf693c..430500ce1e 100644 --- a/engines/sci/graphics/celobj32.cpp +++ b/engines/sci/graphics/celobj32.cpp @@ -287,7 +287,7 @@ private: uint32 _uncompressedDataOffset; int16 _y; const int16 _sourceHeight; - const uint8 _transparentColor; + const uint8 _skipColor; const int16 _maxWidth; public: @@ -295,7 +295,7 @@ public: _resource(celObj.getResPointer()), _y(-1), _sourceHeight(celObj._height), - _transparentColor(celObj._transparentColor), + _skipColor(celObj._skipColor), _maxWidth(maxWidth) { assert(maxWidth <= celObj._width); @@ -326,7 +326,7 @@ public: // Fill with skip color if (controlByte & 0x40) { - memset(_buffer + i, _transparentColor, length); + memset(_buffer + i, _skipColor, length); // Next value is fill color } else { memset(_buffer + i, *literal, length); @@ -665,7 +665,7 @@ void CelObj::render(Buffer &target, const Common::Rect &targetRect, const Common MAPPER mapper; SCALER scaler(*this, targetRect.left - scaledPosition.x + targetRect.width(), scaledPosition); - RENDERER renderer(mapper, scaler, _transparentColor); + RENDERER renderer(mapper, scaler, _skipColor); renderer.draw(target, targetRect, scaledPosition); } @@ -675,10 +675,10 @@ void CelObj::render(Buffer &target, const Common::Rect &targetRect, const Common MAPPER mapper; SCALER scaler(*this, targetRect, scaledPosition, scaleX, scaleY); if (_drawBlackLines) { - RENDERER renderer(mapper, scaler, _transparentColor); + RENDERER renderer(mapper, scaler, _skipColor); renderer.draw(target, targetRect, scaledPosition); } else { - RENDERER renderer(mapper, scaler, _transparentColor); + RENDERER renderer(mapper, scaler, _skipColor); renderer.draw(target, targetRect, scaledPosition); } } @@ -891,20 +891,20 @@ CelObjView::CelObjView(const GuiResourceId viewId, const int16 loopNo, const int const byte *const data = resource->data; - _scaledWidth = READ_SCI11ENDIAN_UINT16(data + 14); - _scaledHeight = READ_SCI11ENDIAN_UINT16(data + 16); + _xResolution = READ_SCI11ENDIAN_UINT16(data + 14); + _yResolution = READ_SCI11ENDIAN_UINT16(data + 16); - if (_scaledWidth == 0 && _scaledHeight == 0) { + if (_xResolution == 0 && _yResolution == 0) { byte sizeFlag = data[5]; if (sizeFlag == 0) { - _scaledWidth = kLowResX; - _scaledHeight = kLowResY; + _xResolution = kLowResX; + _yResolution = kLowResY; } else if (sizeFlag == 1) { - _scaledWidth = 640; - _scaledHeight = 480; + _xResolution = 640; + _yResolution = 480; } else if (sizeFlag == 2) { - _scaledWidth = 640; - _scaledHeight = 400; + _xResolution = 640; + _yResolution = 400; } } @@ -958,9 +958,9 @@ CelObjView::CelObjView(const GuiResourceId viewId, const int16 loopNo, const int _width = READ_SCI11ENDIAN_UINT16(celHeader); _height = READ_SCI11ENDIAN_UINT16(celHeader + 2); - _displace.x = _width / 2 - (int16)READ_SCI11ENDIAN_UINT16(celHeader + 4); - _displace.y = _height - (int16)READ_SCI11ENDIAN_UINT16(celHeader + 6) - 1; - _transparentColor = celHeader[8]; + _origin.x = _width / 2 - (int16)READ_SCI11ENDIAN_UINT16(celHeader + 4); + _origin.y = _height - (int16)READ_SCI11ENDIAN_UINT16(celHeader + 6) - 1; + _skipColor = celHeader[8]; _compressionType = (CelCompressionType)celHeader[9]; if (_compressionType != kCelCompressionNone && _compressionType != kCelCompressionRLE) { @@ -989,7 +989,7 @@ bool CelObjView::analyzeUncompressedForRemap() const { if ( pixel >= g_sci->_gfxRemap32->getStartColor() && pixel <= g_sci->_gfxRemap32->getEndColor() && - pixel != _transparentColor + pixel != _skipColor ) { return true; } @@ -1006,7 +1006,7 @@ bool CelObjView::analyzeForRemap() const { if ( pixel >= g_sci->_gfxRemap32->getStartColor() && pixel <= g_sci->_gfxRemap32->getEndColor() && - pixel != _transparentColor + pixel != _skipColor ) { return true; } @@ -1080,9 +1080,9 @@ CelObjPic::CelObjPic(const GuiResourceId picId, const int16 celNo) { _width = READ_SCI11ENDIAN_UINT16(celHeader); _height = READ_SCI11ENDIAN_UINT16(celHeader + 2); - _displace.x = (int16)READ_SCI11ENDIAN_UINT16(celHeader + 4); - _displace.y = (int16)READ_SCI11ENDIAN_UINT16(celHeader + 6); - _transparentColor = celHeader[8]; + _origin.x = (int16)READ_SCI11ENDIAN_UINT16(celHeader + 4); + _origin.y = (int16)READ_SCI11ENDIAN_UINT16(celHeader + 6); + _skipColor = celHeader[8]; _compressionType = (CelCompressionType)celHeader[9]; _priority = READ_SCI11ENDIAN_UINT16(celHeader + 36); _relativePosition.x = (int16)READ_SCI11ENDIAN_UINT16(celHeader + 38); @@ -1092,17 +1092,17 @@ CelObjPic::CelObjPic(const GuiResourceId picId, const int16 celNo) { const uint16 sizeFlag2 = READ_SCI11ENDIAN_UINT16(data + 12); if (sizeFlag2) { - _scaledWidth = sizeFlag1; - _scaledHeight = sizeFlag2; + _xResolution = sizeFlag1; + _yResolution = sizeFlag2; } else if (sizeFlag1 == 0) { - _scaledWidth = kLowResX; - _scaledHeight = kLowResY; + _xResolution = kLowResX; + _yResolution = kLowResY; } else if (sizeFlag1 == 1) { - _scaledWidth = 640; - _scaledHeight = 480; + _xResolution = 640; + _yResolution = 480; } else if (sizeFlag1 == 2) { - _scaledWidth = 640; - _scaledHeight = 400; + _xResolution = 640; + _yResolution = 400; } if (celHeader[10] & 128) { @@ -1127,7 +1127,7 @@ bool CelObjPic::analyzeUncompressedForSkip() const { const byte *const pixels = resource + READ_SCI11ENDIAN_UINT32(resource + _celHeaderOffset + 24); for (int i = 0; i < _width * _height; ++i) { uint8 pixel = pixels[i]; - if (pixel == _transparentColor) { + if (pixel == _skipColor) { return true; } } @@ -1173,10 +1173,10 @@ CelObjMem::CelObjMem(const reg_t bitmapObject) { _width = bitmap->getWidth(); _height = bitmap->getHeight(); - _displace = bitmap->getDisplace(); - _transparentColor = bitmap->getSkipColor(); - _scaledWidth = bitmap->getScaledWidth(); - _scaledHeight = bitmap->getScaledHeight(); + _origin = bitmap->getOrigin(); + _skipColor = bitmap->getSkipColor(); + _xResolution = bitmap->getXResolution(); + _yResolution = bitmap->getYResolution(); _hunkPaletteOffset = bitmap->getHunkPaletteOffset(); _remap = bitmap->getRemap(); } @@ -1195,10 +1195,10 @@ byte *CelObjMem::getResPointer() const { CelObjColor::CelObjColor(const uint8 color, const int16 width, const int16 height) { _info.type = kCelTypeColor; _info.color = color; - _displace.x = 0; - _displace.y = 0; - _scaledWidth = g_sci->_gfxFrameout->getCurrentBuffer().scriptWidth; - _scaledHeight = g_sci->_gfxFrameout->getCurrentBuffer().scriptHeight; + _origin.x = 0; + _origin.y = 0; + _xResolution = g_sci->_gfxFrameout->getCurrentBuffer().scriptWidth; + _yResolution = g_sci->_gfxFrameout->getCurrentBuffer().scriptHeight; _hunkPaletteOffset = 0; _mirrorX = false; _remap = false; diff --git a/engines/sci/graphics/celobj32.h b/engines/sci/graphics/celobj32.h index c30529fde5..03d950a3c3 100644 --- a/engines/sci/graphics/celobj32.h +++ b/engines/sci/graphics/celobj32.h @@ -286,7 +286,7 @@ public: /** * TODO: Documentation */ - Common::Point _displace; + Common::Point _origin; /** * The dimensions of the original coordinate system for @@ -301,21 +301,21 @@ public: * scriptWidth/Height but seems to typically be changed * to more closely match the native screen resolution. */ - uint16 _scaledWidth, _scaledHeight; + uint16 _xResolution, _yResolution; /** * The skip (transparent) color for the cel. When * compositing, any pixels matching this color will not * be copied to the buffer. */ - uint8 _transparentColor; + uint8 _skipColor; /** * Whether or not this cel has any transparent regions. * This is used for optimised drawing of non-transparent * cels. */ - bool _transparent; // TODO: probably "skip"? + bool _transparent; /** * The compression type for the pixel data for this cel. diff --git a/engines/sci/graphics/controls32.cpp b/engines/sci/graphics/controls32.cpp index 89997d38a5..4ec534fd8a 100644 --- a/engines/sci/graphics/controls32.cpp +++ b/engines/sci/graphics/controls32.cpp @@ -400,7 +400,7 @@ ScrollWindow::ScrollWindow(SegManager *segMan, const Common::Rect &gameRect, con const uint16 scriptHeight = g_sci->_gfxFrameout->getCurrentBuffer().scriptHeight; Common::Rect bitmapRect(gameRect); - mulinc(bitmapRect, Ratio(_gfxText32._scaledWidth, scriptWidth), Ratio(_gfxText32._scaledHeight, scriptHeight)); + mulinc(bitmapRect, Ratio(_gfxText32._xResolution, scriptWidth), Ratio(_gfxText32._yResolution, scriptHeight)); _textRect.left = 2; _textRect.top = 2; diff --git a/engines/sci/graphics/cursor32.cpp b/engines/sci/graphics/cursor32.cpp index 7889d61b09..2f2611c769 100644 --- a/engines/sci/graphics/cursor32.cpp +++ b/engines/sci/graphics/cursor32.cpp @@ -182,7 +182,7 @@ void GfxCursor32::setView(const GuiResourceId viewId, const int16 loopNo, const if (_macCursorRemap.empty() && viewId != -1) { CelObjView view(viewId, loopNo, celNo); - _hotSpot = view._displace; + _hotSpot = view._origin; _width = view._width; _height = view._height; diff --git a/engines/sci/graphics/frameout.cpp b/engines/sci/graphics/frameout.cpp index c5c06c68d4..94518413da 100644 --- a/engines/sci/graphics/frameout.cpp +++ b/engines/sci/graphics/frameout.cpp @@ -1344,7 +1344,7 @@ bool GfxFrameout::isOnMe(const ScreenItem &screenItem, const Plane &plane, const scaledPosition.x -= screenItem._scaledPosition.x; scaledPosition.y -= screenItem._scaledPosition.y; - mulru(scaledPosition, Ratio(celObj._scaledWidth, _currentBuffer.screenWidth), Ratio(celObj._scaledHeight, _currentBuffer.screenHeight)); + mulru(scaledPosition, Ratio(celObj._xResolution, _currentBuffer.screenWidth), Ratio(celObj._yResolution, _currentBuffer.screenHeight)); if (screenItem._scale.signal != kScaleSignalNone && screenItem._scale.x && screenItem._scale.y) { scaledPosition.x = scaledPosition.x * 128 / screenItem._scale.x; @@ -1352,7 +1352,7 @@ bool GfxFrameout::isOnMe(const ScreenItem &screenItem, const Plane &plane, const } uint8 pixel = celObj.readPixel(scaledPosition.x, scaledPosition.y, mirrorX); - return pixel != celObj._transparentColor; + return pixel != celObj._skipColor; } return true; diff --git a/engines/sci/graphics/screen_item32.cpp b/engines/sci/graphics/screen_item32.cpp index 0956ef71a4..9b0d390cc3 100644 --- a/engines/sci/graphics/screen_item32.cpp +++ b/engines/sci/graphics/screen_item32.cpp @@ -275,18 +275,18 @@ void ScreenItem::calcRects(const Plane &plane) { if (scaleX.getNumerator() && scaleY.getNumerator()) { _screenItemRect = _insetRect; - const Ratio celToScreenX(screenWidth, celObj._scaledWidth); - const Ratio celToScreenY(screenHeight, celObj._scaledHeight); + const Ratio celToScreenX(screenWidth, celObj._xResolution); + const Ratio celToScreenY(screenHeight, celObj._yResolution); // Cel may use a coordinate system that is not the same size as the // script coordinate system (usually this means high-resolution // pictures with low-resolution scripts) - if (celObj._scaledWidth != kLowResX || celObj._scaledHeight != kLowResY) { + if (celObj._xResolution != kLowResX || celObj._yResolution != kLowResY) { // high resolution coordinates if (_useInsetRect) { - const Ratio scriptToCelX(celObj._scaledWidth, scriptWidth); - const Ratio scriptToCelY(celObj._scaledHeight, scriptHeight); + const Ratio scriptToCelX(celObj._xResolution, scriptWidth); + const Ratio scriptToCelY(celObj._yResolution, scriptHeight); mulru(_screenItemRect, scriptToCelX, scriptToCelY, 0); if (_screenItemRect.intersects(celRect)) { @@ -296,11 +296,11 @@ void ScreenItem::calcRects(const Plane &plane) { } } - int displaceX = celObj._displace.x; - int displaceY = celObj._displace.y; + int originX = celObj._origin.x; + int originY = celObj._origin.y; if (_mirrorX != celObj._mirrorX && _celInfo.type != kCelTypePic) { - displaceX = celObj._width - celObj._displace.x - 1; + originX = celObj._width - celObj._origin.x - 1; } if (!scaleX.isOne() || !scaleY.isOne()) { @@ -328,13 +328,13 @@ void ScreenItem::calcRects(const Plane &plane) { } } - displaceX = (displaceX * scaleX).toInt(); - displaceY = (displaceY * scaleY).toInt(); + originX = (originX * scaleX).toInt(); + originY = (originY * scaleY).toInt(); } mulinc(_screenItemRect, celToScreenX, celToScreenY); - displaceX = (displaceX * celToScreenX).toInt(); - displaceY = (displaceY * celToScreenY).toInt(); + originX = (originX * celToScreenX).toInt(); + originY = (originY * celToScreenY).toInt(); const Ratio scriptToScreenX = Ratio(screenWidth, scriptWidth); const Ratio scriptToScreenY = Ratio(screenHeight, scriptHeight); @@ -343,8 +343,8 @@ void ScreenItem::calcRects(const Plane &plane) { _scaledPosition.x = _position.x; _scaledPosition.y = _position.y; } else { - _scaledPosition.x = (_position.x * scriptToScreenX).toInt() - displaceX; - _scaledPosition.y = (_position.y * scriptToScreenY).toInt() - displaceY; + _scaledPosition.x = (_position.x * scriptToScreenX).toInt() - originX; + _scaledPosition.y = (_position.y * scriptToScreenY).toInt() - originY; } _screenItemRect.translate(_scaledPosition.x, _scaledPosition.y); @@ -362,7 +362,7 @@ void ScreenItem::calcRects(const Plane &plane) { if (celObjPic == nullptr) { error("Expected a CelObjPic"); } - temp.translate((celObjPic->_relativePosition.x * scriptToScreenX).toInt() - displaceX, 0); + temp.translate((celObjPic->_relativePosition.x * scriptToScreenX).toInt() - originX, 0); // TODO: This is weird. int deltaX = plane._planeRect.width() - temp.right - 1 - temp.left; @@ -380,9 +380,9 @@ void ScreenItem::calcRects(const Plane &plane) { } else { // low resolution coordinates - int displaceX = celObj._displace.x; + int originX = celObj._origin.x; if (_mirrorX != celObj._mirrorX && _celInfo.type != kCelTypePic) { - displaceX = celObj._width - celObj._displace.x - 1; + originX = celObj._width - celObj._origin.x - 1; } if (!scaleX.isOne() || !scaleY.isOne()) { @@ -394,8 +394,8 @@ void ScreenItem::calcRects(const Plane &plane) { _screenItemRect.bottom -= 1; } - _scaledPosition.x = _position.x - (displaceX * scaleX).toInt(); - _scaledPosition.y = _position.y - (celObj._displace.y * scaleY).toInt(); + _scaledPosition.x = _position.x - (originX * scaleX).toInt(); + _scaledPosition.y = _position.y - (celObj._origin.y * scaleY).toInt(); _screenItemRect.translate(_scaledPosition.x, _scaledPosition.y); if (_mirrorX != celObj._mirrorX && _celInfo.type == kCelTypePic) { @@ -410,7 +410,7 @@ void ScreenItem::calcRects(const Plane &plane) { if (celObjPic == nullptr) { error("Expected a CelObjPic"); } - temp.translate(celObjPic->_relativePosition.x - (displaceX * scaleX).toInt(), celObjPic->_relativePosition.y - (celObj._displace.y * scaleY).toInt()); + temp.translate(celObjPic->_relativePosition.x - (originX * scaleX).toInt(), celObjPic->_relativePosition.y - (celObj._origin.y * scaleY).toInt()); // TODO: This is weird. int deltaX = plane._gameRect.width() - temp.right - 1 - temp.left; @@ -423,7 +423,7 @@ void ScreenItem::calcRects(const Plane &plane) { _scaledPosition.y += plane._gameRect.top; _screenItemRect.translate(plane._gameRect.left, plane._gameRect.top); - if (celObj._scaledWidth != screenWidth || celObj._scaledHeight != screenHeight) { + if (celObj._xResolution != screenWidth || celObj._yResolution != screenHeight) { mulru(_scaledPosition, celToScreenX, celToScreenY); mulru(_screenItemRect, celToScreenX, celToScreenY, 1); } @@ -517,11 +517,11 @@ void ScreenItem::printDebugInfo(Console *con) const { _celInfo.color ); if (_celObj != nullptr) { - con->debugPrintf(" width %d, height %d, scaledWidth %d, scaledHeight %d\n", + con->debugPrintf(" width %d, height %d, x-resolution %d, y-resolution %d\n", _celObj->_width, _celObj->_height, - _celObj->_scaledWidth, - _celObj->_scaledHeight + _celObj->_xResolution, + _celObj->_yResolution ); } } @@ -603,19 +603,19 @@ Common::Rect ScreenItem::getNowSeenRect(const Plane &plane) const { return Common::Rect(); } - int16 displaceX = celObj._displace.x; - int16 displaceY = celObj._displace.y; + int16 originX = celObj._origin.x; + int16 originY = celObj._origin.y; if (_mirrorX != celObj._mirrorX && _celInfo.type != kCelTypePic) { - displaceX = celObj._width - displaceX - 1; + originX = celObj._width - originX - 1; } - if (celObj._scaledWidth != kLowResX || celObj._scaledHeight != kLowResY) { + if (celObj._xResolution != kLowResX || celObj._yResolution != kLowResY) { // high resolution coordinates if (_useInsetRect) { - Ratio scriptToCelX(celObj._scaledWidth, scriptWidth); - Ratio scriptToCelY(celObj._scaledHeight, scriptHeight); + Ratio scriptToCelX(celObj._xResolution, scriptWidth); + Ratio scriptToCelY(celObj._yResolution, scriptHeight); mulru(nsRect, scriptToCelX, scriptToCelY, 0); if (nsRect.intersects(celObjRect)) { @@ -656,14 +656,14 @@ Common::Rect ScreenItem::getNowSeenRect(const Plane &plane) const { } } - Ratio celToScriptX(scriptWidth, celObj._scaledWidth); - Ratio celToScriptY(scriptHeight, celObj._scaledHeight); + Ratio celToScriptX(scriptWidth, celObj._xResolution); + Ratio celToScriptY(scriptHeight, celObj._yResolution); - displaceX = (displaceX * scaleX * celToScriptX).toInt(); - displaceY = (displaceY * scaleY * celToScriptY).toInt(); + originX = (originX * scaleX * celToScriptX).toInt(); + originY = (originY * scaleY * celToScriptY).toInt(); mulinc(nsRect, celToScriptX, celToScriptY); - nsRect.translate(_position.x - displaceX, _position.y - displaceY); + nsRect.translate(_position.x - originX, _position.y - originY); } else { // low resolution coordinates @@ -676,9 +676,9 @@ Common::Rect ScreenItem::getNowSeenRect(const Plane &plane) const { nsRect.bottom -= 1; } - displaceX = (displaceX * scaleX).toInt(); - displaceY = (displaceY * scaleY).toInt(); - nsRect.translate(_position.x - displaceX, _position.y - displaceY); + originX = (originX * scaleX).toInt(); + originY = (originY * scaleY).toInt(); + nsRect.translate(_position.x - originX, _position.y - originY); if (_mirrorX != celObj._mirrorX && _celInfo.type != kCelTypePic) { nsRect.translate(plane._gameRect.width() - nsRect.width(), 0); diff --git a/engines/sci/graphics/text32.cpp b/engines/sci/graphics/text32.cpp index 254c7d92e6..d142ff75c3 100644 --- a/engines/sci/graphics/text32.cpp +++ b/engines/sci/graphics/text32.cpp @@ -39,8 +39,8 @@ namespace Sci { int16 GfxText32::_defaultFontId = 0; -int16 GfxText32::_scaledWidth = 0; -int16 GfxText32::_scaledHeight = 0; +int16 GfxText32::_xResolution = 0; +int16 GfxText32::_yResolution = 0; GfxText32::GfxText32(SegManager *segMan, GfxCache *fonts) : _segMan(segMan), @@ -52,10 +52,10 @@ GfxText32::GfxText32(SegManager *segMan, GfxCache *fonts) : _fontId = _defaultFontId; _font = _cache->getFont(_defaultFontId); - if (_scaledWidth == 0) { + if (_xResolution == 0) { // initialize the statics - _scaledWidth = g_sci->_gfxFrameout->getCurrentBuffer().scriptWidth; - _scaledHeight = g_sci->_gfxFrameout->getCurrentBuffer().scriptHeight; + _xResolution = g_sci->_gfxFrameout->getCurrentBuffer().scriptWidth; + _yResolution = g_sci->_gfxFrameout->getCurrentBuffer().scriptHeight; } } @@ -78,8 +78,8 @@ reg_t GfxText32::createFontBitmap(int16 width, int16 height, const Common::Rect int16 scriptWidth = g_sci->_gfxFrameout->getCurrentBuffer().scriptWidth; int16 scriptHeight = g_sci->_gfxFrameout->getCurrentBuffer().scriptHeight; - Ratio scaleX(_scaledWidth, scriptWidth); - Ratio scaleY(_scaledHeight, scriptHeight); + Ratio scaleX(_xResolution, scriptWidth); + Ratio scaleY(_yResolution, scriptHeight); _width = (_width * scaleX).toInt(); _height = (_height * scaleY).toInt(); @@ -96,7 +96,7 @@ reg_t GfxText32::createFontBitmap(int16 width, int16 height, const Common::Rect _textRect = Common::Rect(); } - _segMan->allocateBitmap(&_bitmap, _width, _height, _skipColor, 0, 0, _scaledWidth, _scaledHeight, 0, false, gc); + _segMan->allocateBitmap(&_bitmap, _width, _height, _skipColor, 0, 0, _xResolution, _yResolution, 0, false, gc); erase(bitmapRect, false); @@ -120,12 +120,12 @@ reg_t GfxText32::createFontBitmap(const CelInfo32 &celInfo, const Common::Rect & int16 scriptWidth = g_sci->_gfxFrameout->getCurrentBuffer().scriptWidth; int16 scriptHeight = g_sci->_gfxFrameout->getCurrentBuffer().scriptHeight; - mulinc(_textRect, Ratio(_scaledWidth, scriptWidth), Ratio(_scaledHeight, scriptHeight)); + mulinc(_textRect, Ratio(_xResolution, scriptWidth), Ratio(_yResolution, scriptHeight)); CelObjView view(celInfo.resourceId, celInfo.loopNo, celInfo.celNo); - _skipColor = view._transparentColor; - _width = view._width * _scaledWidth / view._scaledWidth; - _height = view._height * _scaledHeight / view._scaledHeight; + _skipColor = view._skipColor; + _width = view._width * _xResolution / view._xResolution; + _height = view._height * _yResolution / view._yResolution; Common::Rect bitmapRect(_width, _height); if (_textRect.intersects(bitmapRect)) { @@ -134,7 +134,7 @@ reg_t GfxText32::createFontBitmap(const CelInfo32 &celInfo, const Common::Rect & _textRect = Common::Rect(); } - SciBitmap &bitmap = *_segMan->allocateBitmap(&_bitmap, _width, _height, _skipColor, 0, 0, _scaledWidth, _scaledHeight, 0, false, gc); + SciBitmap &bitmap = *_segMan->allocateBitmap(&_bitmap, _width, _height, _skipColor, 0, 0, _xResolution, _yResolution, 0, false, gc); // NOTE: The engine filled the bitmap pixels with 11 here, which is silly // because then it just erased the bitmap using the skip color. So we don't @@ -144,7 +144,7 @@ reg_t GfxText32::createFontBitmap(const CelInfo32 &celInfo, const Common::Rect & erase(bitmapRect, false); _backColor = backColor; - view.draw(bitmap.getBuffer(), bitmapRect, Common::Point(0, 0), false, Ratio(_scaledWidth, view._scaledWidth), Ratio(_scaledHeight, view._scaledHeight)); + view.draw(bitmap.getBuffer(), bitmapRect, Common::Point(0, 0), false, Ratio(_xResolution, view._xResolution), Ratio(_yResolution, view._yResolution)); if (_backColor != skipColor && _foreColor != skipColor) { erase(_textRect, false); @@ -332,7 +332,7 @@ void GfxText32::drawText(const uint index, uint length) { void GfxText32::invertRect(const reg_t bitmapId, int16 bitmapStride, const Common::Rect &rect, const uint8 foreColor, const uint8 backColor, const bool doScaling) { Common::Rect targetRect = rect; if (doScaling) { - bitmapStride = bitmapStride * _scaledWidth / g_sci->_gfxFrameout->getCurrentBuffer().scriptWidth; + bitmapStride = bitmapStride * _xResolution / g_sci->_gfxFrameout->getCurrentBuffer().scriptWidth; targetRect = scaleRect(rect); } @@ -557,13 +557,13 @@ Common::Rect GfxText32::getTextSize(const Common::String &text, int16 maxWidth, int16 scriptWidth = g_sci->_gfxFrameout->getCurrentBuffer().scriptWidth; int16 scriptHeight = g_sci->_gfxFrameout->getCurrentBuffer().scriptHeight; - maxWidth = maxWidth * _scaledWidth / scriptWidth; + maxWidth = maxWidth * _xResolution / scriptWidth; _text = text; if (maxWidth >= 0) { if (maxWidth == 0) { - maxWidth = _scaledWidth * 3 / 5; + maxWidth = _xResolution * 3 / 5; } result.right = maxWidth; @@ -606,8 +606,8 @@ Common::Rect GfxText32::getTextSize(const Common::String &text, int16 maxWidth, if (doScaling) { // NOTE: The original engine code also scaled top/left but these are // always zero so there is no reason to do that. - result.right = ((result.right - 1) * scriptWidth + _scaledWidth - 1) / _scaledWidth + 1; - result.bottom = ((result.bottom - 1) * scriptHeight + _scaledHeight - 1) / _scaledHeight + 1; + result.right = ((result.right - 1) * scriptWidth + _xResolution - 1) / _xResolution + 1; + result.bottom = ((result.bottom - 1) * scriptHeight + _yResolution - 1) / _yResolution + 1; } return result; @@ -630,7 +630,7 @@ int16 GfxText32::getTextCount(const Common::String &text, const uint index, cons Common::Rect scaledRect(textRect); if (doScaling) { - mulinc(scaledRect, Ratio(_scaledWidth, scriptWidth), Ratio(_scaledHeight, scriptHeight)); + mulinc(scaledRect, Ratio(_xResolution, scriptWidth), Ratio(_yResolution, scriptHeight)); } Common::String oldText = _text; diff --git a/engines/sci/graphics/text32.h b/engines/sci/graphics/text32.h index 44bd48afd5..c4521a4f56 100644 --- a/engines/sci/graphics/text32.h +++ b/engines/sci/graphics/text32.h @@ -151,8 +151,8 @@ private: Common::Rect scaledRect(rect); int16 scriptWidth = g_sci->_gfxFrameout->getCurrentBuffer().scriptWidth; int16 scriptHeight = g_sci->_gfxFrameout->getCurrentBuffer().scriptHeight; - Ratio scaleX(_scaledWidth, scriptWidth); - Ratio scaleY(_scaledHeight, scriptHeight); + Ratio scaleX(_xResolution, scriptWidth); + Ratio scaleY(_yResolution, scriptHeight); mulinc(scaledRect, scaleX, scaleY); return scaledRect; } @@ -169,13 +169,13 @@ public: * The size of the x-dimension of the coordinate system * used by the text renderer. Static since it was global in SSCI. */ - static int16 _scaledWidth; + static int16 _xResolution; /** * The size of the y-dimension of the coordinate system * used by the text renderer. Static since it was global in SSCI. */ - static int16 _scaledHeight; + static int16 _yResolution; /** * The currently active font resource used to write text @@ -199,12 +199,12 @@ public: inline int scaleUpWidth(int value) const { const int scriptWidth = g_sci->_gfxFrameout->getCurrentBuffer().scriptWidth; - return (value * scriptWidth + _scaledWidth - 1) / _scaledWidth; + return (value * scriptWidth + _xResolution - 1) / _xResolution; } inline int scaleUpHeight(int value) const { const int scriptHeight = g_sci->_gfxFrameout->getCurrentBuffer().scriptHeight; - return (value * scriptHeight + _scaledHeight - 1) / _scaledHeight; + return (value * scriptHeight + _yResolution - 1) / _yResolution; } /** diff --git a/engines/sci/video/robot_decoder.cpp b/engines/sci/video/robot_decoder.cpp index 0426dd0dac..446b986581 100644 --- a/engines/sci/video/robot_decoder.cpp +++ b/engines/sci/video/robot_decoder.cpp @@ -703,7 +703,7 @@ void RobotDecoder::showFrame(const uint16 frameNo, const uint16 newX, const uint const int16 lowResX = (scaledX * screenToLowResX).toInt(); const int16 lowResY = (scaledY2 * screenToLowResY).toInt(); - bitmap.setDisplace(Common::Point( + bitmap.setOrigin(Common::Point( (scaledX - (lowResX * lowResToScreenX).toInt()) * -1, (lowResY * lowResToScreenY).toInt() - scaledY1 )); @@ -713,7 +713,7 @@ void RobotDecoder::showFrame(const uint16 frameNo, const uint16 newX, const uint } else { const int16 scaledX = _originalScreenItemX[i] + _position.x; const int16 scaledY = _originalScreenItemY[i] + _position.y + bitmap.getHeight() - 1; - bitmap.setDisplace(Common::Point(0, bitmap.getHeight() - 1)); + bitmap.setOrigin(Common::Point(0, bitmap.getHeight() - 1)); _screenItemX[i] = scaledX; _screenItemY[i] = scaledY; } @@ -1461,7 +1461,7 @@ uint32 RobotDecoder::createCel5(const byte *rawVideoData, const int16 screenItem const int16 screenWidth = g_sci->_gfxFrameout->getCurrentBuffer().screenWidth; const int16 screenHeight = g_sci->_gfxFrameout->getCurrentBuffer().screenHeight; - Common::Point displace; + Common::Point origin; if (scriptWidth == kLowResX && scriptHeight == kLowResY) { const Ratio lowResToScreenX(screenWidth, kLowResX); const Ratio lowResToScreenY(screenHeight, kLowResY); @@ -1475,22 +1475,22 @@ uint32 RobotDecoder::createCel5(const byte *rawVideoData, const int16 screenItem const int16 lowResX = (scaledX * screenToLowResX).toInt(); const int16 lowResY = (scaledY2 * screenToLowResY).toInt(); - displace.x = (scaledX - (lowResX * lowResToScreenX).toInt()) * -1; - displace.y = (lowResY * lowResToScreenY).toInt() - scaledY1; + origin.x = (scaledX - (lowResX * lowResToScreenX).toInt()) * -1; + origin.y = (lowResY * lowResToScreenY).toInt() - scaledY1; _screenItemX[screenItemIndex] = lowResX; _screenItemY[screenItemIndex] = lowResY; - debugC(kDebugLevelVideo, "Low resolution position c: %d %d l: %d/%d %d/%d d: %d %d s: %d/%d %d/%d x: %d y: %d", celPosition.x, celPosition.y, lowResX, scriptWidth, lowResY, scriptHeight, displace.x, displace.y, scaledX, screenWidth, scaledY2, screenHeight, scaledX - displace.x, scaledY2 - displace.y); + debugC(kDebugLevelVideo, "Low resolution position c: %d %d l: %d/%d %d/%d d: %d %d s: %d/%d %d/%d x: %d y: %d", celPosition.x, celPosition.y, lowResX, scriptWidth, lowResY, scriptHeight, origin.x, origin.y, scaledX, screenWidth, scaledY2, screenHeight, scaledX - origin.x, scaledY2 - origin.y); } else { const int16 highResX = celPosition.x + _position.x; const int16 highResY = celPosition.y + _position.y + celHeight - 1; - displace.x = 0; - displace.y = celHeight - 1; + origin.x = 0; + origin.y = celHeight - 1; _screenItemX[screenItemIndex] = highResX; _screenItemY[screenItemIndex] = highResY; - debugC(kDebugLevelVideo, "High resolution position c: %d %d s: %d %d d: %d %d", celPosition.x, celPosition.y, highResX, highResY, displace.x, displace.y); + debugC(kDebugLevelVideo, "High resolution position c: %d %d s: %d %d d: %d %d", celPosition.x, celPosition.y, highResX, highResY, origin.x, origin.y); } _originalScreenItemX[screenItemIndex] = celPosition.x; @@ -1500,9 +1500,9 @@ uint32 RobotDecoder::createCel5(const byte *rawVideoData, const int16 screenItem SciBitmap &bitmap = *_segMan->lookupBitmap(_celHandles[screenItemIndex].bitmapId); assert(bitmap.getWidth() == celWidth && bitmap.getHeight() == celHeight); - assert(bitmap.getScaledWidth() == _xResolution && bitmap.getScaledHeight() == _yResolution); + assert(bitmap.getXResolution() == _xResolution && bitmap.getYResolution() == _yResolution); assert(bitmap.getHunkPaletteOffset() == (uint32)bitmap.getWidth() * bitmap.getHeight() + SciBitmap::getBitmapHeaderSize()); - bitmap.setDisplace(displace); + bitmap.setOrigin(origin); byte *targetBuffer = nullptr; if (_verticalScaleFactor == 100) { -- cgit v1.2.3