mirror of
https://github.com/FunkyFr3sh/cnc-ddraw.git
synced 2025-03-24 17:49:52 +01:00
replace memcpy with blt_copy + enable AVX code
This commit is contained in:
parent
234448ebee
commit
c279682408
14
src/blt.c
14
src/blt.c
@ -11,7 +11,7 @@ void blt_copy(
|
|||||||
unsigned char* src,
|
unsigned char* src,
|
||||||
size_t size)
|
size_t size)
|
||||||
{
|
{
|
||||||
#ifdef __AVX__
|
#ifdef _MSC_VER
|
||||||
if (g_blt_use_avx && !((DWORD)dst % 32) && !((DWORD)src % 32))
|
if (g_blt_use_avx && !((DWORD)dst % 32) && !((DWORD)src % 32))
|
||||||
{
|
{
|
||||||
if (size >= 1024 * 4096)
|
if (size >= 1024 * 4096)
|
||||||
@ -110,7 +110,7 @@ void blt_clean(
|
|||||||
{
|
{
|
||||||
for (int i = 0; i < dst_h; i++)
|
for (int i = 0; i < dst_h; i++)
|
||||||
{
|
{
|
||||||
memcpy(dst, src, size);
|
blt_copy(dst, src, size);
|
||||||
|
|
||||||
src += src_p;
|
src += src_p;
|
||||||
dst += dst_p;
|
dst += dst_p;
|
||||||
@ -530,7 +530,7 @@ void blt_colorfill(
|
|||||||
for (int i = 1; i < dst_h; i++)
|
for (int i = 1; i < dst_h; i++)
|
||||||
{
|
{
|
||||||
dst += dst_p;
|
dst += dst_p;
|
||||||
memcpy(dst, first_row, size);
|
blt_copy(dst, first_row, size);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (bpp == 32)
|
else if (bpp == 32)
|
||||||
@ -545,7 +545,7 @@ void blt_colorfill(
|
|||||||
for (int i = 1; i < dst_h; i++)
|
for (int i = 1; i < dst_h; i++)
|
||||||
{
|
{
|
||||||
dst += dst_p;
|
dst += dst_p;
|
||||||
memcpy(dst, first_row, size);
|
blt_copy(dst, first_row, size);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -662,7 +662,7 @@ void blt_stretch(
|
|||||||
|
|
||||||
if (scaled_y == last_y)
|
if (scaled_y == last_y)
|
||||||
{
|
{
|
||||||
memcpy(&d[dst_row], &d[last_row], size);
|
blt_copy(&d[dst_row], &d[last_row], size);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -691,7 +691,7 @@ void blt_stretch(
|
|||||||
|
|
||||||
if (scaled_y == last_y)
|
if (scaled_y == last_y)
|
||||||
{
|
{
|
||||||
memcpy(&d[dst_row], &d[last_row], size);
|
blt_copy(&d[dst_row], &d[last_row], size);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -720,7 +720,7 @@ void blt_stretch(
|
|||||||
|
|
||||||
if (scaled_y == last_y)
|
if (scaled_y == last_y)
|
||||||
{
|
{
|
||||||
memcpy(&d[dst_row], &d[last_row], size);
|
blt_copy(&d[dst_row], &d[last_row], size);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user