Use memset rather than a loop to set memory to a fixed value
This commit is contained in:
@@ -216,13 +216,10 @@ unsigned char *InitAlpha(wxImage *image, png_uint_32 x, png_uint_32 y)
|
|||||||
|
|
||||||
// set alpha for the pixels we had so far
|
// set alpha for the pixels we had so far
|
||||||
png_uint_32 end = y * image->GetWidth() + x;
|
png_uint_32 end = y * image->GetWidth() + x;
|
||||||
for ( png_uint_32 i = 0; i < end; i++ )
|
// all the previous pixels were opaque
|
||||||
{
|
memset(alpha, 0xff, end);
|
||||||
// all the previous pixels were opaque
|
|
||||||
*alpha++ = 0xff;
|
|
||||||
}
|
|
||||||
|
|
||||||
return alpha;
|
return alpha + end;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
Reference in New Issue
Block a user