mirror of
https://github.com/gryf/wmaker.git
synced 2026-10-09 03:02:30 +02:00
fixed image clearing
This commit is contained in:
1 parent
0f9aa277c1
commit
b974bd7e78
4 files changed
+52
-9
No files matched your search
@@ -91,6 +91,33 @@ RBevelImage(RImage *image, int bevel_type)
|
||||
void
|
||||
RClearImage(RImage *image, RColor *color)
|
||||
{
|
||||
if (image->format == RRGBAFormat) {
|
||||
unsigned char *d = image->data;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < image->width; i++) {
|
||||
*d++ = color->red;
|
||||
*d++ = color->green;
|
||||
*d++ = color->blue;
|
||||
*d++ = color->alpha;
|
||||
}
|
||||
for (i = 1; i < image->height; i++, d += image->width*4) {
|
||||
memcpy(d, image->data, image->width*4);
|
||||
}
|
||||
} else {
|
||||
unsigned char *d = image->data;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < image->width; i++) {
|
||||
*d++ = color->red;
|
||||
*d++ = color->green;
|
||||
*d++ = color->blue;
|
||||
}
|
||||
for (i = 1; i < image->height; i++, d += image->width*3) {
|
||||
memcpy(d, image->data, image->width*3);
|
||||
}
|
||||
}
|
||||
#if 0
|
||||
if (color->alpha==255) {
|
||||
if (image->format == RRGBAFormat) {
|
||||
unsigned char *d = image->data;
|
||||
@@ -144,6 +171,7 @@ RClearImage(RImage *image, RColor *color)
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
const char*
|
||||
|
||||
Reference in new issue
Block a user