Skip to content

Commit

Permalink
Upgraded to NET 8.0
Browse files Browse the repository at this point in the history
Updated nuget packages
Updated submodules
  • Loading branch information
Justin113D committed Aug 3, 2024
1 parent 9c941be commit 6360848
Show file tree
Hide file tree
Showing 42 changed files with 182 additions and 185 deletions.
28 changes: 14 additions & 14 deletions src/SA3D.Modeling/Animation/Keyframes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -149,20 +149,20 @@ public KeyframeAttributes Type
/// </summary>
public Keyframes()
{
Position = new();
EulerRotation = new();
Scale = new();
Vector = new();
Vertex = new();
Normal = new();
Target = new();
Roll = new();
Angle = new();
LightColor = new();
Intensity = new();
Spot = new();
Point = new();
QuaternionRotation = new();
Position = [];
EulerRotation = [];
Scale = [];
Vector = [];
Vertex = [];
Normal = [];
Target = [];
Roll = [];
Angle = [];
LightColor = [];
Intensity = [];
Spot = [];
Point = [];
QuaternionRotation = [];
}


Expand Down
2 changes: 1 addition & 1 deletion src/SA3D.Modeling/Animation/Motion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public bool IsLightMotion
public Motion()
{
Label = "animation_" + GenerateIdentifier();
Keyframes = new();
Keyframes = [];
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ private static void RemoveDeviations<T>(
return;
}

List<uint> frames = new();
List<uint> frames = [];
for(uint frame = start.Value; frame <= end; frame++)
{
if(keyframes.ContainsKey(frame))
Expand Down
2 changes: 1 addition & 1 deletion src/SA3D.Modeling/Animation/Utilities/KeyframeRead.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public static void ReadVector3ArraySet(this EndianStackReader reader, uint addre
uint startAddr = address;

// <frame, address>
SortedDictionary<uint, uint> frameAddresses = new();
SortedDictionary<uint, uint> frameAddresses = [];
for(int i = 0; i < count; i++)
{
uint frame = reader.ReadUInt(address);
Expand Down
16 changes: 8 additions & 8 deletions src/SA3D.Modeling/Animation/Utilities/KeyframeRotationUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public static void QuaternionToEuler(QuaternionKF source, float deviationThresho
/// <returns>The converted euler rotation keyframes.</returns>
public static EulerKF QuaternionToEuler(QuaternionKF source, float deviationThreshold, bool rotateZYX)
{
EulerKF result = new();
EulerKF result = [];
QuaternionToEuler(source, deviationThreshold, rotateZYX, result);
return result;
}
Expand Down Expand Up @@ -156,7 +156,7 @@ public static void EulerToQuaternion(EulerKF source, float deviationThreshold, b
/// <returns>The converted quaternion rotation keyframes.</returns>
public static QuaternionKF EulerToQuaternion(EulerKF source, float deviationThreshold, bool rotateZYX)
{
QuaternionKF result = new();
QuaternionKF result = [];
EulerToQuaternion(source, deviationThreshold, rotateZYX, result);
return result;
}
Expand Down Expand Up @@ -222,7 +222,7 @@ public static void EulerToQuaternion(this Keyframes keyframes, float deviationTh
/// <returns>The converted rotation matrix keyframes.</returns>
public static Matrix4x4KF GetRotationMatrices(this Keyframes keyframes, bool targetQuaternion, float deviationThreshold, bool rotateZYX, out bool converted, out Dictionary<uint, Matrix4x4[]>? complementary)
{
Matrix4x4KF result = new();
Matrix4x4KF result = [];
complementary = null;
converted = false;

Expand Down Expand Up @@ -258,7 +258,7 @@ public static Matrix4x4KF GetRotationMatrices(this Keyframes keyframes, bool tar

Vector3? previous = null;
uint previousFrame = 0;
complementary = new();
complementary = [];

foreach(KeyValuePair<uint, Vector3> rotation in output)
{
Expand Down Expand Up @@ -335,7 +335,7 @@ public static void MatrixToQuaternion(Matrix4x4KF source, bool wasQuaternion, fl
}
else
{
EulerKF rotations = new();
EulerKF rotations = [];
ConvertMatrixToRotation(source, rotateZYX, null, rotations);
EulerToQuaternion(rotations, deviationThreshold, rotateZYX, result);
}
Expand All @@ -351,7 +351,7 @@ public static void MatrixToQuaternion(Matrix4x4KF source, bool wasQuaternion, fl
/// <returns>The converted quaternion keyframes.</returns>
public static QuaternionKF MatrixToQuaternion(Matrix4x4KF source, bool wasQuaternion, float deviationThreshold, bool rotateZYX)
{
QuaternionKF result = new();
QuaternionKF result = [];
MatrixToQuaternion(source, wasQuaternion, deviationThreshold, rotateZYX, result);
return result;
}
Expand Down Expand Up @@ -388,7 +388,7 @@ public static void MatrixToEuler(Matrix4x4KF source, bool wasQuaternion, float d
{
if(wasQuaternion)
{
QuaternionKF quaternions = new();
QuaternionKF quaternions = [];
ConvertMatrixToQuaternion(source, quaternions);
QuaternionToEuler(quaternions, deviationThreshold, rotateZYX, result);
}
Expand All @@ -409,7 +409,7 @@ public static void MatrixToEuler(Matrix4x4KF source, bool wasQuaternion, float d
/// <returns>The converted euler keyframes.</returns>
public static EulerKF MatrixToEuler(Matrix4x4KF source, bool wasQuaternion, float deviationThreshold, bool rotateZYX, Dictionary<uint, Matrix4x4[]>? complementary)
{
EulerKF result = new();
EulerKF result = [];
MatrixToEuler(source, wasQuaternion, deviationThreshold, rotateZYX, complementary, result);
return result;
}
Expand Down
18 changes: 9 additions & 9 deletions src/SA3D.Modeling/File/FileHeaders.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,32 +112,32 @@ internal class FileHeaders
/// <summary>
/// Texture list block header in a hashset for finding the block
/// </summary>
public static readonly HashSet<uint> TextureListBlockHeaders = new()
{
public static readonly HashSet<uint> TextureListBlockHeaders =
[
(TL << 16) | NJ,
(TL << 16) | GJ,
};
];

/// <summary>
/// model block headers in a hashset for finding the block
/// </summary>
public static readonly HashSet<uint> ModelBlockHeaders = new()
{
public static readonly HashSet<uint> ModelBlockHeaders =
[
(CM << 16) | NJ,
(BM << 16) | NJ,
(CM << 16) | GJ,
(BM << 16) | GJ,
};
];

/// <summary>
/// Animation block headers in a hashset for finding the block
/// </summary>
public static readonly HashSet<uint> AnimationBlockHeaders = new()
{
public static readonly HashSet<uint> AnimationBlockHeaders =
[
NMDM,
NSSM,
NCAM,
};
];

#endregion
}
Expand Down
10 changes: 5 additions & 5 deletions src/SA3D.Modeling/File/MetaData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ public class MetaData
/// </summary>
public MetaData()
{
AnimFiles = new();
MorphFiles = new();
Other = new();
Labels = new();
MetaWeights = new();
AnimFiles = [];
MorphFiles = [];
Other = [];
Labels = [];
MetaWeights = [];
}


Expand Down
2 changes: 1 addition & 1 deletion src/SA3D.Modeling/File/NJBlockUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ internal static class NJBlockUtility
{
public static Dictionary<uint, uint> GetBlockAddresses(EndianStackReader reader, uint address)
{
Dictionary<uint, uint> result = new();
Dictionary<uint, uint> result = [];
reader.PushBigEndian(reader.CheckBigEndian32(address + 4));

uint blockAddress = address;
Expand Down
4 changes: 2 additions & 2 deletions src/SA3D.Modeling/Mesh/Attach.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ public virtual bool CheckHasWeights()
/// <returns></returns>
public (BufferMesh[] opaque, BufferMesh[] transparent) GetDisplayMeshes()
{
List<BufferMesh> opaque = new();
List<BufferMesh> transparent = new();
List<BufferMesh> opaque = [];
List<BufferMesh> transparent = [];

foreach(BufferMesh mesh in MeshData)
{
Expand Down
10 changes: 5 additions & 5 deletions src/SA3D.Modeling/Mesh/Buffer/BufferMesh.cs
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ public static uint[] GetIndexTriangleList(BufferCorner[] corners, uint[]? indexL
{
if(strippified)
{
List<uint> triangles = new();
List<uint> triangles = [];

bool rev = false;

Expand Down Expand Up @@ -248,7 +248,7 @@ public static uint[] GetIndexTriangleList(BufferCorner[] corners, uint[]? indexL
{
if(strippified)
{
List<uint> triangles = new();
List<uint> triangles = [];
bool rev = false;

for(int i = 2; i < indexList.Length; i++, rev = !rev)
Expand Down Expand Up @@ -305,7 +305,7 @@ public static BufferCorner[] GetCornerTriangleList(BufferCorner[] corners, uint[
{
if(strippified)
{
List<BufferCorner> triangles = new();
List<BufferCorner> triangles = [];
bool rev = false;

for(uint i = 2; i < corners.Length; i++, rev = !rev)
Expand Down Expand Up @@ -346,7 +346,7 @@ public static BufferCorner[] GetCornerTriangleList(BufferCorner[] corners, uint[
{
if(strippified)
{
List<BufferCorner> triangles = new();
List<BufferCorner> triangles = [];
bool rev = false;

for(uint i = 2; i < indexList.Length; i++, rev = !rev)
Expand Down Expand Up @@ -499,7 +499,7 @@ public void OptimizePolygons()
/// <returns>The optimized buffermeshes.</returns>
public static BufferMesh[] CompressLayout(IList<BufferMesh> input)
{
List<BufferMesh> result = new();
List<BufferMesh> result = [];

foreach(BufferMesh mesh in input)
{
Expand Down
2 changes: 1 addition & 1 deletion src/SA3D.Modeling/Mesh/Chunk/ChunkAttach.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public override bool CheckHasWeights()
return VertexChunks != null && VertexChunks.Any(a => a?.HasWeight == true);
}

HashSet<int> ids = new();
HashSet<int> ids = [];
if(VertexChunks != null)
{
foreach(VertexChunk? vc in VertexChunks)
Expand Down
2 changes: 1 addition & 1 deletion src/SA3D.Modeling/Mesh/Chunk/PolyChunk.cs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ public static PolyChunk Read(EndianStackReader reader, ref uint address, Pointer
/// <returns>The poly chunks that were read.</returns>
public static PolyChunk?[] ReadArray(EndianStackReader reader, uint address, PointerLUT lut)
{
List<PolyChunk?> result = new();
List<PolyChunk?> result = [];

PolyChunkType readType()
{
Expand Down
2 changes: 1 addition & 1 deletion src/SA3D.Modeling/Mesh/Chunk/VertexChunk.cs
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ public static VertexChunk Read(EndianStackReader reader, ref uint address)
/// <returns>The read vertex chunks.</returns>
public static VertexChunk?[] ReadArray(EndianStackReader reader, uint address)
{
List<VertexChunk?> result = new();
List<VertexChunk?> result = [];

VertexChunkType readType()
{
Expand Down
2 changes: 1 addition & 1 deletion src/SA3D.Modeling/Mesh/Converters/BasicConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ public static BufferMesh[] ConvertBasicToBuffer(BasicAttach attach, bool optimiz

bool hasNormals = attach.Normals.Any(x => !x.Equals(BufferMesh.DefaultNormal));

List<BufferMesh> meshes = new();
List<BufferMesh> meshes = [];
foreach(BasicMesh mesh in attach.Meshes)
{
// creating the material
Expand Down
Loading

0 comments on commit 6360848

Please sign in to comment.