Update textures.c
This commit is contained in:
parent
d0e9228660
commit
87592e2625
1 changed files with 4 additions and 4 deletions
|
@ -1111,12 +1111,12 @@ void ImageAlphaClear(Image *image, Color color, float threshold)
|
||||||
for (int i = 0; i < image->width*image->height; i++) if (pixels[i].a <= (unsigned char)(threshold*255.0f)) pixels[i] = color;
|
for (int i = 0; i < image->width*image->height; i++) if (pixels[i].a <= (unsigned char)(threshold*255.0f)) pixels[i] = color;
|
||||||
|
|
||||||
RL_FREE(image->data);
|
RL_FREE(image->data);
|
||||||
int prevFormat = image->format;
|
int format = image->format;
|
||||||
|
|
||||||
image->data = pixels;
|
image->data = pixels;
|
||||||
image->format = UNCOMPRESSED_R8G8B8A8;
|
image->format = UNCOMPRESSED_R8G8B8A8;
|
||||||
|
|
||||||
ImageFormat(image, prevFormat);
|
ImageFormat(image, format);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Apply alpha mask to image
|
// Apply alpha mask to image
|
||||||
|
@ -1189,11 +1189,11 @@ void ImageAlphaPremultiply(Image *image)
|
||||||
|
|
||||||
RL_FREE(image->data);
|
RL_FREE(image->data);
|
||||||
|
|
||||||
int prevFormat = image->format;
|
int format = image->format;
|
||||||
image->data = pixels;
|
image->data = pixels;
|
||||||
image->format = UNCOMPRESSED_R8G8B8A8;
|
image->format = UNCOMPRESSED_R8G8B8A8;
|
||||||
|
|
||||||
ImageFormat(image, prevFormat);
|
ImageFormat(image, format);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Resize and image to new size
|
// Resize and image to new size
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue