REVIEWED: Code sections definition

This commit is contained in:
Ray
2025-09-02 12:10:40 +02:00
parent b6ae380260
commit 8f32c502a7
10 changed files with 19 additions and 25 deletions

View File

@@ -111,7 +111,7 @@ extern CoreData CORE; // Global CORE state context
static PlatformData platform = { 0 }; // Platform specific data static PlatformData platform = { 0 }; // Platform specific data
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
// Local Variables Definition // Global Variables Definition
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
#define SCANCODE_MAPPED_NUM 232 #define SCANCODE_MAPPED_NUM 232
static const KeyboardKey mapScancodeToKey[SCANCODE_MAPPED_NUM] = { static const KeyboardKey mapScancodeToKey[SCANCODE_MAPPED_NUM] = {

View File

@@ -156,7 +156,7 @@ extern CoreData CORE; // Global CORE state context
static PlatformData platform = { 0 }; // Platform specific data static PlatformData platform = { 0 }; // Platform specific data
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
// Local Variables Definition // Global Variables Definition
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
// NOTE: The complete evdev EV_KEY list can be found at /usr/include/linux/input-event-codes.h // NOTE: The complete evdev EV_KEY list can be found at /usr/include/linux/input-event-codes.h

View File

@@ -86,7 +86,7 @@ extern CoreData CORE; // Global CORE state context
static PlatformData platform = { 0 }; // Platform specific data static PlatformData platform = { 0 }; // Platform specific data
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
// Local Variables Definition // Global Variables Definition
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
static const char cursorLUT[11][12] = { static const char cursorLUT[11][12] = {
"default", // 0 MOUSE_CURSOR_DEFAULT "default", // 0 MOUSE_CURSOR_DEFAULT

View File

@@ -407,7 +407,7 @@ static AudioData AUDIO = { // Global AUDIO context
}; };
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
// Module specific Functions Declaration // Module Internal Functions Declaration
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
static void OnLog(void *pUserData, ma_uint32 level, const char *pMessage); static void OnLog(void *pUserData, ma_uint32 level, const char *pMessage);
@@ -2352,9 +2352,8 @@ void DetachAudioMixedProcessor(AudioCallback process)
} }
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
// Module specific Functions Definition // Module Internal Functions Definition
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
// Log callback function // Log callback function
static void OnLog(void *pUserData, ma_uint32 level, const char *pMessage) static void OnLog(void *pUserData, ma_uint32 level, const char *pMessage)
{ {

View File

@@ -115,7 +115,7 @@
#endif #endif
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
// Some basic Defines // Defines and Macros
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
#ifndef PI #ifndef PI
#define PI 3.14159265358979323846f #define PI 3.14159265358979323846f
@@ -201,7 +201,7 @@
#define RAYWHITE CLITERAL(Color){ 245, 245, 245, 255 } // My own White (raylib logo) #define RAYWHITE CLITERAL(Color){ 245, 245, 245, 255 } // My own White (raylib logo)
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
// Structures Definition // Types and Structures Definition
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
// Boolean type // Boolean type
#if (defined(__STDC__) && __STDC_VERSION__ >= 199901L) || (defined(_MSC_VER) && _MSC_VER >= 1800) #if (defined(__STDC__) && __STDC_VERSION__ >= 199901L) || (defined(_MSC_VER) && _MSC_VER >= 1800)

View File

@@ -1039,7 +1039,7 @@ RLAPI void rlLoadDrawQuad(void); // Load and draw a quad
#endif #endif
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
// Types and Structures Definition // Module Types and Structures Definition
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)
@@ -1145,7 +1145,7 @@ static PFNGLVERTEXATTRIBDIVISOREXTPROC glVertexAttribDivisor = NULL;
#endif #endif
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
// Module specific Functions Declaration // Module Functions Declaration
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)
static void rlLoadShaderDefault(void); // Load default shader static void rlLoadShaderDefault(void); // Load default shader
@@ -4864,7 +4864,7 @@ const char *rlGetPixelFormatName(unsigned int format)
} }
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
// Module specific Functions Definition // Module Functions Definition
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)
// Load default shader (just vertex positioning and texture coloring) // Load default shader (just vertex positioning and texture coloring)

View File

