Merge branch 'raysan5:master' into master

This commit is contained in:
Jon Daniel 2025-03-09 21:40:40 +01:00 committed by GitHub
commit 01de3b421b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 49 additions and 37 deletions

View file

@ -26,7 +26,7 @@ jobs:
# - https://gh.io/supported-runners-and-hardware-resources # - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners # - https://gh.io/using-larger-runners
# Consider using larger runners for possible analysis time improvements. # 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 }} timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
permissions: permissions:
actions: read actions: read

View file

@ -22,7 +22,7 @@ jobs:
build: build:
permissions: permissions:
contents: write # for actions/upload-release-asset to upload release asset contents: write # for actions/upload-release-asset to upload release asset
runs-on: ubuntu-20.04 runs-on: ubuntu-latest
strategy: strategy:
fail-fast: false fail-fast: false
max-parallel: 1 max-parallel: 1

View file

@ -1,17 +1,19 @@
.{ .{
.name = "raylib", .name = .raylib,
.version = "5.5.0", .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 = .{ .dependencies = .{
.xcode_frameworks = .{ .xcode_frameworks = .{
.url = "git+https://github.com/hexops/xcode-frameworks#9a45f3ac977fd25dff77e58c6de1870b6808c4a7", .url = "git+https://github.com/hexops/xcode-frameworks#9a45f3ac977fd25dff77e58c6de1870b6808c4a7",
.hash = "122098b9174895f9708bc824b0f9e550c401892c40a900006459acf2cbf78acd99bb", .hash = "N-V-__8AABHMqAWYuRdIlflwi8gksPnlUMQBiSxAqQAAZFms",
.lazy = true, .lazy = true,
}, },
.emsdk = .{ .emsdk = .{
.url = "git+https://github.com/emscripten-core/emsdk#3.1.50", .url = "git+https://github.com/emscripten-core/emsdk#3.1.50",
.hash = "1220e8fe9509f0843e5e22326300ca415c27afbfbba3992f3c3184d71613540b5564", .hash = "N-V-__8AALRTBQDo_pUJ8IQ-XiIyYwDKQVwnr7-7o5kvPDGE",
.lazy = true, .lazy = true,
}, },
}, },

View file

@ -15,7 +15,7 @@
* *
********************************************************************************************/ ********************************************************************************************/
#include <raylib.h> #include "raylib.h"
#define RAYGUI_IMPLEMENTATION #define RAYGUI_IMPLEMENTATION
#include "raygui.h" // Required for GUI controls #include "raygui.h" // Required for GUI controls

View file

@ -15,7 +15,7 @@
* *
********************************************************************************************/ ********************************************************************************************/
#include <raylib.h> #include "raylib.h"
#define RAYGUI_IMPLEMENTATION #define RAYGUI_IMPLEMENTATION
#include "raygui.h" // Required for GUI controls #include "raygui.h" // Required for GUI controls

View file

@ -15,7 +15,7 @@
* *
********************************************************************************************/ ********************************************************************************************/
#include <raylib.h> #include "raylib.h"
#define RAYGUI_IMPLEMENTATION #define RAYGUI_IMPLEMENTATION
#include "raygui.h" // Required for GUI controls #include "raygui.h" // Required for GUI controls

View file

@ -101,15 +101,18 @@ int main(void)
} }
// Spline point focus and selection logic // Spline point focus and selection logic
if ((selectedPoint == -1) && ((splineTypeActive != SPLINE_BEZIER) || (selectedControlPoint == NULL)))
{
focusedPoint = -1;
for (int i = 0; i < pointCount; i++) for (int i = 0; i < pointCount; i++)
{ {
if (CheckCollisionPointCircle(GetMousePosition(), points[i], 8.0f)) if (CheckCollisionPointCircle(GetMousePosition(), points[i], 8.0f))
{ {
focusedPoint = i; focusedPoint = i;
if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) selectedPoint = i;
break; break;
} }
else focusedPoint = -1; }
if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) selectedPoint = focusedPoint;
} }
// Spline point movement logic // Spline point movement logic
@ -123,21 +126,23 @@ int main(void)
if ((splineTypeActive == SPLINE_BEZIER) && (focusedPoint == -1)) if ((splineTypeActive == SPLINE_BEZIER) && (focusedPoint == -1))
{ {
// Spline control point focus and selection logic // Spline control point focus and selection logic
if (selectedControlPoint == NULL)
{
focusedControlPoint = NULL;
for (int i = 0; i < pointCount - 1; i++) for (int i = 0; i < pointCount - 1; i++)
{ {
if (CheckCollisionPointCircle(GetMousePosition(), control[i].start, 6.0f)) if (CheckCollisionPointCircle(GetMousePosition(), control[i].start, 6.0f))
{ {
focusedControlPoint = &control[i].start; focusedControlPoint = &control[i].start;
if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) selectedControlPoint = &control[i].start;
break; break;
} }
else if (CheckCollisionPointCircle(GetMousePosition(), control[i].end, 6.0f)) else if (CheckCollisionPointCircle(GetMousePosition(), control[i].end, 6.0f))
{ {
focusedControlPoint = &control[i].end; focusedControlPoint = &control[i].end;
if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) selectedControlPoint = &control[i].end;
break; break;
} }
else focusedControlPoint = NULL; }
if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) selectedControlPoint = focusedControlPoint;
} }
// Spline control point movement logic // Spline control point movement logic
@ -153,6 +158,9 @@ int main(void)
else if (IsKeyPressed(KEY_TWO)) splineTypeActive = 1; else if (IsKeyPressed(KEY_TWO)) splineTypeActive = 1;
else if (IsKeyPressed(KEY_THREE)) splineTypeActive = 2; else if (IsKeyPressed(KEY_THREE)) splineTypeActive = 2;
else if (IsKeyPressed(KEY_FOUR)) splineTypeActive = 3; 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 // Draw
@ -249,7 +257,7 @@ int main(void)
} }
// Check all possible UI states that require controls lock // Check all possible UI states that require controls lock
if (splineTypeEditMode) GuiLock(); if (splineTypeEditMode || (selectedPoint != -1) || (selectedControlPoint != NULL)) GuiLock();
// Draw spline config // Draw spline config
GuiLabel((Rectangle){ 12, 62, 140, 24 }, TextFormat("Spline thickness: %i", (int)splineThickness)); GuiLabel((Rectangle){ 12, 62, 140, 24 }, TextFormat("Spline thickness: %i", (int)splineThickness));
@ -257,11 +265,13 @@ int main(void)
GuiCheckBox((Rectangle){ 12, 110, 20, 20 }, "Show point helpers", &splineHelpersActive); GuiCheckBox((Rectangle){ 12, 110, 20, 20 }, "Show point helpers", &splineHelpersActive);
GuiUnlock(); if (splineTypeEditMode) GuiUnlock();
GuiLabel((Rectangle){ 12, 10, 140, 24 }, "Spline type:"); GuiLabel((Rectangle){ 12, 10, 140, 24 }, "Spline type:");
if (GuiDropdownBox((Rectangle){ 12, 8 + 24, 140, 28 }, "LINEAR;BSPLINE;CATMULLROM;BEZIER", &splineTypeActive, splineTypeEditMode)) splineTypeEditMode = !splineTypeEditMode; if (GuiDropdownBox((Rectangle){ 12, 8 + 24, 140, 28 }, "LINEAR;BSPLINE;CATMULLROM;BEZIER", &splineTypeActive, splineTypeEditMode)) splineTypeEditMode = !splineTypeEditMode;
GuiUnlock();
EndDrawing(); EndDrawing();
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
} }

