aboutsummaryrefslogtreecommitdiff
path: root/common/scaler.cpp
diff options
context:
space:
mode:
authorMax Horn2003-06-22 17:32:50 +0000
committerMax Horn2003-06-22 17:32:50 +0000
commit71ea8f7228eb21a5a9b552ed858f989a14bf6205 (patch)
treeab1cb705d2debf2fb3985b03a97cb527a09303b0 /common/scaler.cpp
parent31bdf9f45001bb3d9aeb15ed714e3a4c898ff45d (diff)
downloadscummvm-rg350-71ea8f7228eb21a5a9b552ed858f989a14bf6205.tar.gz
scummvm-rg350-71ea8f7228eb21a5a9b552ed858f989a14bf6205.tar.bz2
scummvm-rg350-71ea8f7228eb21a5a9b552ed858f989a14bf6205.zip
fix the inaccurate version of interpolate5Line to work correctly for odd widths
svn-id: r8628
Diffstat (limited to 'common/scaler.cpp')
-rw-r--r--common/scaler.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/common/scaler.cpp b/common/scaler.cpp
index 1252a61866..cea445466e 100644
--- a/common/scaler.cpp
+++ b/common/scaler.cpp
@@ -666,6 +666,19 @@ static inline void interpolate5Line(uint16 *dst, const uint16 *srcA, const uint1
}
#else
// Not fully accurate, but a bit faster
+
+ if (width & 1) {
+ // For efficency reasons we normally blit two pixels at a time; but if the
+ // width is odd, we first blit a single pixel.
+ width--;
+ if (scale == 1) {
+ uint32 B = *srcB++;
+ *dst++ = (uint16)Q_INTERPOLATE(*srcA++, B, B, B);
+ } else {
+ *dst++ = (uint16)INTERPOLATE(*srcA++, *srcB++);
+ }
+ }
+
width /= 2;
const uint32 *sA = (const uint32 *)srcA;
const uint32 *sB = (const uint32 *)srcB;