Merge branch 'raysan5:master' into master
This commit is contained in:
commit
01de3b421b
15 changed files with 49 additions and 37 deletions
2
.github/workflows/codeql.yml
vendored
2
.github/workflows/codeql.yml
vendored
|
@ -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
|
||||
|
|
2
.github/workflows/linux.yml
vendored
2
.github/workflows/linux.yml
vendored
|
@ -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
|
||||
|
|
|
@ -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,
|
||||
},
|
||||
},
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
*
|
||||
********************************************************************************************/
|
||||
|
||||
#include <raylib.h>
|
||||
#include "raylib.h"
|
||||
|
||||
#define RAYGUI_IMPLEMENTATION
|
||||
#include "raygui.h" // Required for GUI controls
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
*
|
||||
********************************************************************************************/
|
||||
|
||||
#include <raylib.h>
|
||||
#include "raylib.h"
|
||||
|
||||
#define RAYGUI_IMPLEMENTATION
|
||||
#include "raygui.h" // Required for GUI controls
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
*
|
||||
********************************************************************************************/
|
||||
|
||||
#include <raylib.h>
|
||||
#include "raylib.h"
|
||||
|
||||
#define RAYGUI_IMPLEMENTATION
|
||||
#include "raygui.h" // Required for GUI controls
|
||||
|
|
|
@ -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 = NULL;
|
||||
for (int i = 0; i < pointCount - 1; i++)
|
||||
{
|
||||
focusedControlPoint = &control[i].start;
|
||||
if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) selectedControlPoint = &control[i].start;
|
||||
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 if (CheckCollisionPointCircle(GetMousePosition(), control[i].end, 6.0f))
|
||||
{
|
||||
focusedControlPoint = &control[i].end;
|
||||
if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) selectedControlPoint = &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();
|
||||
//----------------------------------------------------------------------------------
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
*
|
||||
********************************************************************************************/
|
||||
|
||||
#include <raylib.h>
|
||||
#include "raylib.h"
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
// Program main entry point
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue