diff options
author | Torbjörn Andersson | 2003-06-22 14:59:21 +0000 |
---|---|---|
committer | Torbjörn Andersson | 2003-06-22 14:59:21 +0000 |
commit | 160c4f910404dcfaad86b5ad238391c75a2d5182 (patch) | |
tree | 43b990fab909af2330cd47ac6dabb742a71ca81a /common/scaler.cpp | |
parent | 7e86b215bbf0fd5e016bbc2fc340039690e682cd (diff) | |
download | scummvm-rg350-160c4f910404dcfaad86b5ad238391c75a2d5182.tar.gz scummvm-rg350-160c4f910404dcfaad86b5ad238391c75a2d5182.tar.bz2 scummvm-rg350-160c4f910404dcfaad86b5ad238391c75a2d5182.zip |
Fixed the last (?) glitches around the mouse cursor [*] in aspect-ratio
correction mode by making sure that dirty rects always start on a line
that won't have its colours changed by the stretching function. This was
probably only noticeable when using the 1x scaler.
[*] Actually, the glitches weren't specific to the mouse cursor, but it was
useful for triggering them.
svn-id: r8621
Diffstat (limited to 'common/scaler.cpp')
-rw-r--r-- | common/scaler.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/common/scaler.cpp b/common/scaler.cpp index 65c4380266..a0a49ad5eb 100644 --- a/common/scaler.cpp +++ b/common/scaler.cpp @@ -683,6 +683,18 @@ static inline void interpolate5Line(uint16 *dst, const uint16 *srcA, const uint1 #endif } +void makeRectStretchable(int &x, int &y, int &w, int &h) { + int m = real2Aspect(y) % 6; + + // Ensure that the rect will start on a line that won't have its + // colours changed by the stretching function. + + if (m != 0 && m != 5) { + y -= m; + h += m; + } +} + /** * Stretch a 16bpp image vertically by factor 1.2. Used to correct the * aspect-ratio in games using 320x200 pixel graphics with non-qudratic |