Watch
2
0
Fork
You've already forked raylib-cs
0

Merge branch 'main' into examples-backport

This commit is contained in:
tiger tiger tiger 2026-07-22 15:25:15 +02:00 committed by GitHub
commit 23b3659b1b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 43 additions and 27 deletions

View file

@ -21,7 +21,7 @@ jobs:
steps:
- uses: actions/checkout@v7
- name: Setup .NET
- name: Set up .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: |
@ -35,7 +35,6 @@ jobs:
- name: Create NuGet Package
run: dotnet pack Raylib-cs -c Release --output nuget
- name: Restore + Install Built Package
run: |
dotnet restore
@ -44,18 +43,18 @@ jobs:
run: |
dotnet test --verbosity normal
- name: upload NuGet Package As Artifact
- name: Upload NuGet Package As Artifact
uses: actions/upload-artifact@v7
with:
path: nuget/*
- name: upload NuGet Package As Release
- name: Upload NuGet Package As Release
uses: softprops/action-gh-release@v3
if: startsWith(github.ref, 'refs/tags/')
with:
files: nuget/*
- name: publish to NuGet
- name: Publish to NuGet
if: startsWith(github.ref, 'refs/tags/')
run: |
dotnet nuget push \

View file

@ -15,7 +15,13 @@
</PackageReference>
</ItemGroup>
<ItemGroup>
<ItemGroup Condition="'$(UseRaylibCsPackage)' != 'true'">
<ProjectReference Include="..\Raylib-cs\Raylib-cs.csproj"/>
</ItemGroup>
<Import Project="..\Raylib-cs\Raylib-cs.targets" Condition="'$(UseRaylibCsPackage)' != 'true'"/>
<ItemGroup Condition="'$(UseRaylibCsPackage)' == 'true'">
<PackageReference Include="Raylib-cs" Version="$(RaylibCsVersion)"/>
</ItemGroup>
</Project>

View file

@ -3,8 +3,6 @@ using Xunit;
namespace Raylib_cs.Tests;
using System.Collections.Generic;
public static class BlittableHelper
{
public static bool IsBlittable<T>()

View file

@ -130,16 +130,42 @@ public unsafe struct Model
public Matrix4x4* BoneMatrices;
/// <summary>
/// Bones animated transformation matrices as span. Based on Skeleton.BoneCount length
/// Meshes as span. Based on MeshCount length
/// </summary>
public Span<Matrix4x4> BoneMatricesAsSpan()
public Span<Mesh> MeshesAsSpan()
{
if (BoneMatrices == null || Skeleton.BoneCount <= 0)
if (Meshes == null || MeshCount <= 0)
{
return Span<Matrix4x4>.Empty;
return Span<Mesh>.Empty;
}
return new Span<Matrix4x4>(BoneMatrices, Skeleton.BoneCount);
return new Span<Mesh>(Meshes, MeshCount);
}
/// <summary>
/// Materials as span. Based on MaterialCount length
/// </summary>
public Span<Material> MaterialsAsSpan()
{
if (Materials == null || MaterialCount <= 0)
{
return Span<Material>.Empty;
}
return new Span<Material>(Materials, MaterialCount);
}
/// <summary>
/// Mesh material number as span. Based on MeshCount length
/// </summary>
public Span<int> MeshMaterialAsSpan()
{
if (MeshMaterial == null || MeshCount <= 0)
{
return Span<int>.Empty;
}
return new Span<int>(MeshMaterial, MeshCount);
}
/// <summary>
@ -156,29 +182,16 @@ public unsafe struct Model
}
/// <summary>
/// Mesh material number as span. Based on MaterialCount length
/// Bones animated transformation matrices as span. Based on Skeleton.BoneCount length
/// </summary>
public Span<int> MeshMaterialAsSpan()
public Span<Matrix4x4> BoneMatricesAsSpan()
{
if (MeshMaterial == null || MaterialCount <= 0)
if (BoneMatrices == null || Skeleton.BoneCount <= 0)
{
return Span<int>.Empty;
return Span<Matrix4x4>.Empty;
}
return new Span<int>(MeshMaterial, MaterialCount);
}
/// <summary>
/// Meshes as span. Based on MeshCount length
/// </summary>
public Span<Mesh> MeshesAsSpan()
{
if (Meshes == null || MeshCount <= 0)
{
return Span<Mesh>.Empty;
}
return new Span<Mesh>(Meshes, MeshCount);
return new Span<Matrix4x4>(BoneMatrices, Skeleton.BoneCount);
}
}