aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Snover2016-03-13 14:35:09 -0500
committerColin Snover2016-03-13 22:28:39 -0500
commitbfd7e4e7842863da67d3cd1dc670f7229ee935c3 (patch)
tree3cb7068c3863b2b0b4be517fb789c96296d63347
parentea81d2141750575c077c6145a8307c589dd3fd29 (diff)
downloadscummvm-rg350-bfd7e4e7842863da67d3cd1dc670f7229ee935c3.tar.gz
scummvm-rg350-bfd7e4e7842863da67d3cd1dc670f7229ee935c3.tar.bz2
scummvm-rg350-bfd7e4e7842863da67d3cd1dc670f7229ee935c3.zip
Revert "SCI32: Fix small inaccuracy in the scaling drawing code"
This reverts commit d85eb8ded68a20de383d84064aacd1a4c81db4e9. This patch did not correctly fix the scaler to follow the same rules as SSCI and only worked on the y-axis.
-rw-r--r--engines/sci/graphics/celobj32.cpp15
1 files changed, 6 insertions, 9 deletions
diff --git a/engines/sci/graphics/celobj32.cpp b/engines/sci/graphics/celobj32.cpp
index acf499308a..389270ec42 100644
--- a/engines/sci/graphics/celobj32.cpp
+++ b/engines/sci/graphics/celobj32.cpp
@@ -117,8 +117,8 @@ struct SCALER_NoScale {
_reader(celObj, FLIP ? celObj._width : maxWidth),
_lastIndex(celObj._width - 1) {}
- inline void setSource(const int16 x, const int16 targetY, const int16 scaledPosY) {
- _row = _reader.getRow(targetY - scaledPosY);
+ inline void setSource(const int16 x, const int16 y) {
+ _row = _reader.getRow(y);
if (FLIP) {
_row += _lastIndex - x;
@@ -153,11 +153,8 @@ struct SCALER_Scale {
_table(CelObj::_scaler->getScalerTable(scaleX, scaleY)),
_lastIndex(maxWidth - 1) {}
- inline void setSource(const int16 x, const int16 targetY, const int16 scaledPosY) {
- // look up both targetY + scaledPosY in here, only subtract afterwards
- // otherwise y won't be correct all the time when uneven scaling is used (for example 5:12)
- int16 y = _table->valuesY[targetY] - _table->valuesY[scaledPosY];
- _row = _reader.getRow(y);
+ inline void setSource(const int16 x, const int16 y) {
+ _row = _reader.getRow(_table->valuesY[y]);
if (FLIP) {
_x = _lastIndex - x;
} else {
@@ -578,7 +575,7 @@ struct RENDERER {
inline void draw(Buffer &target, const Common::Rect &targetRect, const Common::Point &scaledPosition) const {
const int16 sourceX = targetRect.left - scaledPosition.x;
- //const int16 sourceY = targetRect.top - scaledPosition.y;
+ const int16 sourceY = targetRect.top - scaledPosition.y;
byte *targetPixel = (byte *)target.getPixels() + target.screenWidth * targetRect.top + targetRect.left;
@@ -586,7 +583,7 @@ struct RENDERER {
const int16 targetWidth = targetRect.width();
const int16 targetHeight = targetRect.height();
for (int y = 0; y < targetHeight; ++y) {
- _scaler.setSource(sourceX, targetRect.top + y, scaledPosition.y);
+ _scaler.setSource(sourceX, sourceY + y);
for (int x = 0; x < targetWidth; ++x) {
_mapper.draw(targetPixel++, _scaler.read(), _skipColor);