From 15d25242be1fa49632512a243a4f50a5a864e9b4 Mon Sep 17 00:00:00 2001 From: Ray Date: Sun, 7 Jun 2026 18:41:44 +0200 Subject: [PATCH] REVIEWED: Comments to be more descriptive --- src/raylib.h | 12 ++++++------ src/rmodels.c | 6 +++--- src/rshapes.c | 4 ++-- src/rtext.c | 8 ++++---- src/rtextures.c | 4 ++-- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/raylib.h b/src/raylib.h index 7313ffaf3..5b282ea5a 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1461,7 +1461,7 @@ RLAPI void SetTextureWrap(Texture2D texture, int wrap); // Texture drawing functions RLAPI void DrawTexture(Texture2D texture, int posX, int posY, Color tint); // Draw a Texture2D RLAPI void DrawTextureV(Texture2D texture, Vector2 position, Color tint); // Draw a Texture2D with position defined as Vector2 -RLAPI void DrawTextureEx(Texture2D texture, Vector2 position, float rotation, float scale, Color tint); // Draw a Texture2D with extended parameters +RLAPI void DrawTextureEx(Texture2D texture, Vector2 position, float rotation, float scale, Color tint); // Draw a Texture2D with rotation and scale RLAPI void DrawTextureRec(Texture2D texture, Rectangle rec, Vector2 position, Color tint); // Draw a part of a texture defined by a rectangle RLAPI void DrawTexturePro(Texture2D texture, Rectangle srcrec, Rectangle dstrec, Vector2 origin, float rotation, Color tint); // Draw a part of a texture defined by a source rectangle to destination rectangle, with scaling and rotation RLAPI void DrawTextureNPatch(Texture2D texture, NPatchInfo nPatchInfo, Rectangle dstrec, Vector2 origin, float rotation, Color tint); // Draw a texture (or part of it) that stretches or shrinks nicely @@ -1492,7 +1492,7 @@ RLAPI int GetPixelDataSize(int width, int height, int format); // G // Font loading/unloading functions RLAPI Font GetFontDefault(void); // Get the default Font RLAPI Font LoadFont(const char *fileName); // Load font from file into GPU memory (VRAM) -RLAPI Font LoadFontEx(const char *fileName, int fontSize, const int *codepoints, int codepointCount); // Load font from file with extended parameters, use NULL for codepoints and 0 for codepointCount to load the default character set, font size is provided in pixels height +RLAPI Font LoadFontEx(const char *fileName, int fontSize, const int *codepoints, int codepointCount); // Load font from file with defined codepoints and generation size, use NULL for codepoints and 0 for codepointCount to load the default character set, font size is provided in pixels height RLAPI Font LoadFontFromImage(Image image, Color key, int firstChar); // Load font from Image (XNA style) RLAPI Font LoadFontFromMemory(const char *fileType, const unsigned char *fileData, int dataSize, int fontSize, const int *codepoints, int codepointCount); // Load font from memory buffer, fileType refers to extension: i.e. '.ttf' RLAPI bool IsFontValid(Font font); // Check if font is valid (font data loaded, WARNING: GPU texture not checked) @@ -1568,14 +1568,14 @@ RLAPI float TextToFloat(const char *text); RLAPI void DrawLine3D(Vector3 startPos, Vector3 endPos, Color color); // Draw a line in 3D world space RLAPI void DrawPoint3D(Vector3 position, Color color); // Draw a point in 3D space, actually a small line RLAPI void DrawCircle3D(Vector3 center, float radius, Vector3 rotationAxis, float rotationAngle, Color color); // Draw a circle in 3D world space -RLAPI void DrawTriangle3D(Vector3 v1, Vector3 v2, Vector3 v3, Color color); // Draw a color-filled triangle (vertex in counter-clockwise order!) +RLAPI void DrawTriangle3D(Vector3 v1, Vector3 v2, Vector3 v3, Color color); // Draw a color-filled triangle, counter-clockwise vertex order RLAPI void DrawTriangleStrip3D(const Vector3 *points, int pointCount, Color color); // Draw a triangle strip defined by points RLAPI void DrawCube(Vector3 position, float width, float height, float length, Color color); // Draw cube RLAPI void DrawCubeV(Vector3 position, Vector3 size, Color color); // Draw cube (Vector version) RLAPI void DrawCubeWires(Vector3 position, float width, float height, float length, Color color); // Draw cube wires RLAPI void DrawCubeWiresV(Vector3 position, Vector3 size, Color color); // Draw cube wires (Vector version) RLAPI void DrawSphere(Vector3 centerPos, float radius, Color color); // Draw sphere -RLAPI void DrawSphereEx(Vector3 centerPos, float radius, int rings, int slices, Color color); // Draw sphere with extended parameters +RLAPI void DrawSphereEx(Vector3 centerPos, float radius, int rings, int slices, Color color); // Draw sphere with defined rings and slices RLAPI void DrawSphereWires(Vector3 centerPos, float radius, int rings, int slices, Color color); // Draw sphere wires RLAPI void DrawCylinder(Vector3 position, float radiusTop, float radiusBottom, float height, int sides, Color color); // Draw a cylinder/cone RLAPI void DrawCylinderEx(Vector3 startPos, Vector3 endPos, float startRadius, float endRadius, int sides, Color color); // Draw a cylinder with base at startPos and top at endPos @@ -1600,9 +1600,9 @@ RLAPI BoundingBox GetModelBoundingBox(Model model); // Model drawing functions RLAPI void DrawModel(Model model, Vector3 position, float scale, Color tint); // Draw a model (with texture if set) -RLAPI void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model with extended parameters +RLAPI void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model with custom transform RLAPI void DrawModelWires(Model model, Vector3 position, float scale, Color tint); // Draw a model wires (with texture if set) -RLAPI void DrawModelWiresEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model wires (with texture if set) with extended parameters +RLAPI void DrawModelWiresEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model wires with custom transform RLAPI void DrawBoundingBox(BoundingBox box, Color color); // Draw bounding box (wires) RLAPI void DrawBillboard(Camera camera, Texture2D texture, Vector3 position, float scale, Color tint); // Draw a billboard texture RLAPI void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle rec, Vector3 position, Vector2 size, Color tint); // Draw a billboard texture defined by rectangle diff --git a/src/rmodels.c b/src/rmodels.c index 7f140bb6b..21f69c92e 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -435,7 +435,7 @@ void DrawSphere(Vector3 centerPos, float radius, Color color) DrawSphereEx(centerPos, radius, 16, 16, color); } -// Draw sphere with extended parameters +// Draw sphere with defined rings and slices void DrawSphereEx(Vector3 centerPos, float radius, int rings, int slices, Color color) { #if 0 @@ -3918,7 +3918,7 @@ void DrawModel(Model model, Vector3 position, float scale, Color tint) DrawModelEx(model, position, rotationAxis, 0.0f, vScale, tint); } -// Draw a model with extended parameters +// Draw a model with custom transform void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint) { // Calculate transformation matrix from function parameters @@ -3972,7 +3972,7 @@ void DrawModelWires(Model model, Vector3 position, float scale, Color tint) rlDisableWireMode(); } -// Draw a model wires (with texture if set) with extended parameters +// Draw a model wires with custom transform void DrawModelWiresEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint) { rlEnableWireMode(); diff --git a/src/rshapes.c b/src/rshapes.c index 38c8a1fbe..627ee24f0 100644 --- a/src/rshapes.c +++ b/src/rshapes.c @@ -908,8 +908,8 @@ void DrawRectangleLines(int posX, int posY, int width, int height, Color color) */ } -// Draw rectangle outline with extended parameters -void DrawRectangleLinesEx(Rectangle rec, float lineThick, Color color) +// Draw rectangle outline with line thickness +void DrawRectangleLinesEx(Rectangle rec, float thick, Color color) { if ((lineThick > rec.width) || (lineThick > rec.height)) { diff --git a/src/rtext.c b/src/rtext.c index f1de75421..79baa85e1 100644 --- a/src/rtext.c +++ b/src/rtext.c @@ -327,7 +327,7 @@ extern void UnloadFontDefault(void) defaultFont.recs = NULL; } -// Get the default font, useful to be used with extended parameters +// Get the default font Font GetFontDefault() { return defaultFont; @@ -381,9 +381,9 @@ Font LoadFont(const char *fileName) return font; } -// Load Font from TTF or BDF font file with generation parameters -// NOTE: You can pass an array with desired characters, those characters should be available in the font -// if array is NULL, default char set is selected 32..126 +// Load font from file with defined codepoints and generation size +// NOTE: NULL for codepoints and 0 for codepointCount to load the default character set (32..126), +// font size is provided in pixels height Font LoadFontEx(const char *fileName, int fontSize, const int *codepoints, int codepointCount) { Font font = { 0 }; diff --git a/src/rtextures.c b/src/rtextures.c index 9a359f0f2..84e4406bc 100644 --- a/src/rtextures.c +++ b/src/rtextures.c @@ -3738,7 +3738,7 @@ void ImageDrawRectangleLines(Image *dst, int posX, int posY, int width, int heig ImageDrawRectangleLinesEx(dst, rec, 1, color); } -// Draw rectangle lines within an image with extended parameters +// Draw rectangle lines within an image with line thickness void ImageDrawRectangleLinesEx(Image *dst, Rectangle rec, int thick, Color color) { ImageDrawRectangle(dst, (int)rec.x, (int)rec.y, (int)rec.width, thick, color); @@ -4488,7 +4488,7 @@ void DrawTextureV(Texture2D texture, Vector2 position, Color tint) DrawTextureEx(texture, position, 0, 1.0f, tint); } -// Draw a texture with extended parameters +// Draw a texture with rotation and scale void DrawTextureEx(Texture2D texture, Vector2 position, float rotation, float scale, Color tint) { Rectangle srcrec = { 0.0f, 0.0f, (float)texture.width, (float)texture.height };