Corrected bug on GenTextureMipmaps()

texture.mipmaps value needs to be updated, so, texture must be passed by
reference instead of by value
This commit is contained in:
Ray
2016-11-22 12:14:55 +01:00
parent d1c9c34b2f
commit f1bcfc1352
4 changed files with 24 additions and 18 deletions

View File

@@ -1516,14 +1516,14 @@ void ImageColorBrightness(Image *image, int brightness)
}
// Generate GPU mipmaps for a texture
void GenTextureMipmaps(Texture2D texture)
void GenTextureMipmaps(Texture2D *texture)
{
#if PLATFORM_WEB
int potWidth = GetNextPOT(texture.width);
int potHeight = GetNextPOT(texture.height);
int potWidth = GetNextPOT(texture->width);
int potHeight = GetNextPOT(texture->height);
// Check if texture is POT
if ((potWidth != texture.width) || (potHeight != texture.height))
if ((potWidth != texture->width) || (potHeight != texture->height))
{
TraceLog(WARNING, "Limited NPOT support, no mipmaps available for NPOT textures");
}