Still, I think my cleaner variant is valid, and that the pixels outside of the real image area don't have to be cleared.
[/edit]
In graphics.c, line 233:
Code: Select all
int size = image->textureWidth * image->textureWidth;
Code: Select all
int size = image->imageWidth * image->imageHeight;
In fact, I'd suggest a cleaner (IMHO) variant like the following:
Code: Select all
void clearImage(Color color, Image* image)
{
Color *data = image->data;
Color *end = data + (image->imageWidth * image->imageHeight);
do *data = color; while(++data < end);
}