1
0
mirror of https://github.com/FunkyFr3sh/cnc-ddraw.git synced 2025-03-15 06:04:49 +01:00

fix clip+stretch blts

This commit is contained in:
FunkyFr3sh 2022-09-29 21:27:05 +02:00
parent 4326703c71
commit eabad7582d

View File

@ -116,24 +116,30 @@ HRESULT dds_Blt(
if (dst_rect.left < 0)
{
src_rect.left += abs(dst_rect.left);
src_rect.left += (LONG)(abs(dst_rect.left) * scale_w);
dst_rect.left = 0;
}
if (dst_rect.top < 0)
{
src_rect.top += abs(dst_rect.top);
src_rect.top += (LONG)(abs(dst_rect.top) * scale_h);
dst_rect.top = 0;
}
if (dst_rect.right > This->width)
{
src_rect.right -= (LONG)((dst_rect.right - This->width) * scale_w);
dst_rect.right = This->width;
}
if (dst_rect.left > dst_rect.right)
dst_rect.left = dst_rect.right;
if (dst_rect.bottom > This->height)
{
src_rect.bottom -= (LONG)((dst_rect.bottom - This->height) * scale_h);
dst_rect.bottom = This->height;
}
if (dst_rect.top > dst_rect.bottom)
dst_rect.top = dst_rect.bottom;