From c2df1698473687a97e0f40562477921aee07b3e7 Mon Sep 17 00:00:00 2001 From: Le Juez Victor <90587919+Bigfoot71@users.noreply.github.com> Date: Mon, 24 Jun 2024 09:27:59 +0200 Subject: [PATCH 01/11] [rtextures] Adding `ImageDrawLineEx` function (#4097) * adding `ImageDrawLineEx` function also review other functions for drawing lines in images * fix `ImageDrawLineV` --- src/raylib.h | 1 + src/rtextures.c | 166 ++++++++++++++++++++++++++---------------------- 2 files changed, 91 insertions(+), 76 deletions(-) diff --git a/src/raylib.h b/src/raylib.h index 7195fd55f..8cd1d1ec0 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1373,6 +1373,7 @@ RLAPI void ImageDrawPixel(Image *dst, int posX, int posY, Color color); RLAPI void ImageDrawPixelV(Image *dst, Vector2 position, Color color); // Draw pixel within an image (Vector version) RLAPI void ImageDrawLine(Image *dst, int startPosX, int startPosY, int endPosX, int endPosY, Color color); // Draw line within an image RLAPI void ImageDrawLineV(Image *dst, Vector2 start, Vector2 end, Color color); // Draw line within an image (Vector version) +RLAPI void ImageDrawLineEx(Image *dst, Vector2 start, Vector2 end, int thick, Color color); // Draw a line defining thickness within an image RLAPI void ImageDrawCircle(Image *dst, int centerX, int centerY, int radius, Color color); // Draw a filled circle within an image RLAPI void ImageDrawCircleV(Image *dst, Vector2 center, int radius, Color color); // Draw a filled circle within an image (Vector version) RLAPI void ImageDrawCircleLines(Image *dst, int centerX, int centerY, int radius, Color color); // Draw circle outline within an image diff --git a/src/rtextures.c b/src/rtextures.c index 39c0f78f2..df9ccbdf4 100644 --- a/src/rtextures.c +++ b/src/rtextures.c @@ -3403,98 +3403,112 @@ void ImageDrawPixelV(Image *dst, Vector2 position, Color color) // Draw line within an image void ImageDrawLine(Image *dst, int startPosX, int startPosY, int endPosX, int endPosY, Color color) { - // Using Bresenham's algorithm as described in - // Drawing Lines with Pixels - Joshua Scott - March 2012 - // https://classic.csunplugged.org/wp-content/uploads/2014/12/Lines.pdf + // Calculate differences in coordinates + int shortLen = endPosY - startPosY; + int longLen = endPosX - startPosX; + bool yLonger = false; - int changeInX = (endPosX - startPosX); - int absChangeInX = (changeInX < 0)? -changeInX : changeInX; - int changeInY = (endPosY - startPosY); - int absChangeInY = (changeInY < 0)? -changeInY : changeInY; - - int startU, startV, endU, stepV; // Substitutions, either U = X, V = Y or vice versa. See loop at end of function - //int endV; // Not needed but left for better understanding, check code below - int A, B, P; // See linked paper above, explained down in the main loop - int reversedXY = (absChangeInY < absChangeInX); - - if (reversedXY) + // Determine if the line is more vertical than horizontal + if (abs(shortLen) > abs(longLen)) { - A = 2*absChangeInY; - B = A - 2*absChangeInX; - P = A - absChangeInX; + // Swap the lengths if the line is more vertical + int temp = shortLen; + shortLen = longLen; + longLen = temp; + yLonger = true; + } - if (changeInX > 0) + // Initialize variables for drawing loop + int endVal = longLen; + int sgnInc = 1; + + // Adjust direction increment based on longLen sign + if (longLen < 0) + { + longLen = -longLen; + sgnInc = -1; + } + + // Calculate fixed-point increment for shorter length + int decInc = (longLen == 0)? 0 : (shortLen<<16) / longLen; + + // Draw the line pixel by pixel + if (yLonger) + { + // If line is more vertical, iterate over y-axis + for (int i = 0, j = 0; i != endVal; i += sgnInc, j += decInc) { - startU = startPosX; - startV = startPosY; - endU = endPosX; - //endV = endPosY; + // Calculate pixel position and draw it + ImageDrawPixel(dst, startPosX + (j>>16), startPosY + i, color); } - else - { - startU = endPosX; - startV = endPosY; - endU = startPosX; - //endV = startPosY; - - // Since start and end are reversed - changeInX = -changeInX; - changeInY = -changeInY; - } - - stepV = (changeInY < 0)? -1 : 1; - - ImageDrawPixel(dst, startU, startV, color); // At this point they are correctly ordered... } else { - A = 2*absChangeInX; - B = A - 2*absChangeInY; - P = A - absChangeInY; - - if (changeInY > 0) + // If line is more horizontal, iterate over x-axis + for (int i = 0, j = 0; i != endVal; i += sgnInc, j += decInc) { - startU = startPosY; - startV = startPosX; - endU = endPosY; - //endV = endPosX; + // Calculate pixel position and draw it + ImageDrawPixel(dst, startPosX + i, startPosY + (j>>16), color); } - else - { - startU = endPosY; - startV = endPosX; - endU = startPosY; - //endV = startPosX; - - // Since start and end are reversed - changeInX = -changeInX; - changeInY = -changeInY; - } - - stepV = (changeInX < 0)? -1 : 1; - - ImageDrawPixel(dst, startV, startU, color); // ... but need to be reversed here. Repeated in the main loop below - } - - // We already drew the start point. If we started at startU + 0, the line would be crooked and too short - for (int u = startU + 1, v = startV; u <= endU; u++) - { - if (P >= 0) - { - v += stepV; // Adjusts whenever we stray too far from the direct line. Details in the linked paper above - P += B; // Remembers that we corrected our path - } - else P += A; // Remembers how far we are from the direct line - - if (reversedXY) ImageDrawPixel(dst, u, v, color); - else ImageDrawPixel(dst, v, u, color); } } // Draw line within an image (Vector version) void ImageDrawLineV(Image *dst, Vector2 start, Vector2 end, Color color) { - ImageDrawLine(dst, (int)start.x, (int)start.y, (int)end.x, (int)end.y, color); + // Round start and end positions to nearest integer coordinates + int x1 = (int)(start.x + 0.5f); + int y1 = (int)(start.y + 0.5f); + int x2 = (int)(end.x + 0.5f); + int y2 = (int)(end.y + 0.5f); + + // Draw a vertical line using ImageDrawLine function + ImageDrawLine(dst, x1, y1, x2, y2, color); +} + +// Draw a line defining thickness within an image +void ImageDrawLineEx(Image *dst, Vector2 start, Vector2 end, int thick, Color color) +{ + // Round start and end positions to nearest integer coordinates + int x1 = (int)(start.x + 0.5f); + int y1 = (int)(start.y + 0.5f); + int x2 = (int)(end.x + 0.5f); + int y2 = (int)(end.y + 0.5f); + + // Calculate differences in x and y coordinates + int dx = x2 - x1; + int dy = y2 - y1; + + // Draw the main line between (x1, y1) and (x2, y2) + ImageDrawLine(dst, x1, y1, x2, y2, color); + + // Determine if the line is more horizontal or vertical + if (dx != 0 && abs(dy/dx) < 1) + { + // Line is more horizontal + // Calculate half the width of the line + int wy = (thick - 1)*sqrtf(dx*dx + dy*dy)/(2*abs(dx)); + + // Draw additional lines above and below the main line + for (int i = 1; i <= wy; i++) + { + ImageDrawLine(dst, x1, y1 - i, x2, y2 - i, color); // Draw above the main line + ImageDrawLine(dst, x1, y1 + i, x2, y2 + i, color); // Draw below the main line + } + } + else if (dy != 0) + { + // Line is more vertical or perfectly horizontal + // Calculate half the width of the line + int wx = (thick - 1)*sqrtf(dx*dx + dy*dy)/(2*abs(dy)); + + // Draw additional lines to the left and right of the main line + for (int i = 1; i <= wx; i++) + { + ImageDrawLine(dst, x1 - i, y1, x2 - i, y2, color); // Draw left of the main line + ImageDrawLine(dst, x1 + i, y1, x2 + i, y2, color); // Draw right of the main line + } + } } // Draw circle within an image From f947f890617fade5bdcaccaaeb812306dc7658de Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 24 Jun 2024 07:28:17 +0000 Subject: [PATCH 02/11] Update raylib_api.* by CI --- parser/output/raylib_api.json | 27 ++ parser/output/raylib_api.lua | 12 + parser/output/raylib_api.txt | 491 +++++++++++++++++----------------- parser/output/raylib_api.xml | 9 +- 4 files changed, 297 insertions(+), 242 deletions(-) diff --git a/parser/output/raylib_api.json b/parser/output/raylib_api.json index c4577e68d..a75b94ed0 100644 --- a/parser/output/raylib_api.json +++ b/parser/output/raylib_api.json @@ -7817,6 +7817,33 @@ } ] }, + { + "name": "ImageDrawLineEx", + "description": "Draw a line defining thickness within an image", + "returnType": "void", + "params": [ + { + "type": "Image *", + "name": "dst" + }, + { + "type": "Vector2", + "name": "start" + }, + { + "type": "Vector2", + "name": "end" + }, + { + "type": "int", + "name": "thick" + }, + { + "type": "Color", + "name": "color" + } + ] + }, { "name": "ImageDrawCircle", "description": "Draw a filled circle within an image", diff --git a/parser/output/raylib_api.lua b/parser/output/raylib_api.lua index 7cd1b5f20..7dcb1fa41 100644 --- a/parser/output/raylib_api.lua +++ b/parser/output/raylib_api.lua @@ -5879,6 +5879,18 @@ return { {type = "Color", name = "color"} } }, + { + name = "ImageDrawLineEx", + description = "Draw a line defining thickness within an image", + returnType = "void", + params = { + {type = "Image *", name = "dst"}, + {type = "Vector2", name = "start"}, + {type = "Vector2", name = "end"}, + {type = "int", name = "thick"}, + {type = "Color", name = "color"} + } + }, { name = "ImageDrawCircle", description = "Draw a filled circle within an image", diff --git a/parser/output/raylib_api.txt b/parser/output/raylib_api.txt index 5b09bb972..fd082d074 100644 --- a/parser/output/raylib_api.txt +++ b/parser/output/raylib_api.txt @@ -984,7 +984,7 @@ Callback 006: AudioCallback() (2 input parameters) Param[1]: bufferData (type: void *) Param[2]: frames (type: unsigned int) -Functions found: 571 +Functions found: 572 Function 001: InitWindow() (3 input parameters) Name: InitWindow @@ -3017,7 +3017,16 @@ Function 331: ImageDrawLineV() (4 input parameters) Param[2]: start (type: Vector2) Param[3]: end (type: Vector2) Param[4]: color (type: Color) -Function 332: ImageDrawCircle() (5 input parameters) +Function 332: ImageDrawLineEx() (5 input parameters) + Name: ImageDrawLineEx + Return type: void + Description: Draw a line defining thickness within an image + Param[1]: dst (type: Image *) + Param[2]: start (type: Vector2) + Param[3]: end (type: Vector2) + Param[4]: thick (type: int) + Param[5]: color (type: Color) +Function 333: ImageDrawCircle() (5 input parameters) Name: ImageDrawCircle Return type: void Description: Draw a filled circle within an image @@ -3026,7 +3035,7 @@ Function 332: ImageDrawCircle() (5 input parameters) Param[3]: centerY (type: int) Param[4]: radius (type: int) Param[5]: color (type: Color) -Function 333: ImageDrawCircleV() (4 input parameters) +Function 334: ImageDrawCircleV() (4 input parameters) Name: ImageDrawCircleV Return type: void Description: Draw a filled circle within an image (Vector version) @@ -3034,7 +3043,7 @@ Function 333: ImageDrawCircleV() (4 input parameters) Param[2]: center (type: Vector2) Param[3]: radius (type: int) Param[4]: color (type: Color) -Function 334: ImageDrawCircleLines() (5 input parameters) +Function 335: ImageDrawCircleLines() (5 input parameters) Name: ImageDrawCircleLines Return type: void Description: Draw circle outline within an image @@ -3043,7 +3052,7 @@ Function 334: ImageDrawCircleLines() (5 input parameters) Param[3]: centerY (type: int) Param[4]: radius (type: int) Param[5]: color (type: Color) -Function 335: ImageDrawCircleLinesV() (4 input parameters) +Function 336: ImageDrawCircleLinesV() (4 input parameters) Name: ImageDrawCircleLinesV Return type: void Description: Draw circle outline within an image (Vector version) @@ -3051,7 +3060,7 @@ Function 335: ImageDrawCircleLinesV() (4 input parameters) Param[2]: center (type: Vector2) Param[3]: radius (type: int) Param[4]: color (type: Color) -Function 336: ImageDrawRectangle() (6 input parameters) +Function 337: ImageDrawRectangle() (6 input parameters) Name: ImageDrawRectangle Return type: void Description: Draw rectangle within an image @@ -3061,7 +3070,7 @@ Function 336: ImageDrawRectangle() (6 input parameters) Param[4]: width (type: int) Param[5]: height (type: int) Param[6]: color (type: Color) -Function 337: ImageDrawRectangleV() (4 input parameters) +Function 338: ImageDrawRectangleV() (4 input parameters) Name: ImageDrawRectangleV Return type: void Description: Draw rectangle within an image (Vector version) @@ -3069,14 +3078,14 @@ Function 337: ImageDrawRectangleV() (4 input parameters) Param[2]: position (type: Vector2) Param[3]: size (type: Vector2) Param[4]: color (type: Color) -Function 338: ImageDrawRectangleRec() (3 input parameters) +Function 339: ImageDrawRectangleRec() (3 input parameters) Name: ImageDrawRectangleRec Return type: void Description: Draw rectangle within an image Param[1]: dst (type: Image *) Param[2]: rec (type: Rectangle) Param[3]: color (type: Color) -Function 339: ImageDrawRectangleLines() (4 input parameters) +Function 340: ImageDrawRectangleLines() (4 input parameters) Name: ImageDrawRectangleLines Return type: void Description: Draw rectangle lines within an image @@ -3084,7 +3093,7 @@ Function 339: ImageDrawRectangleLines() (4 input parameters) Param[2]: rec (type: Rectangle) Param[3]: thick (type: int) Param[4]: color (type: Color) -Function 340: ImageDrawTriangle() (5 input parameters) +Function 341: ImageDrawTriangle() (5 input parameters) Name: ImageDrawTriangle Return type: void Description: Draw triangle within an image @@ -3093,7 +3102,7 @@ Function 340: ImageDrawTriangle() (5 input parameters) Param[3]: v2 (type: Vector2) Param[4]: v3 (type: Vector2) Param[5]: color (type: Color) -Function 341: ImageDrawTriangleEx() (7 input parameters) +Function 342: ImageDrawTriangleEx() (7 input parameters) Name: ImageDrawTriangleEx Return type: void Description: Draw triangle with interpolated colors within an image @@ -3104,7 +3113,7 @@ Function 341: ImageDrawTriangleEx() (7 input parameters) Param[5]: c1 (type: Color) Param[6]: c2 (type: Color) Param[7]: c3 (type: Color) -Function 342: ImageDrawTriangleLines() (5 input parameters) +Function 343: ImageDrawTriangleLines() (5 input parameters) Name: ImageDrawTriangleLines Return type: void Description: Draw triangle outline within an image @@ -3113,7 +3122,7 @@ Function 342: ImageDrawTriangleLines() (5 input parameters) Param[3]: v2 (type: Vector2) Param[4]: v3 (type: Vector2) Param[5]: color (type: Color) -Function 343: ImageDrawTriangleFan() (4 input parameters) +Function 344: ImageDrawTriangleFan() (4 input parameters) Name: ImageDrawTriangleFan Return type: void Description: Draw a triangle fan defined by points within an image (first vertex is the center) @@ -3121,7 +3130,7 @@ Function 343: ImageDrawTriangleFan() (4 input parameters) Param[2]: points (type: Vector2 *) Param[3]: pointCount (type: int) Param[4]: color (type: Color) -Function 344: ImageDrawTriangleStrip() (4 input parameters) +Function 345: ImageDrawTriangleStrip() (4 input parameters) Name: ImageDrawTriangleStrip Return type: void Description: Draw a triangle strip defined by points within an image @@ -3129,7 +3138,7 @@ Function 344: ImageDrawTriangleStrip() (4 input parameters) Param[2]: points (type: Vector2 *) Param[3]: pointCount (type: int) Param[4]: color (type: Color) -Function 345: ImageDraw() (5 input parameters) +Function 346: ImageDraw() (5 input parameters) Name: ImageDraw Return type: void Description: Draw a source image within a destination image (tint applied to source) @@ -3138,7 +3147,7 @@ Function 345: ImageDraw() (5 input parameters) Param[3]: srcRec (type: Rectangle) Param[4]: dstRec (type: Rectangle) Param[5]: tint (type: Color) -Function 346: ImageDrawText() (6 input parameters) +Function 347: ImageDrawText() (6 input parameters) Name: ImageDrawText Return type: void Description: Draw text (using default font) within an image (destination) @@ -3148,7 +3157,7 @@ Function 346: ImageDrawText() (6 input parameters) Param[4]: posY (type: int) Param[5]: fontSize (type: int) Param[6]: color (type: Color) -Function 347: ImageDrawTextEx() (7 input parameters) +Function 348: ImageDrawTextEx() (7 input parameters) Name: ImageDrawTextEx Return type: void Description: Draw text (custom sprite font) within an image (destination) @@ -3159,79 +3168,79 @@ Function 347: ImageDrawTextEx() (7 input parameters) Param[5]: fontSize (type: float) Param[6]: spacing (type: float) Param[7]: tint (type: Color) -Function 348: LoadTexture() (1 input parameters) +Function 349: LoadTexture() (1 input parameters) Name: LoadTexture Return type: Texture2D Description: Load texture from file into GPU memory (VRAM) Param[1]: fileName (type: const char *) -Function 349: LoadTextureFromImage() (1 input parameters) +Function 350: LoadTextureFromImage() (1 input parameters) Name: LoadTextureFromImage Return type: Texture2D Description: Load texture from image data Param[1]: image (type: Image) -Function 350: LoadTextureCubemap() (2 input parameters) +Function 351: LoadTextureCubemap() (2 input parameters) Name: LoadTextureCubemap Return type: TextureCubemap Description: Load cubemap from image, multiple image cubemap layouts supported Param[1]: image (type: Image) Param[2]: layout (type: int) -Function 351: LoadRenderTexture() (2 input parameters) +Function 352: LoadRenderTexture() (2 input parameters) Name: LoadRenderTexture Return type: RenderTexture2D Description: Load texture for rendering (framebuffer) Param[1]: width (type: int) Param[2]: height (type: int) -Function 352: IsTextureReady() (1 input parameters) +Function 353: IsTextureReady() (1 input parameters) Name: IsTextureReady Return type: bool Description: Check if a texture is ready Param[1]: texture (type: Texture2D) -Function 353: UnloadTexture() (1 input parameters) +Function 354: UnloadTexture() (1 input parameters) Name: UnloadTexture Return type: void Description: Unload texture from GPU memory (VRAM) Param[1]: texture (type: Texture2D) -Function 354: IsRenderTextureReady() (1 input parameters) +Function 355: IsRenderTextureReady() (1 input parameters) Name: IsRenderTextureReady Return type: bool Description: Check if a render texture is ready Param[1]: target (type: RenderTexture2D) -Function 355: UnloadRenderTexture() (1 input parameters) +Function 356: UnloadRenderTexture() (1 input parameters) Name: UnloadRenderTexture Return type: void Description: Unload render texture from GPU memory (VRAM) Param[1]: target (type: RenderTexture2D) -Function 356: UpdateTexture() (2 input parameters) +Function 357: UpdateTexture() (2 input parameters) Name: UpdateTexture Return type: void Description: Update GPU texture with new data Param[1]: texture (type: Texture2D) Param[2]: pixels (type: const void *) -Function 357: UpdateTextureRec() (3 input parameters) +Function 358: UpdateTextureRec() (3 input parameters) Name: UpdateTextureRec Return type: void Description: Update GPU texture rectangle with new data Param[1]: texture (type: Texture2D) Param[2]: rec (type: Rectangle) Param[3]: pixels (type: const void *) -Function 358: GenTextureMipmaps() (1 input parameters) +Function 359: GenTextureMipmaps() (1 input parameters) Name: GenTextureMipmaps Return type: void Description: Generate GPU mipmaps for a texture Param[1]: texture (type: Texture2D *) -Function 359: SetTextureFilter() (2 input parameters) +Function 360: SetTextureFilter() (2 input parameters) Name: SetTextureFilter Return type: void Description: Set texture scaling filter mode Param[1]: texture (type: Texture2D) Param[2]: filter (type: int) -Function 360: SetTextureWrap() (2 input parameters) +Function 361: SetTextureWrap() (2 input parameters) Name: SetTextureWrap Return type: void Description: Set texture wrapping mode Param[1]: texture (type: Texture2D) Param[2]: wrap (type: int) -Function 361: DrawTexture() (4 input parameters) +Function 362: DrawTexture() (4 input parameters) Name: DrawTexture Return type: void Description: Draw a Texture2D @@ -3239,14 +3248,14 @@ Function 361: DrawTexture() (4 input parameters) Param[2]: posX (type: int) Param[3]: posY (type: int) Param[4]: tint (type: Color) -Function 362: DrawTextureV() (3 input parameters) +Function 363: DrawTextureV() (3 input parameters) Name: DrawTextureV Return type: void Description: Draw a Texture2D with position defined as Vector2 Param[1]: texture (type: Texture2D) Param[2]: position (type: Vector2) Param[3]: tint (type: Color) -Function 363: DrawTextureEx() (5 input parameters) +Function 364: DrawTextureEx() (5 input parameters) Name: DrawTextureEx Return type: void Description: Draw a Texture2D with extended parameters @@ -3255,7 +3264,7 @@ Function 363: DrawTextureEx() (5 input parameters) Param[3]: rotation (type: float) Param[4]: scale (type: float) Param[5]: tint (type: Color) -Function 364: DrawTextureRec() (4 input parameters) +Function 365: DrawTextureRec() (4 input parameters) Name: DrawTextureRec Return type: void Description: Draw a part of a texture defined by a rectangle @@ -3263,7 +3272,7 @@ Function 364: DrawTextureRec() (4 input parameters) Param[2]: source (type: Rectangle) Param[3]: position (type: Vector2) Param[4]: tint (type: Color) -Function 365: DrawTexturePro() (6 input parameters) +Function 366: DrawTexturePro() (6 input parameters) Name: DrawTexturePro Return type: void Description: Draw a part of a texture defined by a rectangle with 'pro' parameters @@ -3273,7 +3282,7 @@ Function 365: DrawTexturePro() (6 input parameters) Param[4]: origin (type: Vector2) Param[5]: rotation (type: float) Param[6]: tint (type: Color) -Function 366: DrawTextureNPatch() (6 input parameters) +Function 367: DrawTextureNPatch() (6 input parameters) Name: DrawTextureNPatch Return type: void Description: Draws a texture (or part of it) that stretches or shrinks nicely @@ -3283,112 +3292,112 @@ Function 366: DrawTextureNPatch() (6 input parameters) Param[4]: origin (type: Vector2) Param[5]: rotation (type: float) Param[6]: tint (type: Color) -Function 367: ColorIsEqual() (2 input parameters) +Function 368: ColorIsEqual() (2 input parameters) Name: ColorIsEqual Return type: bool Description: Check if two colors are equal Param[1]: col1 (type: Color) Param[2]: col2 (type: Color) -Function 368: Fade() (2 input parameters) +Function 369: Fade() (2 input parameters) Name: Fade Return type: Color Description: Get color with alpha applied, alpha goes from 0.0f to 1.0f Param[1]: color (type: Color) Param[2]: alpha (type: float) -Function 369: ColorToInt() (1 input parameters) +Function 370: ColorToInt() (1 input parameters) Name: ColorToInt Return type: int Description: Get hexadecimal value for a Color (0xRRGGBBAA) Param[1]: color (type: Color) -Function 370: ColorNormalize() (1 input parameters) +Function 371: ColorNormalize() (1 input parameters) Name: ColorNormalize Return type: Vector4 Description: Get Color normalized as float [0..1] Param[1]: color (type: Color) -Function 371: ColorFromNormalized() (1 input parameters) +Function 372: ColorFromNormalized() (1 input parameters) Name: ColorFromNormalized Return type: Color Description: Get Color from normalized values [0..1] Param[1]: normalized (type: Vector4) -Function 372: ColorToHSV() (1 input parameters) +Function 373: ColorToHSV() (1 input parameters) Name: ColorToHSV Return type: Vector3 Description: Get HSV values for a Color, hue [0..360], saturation/value [0..1] Param[1]: color (type: Color) -Function 373: ColorFromHSV() (3 input parameters) +Function 374: ColorFromHSV() (3 input parameters) Name: ColorFromHSV Return type: Color Description: Get a Color from HSV values, hue [0..360], saturation/value [0..1] Param[1]: hue (type: float) Param[2]: saturation (type: float) Param[3]: value (type: float) -Function 374: ColorTint() (2 input parameters) +Function 375: ColorTint() (2 input parameters) Name: ColorTint Return type: Color Description: Get color multiplied with another color Param[1]: color (type: Color) Param[2]: tint (type: Color) -Function 375: ColorBrightness() (2 input parameters) +Function 376: ColorBrightness() (2 input parameters) Name: ColorBrightness Return type: Color Description: Get color with brightness correction, brightness factor goes from -1.0f to 1.0f Param[1]: color (type: Color) Param[2]: factor (type: float) -Function 376: ColorContrast() (2 input parameters) +Function 377: ColorContrast() (2 input parameters) Name: ColorContrast Return type: Color Description: Get color with contrast correction, contrast values between -1.0f and 1.0f Param[1]: color (type: Color) Param[2]: contrast (type: float) -Function 377: ColorAlpha() (2 input parameters) +Function 378: ColorAlpha() (2 input parameters) Name: ColorAlpha Return type: Color Description: Get color with alpha applied, alpha goes from 0.0f to 1.0f Param[1]: color (type: Color) Param[2]: alpha (type: float) -Function 378: ColorAlphaBlend() (3 input parameters) +Function 379: ColorAlphaBlend() (3 input parameters) Name: ColorAlphaBlend Return type: Color Description: Get src alpha-blended into dst color with tint Param[1]: dst (type: Color) Param[2]: src (type: Color) Param[3]: tint (type: Color) -Function 379: GetColor() (1 input parameters) +Function 380: GetColor() (1 input parameters) Name: GetColor Return type: Color Description: Get Color structure from hexadecimal value Param[1]: hexValue (type: unsigned int) -Function 380: GetPixelColor() (2 input parameters) +Function 381: GetPixelColor() (2 input parameters) Name: GetPixelColor Return type: Color Description: Get Color from a source pixel pointer of certain format Param[1]: srcPtr (type: void *) Param[2]: format (type: int) -Function 381: SetPixelColor() (3 input parameters) +Function 382: SetPixelColor() (3 input parameters) Name: SetPixelColor Return type: void Description: Set color formatted into destination pixel pointer Param[1]: dstPtr (type: void *) Param[2]: color (type: Color) Param[3]: format (type: int) -Function 382: GetPixelDataSize() (3 input parameters) +Function 383: GetPixelDataSize() (3 input parameters) Name: GetPixelDataSize Return type: int Description: Get pixel data size in bytes for certain format Param[1]: width (type: int) Param[2]: height (type: int) Param[3]: format (type: int) -Function 383: GetFontDefault() (0 input parameters) +Function 384: GetFontDefault() (0 input parameters) Name: GetFontDefault Return type: Font Description: Get the default Font No input parameters -Function 384: LoadFont() (1 input parameters) +Function 385: LoadFont() (1 input parameters) Name: LoadFont Return type: Font Description: Load font from file into GPU memory (VRAM) Param[1]: fileName (type: const char *) -Function 385: LoadFontEx() (4 input parameters) +Function 386: LoadFontEx() (4 input parameters) Name: LoadFontEx Return type: Font Description: Load font from file with extended parameters, use NULL for codepoints and 0 for codepointCount to load the default character setFont @@ -3396,14 +3405,14 @@ Function 385: LoadFontEx() (4 input parameters) Param[2]: fontSize (type: int) Param[3]: codepoints (type: int *) Param[4]: codepointCount (type: int) -Function 386: LoadFontFromImage() (3 input parameters) +Function 387: LoadFontFromImage() (3 input parameters) Name: LoadFontFromImage Return type: Font Description: Load font from Image (XNA style) Param[1]: image (type: Image) Param[2]: key (type: Color) Param[3]: firstChar (type: int) -Function 387: LoadFontFromMemory() (6 input parameters) +Function 388: LoadFontFromMemory() (6 input parameters) Name: LoadFontFromMemory Return type: Font Description: Load font from memory buffer, fileType refers to extension: i.e. '.ttf' @@ -3413,12 +3422,12 @@ Function 387: LoadFontFromMemory() (6 input parameters) Param[4]: fontSize (type: int) Param[5]: codepoints (type: int *) Param[6]: codepointCount (type: int) -Function 388: IsFontReady() (1 input parameters) +Function 389: IsFontReady() (1 input parameters) Name: IsFontReady Return type: bool Description: Check if a font is ready Param[1]: font (type: Font) -Function 389: LoadFontData() (6 input parameters) +Function 390: LoadFontData() (6 input parameters) Name: LoadFontData Return type: GlyphInfo * Description: Load font data for further use @@ -3428,7 +3437,7 @@ Function 389: LoadFontData() (6 input parameters) Param[4]: codepoints (type: int *) Param[5]: codepointCount (type: int) Param[6]: type (type: int) -Function 390: GenImageFontAtlas() (6 input parameters) +Function 391: GenImageFontAtlas() (6 input parameters) Name: GenImageFontAtlas Return type: Image Description: Generate image font atlas using chars info @@ -3438,30 +3447,30 @@ Function 390: GenImageFontAtlas() (6 input parameters) Param[4]: fontSize (type: int) Param[5]: padding (type: int) Param[6]: packMethod (type: int) -Function 391: UnloadFontData() (2 input parameters) +Function 392: UnloadFontData() (2 input parameters) Name: UnloadFontData Return type: void Description: Unload font chars info data (RAM) Param[1]: glyphs (type: GlyphInfo *) Param[2]: glyphCount (type: int) -Function 392: UnloadFont() (1 input parameters) +Function 393: UnloadFont() (1 input parameters) Name: UnloadFont Return type: void Description: Unload font from GPU memory (VRAM) Param[1]: font (type: Font) -Function 393: ExportFontAsCode() (2 input parameters) +Function 394: ExportFontAsCode() (2 input parameters) Name: ExportFontAsCode Return type: bool Description: Export font as code file, returns true on success Param[1]: font (type: Font) Param[2]: fileName (type: const char *) -Function 394: DrawFPS() (2 input parameters) +Function 395: DrawFPS() (2 input parameters) Name: DrawFPS Return type: void Description: Draw current FPS Param[1]: posX (type: int) Param[2]: posY (type: int) -Function 395: DrawText() (5 input parameters) +Function 396: DrawText() (5 input parameters) Name: DrawText Return type: void Description: Draw text (using default font) @@ -3470,7 +3479,7 @@ Function 395: DrawText() (5 input parameters) Param[3]: posY (type: int) Param[4]: fontSize (type: int) Param[5]: color (type: Color) -Function 396: DrawTextEx() (6 input parameters) +Function 397: DrawTextEx() (6 input parameters) Name: DrawTextEx Return type: void Description: Draw text using font and additional parameters @@ -3480,7 +3489,7 @@ Function 396: DrawTextEx() (6 input parameters) Param[4]: fontSize (type: float) Param[5]: spacing (type: float) Param[6]: tint (type: Color) -Function 397: DrawTextPro() (8 input parameters) +Function 398: DrawTextPro() (8 input parameters) Name: DrawTextPro Return type: void Description: Draw text using Font and pro parameters (rotation) @@ -3492,7 +3501,7 @@ Function 397: DrawTextPro() (8 input parameters) Param[6]: fontSize (type: float) Param[7]: spacing (type: float) Param[8]: tint (type: Color) -Function 398: DrawTextCodepoint() (5 input parameters) +Function 399: DrawTextCodepoint() (5 input parameters) Name: DrawTextCodepoint Return type: void Description: Draw one character (codepoint) @@ -3501,7 +3510,7 @@ Function 398: DrawTextCodepoint() (5 input parameters) Param[3]: position (type: Vector2) Param[4]: fontSize (type: float) Param[5]: tint (type: Color) -Function 399: DrawTextCodepoints() (7 input parameters) +Function 400: DrawTextCodepoints() (7 input parameters) Name: DrawTextCodepoints Return type: void Description: Draw multiple character (codepoint) @@ -3512,18 +3521,18 @@ Function 399: DrawTextCodepoints() (7 input parameters) Param[5]: fontSize (type: float) Param[6]: spacing (type: float) Param[7]: tint (type: Color) -Function 400: SetTextLineSpacing() (1 input parameters) +Function 401: SetTextLineSpacing() (1 input parameters) Name: SetTextLineSpacing Return type: void Description: Set vertical line spacing when drawing with line-breaks Param[1]: spacing (type: int) -Function 401: MeasureText() (2 input parameters) +Function 402: MeasureText() (2 input parameters) Name: MeasureText Return type: int Description: Measure string width for default font Param[1]: text (type: const char *) Param[2]: fontSize (type: int) -Function 402: MeasureTextEx() (4 input parameters) +Function 403: MeasureTextEx() (4 input parameters) Name: MeasureTextEx Return type: Vector2 Description: Measure string size for Font @@ -3531,195 +3540,195 @@ Function 402: MeasureTextEx() (4 input parameters) Param[2]: text (type: const char *) Param[3]: fontSize (type: float) Param[4]: spacing (type: float) -Function 403: GetGlyphIndex() (2 input parameters) +Function 404: GetGlyphIndex() (2 input parameters) Name: GetGlyphIndex Return type: int Description: Get glyph index position in font for a codepoint (unicode character), fallback to '?' if not found Param[1]: font (type: Font) Param[2]: codepoint (type: int) -Function 404: GetGlyphInfo() (2 input parameters) +Function 405: GetGlyphInfo() (2 input parameters) Name: GetGlyphInfo Return type: GlyphInfo Description: Get glyph font info data for a codepoint (unicode character), fallback to '?' if not found Param[1]: font (type: Font) Param[2]: codepoint (type: int) -Function 405: GetGlyphAtlasRec() (2 input parameters) +Function 406: GetGlyphAtlasRec() (2 input parameters) Name: GetGlyphAtlasRec Return type: Rectangle Description: Get glyph rectangle in font atlas for a codepoint (unicode character), fallback to '?' if not found Param[1]: font (type: Font) Param[2]: codepoint (type: int) -Function 406: LoadUTF8() (2 input parameters) +Function 407: LoadUTF8() (2 input parameters) Name: LoadUTF8 Return type: char * Description: Load UTF-8 text encoded from codepoints array Param[1]: codepoints (type: const int *) Param[2]: length (type: int) -Function 407: UnloadUTF8() (1 input parameters) +Function 408: UnloadUTF8() (1 input parameters) Name: UnloadUTF8 Return type: void Description: Unload UTF-8 text encoded from codepoints array Param[1]: text (type: char *) -Function 408: LoadCodepoints() (2 input parameters) +Function 409: LoadCodepoints() (2 input parameters) Name: LoadCodepoints Return type: int * Description: Load all codepoints from a UTF-8 text string, codepoints count returned by parameter Param[1]: text (type: const char *) Param[2]: count (type: int *) -Function 409: UnloadCodepoints() (1 input parameters) +Function 410: UnloadCodepoints() (1 input parameters) Name: UnloadCodepoints Return type: void Description: Unload codepoints data from memory Param[1]: codepoints (type: int *) -Function 410: GetCodepointCount() (1 input parameters) +Function 411: GetCodepointCount() (1 input parameters) Name: GetCodepointCount Return type: int Description: Get total number of codepoints in a UTF-8 encoded string Param[1]: text (type: const char *) -Function 411: GetCodepoint() (2 input parameters) +Function 412: GetCodepoint() (2 input parameters) Name: GetCodepoint Return type: int Description: Get next codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure Param[1]: text (type: const char *) Param[2]: codepointSize (type: int *) -Function 412: GetCodepointNext() (2 input parameters) +Function 413: GetCodepointNext() (2 input parameters) Name: GetCodepointNext Return type: int Description: Get next codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure Param[1]: text (type: const char *) Param[2]: codepointSize (type: int *) -Function 413: GetCodepointPrevious() (2 input parameters) +Function 414: GetCodepointPrevious() (2 input parameters) Name: GetCodepointPrevious Return type: int Description: Get previous codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure Param[1]: text (type: const char *) Param[2]: codepointSize (type: int *) -Function 414: CodepointToUTF8() (2 input parameters) +Function 415: CodepointToUTF8() (2 input parameters) Name: CodepointToUTF8 Return type: const char * Description: Encode one codepoint into UTF-8 byte array (array length returned as parameter) Param[1]: codepoint (type: int) Param[2]: utf8Size (type: int *) -Function 415: TextCopy() (2 input parameters) +Function 416: TextCopy() (2 input parameters) Name: TextCopy Return type: int Description: Copy one string to another, returns bytes copied Param[1]: dst (type: char *) Param[2]: src (type: const char *) -Function 416: TextIsEqual() (2 input parameters) +Function 417: TextIsEqual() (2 input parameters) Name: TextIsEqual Return type: bool Description: Check if two text string are equal Param[1]: text1 (type: const char *) Param[2]: text2 (type: const char *) -Function 417: TextLength() (1 input parameters) +Function 418: TextLength() (1 input parameters) Name: TextLength Return type: unsigned int Description: Get text length, checks for '\0' ending Param[1]: text (type: const char *) -Function 418: TextFormat() (2 input parameters) +Function 419: TextFormat() (2 input parameters) Name: TextFormat Return type: const char * Description: Text formatting with variables (sprintf() style) Param[1]: text (type: const char *) Param[2]: args (type: ...) -Function 419: TextSubtext() (3 input parameters) +Function 420: TextSubtext() (3 input parameters) Name: TextSubtext Return type: const char * Description: Get a piece of a text string Param[1]: text (type: const char *) Param[2]: position (type: int) Param[3]: length (type: int) -Function 420: TextReplace() (3 input parameters) +Function 421: TextReplace() (3 input parameters) Name: TextReplace Return type: char * Description: Replace text string (WARNING: memory must be freed!) Param[1]: text (type: const char *) Param[2]: replace (type: const char *) Param[3]: by (type: const char *) -Function 421: TextInsert() (3 input parameters) +Function 422: TextInsert() (3 input parameters) Name: TextInsert Return type: char * Description: Insert text in a position (WARNING: memory must be freed!) Param[1]: text (type: const char *) Param[2]: insert (type: const char *) Param[3]: position (type: int) -Function 422: TextJoin() (3 input parameters) +Function 423: TextJoin() (3 input parameters) Name: TextJoin Return type: const char * Description: Join text strings with delimiter Param[1]: textList (type: const char **) Param[2]: count (type: int) Param[3]: delimiter (type: const char *) -Function 423: TextSplit() (3 input parameters) +Function 424: TextSplit() (3 input parameters) Name: TextSplit Return type: const char ** Description: Split text into multiple strings Param[1]: text (type: const char *) Param[2]: delimiter (type: char) Param[3]: count (type: int *) -Function 424: TextAppend() (3 input parameters) +Function 425: TextAppend() (3 input parameters) Name: TextAppend Return type: void Description: Append text at specific position and move cursor! Param[1]: text (type: char *) Param[2]: append (type: const char *) Param[3]: position (type: int *) -Function 425: TextFindIndex() (2 input parameters) +Function 426: TextFindIndex() (2 input parameters) Name: TextFindIndex Return type: int Description: Find first text occurrence within a string Param[1]: text (type: const char *) Param[2]: find (type: const char *) -Function 426: TextToUpper() (1 input parameters) +Function 427: TextToUpper() (1 input parameters) Name: TextToUpper Return type: const char * Description: Get upper case version of provided string Param[1]: text (type: const char *) -Function 427: TextToLower() (1 input parameters) +Function 428: TextToLower() (1 input parameters) Name: TextToLower Return type: const char * Description: Get lower case version of provided string Param[1]: text (type: const char *) -Function 428: TextToPascal() (1 input parameters) +Function 429: TextToPascal() (1 input parameters) Name: TextToPascal Return type: const char * Description: Get Pascal case notation version of provided string Param[1]: text (type: const char *) -Function 429: TextToSnake() (1 input parameters) +Function 430: TextToSnake() (1 input parameters) Name: TextToSnake Return type: const char * Description: Get Snake case notation version of provided string Param[1]: text (type: const char *) -Function 430: TextToCamel() (1 input parameters) +Function 431: TextToCamel() (1 input parameters) Name: TextToCamel Return type: const char * Description: Get Camel case notation version of provided string Param[1]: text (type: const char *) -Function 431: TextToInteger() (1 input parameters) +Function 432: TextToInteger() (1 input parameters) Name: TextToInteger Return type: int Description: Get integer value from text (negative values not supported) Param[1]: text (type: const char *) -Function 432: TextToFloat() (1 input parameters) +Function 433: TextToFloat() (1 input parameters) Name: TextToFloat Return type: float Description: Get float value from text (negative values not supported) Param[1]: text (type: const char *) -Function 433: DrawLine3D() (3 input parameters) +Function 434: DrawLine3D() (3 input parameters) Name: DrawLine3D Return type: void Description: Draw a line in 3D world space Param[1]: startPos (type: Vector3) Param[2]: endPos (type: Vector3) Param[3]: color (type: Color) -Function 434: DrawPoint3D() (2 input parameters) +Function 435: DrawPoint3D() (2 input parameters) Name: DrawPoint3D Return type: void Description: Draw a point in 3D space, actually a small line Param[1]: position (type: Vector3) Param[2]: color (type: Color) -Function 435: DrawCircle3D() (5 input parameters) +Function 436: DrawCircle3D() (5 input parameters) Name: DrawCircle3D Return type: void Description: Draw a circle in 3D world space @@ -3728,7 +3737,7 @@ Function 435: DrawCircle3D() (5 input parameters) Param[3]: rotationAxis (type: Vector3) Param[4]: rotationAngle (type: float) Param[5]: color (type: Color) -Function 436: DrawTriangle3D() (4 input parameters) +Function 437: DrawTriangle3D() (4 input parameters) Name: DrawTriangle3D Return type: void Description: Draw a color-filled triangle (vertex in counter-clockwise order!) @@ -3736,14 +3745,14 @@ Function 436: DrawTriangle3D() (4 input parameters) Param[2]: v2 (type: Vector3) Param[3]: v3 (type: Vector3) Param[4]: color (type: Color) -Function 437: DrawTriangleStrip3D() (3 input parameters) +Function 438: DrawTriangleStrip3D() (3 input parameters) Name: DrawTriangleStrip3D Return type: void Description: Draw a triangle strip defined by points Param[1]: points (type: const Vector3 *) Param[2]: pointCount (type: int) Param[3]: color (type: Color) -Function 438: DrawCube() (5 input parameters) +Function 439: DrawCube() (5 input parameters) Name: DrawCube Return type: void Description: Draw cube @@ -3752,14 +3761,14 @@ Function 438: DrawCube() (5 input parameters) Param[3]: height (type: float) Param[4]: length (type: float) Param[5]: color (type: Color) -Function 439: DrawCubeV() (3 input parameters) +Function 440: DrawCubeV() (3 input parameters) Name: DrawCubeV Return type: void Description: Draw cube (Vector version) Param[1]: position (type: Vector3) Param[2]: size (type: Vector3) Param[3]: color (type: Color) -Function 440: DrawCubeWires() (5 input parameters) +Function 441: DrawCubeWires() (5 input parameters) Name: DrawCubeWires Return type: void Description: Draw cube wires @@ -3768,21 +3777,21 @@ Function 440: DrawCubeWires() (5 input parameters) Param[3]: height (type: float) Param[4]: length (type: float) Param[5]: color (type: Color) -Function 441: DrawCubeWiresV() (3 input parameters) +Function 442: DrawCubeWiresV() (3 input parameters) Name: DrawCubeWiresV Return type: void Description: Draw cube wires (Vector version) Param[1]: position (type: Vector3) Param[2]: size (type: Vector3) Param[3]: color (type: Color) -Function 442: DrawSphere() (3 input parameters) +Function 443: DrawSphere() (3 input parameters) Name: DrawSphere Return type: void Description: Draw sphere Param[1]: centerPos (type: Vector3) Param[2]: radius (type: float) Param[3]: color (type: Color) -Function 443: DrawSphereEx() (5 input parameters) +Function 444: DrawSphereEx() (5 input parameters) Name: DrawSphereEx Return type: void Description: Draw sphere with extended parameters @@ -3791,7 +3800,7 @@ Function 443: DrawSphereEx() (5 input parameters) Param[3]: rings (type: int) Param[4]: slices (type: int) Param[5]: color (type: Color) -Function 444: DrawSphereWires() (5 input parameters) +Function 445: DrawSphereWires() (5 input parameters) Name: DrawSphereWires Return type: void Description: Draw sphere wires @@ -3800,7 +3809,7 @@ Function 444: DrawSphereWires() (5 input parameters) Param[3]: rings (type: int) Param[4]: slices (type: int) Param[5]: color (type: Color) -Function 445: DrawCylinder() (6 input parameters) +Function 446: DrawCylinder() (6 input parameters) Name: DrawCylinder Return type: void Description: Draw a cylinder/cone @@ -3810,7 +3819,7 @@ Function 445: DrawCylinder() (6 input parameters) Param[4]: height (type: float) Param[5]: slices (type: int) Param[6]: color (type: Color) -Function 446: DrawCylinderEx() (6 input parameters) +Function 447: DrawCylinderEx() (6 input parameters) Name: DrawCylinderEx Return type: void Description: Draw a cylinder with base at startPos and top at endPos @@ -3820,7 +3829,7 @@ Function 446: DrawCylinderEx() (6 input parameters) Param[4]: endRadius (type: float) Param[5]: sides (type: int) Param[6]: color (type: Color) -Function 447: DrawCylinderWires() (6 input parameters) +Function 448: DrawCylinderWires() (6 input parameters) Name: DrawCylinderWires Return type: void Description: Draw a cylinder/cone wires @@ -3830,7 +3839,7 @@ Function 447: DrawCylinderWires() (6 input parameters) Param[4]: height (type: float) Param[5]: slices (type: int) Param[6]: color (type: Color) -Function 448: DrawCylinderWiresEx() (6 input parameters) +Function 449: DrawCylinderWiresEx() (6 input parameters) Name: DrawCylinderWiresEx Return type: void Description: Draw a cylinder wires with base at startPos and top at endPos @@ -3840,7 +3849,7 @@ Function 448: DrawCylinderWiresEx() (6 input parameters) Param[4]: endRadius (type: float) Param[5]: sides (type: int) Param[6]: color (type: Color) -Function 449: DrawCapsule() (6 input parameters) +Function 450: DrawCapsule() (6 input parameters) Name: DrawCapsule Return type: void Description: Draw a capsule with the center of its sphere caps at startPos and endPos @@ -3850,7 +3859,7 @@ Function 449: DrawCapsule() (6 input parameters) Param[4]: slices (type: int) Param[5]: rings (type: int) Param[6]: color (type: Color) -Function 450: DrawCapsuleWires() (6 input parameters) +Function 451: DrawCapsuleWires() (6 input parameters) Name: DrawCapsuleWires Return type: void Description: Draw capsule wireframe with the center of its sphere caps at startPos and endPos @@ -3860,51 +3869,51 @@ Function 450: DrawCapsuleWires() (6 input parameters) Param[4]: slices (type: int) Param[5]: rings (type: int) Param[6]: color (type: Color) -Function 451: DrawPlane() (3 input parameters) +Function 452: DrawPlane() (3 input parameters) Name: DrawPlane Return type: void Description: Draw a plane XZ Param[1]: centerPos (type: Vector3) Param[2]: size (type: Vector2) Param[3]: color (type: Color) -Function 452: DrawRay() (2 input parameters) +Function 453: DrawRay() (2 input parameters) Name: DrawRay Return type: void Description: Draw a ray line Param[1]: ray (type: Ray) Param[2]: color (type: Color) -Function 453: DrawGrid() (2 input parameters) +Function 454: DrawGrid() (2 input parameters) Name: DrawGrid Return type: void Description: Draw a grid (centered at (0, 0, 0)) Param[1]: slices (type: int) Param[2]: spacing (type: float) -Function 454: LoadModel() (1 input parameters) +Function 455: LoadModel() (1 input parameters) Name: LoadModel Return type: Model Description: Load model from files (meshes and materials) Param[1]: fileName (type: const char *) -Function 455: LoadModelFromMesh() (1 input parameters) +Function 456: LoadModelFromMesh() (1 input parameters) Name: LoadModelFromMesh Return type: Model Description: Load model from generated mesh (default material) Param[1]: mesh (type: Mesh) -Function 456: IsModelReady() (1 input parameters) +Function 457: IsModelReady() (1 input parameters) Name: IsModelReady Return type: bool Description: Check if a model is ready Param[1]: model (type: Model) -Function 457: UnloadModel() (1 input parameters) +Function 458: UnloadModel() (1 input parameters) Name: UnloadModel Return type: void Description: Unload model (including meshes) from memory (RAM and/or VRAM) Param[1]: model (type: Model) -Function 458: GetModelBoundingBox() (1 input parameters) +Function 459: GetModelBoundingBox() (1 input parameters) Name: GetModelBoundingBox Return type: BoundingBox Description: Compute model bounding box limits (considers all meshes) Param[1]: model (type: Model) -Function 459: DrawModel() (4 input parameters) +Function 460: DrawModel() (4 input parameters) Name: DrawModel Return type: void Description: Draw a model (with texture if set) @@ -3912,7 +3921,7 @@ Function 459: DrawModel() (4 input parameters) Param[2]: position (type: Vector3) Param[3]: scale (type: float) Param[4]: tint (type: Color) -Function 460: DrawModelEx() (6 input parameters) +Function 461: DrawModelEx() (6 input parameters) Name: DrawModelEx Return type: void Description: Draw a model with extended parameters @@ -3922,7 +3931,7 @@ Function 460: DrawModelEx() (6 input parameters) Param[4]: rotationAngle (type: float) Param[5]: scale (type: Vector3) Param[6]: tint (type: Color) -Function 461: DrawModelWires() (4 input parameters) +Function 462: DrawModelWires() (4 input parameters) Name: DrawModelWires Return type: void Description: Draw a model wires (with texture if set) @@ -3930,7 +3939,7 @@ Function 461: DrawModelWires() (4 input parameters) Param[2]: position (type: Vector3) Param[3]: scale (type: float) Param[4]: tint (type: Color) -Function 462: DrawModelWiresEx() (6 input parameters) +Function 463: DrawModelWiresEx() (6 input parameters) Name: DrawModelWiresEx Return type: void Description: Draw a model wires (with texture if set) with extended parameters @@ -3940,13 +3949,13 @@ Function 462: DrawModelWiresEx() (6 input parameters) Param[4]: rotationAngle (type: float) Param[5]: scale (type: Vector3) Param[6]: tint (type: Color) -Function 463: DrawBoundingBox() (2 input parameters) +Function 464: DrawBoundingBox() (2 input parameters) Name: DrawBoundingBox Return type: void Description: Draw bounding box (wires) Param[1]: box (type: BoundingBox) Param[2]: color (type: Color) -Function 464: DrawBillboard() (5 input parameters) +Function 465: DrawBillboard() (5 input parameters) Name: DrawBillboard Return type: void Description: Draw a billboard texture @@ -3955,7 +3964,7 @@ Function 464: DrawBillboard() (5 input parameters) Param[3]: position (type: Vector3) Param[4]: size (type: float) Param[5]: tint (type: Color) -Function 465: DrawBillboardRec() (6 input parameters) +Function 466: DrawBillboardRec() (6 input parameters) Name: DrawBillboardRec Return type: void Description: Draw a billboard texture defined by source @@ -3965,7 +3974,7 @@ Function 465: DrawBillboardRec() (6 input parameters) Param[4]: position (type: Vector3) Param[5]: size (type: Vector2) Param[6]: tint (type: Color) -Function 466: DrawBillboardPro() (9 input parameters) +Function 467: DrawBillboardPro() (9 input parameters) Name: DrawBillboardPro Return type: void Description: Draw a billboard texture defined by source and rotation @@ -3978,13 +3987,13 @@ Function 466: DrawBillboardPro() (9 input parameters) Param[7]: origin (type: Vector2) Param[8]: rotation (type: float) Param[9]: tint (type: Color) -Function 467: UploadMesh() (2 input parameters) +Function 468: UploadMesh() (2 input parameters) Name: UploadMesh Return type: void Description: Upload mesh vertex data in GPU and provide VAO/VBO ids Param[1]: mesh (type: Mesh *) Param[2]: dynamic (type: bool) -Function 468: UpdateMeshBuffer() (5 input parameters) +Function 469: UpdateMeshBuffer() (5 input parameters) Name: UpdateMeshBuffer Return type: void Description: Update mesh vertex data in GPU for a specific buffer index @@ -3993,19 +4002,19 @@ Function 468: UpdateMeshBuffer() (5 input parameters) Param[3]: data (type: const void *) Param[4]: dataSize (type: int) Param[5]: offset (type: int) -Function 469: UnloadMesh() (1 input parameters) +Function 470: UnloadMesh() (1 input parameters) Name: UnloadMesh Return type: void Description: Unload mesh data from CPU and GPU Param[1]: mesh (type: Mesh) -Function 470: DrawMesh() (3 input parameters) +Function 471: DrawMesh() (3 input parameters) Name: DrawMesh Return type: void Description: Draw a 3d mesh with material and transform Param[1]: mesh (type: Mesh) Param[2]: material (type: Material) Param[3]: transform (type: Matrix) -Function 471: DrawMeshInstanced() (4 input parameters) +Function 472: DrawMeshInstanced() (4 input parameters) Name: DrawMeshInstanced Return type: void Description: Draw multiple mesh instances with material and different transforms @@ -4013,35 +4022,35 @@ Function 471: DrawMeshInstanced() (4 input parameters) Param[2]: material (type: Material) Param[3]: transforms (type: const Matrix *) Param[4]: instances (type: int) -Function 472: GetMeshBoundingBox() (1 input parameters) +Function 473: GetMeshBoundingBox() (1 input parameters) Name: GetMeshBoundingBox Return type: BoundingBox Description: Compute mesh bounding box limits Param[1]: mesh (type: Mesh) -Function 473: GenMeshTangents() (1 input parameters) +Function 474: GenMeshTangents() (1 input parameters) Name: GenMeshTangents Return type: void Description: Compute mesh tangents Param[1]: mesh (type: Mesh *) -Function 474: ExportMesh() (2 input parameters) +Function 475: ExportMesh() (2 input parameters) Name: ExportMesh Return type: bool Description: Export mesh data to file, returns true on success Param[1]: mesh (type: Mesh) Param[2]: fileName (type: const char *) -Function 475: ExportMeshAsCode() (2 input parameters) +Function 476: ExportMeshAsCode() (2 input parameters) Name: ExportMeshAsCode Return type: bool Description: Export mesh as code file (.h) defining multiple arrays of vertex attributes Param[1]: mesh (type: Mesh) Param[2]: fileName (type: const char *) -Function 476: GenMeshPoly() (2 input parameters) +Function 477: GenMeshPoly() (2 input parameters) Name: GenMeshPoly Return type: Mesh Description: Generate polygonal mesh Param[1]: sides (type: int) Param[2]: radius (type: float) -Function 477: GenMeshPlane() (4 input parameters) +Function 478: GenMeshPlane() (4 input parameters) Name: GenMeshPlane Return type: Mesh Description: Generate plane mesh (with subdivisions) @@ -4049,42 +4058,42 @@ Function 477: GenMeshPlane() (4 input parameters) Param[2]: length (type: float) Param[3]: resX (type: int) Param[4]: resZ (type: int) -Function 478: GenMeshCube() (3 input parameters) +Function 479: GenMeshCube() (3 input parameters) Name: GenMeshCube Return type: Mesh Description: Generate cuboid mesh Param[1]: width (type: float) Param[2]: height (type: float) Param[3]: length (type: float) -Function 479: GenMeshSphere() (3 input parameters) +Function 480: GenMeshSphere() (3 input parameters) Name: GenMeshSphere Return type: Mesh Description: Generate sphere mesh (standard sphere) Param[1]: radius (type: float) Param[2]: rings (type: int) Param[3]: slices (type: int) -Function 480: GenMeshHemiSphere() (3 input parameters) +Function 481: GenMeshHemiSphere() (3 input parameters) Name: GenMeshHemiSphere Return type: Mesh Description: Generate half-sphere mesh (no bottom cap) Param[1]: radius (type: float) Param[2]: rings (type: int) Param[3]: slices (type: int) -Function 481: GenMeshCylinder() (3 input parameters) +Function 482: GenMeshCylinder() (3 input parameters) Name: GenMeshCylinder Return type: Mesh Description: Generate cylinder mesh Param[1]: radius (type: float) Param[2]: height (type: float) Param[3]: slices (type: int) -Function 482: GenMeshCone() (3 input parameters) +Function 483: GenMeshCone() (3 input parameters) Name: GenMeshCone Return type: Mesh Description: Generate cone/pyramid mesh Param[1]: radius (type: float) Param[2]: height (type: float) Param[3]: slices (type: int) -Function 483: GenMeshTorus() (4 input parameters) +Function 484: GenMeshTorus() (4 input parameters) Name: GenMeshTorus Return type: Mesh Description: Generate torus mesh @@ -4092,7 +4101,7 @@ Function 483: GenMeshTorus() (4 input parameters) Param[2]: size (type: float) Param[3]: radSeg (type: int) Param[4]: sides (type: int) -Function 484: GenMeshKnot() (4 input parameters) +Function 485: GenMeshKnot() (4 input parameters) Name: GenMeshKnot Return type: Mesh Description: Generate trefoil knot mesh @@ -4100,84 +4109,84 @@ Function 484: GenMeshKnot() (4 input parameters) Param[2]: size (type: float) Param[3]: radSeg (type: int) Param[4]: sides (type: int) -Function 485: GenMeshHeightmap() (2 input parameters) +Function 486: GenMeshHeightmap() (2 input parameters) Name: GenMeshHeightmap Return type: Mesh Description: Generate heightmap mesh from image data Param[1]: heightmap (type: Image) Param[2]: size (type: Vector3) -Function 486: GenMeshCubicmap() (2 input parameters) +Function 487: GenMeshCubicmap() (2 input parameters) Name: GenMeshCubicmap Return type: Mesh Description: Generate cubes-based map mesh from image data Param[1]: cubicmap (type: Image) Param[2]: cubeSize (type: Vector3) -Function 487: LoadMaterials() (2 input parameters) +Function 488: LoadMaterials() (2 input parameters) Name: LoadMaterials Return type: Material * Description: Load materials from model file Param[1]: fileName (type: const char *) Param[2]: materialCount (type: int *) -Function 488: LoadMaterialDefault() (0 input parameters) +Function 489: LoadMaterialDefault() (0 input parameters) Name: LoadMaterialDefault Return type: Material Description: Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps) No input parameters -Function 489: IsMaterialReady() (1 input parameters) +Function 490: IsMaterialReady() (1 input parameters) Name: IsMaterialReady Return type: bool Description: Check if a material is ready Param[1]: material (type: Material) -Function 490: UnloadMaterial() (1 input parameters) +Function 491: UnloadMaterial() (1 input parameters) Name: UnloadMaterial Return type: void Description: Unload material from GPU memory (VRAM) Param[1]: material (type: Material) -Function 491: SetMaterialTexture() (3 input parameters) +Function 492: SetMaterialTexture() (3 input parameters) Name: SetMaterialTexture Return type: void Description: Set texture for a material map type (MATERIAL_MAP_DIFFUSE, MATERIAL_MAP_SPECULAR...) Param[1]: material (type: Material *) Param[2]: mapType (type: int) Param[3]: texture (type: Texture2D) -Function 492: SetModelMeshMaterial() (3 input parameters) +Function 493: SetModelMeshMaterial() (3 input parameters) Name: SetModelMeshMaterial Return type: void Description: Set material for a mesh Param[1]: model (type: Model *) Param[2]: meshId (type: int) Param[3]: materialId (type: int) -Function 493: LoadModelAnimations() (2 input parameters) +Function 494: LoadModelAnimations() (2 input parameters) Name: LoadModelAnimations Return type: ModelAnimation * Description: Load model animations from file Param[1]: fileName (type: const char *) Param[2]: animCount (type: int *) -Function 494: UpdateModelAnimation() (3 input parameters) +Function 495: UpdateModelAnimation() (3 input parameters) Name: UpdateModelAnimation Return type: void Description: Update model animation pose Param[1]: model (type: Model) Param[2]: anim (type: ModelAnimation) Param[3]: frame (type: int) -Function 495: UnloadModelAnimation() (1 input parameters) +Function 496: UnloadModelAnimation() (1 input parameters) Name: UnloadModelAnimation Return type: void Description: Unload animation data Param[1]: anim (type: ModelAnimation) -Function 496: UnloadModelAnimations() (2 input parameters) +Function 497: UnloadModelAnimations() (2 input parameters) Name: UnloadModelAnimations Return type: void Description: Unload animation array data Param[1]: animations (type: ModelAnimation *) Param[2]: animCount (type: int) -Function 497: IsModelAnimationValid() (2 input parameters) +Function 498: IsModelAnimationValid() (2 input parameters) Name: IsModelAnimationValid Return type: bool Description: Check model animation skeleton match Param[1]: model (type: Model) Param[2]: anim (type: ModelAnimation) -Function 498: CheckCollisionSpheres() (4 input parameters) +Function 499: CheckCollisionSpheres() (4 input parameters) Name: CheckCollisionSpheres Return type: bool Description: Check collision between two spheres @@ -4185,40 +4194,40 @@ Function 498: CheckCollisionSpheres() (4 input parameters) Param[2]: radius1 (type: float) Param[3]: center2 (type: Vector3) Param[4]: radius2 (type: float) -Function 499: CheckCollisionBoxes() (2 input parameters) +Function 500: CheckCollisionBoxes() (2 input parameters) Name: CheckCollisionBoxes Return type: bool Description: Check collision between two bounding boxes Param[1]: box1 (type: BoundingBox) Param[2]: box2 (type: BoundingBox) -Function 500: CheckCollisionBoxSphere() (3 input parameters) +Function 501: CheckCollisionBoxSphere() (3 input parameters) Name: CheckCollisionBoxSphere Return type: bool Description: Check collision between box and sphere Param[1]: box (type: BoundingBox) Param[2]: center (type: Vector3) Param[3]: radius (type: float) -Function 501: GetRayCollisionSphere() (3 input parameters) +Function 502: GetRayCollisionSphere() (3 input parameters) Name: GetRayCollisionSphere Return type: RayCollision Description: Get collision info between ray and sphere Param[1]: ray (type: Ray) Param[2]: center (type: Vector3) Param[3]: radius (type: float) -Function 502: GetRayCollisionBox() (2 input parameters) +Function 503: GetRayCollisionBox() (2 input parameters) Name: GetRayCollisionBox Return type: RayCollision Description: Get collision info between ray and box Param[1]: ray (type: Ray) Param[2]: box (type: BoundingBox) -Function 503: GetRayCollisionMesh() (3 input parameters) +Function 504: GetRayCollisionMesh() (3 input parameters) Name: GetRayCollisionMesh Return type: RayCollision Description: Get collision info between ray and mesh Param[1]: ray (type: Ray) Param[2]: mesh (type: Mesh) Param[3]: transform (type: Matrix) -Function 504: GetRayCollisionTriangle() (4 input parameters) +Function 505: GetRayCollisionTriangle() (4 input parameters) Name: GetRayCollisionTriangle Return type: RayCollision Description: Get collision info between ray and triangle @@ -4226,7 +4235,7 @@ Function 504: GetRayCollisionTriangle() (4 input parameters) Param[2]: p1 (type: Vector3) Param[3]: p2 (type: Vector3) Param[4]: p3 (type: Vector3) -Function 505: GetRayCollisionQuad() (5 input parameters) +Function 506: GetRayCollisionQuad() (5 input parameters) Name: GetRayCollisionQuad Return type: RayCollision Description: Get collision info between ray and quad @@ -4235,158 +4244,158 @@ Function 505: GetRayCollisionQuad() (5 input parameters) Param[3]: p2 (type: Vector3) Param[4]: p3 (type: Vector3) Param[5]: p4 (type: Vector3) -Function 506: InitAudioDevice() (0 input parameters) +Function 507: InitAudioDevice() (0 input parameters) Name: InitAudioDevice Return type: void Description: Initialize audio device and context No input parameters -Function 507: CloseAudioDevice() (0 input parameters) +Function 508: CloseAudioDevice() (0 input parameters) Name: CloseAudioDevice Return type: void Description: Close the audio device and context No input parameters -Function 508: IsAudioDeviceReady() (0 input parameters) +Function 509: IsAudioDeviceReady() (0 input parameters) Name: IsAudioDeviceReady Return type: bool Description: Check if audio device has been initialized successfully No input parameters -Function 509: SetMasterVolume() (1 input parameters) +Function 510: SetMasterVolume() (1 input parameters) Name: SetMasterVolume Return type: void Description: Set master volume (listener) Param[1]: volume (type: float) -Function 510: GetMasterVolume() (0 input parameters) +Function 511: GetMasterVolume() (0 input parameters) Name: GetMasterVolume Return type: float Description: Get master volume (listener) No input parameters -Function 511: LoadWave() (1 input parameters) +Function 512: LoadWave() (1 input parameters) Name: LoadWave Return type: Wave Description: Load wave data from file Param[1]: fileName (type: const char *) -Function 512: LoadWaveFromMemory() (3 input parameters) +Function 513: LoadWaveFromMemory() (3 input parameters) Name: LoadWaveFromMemory Return type: Wave Description: Load wave from memory buffer, fileType refers to extension: i.e. '.wav' Param[1]: fileType (type: const char *) Param[2]: fileData (type: const unsigned char *) Param[3]: dataSize (type: int) -Function 513: IsWaveReady() (1 input parameters) +Function 514: IsWaveReady() (1 input parameters) Name: IsWaveReady Return type: bool Description: Checks if wave data is ready Param[1]: wave (type: Wave) -Function 514: LoadSound() (1 input parameters) +Function 515: LoadSound() (1 input parameters) Name: LoadSound Return type: Sound Description: Load sound from file Param[1]: fileName (type: const char *) -Function 515: LoadSoundFromWave() (1 input parameters) +Function 516: LoadSoundFromWave() (1 input parameters) Name: LoadSoundFromWave Return type: Sound Description: Load sound from wave data Param[1]: wave (type: Wave) -Function 516: LoadSoundAlias() (1 input parameters) +Function 517: LoadSoundAlias() (1 input parameters) Name: LoadSoundAlias Return type: Sound Description: Create a new sound that shares the same sample data as the source sound, does not own the sound data Param[1]: source (type: Sound) -Function 517: IsSoundReady() (1 input parameters) +Function 518: IsSoundReady() (1 input parameters) Name: IsSoundReady Return type: bool Description: Checks if a sound is ready Param[1]: sound (type: Sound) -Function 518: UpdateSound() (3 input parameters) +Function 519: UpdateSound() (3 input parameters) Name: UpdateSound Return type: void Description: Update sound buffer with new data Param[1]: sound (type: Sound) Param[2]: data (type: const void *) Param[3]: sampleCount (type: int) -Function 519: UnloadWave() (1 input parameters) +Function 520: UnloadWave() (1 input parameters) Name: UnloadWave Return type: void Description: Unload wave data Param[1]: wave (type: Wave) -Function 520: UnloadSound() (1 input parameters) +Function 521: UnloadSound() (1 input parameters) Name: UnloadSound Return type: void Description: Unload sound Param[1]: sound (type: Sound) -Function 521: UnloadSoundAlias() (1 input parameters) +Function 522: UnloadSoundAlias() (1 input parameters) Name: UnloadSoundAlias Return type: void Description: Unload a sound alias (does not deallocate sample data) Param[1]: alias (type: Sound) -Function 522: ExportWave() (2 input parameters) +Function 523: ExportWave() (2 input parameters) Name: ExportWave Return type: bool Description: Export wave data to file, returns true on success Param[1]: wave (type: Wave) Param[2]: fileName (type: const char *) -Function 523: ExportWaveAsCode() (2 input parameters) +Function 524: ExportWaveAsCode() (2 input parameters) Name: ExportWaveAsCode Return type: bool Description: Export wave sample data to code (.h), returns true on success Param[1]: wave (type: Wave) Param[2]: fileName (type: const char *) -Function 524: PlaySound() (1 input parameters) +Function 525: PlaySound() (1 input parameters) Name: PlaySound Return type: void Description: Play a sound Param[1]: sound (type: Sound) -Function 525: StopSound() (1 input parameters) +Function 526: StopSound() (1 input parameters) Name: StopSound Return type: void Description: Stop playing a sound Param[1]: sound (type: Sound) -Function 526: PauseSound() (1 input parameters) +Function 527: PauseSound() (1 input parameters) Name: PauseSound Return type: void Description: Pause a sound Param[1]: sound (type: Sound) -Function 527: ResumeSound() (1 input parameters) +Function 528: ResumeSound() (1 input parameters) Name: ResumeSound Return type: void Description: Resume a paused sound Param[1]: sound (type: Sound) -Function 528: IsSoundPlaying() (1 input parameters) +Function 529: IsSoundPlaying() (1 input parameters) Name: IsSoundPlaying Return type: bool Description: Check if a sound is currently playing Param[1]: sound (type: Sound) -Function 529: SetSoundVolume() (2 input parameters) +Function 530: SetSoundVolume() (2 input parameters) Name: SetSoundVolume Return type: void Description: Set volume for a sound (1.0 is max level) Param[1]: sound (type: Sound) Param[2]: volume (type: float) -Function 530: SetSoundPitch() (2 input parameters) +Function 531: SetSoundPitch() (2 input parameters) Name: SetSoundPitch Return type: void Description: Set pitch for a sound (1.0 is base level) Param[1]: sound (type: Sound) Param[2]: pitch (type: float) -Function 531: SetSoundPan() (2 input parameters) +Function 532: SetSoundPan() (2 input parameters) Name: SetSoundPan Return type: void Description: Set pan for a sound (0.5 is center) Param[1]: sound (type: Sound) Param[2]: pan (type: float) -Function 532: WaveCopy() (1 input parameters) +Function 533: WaveCopy() (1 input parameters) Name: WaveCopy Return type: Wave Description: Copy a wave to a new wave Param[1]: wave (type: Wave) -Function 533: WaveCrop() (3 input parameters) +Function 534: WaveCrop() (3 input parameters) Name: WaveCrop Return type: void Description: Crop a wave to defined frames range Param[1]: wave (type: Wave *) Param[2]: initFrame (type: int) Param[3]: finalFrame (type: int) -Function 534: WaveFormat() (4 input parameters) +Function 535: WaveFormat() (4 input parameters) Name: WaveFormat Return type: void Description: Convert wave data to desired format @@ -4394,203 +4403,203 @@ Function 534: WaveFormat() (4 input parameters) Param[2]: sampleRate (type: int) Param[3]: sampleSize (type: int) Param[4]: channels (type: int) -Function 535: LoadWaveSamples() (1 input parameters) +Function 536: LoadWaveSamples() (1 input parameters) Name: LoadWaveSamples Return type: float * Description: Load samples data from wave as a 32bit float data array Param[1]: wave (type: Wave) -Function 536: UnloadWaveSamples() (1 input parameters) +Function 537: UnloadWaveSamples() (1 input parameters) Name: UnloadWaveSamples Return type: void Description: Unload samples data loaded with LoadWaveSamples() Param[1]: samples (type: float *) -Function 537: LoadMusicStream() (1 input parameters) +Function 538: LoadMusicStream() (1 input parameters) Name: LoadMusicStream Return type: Music Description: Load music stream from file Param[1]: fileName (type: const char *) -Function 538: LoadMusicStreamFromMemory() (3 input parameters) +Function 539: LoadMusicStreamFromMemory() (3 input parameters) Name: LoadMusicStreamFromMemory Return type: Music Description: Load music stream from data Param[1]: fileType (type: const char *) Param[2]: data (type: const unsigned char *) Param[3]: dataSize (type: int) -Function 539: IsMusicReady() (1 input parameters) +Function 540: IsMusicReady() (1 input parameters) Name: IsMusicReady Return type: bool Description: Checks if a music stream is ready Param[1]: music (type: Music) -Function 540: UnloadMusicStream() (1 input parameters) +Function 541: UnloadMusicStream() (1 input parameters) Name: UnloadMusicStream Return type: void Description: Unload music stream Param[1]: music (type: Music) -Function 541: PlayMusicStream() (1 input parameters) +Function 542: PlayMusicStream() (1 input parameters) Name: PlayMusicStream Return type: void Description: Start music playing Param[1]: music (type: Music) -Function 542: IsMusicStreamPlaying() (1 input parameters) +Function 543: IsMusicStreamPlaying() (1 input parameters) Name: IsMusicStreamPlaying Return type: bool Description: Check if music is playing Param[1]: music (type: Music) -Function 543: UpdateMusicStream() (1 input parameters) +Function 544: UpdateMusicStream() (1 input parameters) Name: UpdateMusicStream Return type: void Description: Updates buffers for music streaming Param[1]: music (type: Music) -Function 544: StopMusicStream() (1 input parameters) +Function 545: StopMusicStream() (1 input parameters) Name: StopMusicStream Return type: void Description: Stop music playing Param[1]: music (type: Music) -Function 545: PauseMusicStream() (1 input parameters) +Function 546: PauseMusicStream() (1 input parameters) Name: PauseMusicStream Return type: void Description: Pause music playing Param[1]: music (type: Music) -Function 546: ResumeMusicStream() (1 input parameters) +Function 547: ResumeMusicStream() (1 input parameters) Name: ResumeMusicStream Return type: void Description: Resume playing paused music Param[1]: music (type: Music) -Function 547: SeekMusicStream() (2 input parameters) +Function 548: SeekMusicStream() (2 input parameters) Name: SeekMusicStream Return type: void Description: Seek music to a position (in seconds) Param[1]: music (type: Music) Param[2]: position (type: float) -Function 548: SetMusicVolume() (2 input parameters) +Function 549: SetMusicVolume() (2 input parameters) Name: SetMusicVolume Return type: void Description: Set volume for music (1.0 is max level) Param[1]: music (type: Music) Param[2]: volume (type: float) -Function 549: SetMusicPitch() (2 input parameters) +Function 550: SetMusicPitch() (2 input parameters) Name: SetMusicPitch Return type: void Description: Set pitch for a music (1.0 is base level) Param[1]: music (type: Music) Param[2]: pitch (type: float) -Function 550: SetMusicPan() (2 input parameters) +Function 551: SetMusicPan() (2 input parameters) Name: SetMusicPan Return type: void Description: Set pan for a music (0.5 is center) Param[1]: music (type: Music) Param[2]: pan (type: float) -Function 551: GetMusicTimeLength() (1 input parameters) +Function 552: GetMusicTimeLength() (1 input parameters) Name: GetMusicTimeLength Return type: float Description: Get music time length (in seconds) Param[1]: music (type: Music) -Function 552: GetMusicTimePlayed() (1 input parameters) +Function 553: GetMusicTimePlayed() (1 input parameters) Name: GetMusicTimePlayed Return type: float Description: Get current music time played (in seconds) Param[1]: music (type: Music) -Function 553: LoadAudioStream() (3 input parameters) +Function 554: LoadAudioStream() (3 input parameters) Name: LoadAudioStream Return type: AudioStream Description: Load audio stream (to stream raw audio pcm data) Param[1]: sampleRate (type: unsigned int) Param[2]: sampleSize (type: unsigned int) Param[3]: channels (type: unsigned int) -Function 554: IsAudioStreamReady() (1 input parameters) +Function 555: IsAudioStreamReady() (1 input parameters) Name: IsAudioStreamReady Return type: bool Description: Checks if an audio stream is ready Param[1]: stream (type: AudioStream) -Function 555: UnloadAudioStream() (1 input parameters) +Function 556: UnloadAudioStream() (1 input parameters) Name: UnloadAudioStream Return type: void Description: Unload audio stream and free memory Param[1]: stream (type: AudioStream) -Function 556: UpdateAudioStream() (3 input parameters) +Function 557: UpdateAudioStream() (3 input parameters) Name: UpdateAudioStream Return type: void Description: Update audio stream buffers with data Param[1]: stream (type: AudioStream) Param[2]: data (type: const void *) Param[3]: frameCount (type: int) -Function 557: IsAudioStreamProcessed() (1 input parameters) +Function 558: IsAudioStreamProcessed() (1 input parameters) Name: IsAudioStreamProcessed Return type: bool Description: Check if any audio stream buffers requires refill Param[1]: stream (type: AudioStream) -Function 558: PlayAudioStream() (1 input parameters) +Function 559: PlayAudioStream() (1 input parameters) Name: PlayAudioStream Return type: void Description: Play audio stream Param[1]: stream (type: AudioStream) -Function 559: PauseAudioStream() (1 input parameters) +Function 560: PauseAudioStream() (1 input parameters) Name: PauseAudioStream Return type: void Description: Pause audio stream Param[1]: stream (type: AudioStream) -Function 560: ResumeAudioStream() (1 input parameters) +Function 561: ResumeAudioStream() (1 input parameters) Name: ResumeAudioStream Return type: void Description: Resume audio stream Param[1]: stream (type: AudioStream) -Function 561: IsAudioStreamPlaying() (1 input parameters) +Function 562: IsAudioStreamPlaying() (1 input parameters) Name: IsAudioStreamPlaying Return type: bool Description: Check if audio stream is playing Param[1]: stream (type: AudioStream) -Function 562: StopAudioStream() (1 input parameters) +Function 563: StopAudioStream() (1 input parameters) Name: StopAudioStream Return type: void Description: Stop audio stream Param[1]: stream (type: AudioStream) -Function 563: SetAudioStreamVolume() (2 input parameters) +Function 564: SetAudioStreamVolume() (2 input parameters) Name: SetAudioStreamVolume Return type: void Description: Set volume for audio stream (1.0 is max level) Param[1]: stream (type: AudioStream) Param[2]: volume (type: float) -Function 564: SetAudioStreamPitch() (2 input parameters) +Function 565: SetAudioStreamPitch() (2 input parameters) Name: SetAudioStreamPitch Return type: void Description: Set pitch for audio stream (1.0 is base level) Param[1]: stream (type: AudioStream) Param[2]: pitch (type: float) -Function 565: SetAudioStreamPan() (2 input parameters) +Function 566: SetAudioStreamPan() (2 input parameters) Name: SetAudioStreamPan Return type: void Description: Set pan for audio stream (0.5 is centered) Param[1]: stream (type: AudioStream) Param[2]: pan (type: float) -Function 566: SetAudioStreamBufferSizeDefault() (1 input parameters) +Function 567: SetAudioStreamBufferSizeDefault() (1 input parameters) Name: SetAudioStreamBufferSizeDefault Return type: void Description: Default size for new audio streams Param[1]: size (type: int) -Function 567: SetAudioStreamCallback() (2 input parameters) +Function 568: SetAudioStreamCallback() (2 input parameters) Name: SetAudioStreamCallback Return type: void Description: Audio thread callback to request new data Param[1]: stream (type: AudioStream) Param[2]: callback (type: AudioCallback) -Function 568: AttachAudioStreamProcessor() (2 input parameters) +Function 569: AttachAudioStreamProcessor() (2 input parameters) Name: AttachAudioStreamProcessor Return type: void Description: Attach audio stream processor to stream, receives the samples as 'float' Param[1]: stream (type: AudioStream) Param[2]: processor (type: AudioCallback) -Function 569: DetachAudioStreamProcessor() (2 input parameters) +Function 570: DetachAudioStreamProcessor() (2 input parameters) Name: DetachAudioStreamProcessor Return type: void Description: Detach audio stream processor from stream Param[1]: stream (type: AudioStream) Param[2]: processor (type: AudioCallback) -Function 570: AttachAudioMixedProcessor() (1 input parameters) +Function 571: AttachAudioMixedProcessor() (1 input parameters) Name: AttachAudioMixedProcessor Return type: void Description: Attach audio stream processor to the entire audio pipeline, receives the samples as 'float' Param[1]: processor (type: AudioCallback) -Function 571: DetachAudioMixedProcessor() (1 input parameters) +Function 572: DetachAudioMixedProcessor() (1 input parameters) Name: DetachAudioMixedProcessor Return type: void Description: Detach audio stream processor from the entire audio pipeline diff --git a/parser/output/raylib_api.xml b/parser/output/raylib_api.xml index 39e86c211..22f9b0ec7 100644 --- a/parser/output/raylib_api.xml +++ b/parser/output/raylib_api.xml @@ -670,7 +670,7 @@ - + @@ -1966,6 +1966,13 @@ + + + + + + + From 4311db5ba5eb23c8f1d71268010afb135f3e1e25 Mon Sep 17 00:00:00 2001 From: Peter0x44 Date: Mon, 24 Jun 2024 08:29:10 +0100 Subject: [PATCH 03/11] [rmodels] Fix -Wstringop-truncation warning (#4096) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit rmodels.c: In function ‘LoadBoneInfoGLTF.isra’: rmodels.c:4874:32: warning: ‘strncpy’ specified bound 32 equals destination size [-Wstringop-truncation] 4874 | if (node.name != NULL) strncpy(bones[i].name, node.name, sizeof(bones[i].name)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- src/rmodels.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/rmodels.c b/src/rmodels.c index a169ec50d..a323292ca 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -4871,7 +4871,11 @@ static BoneInfo *LoadBoneInfoGLTF(cgltf_skin skin, int *boneCount) for (unsigned int i = 0; i < skin.joints_count; i++) { cgltf_node node = *skin.joints[i]; - if (node.name != NULL) strncpy(bones[i].name, node.name, sizeof(bones[i].name)); + if (node.name != NULL) + { + strncpy(bones[i].name, node.name, sizeof(bones[i].name)); + bones[i].name[sizeof(bones[i].name) - 1] = '\0'; + } // Find parent bone index unsigned int parentIndex = -1; From e96bab7ce63568d86fae4fd664fa06625f76f1ee Mon Sep 17 00:00:00 2001 From: Jeffery Myers Date: Mon, 24 Jun 2024 08:47:32 -0700 Subject: [PATCH 04/11] [Build] Fix warnings when building in VS 2022 (#4095) * Update raylib_api.* by CI * Fix warnings when building examples in MSVC 2022 * fix auto-format that sneaked in there. --------- Co-authored-by: github-actions[bot] --- examples/audio/audio_mixed_processor.c | 2 +- examples/core/core_2d_camera_platformer.c | 4 +- examples/core/core_input_mouse_wheel.c | 2 +- examples/core/core_random_sequence.c | 16 +++---- examples/core/core_smooth_pixelperfect.c | 8 ++-- examples/core/core_storage_values.c | 2 +- examples/models/models_draw_cube_texture.c | 2 +- examples/shaders/shaders_deferred_render.c | 6 +-- examples/shapes/shapes_lines_bezier.c | 4 +- examples/shapes/shapes_splines_drawing.c | 2 +- .../examples/shapes_splines_drawing.vcxproj | 16 +++---- src/rcore.c | 2 +- src/rlgl.h | 4 +- src/rtext.c | 2 +- src/rtextures.c | 46 +++++++++---------- 15 files changed, 60 insertions(+), 58 deletions(-) diff --git a/examples/audio/audio_mixed_processor.c b/examples/audio/audio_mixed_processor.c index 3a008f3e2..fd970dd19 100644 --- a/examples/audio/audio_mixed_processor.c +++ b/examples/audio/audio_mixed_processor.c @@ -97,7 +97,7 @@ int main(void) DrawRectangle(199, 199, 402, 34, LIGHTGRAY); for (int i = 0; i < 400; i++) { - DrawLine(201 + i, 232 - averageVolume[i] * 32, 201 + i, 232, MAROON); + DrawLine(201 + i, 232 - (int)averageVolume[i] * 32, 201 + i, 232, MAROON); } DrawRectangleLines(199, 199, 402, 34, GRAY); diff --git a/examples/core/core_2d_camera_platformer.c b/examples/core/core_2d_camera_platformer.c index 75fd6cf6a..3743de80b 100644 --- a/examples/core/core_2d_camera_platformer.c +++ b/examples/core/core_2d_camera_platformer.c @@ -133,10 +133,10 @@ int main(void) for (int i = 0; i < envItemsLength; i++) DrawRectangleRec(envItems[i].rect, envItems[i].color); - Rectangle playerRect = { player.position.x - 20, player.position.y - 40, 40, 40 }; + Rectangle playerRect = { player.position.x - 20, player.position.y - 40, 40.0f, 40.0f }; DrawRectangleRec(playerRect, RED); - DrawCircle(player.position.x, player.position.y, 5, GOLD); + DrawCircleV(player.position, 5.0f, GOLD); EndMode2D(); diff --git a/examples/core/core_input_mouse_wheel.c b/examples/core/core_input_mouse_wheel.c index 54f33545e..d261e9348 100644 --- a/examples/core/core_input_mouse_wheel.c +++ b/examples/core/core_input_mouse_wheel.c @@ -36,7 +36,7 @@ int main(void) { // Update //---------------------------------------------------------------------------------- - boxPositionY -= (GetMouseWheelMove()*scrollSpeed); + boxPositionY -= (int)(GetMouseWheelMove()*scrollSpeed); //---------------------------------------------------------------------------------- // Draw diff --git a/examples/core/core_random_sequence.c b/examples/core/core_random_sequence.c index c946b64da..2f7c3be95 100644 --- a/examples/core/core_random_sequence.c +++ b/examples/core/core_random_sequence.c @@ -41,7 +41,7 @@ int main(void) { int rectCount = 20; float rectSize = (float)screenWidth/rectCount; - ColorRect* rectangles = GenerateRandomColorRectSequence(rectCount, rectSize, screenWidth, 0.75f * screenHeight); + ColorRect* rectangles = GenerateRandomColorRectSequence((float)rectCount, rectSize, (float)screenWidth, 0.75f * screenHeight); SetTargetFPS(60); //-------------------------------------------------------------------------------------- @@ -62,7 +62,7 @@ int main(void) { rectCount++; rectSize = (float)screenWidth/rectCount; free(rectangles); - rectangles = GenerateRandomColorRectSequence(rectCount, rectSize, screenWidth, 0.75f * screenHeight); + rectangles = GenerateRandomColorRectSequence((float)rectCount, rectSize, (float)screenWidth, 0.75f * screenHeight); } if(IsKeyPressed(KEY_DOWN)) @@ -71,7 +71,7 @@ int main(void) { rectCount--; rectSize = (float)screenWidth/rectCount; free(rectangles); - rectangles = GenerateRandomColorRectSequence(rectCount, rectSize, screenWidth, 0.75f * screenHeight); + rectangles = GenerateRandomColorRectSequence((float)rectCount, rectSize, (float)screenWidth, 0.75f * screenHeight); } } @@ -121,17 +121,17 @@ static Color GenerateRandomColor() } static ColorRect* GenerateRandomColorRectSequence(float rectCount, float rectWidth, float screenWidth, float screenHeight){ - int *seq = LoadRandomSequence(rectCount, 0, rectCount-1); - ColorRect* rectangles = (ColorRect *)malloc(rectCount*sizeof(ColorRect)); + int *seq = LoadRandomSequence((unsigned int)rectCount, 0, (unsigned int)rectCount-1); + ColorRect* rectangles = (ColorRect *)malloc((int)rectCount*sizeof(ColorRect)); float rectSeqWidth = rectCount * rectWidth; - int startX = (screenWidth - rectSeqWidth) * 0.5f; + float startX = (screenWidth - rectSeqWidth) * 0.5f; for(int x=0;x Level3 Disabled - WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + WIN32;_CRT_SECURE_NO_WARNINGS;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) CompileAsC $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) @@ -219,7 +219,7 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + WIN32;_CRT_SECURE_NO_WARNINGS;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) CompileAsC $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) /FS %(AdditionalOptions) @@ -237,7 +237,7 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + WIN32;_CRT_SECURE_NO_WARNINGS;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) CompileAsC $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) @@ -258,7 +258,7 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + WIN32;_CRT_SECURE_NO_WARNINGS;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) CompileAsC $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) @@ -281,7 +281,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + WIN32;_CRT_SECURE_NO_WARNINGS;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) CompileAsC true @@ -303,7 +303,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + WIN32;_CRT_SECURE_NO_WARNINGS;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) CompileAsC true @@ -325,7 +325,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + WIN32;_CRT_SECURE_NO_WARNINGS;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) CompileAsC true @@ -353,7 +353,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + WIN32;_CRT_SECURE_NO_WARNINGS;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) CompileAsC true diff --git a/src/rcore.c b/src/rcore.c index a4fc4d675..2c9af11d5 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -856,7 +856,7 @@ void EndDrawing(void) #ifndef GIF_RECORD_FRAMERATE #define GIF_RECORD_FRAMERATE 10 #endif - gifFrameCounter += GetFrameTime()*1000; + gifFrameCounter += (unsigned int)(GetFrameTime()*1000); // NOTE: We record one gif frame depending on the desired gif framerate if (gifFrameCounter > 1000/GIF_RECORD_FRAMERATE) diff --git a/src/rlgl.h b/src/rlgl.h index 530e44efc..bdf665a44 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -3945,7 +3945,9 @@ void rlSetVertexAttribute(unsigned int index, int compSize, int type, bool norma // Additional types (depends on OpenGL version or extensions): // - GL_HALF_FLOAT, GL_FLOAT, GL_DOUBLE, GL_FIXED, // - GL_INT_2_10_10_10_REV, GL_UNSIGNED_INT_2_10_10_10_REV, GL_UNSIGNED_INT_10F_11F_11F_REV - glVertexAttribPointer(index, compSize, type, normalized, stride, (void *)offset); + + size_t offsetNative = offset; + glVertexAttribPointer(index, compSize, type, normalized, stride, (void *)offsetNative); #endif } diff --git a/src/rtext.c b/src/rtext.c index 62d786eac..35e69420f 100644 --- a/src/rtext.c +++ b/src/rtext.c @@ -2297,7 +2297,7 @@ static Font LoadBMFont(const char *fileName) } else { - font.glyphs[i].image = GenImageColor(font.recs[i].width, font.recs[i].height, BLACK); + font.glyphs[i].image = GenImageColor((int)font.recs[i].width, (int)font.recs[i].height, BLACK); TRACELOG(LOG_WARNING, "FONT: [%s] Some characters data not correctly provided", fileName); } } diff --git a/src/rtextures.c b/src/rtextures.c index df9ccbdf4..783e9b7f9 100644 --- a/src/rtextures.c +++ b/src/rtextures.c @@ -3646,10 +3646,10 @@ void ImageDrawTriangle(Image *dst, Vector2 v1, Vector2 v2, Vector2 v3, Color col { // Calculate the 2D bounding box of the triangle // Determine the minimum and maximum x and y coordinates of the triangle vertices - int xMin = (v1.x < v2.x)? ((v1.x < v3.x)? v1.x : v3.x) : ((v2.x < v3.x)? v2.x : v3.x); - int yMin = (v1.y < v2.y)? ((v1.y < v3.y)? v1.y : v3.y) : ((v2.y < v3.y)? v2.y : v3.y); - int xMax = (v1.x > v2.x)? ((v1.x > v3.x)? v1.x : v3.x) : ((v2.x > v3.x)? v2.x : v3.x); - int yMax = (v1.y > v2.y)? ((v1.y > v3.y)? v1.y : v3.y) : ((v2.y > v3.y)? v2.y : v3.y); + int xMin = (int)((v1.x < v2.x)? ((v1.x < v3.x) ? v1.x : v3.x) : ((v2.x < v3.x) ? v2.x : v3.x)); + int yMin = (int)((v1.y < v2.y)? ((v1.y < v3.y) ? v1.y : v3.y) : ((v2.y < v3.y) ? v2.y : v3.y)); + int xMax = (int)((v1.x > v2.x)? ((v1.x > v3.x) ? v1.x : v3.x) : ((v2.x > v3.x) ? v2.x : v3.x)); + int yMax = (int)((v1.y > v2.y)? ((v1.y > v3.y) ? v1.y : v3.y) : ((v2.y > v3.y) ? v2.y : v3.y)); // Clamp the bounding box to the image dimensions if (xMin < 0) xMin = 0; @@ -3664,9 +3664,9 @@ void ImageDrawTriangle(Image *dst, Vector2 v1, Vector2 v2, Vector2 v3, Color col // Barycentric interpolation setup // Calculate the step increments for the barycentric coordinates - int w1XStep = v3.y - v2.y, w1YStep = v2.x - v3.x; - int w2XStep = v1.y - v3.y, w2YStep = v3.x - v1.x; - int w3XStep = v2.y - v1.y, w3YStep = v1.x - v2.x; + int w1XStep = (int)(v3.y - v2.y), w1YStep = (int)(v2.x - v3.x); + int w2XStep = (int)(v1.y - v3.y), w2YStep = (int)(v3.x - v1.x); + int w3XStep = (int)(v2.y - v1.y), w3YStep = (int)(v1.x - v2.x); // If the triangle is a back face, invert the steps if (isBackFace) @@ -3677,9 +3677,9 @@ void ImageDrawTriangle(Image *dst, Vector2 v1, Vector2 v2, Vector2 v3, Color col } // Calculate the initial barycentric coordinates for the top-left point of the bounding box - int w1Row = (xMin - v2.x)*w1XStep + w1YStep*(yMin - v2.y); - int w2Row = (xMin - v3.x)*w2XStep + w2YStep*(yMin - v3.y); - int w3Row = (xMin - v1.x)*w3XStep + w3YStep*(yMin - v1.y); + int w1Row = (int)((xMin - v2.x)*w1XStep + w1YStep*(yMin - v2.y)); + int w2Row = (int)((xMin - v3.x)*w2XStep + w2YStep*(yMin - v3.y)); + int w3Row = (int)((xMin - v1.x)*w3XStep + w3YStep*(yMin - v1.y)); // Rasterization loop // Iterate through each pixel in the bounding box @@ -3713,10 +3713,10 @@ void ImageDrawTriangleEx(Image *dst, Vector2 v1, Vector2 v2, Vector2 v3, Color c { // Calculate the 2D bounding box of the triangle // Determine the minimum and maximum x and y coordinates of the triangle vertices - int xMin = (v1.x < v2.x)? ((v1.x < v3.x)? v1.x : v3.x) : ((v2.x < v3.x)? v2.x : v3.x); - int yMin = (v1.y < v2.y)? ((v1.y < v3.y)? v1.y : v3.y) : ((v2.y < v3.y)? v2.y : v3.y); - int xMax = (v1.x > v2.x)? ((v1.x > v3.x)? v1.x : v3.x) : ((v2.x > v3.x)? v2.x : v3.x); - int yMax = (v1.y > v2.y)? ((v1.y > v3.y)? v1.y : v3.y) : ((v2.y > v3.y)? v2.y : v3.y); + int xMin = (int)((v1.x < v2.x)? ((v1.x < v3.x)? v1.x : v3.x) : ((v2.x < v3.x)? v2.x : v3.x)); + int yMin = (int)((v1.y < v2.y)? ((v1.y < v3.y)? v1.y : v3.y) : ((v2.y < v3.y)? v2.y : v3.y)); + int xMax = (int)((v1.x > v2.x)? ((v1.x > v3.x)? v1.x : v3.x) : ((v2.x > v3.x)? v2.x : v3.x)); + int yMax = (int)((v1.y > v2.y)? ((v1.y > v3.y)? v1.y : v3.y) : ((v2.y > v3.y)? v2.y : v3.y)); // Clamp the bounding box to the image dimensions if (xMin < 0) xMin = 0; @@ -3731,9 +3731,9 @@ void ImageDrawTriangleEx(Image *dst, Vector2 v1, Vector2 v2, Vector2 v3, Color c // Barycentric interpolation setup // Calculate the step increments for the barycentric coordinates - int w1XStep = v3.y - v2.y, w1YStep = v2.x - v3.x; - int w2XStep = v1.y - v3.y, w2YStep = v3.x - v1.x; - int w3XStep = v2.y - v1.y, w3YStep = v1.x - v2.x; + int w1XStep = (int)(v3.y - v2.y), w1YStep = (int)(v2.x - v3.x); + int w2XStep = (int)(v1.y - v3.y), w2YStep = (int)(v3.x - v1.x); + int w3XStep = (int)(v2.y - v1.y), w3YStep = (int)(v1.x - v2.x); // If the triangle is a back face, invert the steps if (isBackFace) @@ -3744,9 +3744,9 @@ void ImageDrawTriangleEx(Image *dst, Vector2 v1, Vector2 v2, Vector2 v3, Color c } // Calculate the initial barycentric coordinates for the top-left point of the bounding box - int w1Row = (xMin - v2.x)*w1XStep + w1YStep*(yMin - v2.y); - int w2Row = (xMin - v3.x)*w2XStep + w2YStep*(yMin - v3.y); - int w3Row = (xMin - v1.x)*w3XStep + w3YStep*(yMin - v1.y); + int w1Row = (int)((xMin - v2.x)*w1XStep + w1YStep*(yMin - v2.y)); + int w2Row = (int)((xMin - v3.x)*w2XStep + w2YStep*(yMin - v3.y)); + int w3Row = (int)((xMin - v1.x)*w3XStep + w3YStep*(yMin - v1.y)); // Calculate the inverse of the sum of the barycentric coordinates for normalization // NOTE 1: Here, we act as if we multiply by 255 the reciprocal, which avoids additional @@ -3799,9 +3799,9 @@ void ImageDrawTriangleEx(Image *dst, Vector2 v1, Vector2 v2, Vector2 v3, Color c // Draw triangle outline within an image void ImageDrawTriangleLines(Image *dst, Vector2 v1, Vector2 v2, Vector2 v3, Color color) { - ImageDrawLine(dst, v1.x, v1.y, v2.x, v2.y, color); - ImageDrawLine(dst, v2.x, v2.y, v3.x, v3.y, color); - ImageDrawLine(dst, v3.x, v3.y, v1.x, v1.y, color); + ImageDrawLine(dst, (int)v1.x, (int)v1.y, (int)v2.x, (int)v2.y, color); + ImageDrawLine(dst, (int)v2.x, (int)v2.y, (int)v3.x, (int)v3.y, color); + ImageDrawLine(dst, (int)v3.x, (int)v3.y, (int)v1.x, (int)v1.y, color); } // Draw a triangle fan defined by points within an image (first vertex is the center) From 385e60dd41d49d56ac1bf44b68549070d108e941 Mon Sep 17 00:00:00 2001 From: Ray Date: Mon, 24 Jun 2024 18:41:33 +0200 Subject: [PATCH 05/11] Minor tweaks --- src/raylib.h | 2 +- src/rlgl.h | 2 +- src/rshapes.c | 2 +- src/rtextures.c | 5 +++-- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/raylib.h b/src/raylib.h index 8cd1d1ec0..c3c546c36 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1342,7 +1342,7 @@ RLAPI void ImageAlphaClear(Image *image, Color color, float threshold); RLAPI void ImageAlphaMask(Image *image, Image alphaMask); // Apply alpha mask to image RLAPI void ImageAlphaPremultiply(Image *image); // Premultiply alpha channel RLAPI void ImageBlurGaussian(Image *image, int blurSize); // Apply Gaussian blur using a box blur approximation -RLAPI void ImageKernelConvolution(Image *image, float *kernel, int kernelSize); // Apply Custom Square image convolution kernel +RLAPI void ImageKernelConvolution(Image *image, const float *kernel, int kernelSize); // Apply custom square convolution kernel to image RLAPI void ImageResize(Image *image, int newWidth, int newHeight); // Resize image (Bicubic scaling algorithm) RLAPI void ImageResizeNN(Image *image, int newWidth,int newHeight); // Resize image (Nearest-Neighbor scaling algorithm) RLAPI void ImageResizeCanvas(Image *image, int newWidth, int newHeight, int offsetX, int offsetY, Color fill); // Resize canvas and fill with color diff --git a/src/rlgl.h b/src/rlgl.h index bdf665a44..98d43ea57 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -1406,7 +1406,7 @@ void rlBegin(int mode) } } -void rlEnd() { glEnd(); } +void rlEnd(void) { glEnd(); } void rlVertex2i(int x, int y) { glVertex2i(x, y); } void rlVertex2f(float x, float y) { glVertex2f(x, y); } void rlVertex3f(float x, float y, float z) { glVertex3f(x, y, z); } diff --git a/src/rshapes.c b/src/rshapes.c index 95c54770e..49970d7fb 100644 --- a/src/rshapes.c +++ b/src/rshapes.c @@ -126,7 +126,7 @@ Rectangle GetShapesTextureRectangle(void) // Draw a pixel void DrawPixel(int posX, int posY, Color color) { - DrawPixelV((Vector2){ (float)posX, (float)posY }, color); + DrawPixelV((Vector2){ (float)posX, (float)posY }, color); } // Draw a pixel (Vector version) diff --git a/src/rtextures.c b/src/rtextures.c index 783e9b7f9..e914db419 100644 --- a/src/rtextures.c +++ b/src/rtextures.c @@ -2156,8 +2156,9 @@ void ImageBlurGaussian(Image *image, int blurSize) ImageFormat(image, format); } -// The kernel matrix is assumed to be square. Only supply the width of the kernel -void ImageKernelConvolution(Image *image, float* kernel, int kernelSize) +// Apply custom square convolution kernel to image +// NOTE: The convolution kernel matrix is expected to be square +void ImageKernelConvolution(Image *image, const float *kernel, int kernelSize) { if ((image->data == NULL) || (image->width == 0) || (image->height == 0) || kernel == NULL) return; From ec95ee85a386db29f059b9738cd5ec9329f1661e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 24 Jun 2024 16:42:01 +0000 Subject: [PATCH 06/11] Update raylib_api.* by CI --- parser/output/raylib_api.json | 4 ++-- parser/output/raylib_api.lua | 4 ++-- parser/output/raylib_api.txt | 4 ++-- parser/output/raylib_api.xml | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/parser/output/raylib_api.json b/parser/output/raylib_api.json index a75b94ed0..2baa6c3f3 100644 --- a/parser/output/raylib_api.json +++ b/parser/output/raylib_api.json @@ -7351,7 +7351,7 @@ }, { "name": "ImageKernelConvolution", - "description": "Apply Custom Square image convolution kernel", + "description": "Apply custom square convolution kernel to image", "returnType": "void", "params": [ { @@ -7359,7 +7359,7 @@ "name": "image" }, { - "type": "float *", + "type": "const float *", "name": "kernel" }, { diff --git a/parser/output/raylib_api.lua b/parser/output/raylib_api.lua index 7dcb1fa41..a6d91cd6d 100644 --- a/parser/output/raylib_api.lua +++ b/parser/output/raylib_api.lua @@ -5617,11 +5617,11 @@ return { }, { name = "ImageKernelConvolution", - description = "Apply Custom Square image convolution kernel", + description = "Apply custom square convolution kernel to image", returnType = "void", params = { {type = "Image *", name = "image"}, - {type = "float *", name = "kernel"}, + {type = "const float *", name = "kernel"}, {type = "int", name = "kernelSize"} } }, diff --git a/parser/output/raylib_api.txt b/parser/output/raylib_api.txt index fd082d074..f283ad795 100644 --- a/parser/output/raylib_api.txt +++ b/parser/output/raylib_api.txt @@ -2840,9 +2840,9 @@ Function 303: ImageBlurGaussian() (2 input parameters) Function 304: ImageKernelConvolution() (3 input parameters) Name: ImageKernelConvolution Return type: void - Description: Apply Custom Square image convolution kernel + Description: Apply custom square convolution kernel to image Param[1]: image (type: Image *) - Param[2]: kernel (type: float *) + Param[2]: kernel (type: const float *) Param[3]: kernelSize (type: int) Function 305: ImageResize() (3 input parameters) Name: ImageResize diff --git a/parser/output/raylib_api.xml b/parser/output/raylib_api.xml index 22f9b0ec7..fa953b626 100644 --- a/parser/output/raylib_api.xml +++ b/parser/output/raylib_api.xml @@ -1842,9 +1842,9 @@ - + - + From 3e441ae98b262c1f5a746d49491918c862137fef Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 25 Jun 2024 16:37:20 +0200 Subject: [PATCH 07/11] REVIEWED: `DrawLine()` #4075 --- src/rshapes.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/rshapes.c b/src/rshapes.c index 49970d7fb..a08cb49e1 100644 --- a/src/rshapes.c +++ b/src/rshapes.c @@ -179,8 +179,8 @@ void DrawLine(int startPosX, int startPosY, int endPosX, int endPosY, Color colo rlBegin(RL_LINES); rlColor4ub(color.r, color.g, color.b, color.a); // WARNING: Adding 0.5f offset to "center" point on selected pixel - rlVertex2f((float)startPosX + 0.5f, (float)startPosY + 0.5f); - rlVertex2f((float)endPosX + 0.5f, (float)endPosY + 0.5f); + rlVertex2f((float)startPosX, (float)startPosY); + rlVertex2f((float)endPosX, (float)endPosY); rlEnd(); } @@ -190,8 +190,8 @@ void DrawLineV(Vector2 startPos, Vector2 endPos, Color color) rlBegin(RL_LINES); rlColor4ub(color.r, color.g, color.b, color.a); // WARNING: Adding 0.5f offset to "center" point on selected pixel - rlVertex2f(startPos.x + 0.5f, startPos.y + 0.5f); - rlVertex2f(endPos.x + 0.5f, endPos.y + 0.5f); + rlVertex2f(startPos.x, startPos.y); + rlVertex2f(endPos.x, endPos.y); rlEnd(); } From dfabbd8ba8342169247685c294ae09f882f48e2c Mon Sep 17 00:00:00 2001 From: Peter0x44 Date: Tue, 25 Jun 2024 20:38:55 +0100 Subject: [PATCH 08/11] [rtext] Don't return default font if LoadFontEx fails (#4077) It is currently impossible to check a font loaded successfully with IsFontReady because LoadFontEx will always return a valid font. DrawTextEx has this check: if (font.texture.id == 0) font = GetFontDefault(); // Security check in case of not valid font So anyone relying on the default font as a fallback for fonts failing to load should still be covered. --- src/rtext.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/rtext.c b/src/rtext.c index 35e69420f..55061a1bd 100644 --- a/src/rtext.c +++ b/src/rtext.c @@ -394,7 +394,6 @@ Font LoadFontEx(const char *fileName, int fontSize, int *codepoints, int codepoi UnloadFileData(fileData); } - else font = GetFontDefault(); return font; } From 4239e66c55cc36ac5fe4c764d786638b4cece312 Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 25 Jun 2024 21:39:43 +0200 Subject: [PATCH 09/11] Update rshapes.c --- src/rshapes.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/rshapes.c b/src/rshapes.c index a08cb49e1..b119f50ec 100644 --- a/src/rshapes.c +++ b/src/rshapes.c @@ -178,7 +178,6 @@ void DrawLine(int startPosX, int startPosY, int endPosX, int endPosY, Color colo { rlBegin(RL_LINES); rlColor4ub(color.r, color.g, color.b, color.a); - // WARNING: Adding 0.5f offset to "center" point on selected pixel rlVertex2f((float)startPosX, (float)startPosY); rlVertex2f((float)endPosX, (float)endPosY); rlEnd(); @@ -189,7 +188,6 @@ void DrawLineV(Vector2 startPos, Vector2 endPos, Color color) { rlBegin(RL_LINES); rlColor4ub(color.r, color.g, color.b, color.a); - // WARNING: Adding 0.5f offset to "center" point on selected pixel rlVertex2f(startPos.x, startPos.y); rlVertex2f(endPos.x, endPos.y); rlEnd(); From 0979eafa84c7c5b330a99067411afbc9d5cd13b5 Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 25 Jun 2024 21:40:41 +0200 Subject: [PATCH 10/11] WARNING: REMOVED: Default font fallback --- src/rtext.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/rtext.c b/src/rtext.c index 55061a1bd..8daf3a7bc 100644 --- a/src/rtext.c +++ b/src/rtext.c @@ -362,11 +362,7 @@ Font LoadFont(const char *fileName) UnloadImage(image); } - if (font.texture.id == 0) - { - TRACELOG(LOG_WARNING, "FONT: [%s] Failed to load font texture -> Using default font", fileName); - font = GetFontDefault(); - } + if (font.texture.id == 0) TRACELOG(LOG_WARNING, "FONT: [%s] Failed to load font texture -> Using default font", fileName); else { SetTextureFilter(font.texture, TEXTURE_FILTER_POINT); // By default, we set point filter (the best performance) From 37205bba84263c5168f7aaeef4da9c43c56a87e1 Mon Sep 17 00:00:00 2001 From: jspast <140563347+jspast@users.noreply.github.com> Date: Tue, 25 Jun 2024 17:15:29 -0300 Subject: [PATCH 11/11] [web] Fix undesired scrollbars on shell files (#4104) --- src/minshell.html | 8 ++++++-- src/shell.html | 5 +++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/minshell.html b/src/minshell.html index 38f3672b9..4068ca36c 100644 --- a/src/minshell.html +++ b/src/minshell.html @@ -34,8 +34,12 @@