mirror of
https://github.com/SabreTools/SabreTools.Models.git
synced 2026-02-06 21:29:42 +00:00
Compare commits
85 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0451af3eb4 | ||
|
|
7967eb29eb | ||
|
|
6bbe904cc3 | ||
|
|
dce9d98885 | ||
|
|
f862e018fb | ||
|
|
b4a5154da8 | ||
|
|
077aa3c57e | ||
|
|
ea8630ba8c | ||
|
|
385491c67b | ||
|
|
f57461e0c3 | ||
|
|
18f49ac43f | ||
|
|
28fd81adab | ||
|
|
ecca68822d | ||
|
|
58c2dcbe4f | ||
|
|
f9b8717abb | ||
|
|
6a356a5874 | ||
|
|
88c6a0302f | ||
|
|
5282db965f | ||
|
|
33217a7efe | ||
|
|
c8583589d6 | ||
|
|
6ed2b406d7 | ||
|
|
4b08e0f5dd | ||
|
|
e8259fed12 | ||
|
|
d06df28f72 | ||
|
|
f73ff87922 | ||
|
|
dd6b79a21b | ||
|
|
d3daa2c4aa | ||
|
|
1620d00edf | ||
|
|
5565fa2fc3 | ||
|
|
e088e203ea | ||
|
|
acc8d95930 | ||
|
|
1a76c59827 | ||
|
|
8725ec0337 | ||
|
|
8991cc460d | ||
|
|
98ce8b65ec | ||
|
|
ca58343c30 | ||
|
|
2f637e0012 | ||
|
|
80172942fd | ||
|
|
aa0960b42f | ||
|
|
2554f64277 | ||
|
|
4c5c960915 | ||
|
|
1cb49163dd | ||
|
|
d144dd47a1 | ||
|
|
c4247c7ccb | ||
|
|
1e77437167 | ||
|
|
3d79e07d76 | ||
|
|
9d50d577ab | ||
|
|
494ca175fb | ||
|
|
73b3d4a7a8 | ||
|
|
bd40158423 | ||
|
|
149a45d871 | ||
|
|
e18d8d7543 | ||
|
|
38f0d4aef5 | ||
|
|
3959993255 | ||
|
|
00df5bdd6e | ||
|
|
00c087d8e0 | ||
|
|
6bc948784a | ||
|
|
c4f14854c2 | ||
|
|
adaac68898 | ||
|
|
a9bc4a2bfe | ||
|
|
262b91de65 | ||
|
|
62bd6a4bde | ||
|
|
7f14f0c5b0 | ||
|
|
33d63fddae | ||
|
|
209be57bf4 | ||
|
|
a1581e9d9b | ||
|
|
521664d5a8 | ||
|
|
73a8d91a83 | ||
|
|
438e87f833 | ||
|
|
2cdedbb456 | ||
|
|
b57a545598 | ||
|
|
8dc6eb2eee | ||
|
|
b58436d71a | ||
|
|
925c20021f | ||
|
|
9bebf95599 | ||
|
|
089e13ca03 | ||
|
|
de07b3b0dd | ||
|
|
22cb5360e6 | ||
|
|
a422ec7e6d | ||
|
|
f60afd6368 | ||
|
|
b8f67a8ab0 | ||
|
|
d844a8b582 | ||
|
|
8583baa862 | ||
|
|
8f3be17850 | ||
|
|
5856967794 |
6
.github/workflows/build_nupkg.yml
vendored
6
.github/workflows/build_nupkg.yml
vendored
@@ -16,7 +16,7 @@ jobs:
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v4
|
||||
with:
|
||||
dotnet-version: 8.0.x
|
||||
dotnet-version: 9.0.x
|
||||
|
||||
- name: Restore dependencies
|
||||
run: dotnet restore
|
||||
@@ -28,13 +28,13 @@ jobs:
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: 'Nuget Package'
|
||||
path: 'bin/Release/*.nupkg'
|
||||
path: 'SabreTools.Models/bin/Release/*.nupkg'
|
||||
|
||||
- name: Upload to rolling
|
||||
uses: ncipollo/release-action@v1.14.0
|
||||
with:
|
||||
allowUpdates: True
|
||||
artifacts: 'bin/Release/*.nupkg'
|
||||
artifacts: 'SabreTools.Models/bin/Release/*.nupkg'
|
||||
body: 'Last built commit: ${{ github.sha }}'
|
||||
name: 'Rolling Release'
|
||||
prerelease: True
|
||||
|
||||
2
.github/workflows/check_pr.yml
vendored
2
.github/workflows/check_pr.yml
vendored
@@ -11,7 +11,7 @@ jobs:
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v4
|
||||
with:
|
||||
dotnet-version: 8.0.x
|
||||
dotnet-version: 9.0.x
|
||||
|
||||
- name: Build
|
||||
run: dotnet build
|
||||
@@ -1,24 +0,0 @@
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace SabreTools.Models.ArchiveDotOrg
|
||||
{
|
||||
[XmlRoot("files")]
|
||||
public class Files
|
||||
{
|
||||
[XmlElement("file")]
|
||||
public File?[]? File { get; set; }
|
||||
|
||||
#region DO NOT USE IN PRODUCTION
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyAttribute]
|
||||
public XmlAttribute[]? ADDITIONAL_ATTRIBUTES { get; set; }
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyElement]
|
||||
public object[]? ADDITIONAL_ELEMENTS { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
namespace SabreTools.Models.BSP
|
||||
{
|
||||
public static class Constants
|
||||
{
|
||||
/// <summary>
|
||||
/// Number of lumps in a BSP
|
||||
/// </summary>
|
||||
public const int HL_BSP_LUMP_COUNT = 15;
|
||||
|
||||
/// <summary>
|
||||
/// Index for the entities lump
|
||||
/// </summary>
|
||||
public const int HL_BSP_LUMP_ENTITIES = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Index for the texture data lump
|
||||
/// </summary>
|
||||
public const int HL_BSP_LUMP_TEXTUREDATA = 2;
|
||||
|
||||
/// <summary>
|
||||
/// Number of valid mipmap levels
|
||||
/// </summary>
|
||||
public const int HL_BSP_MIPMAP_COUNT = 4;
|
||||
}
|
||||
}
|
||||
29
BSP/File.cs
29
BSP/File.cs
@@ -1,29 +0,0 @@
|
||||
namespace SabreTools.Models.BSP
|
||||
{
|
||||
/// <summary>
|
||||
/// Half-Life Level
|
||||
/// </summary>
|
||||
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/BSPFile.h"/>
|
||||
public sealed class File
|
||||
{
|
||||
/// <summary>
|
||||
/// Header data
|
||||
/// </summary>
|
||||
public Header? Header { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Lumps
|
||||
/// </summary>
|
||||
public Lump?[]? Lumps { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Texture header data
|
||||
/// </summary>
|
||||
public TextureHeader? TextureHeader { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Textures
|
||||
/// </summary>
|
||||
public Texture?[]? Textures { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace SabreTools.Models.BSP
|
||||
{
|
||||
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/BSPFile.h"/>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public sealed class Header
|
||||
{
|
||||
/// <summary>
|
||||
/// Version
|
||||
/// </summary>
|
||||
public uint Version;
|
||||
}
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
namespace SabreTools.Models.BSP
|
||||
{
|
||||
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/BSPFile.h"/>
|
||||
public sealed class Texture
|
||||
{
|
||||
/// <summary>
|
||||
/// Name
|
||||
/// </summary>
|
||||
public string? Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Width
|
||||
/// </summary>
|
||||
public uint Width { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Height
|
||||
/// </summary>
|
||||
public uint Height { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Offsets
|
||||
/// </summary>
|
||||
public uint[]? Offsets { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Texture data
|
||||
/// </summary>
|
||||
public byte[]? TextureData { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Palette size
|
||||
/// </summary>
|
||||
public uint PaletteSize { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Palette data
|
||||
/// </summary>
|
||||
public byte[]? PaletteData { get; set; }
|
||||
}
|
||||
}
|
||||
42
CHD/Enums.cs
42
CHD/Enums.cs
@@ -1,42 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace SabreTools.Models.CHD
|
||||
{
|
||||
/// <see href="https://github.com/mamedev/mame/blob/master/src/lib/util/chd.h"/>
|
||||
public enum CompressionType : uint
|
||||
{
|
||||
#region V1
|
||||
|
||||
CHDCOMPRESSION_NONE = 0,
|
||||
CHDCOMPRESSION_ZLIB = 1,
|
||||
|
||||
#endregion
|
||||
|
||||
#region V3
|
||||
|
||||
CHDCOMPRESSION_ZLIB_PLUS = 2,
|
||||
|
||||
#endregion
|
||||
|
||||
#region V4
|
||||
|
||||
CHDCOMPRESSION_AV = 3,
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
/// <see href="https://github.com/mamedev/mame/blob/master/src/lib/util/chd.h"/>
|
||||
[Flags]
|
||||
public enum Flags : uint
|
||||
{
|
||||
/// <summary>
|
||||
/// Set if this drive has a parent
|
||||
/// </summary>
|
||||
DriveHasParent = 0x00000001,
|
||||
|
||||
/// <summary>
|
||||
/// Set if this drive allows writes
|
||||
/// </summary>
|
||||
DriveAllowsWrites = 0x00000002,
|
||||
}
|
||||
}
|
||||
@@ -1,89 +0,0 @@
|
||||
namespace SabreTools.Models.Compression.MSZIP
|
||||
{
|
||||
/// <see href="https://github.com/wine-mirror/wine/blob/master/dlls/cabinet/cabinet.h"/>
|
||||
public static class Constants
|
||||
{
|
||||
/// <summary>
|
||||
/// Window size
|
||||
/// </summary>
|
||||
public const ushort ZIPWSIZE = 0x8000;
|
||||
|
||||
/// <summary>
|
||||
/// Bits in base literal/length lookup table
|
||||
/// </summary>
|
||||
public const int ZIPLBITS = 9;
|
||||
|
||||
/// <summary>
|
||||
/// Bits in base distance lookup table
|
||||
/// </summary>
|
||||
public const int ZIPDBITS = 6;
|
||||
|
||||
/// <summary>
|
||||
/// Maximum bit length of any code
|
||||
/// </summary>
|
||||
public const int ZIPBMAX = 16;
|
||||
|
||||
/// <summary>
|
||||
/// Maximum number of codes in any set
|
||||
/// </summary>
|
||||
public const int ZIPN_MAX = 288;
|
||||
|
||||
#region THOSE_ZIP_CONSTS
|
||||
|
||||
/// <summary>
|
||||
/// Order of the bit length code lengths
|
||||
/// </summary>
|
||||
public static readonly byte[] BitLengthOrder = new byte[]
|
||||
{
|
||||
16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Copy lengths for literal codes 257..285
|
||||
/// </summary>
|
||||
public static readonly ushort[] CopyLengths = new ushort[]
|
||||
{
|
||||
3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51,
|
||||
59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Extra bits for literal codes 257..285
|
||||
/// </summary>
|
||||
/// <remarks>99 == invalid</remarks>
|
||||
public static readonly ushort[] LiteralExtraBits = new ushort[]
|
||||
{
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4,
|
||||
4, 5, 5, 5, 5, 0, 99, 99
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Copy offsets for distance codes 0..29
|
||||
/// </summary>
|
||||
public static readonly ushort[] CopyOffsets = new ushort[]
|
||||
{
|
||||
1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385,
|
||||
513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Extra bits for distance codes
|
||||
/// </summary>
|
||||
public static readonly ushort[] DistanceExtraBits = new ushort[]
|
||||
{
|
||||
0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10,
|
||||
10, 11, 11, 12, 12, 13, 13
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// And'ing with Zipmask[n] masks the lower n bits
|
||||
/// </summary>
|
||||
public static readonly ushort[] BitMasks = new ushort[17]
|
||||
{
|
||||
0x0000, 0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff,
|
||||
0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff
|
||||
};
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,94 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace SabreTools.Models.Compression.MSZIP
|
||||
{
|
||||
/// <summary>
|
||||
/// Compression with fixed Huffman codes (BTYPE=01)
|
||||
/// </summary>
|
||||
/// <see href="https://interoperability.blob.core.windows.net/files/MS-MCI/%5bMS-MCI%5d.pdf"/>
|
||||
/// <see href="https://www.rfc-editor.org/rfc/rfc1951"/>
|
||||
public class FixedCompressedDataHeader : CompressedDataHeader
|
||||
{
|
||||
#region Properties
|
||||
|
||||
/// <summary>
|
||||
/// Huffman code lengths for the literal / length alphabet
|
||||
/// </summary>
|
||||
public override uint[]? LiteralLengths
|
||||
{
|
||||
get
|
||||
{
|
||||
// If we have cached lengths, use those
|
||||
if (_literalLengths != null)
|
||||
return _literalLengths;
|
||||
|
||||
// Otherwise, build it from scratch
|
||||
_literalLengths = new uint[288];
|
||||
|
||||
// Literal Value 0 - 143, 8 bits
|
||||
for (int i = 0; i < 144; i++)
|
||||
_literalLengths[i] = 8;
|
||||
|
||||
// Literal Value 144 - 255, 9 bits
|
||||
for (int i = 144; i < 256; i++)
|
||||
_literalLengths[i] = 9;
|
||||
|
||||
// Literal Value 256 - 279, 7 bits
|
||||
for (int i = 256; i < 280; i++)
|
||||
_literalLengths[i] = 7;
|
||||
|
||||
// Literal Value 280 - 287, 8 bits
|
||||
for (int i = 280; i < 288; i++)
|
||||
_literalLengths[i] = 8;
|
||||
|
||||
return _literalLengths;
|
||||
}
|
||||
set
|
||||
{
|
||||
throw new FieldAccessException();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Huffman distance codes for the literal / length alphabet
|
||||
/// </summary>
|
||||
public override uint[]? DistanceCodes
|
||||
{
|
||||
get
|
||||
{
|
||||
// If we have cached distances, use those
|
||||
if (_distanceCodes != null)
|
||||
return _distanceCodes;
|
||||
|
||||
// Otherwise, build it from scratch
|
||||
_distanceCodes = new uint[30];
|
||||
|
||||
// Fixed length, 5 bits
|
||||
for (int i = 0; i < 30; i++)
|
||||
_distanceCodes[i] = 5;
|
||||
|
||||
return _distanceCodes;
|
||||
}
|
||||
set
|
||||
{
|
||||
throw new FieldAccessException();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Instance Variables
|
||||
|
||||
/// <summary>
|
||||
/// Huffman code lengths for the literal / length alphabet
|
||||
/// </summary>
|
||||
private uint[]? _literalLengths = null;
|
||||
|
||||
/// <summary>
|
||||
/// Huffman distance codes for the literal / length alphabet
|
||||
/// </summary>
|
||||
private uint[]? _distanceCodes = null;
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace SabreTools.Models.InstallShieldArchiveV3
|
||||
{
|
||||
/// <see href="https://github.com/wfr/unshieldv3/blob/master/ISArchiveV3.cpp"/>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public class Directory
|
||||
{
|
||||
[MarshalAs(UnmanagedType.BStr)]
|
||||
public string? Name;
|
||||
|
||||
public ushort FileCount;
|
||||
}
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace SabreTools.Models.InstallShieldCabinet
|
||||
{
|
||||
/// <see href="https://github.com/twogood/unshield/blob/main/lib/cabfile.h"/>
|
||||
[Flags]
|
||||
public enum FileFlags : ushort
|
||||
{
|
||||
FILE_SPLIT = 1,
|
||||
FILE_OBFUSCATED = 2,
|
||||
FILE_COMPRESSED = 4,
|
||||
FILE_INVALID = 8,
|
||||
}
|
||||
|
||||
/// <see href="https://github.com/twogood/unshield/blob/main/lib/cabfile.h"/>
|
||||
public enum LinkFlags : byte
|
||||
{
|
||||
LINK_NONE = 0,
|
||||
LINK_PREV = 1,
|
||||
LINK_NEXT = 2,
|
||||
LINK_BOTH = 3,
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
namespace SabreTools.Models.Listrom
|
||||
{
|
||||
public class MetadataFile
|
||||
{
|
||||
public Set[]? Set { get; set; }
|
||||
|
||||
#region DO NOT USE IN PRODUCTION
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
public string[]? ADDITIONAL_ELEMENTS { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace SabreTools.Models.Listxml
|
||||
{
|
||||
[XmlRoot("analog")]
|
||||
public class Analog
|
||||
{
|
||||
[Required]
|
||||
[XmlAttribute("mask")]
|
||||
public string? Mask { get; set; }
|
||||
|
||||
#region DO NOT USE IN PRODUCTION
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyAttribute]
|
||||
public XmlAttribute[]? ADDITIONAL_ATTRIBUTES { get; set; }
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyElement]
|
||||
public object[]? ADDITIONAL_ELEMENTS { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace SabreTools.Models.Listxml
|
||||
{
|
||||
[XmlRoot("device_ref")]
|
||||
public class DeviceRef
|
||||
{
|
||||
[Required]
|
||||
[XmlAttribute("name")]
|
||||
public string? Name { get; set; }
|
||||
|
||||
#region DO NOT USE IN PRODUCTION
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyAttribute]
|
||||
public XmlAttribute[]? ADDITIONAL_ATTRIBUTES { get; set; }
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyElement]
|
||||
public object[]? ADDITIONAL_ELEMENTS { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace SabreTools.Models.Listxml
|
||||
{
|
||||
[XmlRoot("extension")]
|
||||
public class Extension
|
||||
{
|
||||
[Required]
|
||||
[XmlAttribute("name")]
|
||||
public string? Name { get; set; }
|
||||
|
||||
#region DO NOT USE IN PRODUCTION
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyAttribute]
|
||||
public XmlAttribute[]? ADDITIONAL_ATTRIBUTES { get; set; }
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyElement]
|
||||
public object[]? ADDITIONAL_ELEMENTS { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace SabreTools.Models.Listxml
|
||||
{
|
||||
[XmlRoot("port")]
|
||||
public class Port
|
||||
{
|
||||
[Required]
|
||||
[XmlAttribute("tag")]
|
||||
public string? Tag { get; set; }
|
||||
|
||||
[XmlElement("analog")]
|
||||
public Analog[]? Analog { get; set; }
|
||||
|
||||
#region DO NOT USE IN PRODUCTION
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyAttribute]
|
||||
public XmlAttribute[]? ADDITIONAL_ATTRIBUTES { get; set; }
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyElement]
|
||||
public object[]? ADDITIONAL_ELEMENTS { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace SabreTools.Models.Listxml
|
||||
{
|
||||
[XmlRoot("sample")]
|
||||
public class Sample
|
||||
{
|
||||
[Required]
|
||||
[XmlAttribute("name")]
|
||||
public string? Name { get; set; }
|
||||
|
||||
#region DO NOT USE IN PRODUCTION
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyAttribute]
|
||||
public XmlAttribute[]? ADDITIONAL_ATTRIBUTES { get; set; }
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyElement]
|
||||
public object[]? ADDITIONAL_ELEMENTS { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace SabreTools.Models.Listxml
|
||||
{
|
||||
[XmlRoot("slot")]
|
||||
public class Slot
|
||||
{
|
||||
[Required]
|
||||
[XmlAttribute("name")]
|
||||
public string? Name { get; set; }
|
||||
|
||||
[XmlElement("slotoption")]
|
||||
public SlotOption[]? SlotOption { get; set; }
|
||||
|
||||
#region DO NOT USE IN PRODUCTION
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyAttribute]
|
||||
public XmlAttribute[]? ADDITIONAL_ATTRIBUTES { get; set; }
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyElement]
|
||||
public object[]? ADDITIONAL_ELEMENTS { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace SabreTools.Models.Listxml
|
||||
{
|
||||
[XmlRoot("sound")]
|
||||
public class Sound
|
||||
{
|
||||
/// <remarks>Numeric</remarks>
|
||||
[Required]
|
||||
[XmlAttribute("channels")]
|
||||
public string? Channels { get; set; }
|
||||
|
||||
#region DO NOT USE IN PRODUCTION
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyAttribute]
|
||||
public XmlAttribute[]? ADDITIONAL_ATTRIBUTES { get; set; }
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyElement]
|
||||
public object[]? ADDITIONAL_ELEMENTS { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace SabreTools.Models.Logiqx
|
||||
{
|
||||
[XmlRoot("archive")]
|
||||
public class Archive
|
||||
{
|
||||
[Required]
|
||||
[XmlAttribute("name")]
|
||||
public string? Name { get; set; }
|
||||
|
||||
#region DO NOT USE IN PRODUCTION
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyAttribute]
|
||||
public XmlAttribute[]? ADDITIONAL_ATTRIBUTES { get; set; }
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyElement]
|
||||
public object[]? ADDITIONAL_ELEMENTS { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace SabreTools.Models.Logiqx
|
||||
{
|
||||
[XmlRoot("device_ref")]
|
||||
public class DeviceRef
|
||||
{
|
||||
[Required]
|
||||
[XmlAttribute("name")]
|
||||
public string? Name { get; set; }
|
||||
|
||||
#region DO NOT USE IN PRODUCTION
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyAttribute]
|
||||
public XmlAttribute[]? ADDITIONAL_ATTRIBUTES { get; set; }
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyElement]
|
||||
public object[]? ADDITIONAL_ELEMENTS { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace SabreTools.Models.Logiqx
|
||||
{
|
||||
[XmlRoot("sample")]
|
||||
public class Sample
|
||||
{
|
||||
[Required]
|
||||
[XmlAttribute("name")]
|
||||
public string? Name { get; set; }
|
||||
|
||||
#region DO NOT USE IN PRODUCTION
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyAttribute]
|
||||
public XmlAttribute[]? ADDITIONAL_ATTRIBUTES { get; set; }
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyElement]
|
||||
public object[]? ADDITIONAL_ELEMENTS { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
namespace SabreTools.Models.N3DS
|
||||
{
|
||||
/// <see href="https://www.3dbrew.org/wiki/NCSD#Card_Info_Header"/>
|
||||
public sealed class CardInfoHeader
|
||||
{
|
||||
/// <summary>
|
||||
/// CARD2: Writable Address In Media Units (For 'On-Chip' Savedata). CARD1: Always 0xFFFFFFFF.
|
||||
/// </summary>
|
||||
public uint WritableAddressMediaUnits { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Card Info Bitmask
|
||||
/// </summary>
|
||||
public uint CardInfoBitmask { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Reserved
|
||||
/// </summary>
|
||||
public byte[]? Reserved1 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Filled size of cartridge
|
||||
/// </summary>
|
||||
public uint FilledSize { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Reserved
|
||||
/// </summary>
|
||||
public byte[]? Reserved2 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Title version
|
||||
/// </summary>
|
||||
public ushort TitleVersion { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Card revision
|
||||
/// </summary>
|
||||
public ushort CardRevision { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Reserved
|
||||
/// </summary>
|
||||
public byte[]? Reserved3 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Title ID of CVer in included update partition
|
||||
/// </summary>
|
||||
public byte[]? CVerTitleID { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Version number of CVer in included update partition
|
||||
/// </summary>
|
||||
public ushort CVerVersionNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Reserved
|
||||
/// </summary>
|
||||
public byte[]? Reserved4 { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
namespace SabreTools.Models.N3DS
|
||||
{
|
||||
/// <see href="https://www.3dbrew.org/wiki/NCSD#Development_Card_Info_Header_Extension"/>
|
||||
public sealed class DevelopmentCardInfoHeader
|
||||
{
|
||||
/// <summary>
|
||||
/// InitialData
|
||||
/// </summary>
|
||||
public InitialData? InitialData { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// CardDeviceReserved1
|
||||
/// </summary>
|
||||
public byte[]? CardDeviceReserved1 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// TitleKey
|
||||
/// </summary>
|
||||
public byte[]? TitleKey { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// CardDeviceReserved2
|
||||
/// </summary>
|
||||
public byte[]? CardDeviceReserved2 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// TestData
|
||||
/// </summary>
|
||||
public TestData? TestData { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
namespace SabreTools.Models.N3DS
|
||||
{
|
||||
/// <see href="https://www.3dbrew.org/wiki/NCSD#InitialData"/>
|
||||
public sealed class InitialData
|
||||
{
|
||||
/// <summary>
|
||||
/// Card seed keyY (first u64 is Media ID (same as first NCCH partitionId))
|
||||
/// </summary>
|
||||
public byte[]? CardSeedKeyY { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Encrypted card seed (AES-CCM, keyslot 0x3B for retail cards, see CTRCARD_SECSEED)
|
||||
/// </summary>
|
||||
public byte[]? EncryptedCardSeed { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Card seed AES-MAC
|
||||
/// </summary>
|
||||
public byte[]? CardSeedAESMAC { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Card seed nonce
|
||||
/// </summary>
|
||||
public byte[]? CardSeedNonce { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Reserved3
|
||||
/// </summary>
|
||||
public byte[]? Reserved { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Copy of first NCCH header (excluding RSA signature)
|
||||
/// </summary>
|
||||
public NCCHHeader? BackupHeader { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
namespace SabreTools.Models.N3DS
|
||||
{
|
||||
/// <see href="https://www.3dbrew.org/wiki/CIA#Meta"/>
|
||||
public sealed class MetaData
|
||||
{
|
||||
/// <summary>
|
||||
/// Title ID dependency list - Taken from the application's ExHeader
|
||||
/// </summary>
|
||||
/// TODO: Determine numeric format of each entry
|
||||
public byte[]? TitleIDDependencyList { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Reserved
|
||||
/// </summary>
|
||||
public byte[]? Reserved1 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Core Version
|
||||
/// </summary>
|
||||
public uint CoreVersion { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Reserved
|
||||
/// </summary>
|
||||
public byte[]? Reserved2 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Icon Data(.ICN) - Taken from the application's ExeFS
|
||||
/// </summary>
|
||||
public byte[]? IconData { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,59 +0,0 @@
|
||||
namespace SabreTools.Models.N3DS
|
||||
{
|
||||
/// <summary>
|
||||
/// The test data is the same one encountered in development DS/DSi cartridges.
|
||||
/// </summary>
|
||||
/// <see href="https://www.3dbrew.org/wiki/NCSD#TestData"/>
|
||||
public sealed class TestData
|
||||
{
|
||||
/// <summary>
|
||||
/// The bytes FF 00 FF 00 AA 55 AA 55.
|
||||
/// </summary>
|
||||
public byte[]? Signature { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// An ascending byte sequence equal to the offset mod 256 (08 09 0A ... FE FF 00 01 ... FF).
|
||||
/// </summary>
|
||||
public byte[]? AscendingByteSequence { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// A descending byte sequence equal to 255 minus the offset mod 256 (FF FE FD ... 00 FF DE ... 00).
|
||||
/// </summary>
|
||||
public byte[]? DescendingByteSequence { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Filled with 00 (0b00000000) bytes.
|
||||
/// </summary>
|
||||
public byte[]? Filled00 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Filled with FF (0b11111111) bytes.
|
||||
/// </summary>
|
||||
public byte[]? FilledFF { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Filled with 0F (0b00001111) bytes.
|
||||
/// </summary>
|
||||
public byte[]? Filled0F { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Filled with F0 (0b11110000) bytes.
|
||||
/// </summary>
|
||||
public byte[]? FilledF0 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Filled with 55 (0b01010101) bytes.
|
||||
/// </summary>
|
||||
public byte[]? Filled55 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Filled with AA (0b10101010) bytes.
|
||||
/// </summary>
|
||||
public byte[]? FilledAA { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The final byte is 00 (0b00000000).
|
||||
/// </summary>
|
||||
public byte FinalByte { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace SabreTools.Models.OfflineList
|
||||
{
|
||||
[XmlRoot("canOpen")]
|
||||
public class CanOpen
|
||||
{
|
||||
[XmlElement("extension")]
|
||||
public string[]? Extension { get; set; }
|
||||
|
||||
#region DO NOT USE IN PRODUCTION
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyAttribute]
|
||||
public XmlAttribute[]? ADDITIONAL_ATTRIBUTES { get; set; }
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyElement]
|
||||
public object[]? ADDITIONAL_ELEMENTS { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace SabreTools.Models.OfflineList
|
||||
{
|
||||
[XmlRoot("datURL")]
|
||||
public class DatUrl
|
||||
{
|
||||
[XmlAttribute("fileName")]
|
||||
public string? FileName { get; set; }
|
||||
|
||||
[XmlText]
|
||||
public string? Content { get; set; }
|
||||
|
||||
#region DO NOT USE IN PRODUCTION
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyAttribute]
|
||||
public XmlAttribute[]? ADDITIONAL_ATTRIBUTES { get; set; }
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyElement]
|
||||
public object[]? ADDITIONAL_ELEMENTS { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace SabreTools.Models.OfflineList
|
||||
{
|
||||
[XmlRoot("romCRC")]
|
||||
public class FileRomCRC
|
||||
{
|
||||
[XmlAttribute("extension")]
|
||||
public string? Extension { get; set; }
|
||||
|
||||
[XmlText]
|
||||
public string? Content { get; set; }
|
||||
|
||||
#region DO NOT USE IN PRODUCTION
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyAttribute]
|
||||
public XmlAttribute[]? ADDITIONAL_ATTRIBUTES { get; set; }
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyElement]
|
||||
public object[]? ADDITIONAL_ELEMENTS { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace SabreTools.Models.OfflineList
|
||||
{
|
||||
[XmlRoot("files")]
|
||||
public class Files
|
||||
{
|
||||
[XmlElement("romCRC")]
|
||||
public FileRomCRC[]? RomCRC { get; set; }
|
||||
|
||||
#region DO NOT USE IN PRODUCTION
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyAttribute]
|
||||
public XmlAttribute[]? ADDITIONAL_ATTRIBUTES { get; set; }
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyElement]
|
||||
public object[]? ADDITIONAL_ELEMENTS { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace SabreTools.Models.OfflineList
|
||||
{
|
||||
[XmlRoot("gui")]
|
||||
public class GUI
|
||||
{
|
||||
[XmlElement("images")]
|
||||
public Images? Images { get; set; }
|
||||
|
||||
#region DO NOT USE IN PRODUCTION
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyAttribute]
|
||||
public XmlAttribute[]? ADDITIONAL_ATTRIBUTES { get; set; }
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyElement]
|
||||
public object[]? ADDITIONAL_ELEMENTS { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace SabreTools.Models.OfflineList
|
||||
{
|
||||
[XmlRoot("games")]
|
||||
public class Games
|
||||
{
|
||||
[XmlElement("game")]
|
||||
public Game[]? Game { get; set; }
|
||||
|
||||
#region DO NOT USE IN PRODUCTION
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyAttribute]
|
||||
public XmlAttribute[]? ADDITIONAL_ATTRIBUTES { get; set; }
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyElement]
|
||||
public object[]? ADDITIONAL_ELEMENTS { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace SabreTools.Models.OfflineList
|
||||
{
|
||||
[XmlRoot("search")]
|
||||
public class Search
|
||||
{
|
||||
[XmlElement("to")]
|
||||
public To[]? To { get; set; }
|
||||
|
||||
#region DO NOT USE IN PRODUCTION
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyAttribute]
|
||||
public XmlAttribute[]? ADDITIONAL_ATTRIBUTES { get; set; }
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyElement]
|
||||
public object[]? ADDITIONAL_ELEMENTS { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace SabreTools.Models.OpenMSX
|
||||
{
|
||||
[XmlRoot("original")]
|
||||
public class Original
|
||||
{
|
||||
/// <remarks>Boolean?</remarks>
|
||||
[XmlAttribute("value")]
|
||||
public string? Value { get; set; }
|
||||
|
||||
[XmlText]
|
||||
public string? Content { get; set; }
|
||||
|
||||
#region DO NOT USE IN PRODUCTION
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyAttribute]
|
||||
public XmlAttribute[]? ADDITIONAL_ATTRIBUTES { get; set; }
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyElement]
|
||||
public object[]? ADDITIONAL_ELEMENTS { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace SabreTools.Models.OpenMSX
|
||||
{
|
||||
[XmlRoot("softwaredb")]
|
||||
public class SoftwareDb
|
||||
{
|
||||
[XmlAttribute("timestamp")]
|
||||
public string? Timestamp { get; set; }
|
||||
|
||||
[XmlElement("software")]
|
||||
public Software[]? Software { get; set; }
|
||||
|
||||
#region DO NOT USE IN PRODUCTION
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyAttribute]
|
||||
public XmlAttribute[]? ADDITIONAL_ATTRIBUTES { get; set; }
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyElement]
|
||||
public object[]? ADDITIONAL_ELEMENTS { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
719
PKZIP/Enums.cs
719
PKZIP/Enums.cs
@@ -1,719 +0,0 @@
|
||||
using System;
|
||||
|
||||
/// <see href="https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT"/>
|
||||
namespace SabreTools.Models.PKZIP
|
||||
{
|
||||
public enum CompressionMethod : ushort
|
||||
{
|
||||
/// <summary>
|
||||
/// The file is stored (no compression)
|
||||
/// </summary>
|
||||
Stored = 0,
|
||||
|
||||
/// <summary>
|
||||
/// The file is Shrunk
|
||||
/// </summary>
|
||||
Shrunk = 1,
|
||||
|
||||
/// <summary>
|
||||
/// The file is Reduced with compression factor 1
|
||||
/// </summary>
|
||||
ReducedCompressionFactor1 = 2,
|
||||
|
||||
/// <summary>
|
||||
/// The file is Reduced with compression factor 2
|
||||
/// </summary>
|
||||
ReducedCompressionFactor2 = 3,
|
||||
|
||||
/// <summary>
|
||||
/// The file is Reduced with compression factor 3
|
||||
/// </summary>
|
||||
ReducedCompressionFactor3 = 4,
|
||||
|
||||
/// <summary>
|
||||
/// The file is Reduced with compression factor 4
|
||||
/// </summary>
|
||||
ReducedCompressionFactor4 = 5,
|
||||
|
||||
/// <summary>
|
||||
/// The file is Imploded
|
||||
/// </summary>
|
||||
Implode = 6,
|
||||
|
||||
/// <summary>
|
||||
/// Reserved for Tokenizing compression algorithm
|
||||
/// </summary>
|
||||
TokenizingCompressionAlgorithm = 7,
|
||||
|
||||
/// <summary>
|
||||
/// The file is Deflated
|
||||
/// </summary>
|
||||
Deflate = 8,
|
||||
|
||||
/// <summary>
|
||||
/// Enhanced Deflating using Deflate64(tm)
|
||||
/// </summary>
|
||||
Deflate64 = 9,
|
||||
|
||||
/// <summary>
|
||||
/// PKWARE Data Compression Library Imploding (old IBM TERSE)
|
||||
/// </summary>
|
||||
PKWAREDataCompressionLibraryImplode = 10,
|
||||
|
||||
/// <summary>
|
||||
/// Reserved by PKWARE
|
||||
/// </summary>
|
||||
CompressionMethod11 = 11,
|
||||
|
||||
/// <summary>
|
||||
/// File is compressed using BZIP2 algorithm
|
||||
/// </summary>
|
||||
BZIP2 = 12,
|
||||
|
||||
/// <summary>
|
||||
/// Reserved by PKWARE
|
||||
/// </summary>
|
||||
CompressionMethod13 = 13,
|
||||
|
||||
/// <summary>
|
||||
/// LZMA
|
||||
/// </summary>
|
||||
LZMA = 14,
|
||||
|
||||
/// <summary>
|
||||
/// Reserved by PKWARE
|
||||
/// </summary>
|
||||
CompressionMethod15 = 15,
|
||||
|
||||
/// <summary>
|
||||
/// IBM z/OS CMPSC Compression
|
||||
/// </summary>
|
||||
IBMzOSCMPSC = 16,
|
||||
|
||||
/// <summary>
|
||||
/// Reserved by PKWARE
|
||||
/// </summary>
|
||||
CompressionMethod17 = 17,
|
||||
|
||||
/// <summary>
|
||||
/// File is compressed using IBM TERSE (new)
|
||||
/// </summary>
|
||||
IBMTERSE = 18,
|
||||
|
||||
/// <summary>
|
||||
/// IBM LZ77 z Architecture
|
||||
/// </summary>
|
||||
IBMLZ77 = 19,
|
||||
|
||||
/// <summary>
|
||||
/// deprecated (use method 93 for zstd)
|
||||
/// </summary>
|
||||
[Obsolete]
|
||||
OldZstandard = 20,
|
||||
|
||||
/// <summary>
|
||||
/// Zstandard (zstd) Compression
|
||||
/// </summary>
|
||||
Zstandard = 93,
|
||||
|
||||
/// <summary>
|
||||
/// MP3 Compression
|
||||
/// </summary>
|
||||
MP3 = 94,
|
||||
|
||||
/// <summary>
|
||||
/// XZ Compression
|
||||
/// </summary>
|
||||
XZ = 95,
|
||||
|
||||
/// <summary>
|
||||
/// JPEG variant
|
||||
/// </summary>
|
||||
JPEGVariant = 96,
|
||||
|
||||
/// <summary>
|
||||
/// WavPack compressed data
|
||||
/// </summary>
|
||||
WavPack = 97,
|
||||
|
||||
/// <summary>
|
||||
/// PPMd version I, Rev 1
|
||||
/// </summary>
|
||||
PPMdVersionIRev1 = 98,
|
||||
|
||||
/// <summary>
|
||||
/// AE-x encryption marker
|
||||
/// </summary>
|
||||
AExEncryption = 99,
|
||||
}
|
||||
|
||||
[Flags]
|
||||
public enum GeneralPurposeBitFlags : ushort
|
||||
{
|
||||
/// <summary>
|
||||
/// Indicates that the file is encrypted
|
||||
/// </summary>
|
||||
FileEncrypted = 0b0000_0000_0000_0001,
|
||||
|
||||
#region Compression Method 6 (Implode)
|
||||
|
||||
/// <summary>
|
||||
/// Set - 8K sliding dictionary
|
||||
/// Clear - 4K sliding dictionary
|
||||
/// </summary>
|
||||
LargeSlidingDictionary = 0b0000_0000_0000_0010,
|
||||
|
||||
/// <summary>
|
||||
/// Set - 3 Shannon-Fano trees were used
|
||||
/// Clear - 2 Shannon-Fano trees were used
|
||||
/// </summary>
|
||||
ThreeTrees = 0b0000_0000_0000_0100,
|
||||
|
||||
#endregion
|
||||
|
||||
#region Compression Method 8 (Deflate)
|
||||
|
||||
/// <summary>
|
||||
/// Normal (-en) compression
|
||||
/// </summary>
|
||||
NormalCompression = 0b0000_0000_0000_0000,
|
||||
|
||||
/// <summary>
|
||||
/// Maximum (-ex) compression
|
||||
/// </summary>
|
||||
MaximumCompression = 0b0000_0000_0000_0010,
|
||||
|
||||
/// <summary>
|
||||
/// Fast (-ef) compression
|
||||
/// </summary>
|
||||
FastCompression = 0b0000_0000_0000_0100,
|
||||
|
||||
/// <summary>
|
||||
/// Super Fast (-es) compression
|
||||
/// </summary>
|
||||
SuperFastCompression = 0b0000_0000_0000_0110,
|
||||
|
||||
#endregion
|
||||
|
||||
#region Compression Method 14 (LZMA)
|
||||
|
||||
/// <summary>
|
||||
/// Set - indicates an end-of-stream (EOS) marker is used to
|
||||
/// mark the end of the compressed data stream.
|
||||
/// Clear - an EOS marker is not present and the compressed data
|
||||
/// size must be known to extract.
|
||||
/// </summary>
|
||||
EndOfStreamMarker = 0b0000_0000_0000_0010,
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// set - the fields crc-32, compressed size and
|
||||
/// uncompressed size are set to zero in the
|
||||
/// local header. The correct values are put
|
||||
/// in the data descriptor immediately
|
||||
/// following the compressed data.
|
||||
/// </summary>
|
||||
NoCRC = 0b0000_0000_0000_1000,
|
||||
|
||||
/// <summary>
|
||||
/// Reserved for use with method 8, for enhanced deflating.
|
||||
/// </summary>
|
||||
EnhancedDeflateReserved = 0b0000_0000_0001_0000,
|
||||
|
||||
/// <summary>
|
||||
/// Indicates that the file is compressed patched data.
|
||||
/// </summary>
|
||||
/// <remarks>Requires PKZIP version 2.70 or greater</remarks>
|
||||
CompressedPatchedData = 0b0000_0000_0010_0000,
|
||||
|
||||
/// <summary>
|
||||
/// Set - you MUST set the version needed to extract value
|
||||
/// to at least 50 and you MUST also set bit 0. If AES
|
||||
/// encryption is used, the version needed to extract
|
||||
/// value MUST be at least 51.
|
||||
/// </summary>
|
||||
StrongEncryption = 0b0000_0000_0100_0000,
|
||||
|
||||
/// <summary>
|
||||
/// Currently unused
|
||||
/// </summary>
|
||||
Bit7 = 0b0000_0000_1000_0000,
|
||||
|
||||
/// <summary>
|
||||
/// Currently unused
|
||||
/// </summary>
|
||||
Bit8 = 0b0000_0001_0000_0000,
|
||||
|
||||
/// <summary>
|
||||
/// Currently unused
|
||||
/// </summary>
|
||||
Bit9 = 0b0000_0010_0000_0000,
|
||||
|
||||
/// <summary>
|
||||
/// Currently unused
|
||||
/// </summary>
|
||||
Bit10 = 0b0000_0100_0000_0000,
|
||||
|
||||
/// <summary>
|
||||
/// Set - the filename and comment fields for this
|
||||
/// file MUST be encoded using UTF-8.
|
||||
/// </summary>
|
||||
LanguageEncodingFlag = 0b0000_1000_0000_0000,
|
||||
|
||||
/// <summary>
|
||||
/// Reserved by PKWARE for enhanced compression
|
||||
/// </summary>
|
||||
PKWAREEnhancedCompression = 0b0001_0000_0000_0000,
|
||||
|
||||
/// <summary>
|
||||
/// Set - Set when encrypting the Central Directory to
|
||||
/// indicate selected data values in the Local
|
||||
/// Header are masked to hide their actual values
|
||||
/// </summary>
|
||||
LocalHeaderValuesMasked = 0b0010_0000_0000_0000,
|
||||
|
||||
/// <summary>
|
||||
/// Reserved by PKWARE for alternate streams
|
||||
/// </summary>
|
||||
PKWAREAlternateStreams = 0b0100_0000_0000_0000,
|
||||
|
||||
/// <summary>
|
||||
/// Reserved by PKWARE
|
||||
/// </summary>
|
||||
PKWAREReserved = 0b1000_0000_0000_0000,
|
||||
}
|
||||
|
||||
public enum HeaderID : ushort
|
||||
{
|
||||
/// <summary>
|
||||
/// Zip64 extended information extra field
|
||||
/// </summary>
|
||||
Zip64ExtendedInformation = 0x0001,
|
||||
|
||||
/// <summary>
|
||||
/// AV Info
|
||||
/// </summary>
|
||||
AVInfo = 0x0007,
|
||||
|
||||
/// <summary>
|
||||
/// Reserved for extended language encoding data (PFS)
|
||||
/// </summary>
|
||||
ExtendedLanguageEncodingData = 0x0008,
|
||||
|
||||
/// <summary>
|
||||
/// OS/2
|
||||
/// </summary>
|
||||
OS2 = 0x0009,
|
||||
|
||||
/// <summary>
|
||||
/// NTFS
|
||||
/// </summary>
|
||||
NTFS = 0x000A,
|
||||
|
||||
/// <summary>
|
||||
/// OpenVMS
|
||||
/// </summary>
|
||||
OpenVMS = 0x000C,
|
||||
|
||||
/// <summary>
|
||||
/// UNIX
|
||||
/// </summary>
|
||||
UNIX = 0x000D,
|
||||
|
||||
/// <summary>
|
||||
/// Reserved for file stream and fork descriptors
|
||||
/// </summary>
|
||||
FileStreamFork = 0x000E,
|
||||
|
||||
/// <summary>
|
||||
/// Patch Descriptor
|
||||
/// </summary>
|
||||
PatchDescriptor = 0x000F,
|
||||
|
||||
/// <summary>
|
||||
/// PKCS#7 Store for X.509 Certificates
|
||||
/// </summary>
|
||||
PKCSStore = 0x0014,
|
||||
|
||||
/// <summary>
|
||||
/// X.509 Certificate ID and Signature for individual file
|
||||
/// </summary>
|
||||
X509IndividualFile = 0x0015,
|
||||
|
||||
/// <summary>
|
||||
/// X.509 Certificate ID for Central Directory
|
||||
/// </summary>
|
||||
X509CentralDirectory = 0x0016,
|
||||
|
||||
/// <summary>
|
||||
/// Strong Encryption Header
|
||||
/// </summary>
|
||||
StrongEncryptionHeader = 0x0017,
|
||||
|
||||
/// <summary>
|
||||
/// Record Management Controls
|
||||
/// </summary>
|
||||
RecordManagementControls = 0x0018,
|
||||
|
||||
/// <summary>
|
||||
/// PKCS#7 Encryption Recipient Certificate List
|
||||
/// </summary>
|
||||
PKCSCertificateList = 0x0019,
|
||||
|
||||
/// <summary>
|
||||
/// Reserved for Timestamp record
|
||||
/// </summary>
|
||||
Timestamp = 0x0020,
|
||||
|
||||
/// <summary>
|
||||
/// Policy Decryption Key Record
|
||||
/// </summary>
|
||||
PolicyDecryptionKey = 0x0021,
|
||||
|
||||
/// <summary>
|
||||
/// Smartcrypt Key Provider Record
|
||||
/// </summary>
|
||||
SmartcryptKeyProvider = 0x0022,
|
||||
|
||||
/// <summary>
|
||||
/// Smartcrypt Policy Key Data Record
|
||||
/// </summary>
|
||||
SmartcryptPolicyKeyData = 0x0023,
|
||||
|
||||
/// <summary>
|
||||
/// IBM S/390 (Z390), AS/400 (I400) attributes - uncompressed
|
||||
/// </summary>
|
||||
IBMS390AttributesUncompressed = 0x0065,
|
||||
|
||||
/// <summary>
|
||||
/// Reserved for IBM S/390 (Z390), AS/400 (I400) attributes - compressed
|
||||
/// </summary>
|
||||
IBMS390AttributesCompressed = 0x0066,
|
||||
|
||||
/// <summary>
|
||||
/// POSZIP 4690 (reserved)
|
||||
/// </summary>
|
||||
POSZIP4690 = 0x4690,
|
||||
|
||||
#region Third-Party
|
||||
|
||||
/// <summary>
|
||||
/// Macintosh
|
||||
/// </summary>
|
||||
Macintosh = 0x07C8,
|
||||
|
||||
/// <summary>
|
||||
/// Pixar USD header ID
|
||||
/// </summary>
|
||||
PixarUSD = 0x1986,
|
||||
|
||||
/// <summary>
|
||||
/// ZipIt Macintosh
|
||||
/// </summary>
|
||||
ZipItMacintosh = 0x2605,
|
||||
|
||||
/// <summary>
|
||||
/// ZipIt Macintosh 1.3.5+
|
||||
/// </summary>
|
||||
ZipItMacintosh135Plus = 0x2705,
|
||||
|
||||
/// <summary>
|
||||
/// ZipIt Macintosh 1.3.5+
|
||||
/// </summary>
|
||||
ZipItMacintosh135PlusAlt = 0x2805,
|
||||
|
||||
/// <summary>
|
||||
/// Info-ZIP Macintosh
|
||||
/// </summary>
|
||||
InfoZIPMacintosh = 0x334D,
|
||||
|
||||
/// <summary>
|
||||
/// Acorn/SparkFS
|
||||
/// </summary>
|
||||
AcornSparkFS = 0x4341,
|
||||
|
||||
/// <summary>
|
||||
/// Windows NT security descriptor (binary ACL)
|
||||
/// </summary>
|
||||
WindowsNTSecurityDescriptor = 0x4453,
|
||||
|
||||
/// <summary>
|
||||
/// VM/CMS
|
||||
/// </summary>
|
||||
VMCMS = 0x4704,
|
||||
|
||||
/// <summary>
|
||||
/// MVS
|
||||
/// </summary>
|
||||
MVS = 0x470F,
|
||||
|
||||
/// <summary>
|
||||
/// THEOS (old?)
|
||||
/// </summary>
|
||||
THEOSold = 0x4854,
|
||||
|
||||
/// <summary>
|
||||
/// FWKCS MD5
|
||||
/// </summary>
|
||||
FWKCSMD5 = 0x4B46,
|
||||
|
||||
/// <summary>
|
||||
/// OS/2 access control list (text ACL)
|
||||
/// </summary>
|
||||
OS2AccessControlList = 0x4C41,
|
||||
|
||||
/// <summary>
|
||||
/// Info-ZIP OpenVMS
|
||||
/// </summary>
|
||||
InfoZIPOpenVMS = 0x4D49,
|
||||
|
||||
/// <summary>
|
||||
/// Macintosh Smartzip (??)
|
||||
/// </summary>
|
||||
MacintoshSmartzip = 0x4D63,
|
||||
|
||||
/// <summary>
|
||||
/// Xceed original location extra field
|
||||
/// </summary>
|
||||
XceedOriginalLocation = 0x4F4C,
|
||||
|
||||
/// <summary>
|
||||
/// AOS/VS (ACL)
|
||||
/// </summary>
|
||||
ADSVS = 0x5356,
|
||||
|
||||
/// <summary>
|
||||
/// extended timestamp
|
||||
/// </summary>
|
||||
ExtendedTimestamp = 0x5455,
|
||||
|
||||
/// <summary>
|
||||
/// Xceed unicode extra field
|
||||
/// </summary>
|
||||
XceedUnicode = 0x554E,
|
||||
|
||||
/// <summary>
|
||||
/// Info-ZIP UNIX (original, also OS/2, NT, etc)
|
||||
/// </summary>
|
||||
InfoZIPUNIX = 0x5855,
|
||||
|
||||
/// <summary>
|
||||
/// Info-ZIP Unicode Comment Extra Field
|
||||
/// </summary>
|
||||
InfoZIPUnicodeComment = 0x6375,
|
||||
|
||||
/// <summary>
|
||||
/// BeOS/BeBox
|
||||
/// </summary>
|
||||
BeOSBeBox = 0x6542,
|
||||
|
||||
/// <summary>
|
||||
/// THEOS
|
||||
/// </summary>
|
||||
THEOS = 0x6854,
|
||||
|
||||
/// <summary>
|
||||
/// Info-ZIP Unicode Path Extra Field
|
||||
/// </summary>
|
||||
InfoZIPUnicodePath = 0x7075,
|
||||
|
||||
/// <summary>
|
||||
/// AtheOS/Syllable
|
||||
/// </summary>
|
||||
AtheOSSyllable = 0x7441,
|
||||
|
||||
/// <summary>
|
||||
/// ASi UNIX
|
||||
/// </summary>
|
||||
ASiUNIX = 0x756E,
|
||||
|
||||
/// <summary>
|
||||
/// Info-ZIP UNIX (new)
|
||||
/// </summary>
|
||||
InfoZIPUNIXNew = 0x7855,
|
||||
|
||||
/// <summary>
|
||||
/// Info-ZIP UNIX (newer UID/GID)
|
||||
/// </summary>
|
||||
InfoZIPUNIXNewer = 0x7875,
|
||||
|
||||
/// <summary>
|
||||
/// Data Stream Alignment (Apache Commons-Compress)
|
||||
/// </summary>
|
||||
DataStreamAlignment = 0xA11E,
|
||||
|
||||
/// <summary>
|
||||
/// Microsoft Open Packaging Growth Hint
|
||||
/// </summary>
|
||||
MicrosoftOpenPackagingGrowthHint = 0xA220,
|
||||
|
||||
/// <summary>
|
||||
/// Java JAR file Extra Field Header ID
|
||||
/// </summary>
|
||||
JavaJAR = 0xCAFE,
|
||||
|
||||
/// <summary>
|
||||
/// Android ZIP Alignment Extra Field
|
||||
/// </summary>
|
||||
AndroidZIPAlignment = 0xD935,
|
||||
|
||||
/// <summary>
|
||||
/// Korean ZIP code page info
|
||||
/// </summary>
|
||||
KoreanZIPCodePage = 0xE57A,
|
||||
|
||||
/// <summary>
|
||||
/// SMS/QDOS
|
||||
/// </summary>
|
||||
SMSQDOS = 0xFD4A,
|
||||
|
||||
/// <summary>
|
||||
/// AE-x encryption structure
|
||||
/// </summary>
|
||||
AExEncryptionStructure = 0x9901,
|
||||
|
||||
/// <summary>
|
||||
/// Unknown
|
||||
/// </summary>
|
||||
Unknown = 0x9902,
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
public enum HostSystem : byte
|
||||
{
|
||||
/// <summary>
|
||||
/// MS-DOS and OS/2 (FAT / VFAT / FAT32 file systems)
|
||||
/// </summary>
|
||||
MSDOS = 0,
|
||||
|
||||
/// <summary>
|
||||
/// Amiga
|
||||
/// </summary>
|
||||
Amiga = 1,
|
||||
|
||||
/// <summary>
|
||||
/// OpenVMS
|
||||
/// </summary>
|
||||
OpenVMS = 2,
|
||||
|
||||
/// <summary>
|
||||
/// UNIX
|
||||
/// </summary>
|
||||
UNIX = 3,
|
||||
|
||||
/// <summary>
|
||||
/// VM/CMS
|
||||
/// </summary>
|
||||
VMCMS = 4,
|
||||
|
||||
/// <summary>
|
||||
/// Atari ST
|
||||
/// </summary>
|
||||
AtariST = 5,
|
||||
|
||||
/// <summary>
|
||||
/// OS/2 H.P.F.S.
|
||||
/// </summary>
|
||||
OS2HPFS = 6,
|
||||
|
||||
/// <summary>
|
||||
/// Macintosh
|
||||
/// </summary>
|
||||
Macintosh = 7,
|
||||
|
||||
/// <summary>
|
||||
/// Z-System
|
||||
/// </summary>
|
||||
ZSystem = 8,
|
||||
|
||||
/// <summary>
|
||||
/// CP/M
|
||||
/// </summary>
|
||||
CPM = 9,
|
||||
|
||||
/// <summary>
|
||||
/// Windows NTFS
|
||||
/// </summary>
|
||||
WindowsNTFS = 10,
|
||||
|
||||
/// <summary>
|
||||
/// MVS (OS/390 - Z/OS)
|
||||
/// </summary>
|
||||
MVS = 11,
|
||||
|
||||
/// <summary>
|
||||
/// VSE
|
||||
/// </summary>
|
||||
VSE = 12,
|
||||
|
||||
/// <summary>
|
||||
/// Acorn Risc
|
||||
/// </summary>
|
||||
AcornRisc = 13,
|
||||
|
||||
/// <summary>
|
||||
/// VFAT
|
||||
/// </summary>
|
||||
VFAT = 14,
|
||||
|
||||
/// <summary>
|
||||
/// alternate MVS
|
||||
/// </summary>
|
||||
AlternateVMS = 15,
|
||||
|
||||
/// <summary>
|
||||
/// BeOS
|
||||
/// </summary>
|
||||
BeOS = 16,
|
||||
|
||||
/// <summary>
|
||||
/// Tandem
|
||||
/// </summary>
|
||||
Tandem = 17,
|
||||
|
||||
/// <summary>
|
||||
/// OS/400
|
||||
/// </summary>
|
||||
OS400 = 18,
|
||||
|
||||
/// <summary>
|
||||
/// OS X (Darwin)
|
||||
/// </summary>
|
||||
OSX = 19,
|
||||
|
||||
// 20 thru 255 - unused
|
||||
}
|
||||
|
||||
[Flags]
|
||||
public enum InternalFileAttributes : ushort
|
||||
{
|
||||
/// <summary>
|
||||
/// Set - The file is apparently an ASCII or text file
|
||||
/// Clear - The file is apparently binary data
|
||||
/// </summary>
|
||||
ASCII = 0b0000_0000_0000_0001,
|
||||
|
||||
/// <summary>
|
||||
/// Reserved for use by PKWARE
|
||||
/// </summary>
|
||||
Bit1 = 0b0000_0000_0000_0010,
|
||||
|
||||
/// <summary>
|
||||
/// Reserved for use by PKWARE
|
||||
/// </summary>
|
||||
Bit2 = 0b0000_0000_0000_0100,
|
||||
|
||||
/*
|
||||
4.4.14.2 The 0x0002 bit of this field indicates, if set, that
|
||||
a 4 byte variable record length control field precedes each
|
||||
logical record indicating the length of the record. The
|
||||
record length control field is stored in little-endian byte
|
||||
order. This flag is independent of text control characters,
|
||||
and if used in conjunction with text data, includes any
|
||||
control characters in the total length of the record. This
|
||||
value is provided for mainframe data transfer support.
|
||||
*/
|
||||
}
|
||||
}
|
||||
@@ -1,62 +0,0 @@
|
||||
namespace SabreTools.Models.PortableExecutable
|
||||
{
|
||||
/// <summary>
|
||||
/// Contains information about each item in a menu resource that does not open a menu
|
||||
/// or a submenu. The structure definition provided here is for explanation only; it
|
||||
/// is not present in any standard header file.
|
||||
///
|
||||
/// Contains information about the menu items in a menu resource that open a menu
|
||||
/// or a submenu. The structure definition provided here is for explanation only;
|
||||
/// it is not present in any standard header file.
|
||||
/// </summary>
|
||||
/// <see href="https://learn.microsoft.com/en-us/windows/win32/menurc/normalmenuitem"/>
|
||||
/// <see href="https://learn.microsoft.com/en-us/windows/win32/menurc/popupmenuitem"/>
|
||||
public sealed class MenuItem
|
||||
{
|
||||
#region NORMALMENUITEM
|
||||
|
||||
/// <summary>
|
||||
/// The type of menu item.
|
||||
/// </summary>
|
||||
public MenuFlags NormalResInfo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// A null-terminated Unicode string that contains the text for this menu item.
|
||||
/// There is no fixed limit on the size of this string.
|
||||
/// </summary>
|
||||
public string? NormalMenuText { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region POPUPMENUITEM
|
||||
|
||||
/// <summary>
|
||||
/// Describes the menu item.
|
||||
/// </summary>
|
||||
public MenuFlags PopupItemType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Describes the menu item.
|
||||
/// </summary>
|
||||
public MenuFlags PopupState { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// A numeric expression that identifies the menu item that is passed in the
|
||||
/// WM_COMMAND message.
|
||||
/// </summary>
|
||||
public uint PopupID { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// A set of bit flags that specify the type of menu item.
|
||||
/// </summary>
|
||||
public MenuFlags PopupResInfo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// A null-terminated Unicode string that contains the text for this menu item.
|
||||
/// There is no fixed limit on the size of this string.
|
||||
/// </summary>
|
||||
public string? PopupMenuText { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
18
README.MD
18
README.MD
@@ -4,24 +4,6 @@ This library comprises of models that represent either directly serializable or
|
||||
|
||||
Find the link to the Nuget package [here](https://www.nuget.org/packages/SabreTools.Models).
|
||||
|
||||
In most completed models for serialization, there is a section that looks like the following:
|
||||
|
||||
```c#
|
||||
#region DO NOT USE IN PRODUCTION
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyAttribute]
|
||||
public XmlAttribute[]? ADDITIONAL_ATTRIBUTES { get; set; }
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyElement]
|
||||
public object[]? ADDITIONAL_ELEMENTS { get; set; }
|
||||
|
||||
#endregion
|
||||
```
|
||||
|
||||
This code should be removed before the models are used. This is only included during debugging and implementation as to ensure that there are no notable holes in the models that would disallow 1:1 replication of inputs.
|
||||
|
||||
## Missing Metadata Models
|
||||
|
||||
The following metadata file formats do not have models included in this library yet and, as such, do not have serializers:
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
namespace SabreTools.Models.RomCenter
|
||||
{
|
||||
/// <remarks>[games]</remarks>
|
||||
public class Games
|
||||
{
|
||||
public Rom[]? Rom { get; set; }
|
||||
|
||||
#region DO NOT USE IN PRODUCTION
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
public string[]? ADDITIONAL_ELEMENTS { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<!-- Assembly Properties -->
|
||||
<TargetFrameworks>net20;net35;net40;net452;net462;net472;net48;netcoreapp3.1;net5.0;net6.0;net7.0;net8.0</TargetFrameworks>
|
||||
<RuntimeIdentifiers>win-x86;win-x64;win-arm64;linux-x64;linux-arm64;osx-x64;osx-arm64</RuntimeIdentifiers>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<Nullable>enable</Nullable>
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
<Version>1.4.3</Version>
|
||||
<WarningsNotAsErrors>CS0618</WarningsNotAsErrors>
|
||||
|
||||
<!-- Package Properties -->
|
||||
<Authors>Matt Nadareski</Authors>
|
||||
<Description>Common models used by other SabreTools projects</Description>
|
||||
<Copyright>Copyright (c) Matt Nadareski 2022-2024</Copyright>
|
||||
<PackageProjectUrl>https://github.com/SabreTools/</PackageProjectUrl>
|
||||
<PackageReadmeFile>README.md</PackageReadmeFile>
|
||||
<RepositoryUrl>https://github.com/SabreTools/SabreTools.Models</RepositoryUrl>
|
||||
<RepositoryType>git</RepositoryType>
|
||||
<PackageTags>model models executable protection archive</PackageTags>
|
||||
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Include="README.md" Pack="true" PackagePath="" />
|
||||
</ItemGroup>
|
||||
|
||||
<!-- Support for old .NET versions -->
|
||||
<ItemGroup Condition="$(TargetFramework.StartsWith(`net2`)) OR $(TargetFramework.StartsWith(`net3`))">
|
||||
<PackageReference Include="MinValueTupleBridge" Version="0.2.0" />
|
||||
</ItemGroup>
|
||||
<ItemGroup Condition="$(TargetFramework.StartsWith(`net4`))">
|
||||
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.0.31903.59
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SabreTools.Models", "SabreTools.Models.csproj", "{51F0D5D9-7C2B-445A-8ECD-4A47B33609C4}"
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SabreTools.Models", "SabreTools.Models\SabreTools.Models.csproj", "{51F0D5D9-7C2B-445A-8ECD-4A47B33609C4}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
|
||||
@@ -201,17 +201,5 @@ namespace SabreTools.Models.ArchiveDotOrg
|
||||
public string? Width { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region DO NOT USE IN PRODUCTION
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyAttribute]
|
||||
public XmlAttribute[]? ADDITIONAL_ATTRIBUTES { get; set; }
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyElement]
|
||||
public object[]? ADDITIONAL_ELEMENTS { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
12
SabreTools.Models/ArchiveDotOrg/Files.cs
Normal file
12
SabreTools.Models/ArchiveDotOrg/Files.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace SabreTools.Models.ArchiveDotOrg
|
||||
{
|
||||
[XmlRoot("files")]
|
||||
public class Files
|
||||
{
|
||||
[XmlElement("file")]
|
||||
public File?[]? File { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -47,12 +47,5 @@ namespace SabreTools.Models.AttractMode
|
||||
public string? PlayedTime { get; set; }
|
||||
|
||||
public string? FileIsAvailable { get; set; }
|
||||
|
||||
#region DO NOT USE IN PRODUCTION
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
public string[]? ADDITIONAL_ELEMENTS { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -6,11 +6,13 @@ namespace SabreTools.Models.BDPlus
|
||||
/// <summary>
|
||||
/// "BDSVM_CC"
|
||||
/// </summary>
|
||||
/// <remarks>8 bytes</remarks>
|
||||
public string? Signature { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 5 bytes of unknown data
|
||||
/// Unknown data
|
||||
/// </summary>
|
||||
/// <remarks>5 bytes</remarks>
|
||||
public byte[]? Unknown1 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
@@ -29,8 +31,9 @@ namespace SabreTools.Models.BDPlus
|
||||
public byte Day { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 4 bytes of unknown data
|
||||
/// Unknown data
|
||||
/// </summary>
|
||||
/// <remarks>4 bytes</remarks>
|
||||
public byte[]? Unknown2 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
@@ -14,6 +14,6 @@
|
||||
/// <summary>
|
||||
/// Files
|
||||
/// </summary>
|
||||
public FileEntry?[]? Files { get; set; }
|
||||
public FileEntry[]? Files { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@ namespace SabreTools.Models.BFPK
|
||||
{
|
||||
public static class Constants
|
||||
{
|
||||
public static readonly byte[] SignatureBytes = new byte[] { 0x42, 0x46, 0x50, 0x4b };
|
||||
public static readonly byte[] SignatureBytes = [0x42, 0x46, 0x50, 0x4b];
|
||||
|
||||
public const string SignatureString = "BFPK";
|
||||
|
||||
11
SabreTools.Models/BSP/AmbientIndexLump.cs
Normal file
11
SabreTools.Models/BSP/AmbientIndexLump.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
namespace SabreTools.Models.BSP
|
||||
{
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(Source)"/>
|
||||
public sealed class AmbientIndexLump : Lump
|
||||
{
|
||||
/// <summary>
|
||||
/// Indicies
|
||||
/// </summary>
|
||||
public LeafAmbientIndex[]? Indicies { get; set; }
|
||||
}
|
||||
}
|
||||
11
SabreTools.Models/BSP/AmbientLightingLump.cs
Normal file
11
SabreTools.Models/BSP/AmbientLightingLump.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
namespace SabreTools.Models.BSP
|
||||
{
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(Source)"/>
|
||||
public sealed class AmbientLightingLump : Lump
|
||||
{
|
||||
/// <summary>
|
||||
/// Lightings
|
||||
/// </summary>
|
||||
public LeafAmbientLighting[]? Lightings { get; set; }
|
||||
}
|
||||
}
|
||||
33
SabreTools.Models/BSP/Brush.cs
Normal file
33
SabreTools.Models/BSP/Brush.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace SabreTools.Models.BSP
|
||||
{
|
||||
/// <summary>
|
||||
/// The brush lump (Lump 18) contains all brushes that were
|
||||
/// present in the original VMF file before compiling.
|
||||
/// Unlike faces, brushes are constructive solid geometry (CSG)
|
||||
/// defined by planes instead of edges and vertices. It is the
|
||||
/// presence of the brush and brushside lumps in Source BSP
|
||||
/// files that makes decompiling them a much easier job than
|
||||
/// for GoldSrc files, which lacked this info.
|
||||
/// </summary>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(Source)"/>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public sealed class Brush
|
||||
{
|
||||
/// <summary>
|
||||
/// First brushside
|
||||
/// </summary>
|
||||
public int FirstSide;
|
||||
|
||||
/// <summary>
|
||||
/// Number of brushsides
|
||||
/// </summary>
|
||||
public int NumSides;
|
||||
|
||||
/// <summary>
|
||||
/// Contents flags
|
||||
/// </summary>
|
||||
public VbspContents Contents;
|
||||
}
|
||||
}
|
||||
11
SabreTools.Models/BSP/BrushesLump.cs
Normal file
11
SabreTools.Models/BSP/BrushesLump.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
namespace SabreTools.Models.BSP
|
||||
{
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(Source)"/>
|
||||
public sealed class BrushesLump : Lump
|
||||
{
|
||||
/// <summary>
|
||||
/// Brushes
|
||||
/// </summary>
|
||||
public Brush[]? Brushes { get; set; }
|
||||
}
|
||||
}
|
||||
48
SabreTools.Models/BSP/Brushside.cs
Normal file
48
SabreTools.Models/BSP/Brushside.cs
Normal file
@@ -0,0 +1,48 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace SabreTools.Models.BSP
|
||||
{
|
||||
/// <summary>
|
||||
/// Planenum is an index info the plane array, giving the plane
|
||||
/// corresponding to this brushside. Texinfo and dispinfo are
|
||||
/// references into the texture and displacement info lumps.
|
||||
/// Bevel is zero for normal brush sides, but 1 if the side is
|
||||
/// a bevel plane (which seem to be used for collision detection).
|
||||
///
|
||||
/// Unlike the face array, brushsides are not culled (removed)
|
||||
/// where they touch the void. Void-facing sides do however have
|
||||
/// their texinfo entry changed to the tools/toolsnodraw texture
|
||||
/// during the compile process. Note there is no direct way of
|
||||
/// linking brushes and brushsides and the corresponding face array
|
||||
/// entries which are used to render that brush. Brushsides are
|
||||
/// used by the engine to calculate all player physics collision
|
||||
/// with world brushes. (Vphysics objects use lump 29 instead.)
|
||||
///
|
||||
/// The maximum number of brushsides is 65536 (MAX_MAP_BRUSHSIDES).
|
||||
/// The maximum number of brushsides on a single brush is 128 (MAX_BRUSH_SIDES).
|
||||
/// </summary>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(Source)"/>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public sealed class Brushside
|
||||
{
|
||||
/// <summary>
|
||||
/// Facing out of the leaf
|
||||
/// </summary>
|
||||
public ushort PlaneNum;
|
||||
|
||||
/// <summary>
|
||||
/// Texture info
|
||||
/// </summary>
|
||||
public short TextureInfo;
|
||||
|
||||
/// <summary>
|
||||
/// Displacement info
|
||||
/// </summary>
|
||||
public short DisplacementInfo;
|
||||
|
||||
/// <summary>
|
||||
/// Is the side a bevel plane?
|
||||
/// </summary>
|
||||
public short Bevel;
|
||||
}
|
||||
}
|
||||
11
SabreTools.Models/BSP/BrushsidesLump.cs
Normal file
11
SabreTools.Models/BSP/BrushsidesLump.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
namespace SabreTools.Models.BSP
|
||||
{
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(Source)"/>
|
||||
public sealed class BrushsidesLump : Lump
|
||||
{
|
||||
/// <summary>
|
||||
/// Brushsides
|
||||
/// </summary>
|
||||
public Brushside[]? Brushsides { get; set; }
|
||||
}
|
||||
}
|
||||
66
SabreTools.Models/BSP/BspFace.cs
Normal file
66
SabreTools.Models/BSP/BspFace.cs
Normal file
@@ -0,0 +1,66 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace SabreTools.Models.BSP
|
||||
{
|
||||
/// <summary>
|
||||
/// The face lump contains the surfaces of the scene.
|
||||
///
|
||||
/// The first number of this data structure is an index into
|
||||
/// the planes lump giving a plane which is parallel to this
|
||||
/// face (meaning they share the same normal). The second
|
||||
/// value may be seen as a boolean. If nPlaneSide equals 0,
|
||||
/// then the normal vector of this face equals the one of the
|
||||
/// parallel plane exactly. Otherwise, the normal of the plane
|
||||
/// has to be multiplied by -1 to point into the right direction.
|
||||
/// Afterwards we have an index into the surfedges lump, as
|
||||
/// well as the count of consecutive surfedges from that position.
|
||||
/// Furthermore there is an index into the texture info lump,
|
||||
/// which is used to find the BSPTEXINFO structure needed to
|
||||
/// calculate the texture coordinates for this face. Afterwards,
|
||||
/// there are four bytes giving some lighting information (partly
|
||||
/// used by the renderer to hide sky surfaces). Finally we have
|
||||
/// an offset in byes giving the beginning of the binary lightmap
|
||||
/// data of this face in the lighting lump.
|
||||
/// </summary>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public sealed class BspFace
|
||||
{
|
||||
/// <summary>
|
||||
/// Plane the face is parallel to
|
||||
/// </summary>
|
||||
public ushort PlaneIndex;
|
||||
|
||||
/// <summary>
|
||||
/// Set if different normals orientation
|
||||
/// </summary>
|
||||
public ushort PlaneSideCount;
|
||||
|
||||
/// <summary>
|
||||
/// Index of the first surfedge
|
||||
/// </summary>
|
||||
public uint FirstEdgeIndex;
|
||||
|
||||
/// <summary>
|
||||
/// Number of consecutive surfedges
|
||||
/// </summary>
|
||||
public ushort NumberOfEdges;
|
||||
|
||||
/// <summary>
|
||||
/// Index of the texture info structure
|
||||
/// </summary>
|
||||
public ushort TextureInfoIndex;
|
||||
|
||||
/// <summary>
|
||||
/// Specify lighting styles
|
||||
/// </summary>
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
|
||||
public byte[]? LightingStyles = new byte[4];
|
||||
|
||||
/// <summary>
|
||||
/// Offsets into the raw lightmap data; if less than zero,
|
||||
/// then a lightmap was not baked for the given face.
|
||||
/// </summary>
|
||||
public int LightmapOffset;
|
||||
}
|
||||
}
|
||||
11
SabreTools.Models/BSP/BspFacesLump.cs
Normal file
11
SabreTools.Models/BSP/BspFacesLump.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
namespace SabreTools.Models.BSP
|
||||
{
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
||||
public sealed class BspFacesLump : Lump
|
||||
{
|
||||
/// <summary>
|
||||
/// Faces
|
||||
/// </summary>
|
||||
public BspFace[]? Faces { get; set; }
|
||||
}
|
||||
}
|
||||
89
SabreTools.Models/BSP/BspFile.cs
Normal file
89
SabreTools.Models/BSP/BspFile.cs
Normal file
@@ -0,0 +1,89 @@
|
||||
namespace SabreTools.Models.BSP
|
||||
{
|
||||
/// <summary>
|
||||
/// Half-Life Level
|
||||
/// </summary>
|
||||
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/BSPFile.h"/>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
||||
public sealed class BspFile
|
||||
{
|
||||
/// <summary>
|
||||
/// Header data
|
||||
/// </summary>
|
||||
public BspHeader? Header { get; set; }
|
||||
|
||||
#region Lumps
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_ENTITIES [0]
|
||||
/// </summary>
|
||||
public EntitiesLump? Entities { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_PLANES [1]
|
||||
/// </summary>
|
||||
public PlanesLump? PlanesLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_TEXTURES [2]
|
||||
/// </summary>
|
||||
public TextureLump? TextureLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_VERTICES [3]
|
||||
/// </summary>
|
||||
public VerticesLump? VerticesLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_NODES [5]
|
||||
/// </summary>
|
||||
public BspNodesLump? NodesLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_TEXINFO [6]
|
||||
/// </summary>
|
||||
public BspTexinfoLump? TexinfoLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_FACES [7]
|
||||
/// </summary>
|
||||
public BspFacesLump? FacesLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_LIGHTING [8]
|
||||
/// </summary>
|
||||
public LightmapLump? LightmapLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_CLIPNODES [9]
|
||||
/// </summary>s
|
||||
public ClipnodesLump? ClipnodesLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_LEAVES [10]
|
||||
/// </summary>
|
||||
public BspLeavesLump? LeavesLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_MARKSURFACES [11]
|
||||
/// </summary>
|
||||
public MarksurfacesLump? MarksurfacesLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_EDGES [12]
|
||||
/// </summary>
|
||||
public EdgesLump? EdgesLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_SURFEDGES [13]
|
||||
/// </summary>
|
||||
public SurfedgesLump? SurfedgesLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_MODELS [14]
|
||||
/// </summary>
|
||||
public BspModelsLump? ModelsLump { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
22
SabreTools.Models/BSP/BspHeader.cs
Normal file
22
SabreTools.Models/BSP/BspHeader.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace SabreTools.Models.BSP
|
||||
{
|
||||
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/BSPFile.h"/>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public sealed class BspHeader
|
||||
{
|
||||
/// <summary>
|
||||
/// Version
|
||||
/// </summary>
|
||||
/// <remarks>Must be 30 for a valid HL BSP file</remarks>
|
||||
public int Version;
|
||||
|
||||
/// <summary>
|
||||
/// Lumps
|
||||
/// </summary>
|
||||
/// <remarks>15 entries</remarks>
|
||||
public BspLumpEntry[]? Lumps { get; set; }
|
||||
}
|
||||
}
|
||||
67
SabreTools.Models/BSP/BspLeaf.cs
Normal file
67
SabreTools.Models/BSP/BspLeaf.cs
Normal file
@@ -0,0 +1,67 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace SabreTools.Models.BSP
|
||||
{
|
||||
/// <summary>
|
||||
/// The leaves lump contains the leaves of the BSP tree.
|
||||
///
|
||||
/// The first entry of this struct is the type of the content
|
||||
/// of this leaf. It can be one of the predefined values, found
|
||||
/// in the compiler source codes, and is litte relevant for the
|
||||
/// actual rendering process. All the more important is the
|
||||
/// next integer containing the offset into the vis lump. It
|
||||
/// defines the start of the raw PVS data for this leaf. If this
|
||||
/// value equals -1, no VIS lists are available for this leaf,
|
||||
/// usually if the map has been built without the VIS compiler.
|
||||
/// The next two 16bit integer triples span the bounding box of
|
||||
/// this leaf. Furthermore, the struct contains an index pointing
|
||||
/// into the array of marksurfaces loaded from the marksufaces
|
||||
/// lump as well as the number of consecutive marksurfaces belonging
|
||||
/// to this leaf. The marksurfaces are looped through during the
|
||||
/// rendering process and point to the actual faces. The final 4 bytes
|
||||
/// specify the volume of ambient sounds in Quake, but are unused in
|
||||
/// GoldSrc.
|
||||
/// </summary>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public sealed class BspLeaf
|
||||
{
|
||||
/// <summary>
|
||||
/// Contents enumeration
|
||||
/// </summary>
|
||||
public BspContents Contents;
|
||||
|
||||
/// <summary>
|
||||
/// Offset into the visibility lump
|
||||
/// </summary>
|
||||
public int VisOffset;
|
||||
|
||||
/// <summary>
|
||||
/// Defines bounding box
|
||||
/// </summary>
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
|
||||
public short[] Mins = new short[3];
|
||||
|
||||
/// <summary>
|
||||
/// Defines bounding box
|
||||
/// </summary>
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
|
||||
public short[] Maxs = new short[3];
|
||||
|
||||
/// <summary>
|
||||
/// Index into marksurfaces array
|
||||
/// </summary>
|
||||
public ushort FirstMarkSurfaceIndex;
|
||||
|
||||
/// <summary>
|
||||
/// Count of marksurfaces array
|
||||
/// </summary>
|
||||
public ushort MarkSurfacesCount;
|
||||
|
||||
/// <summary>
|
||||
/// Ambient sound levels
|
||||
/// </summary>
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
|
||||
public byte[]? AmbientLevels = new byte[4];
|
||||
}
|
||||
}
|
||||
11
SabreTools.Models/BSP/BspLeavesLump.cs
Normal file
11
SabreTools.Models/BSP/BspLeavesLump.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
namespace SabreTools.Models.BSP
|
||||
{
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
||||
public sealed class BspLeavesLump : Lump
|
||||
{
|
||||
/// <summary>
|
||||
/// Leaves
|
||||
/// </summary>
|
||||
public BspLeaf[]? Leaves { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -3,17 +3,18 @@ using System.Runtime.InteropServices;
|
||||
namespace SabreTools.Models.BSP
|
||||
{
|
||||
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/BSPFile.h"/>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public sealed class Lump
|
||||
public class BspLumpEntry
|
||||
{
|
||||
/// <summary>
|
||||
/// Offset
|
||||
/// File offset to data
|
||||
/// </summary>
|
||||
public uint Offset;
|
||||
public int Offset;
|
||||
|
||||
/// <summary>
|
||||
/// Length
|
||||
/// Length of data
|
||||
/// </summary>
|
||||
public uint Length;
|
||||
public int Length;
|
||||
}
|
||||
}
|
||||
63
SabreTools.Models/BSP/BspModel.cs
Normal file
63
SabreTools.Models/BSP/BspModel.cs
Normal file
@@ -0,0 +1,63 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace SabreTools.Models.BSP
|
||||
{
|
||||
/// <summary>
|
||||
/// A model is kind of a mini BSP tree. Its size is determinded
|
||||
/// by the bounding box spaned by the first to members of this
|
||||
/// struct. The major difference between a model and the BSP
|
||||
/// tree holding the scene is that the models use a local
|
||||
/// coordinate system for their vertexes and just state its
|
||||
/// origin in world coordinates. During rendering the coordinate
|
||||
/// system is translated to the origin of the model (glTranslate())
|
||||
/// and moved back after the models BSP tree has been traversed.
|
||||
/// Furthermore their are 4 indexes into node arrays. The first
|
||||
/// one has proofed to index the root node of the mini BSP tree
|
||||
/// used for rendering. The other three indexes could probably be
|
||||
/// used for collision detection, meaning they point into the
|
||||
/// clipnodes, but I am not sure about this. The meaning of the
|
||||
/// next value is also somehow unclear to me. Finally their are
|
||||
/// direct indexes into the faces array, not taking the redirecting
|
||||
/// by the marksurfaces.
|
||||
/// </summary>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public sealed class BspModel
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines bounding box
|
||||
/// </summary>
|
||||
public Vector3D Mins;
|
||||
|
||||
/// <summary>
|
||||
/// Defines bounding box
|
||||
/// </summary>
|
||||
public Vector3D Maxs;
|
||||
|
||||
/// <summary>
|
||||
/// Coordinates to move the coordinate system
|
||||
/// </summary>
|
||||
public Vector3D OriginVector;
|
||||
|
||||
/// <summary>
|
||||
/// Index into nodes array
|
||||
/// </summary>
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.MAX_MAP_HULLS)]
|
||||
public int[]? HeadnodesIndex = new int[Constants.MAX_MAP_HULLS];
|
||||
|
||||
/// <summary>
|
||||
/// ???
|
||||
/// </summary>
|
||||
public int VisLeafsCount;
|
||||
|
||||
/// <summary>
|
||||
/// Index into faces
|
||||
/// </summary>
|
||||
public int FirstFaceIndex;
|
||||
|
||||
/// <summary>
|
||||
/// Count of faces
|
||||
/// </summary>
|
||||
public int FacesCount;
|
||||
}
|
||||
}
|
||||
11
SabreTools.Models/BSP/BspModelsLump.cs
Normal file
11
SabreTools.Models/BSP/BspModelsLump.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
namespace SabreTools.Models.BSP
|
||||
{
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
||||
public sealed class BspModelsLump : Lump
|
||||
{
|
||||
/// <summary>
|
||||
/// Model
|
||||
/// </summary>
|
||||
public BspModel[]? Models { get; set; }
|
||||
}
|
||||
}
|
||||
62
SabreTools.Models/BSP/BspNode.cs
Normal file
62
SabreTools.Models/BSP/BspNode.cs
Normal file
@@ -0,0 +1,62 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace SabreTools.Models.BSP
|
||||
{
|
||||
/// <summary>
|
||||
/// This lump is simple again and contains an array of binary
|
||||
/// structures, the nodes, which are a major part of the BSP tree.
|
||||
///
|
||||
/// Every BSPNODE structure represents a node in the BSP tree and
|
||||
/// every node equals more or less a division step of the BSP algorithm.
|
||||
/// Therefore, each node has an index (iPlane) referring to a plane
|
||||
/// in the plane lump which devides the node into its two child nodes.
|
||||
/// The childnodes are also stored as indexes. Contrary to the plane
|
||||
/// index, the node index for the child is signed. If the index is
|
||||
/// larger than 0, the index indicates a child node. If it is equal
|
||||
/// to or smaller than zero (no valid array index), the bitwise
|
||||
/// inversed value of the index gives an index into the leaves lump.
|
||||
/// Additionally two points (nMins, nMaxs) span the bounding box
|
||||
/// (AABB, axis aligned bounding box) delimitting the space of the node.
|
||||
/// Finally firstFace indexes into the face lump and spezifies the
|
||||
/// first of nFaces surfaces contained in this node.
|
||||
/// </summary>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(Source)"/>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public class BspNode
|
||||
{
|
||||
/// <summary>
|
||||
/// Index into Planes lump
|
||||
/// </summary>
|
||||
public uint PlaneIndex;
|
||||
|
||||
/// <summary>
|
||||
/// If > 0, then indices into Nodes.
|
||||
/// Otherwise bitwise inverse indices into Leafs
|
||||
/// </summary>
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)]
|
||||
public ushort[] Children = new ushort[2];
|
||||
|
||||
/// <summary>
|
||||
/// Defines bounding box
|
||||
/// </summary>
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
|
||||
public ushort[] Mins = new ushort[3];
|
||||
|
||||
/// <summary>
|
||||
/// Defines bounding box
|
||||
/// </summary>
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
|
||||
public ushort[] Maxs = new ushort[3];
|
||||
|
||||
/// <summary>
|
||||
/// Index into Faces
|
||||
/// </summary>
|
||||
public ushort FirstFace;
|
||||
|
||||
/// <summary>
|
||||
/// Count of Faces
|
||||
/// </summary>
|
||||
public ushort FaceCount;
|
||||
}
|
||||
}
|
||||
11
SabreTools.Models/BSP/BspNodesLump.cs
Normal file
11
SabreTools.Models/BSP/BspNodesLump.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
namespace SabreTools.Models.BSP
|
||||
{
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
||||
public sealed class BspNodesLump : Lump
|
||||
{
|
||||
/// <summary>
|
||||
/// Nodes
|
||||
/// </summary>
|
||||
public BspNode[]? Nodes { get; set; }
|
||||
}
|
||||
}
|
||||
52
SabreTools.Models/BSP/BspTexinfo.cs
Normal file
52
SabreTools.Models/BSP/BspTexinfo.cs
Normal file
@@ -0,0 +1,52 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace SabreTools.Models.BSP
|
||||
{
|
||||
/// <summary>
|
||||
/// The texinfo lump contains informations about how textures are
|
||||
/// applied to surfaces. The lump itself is an array of binary data
|
||||
/// structures.
|
||||
///
|
||||
/// This struct is mainly responsible for the calculation of the texture
|
||||
/// coordinates (vS, fSShift, vT, fTShift). This values determine the
|
||||
/// position of the texture on the surface. The iMiptex integer refers
|
||||
/// to the textures in the texture lump and would be the index in an
|
||||
/// array of BSPMITEX structs. Finally, there are 4 Bytes used for flags.
|
||||
/// Only one flag is used by the vanilla engine, being 0x1 for disabling
|
||||
/// lightmaps and subdivision for the surface (used by sky and liquids).
|
||||
/// </summary>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public sealed class BspTexinfo
|
||||
{
|
||||
/// <summary>
|
||||
/// S-vector
|
||||
/// </summary>
|
||||
public Vector3D SVector;
|
||||
|
||||
/// <summary>
|
||||
/// Texture shift in the S direction
|
||||
/// </summary>
|
||||
public float TextureSShift;
|
||||
|
||||
/// <summary>
|
||||
/// T-vector
|
||||
/// </summary>
|
||||
public Vector3D TVector;
|
||||
|
||||
/// <summary>
|
||||
/// Texture shift in the T direction
|
||||
/// </summary>
|
||||
public float TextureTShift;
|
||||
|
||||
/// <summary>
|
||||
/// Index into textures array
|
||||
/// </summary>
|
||||
public uint MiptexIndex;
|
||||
|
||||
/// <summary>
|
||||
/// Texture flags
|
||||
/// </summary>
|
||||
public TextureFlag Flags;
|
||||
}
|
||||
}
|
||||
11
SabreTools.Models/BSP/BspTexinfoLump.cs
Normal file
11
SabreTools.Models/BSP/BspTexinfoLump.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
namespace SabreTools.Models.BSP
|
||||
{
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
||||
public sealed class BspTexinfoLump : Lump
|
||||
{
|
||||
/// <summary>
|
||||
/// Texinfos
|
||||
/// </summary>
|
||||
public BspTexinfo[]? Texinfos { get; set; }
|
||||
}
|
||||
}
|
||||
17
SabreTools.Models/BSP/CDispCornerNeighbors.cs
Normal file
17
SabreTools.Models/BSP/CDispCornerNeighbors.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace SabreTools.Models.BSP
|
||||
{
|
||||
/// <see href="https://github.com/ValveSoftware/source-sdk-2013/blob/0d8dceea4310fde5706b3ce1c70609d72a38efdf/sp/src/public/bspfile.h#L600"/>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public sealed class CDispCornerNeighbors
|
||||
{
|
||||
/// <summary>
|
||||
/// Indices of neighbors.
|
||||
/// </summary>
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
|
||||
public ushort[] Neighbors = new ushort[4];
|
||||
|
||||
public byte NeighborCount;
|
||||
}
|
||||
}
|
||||
12
SabreTools.Models/BSP/CDispNeighbor.cs
Normal file
12
SabreTools.Models/BSP/CDispNeighbor.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace SabreTools.Models.BSP
|
||||
{
|
||||
/// <see href="https://github.com/ValveSoftware/source-sdk-2013/blob/0d8dceea4310fde5706b3ce1c70609d72a38efdf/sp/src/public/bspfile.h#L583"/>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public sealed class CDispNeighbor
|
||||
{
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)]
|
||||
public CDispSubNeighbor[]? SubNeighbors = new CDispSubNeighbor[2];
|
||||
}
|
||||
}
|
||||
32
SabreTools.Models/BSP/CDispSubNeighbor.cs
Normal file
32
SabreTools.Models/BSP/CDispSubNeighbor.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace SabreTools.Models.BSP
|
||||
{
|
||||
/// <see href="https://github.com/ValveSoftware/source-sdk-2013/blob/0d8dceea4310fde5706b3ce1c70609d72a38efdf/sp/src/public/bspfile.h#L557"/>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public sealed class CDispSubNeighbor
|
||||
{
|
||||
/// <summary>
|
||||
/// This indexes into ddispinfos.
|
||||
/// </summary>
|
||||
/// <remarks>0xFFFF if there is no neighbor here.</remarks>
|
||||
public ushort NeighborIndex;
|
||||
|
||||
/// <summary>
|
||||
/// (CCW) rotation of the neighbor wrt this displacement.
|
||||
/// </summary>
|
||||
public byte NeighborOrientation;
|
||||
|
||||
// These use the NeighborSpan type.
|
||||
|
||||
/// <summary>
|
||||
/// Where the neighbor fits onto this side of our displacement.
|
||||
/// </summary>
|
||||
public byte Span;
|
||||
|
||||
/// <summary>
|
||||
/// Where we fit onto our neighbor.
|
||||
/// </summary>
|
||||
public byte NeighborSpan;
|
||||
}
|
||||
}
|
||||
28
SabreTools.Models/BSP/Clipnode.cs
Normal file
28
SabreTools.Models/BSP/Clipnode.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace SabreTools.Models.BSP
|
||||
{
|
||||
/// <summary>
|
||||
/// This lump contains the so-called clipnodes, which build a second
|
||||
/// BSP tree used only for collision detection.
|
||||
///
|
||||
/// This structure is a reduced form of the BSPNODE struct from the
|
||||
/// nodes lump. Also the BSP tree built by the clipnodes is simpler
|
||||
/// than the one described by the BSPNODEs to accelerate collision calculations.
|
||||
/// </summary>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public sealed class Clipnode
|
||||
{
|
||||
/// <summary>
|
||||
/// Index into planes
|
||||
/// </summary>
|
||||
public int PlaneIndex;
|
||||
|
||||
/// <summary>
|
||||
/// Negative numbers are contents
|
||||
/// </summary>
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)]
|
||||
public short[]? ChildrenIndices = new short[2];
|
||||
}
|
||||
}
|
||||
11
SabreTools.Models/BSP/ClipnodesLump.cs
Normal file
11
SabreTools.Models/BSP/ClipnodesLump.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
namespace SabreTools.Models.BSP
|
||||
{
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
||||
public sealed class ClipnodesLump : Lump
|
||||
{
|
||||
/// <summary>
|
||||
/// Clipnodes
|
||||
/// </summary>
|
||||
public Clipnode[]? Clipnodes { get; set; }
|
||||
}
|
||||
}
|
||||
20
SabreTools.Models/BSP/ColorRGBExp32.cs
Normal file
20
SabreTools.Models/BSP/ColorRGBExp32.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace SabreTools.Models.BSP
|
||||
{
|
||||
/// <summary>
|
||||
/// 4-byte lightmap structure
|
||||
/// </summary>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(Source)"/>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct ColorRGBExp32
|
||||
{
|
||||
public byte Red;
|
||||
|
||||
public byte Green;
|
||||
|
||||
public byte Blue;
|
||||
|
||||
public sbyte Exponent;
|
||||
}
|
||||
}
|
||||
16
SabreTools.Models/BSP/CompressedLightCube.cs
Normal file
16
SabreTools.Models/BSP/CompressedLightCube.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace SabreTools.Models.BSP
|
||||
{
|
||||
/// <summary>
|
||||
/// The lighting data for each sample is represented by an array
|
||||
/// of 6 ColorRGBExp32
|
||||
/// </summary>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(Source)"/>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct CompressedLightCube
|
||||
{
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)]
|
||||
public ColorRGBExp32[]? Colors;
|
||||
}
|
||||
}
|
||||
100
SabreTools.Models/BSP/Constants.cs
Normal file
100
SabreTools.Models/BSP/Constants.cs
Normal file
@@ -0,0 +1,100 @@
|
||||
namespace SabreTools.Models.BSP
|
||||
{
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(Source)"/>
|
||||
public static class Constants
|
||||
{
|
||||
#region Header
|
||||
|
||||
/// <summary>
|
||||
/// Number of lumps in a BSP
|
||||
/// </summary>
|
||||
public const int BSP_HEADER_LUMPS = 15;
|
||||
|
||||
/// <summary>
|
||||
/// Number of lumps in a VBSP
|
||||
/// </summary>
|
||||
public const int VBSP_HEADER_LUMPS = 64;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Lump
|
||||
|
||||
public const int MAX_MAP_HULLS = 4;
|
||||
|
||||
public const int MAX_MAP_MODELS = 400;
|
||||
public const int MAX_MAP_BRUSHES = 4096;
|
||||
public const int MAX_MAP_ENTITIES = 1024;
|
||||
public const int MAX_MAP_ENTSTRING = (128 * 1024);
|
||||
|
||||
public const int MAX_MAP_PLANES = 32767;
|
||||
public const int MAX_MAP_NODES = 32767;
|
||||
public const int MAX_MAP_CLIPNODES = 32767;
|
||||
public const int MAX_MAP_LEAFS = 8192;
|
||||
public const int MAX_MAP_VERTS = 65535;
|
||||
public const int MAX_MAP_FACES = 65535;
|
||||
public const int MAX_MAP_MARKSURFACES = 65535;
|
||||
public const int MAX_MAP_TEXINFO = 8192;
|
||||
public const int MAX_MAP_EDGES = 256000;
|
||||
public const int MAX_MAP_SURFEDGES = 512000;
|
||||
public const int MAX_MAP_TEXTURES = 512;
|
||||
public const int MAX_MAP_MIPTEX = 0x200000;
|
||||
public const int MAX_MAP_LIGHTING = 0x200000;
|
||||
public const int MAX_MAP_VISIBILITY = 0x200000;
|
||||
|
||||
public const int MAX_MAP_PORTALS = 65536;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Entities
|
||||
|
||||
public const int MAX_KEY = 32;
|
||||
|
||||
public const int MAX_VALUE = 1024;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Textures
|
||||
|
||||
public const int MAXTEXTURENAME = 16;
|
||||
|
||||
public const int MIPLEVELS = 4;
|
||||
|
||||
#endregion
|
||||
|
||||
#region VBSP
|
||||
|
||||
public static readonly byte[] SignatureBytes = [0x56, 0x42, 0x53, 0x50];
|
||||
|
||||
public const string SignatureString = "VBSP";
|
||||
|
||||
public const uint SignatureUInt32 = 0x50534256;
|
||||
|
||||
#endregion
|
||||
|
||||
#region LZMA
|
||||
|
||||
public static readonly byte[] LzmaHeaderBytes = [0x4C, 0x5A, 0x4D, 0x41];
|
||||
|
||||
public const string LzmaHeaderString = "LZMA";
|
||||
|
||||
public const uint LzmaHeaderUInt32 = 0x414D5A4C;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Overlay
|
||||
|
||||
public const int OVERLAY_BSP_FACE_COUNT = 64;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Worldlights
|
||||
|
||||
/// <summary>
|
||||
/// This says that the light was put into the per-leaf ambient cubes.
|
||||
/// </summary>
|
||||
public const int DWL_FLAGS_INAMBIENTCUBE = 0x0001;
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
50
SabreTools.Models/BSP/Cubemap.cs
Normal file
50
SabreTools.Models/BSP/Cubemap.cs
Normal file
@@ -0,0 +1,50 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace SabreTools.Models.BSP
|
||||
{
|
||||
/// <summary>
|
||||
/// The dcubemapsample_t structure defines the location of a
|
||||
/// env_cubemap entity in the map. The origin member contains
|
||||
/// integer x,y,z coordinates of the cubemap, and the size member
|
||||
/// is resolution of the cubemap, specified as 2^(size-1) pixels
|
||||
/// square. If set as 0, the default size of 6 (32x32 pixels) is
|
||||
/// used. There can be a maximum of 1024 (MAX_MAP_CUBEMAPSAMPLES)
|
||||
/// cubemaps in a file.
|
||||
///
|
||||
/// When the "buildcubemaps" console command is performed, six
|
||||
/// snapshots of the map (one for each direction) are taken at the
|
||||
/// location of each env_cubemap entity. These snapshots are stored
|
||||
/// in a multi-frame texture (vtf) file, which is added to the
|
||||
/// Pakfile lump (see above). The textures are named cX_Y_Z.vtf,
|
||||
/// where (X,Y,Z) are the (integer) coordinates of the corresponding
|
||||
/// cubemap.
|
||||
///
|
||||
/// Faces containing materials that are environment mapped (e.g.
|
||||
/// shiny textures) reference their assigned cubemap through their
|
||||
/// material name. A face with a material named (e.g.) walls/shiny.vmt
|
||||
/// is altered (new Texinfo & Texdata entries are created) to refer
|
||||
/// to a renamed material maps/mapname/walls/shiny_X_Y_Z.vmt, where
|
||||
/// (X,Y,Z) are the cubemap coordinates as before. This .vmt file
|
||||
/// is also stored in the Pakfile, and references the cubemap .vtf
|
||||
/// file through its $envmap property.
|
||||
///
|
||||
/// Version 20 files contain extra cX_Y_Z.hdr.vtf files in the
|
||||
/// Pakfile lump, containing HDR texture files in RGBA16161616F
|
||||
/// (16-bit per channel) format.
|
||||
/// </summary>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(Source)"/>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public sealed class Cubemap
|
||||
{
|
||||
/// <summary>
|
||||
/// Position of light snapped to the nearest integer
|
||||
/// </summary>
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
|
||||
public int[]? Origin = new int[3];
|
||||
|
||||
/// <summary>
|
||||
/// Resolution of cubemap, 0 - default
|
||||
/// </summary>
|
||||
public int Size;
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user