mirror of
https://github.com/FunkyFr3sh/cnc-ddraw.git
synced 2025-03-24 17:49:52 +01:00
#178 fix blt/bltfast clipping
This commit is contained in:
parent
cd5efade5d
commit
fe82a8a607
@ -115,12 +115,18 @@ HRESULT dds_Blt(
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
if (dst_rect.right < 0)
|
||||||
|
dst_rect.right = 0;
|
||||||
|
|
||||||
if (dst_rect.left < 0)
|
if (dst_rect.left < 0)
|
||||||
{
|
{
|
||||||
src_rect.left += (LONG)(abs(dst_rect.left) * scale_w);
|
src_rect.left += (LONG)(abs(dst_rect.left) * scale_w);
|
||||||
dst_rect.left = 0;
|
dst_rect.left = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (dst_rect.bottom < 0)
|
||||||
|
dst_rect.bottom = 0;
|
||||||
|
|
||||||
if (dst_rect.top < 0)
|
if (dst_rect.top < 0)
|
||||||
{
|
{
|
||||||
src_rect.top += (LONG)(abs(dst_rect.top) * scale_h);
|
src_rect.top += (LONG)(abs(dst_rect.top) * scale_h);
|
||||||
@ -147,9 +153,15 @@ HRESULT dds_Blt(
|
|||||||
|
|
||||||
if (src_surface)
|
if (src_surface)
|
||||||
{
|
{
|
||||||
|
if (src_rect.right < 0)
|
||||||
|
src_rect.right = 0;
|
||||||
|
|
||||||
if (src_rect.left < 0)
|
if (src_rect.left < 0)
|
||||||
src_rect.left = 0;
|
src_rect.left = 0;
|
||||||
|
|
||||||
|
if (src_rect.bottom < 0)
|
||||||
|
src_rect.bottom = 0;
|
||||||
|
|
||||||
if (src_rect.top < 0)
|
if (src_rect.top < 0)
|
||||||
src_rect.top = 0;
|
src_rect.top = 0;
|
||||||
|
|
||||||
@ -439,9 +451,15 @@ HRESULT dds_BltFast(
|
|||||||
|
|
||||||
if (src_surface)
|
if (src_surface)
|
||||||
{
|
{
|
||||||
|
if (src_rect.right < 0)
|
||||||
|
src_rect.right = 0;
|
||||||
|
|
||||||
if (src_rect.left < 0)
|
if (src_rect.left < 0)
|
||||||
src_rect.left = 0;
|
src_rect.left = 0;
|
||||||
|
|
||||||
|
if (src_rect.bottom < 0)
|
||||||
|
src_rect.bottom = 0;
|
||||||
|
|
||||||
if (src_rect.top < 0)
|
if (src_rect.top < 0)
|
||||||
src_rect.top = 0;
|
src_rect.top = 0;
|
||||||
|
|
||||||
@ -463,9 +481,15 @@ HRESULT dds_BltFast(
|
|||||||
|
|
||||||
RECT dst_rect = { dst_x, dst_y, (src_rect.right - src_rect.left) + dst_x, (src_rect.bottom - src_rect.top) + dst_y };
|
RECT dst_rect = { dst_x, dst_y, (src_rect.right - src_rect.left) + dst_x, (src_rect.bottom - src_rect.top) + dst_y };
|
||||||
|
|
||||||
|
if (dst_rect.right < 0)
|
||||||
|
dst_rect.right = 0;
|
||||||
|
|
||||||
if (dst_rect.left < 0)
|
if (dst_rect.left < 0)
|
||||||
dst_rect.left = 0;
|
dst_rect.left = 0;
|
||||||
|
|
||||||
|
if (dst_rect.bottom < 0)
|
||||||
|
dst_rect.bottom = 0;
|
||||||
|
|
||||||
if (dst_rect.top < 0)
|
if (dst_rect.top < 0)
|
||||||
dst_rect.top = 0;
|
dst_rect.top = 0;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user