Browse Source

ImageToPOT() renamed parameter

pull/1271/head
raysan5 4 years ago
parent
commit
a9fb0aa207
2 changed files with 4 additions and 3 deletions
  1. +2
    -1
      src/raylib.h
  2. +2
    -2
      src/textures.c

+ 2
- 1
src/raylib.h View File

@ -1126,7 +1126,7 @@ RLAPI Image ImageFromImage(Image image, Rectangle rec);
RLAPI Image ImageText(const char *text, int fontSize, Color color); // Create an image from text (default font)
RLAPI Image ImageTextEx(Font font, const char *text, float fontSize, float spacing, Color tint); // Create an image from text (custom sprite font)
RLAPI void ImageFormat(Image *image, int newFormat); // Convert image data to desired format
RLAPI void ImageToPOT(Image *image, Color fillColor); // Convert image to POT (power-of-two)
RLAPI void ImageToPOT(Image *image, Color fill); // Convert image to POT (power-of-two)
RLAPI void ImageCrop(Image *image, Rectangle crop); // Crop an image to a defined rectangle
RLAPI void ImageAlphaCrop(Image *image, float threshold); // Crop image depending on alpha value
RLAPI void ImageAlphaClear(Image *image, Color color, float threshold); // Clear alpha channel to desired color
@ -1199,6 +1199,7 @@ RLAPI void DrawTextureNPatch(Texture2D texture, NPatchInfo nPatchInfo, Rectangle
// Image/Texture misc functions
RLAPI int GetPixelDataSize(int width, int height, int format); // Get pixel data size in bytes (image or texture)
//------------------------------------------------------------------------------------
// Font Loading and Text Drawing Functions (Module: text)
//------------------------------------------------------------------------------------

+ 2
- 2
src/textures.c View File

@ -998,7 +998,7 @@ void ImageFormat(Image *image, int newFormat)
// Convert image to POT (power-of-two)
// NOTE: It could be useful on OpenGL ES 2.0 (RPI, HTML5)
void ImageToPOT(Image *image, Color fillColor)
void ImageToPOT(Image *image, Color fill)
{
// Security check to avoid program crash
if ((image->data == NULL) || (image->width == 0) || (image->height == 0)) return;
@ -1009,7 +1009,7 @@ void ImageToPOT(Image *image, Color fillColor)
int potHeight = (int)powf(2, ceilf(logf((float)image->height)/logf(2)));
// Check if POT texture generation is required (if texture is not already POT)
if ((potWidth != image->width) || (potHeight != image->height)) ImageResizeCanvas(image, potWidth, potHeight, 0, 0, fillColor);
if ((potWidth != image->width) || (potHeight != image->height)) ImageResizeCanvas(image, potWidth, potHeight, 0, 0, fill);
}
#if defined(SUPPORT_IMAGE_MANIPULATION)

Loading…
Cancel
Save