Skip to content

Commit 6360848

Browse files
committed
Upgraded to NET 8.0
Updated nuget packages Updated submodules
1 parent 9c941be commit 6360848

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+182
-185
lines changed

src/SA3D.Modeling/Animation/Keyframes.cs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -149,20 +149,20 @@ public KeyframeAttributes Type
149149
/// </summary>
150150
public Keyframes()
151151
{
152-
Position = new();
153-
EulerRotation = new();
154-
Scale = new();
155-
Vector = new();
156-
Vertex = new();
157-
Normal = new();
158-
Target = new();
159-
Roll = new();
160-
Angle = new();
161-
LightColor = new();
162-
Intensity = new();
163-
Spot = new();
164-
Point = new();
165-
QuaternionRotation = new();
152+
Position = [];
153+
EulerRotation = [];
154+
Scale = [];
155+
Vector = [];
156+
Vertex = [];
157+
Normal = [];
158+
Target = [];
159+
Roll = [];
160+
Angle = [];
161+
LightColor = [];
162+
Intensity = [];
163+
Spot = [];
164+
Point = [];
165+
QuaternionRotation = [];
166166
}
167167

168168

src/SA3D.Modeling/Animation/Motion.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public bool IsLightMotion
101101
public Motion()
102102
{
103103
Label = "animation_" + GenerateIdentifier();
104-
Keyframes = new();
104+
Keyframes = [];
105105
}
106106

107107

src/SA3D.Modeling/Animation/Utilities/KeyframeOptimizationUtils.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ private static void RemoveDeviations<T>(
2525
return;
2626
}
2727

