diff --git a/examples/audio/audio_sound_positioning.c b/examples/audio/audio_sound_positioning.c index 5bef2d671..9f09420a2 100644 --- a/examples/audio/audio_sound_positioning.c +++ b/examples/audio/audio_sound_positioning.c @@ -19,7 +19,9 @@ #include "raymath.h" -// Sound positioning function +//------------------------------------------------------------------------------------ +// Module Functions Declaration +//------------------------------------------------------------------------------------ static void SetSoundPosition(Camera listener, Sound sound, Vector3 position, float maxDist); //------------------------------------------------------------------------------------ @@ -94,7 +96,10 @@ int main(void) //-------------------------------------------------------------------------------------- } -// Sound positioning function +//------------------------------------------------------------------------------------ +// Module Functions Definition +//------------------------------------------------------------------------------------ +// Set sound 3d position static void SetSoundPosition(Camera listener, Sound sound, Vector3 position, float maxDist) { // Calculate direction vector and distance between listener and sound source diff --git a/examples/audio/audio_stream_effects.c b/examples/audio/audio_stream_effects.c index b848c8c31..0d06e1e03 100644 --- a/examples/audio/audio_stream_effects.c +++ b/examples/audio/audio_stream_effects.c @@ -17,7 +17,9 @@ #include // Required for: NULL -// Required delay effect variables +//---------------------------------------------------------------------------------- +// Global Variables Definition +//---------------------------------------------------------------------------------- static float *delayBuffer = NULL; static unsigned int delayBufferSize = 0; static unsigned int delayReadIndex = 2; diff --git a/examples/core/core_2d_camera_platformer.c b/examples/core/core_2d_camera_platformer.c index 9a6ec9ade..45bad4015 100644 --- a/examples/core/core_2d_camera_platformer.c +++ b/examples/core/core_2d_camera_platformer.c @@ -22,6 +22,9 @@ #define PLAYER_JUMP_SPD 350.0f #define PLAYER_HOR_SPD 200.0f +//---------------------------------------------------------------------------------- +// Types and Structures Definition +//---------------------------------------------------------------------------------- typedef struct Player { Vector2 position; float speed; @@ -35,7 +38,7 @@ typedef struct EnvItem { } EnvItem; //---------------------------------------------------------------------------------- -// Module functions declaration +// Module Functions Declaration //---------------------------------------------------------------------------------- void UpdatePlayer(Player *player, EnvItem *envItems, int envItemsLength, float delta); void UpdateCameraCenter(Camera2D *camera, Player *player, EnvItem *envItems, int envItemsLength, float delta, int width, int height); diff --git a/examples/core/core_3d_camera_fps.c b/examples/core/core_3d_camera_fps.c index 7fbd4b137..980660b30 100644 --- a/examples/core/core_3d_camera_fps.c +++ b/examples/core/core_3d_camera_fps.c @@ -64,7 +64,7 @@ static float headLerp = STAND_HEIGHT; static Vector2 lean = { 0 }; //---------------------------------------------------------------------------------- -// Module functions declaration +// Module Functions Declaration //---------------------------------------------------------------------------------- static void DrawLevel(void); static void UpdateCameraFPS(Camera *camera); @@ -172,9 +172,10 @@ int main(void) } //---------------------------------------------------------------------------------- -// Module functions definition +// Module Functions Definition //---------------------------------------------------------------------------------- -void UpdateBody(Body* body, float rot, char side, char forward, bool jumpPressed, bool crouchHold) +// Update body considering current world state +void UpdateBody(Body *body, float rot, char side, char forward, bool jumpPressed, bool crouchHold) { Vector2 input = (Vector2){ (float)side, (float)-forward }; @@ -236,7 +237,7 @@ void UpdateBody(Body* body, float rot, char side, char forward, bool jumpPressed } } -// Update camera +// Update camera for FPS behaviour static void UpdateCameraFPS(Camera *camera) { const Vector3 up = (Vector3){ 0.0f, 1.0f, 0.0f }; diff --git a/examples/core/core_basic_window_web.c b/examples/core/core_basic_window_web.c index c4aa18177..7877337a3 100644 --- a/examples/core/core_basic_window_web.c +++ b/examples/core/core_basic_window_web.c @@ -32,7 +32,7 @@ const int screenWidth = 800; const int screenHeight = 450; //---------------------------------------------------------------------------------- -// Module functions declaration +// Module Functions Declaration //---------------------------------------------------------------------------------- void UpdateDrawFrame(void); // Update and Draw one frame diff --git a/examples/core/core_high_dpi.c b/examples/core/core_high_dpi.c index 8de5fa261..636442401 100644 --- a/examples/core/core_high_dpi.c +++ b/examples/core/core_high_dpi.c @@ -14,7 +14,7 @@ #include "raylib.h" //------------------------------------------------------------------------------------ -// Module functions declaration +// Module Functions Declaration //------------------------------------------------------------------------------------ static void DrawTextCenter(const char *text, int x, int y, int fontSize, Color color); @@ -120,7 +120,7 @@ int main(void) } //------------------------------------------------------------------------------------ -// Module functions definition +// Module Functions Definition //------------------------------------------------------------------------------------ static void DrawTextCenter(const char *text, int x, int y, int fontSize, Color color) { diff --git a/examples/core/core_loading_thread.c b/examples/core/core_loading_thread.c index 1fa84640d..3d04f94a7 100644 --- a/examples/core/core_loading_thread.c +++ b/examples/core/core_loading_thread.c @@ -20,16 +20,18 @@ // WARNING: This example does not build on Windows with MSVC compiler #include "pthread.h" // POSIX style threads management -#include // C11 atomic data types - +#include // Required for: C11 atomic data types #include // Required for: clock() // Using C11 atomics for synchronization // NOTE: A plain bool (or any plain data type for that matter) can't be used for inter-thread synchronization -static atomic_bool dataLoaded = false; // Data Loaded completion indicator -static void *LoadDataThread(void *arg); // Loading data thread function declaration +static atomic_bool dataLoaded = false; // Data Loaded completion indicator +static atomic_int dataProgress = 0; // Data progress accumulator -static atomic_int dataProgress = 0; // Data progress accumulator +//------------------------------------------------------------------------------------ +// Module Functions Declaration +//------------------------------------------------------------------------------------ +static void *LoadDataThread(void *arg); // Loading data thread function declaration //------------------------------------------------------------------------------------ // Program main entry point @@ -134,6 +136,9 @@ int main(void) return 0; } +//------------------------------------------------------------------------------------ +// Module Functions Definition +//------------------------------------------------------------------------------------ // Loading data thread function definition static void *LoadDataThread(void *arg) { diff --git a/examples/core/core_random_sequence.c b/examples/core/core_random_sequence.c index be63e2f9b..3121debc7 100644 --- a/examples/core/core_random_sequence.c +++ b/examples/core/core_random_sequence.c @@ -18,15 +18,18 @@ #include "raylib.h" #include "raymath.h" -#include // Required for: malloc() and free() +#include // Required for: malloc(), free() +//---------------------------------------------------------------------------------- +// Types and Structures Definition +//---------------------------------------------------------------------------------- typedef struct ColorRect { Color c; Rectangle r; } ColorRect; //------------------------------------------------------------------------------------ -// Module functions declaration +// Module Functions Declaration //------------------------------------------------------------------------------------ static Color GenerateRandomColor(); static ColorRect *GenerateRandomColorRectSequence(float rectCount, float rectWidth, float screenWidth, float screenHeight); @@ -114,7 +117,7 @@ int main(void) } //------------------------------------------------------------------------------------ -// Module functions definition +// Module Functions Definition //------------------------------------------------------------------------------------ static Color GenerateRandomColor() { diff --git a/examples/models/models_rlgl_solar_system.c b/examples/models/models_rlgl_solar_system.c index ee1e713c2..d8d86d69a 100644 --- a/examples/models/models_rlgl_solar_system.c +++ b/examples/models/models_rlgl_solar_system.c @@ -128,9 +128,8 @@ int main(void) } //-------------------------------------------------------------------------------------------- -// Module Functions Definitions (local) +// Module Functions Definition //-------------------------------------------------------------------------------------------- - // Draw sphere without any matrix transformation // NOTE: Sphere is drawn in world position ( 0, 0, 0 ) with radius 1.0f void DrawSphereBasic(Color color) diff --git a/examples/others/rlgl_standalone.c b/examples/others/rlgl_standalone.c index eddb63a0f..288f06419 100644 --- a/examples/others/rlgl_standalone.c +++ b/examples/others/rlgl_standalone.c @@ -77,7 +77,7 @@ #define DARKGRAY (Color){ 80, 80, 80, 255 } // Dark Gray //---------------------------------------------------------------------------------- -// Structures Definition +// Types and Structures Definition //---------------------------------------------------------------------------------- // Color, 4 components, R8G8B8A8 (32bit) typedef struct Color { @@ -97,7 +97,7 @@ typedef struct Camera { } Camera; //---------------------------------------------------------------------------------- -// Module specific Functions Declaration +// Module Functions Declaration //---------------------------------------------------------------------------------- static void ErrorCallback(int error, const char *description); static void KeyCallback(GLFWwindow *window, int key, int scancode, int action, int mods); @@ -260,7 +260,7 @@ int main(void) } //---------------------------------------------------------------------------------- -// Module specific Functions Definitions +// Module Functions Definitions //---------------------------------------------------------------------------------- // GLFW3: Error callback diff --git a/examples/shaders/shaders_basic_pbr.c b/examples/shaders/shaders_basic_pbr.c index 1844a43bc..ec15ab206 100644 --- a/examples/shaders/shaders_basic_pbr.c +++ b/examples/shaders/shaders_basic_pbr.c @@ -34,7 +34,6 @@ //---------------------------------------------------------------------------------- // Types and Structures Definition //---------------------------------------------------------------------------------- - // Light type typedef enum { LIGHT_DIRECTIONAL = 0, @@ -66,7 +65,7 @@ typedef struct { static int lightCount = 0; // Current number of dynamic lights that have been created //---------------------------------------------------------------------------------- -// Module specific Functions Declaration +// Module Functions Declaration //---------------------------------------------------------------------------------- // Create a light and get shader locations static Light CreateLight(int type, Vector3 position, Vector3 target, Color color, float intensity, Shader shader); @@ -76,7 +75,7 @@ static Light CreateLight(int type, Vector3 position, Vector3 target, Color color static void UpdateLight(Shader shader, Light light); //---------------------------------------------------------------------------------- -// Main Entry Point +// Program main entry point //---------------------------------------------------------------------------------- int main() { @@ -231,9 +230,9 @@ int main() Vector4 floorEmissiveColor = ColorNormalize(floor.materials[0].maps[MATERIAL_MAP_EMISSION].color); SetShaderValue(shader, emissiveColorLoc, &floorEmissiveColor, SHADER_UNIFORM_VEC4); - // Set floor metallic and roughness values - SetShaderValue(shader, metallicValueLoc, &floor.materials[0].maps[MATERIAL_MAP_METALNESS].value, SHADER_UNIFORM_FLOAT); - SetShaderValue(shader, roughnessValueLoc, &floor.materials[0].maps[MATERIAL_MAP_ROUGHNESS].value, SHADER_UNIFORM_FLOAT); + // Set floor metallic and roughness values + SetShaderValue(shader, metallicValueLoc, &floor.materials[0].maps[MATERIAL_MAP_METALNESS].value, SHADER_UNIFORM_FLOAT); + SetShaderValue(shader, roughnessValueLoc, &floor.materials[0].maps[MATERIAL_MAP_ROUGHNESS].value, SHADER_UNIFORM_FLOAT); DrawModel(floor, (Vector3){ 0.0f, 0.0f, 0.0f }, 5.0f, WHITE); // Draw floor model @@ -244,9 +243,9 @@ int main() float emissiveIntensity = 0.01f; SetShaderValue(shader, emissiveIntensityLoc, &emissiveIntensity, SHADER_UNIFORM_FLOAT); - // Set old car metallic and roughness values - SetShaderValue(shader, metallicValueLoc, &car.materials[0].maps[MATERIAL_MAP_METALNESS].value, SHADER_UNIFORM_FLOAT); - SetShaderValue(shader, roughnessValueLoc, &car.materials[0].maps[MATERIAL_MAP_ROUGHNESS].value, SHADER_UNIFORM_FLOAT); + // Set old car metallic and roughness values + SetShaderValue(shader, metallicValueLoc, &car.materials[0].maps[MATERIAL_MAP_METALNESS].value, SHADER_UNIFORM_FLOAT); + SetShaderValue(shader, roughnessValueLoc, &car.materials[0].maps[MATERIAL_MAP_ROUGHNESS].value, SHADER_UNIFORM_FLOAT); DrawModel(car, (Vector3){ 0.0f, 0.0f, 0.0f }, 0.25f, WHITE); // Draw car model @@ -293,6 +292,9 @@ int main() return 0; } +//---------------------------------------------------------------------------------- +// Module Functions Definition +//---------------------------------------------------------------------------------- // Create light with provided data // NOTE: It updated the global lightCount and it's limited to MAX_LIGHTS static Light CreateLight(int type, Vector3 position, Vector3 target, Color color, float intensity, Shader shader) diff --git a/examples/shaders/shaders_hybrid_render.c b/examples/shaders/shaders_hybrid_render.c index d3c3a910b..9882306a0 100644 --- a/examples/shaders/shaders_hybrid_render.c +++ b/examples/shaders/shaders_hybrid_render.c @@ -16,32 +16,35 @@ ********************************************************************************************/ #include "raylib.h" + #include "rlgl.h" -#include "math.h" // Used for tan() -#include "raymath.h" // Used to calculate camera Direction +#include "raymath.h" + +#include // Required for: tanf() #if defined(PLATFORM_DESKTOP) -#define GLSL_VERSION 330 + #define GLSL_VERSION 330 #else // PLATFORM_ANDROID, PLATFORM_WEB -#define GLSL_VERSION 100 + #define GLSL_VERSION 100 #endif +//---------------------------------------------------------------------------------- +// Types and Structures Definition +//---------------------------------------------------------------------------------- +typedef struct { + unsigned int camPos; + unsigned int camDir; + unsigned int screenCenter; +} RayLocs; + //------------------------------------------------------------------------------------ -// Declare custom functions required for the example +// Module Functions Declaration //------------------------------------------------------------------------------------ // Load custom render texture, create a writable depth texture buffer static RenderTexture2D LoadRenderTextureDepthTex(int width, int height); // Unload render texture from GPU memory (VRAM) static void UnloadRenderTextureDepthTex(RenderTexture2D target); -//------------------------------------------------------------------------------------ -// Declare custom Structs -//------------------------------------------------------------------------------------ - -typedef struct { - unsigned int camPos, camDir, screenCenter; -}RayLocs ; - //------------------------------------------------------------------------------------ // Program main entry point //------------------------------------------------------------------------------------ @@ -153,10 +156,10 @@ int main(void) } //------------------------------------------------------------------------------------ -// Define custom functions required for the example +// Module Functions Definition //------------------------------------------------------------------------------------ // Load custom render texture, create a writable depth texture buffer -RenderTexture2D LoadRenderTextureDepthTex(int width, int height) +static RenderTexture2D LoadRenderTextureDepthTex(int width, int height) { RenderTexture2D target = { 0 }; @@ -195,7 +198,7 @@ RenderTexture2D LoadRenderTextureDepthTex(int width, int height) } // Unload render texture from GPU memory (VRAM) -void UnloadRenderTextureDepthTex(RenderTexture2D target) +static void UnloadRenderTextureDepthTex(RenderTexture2D target) { if (target.id > 0) { diff --git a/examples/shaders/shaders_rounded_rectangle.c b/examples/shaders/shaders_rounded_rectangle.c index 654fba49b..ddfab299c 100644 --- a/examples/shaders/shaders_rounded_rectangle.c +++ b/examples/shaders/shaders_rounded_rectangle.c @@ -23,9 +23,9 @@ #define GLSL_VERSION 100 #endif -//------------------------------------------------------------------------------------ -// Structs definition -//------------------------------------------------------------------------------------ +//---------------------------------------------------------------------------------- +// Types and Structures Definition +//---------------------------------------------------------------------------------- // Rounded rectangle data typedef struct { Vector4 cornerRadius; // Individual corner radius (top-left, top-right, bottom-left, bottom-right) diff --git a/examples/shaders/shaders_spotlight.c b/examples/shaders/shaders_spotlight.c index 1ab7664b5..1188ea8da 100644 --- a/examples/shaders/shaders_spotlight.c +++ b/examples/shaders/shaders_spotlight.c @@ -43,6 +43,9 @@ #define MAX_SPOTS 3 // NOTE: It must be the same as define in shader #define MAX_STARS 400 +//---------------------------------------------------------------------------------- +// Types and Structures Definition +//---------------------------------------------------------------------------------- // Spot data typedef struct Spot { Vector2 position; @@ -62,6 +65,9 @@ typedef struct Star { Vector2 speed; } Star; +//-------------------------------------------------------------------------------------- +// Module Functions Declaration +//-------------------------------------------------------------------------------------- static void UpdateStar(Star *s); static void ResetStar(Star *s); diff --git a/examples/shaders/shaders_write_depth.c b/examples/shaders/shaders_write_depth.c index 54e504a48..a80eb83e5 100644 --- a/examples/shaders/shaders_write_depth.c +++ b/examples/shaders/shaders_write_depth.c @@ -25,9 +25,9 @@ #define GLSL_VERSION 100 #endif -//------------------------------------------------------------------------------------ -// Declare custom functions required for the example -//------------------------------------------------------------------------------------ +//-------------------------------------------------------------------------------------- +// Module Functions Declaration +//-------------------------------------------------------------------------------------- // Load custom render texture, create a writable depth texture buffer static RenderTexture2D LoadRenderTextureDepthTex(int width, int height); @@ -109,9 +109,10 @@ int main(void) return 0; } -//------------------------------------------------------------------------------------ -// Define custom functions required for the example -//------------------------------------------------------------------------------------ +//-------------------------------------------------------------------------------------- +// Module Functions Definition +//-------------------------------------------------------------------------------------- + // Load custom render texture, create a writable depth texture buffer RenderTexture2D LoadRenderTextureDepthTex(int width, int height) { diff --git a/examples/shapes/shapes_digital_clock.c b/examples/shapes/shapes_digital_clock.c index 5f13dd2a8..20c43ed7b 100644 --- a/examples/shapes/shapes_digital_clock.c +++ b/examples/shapes/shapes_digital_clock.c @@ -128,7 +128,6 @@ int main(void) //---------------------------------------------------------------------------------- // Module Functions Definition //---------------------------------------------------------------------------------- - // Update clock time static void UpdateClock(Clock *clock) { diff --git a/examples/shapes/shapes_double_pendulum.c b/examples/shapes/shapes_double_pendulum.c index e2817f24b..200f9ad7e 100644 --- a/examples/shapes/shapes_double_pendulum.c +++ b/examples/shapes/shapes_double_pendulum.c @@ -19,9 +19,6 @@ #include // Required for: sin(), cos(), PI -//---------------------------------------------------------------------------------- -// Macro Helpers -//---------------------------------------------------------------------------------- // Constant for Simulation #define SIMULATION_STEPS 30 #define G 9.81 @@ -156,13 +153,16 @@ int main(void) return 0; } -// Calculate Pendulum End Point +//---------------------------------------------------------------------------------- +// Module Functions Definition +//---------------------------------------------------------------------------------- +// Calculate pendulum end point static Vector2 CalculatePendulumEndPoint(float l, float theta) { return (Vector2){ 10*l*sin(theta), 10*l*cos(theta) }; } -// Calculate Double Pendulum End Point +// Calculate double pendulum end point static Vector2 CalculateDoublePendulumEndPoint(float l1, float theta1, float l2, float theta2) { Vector2 endpoint1 = CalculatePendulumEndPoint(l1, theta1); diff --git a/examples/shapes/shapes_rectangle_advanced.c b/examples/shapes/shapes_rectangle_advanced.c index c4fc648b3..5bd15cc55 100644 --- a/examples/shapes/shapes_rectangle_advanced.c +++ b/examples/shapes/shapes_rectangle_advanced.c @@ -21,6 +21,9 @@ #include +//-------------------------------------------------------------------------------------- +// Module Functions Declaration +//-------------------------------------------------------------------------------------- // Draw rectangle with rounded edges and horizontal gradient, with options to choose side of roundness static void DrawRectangleRoundedGradientH(Rectangle rec, float roundnessLeft, float roundnessRight, int segments, Color left, Color right); @@ -83,6 +86,9 @@ int main(void) return 0; } +//-------------------------------------------------------------------------------------- +// Module Functions Definition +//-------------------------------------------------------------------------------------- // Draw rectangle with rounded edges and horizontal gradient, with options to choose side of roundness // NOTE: Adapted from both 'DrawRectangleRounded()' and 'DrawRectangleGradientH()' raylib [rshapes] implementations static void DrawRectangleRoundedGradientH(Rectangle rec, float roundnessLeft, float roundnessRight, int segments, Color left, Color right) diff --git a/examples/text/text_draw_3d.c b/examples/text/text_draw_3d.c index 532596c88..0202b49f7 100644 --- a/examples/text/text_draw_3d.c +++ b/examples/text/text_draw_3d.c @@ -41,7 +41,7 @@ #endif //-------------------------------------------------------------------------------------- -// Globals +// Global variables //-------------------------------------------------------------------------------------- #define LETTER_BOUNDRY_SIZE 0.25f #define TEXT_MAX_LAYERS 32 @@ -51,7 +51,7 @@ bool SHOW_LETTER_BOUNDRY = false; bool SHOW_TEXT_BOUNDRY = false; //-------------------------------------------------------------------------------------- -// Data Types definition +// Types and Structures Definition //-------------------------------------------------------------------------------------- // Configuration structure for waving the text typedef struct WaveTextConfig { diff --git a/examples/text/text_rectangle_bounds.c b/examples/text/text_rectangle_bounds.c index 66fe53234..e180ae475 100644 --- a/examples/text/text_rectangle_bounds.c +++ b/examples/text/text_rectangle_bounds.c @@ -18,7 +18,7 @@ #include "raylib.h" //---------------------------------------------------------------------------------- -// Module functions declaration +// Module Functions Declaration //---------------------------------------------------------------------------------- // Draw text using font inside rectangle limits static void DrawTextBoxed(Font font, const char *text, Rectangle rec, float fontSize, float spacing, bool wordWrap, Color tint); @@ -135,7 +135,7 @@ tempor incididunt ut labore et dolore magna aliqua. Nec ullamcorper sit amet ris } //-------------------------------------------------------------------------------------- -// Module functions definition +// Module Functions Definition //-------------------------------------------------------------------------------------- // Draw text using font inside rectangle limits diff --git a/examples/text/text_unicode.c b/examples/text/text_unicode.c index 54bdd4f86..aa8527fa9 100644 --- a/examples/text/text_unicode.c +++ b/examples/text/text_unicode.c @@ -24,6 +24,18 @@ #define EMOJI_PER_WIDTH 8 #define EMOJI_PER_HEIGHT 4 +//-------------------------------------------------------------------------------------- +// Global variables +//-------------------------------------------------------------------------------------- +// Arrays that holds the random emojis +struct { + int index; // Index inside `emojiCodepoints` + int message; // Message index + Color color; // Emoji color +} emoji[EMOJI_PER_WIDTH*EMOJI_PER_HEIGHT] = { 0 }; + +static int hovered = -1, selected = -1; + // String containing 180 emoji codepoints separated by a '\0' char const char *const emojiCodepoints = "\xF0\x9F\x8C\x80\x00\xF0\x9F\x98\x80\x00\xF0\x9F\x98\x82\x00\xF0\x9F\xA4\xA3\x00\xF0\x9F\x98\x83\x00\xF0\x9F\x98\x86\x00\xF0\x9F\x98\x89\x00" "\xF0\x9F\x98\x8B\x00\xF0\x9F\x98\x8E\x00\xF0\x9F\x98\x8D\x00\xF0\x9F\x98\x98\x00\xF0\x9F\x98\x97\x00\xF0\x9F\x98\x99\x00\xF0\x9F\x98\x9A\x00\xF0\x9F\x99\x82\x00" @@ -133,25 +145,13 @@ struct { }; //-------------------------------------------------------------------------------------- -// Module functions declaration +// Module Functions Declaration //-------------------------------------------------------------------------------------- static void RandomizeEmoji(void); // Fills the emoji array with random emojis static void DrawTextBoxed(Font font, const char *text, Rectangle rec, float fontSize, float spacing, bool wordWrap, Color tint); // Draw text using font inside rectangle limits static void DrawTextBoxedSelectable(Font font, const char *text, Rectangle rec, float fontSize, float spacing, bool wordWrap, Color tint, int selectStart, int selectLength, Color selectTint, Color selectBackTint); // Draw text using font inside rectangle limits with support for text selection -//-------------------------------------------------------------------------------------- -// Global variables -//-------------------------------------------------------------------------------------- -// Arrays that holds the random emojis -struct { - int index; // Index inside `emojiCodepoints` - int message; // Message index - Color color; // Emoji color -} emoji[EMOJI_PER_WIDTH*EMOJI_PER_HEIGHT] = { 0 }; - -static int hovered = -1, selected = -1; - //------------------------------------------------------------------------------------ // Program main entry point //------------------------------------------------------------------------------------ @@ -329,7 +329,7 @@ static void RandomizeEmoji(void) } //-------------------------------------------------------------------------------------- -// Module functions definition +// Module Functions Definition //-------------------------------------------------------------------------------------- // Draw text using font inside rectangle limits diff --git a/examples/text/text_unicode_ranges.c b/examples/text/text_unicode_ranges.c index d3cb4b5e5..d1ae1a4b5 100644 --- a/examples/text/text_unicode_ranges.c +++ b/examples/text/text_unicode_ranges.c @@ -19,17 +19,20 @@ #include +//---------------------------------------------------------------------------------- +// Types and Structures Definition +//---------------------------------------------------------------------------------- typedef struct { - int* data; + int *data; int count; int capacity; } CodepointsArray; //-------------------------------------------------------------------------------------- -// Module functions declaration +// Module Functions Declaration //-------------------------------------------------------------------------------------- -static void AddRange(CodepointsArray* array, int start, int stop); -static Font LoadUnicodeFont(const char* fileName, int fontSize); +static void AddCodepointRange(CodepointsArray* array, int start, int stop); +//static Font LoadUnicodeFont(const char* fileName, int fontSize); //------------------------------------------------------------------------------------ // Program main entry point @@ -95,7 +98,7 @@ int main(void) } //-------------------------------------------------------------------------------------- -// Module functions definition +// Module Functions Definition //-------------------------------------------------------------------------------------- static void AddRange(CodepointsArray* array, int start, int stop) { diff --git a/examples/textures/textures_image_kernel.c b/examples/textures/textures_image_kernel.c index 99285e15e..3c89bd620 100644 --- a/examples/textures/textures_image_kernel.c +++ b/examples/textures/textures_image_kernel.c @@ -20,7 +20,7 @@ #include "raylib.h" //------------------------------------------------------------------------------------ -// Module functions declaration +// Module Functions Declaration //------------------------------------------------------------------------------------ static void NormalizeKernel(float *kernel, int size); @@ -131,7 +131,7 @@ int main(void) } //------------------------------------------------------------------------------------ -// Module functions definition +// Module Functions Definition //------------------------------------------------------------------------------------ static void NormalizeKernel(float *kernel, int size) { diff --git a/examples/textures/textures_textured_curve.c b/examples/textures/textures_textured_curve.c index 245aee3c7..feeefc7b6 100644 --- a/examples/textures/textures_textured_curve.c +++ b/examples/textures/textures_textured_curve.c @@ -155,7 +155,6 @@ int main() //---------------------------------------------------------------------------------- // Module Functions Definition //---------------------------------------------------------------------------------- - // Draw textured curve using Spline Cubic Bezier static void DrawTexturedCurve(void) { diff --git a/projects/CMake/core_basic_window.c b/projects/CMake/core_basic_window.c index 86709f7a9..cb23a6f87 100644 --- a/projects/CMake/core_basic_window.c +++ b/projects/CMake/core_basic_window.c @@ -31,7 +31,7 @@ int screenHeight = 450; void UpdateDrawFrame(void); // Update and Draw one frame //---------------------------------------------------------------------------------- -// Main Entry Point +// Program main entry point //---------------------------------------------------------------------------------- int main() { diff --git a/projects/VSCode/main.c b/projects/VSCode/main.c index cad32c2ef..ea394de58 100644 --- a/projects/VSCode/main.c +++ b/projects/VSCode/main.c @@ -26,18 +26,18 @@ #endif //---------------------------------------------------------------------------------- -// Local Variables Definition (local to this module) +// Global Variables Definition (local to this module) //---------------------------------------------------------------------------------- Camera camera = { 0 }; Vector3 cubePosition = { 0 }; //---------------------------------------------------------------------------------- -// Local Functions Declaration +// Module Functions Declaration //---------------------------------------------------------------------------------- static void UpdateDrawFrame(void); // Update and draw one frame //---------------------------------------------------------------------------------- -// Main entry point +// Program main entry point //---------------------------------------------------------------------------------- int main() {