mirror of
https://github.com/FunkyFr3sh/cnc-ddraw.git
synced 2025-03-25 10:07:47 +01:00
use stosb
This commit is contained in:
parent
087ccc719a
commit
ee5d236198
16
src/blt.c
16
src/blt.c
@ -392,9 +392,16 @@ void blt_colorkey_mirror_stretch(
|
||||
void blt_clear(
|
||||
unsigned char* dst,
|
||||
size_t size)
|
||||
{
|
||||
if (size >= 1024 * 200)
|
||||
{
|
||||
__stosb(dst, 0, size);
|
||||
}
|
||||
else
|
||||
{
|
||||
memset(dst, 0, size);
|
||||
}
|
||||
}
|
||||
|
||||
void blt_colorfill(
|
||||
unsigned char* dst,
|
||||
@ -421,9 +428,18 @@ void blt_colorfill(
|
||||
(color & 0xFF) == ((color >> 24) & 0xFF)))
|
||||
{
|
||||
if (size == dst_p)
|
||||
{
|
||||
size_t s = dst_p * dst_h;
|
||||
|
||||
if (s >= 1024 * 200)
|
||||
{
|
||||
__stosb(dst, color, dst_p * dst_h);
|
||||
}
|
||||
else
|
||||
{
|
||||
memset(dst, color, dst_p * dst_h);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < dst_h; i++)
|
||||
|
Loading…
x
Reference in New Issue
Block a user