mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-11 03:34:13 +00:00
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
This commit is contained in:
parent
7e86b215bb
commit
160c4f9104
@ -287,6 +287,9 @@ void OSystem_SDL_Common::add_dirty_rect(int x, int y, int w, int h) {
|
||||
h = _screenHeight - y;
|
||||
}
|
||||
|
||||
if (_adjustAspectRatio)
|
||||
makeRectStretchable(x, y, w, h);
|
||||
|
||||
r->x = x;
|
||||
r->y = y;
|
||||
r->w = w;
|
||||
|
@ -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
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user