833,8 → 833,8 |
copy_vp_to_pixmap(viewport_t *vport, pixmap_t *pmap) |
{ |
int y; |
int rowsize; |
int tmp; |
int tmp, srcrowsize; |
int realwidth, realheight, realrowsize; |
int width = vport->width; |
int height = vport->height; |
|
843,13 → 843,17 |
if (height + vport->y > screen.yres) |
height = screen.yres - vport->y; |
|
rowsize = width * screen.pixelbytes; |
realwidth = pmap->width <= width ? pmap->width : width; |
realheight = pmap->height <= height ? pmap->height : height; |
|
for (y = 0; y < height; y++) { |
srcrowsize = vport->width * screen.pixelbytes; |
realrowsize = realwidth * screen.pixelbytes; |
|
for (y = 0; y < realheight; y++) { |
tmp = (vport->y + y) * screen.scanline + |
vport->x * screen.pixelbytes; |
memcpy(pmap->data + rowsize * y, screen.fbaddress + tmp, |
rowsize); |
memcpy(pmap->data + srcrowsize * y, screen.fbaddress + tmp, |
realrowsize); |
} |
} |
|