From 005f2ffb7502668fe5820d5fe041dea7daaac48c Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 5 Apr 2018 19:18:44 +0200 Subject: Simplified some code --- src/textures.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'src/textures.c') diff --git a/src/textures.c b/src/textures.c index f5c905cb..11258150 100644 --- a/src/textures.c +++ b/src/textures.c @@ -575,14 +575,10 @@ void UpdateTexture(Texture2D texture, const void *pixels) // Export image as a PNG file void ExportImage(const char *fileName, Image image) { -#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) // NOTE: Getting Color array as RGBA unsigned char values unsigned char *imgData = (unsigned char *)GetImageData(image); SavePNG(fileName, imgData, image.width, image.height, 4); free(imgData); - - TraceLog(LOG_INFO, "Image saved: %s", fileName); -#endif } // Copy an image to a new image @@ -1930,12 +1926,8 @@ Image GenImageCellular(int width, int height, int tileSize) void GenTextureMipmaps(Texture2D *texture) { #if defined(PLATFORM_WEB) - // Calculate next power-of-two values - int potWidth = (int)powf(2, ceilf(logf((float)texture->width)/logf(2))); - int potHeight = (int)powf(2, ceilf(logf((float)texture->height)/logf(2))); - // Check if texture is POT - if ((potWidth != texture->width) || (potHeight != texture->height)) + if (((texture->width & (texture->width - 1)) != 0) || ((texture->height & (texture->height - 1)) != 0)) { TraceLog(LOG_WARNING, "Limited NPOT support, no mipmaps available for NPOT textures"); } -- cgit v1.2.3