Merge pull request #475 from 0lvin/for_review

Copy drawn lines if picture scaled
This commit is contained in:
Yamagi 2019-10-03 10:16:13 +02:00 committed by GitHub
commit 4e1ed93ae0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -209,6 +209,9 @@ RE_Draw_StretchPicImplementation (int x, int y, int w, int h, const image_t *pic
else
{
int v;
// size of screen tile to pic pixel
int picupscale = h / pic->height;
for (v=0 ; v<height ; v++, dest += vid.width)
{
int f, fstep, u;
@ -221,6 +224,21 @@ RE_Draw_StretchPicImplementation (int x, int y, int w, int h, const image_t *pic
dest[u] = source[f>>16];
f += fstep;
}
if (picupscale > 1)
{
int i;
pixel_t *dest_orig = dest;
// copy first line to fill whole sector
for (i=1; i < picupscale; i++)
{
// go to next line
dest += vid.width;
memcpy (dest, dest_orig, w);
}
// skip updated lines
v += (picupscale - 1);
}
}
}
}