Copy drawn lines if picture scalled

This commit is contained in:
Denis Pauk 2019-10-02 22:07:57 +03:00
parent 70a94f759f
commit de2457bb2a
1 changed files with 18 additions and 0 deletions

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);
}
}
}
}