From 9ba0cdbe6dbd43d9dbd0f57513f05d0aec1c65ae Mon Sep 17 00:00:00 2001 From: Kaluub <60589762+Kaluub@users.noreply.github.com> Date: Fri, 7 Mar 2025 14:21:08 -0500 Subject: [PATCH 1/7] Fix GetCurrentMonitor comments. (#4812) --- src/platforms/rcore_android.c | 2 +- src/platforms/rcore_desktop_glfw.c | 2 +- src/platforms/rcore_desktop_rgfw.c | 2 +- src/platforms/rcore_desktop_sdl.c | 2 +- src/platforms/rcore_drm.c | 2 +- src/platforms/rcore_template.c | 2 +- src/platforms/rcore_web.c | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/platforms/rcore_android.c b/src/platforms/rcore_android.c index 1e726c455..5445b1029 100644 --- a/src/platforms/rcore_android.c +++ b/src/platforms/rcore_android.c @@ -431,7 +431,7 @@ int GetMonitorCount(void) return 1; } -// Get number of monitors +// Get current monitor where window is placed int GetCurrentMonitor(void) { TRACELOG(LOG_WARNING, "GetCurrentMonitor() not implemented on target platform"); diff --git a/src/platforms/rcore_desktop_glfw.c b/src/platforms/rcore_desktop_glfw.c index f79276549..dbe8d6f55 100644 --- a/src/platforms/rcore_desktop_glfw.c +++ b/src/platforms/rcore_desktop_glfw.c @@ -736,7 +736,7 @@ int GetMonitorCount(void) return monitorCount; } -// Get number of monitors +// Get current monitor where window is placed int GetCurrentMonitor(void) { int index = 0; diff --git a/src/platforms/rcore_desktop_rgfw.c b/src/platforms/rcore_desktop_rgfw.c index 3da3af4c9..9d3fb7dfe 100644 --- a/src/platforms/rcore_desktop_rgfw.c +++ b/src/platforms/rcore_desktop_rgfw.c @@ -651,7 +651,7 @@ int GetMonitorCount(void) return count; } -// Get number of monitors +// Get current monitor where window is placed int GetCurrentMonitor(void) { RGFW_monitor *mons = RGFW_getMonitors(); diff --git a/src/platforms/rcore_desktop_sdl.c b/src/platforms/rcore_desktop_sdl.c index f248e2614..379091bbf 100644 --- a/src/platforms/rcore_desktop_sdl.c +++ b/src/platforms/rcore_desktop_sdl.c @@ -914,7 +914,7 @@ int GetMonitorCount(void) return monitorCount; } -// Get number of monitors +// Get current monitor where window is placed int GetCurrentMonitor(void) { int currentMonitor = 0; diff --git a/src/platforms/rcore_drm.c b/src/platforms/rcore_drm.c index abd696fb3..b0a56d6ee 100644 --- a/src/platforms/rcore_drm.c +++ b/src/platforms/rcore_drm.c @@ -371,7 +371,7 @@ int GetMonitorCount(void) return 1; } -// Get number of monitors +// Get current monitor where window is placed int GetCurrentMonitor(void) { TRACELOG(LOG_WARNING, "GetCurrentMonitor() not implemented on target platform"); diff --git a/src/platforms/rcore_template.c b/src/platforms/rcore_template.c index c532bf24f..42c243746 100644 --- a/src/platforms/rcore_template.c +++ b/src/platforms/rcore_template.c @@ -208,7 +208,7 @@ int GetMonitorCount(void) return 1; } -// Get number of monitors +// Get current monitor where window is placed int GetCurrentMonitor(void) { TRACELOG(LOG_WARNING, "GetCurrentMonitor() not implemented on target platform"); diff --git a/src/platforms/rcore_web.c b/src/platforms/rcore_web.c index b8a1f6bf8..0972e9680 100644 --- a/src/platforms/rcore_web.c +++ b/src/platforms/rcore_web.c @@ -709,7 +709,7 @@ int GetMonitorCount(void) return 1; } -// Get number of monitors +// Get current monitor where window is placed int GetCurrentMonitor(void) { TRACELOG(LOG_WARNING, "GetCurrentMonitor() not implemented on target platform"); From 590f793755ad07f91d1bfef1789451fa2559fc49 Mon Sep 17 00:00:00 2001 From: zewenn <86686307+zewenn@users.noreply.github.com> Date: Fri, 7 Mar 2025 20:24:01 +0100 Subject: [PATCH 2/7] Update build.zig.zon to use the new zig v0.14 version (#4819) --- build.zig.zon | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/build.zig.zon b/build.zig.zon index 077865978..c7a61022f 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -1,7 +1,9 @@ .{ - .name = "raylib", + .name = .raylib, .version = "5.5.0", - .minimum_zig_version = "0.13.0", + .minimum_zig_version = "0.14.0", + + .fingerprint = 0x13035e5cb8bc1ac2, .dependencies = .{ .xcode_frameworks = .{ From f430d72a8c42b7880ba9526821a5f5c6cfb12f30 Mon Sep 17 00:00:00 2001 From: sleeptightAnsiC <91839286+sleeptightAnsiC@users.noreply.github.com> Date: Fri, 7 Mar 2025 20:24:53 +0100 Subject: [PATCH 3/7] [examples] fix: use quotation marks when including raylib.h (#4821) ...so it will always prioritize local version of raylib instead of system-wide installations, which is a huge problem when testing any changes done locally to raylib as it might cause silent mismatch issues. There were only 4 examples affected by this issue which were using `#include `. Other examples use proper `#include "raylib.h"` Fixes: https://github.com/raysan5/raylib/issues/4820 --- examples/shapes/shapes_draw_circle_sector.c | 2 +- examples/shapes/shapes_draw_rectangle_rounded.c | 2 +- examples/shapes/shapes_draw_ring.c | 2 +- examples/textures/textures_image_channel.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/shapes/shapes_draw_circle_sector.c b/examples/shapes/shapes_draw_circle_sector.c index e64055c81..1485c464e 100644 --- a/examples/shapes/shapes_draw_circle_sector.c +++ b/examples/shapes/shapes_draw_circle_sector.c @@ -15,7 +15,7 @@ * ********************************************************************************************/ -#include +#include "raylib.h" #define RAYGUI_IMPLEMENTATION #include "raygui.h" // Required for GUI controls diff --git a/examples/shapes/shapes_draw_rectangle_rounded.c b/examples/shapes/shapes_draw_rectangle_rounded.c index ed7e032d1..614ed54b1 100644 --- a/examples/shapes/shapes_draw_rectangle_rounded.c +++ b/examples/shapes/shapes_draw_rectangle_rounded.c @@ -15,7 +15,7 @@ * ********************************************************************************************/ -#include +#include "raylib.h" #define RAYGUI_IMPLEMENTATION #include "raygui.h" // Required for GUI controls diff --git a/examples/shapes/shapes_draw_ring.c b/examples/shapes/shapes_draw_ring.c index daee5cbf5..f7a18bdec 100644 --- a/examples/shapes/shapes_draw_ring.c +++ b/examples/shapes/shapes_draw_ring.c @@ -15,7 +15,7 @@ * ********************************************************************************************/ -#include +#include "raylib.h" #define RAYGUI_IMPLEMENTATION #include "raygui.h" // Required for GUI controls diff --git a/examples/textures/textures_image_channel.c b/examples/textures/textures_image_channel.c index cebe61651..5e159b984 100644 --- a/examples/textures/textures_image_channel.c +++ b/examples/textures/textures_image_channel.c @@ -17,7 +17,7 @@ * ********************************************************************************************/ -#include +#include "raylib.h" //------------------------------------------------------------------------------------ // Program main entry point From 097e80d1c4c46a148177def64d74f4deeb862cca Mon Sep 17 00:00:00 2001 From: 10aded <10aded-Streaming@protonmail.com> Date: Sat, 8 Mar 2025 11:21:50 +1000 Subject: [PATCH 4/7] added comment to fingerprint line per recommendation from the standard 'build.zig.zon' file generated by 'zig init' in Zig 0.14.0 (#4827) --- build.zig.zon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.zig.zon b/build.zig.zon index c7a61022f..2f084da14 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -3,7 +3,7 @@ .version = "5.5.0", .minimum_zig_version = "0.14.0", - .fingerprint = 0x13035e5cb8bc1ac2, + .fingerprint = 0x13035e5cb8bc1ac2, // Changing this has security and trust implications. .dependencies = .{ .xcode_frameworks = .{ From bbeade636cd8c90e18b7e9e841c20b5f8bd15d94 Mon Sep 17 00:00:00 2001 From: David Vanderson Date: Sat, 8 Mar 2025 06:42:17 -0500 Subject: [PATCH 5/7] build.zig.zon: update hashes (#4826) --- build.zig.zon | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.zig.zon b/build.zig.zon index 2f084da14..73866321b 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -8,12 +8,12 @@ .dependencies = .{ .xcode_frameworks = .{ .url = "git+https://github.com/hexops/xcode-frameworks#9a45f3ac977fd25dff77e58c6de1870b6808c4a7", - .hash = "122098b9174895f9708bc824b0f9e550c401892c40a900006459acf2cbf78acd99bb", + .hash = "N-V-__8AABHMqAWYuRdIlflwi8gksPnlUMQBiSxAqQAAZFms", .lazy = true, }, .emsdk = .{ .url = "git+https://github.com/emscripten-core/emsdk#3.1.50", - .hash = "1220e8fe9509f0843e5e22326300ca415c27afbfbba3992f3c3184d71613540b5564", + .hash = "N-V-__8AALRTBQDo_pUJ8IQ-XiIyYwDKQVwnr7-7o5kvPDGE", .lazy = true, }, }, From 5bda46960cd224b8a0f0aa53eb83bd8053b86de0 Mon Sep 17 00:00:00 2001 From: Ray Date: Sat, 8 Mar 2025 18:49:50 +0100 Subject: [PATCH 6/7] REVIEWED: Linux workflow to run on `ubuntu-latest` Previous runner `ubuntu-20.04` is deprecated and being removed soon: https://github.com/actions/runner-images/issues/11101 --- .github/workflows/codeql.yml | 2 +- .github/workflows/linux.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 26cc32660..5ad51a4d6 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -26,7 +26,7 @@ jobs: # - https://gh.io/supported-runners-and-hardware-resources # - https://gh.io/using-larger-runners # Consider using larger runners for possible analysis time improvements. - runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-20.04' }} + runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }} timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }} permissions: actions: read diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 97cf75fc2..a4ce5329b 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -22,7 +22,7 @@ jobs: build: permissions: contents: write # for actions/upload-release-asset to upload release asset - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest strategy: fail-fast: false max-parallel: 1 From 61a026f7ef54f17428ee6fdf079b0d2e7bdbca73 Mon Sep 17 00:00:00 2001 From: Amy Wilder <74995093+AmityWilder@users.noreply.github.com> Date: Sun, 9 Mar 2025 06:40:24 -0400 Subject: [PATCH 7/7] [examples] Reorganize some conditions to fix overlap bugs (#4829) * Reorganize some conditions to fix overlap bugs * Fix edge case where control point selection outlives mouse down --- examples/shapes/shapes_splines_drawing.c | 50 ++++++++++++++---------- 1 file changed, 30 insertions(+), 20 deletions(-) diff --git a/examples/shapes/shapes_splines_drawing.c b/examples/shapes/shapes_splines_drawing.c index 065050e8e..3b4c9c284 100644 --- a/examples/shapes/shapes_splines_drawing.c +++ b/examples/shapes/shapes_splines_drawing.c @@ -101,15 +101,18 @@ int main(void) } // Spline point focus and selection logic - for (int i = 0; i < pointCount; i++) + if ((selectedPoint == -1) && ((splineTypeActive != SPLINE_BEZIER) || (selectedControlPoint == NULL))) { - if (CheckCollisionPointCircle(GetMousePosition(), points[i], 8.0f)) + focusedPoint = -1; + for (int i = 0; i < pointCount; i++) { - focusedPoint = i; - if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) selectedPoint = i; - break; + if (CheckCollisionPointCircle(GetMousePosition(), points[i], 8.0f)) + { + focusedPoint = i; + break; + } } - else focusedPoint = -1; + if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) selectedPoint = focusedPoint; } // Spline point movement logic @@ -123,21 +126,23 @@ int main(void) if ((splineTypeActive == SPLINE_BEZIER) && (focusedPoint == -1)) { // Spline control point focus and selection logic - for (int i = 0; i < pointCount - 1; i++) + if (selectedControlPoint == NULL) { - if (CheckCollisionPointCircle(GetMousePosition(), control[i].start, 6.0f)) - { - focusedControlPoint = &control[i].start; - if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) selectedControlPoint = &control[i].start; - break; - } - else if (CheckCollisionPointCircle(GetMousePosition(), control[i].end, 6.0f)) + focusedControlPoint = NULL; + for (int i = 0; i < pointCount - 1; i++) { - focusedControlPoint = &control[i].end; - if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) selectedControlPoint = &control[i].end; - break; + if (CheckCollisionPointCircle(GetMousePosition(), control[i].start, 6.0f)) + { + focusedControlPoint = &control[i].start; + break; + } + else if (CheckCollisionPointCircle(GetMousePosition(), control[i].end, 6.0f)) + { + focusedControlPoint = &control[i].end; + break; + } } - else focusedControlPoint = NULL; + if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) selectedControlPoint = focusedControlPoint; } // Spline control point movement logic @@ -153,6 +158,9 @@ int main(void) else if (IsKeyPressed(KEY_TWO)) splineTypeActive = 1; else if (IsKeyPressed(KEY_THREE)) splineTypeActive = 2; else if (IsKeyPressed(KEY_FOUR)) splineTypeActive = 3; + + // Clear selection when changing to a spline without control points + if (IsKeyPressed(KEY_ONE) || IsKeyPressed(KEY_TWO) || IsKeyPressed(KEY_THREE)) selectedControlPoint = NULL; //---------------------------------------------------------------------------------- // Draw @@ -249,7 +257,7 @@ int main(void) } // Check all possible UI states that require controls lock - if (splineTypeEditMode) GuiLock(); + if (splineTypeEditMode || (selectedPoint != -1) || (selectedControlPoint != NULL)) GuiLock(); // Draw spline config GuiLabel((Rectangle){ 12, 62, 140, 24 }, TextFormat("Spline thickness: %i", (int)splineThickness)); @@ -257,10 +265,12 @@ int main(void) GuiCheckBox((Rectangle){ 12, 110, 20, 20 }, "Show point helpers", &splineHelpersActive); - GuiUnlock(); + if (splineTypeEditMode) GuiUnlock(); GuiLabel((Rectangle){ 12, 10, 140, 24 }, "Spline type:"); if (GuiDropdownBox((Rectangle){ 12, 8 + 24, 140, 28 }, "LINEAR;BSPLINE;CATMULLROM;BEZIER", &splineTypeActive, splineTypeEditMode)) splineTypeEditMode = !splineTypeEditMode; + + GuiUnlock(); EndDrawing(); //----------------------------------------------------------------------------------