View file

@ -17,7 +17,7 @@
* *
********************************************************************************************/ ********************************************************************************************/
#include <raylib.h> #include "raylib.h"
//------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------
// Program main entry point // Program main entry point

View file

@ -431,7 +431,7 @@ int GetMonitorCount(void)
return 1; return 1;
} }
// Get number of monitors // Get current monitor where window is placed
int GetCurrentMonitor(void) int GetCurrentMonitor(void)
{ {
TRACELOG(LOG_WARNING, "GetCurrentMonitor() not implemented on target platform"); TRACELOG(LOG_WARNING, "GetCurrentMonitor() not implemented on target platform");

View file

@ -736,7 +736,7 @@ int GetMonitorCount(void)
return monitorCount; return monitorCount;
} }
// Get number of monitors // Get current monitor where window is placed
int GetCurrentMonitor(void) int GetCurrentMonitor(void)
{ {
int index = 0; int index = 0;

View file

@ -651,7 +651,7 @@ int GetMonitorCount(void)
return count; return count;
} }
// Get number of monitors // Get current monitor where window is placed
int GetCurrentMonitor(void) int GetCurrentMonitor(void)
{ {
RGFW_monitor *mons = RGFW_getMonitors(); RGFW_monitor *mons = RGFW_getMonitors();

View file

@ -914,7 +914,7 @@ int GetMonitorCount(void)
return monitorCount; return monitorCount;
} }
// Get number of monitors // Get current monitor where window is placed
int GetCurrentMonitor(void) int GetCurrentMonitor(void)
{ {
int currentMonitor = 0; int currentMonitor = 0;

View file

@ -371,7 +371,7 @@ int GetMonitorCount(void)
return 1; return 1;
} }
// Get number of monitors // Get current monitor where window is placed
int GetCurrentMonitor(void) int GetCurrentMonitor(void)
{ {
TRACELOG(LOG_WARNING, "GetCurrentMonitor() not implemented on target platform"); TRACELOG(LOG_WARNING, "GetCurrentMonitor() not implemented on target platform");

View file

@ -208,7 +208,7 @@ int GetMonitorCount(void)
return 1; return 1;
} }
// Get number of monitors // Get current monitor where window is placed
int GetCurrentMonitor(void) int GetCurrentMonitor(void)
{ {
TRACELOG(LOG_WARNING, "GetCurrentMonitor() not implemented on target platform"); TRACELOG(LOG_WARNING, "GetCurrentMonitor() not implemented on target platform");

View file

@ -709,7 +709,7 @@ int GetMonitorCount(void)
return 1; return 1;
} }
// Get number of monitors // Get current monitor where window is placed
int GetCurrentMonitor(void) int GetCurrentMonitor(void)
{ {
TRACELOG(LOG_WARNING, "GetCurrentMonitor() not implemented on target platform"); TRACELOG(LOG_WARNING, "GetCurrentMonitor() not implemented on target platform");