1
0
mirror of https://github.com/FunkyFr3sh/cnc-ddraw.git synced 2025-03-25 10:07:47 +01:00

experimental colorkey blitter test code

This commit is contained in:
FunkyFr3sh 2022-09-06 10:30:51 +02:00
parent a227aa17d0
commit 58cb1e0a04

View File

@ -244,6 +244,62 @@ HRESULT dds_Blt(
unsigned char key_low = (unsigned char)color_key.dwColorSpaceLowValue;
unsigned char key_high = (unsigned char)color_key.dwColorSpaceHighValue;
/*
if (src_w == dst_w && src_h == dst_h && !mirror_left_right && !mirror_up_down)
{
unsigned char* src =
(unsigned char*)src_buf + (src_x * src_surface->lx_pitch) + (src_surface->l_pitch * src_y);
unsigned char* dst =
(unsigned char*)dst_buf + (dst_x * This->lx_pitch) + (This->l_pitch * dst_y);
unsigned int dst_p = This->l_pitch - (dst_w * This->lx_pitch);
unsigned int src_p = src_surface->l_pitch - (dst_w * src_surface->lx_pitch);
if (key_low == key_high)
{
for (int y = 0; y < dst_h; y++)
{
for (int x = 0; x < dst_w; x++)
{
unsigned char c = *src++;
if (c != key_low)
{
*dst = c;
}
dst++;
}
src += src_p;
dst += dst_p;
}
}
else
{
for (int i = 0; i < dst_h; i++)
{
for (int x = 0; x < dst_w; x++)
{
unsigned char c = *src++;
if (c < key_low || c > key_high)
{
*dst = c;
}
dst++;
}
src += src_p;
dst += dst_p;
}
}
}
else
{
*/
for (int y = 0; y < dst_h; y++)
{
int scaled_y = (int)(y * scale_h);
@ -269,6 +325,7 @@ HRESULT dds_Blt(
}
}
}
//}
}
else if (This->bpp == 16)
{