Skip to content

Commit

Permalink
Removed SharpDX dependency.
Browse files Browse the repository at this point in the history
  • Loading branch information
WesternGamer committed Sep 2, 2023
1 parent 0143f4a commit e188a53
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 71 deletions.
2 changes: 0 additions & 2 deletions CodeWalker.Core/CodeWalker.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@

<ItemGroup>
<PackageReference Include="NAudio" Version="2.1.0" />
<PackageReference Include="SharpDX" Version="4.2.0" />
<PackageReference Include="SharpDX.Mathematics" Version="4.2.0" />
<PackageReference Include="System.Numerics.Vectors" Version="4.5.0" />
</ItemGroup>

Expand Down
39 changes: 0 additions & 39 deletions CodeWalker.Core/GameFiles/MetaTypes/Meta.cs
Original file line number Diff line number Diff line change
@@ -1,49 +1,10 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SharpDX;

using TC = System.ComponentModel.TypeConverterAttribute;
using EXP = System.ComponentModel.ExpandableObjectConverter;

namespace CodeWalker.GameFiles
{
































[TC(typeof(EXP))] public struct MetaHash
{
public uint Hash { get; set; }
Expand Down
1 change: 0 additions & 1 deletion CodeWalker.Core/GameFiles/MetaTypes/MetaBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SharpDX;

namespace CodeWalker.GameFiles
{
Expand Down
4 changes: 2 additions & 2 deletions CodeWalker.Core/GameFiles/MetaTypes/MetaXml.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using SharpDX;
using System;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Threading.Tasks;
using System.Xml;
Expand Down
2 changes: 1 addition & 1 deletion CodeWalker.Core/GameFiles/MetaTypes/XmlMeta.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System.Globalization;
using System.Text.RegularExpressions;
using System.Xml;
using SharpDX;


namespace CodeWalker.GameFiles
{
Expand Down
10 changes: 4 additions & 6 deletions CodeWalker.Core/GameFiles/Utils/Data.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,11 @@ THE SOFTWARE.

//shamelessly stolen



using SharpDX;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Threading.Tasks;

Expand Down Expand Up @@ -235,9 +233,9 @@ public Vector4 ReadVector4()
return v;
}

public Matrix ReadMatrix()
public Matrix4x4 ReadMatrix()
{
Matrix m = new Matrix();
Matrix4x4 m = new Matrix4x4();
m.M11 = ReadSingle();
m.M21 = ReadSingle();
m.M31 = ReadSingle();
Expand Down Expand Up @@ -456,7 +454,7 @@ public void Write(Vector4 value)
Write(value.W);
}

public void Write(Matrix value)
public void Write(Matrix4x4 value)
{
Write(value.M11);
Write(value.M21);
Expand Down
14 changes: 1 addition & 13 deletions CodeWalker.Core/Utils/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@
using System.Drawing;
using System.Globalization;
using System.Linq;
using System.Numerics;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using SharpDX;
using Color = SharpDX.Color;
using Half = SharpDX.Half;

namespace CodeWalker
{
Expand Down Expand Up @@ -164,16 +162,6 @@ public static string GetQuaternionXmlString(Quaternion q)
{
return string.Format("x=\"{0}\" y=\"{1}\" z=\"{2}\" w=\"{3}\"", ToString(q.X), ToString(q.Y), ToString(q.Z), ToString(q.W));
}
public static string GetHalf2String(Half2 v, string d = ", ")
{
var f = Half.ConvertToFloat(new[] { v.X, v.Y });
return ToString(f[0]) + d + ToString(f[1]);
}
public static string GetHalf4String(Half4 v, string d = ", ")
{
var f = Half.ConvertToFloat(new[] { v.X, v.Y, v.Z, v.W });
return ToString(f[0]) + d + ToString(f[1]) + d + ToString(f[2]) + d + ToString(f[3]);
}
public static string GetColourString(Color v, string d = ", ")
{
var c = CultureInfo.InvariantCulture;
Expand Down
13 changes: 7 additions & 6 deletions CodeWalker.Core/Utils/Xml.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
using SharpDX;

using System;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
Expand Down Expand Up @@ -510,14 +511,14 @@ public static Vector4[] GetChildRawVector4ArrayNullable(XmlNode node, string nam
return ((arr != null) && (arr.Length > 0)) ? arr : null;
}

public static Matrix GetMatrix(XmlNode node)
public static Matrix4x4 GetMatrix(XmlNode node)
{
if (node == null) return Matrix.Identity;
if (node == null) return Matrix4x4.Identity;
var arr = GetRawFloatArray(node);
if ((arr == null) || (arr.Length != 16)) return Matrix.Identity;
return new Matrix(arr);
if ((arr == null) || (arr.Length != 16)) return Matrix4x4.Identity;
return new Matrix4x4(arr[0], arr[1], arr[2], arr[3], arr[4], arr[5], arr[6], arr[7], arr[8], arr[9], arr[10], arr[11], arr[12], arr[13], arr[14], arr[15]);
}
public static Matrix GetChildMatrix(XmlNode node, string name)
public static Matrix4x4 GetChildMatrix(XmlNode node, string name)
{
var cnode = node.SelectSingleNode(name);
return GetMatrix(cnode);
Expand Down
1 change: 0 additions & 1 deletion RDR2AudioTool/StereoAudioEditingWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using CodeWalker;
using CodeWalker.GameFiles;
using Microsoft.Win32;
using SharpDX.Win32;
using System;
using System.Collections.Generic;
using System.Drawing;
Expand Down

0 comments on commit e188a53

Please sign in to comment.