aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine
diff options
context:
space:
mode:
Diffstat (limited to 'engines/sci/engine')
-rw-r--r--engines/sci/engine/kernel.h2
-rw-r--r--engines/sci/engine/kernel_tables.h2
-rw-r--r--engines/sci/engine/kgraphics32.cpp46
-rw-r--r--engines/sci/engine/seg_manager.cpp4
-rw-r--r--engines/sci/engine/seg_manager.h2
-rw-r--r--engines/sci/engine/segment.h28
6 files changed, 42 insertions, 42 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);
}
}