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 diff --git a/build.zig.zon b/build.zig.zon index 077865978..73866321b 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -1,17 +1,19 @@ .{ - .name = "raylib", + .name = .raylib, .version = "5.5.0", - .minimum_zig_version = "0.13.0", + .minimum_zig_version = "0.14.0", + + .fingerprint = 0x13035e5cb8bc1ac2, // Changing this has security and trust implications. .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, }, }, 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/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(); //---------------------------------------------------------------------------------- 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 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");