-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added Phys File Type, Added more M2 chunks (some unfinished), changed some smaller things #11
Changes from 3 commits
f9c08ef
e01d895
3446eef
3177ea7
ddea812
a352a4f
3308832
f78e289
2c7056b
6f141f6
f4647cc
b6d460a
f65726a
7da0293
d6e9ed1
b7e866b
b5ae8e5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
using Warcraft.NET.Docs.Steps; | ||
using Warcraft.NET.Files.M2; | ||
using Warcraft.NET.Files.phys; | ||
using Warcraft.NET.Files.SKIN; | ||
|
||
namespace Warcraft.NET.Docs | ||
{ | ||
|
@@ -28,6 +31,7 @@ static void Main(string[] args) | |
ConvertToMarkdownStep.Process(autoDocData, outputFolder); | ||
|
||
Console.WriteLine("Done!"); | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Try to reduce unnecessary spaces. |
||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using Warcraft.NET.Attribute; | ||
using Warcraft.NET.Files.Interfaces; | ||
using Warcraft.NET.Files.M2.Entries; | ||
|
||
namespace Warcraft.NET.Files.M2.Chunks.BfA | ||
{ | ||
[AutoDocChunk(AutoDocChunkVersionHelper.VersionAfterLegion, AutoDocChunkVersionHelper.VersionBeforeBfA)] | ||
public class LDV1 : IIFFChunk, IBinarySerializable | ||
{ | ||
/// <summary> | ||
/// Holds the binary chunk signature. | ||
/// </summary> | ||
public const string Signature = "LDV1"; | ||
|
||
/// <summary> | ||
/// Gets or sets the Skin FileDataId | ||
Luzifix marked this conversation as resolved.
Show resolved
Hide resolved
|
||
/// </summary> | ||
public List<LDV1Entry> LDV1Entries = new(); | ||
|
||
/// <summary> | ||
/// Initializes a new instance of <see cref="LDV1"/> | ||
/// </summary> | ||
public LDV1() { } | ||
|
||
/// <summary> | ||
/// Initializes a new instance of <see cref="LDV1"/> | ||
/// </summary> | ||
/// <param name="inData">ExtendedData.</param> | ||
public LDV1(byte[] inData) => LoadBinaryData(inData); | ||
|
||
/// <inheritdoc /> | ||
public string GetSignature() { return Signature; } | ||
|
||
/// <inheritdoc /> | ||
public uint GetSize() { return (uint)Serialize().Length; } | ||
|
||
/// <inheritdoc /> | ||
public void LoadBinaryData(byte[] inData) | ||
{ | ||
{ | ||
using (var ms = new MemoryStream(inData)) | ||
using (var br = new BinaryReader(ms)) | ||
{ | ||
var LDV1count = br.BaseStream.Length / LDV1Entry.GetSize(); | ||
for (var i = 0; i < LDV1count; ++i) | ||
{ | ||
LDV1Entries.Add(new LDV1Entry(br.ReadBytes(LDV1Entry.GetSize()))); | ||
} | ||
} | ||
} | ||
} | ||
|
||
/// <inheritdoc /> | ||
public byte[] Serialize(long offset = 0) | ||
{ | ||
using (var ms = new MemoryStream()) | ||
using (var bw = new BinaryWriter(ms)) | ||
{ | ||
foreach (LDV1Entry obj in LDV1Entries) | ||
{ | ||
bw.Write(obj.Serialize()); | ||
} | ||
|
||
return ms.ToArray(); | ||
} | ||
} | ||
|
||
Luzifix marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using Warcraft.NET.Attribute; | ||
using Warcraft.NET.Files.Interfaces; | ||
using Warcraft.NET.Files.M2.Entries; | ||
|
||
namespace Warcraft.NET.Files.M2.Chunks.BfA | ||
{ | ||
[AutoDocChunk(AutoDocChunkVersionHelper.VersionAfterLegion, AutoDocChunkVersionHelper.VersionBeforeBfA)] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the parsing of the chunk struct is not implemented we dont add the AutoDocChunk. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove |
||
public class WFV1 : IIFFChunk, IBinarySerializable | ||
{ | ||
/// <summary> | ||
/// Holds the binary chunk signature. | ||
/// </summary> | ||
public const string Signature = "WFV1"; | ||
|
||
public byte[] data; | ||
Luzifix marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
/// <summary> | ||
/// Initializes a new instance of <see cref="WFV1"/> | ||
/// </summary> | ||
public WFV1() { } | ||
|
||
/// <summary> | ||
/// Initializes a new instance of <see cref="WFV1"/> | ||
/// </summary> | ||
/// <param name="inData">ExtendedData.</param> | ||
public WFV1(byte[] inData) => LoadBinaryData(inData); | ||
|
||
/// <inheritdoc /> | ||
public string GetSignature() { return Signature; } | ||
|
||
/// <inheritdoc /> | ||
public uint GetSize() { return (uint)Serialize().Length; } | ||
|
||
/// <inheritdoc /> | ||
public void LoadBinaryData(byte[] inData) | ||
{ | ||
{ | ||
using (var ms = new MemoryStream(inData)) | ||
using (var br = new BinaryReader(ms)) | ||
{ | ||
data = inData; | ||
Luzifix marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
} | ||
} | ||
|
||
/// <inheritdoc /> | ||
public byte[] Serialize(long offset = 0) | ||
{ | ||
using (var ms = new MemoryStream()) | ||
using (var bw = new BinaryWriter(ms)) | ||
{ | ||
bw.Write(data); | ||
|
||
|
||
Luzifix marked this conversation as resolved.
Show resolved
Hide resolved
|
||
return ms.ToArray(); | ||
} | ||
} | ||
|
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using Warcraft.NET.Attribute; | ||
using Warcraft.NET.Files.Interfaces; | ||
using Warcraft.NET.Files.M2.Entries; | ||
|
||
namespace Warcraft.NET.Files.M2.Chunks.BfA | ||
{ | ||
[AutoDocChunk(AutoDocChunkVersionHelper.VersionAfterLegion, AutoDocChunkVersionHelper.VersionBeforeBfA)] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the parsing of the chunk struct is not implemented we dont add the AutoDocChunk. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove |
||
public class WFV2 : IIFFChunk, IBinarySerializable | ||
{ | ||
/// <summary> | ||
/// Holds the binary chunk signature. | ||
/// </summary> | ||
public const string Signature = "WFV2"; | ||
|
||
public byte[] data; | ||
Luzifix marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
/// <summary> | ||
/// Initializes a new instance of <see cref="WFV2"/> | ||
/// </summary> | ||
public WFV2() { } | ||
|
||
/// <summary> | ||
/// Initializes a new instance of <see cref="WFV2"/> | ||
/// </summary> | ||
/// <param name="inData">ExtendedData.</param> | ||
public WFV2(byte[] inData) => LoadBinaryData(inData); | ||
|
||
/// <inheritdoc /> | ||
public string GetSignature() { return Signature; } | ||
|
||
/// <inheritdoc /> | ||
public uint GetSize() { return (uint)Serialize().Length; } | ||
|
||
/// <inheritdoc /> | ||
public void LoadBinaryData(byte[] inData) | ||
{ | ||
{ | ||
using (var ms = new MemoryStream(inData)) | ||
Luzifix marked this conversation as resolved.
Show resolved
Hide resolved
|
||
using (var br = new BinaryReader(ms)) | ||
{ | ||
data = inData; | ||
} | ||
} | ||
} | ||
|
||
/// <inheritdoc /> | ||
public byte[] Serialize(long offset = 0) | ||
{ | ||
using (var ms = new MemoryStream()) | ||
using (var bw = new BinaryWriter(ms)) | ||
{ | ||
bw.Write(data); | ||
|
||
|
||
Luzifix marked this conversation as resolved.
Show resolved
Hide resolved
|
||
return ms.ToArray(); | ||
} | ||
} | ||
|
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using Warcraft.NET.Attribute; | ||
using Warcraft.NET.Files.Interfaces; | ||
using Warcraft.NET.Files.M2.Entries; | ||
|
||
namespace Warcraft.NET.Files.M2.Chunks.DF | ||
{ | ||
[AutoDocChunk(AutoDocChunkVersionHelper.VersionAfterSL, AutoDocChunkVersionHelper.VersionBeforeDF)] | ||
public class AFRA : IIFFChunk, IBinarySerializable | ||
Luzifix marked this conversation as resolved.
Show resolved
Hide resolved
|
||
{ | ||
/// <summary> | ||
/// Holds the binary chunk signature. | ||
/// </summary> | ||
public const string Signature = "AFRA"; | ||
|
||
/// <summary> | ||
/// Initializes a new instance of <see cref="AFRA"/> | ||
/// </summary> | ||
public AFRA() { } | ||
|
||
/// <summary> | ||
/// Initializes a new instance of <see cref="AFRA"/> | ||
/// </summary> | ||
/// <param name="inData">ExtendedData.</param> | ||
public AFRA(byte[] inData) => LoadBinaryData(inData); | ||
|
||
/// <inheritdoc /> | ||
public string GetSignature() { return Signature; } | ||
|
||
/// <inheritdoc /> | ||
public uint GetSize() { return (uint)Serialize().Length; } | ||
|
||
byte[] data; | ||
Luzifix marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
/// <inheritdoc/> | ||
public void LoadBinaryData(byte[] inData) | ||
{ | ||
using (var ms = new MemoryStream(inData)) | ||
Luzifix marked this conversation as resolved.
Show resolved
Hide resolved
|
||
using (var br = new BinaryReader(ms)) | ||
{ | ||
data = inData; | ||
} | ||
} | ||
|
||
/// <inheritdoc/> | ||
public byte[] Serialize(long offset = 0) | ||
{ | ||
using (var ms = new MemoryStream()) | ||
using (var bw = new BinaryWriter(ms)) | ||
{ | ||
bw.Write(data); | ||
|
||
return ms.ToArray(); | ||
} | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be removes because there are not needed here