From 2bbf92ad5ae7708bf18ac7ef333e9a979d8d1bde Mon Sep 17 00:00:00 2001 From: Uneven Prankster Date: Thu, 16 Nov 2023 21:12:27 -0300 Subject: Working so hard like a soldier Can't afford a thing on TV --- raylib/src/rtextures.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'raylib/src/rtextures.c') diff --git a/raylib/src/rtextures.c b/raylib/src/rtextures.c index bf1b35e..98586db 100644 --- a/raylib/src/rtextures.c +++ b/raylib/src/rtextures.c @@ -347,7 +347,7 @@ Image LoadImageSvg(const char *fileNameOrString, int width, int height) (fileNameOrString[2] == 'v') && (fileNameOrString[3] == 'g')) { - fileData = fileNameOrString; + fileData = (unsigned char *)fileNameOrString; isSvgStringValid = true; } } @@ -1288,8 +1288,6 @@ void ImageFormat(Image *image, int newFormat) image->data = NULL; image->format = newFormat; - int k = 0; - switch (image->format) { case PIXELFORMAT_UNCOMPRESSED_GRAYSCALE: @@ -1306,7 +1304,7 @@ void ImageFormat(Image *image, int newFormat) { image->data = (unsigned char *)RL_MALLOC(image->width*image->height*2*sizeof(unsigned char)); - for (int i = 0; i < image->width*image->height*2; i += 2, k++) + for (int i = 0, k = 0; i < image->width*image->height*2; i += 2, k++) { ((unsigned char *)image->data)[i] = (unsigned char)((pixels[k].x*0.299f + (float)pixels[k].y*0.587f + (float)pixels[k].z*0.114f)*255.0f); ((unsigned char *)image->data)[i + 1] = (unsigned char)(pixels[k].w*255.0f); -- cgit v1.2.3