@@ -144,7 +144,7 @@
// ... // ...
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
// Module specific Functions Declaration // Module Internal Functions Declaration
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
#if defined(SUPPORT_FILEFORMAT_OBJ) #if defined(SUPPORT_FILEFORMAT_OBJ)
static Model LoadOBJ(const char *fileName); // Load OBJ mesh data static Model LoadOBJ(const char *fileName); // Load OBJ mesh data
@@ -171,7 +171,6 @@ static void ProcessMaterialsOBJ(Material *rayMaterials, tinyobj_material_t *mate
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
// Module Functions Definition // Module Functions Definition
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
// Draw a line in 3D world space // Draw a line in 3D world space
void DrawLine3D(Vector3 startPos, Vector3 endPos, Color color) void DrawLine3D(Vector3 startPos, Vector3 endPos, Color color)
{ {
@@ -4244,7 +4243,7 @@ RayCollision GetRayCollisionQuad(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3, Ve
} }
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
// Module specific Functions Definition // Module Internal Functions Definition
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
#if defined(SUPPORT_FILEFORMAT_IQM) || defined(SUPPORT_FILEFORMAT_GLTF) #if defined(SUPPORT_FILEFORMAT_IQM) || defined(SUPPORT_FILEFORMAT_GLTF)
// Build pose from parent joints // Build pose from parent joints

View File

@@ -83,14 +83,13 @@ static Texture2D texShapes = { 1, 1, 1, 1, 7 }; // Texture used o
static Rectangle texShapesRec = { 0.0f, 0.0f, 1.0f, 1.0f }; // Texture source rectangle used on shapes drawing static Rectangle texShapesRec = { 0.0f, 0.0f, 1.0f, 1.0f }; // Texture source rectangle used on shapes drawing
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
// Module specific Functions Declaration // Module Internal Functions Declaration
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
static float EaseCubicInOut(float t, float b, float c, float d); // Cubic easing static float EaseCubicInOut(float t, float b, float c, float d); // Cubic easing
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
// Module Functions Definition // Module Functions Definition
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
// Set texture and rectangle to be used on shapes drawing // Set texture and rectangle to be used on shapes drawing
// NOTE: It can be useful when using basic shapes and one single font, // NOTE: It can be useful when using basic shapes and one single font,
// defining a font char white rectangle would allow drawing everything in a single draw call // defining a font char white rectangle would allow drawing everything in a single draw call
@@ -2371,7 +2370,7 @@ bool CheckCollisionPointLine(Vector2 point, Vector2 p1, Vector2 p2, int threshol
} }
// Check if circle collides with a line created between two points [p1] and [p2] // Check if circle collides with a line created between two points [p1] and [p2]
RLAPI bool CheckCollisionCircleLine(Vector2 center, float radius, Vector2 p1, Vector2 p2) bool CheckCollisionCircleLine(Vector2 center, float radius, Vector2 p1, Vector2 p2)
{ {
float dx = p1.x - p2.x; float dx = p1.x - p2.x;
float dy = p1.y - p2.y; float dy = p1.y - p2.y;
@@ -2420,7 +2419,7 @@ Rectangle GetCollisionRec(Rectangle rec1, Rectangle rec2)
} }
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
// Module specific Functions Definition // Module Internal Functions Definition
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
// Cubic easing in-out // Cubic easing in-out

View File

@@ -141,7 +141,7 @@ static int textLineSpacing = 2; // Text vertical line spacing in
//... //...
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
// Module specific Functions Declaration // Module Internal Functions Declaration
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
#if defined(SUPPORT_FILEFORMAT_FNT) #if defined(SUPPORT_FILEFORMAT_FNT)
static Font LoadBMFont(const char *fileName); // Load a BMFont file (AngelCode font file) static Font LoadBMFont(const char *fileName); // Load a BMFont file (AngelCode font file)
@@ -2197,7 +2197,7 @@ int GetCodepointPrevious(const char *text, int *codepointSize)
} }
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
// Module specific Functions Definition // Module Internal Functions Definition
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
#if defined(SUPPORT_FILEFORMAT_FNT) || defined(SUPPORT_FILEFORMAT_BDF) #if defined(SUPPORT_FILEFORMAT_FNT) || defined(SUPPORT_FILEFORMAT_BDF)
// Read a line from memory // Read a line from memory
@@ -2380,11 +2380,9 @@ static Font LoadBMFont(const char *fileName)
return font; return font;
} }
#endif #endif
#if defined(SUPPORT_FILEFORMAT_BDF) #if defined(SUPPORT_FILEFORMAT_BDF)
// Convert hexadecimal to decimal (single digit) // Convert hexadecimal to decimal (single digit)
static unsigned char HexToInt(char hex) static unsigned char HexToInt(char hex)
{ {

View File

@@ -258,7 +258,7 @@
extern void LoadFontDefault(void); // [Module: text] Loads default font, required by ImageDrawText() extern void LoadFontDefault(void); // [Module: text] Loads default font, required by ImageDrawText()
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
// Module specific Functions Declaration // Module Internal Functions Declaration
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
static float HalfToFloat(unsigned short x); static float HalfToFloat(unsigned short x);
static unsigned short FloatToHalf(float x); static unsigned short FloatToHalf(float x);
@@ -267,7 +267,6 @@ static Vector4 *LoadImageDataNormalized(Image image); // Load pixel data f
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
// Module Functions Definition // Module Functions Definition
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
// Load image from file into CPU memory (RAM) // Load image from file into CPU memory (RAM)
Image LoadImage(const char *fileName) Image LoadImage(const char *fileName)
{ {
@@ -5406,7 +5405,7 @@ int GetPixelDataSize(int width, int height, int format)
} }
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
// Module specific Functions Definition // Module Internal Functions Definition
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
// Convert half-float (stored as unsigned short) to float // Convert half-float (stored as unsigned short) to float
// REF: https://stackoverflow.com/questions/1659440/32-bit-to-16-bit-floating-point-conversion/60047308#60047308 // REF: https://stackoverflow.com/questions/1659440/32-bit-to-16-bit-floating-point-conversion/60047308#60047308