Skip to content

Commit

Permalink
Remove duped files (#26)
Browse files Browse the repository at this point in the history
* remove duped files

* Update Maple2.File.Parser.csproj
  • Loading branch information
AngeloTadeucci authored Jun 17, 2024
1 parent 9076273 commit 364efa8
Show file tree
Hide file tree
Showing 21 changed files with 49 additions and 1,007 deletions.
64 changes: 48 additions & 16 deletions Maple2.File.IO/Nif/PhysXMesh.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
namespace Maple2.File.IO.Nif;

public struct PhysXMeshFace {
public byte Vert0;
public byte Vert1;
public byte Vert2;
public uint Vert0;
public uint Vert1;
public uint Vert2;

public PhysXMeshFace(byte vert0 = 0, byte vert1 = 0, byte vert2 = 0) {
public PhysXMeshFace(uint vert0 = 0, uint vert1 = 0, uint vert2 = 0) {
Vert0 = vert0;
Vert1 = vert1;
Vert2 = vert2;
Expand Down Expand Up @@ -67,7 +67,7 @@ private NxsMeshType ParseConvexMesh(EndianReader reader) {

byte[] unkSection1 = reader.ReadBytes(8);

// Sanity check to check a known piece of data for potential changes
// Sanity check to check a known piece of data for potential changes
if (!unkSection1.SequenceEqual(unkDataSection1)) {
throw new InvalidDataException("Unknown PhysX convex mesh data layout");
}
Expand All @@ -76,7 +76,7 @@ private NxsMeshType ParseConvexMesh(EndianReader reader) {

byte[] unkSection2 = reader.ReadBytes(4);

// Sanity check to check a known piece of data for potential changes
// Sanity check to check a known piece of data for potential changes
if (!unkSection2.SequenceEqual(unkDataSection2)) {
throw new InvalidDataException("Unknown PhysX convex mesh data layout");
}
Expand All @@ -102,11 +102,27 @@ private NxsMeshType ParseConvexMesh(EndianReader reader) {
uint unk10 = reader.ReadAdjustedUInt32();

for (int i = 0; i < faceCount; ++i) {
PhysXMeshFace face = new PhysXMeshFace(
reader.ReadByte(),
reader.ReadByte(),
reader.ReadByte()
);
PhysXMeshFace face;

if (vertexCount < 0x100) {
face = new PhysXMeshFace(
reader.ReadByte(),
reader.ReadByte(),
reader.ReadByte()
);
} else if (vertexCount < 0x10000) {
face = new PhysXMeshFace(
reader.ReadUInt16(),
reader.ReadUInt16(),
reader.ReadUInt16()
);
} else {
face = new PhysXMeshFace(
reader.ReadUInt32(),
reader.ReadUInt32(),
reader.ReadUInt32()
);
}

Faces.Add(face);

Expand Down Expand Up @@ -141,11 +157,27 @@ private NxsMeshType ParseTriangleMesh(EndianReader reader) {
}

for (int i = 0; i < faceCount; ++i) {
PhysXMeshFace face = new PhysXMeshFace(
reader.ReadByte(),
reader.ReadByte(),
reader.ReadByte()
);
PhysXMeshFace face;

if (vertexCount < 0x100) {
face = new PhysXMeshFace(
reader.ReadByte(),
reader.ReadByte(),
reader.ReadByte()
);
} else if (vertexCount < 0x10000) {
face = new PhysXMeshFace(
reader.ReadUInt16(),
reader.ReadUInt16(),
reader.ReadUInt16()
);
} else {
face = new PhysXMeshFace(
reader.ReadUInt32(),
reader.ReadUInt32(),
reader.ReadUInt32()
);
}

Faces.Add(face);

Expand Down
File renamed without changes.
12 changes: 0 additions & 12 deletions Maple2.File.Parser/Enum/NxActorFlag.cs

This file was deleted.

7 changes: 0 additions & 7 deletions Maple2.File.Parser/Enum/NxMeshShapeFlags.cs

This file was deleted.

7 changes: 0 additions & 7 deletions Maple2.File.Parser/Enum/NxPagingMode.cs

This file was deleted.

23 changes: 0 additions & 23 deletions Maple2.File.Parser/Enum/NxShapeFlag.cs

This file was deleted.

15 changes: 0 additions & 15 deletions Maple2.File.Parser/Enum/NxShapeType.cs

This file was deleted.

9 changes: 0 additions & 9 deletions Maple2.File.Parser/Enum/NxsMeshType.cs

This file was deleted.

11 changes: 0 additions & 11 deletions Maple2.File.Parser/Enum/PhysXMeshFlags.cs

This file was deleted.

2 changes: 1 addition & 1 deletion Maple2.File.Parser/Maple2.File.Parser.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<PackageTags>MapleStory2, File, Parser, m2d, xml</PackageTags>
<!-- Use following lines to write the generated files to disk. -->
<EmitCompilerGeneratedFiles Condition=" '$(Configuration)' == 'Debug' ">true</EmitCompilerGeneratedFiles>
<PackageVersion>2.1.19</PackageVersion>
<PackageVersion>2.1.20</PackageVersion>
<TargetFramework>net8.0</TargetFramework>
<PackageReadmeFile>README.md</PackageReadmeFile>
<ImplicitUsings>enable</ImplicitUsings>
Expand Down
145 changes: 0 additions & 145 deletions Maple2.File.Parser/Nif/Endian.cs

This file was deleted.

50 changes: 0 additions & 50 deletions Maple2.File.Parser/Nif/NiPhysXActorDesc.cs

This file was deleted.

Loading

0 comments on commit 364efa8

Please sign in to comment.