28-
List<uint> frames = new();
28+
List<uint> frames = [];
2929
for(uint frame = start.Value; frame <= end; frame++)
3030
{
3131
if(keyframes.ContainsKey(frame))

src/SA3D.Modeling/Animation/Utilities/KeyframeRead.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public static void ReadVector3ArraySet(this EndianStackReader reader, uint addre
4242
uint startAddr = address;
4343

4444
// <frame, address>
45-
SortedDictionary<uint, uint> frameAddresses = new();
45+
SortedDictionary<uint, uint> frameAddresses = [];
4646
for(int i = 0; i < count; i++)
4747
{
4848
uint frame = reader.ReadUInt(address);

src/SA3D.Modeling/Animation/Utilities/KeyframeRotationUtils.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public static void QuaternionToEuler(QuaternionKF source, float deviationThresho
7474
/// <returns>The converted euler rotation keyframes.</returns>
7575
public static EulerKF QuaternionToEuler(QuaternionKF source, float deviationThreshold, bool rotateZYX)
7676
{
77-
EulerKF result = new();
77+
EulerKF result = [];
7878
QuaternionToEuler(source, deviationThreshold, rotateZYX, result);
7979
return result;
8080
}
@@ -156,7 +156,7 @@ public static void EulerToQuaternion(EulerKF source, float deviationThreshold, b
156156
/// <returns>The converted quaternion rotation keyframes.</returns>
157157
public static QuaternionKF EulerToQuaternion(EulerKF source, float deviationThreshold, bool rotateZYX)
158158
{
159-
QuaternionKF result = new();
159+
QuaternionKF result = [];
160160
EulerToQuaternion(source, deviationThreshold, rotateZYX, result);
161161
return result;
162162
}
@@ -222,7 +222,7 @@ public static void EulerToQuaternion(this Keyframes keyframes, float deviationTh
222222
/// <returns>The converted rotation matrix keyframes.</returns>
223223
public static Matrix4x4KF GetRotationMatrices(this Keyframes keyframes, bool targetQuaternion, float deviationThreshold, bool rotateZYX, out bool converted, out Dictionary<uint, Matrix4x4[]>? complementary)
224224
{
225-
Matrix4x4KF result = new();
225+
Matrix4x4KF result = [];
226226
complementary = null;
227227
converted = false;
228228

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

259259
Vector3? previous = null;
260260
uint previousFrame = 0;
261-
complementary = new();
261+
complementary = [];
262262

263263
foreach(KeyValuePair<uint, Vector3> rotation in output)
264264
{
@@ -335,7 +335,7 @@ public static void MatrixToQuaternion(Matrix4x4KF source, bool wasQuaternion, fl
335335
}
336336
else
337337
{
338-
EulerKF rotations = new();
338+
EulerKF rotations = [];
339339
ConvertMatrixToRotation(source, rotateZYX, null, rotations);
340340
EulerToQuaternion(rotations, deviationThreshold, rotateZYX, result);
341341
}
@@ -351,7 +351,7 @@ public static void MatrixToQuaternion(Matrix4x4KF source, bool wasQuaternion, fl
351351
/// <returns>The converted quaternion keyframes.</returns>
352352
public static QuaternionKF MatrixToQuaternion(Matrix4x4KF source, bool wasQuaternion, float deviationThreshold, bool rotateZYX)
353353
{
354-
QuaternionKF result = new();
354+
QuaternionKF result = [];
355355
MatrixToQuaternion(source, wasQuaternion, deviationThreshold, rotateZYX, result);
356356
return result;
357357
}
@@ -388,7 +388,7 @@ public static void MatrixToEuler(Matrix4x4KF source, bool wasQuaternion, float d
388388
{
389389
if(wasQuaternion)
390390
{
391-
QuaternionKF quaternions = new();
391+
QuaternionKF quaternions = [];
392392
ConvertMatrixToQuaternion(source, quaternions);
393393
QuaternionToEuler(quaternions, deviationThreshold, rotateZYX, result);
394394
}
@@ -409,7 +409,7 @@ public static void MatrixToEuler(Matrix4x4KF source, bool wasQuaternion, float d
409409
/// <returns>The converted euler keyframes.</returns>
410410
public static EulerKF MatrixToEuler(Matrix4x4KF source, bool wasQuaternion, float deviationThreshold, bool rotateZYX, Dictionary<uint, Matrix4x4[]>? complementary)
411411
{
412-
EulerKF result = new();
412+
EulerKF result = [];
413413
MatrixToEuler(source, wasQuaternion, deviationThreshold, rotateZYX, complementary, result);
414414
return result;
415415
}

src/SA3D.Modeling/File/FileHeaders.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -112,32 +112,32 @@ internal class FileHeaders
112112
/// <summary>
113113
/// Texture list block header in a hashset for finding the block
114114
/// </summary>
115-
public static readonly HashSet<uint> TextureListBlockHeaders = new()
116-
{
115+
public static readonly HashSet<uint> TextureListBlockHeaders =
116+
[
117117
(TL << 16) | NJ,
118118
(TL << 16) | GJ,
119-
};
119+
];
120120

121121
/// <summary>
122122
/// model block headers in a hashset for finding the block
123123
/// </summary>
124-
public static readonly HashSet<uint> ModelBlockHeaders = new()
125-
{
124+
public static readonly HashSet<uint> ModelBlockHeaders =
125+
[
126126
(CM << 16) | NJ,
127127
(BM << 16) | NJ,
128128
(CM << 16) | GJ,
129129
(BM << 16) | GJ,
130-
};
130+
];
131131

132132
/// <summary>
133133
/// Animation block headers in a hashset for finding the block
134134
/// </summary>
135-
public static readonly HashSet<uint> AnimationBlockHeaders = new()
136-
{
135+
public static readonly HashSet<uint> AnimationBlockHeaders =
136+
[
137137
NMDM,
138138
NSSM,
139139
NCAM,
140-
};
140+
];
141141

142142
#endregion
143143
}

src/SA3D.Modeling/File/MetaData.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,11 @@ public class MetaData
6464
/// </summary>
6565
public MetaData()
6666
{
67-
AnimFiles = new();
68-
MorphFiles = new();
69-
Other = new();
70-
Labels = new();
71-
MetaWeights = new();
67+
AnimFiles = [];
68+
MorphFiles = [];
69+
Other = [];
70+
Labels = [];
71+
MetaWeights = [];
7272
}
7373

7474

src/SA3D.Modeling/File/NJBlockUtility.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ internal static class NJBlockUtility
88
{
99
public static Dictionary<uint, uint> GetBlockAddresses(EndianStackReader reader, uint address)
1010
{
11-
Dictionary<uint, uint> result = new();
11+
Dictionary<uint, uint> result = [];
1212
reader.PushBigEndian(reader.CheckBigEndian32(address + 4));
1313

1414
uint blockAddress = address;

src/SA3D.Modeling/Mesh/Attach.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ public virtual bool CheckHasWeights()
7373
/// <returns></returns>
7474
public (BufferMesh[] opaque, BufferMesh[] transparent) GetDisplayMeshes()
7575
{
76-
List<BufferMesh> opaque = new();
77-
List<BufferMesh> transparent = new();
76+
List<BufferMesh> opaque = [];
77+
List<BufferMesh> transparent = [];
7878

7979
foreach(BufferMesh mesh in MeshData)
8080
{

src/SA3D.Modeling/Mesh/Buffer/BufferMesh.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ public static uint[] GetIndexTriangleList(BufferCorner[] corners, uint[]? indexL
198198
{
199199
if(strippified)
200200
{
201-
List<uint> triangles = new();
201+
List<uint> triangles = [];
202202

203203
bool rev = false;
204204

@@ -248,7 +248,7 @@ public static uint[] GetIndexTriangleList(BufferCorner[] corners, uint[]? indexL
248248
{
249249
if(strippified)
250250
{
251-
List<uint> triangles = new();
251+
List<uint> triangles = [];
252252
bool rev = false;
253253

254254
for(int i = 2; i < indexList.Length; i++, rev = !rev)
@@ -305,7 +305,7 @@ public static BufferCorner[] GetCornerTriangleList(BufferCorner[] corners, uint[
305305
{
306306
if(strippified)
307307
{
308-
List<BufferCorner> triangles = new();
308+
List<BufferCorner> triangles = [];
309309
bool rev = false;
310310

311311
for(uint i = 2; i < corners.Length; i++, rev = !rev)
@@ -346,7 +346,7 @@ public static BufferCorner[] GetCornerTriangleList(BufferCorner[] corners, uint[
346346
{
347347
if(strippified)
348348
{
349-
List<BufferCorner> triangles = new();
349+
List<BufferCorner> triangles = [];
350350
bool rev = false;
351351

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

504504
foreach(BufferMesh mesh in input)
505505
{

0 commit comments

Comments
 (0)