diff options
Diffstat (limited to 'common')
| -rw-r--r-- | common/scaler.cpp | 12 | ||||
| -rw-r--r-- | common/scaler.h | 2 |
2 files changed, 14 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 diff --git a/common/scaler.h b/common/scaler.h index b8000ddccd..2c1b73b9d0 100644 --- a/common/scaler.h +++ b/common/scaler.h @@ -49,6 +49,8 @@ FORCEINLINE int aspect2Real(int y) { return (y * 5 + 3) / 6; } +extern void makeRectStretchable(int &x, int &y, int &w, int &h); + extern int stretch200To240(uint8 *buf, uint32 pitch, int width, int height, int srcX, int srcY, int origSrcY); enum { |
