Migrate recent HLLib work to BOS

It's better suited for the model of BOS and not an update to HLLibSharp
This commit is contained in:
Matt Nadareski
2022-12-24 12:57:10 -08:00
parent 3a862f343c
commit d8aec5aa97
101 changed files with 5399 additions and 22 deletions

View File

@@ -0,0 +1,35 @@
namespace BurnOutSharp.Models.BMP
{
/// <summary>
/// The BITMAPFILEHEADER structure contains information about the type, size,
/// and layout of a file that contains a DIB.
/// </summary>
/// <see href="https://learn.microsoft.com/en-us/windows/win32/api/wingdi/ns-wingdi-bitmapfileheader"/>
public sealed class BITMAPFILEHEADER
{
/// <summary>
/// The file type; must be BM.
/// </summary>
public ushort Type;
/// <summary>
/// The size, in bytes, of the bitmap file.
/// </summary>
public uint Size;
/// <summary>
/// Reserved; must be zero.
/// </summary>
public ushort Reserved1;
/// <summary>
/// Reserved; must be zero.
/// </summary>
public ushort Reserved2;
/// <summary>
/// The offset, in bytes, from the beginning of the BITMAPFILEHEADER structure to the bitmap bits.
/// </summary>
public uint OffBits;
}
}

View File

@@ -0,0 +1,94 @@
namespace BurnOutSharp.Models.BMP
{
/// <summary>
/// The BITMAPINFOHEADER structure contains information about the dimensions and
/// color format of a device-independent bitmap (DIB).
/// </summary>
public sealed class BITMAPINFOHEADER
{
/// <summary>
/// Specifies the number of bytes required by the structure. This value does
/// not include the size of the color table or the size of the color masks,
/// if they are appended to the end of structure.
/// </summary>
public uint Size;
/// <summary>
/// Specifies the width of the bitmap, in pixels.
/// </summary>
public int Width;
/// <summary>
/// Specifies the height of the bitmap, in pixels.
/// - For uncompressed RGB bitmaps, if biHeight is positive, the bitmap is a
/// bottom-up DIB with the origin at the lower left corner. If biHeight is
/// negative, the bitmap is a top-down DIB with the origin at the upper left
/// corner.
/// - For YUV bitmaps, the bitmap is always top-down, regardless of the sign of
/// biHeight. Decoders should offer YUV formats with positive biHeight, but for
/// backward compatibility they should accept YUV formats with either positive
/// or negative biHeight.
/// - For compressed formats, biHeight must be positive, regardless of image orientation.
/// </summary>
public int Height;
/// <summary>
/// Specifies the number of planes for the target device. This value must be set to 1.
/// </summary>
public ushort Planes;
/// <summary>
/// Specifies the number of bits per pixel (bpp). For uncompressed formats, this value
/// is the average number of bits per pixel. For compressed formats, this value is the
/// implied bit depth of the uncompressed image, after the image has been decoded.
/// </summary>
public ushort BitCount;
/// <summary>
/// For compressed video and YUV formats, this member is a FOURCC code, specified as a
/// DWORD in little-endian order. For example, YUYV video has the FOURCC 'VYUY' or
/// 0x56595559. For more information, see FOURCC Codes.
///
/// For uncompressed RGB formats, the following values are possible:
/// - BI_RGB: Uncompressed RGB.
/// - BI_BITFIELDS: Uncompressed RGB with color masks. Valid for 16-bpp and 32-bpp bitmaps.
///
/// Note that BI_JPG and BI_PNG are not valid video formats.
///
/// For 16-bpp bitmaps, if biCompression equals BI_RGB, the format is always RGB 555.
/// If biCompression equals BI_BITFIELDS, the format is either RGB 555 or RGB 565. Use
/// the subtype GUID in the AM_MEDIA_TYPE structure to determine the specific RGB type.
/// </summary>
public uint Compression;
/// <summary>
/// Specifies the size, in bytes, of the image. This can be set to 0 for uncompressed
/// RGB bitmaps.
/// </summary>
public uint SizeImage;
/// <summary>
/// Specifies the horizontal resolution, in pixels per meter, of the target device for
/// the bitmap.
/// </summary>
public int XPelsPerMeter;
/// <summary>
/// Specifies the vertical resolution, in pixels per meter, of the target device for
/// the bitmap.
/// </summary>
public int YPelsPerMeter;
/// <summary>
/// Specifies the number of color indices in the color table that are actually used by
/// the bitmap.
/// </summary>
public uint ClrUsed;
/// <summary>
/// Specifies the number of color indices that are considered important for displaying
/// the bitmap. If this value is zero, all colors are important.
/// </summary>
public uint ClrImportant;
}
}

View File

@@ -0,0 +1,24 @@
namespace BurnOutSharp.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; }
}
}

View File

@@ -0,0 +1,11 @@
namespace BurnOutSharp.Models.BSP
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/BSPFile.h"/>
public sealed class Header
{
/// <summary>
/// Version
/// </summary>
public uint Version;
}
}

View File

@@ -0,0 +1,16 @@
namespace BurnOutSharp.Models.BSP
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/BSPFile.h"/>
public sealed class Lump
{
/// <summary>
/// Offset
/// </summary>
public uint Offset;
/// <summary>
/// Length
/// </summary>
public uint Length;
}
}

View File

@@ -0,0 +1,26 @@
namespace BurnOutSharp.Models.BSP
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/BSPFile.h"/>
public sealed class Texture
{
/// <summary>
/// Name
/// </summary>
public string Name;
/// <summary>
/// Width
/// </summary>
public uint Width;
/// <summary>
/// Height
/// </summary>
public uint Height;
/// <summary>
/// Offsets
/// </summary>
public uint[] Offsets;
}
}

View File

@@ -0,0 +1,16 @@
namespace BurnOutSharp.Models.BSP
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/BSPFile.h"/>
public sealed class TextureHeader
{
/// <summary>
/// Texture count
/// </summary>
public uint TextureCount;
/// <summary>
/// Offsets
/// </summary>
public uint[] Offsets;
}
}

View File

@@ -0,0 +1,41 @@
namespace BurnOutSharp.Models.GCF
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/GCFFile.h"/>
public sealed class BlockEntry
{
/// <summary>
/// Flags for the block entry. 0x200F0000 == Not used.
/// </summary>
public uint EntryFlags;
/// <summary>
/// The offset for the data contained in this block entry in the file.
/// </summary>
public uint FileDataOffset;
/// <summary>
/// The length of the data in this block entry.
/// </summary>
public uint FileDataSize;
/// <summary>
/// The offset to the first data block of this block entry's data.
/// </summary>
public uint FirstDataBlockIndex;
/// <summary>
/// The next block entry in the series. (N/A if == BlockCount.)
/// </summary>
public uint NextBlockEntryIndex;
/// <summary>
/// The previous block entry in the series. (N/A if == BlockCount.)
/// </summary>
public uint PreviousBlockEntryIndex;
/// <summary>
/// The offset of the block entry in the directory.
/// </summary>
public uint DirectoryIndex;
}
}

View File

@@ -0,0 +1,46 @@
namespace BurnOutSharp.Models.GCF
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/GCFFile.h"/>
public sealed class BlockEntryHeader
{
/// <summary>
/// Number of data blocks.
/// </summary>
public uint BlockCount;
/// <summary>
/// Number of data blocks that point to data.
/// </summary>
public uint BlocksUsed;
/// <summary>
/// Reserved
/// </summary>
public uint Dummy0;
/// <summary>
/// Reserved
/// </summary>
public uint Dummy1;
/// <summary>
/// Reserved
/// </summary>
public uint Dummy2;
/// <summary>
/// Reserved
/// </summary>
public uint Dummy3;
/// <summary>
/// Reserved
/// </summary>
public uint Dummy4;
/// <summary>
/// Header checksum.
/// </summary>
public uint Checksum;
}
}

View File

@@ -0,0 +1,19 @@
namespace BurnOutSharp.Models.GCF
{
/// <remarks>
/// Part of version 5 but not version 6.
/// </remarks>
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/GCFFile.h"/>
public sealed class BlockEntryMap
{
/// <summary>
/// The previous block entry. (N/A if == BlockCount.)
/// </summary>
public uint PreviousBlockEntryIndex;
/// <summary>
/// The next block entry. (N/A if == BlockCount.)
/// </summary>
public uint NextBlockEntryIndex;
}
}

View File

@@ -0,0 +1,34 @@
namespace BurnOutSharp.Models.GCF
{
/// <remarks>
/// Part of version 5 but not version 6.
/// </remarks>
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/GCFFile.h"/>
public sealed class BlockEntryMapHeader
{
/// <summary>
/// Number of data blocks.
/// </summary>
public uint BlockCount;
/// <summary>
/// Index of the first block entry.
/// </summary>
public uint FirstBlockEntryIndex;
/// <summary>
/// Index of the last block entry.
/// </summary>
public uint LastBlockEntryIndex;
/// <summary>
/// Reserved
/// </summary>
public uint Dummy0;
/// <summary>
/// Header checksum.
/// </summary>
public uint Checksum;
}
}

View File

@@ -0,0 +1,11 @@
namespace BurnOutSharp.Models.GCF
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/GCFFile.h"/>
public sealed class ChecksumEntry
{
/// <summary>
/// Checksum.
/// </summary>
public uint Checksum;
}
}

View File

@@ -0,0 +1,16 @@
namespace BurnOutSharp.Models.GCF
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/GCFFile.h"/>
public sealed class ChecksumHeader
{
/// <summary>
/// Always 0x00000001
/// </summary>
public uint Dummy0;
/// <summary>
/// Size of LPGCFCHECKSUMHEADER & LPGCFCHECKSUMMAPHEADER & in bytes.
/// </summary>
public uint ChecksumSize;
}
}

View File

@@ -0,0 +1,16 @@
namespace BurnOutSharp.Models.GCF
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/GCFFile.h"/>
public sealed class ChecksumMapEntry
{
/// <summary>
/// Number of checksums.
/// </summary>
public uint ChecksumCount;
/// <summary>
/// Index of first checksum.
/// </summary>
public uint FirstChecksumIndex;
}
}

View File

@@ -0,0 +1,26 @@
namespace BurnOutSharp.Models.GCF
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/GCFFile.h"/>
public sealed class ChecksumMapHeader
{
/// <summary>
/// Always 0x14893721
/// </summary>
public uint Dummy0;
/// <summary>
/// Always 0x00000001
/// </summary>
public uint Dummy1;
/// <summary>
/// Number of items.
/// </summary>
public uint ItemCount;
/// <summary>
/// Number of checksums.
/// </summary>
public uint ChecksumCount;
}
}

View File

@@ -0,0 +1,36 @@
namespace BurnOutSharp.Models.GCF
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/GCFFile.h"/>
public sealed class DataBlockHeader
{
/// <summary>
/// GCF file version. This field is not part of all file versions.
/// </summary>
public uint LastVersionPlayed;
/// <summary>
/// Number of data blocks.
/// </summary>
public uint BlockCount;
/// <summary>
/// Size of each data block in bytes.
/// </summary>
public uint BlockSize;
/// <summary>
/// Offset to first data block.
/// </summary>
public uint FirstBlockOffset;
/// <summary>
/// Number of data blocks that contain data.
/// </summary>
public uint BlocksUsed;
/// <summary>
/// Header checksum.
/// </summary>
public uint Checksum;
}
}

View File

@@ -0,0 +1,11 @@
namespace BurnOutSharp.Models.GCF
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/GCFFile.h"/>
public sealed class DirectoryCopyEntry
{
/// <summary>
/// Index of the directory item.
/// </summary>
public uint DirectoryIndex;
}
}

View File

@@ -0,0 +1,41 @@
namespace BurnOutSharp.Models.GCF
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/GCFFile.h"/>
public sealed class DirectoryEntry
{
/// <summary>
/// Offset to the directory item name from the end of the directory items.
/// </summary>
public uint NameOffset;
/// <summary>
/// Size of the item. (If file, file size. If folder, num items.)
/// </summary>
public uint ItemSize;
/// <summary>
/// Checksome index. (0xFFFFFFFF == None).
/// </summary>
public uint ChecksumIndex;
/// <summary>
/// Flags for the directory item. (0x00000000 == Folder).
/// </summary>
public uint DirectoryFlags;
/// <summary>
/// Index of the parent directory item. (0xFFFFFFFF == None).
/// </summary>
public uint ParentIndex;
/// <summary>
/// Index of the next directory item. (0x00000000 == None).
/// </summary>
public uint NextIndex;
/// <summary>
/// Index of the first directory item. (0x00000000 == None).
/// </summary>
public uint FirstIndex;
}
}

View File

@@ -0,0 +1,76 @@
namespace BurnOutSharp.Models.GCF
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/GCFFile.h"/>
public sealed class DirectoryHeader
{
/// <summary>
/// Always 0x00000004
/// </summary>
public uint Dummy0;
/// <summary>
/// Cache ID.
/// </summary>
public uint CacheID;
/// <summary>
/// GCF file version.
/// </summary>
public uint LastVersionPlayed;
/// <summary>
/// Number of items in the directory.
/// </summary>
public uint ItemCount;
/// <summary>
/// Number of files in the directory.
/// </summary>
public uint FileCount;
/// <summary>
/// Always 0x00008000. Data per checksum?
/// </summary>
public uint Dummy1;
/// <summary>
/// Size of lpGCFDirectoryEntries & lpGCFDirectoryNames & lpGCFDirectoryInfo1Entries & lpGCFDirectoryInfo2Entries & lpGCFDirectoryCopyEntries & lpGCFDirectoryLocalEntries in bytes.
/// </summary>
public uint DirectorySize;
/// <summary>
/// Size of the directory names in bytes.
/// </summary>
public uint NameSize;
/// <summary>
/// Number of Info1 entires.
/// </summary>
public uint Info1Count;
/// <summary>
/// Number of files to copy.
/// </summary>
public uint CopyCount;
/// <summary>
/// Number of files to keep local.
/// </summary>
public uint LocalCount;
/// <summary>
/// Reserved
/// </summary>
public uint Dummy2;
/// <summary>
/// Reserved
/// </summary>
public uint Dummy3;
/// <summary>
/// Header checksum.
/// </summary>
public uint Checksum;
}
}

View File

@@ -0,0 +1,11 @@
namespace BurnOutSharp.Models.GCF
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/GCFFile.h"/>
public sealed class DirectoryInfo1Entry
{
/// <summary>
/// Reserved
/// </summary>
public uint Dummy0;
}
}

View File

@@ -0,0 +1,11 @@
namespace BurnOutSharp.Models.GCF
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/GCFFile.h"/>
public sealed class DirectoryInfo2Entry
{
/// <summary>
/// Reserved
/// </summary>
public uint Dummy0;
}
}

View File

@@ -0,0 +1,11 @@
namespace BurnOutSharp.Models.GCF
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/GCFFile.h"/>
public sealed class DirectoryLocalEntry
{
/// <summary>
/// Index of the directory item.
/// </summary>
public uint DirectoryIndex;
}
}

View File

@@ -0,0 +1,11 @@
namespace BurnOutSharp.Models.GCF
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/GCFFile.h"/>
public sealed class DirectoryMapEntry
{
/// <summary>
/// Index of the first data block. (N/A if == BlockCount.)
/// </summary>
public uint FirstBlockIndex;
}
}

View File

@@ -0,0 +1,19 @@
namespace BurnOutSharp.Models.GCF
{
/// <remarks>
/// Added in version 4 or version 5.
/// </remarks>
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/GCFFile.h"/>
public sealed class DirectoryMapHeader
{
/// <summary>
/// Always 0x00000001
/// </summary>
public uint Dummy0;
/// <summary>
/// Always 0x00000000
/// </summary>
public uint Dummy1;
}
}

View File

@@ -0,0 +1,116 @@
namespace BurnOutSharp.Models.GCF
{
/// <summary>
/// Half-Life Game Cache File
/// </summary>
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/GCFFile.h"/>
public sealed class File
{
/// <summary>
/// Header data
/// </summary>
public Header Header { get; set; }
/// <summary>
/// Block entry header data
/// </summary>
public BlockEntryHeader BlockEntryHeader { get; set; }
/// <summary>
/// Block entries data
/// </summary>
public BlockEntry[] BlockEntries { get; set; }
/// <summary>
/// Fragmentation map header data
/// </summary>
public FragmentationMapHeader FragmentationMapHeader { get; set; }
/// <summary>
/// Fragmentation map data
/// </summary>
public FragmentationMap[] FragmentationMaps { get; set; }
/// <summary>
/// Block entry map header data
/// </summary>
/// <remarks>Part of version 5 but not version 6.</remarks>
public BlockEntryMapHeader BlockEntryMapHeader { get; set; }
/// <summary>
/// Block entry map data
/// </summary>
/// <remarks>Part of version 5 but not version 6.</remarks>
public BlockEntryMap[] BlockEntryMaps { get; set; }
/// <summary>
/// Directory header data
/// </summary>
public DirectoryHeader DirectoryHeader { get; set; }
/// <summary>
/// Directory entries data
/// </summary>
public DirectoryEntry[] DirectoryEntries { get; set; }
/// <summary>
/// Directory names data
/// </summary>
public string DirectoryNames { get; set; }
/// <summary>
/// Directory info 1 entries data
/// </summary>
public DirectoryInfo1Entry[] DirectoryInfo1Entries { get; set; }
/// <summary>
/// Directory info 2 entries data
/// </summary>
public DirectoryInfo2Entry[] DirectoryInfo2Entries { get; set; }
/// <summary>
/// Directory copy entries data
/// </summary>
public DirectoryCopyEntry[] DirectoryCopyEntries { get; set; }
/// <summary>
/// Directory local entries data
/// </summary>
public DirectoryLocalEntry[] DirectoryLocalEntries { get; set; }
/// <summary>
/// Directory map header data
/// </summary>
public DirectoryMapHeader DirectoryMapHeader { get; set; }
/// <summary>
/// Directory map entries data
/// </summary>
public DirectoryMapEntry[] DirectoryMapEntries { get; set; }
/// <summary>
/// Checksum header data
/// </summary>
public ChecksumHeader ChecksumHeader { get; set; }
/// <summary>
/// Checksum map header data
/// </summary>
public ChecksumMapHeader ChecksumMapHeader { get; set; }
/// <summary>
/// Checksum map entries data
/// </summary>
public ChecksumMapEntry[] ChecksumMapEntries { get; set; }
/// <summary>
/// Checksum entries data
/// </summary>
public ChecksumEntry[] ChecksumEntries { get; set; }
/// <summary>
/// Data block header data
/// </summary>
public DataBlockHeader DataBlockHeader { get; set; }
}
}

View File

@@ -0,0 +1,11 @@
namespace BurnOutSharp.Models.GCF
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/GCFFile.h"/>
public sealed class FragmentationMap
{
/// <summary>
/// The index of the next data block.
/// </summary>
public uint NextDataBlockIndex;
}
}

View File

@@ -0,0 +1,26 @@
namespace BurnOutSharp.Models.GCF
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/GCFFile.h"/>
public sealed class FragmentationMapHeader
{
/// <summary>
/// Number of data blocks.
/// </summary>
public uint BlockCount;
/// <summary>
/// The index of the first unused fragmentation map entry.
/// </summary>
public uint FirstUnusedEntry;
/// <summary>
/// The block entry terminator; 0 = 0x0000ffff or 1 = 0xffffffff.
/// </summary>
public uint Terminator;
/// <summary>
/// Header checksum.
/// </summary>
public uint Checksum;
}
}

View File

@@ -0,0 +1,61 @@
namespace BurnOutSharp.Models.GCF
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/GCFFile.h"/>
public sealed class Header
{
/// <summary>
/// Always 0x00000001
/// </summary>
public uint Dummy0;
/// <summary>
/// Always 0x00000001
/// </summary>
public uint MajorVersion;
/// <summary>
/// GCF version number.
/// </summary>
public uint MinorVersion;
/// <summary>
/// Cache ID
/// </summary>
public uint CacheID;
/// <summary>
/// Last version played
/// </summary>
public uint LastVersionPlayed;
/// <summary>
/// Reserved
/// </summary>
public uint Dummy1;
/// <summary>
/// Reserved
/// </summary>
public uint Dummy2;
/// <summary>
/// Total size of GCF file in bytes.
/// </summary>
public uint FileSize;
/// <summary>
/// Size of each data block in bytes.
/// </summary>
public uint BlockSize;
/// <summary>
/// Number of data blocks.
/// </summary>
public uint BlockCount;
/// <summary>
/// Reserved
/// </summary>
public uint Dummy3;
}
}

View File

@@ -0,0 +1,11 @@
namespace BurnOutSharp.Models.NCF
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/NCFFile.h"/>
public sealed class ChecksumEntry
{
/// <summary>
/// Checksum.
/// </summary>
public uint Checksum;
}
}

View File

@@ -0,0 +1,16 @@
namespace BurnOutSharp.Models.NCF
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/NCFFile.h"/>
public sealed class ChecksumHeader
{
/// <summary>
/// Always 0x00000001
/// </summary>
public uint Dummy0 { get; set; }
/// <summary>
/// Size of LPNCFCHECKSUMHEADER & LPNCFCHECKSUMMAPHEADER & in bytes.
/// </summary>
public uint ChecksumSize { get; set; }
}
}

View File

@@ -0,0 +1,16 @@
namespace BurnOutSharp.Models.NCF
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/NCFFile.h"/>
public sealed class ChecksumMapEntry
{
/// <summary>
/// Number of checksums.
/// </summary>
public uint ChecksumCount;
/// <summary>
/// Index of first checksum.
/// </summary>
public uint FirstChecksumIndex;
}
}

View File

@@ -0,0 +1,26 @@
namespace BurnOutSharp.Models.NCF
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/NCFFile.h"/>
public sealed class ChecksumMapHeader
{
/// <summary>
/// Always 0x14893721
/// </summary>
public uint Dummy0;
/// <summary>
/// Always 0x00000001
/// </summary>
public uint Dummy1;
/// <summary>
/// Number of items.
/// </summary>
public uint ItemCount;
/// <summary>
/// Number of checksums.
/// </summary>
public uint ChecksumCount;
}
}

View File

@@ -0,0 +1,11 @@
namespace BurnOutSharp.Models.NCF
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/NCFFile.h"/>
public sealed class DirectoryCopyEntry
{
/// <summary>
/// Index of the directory item.
/// </summary>
public uint DirectoryIndex;
}
}

View File

@@ -0,0 +1,41 @@
namespace BurnOutSharp.Models.NCF
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/NCFFile.h"/>
public sealed class DirectoryEntry
{
/// <summary>
/// Offset to the directory item name from the end of the directory items.
/// </summary>
public uint NameOffset;
/// <summary>
/// Size of the item. (If file, file size. If folder, num items.)
/// </summary>
public uint ItemSize;
/// <summary>
/// Checksome index. (0xFFFFFFFF == None).
/// </summary>
public uint ChecksumIndex;
/// <summary>
/// Flags for the directory item. (0x00000000 == Folder).
/// </summary>
public uint DirectoryFlags;
/// <summary>
/// Index of the parent directory item. (0xFFFFFFFF == None).
/// </summary>
public uint ParentIndex;
/// <summary>
/// Index of the next directory item. (0x00000000 == None).
/// </summary>
public uint NextIndex;
/// <summary>
/// Index of the first directory item. (0x00000000 == None).
/// </summary>
public uint FirstIndex;
}
}

View File

@@ -0,0 +1,76 @@
namespace BurnOutSharp.Models.NCF
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/NCFFile.h"/>
public sealed class DirectoryHeader
{
/// <summary>
/// Always 0x00000004
/// </summary>
public uint Dummy0;
/// <summary>
/// Cache ID.
/// </summary>
public uint CacheID;
/// <summary>
/// NCF file version.
/// </summary>
public uint LastVersionPlayed;
/// <summary>
/// Number of items in the directory.
/// </summary>
public uint ItemCount;
/// <summary>
/// Number of files in the directory.
/// </summary>
public uint FileCount;
/// <summary>
/// Always 0x00008000. Data per checksum?
/// </summary>
public uint ChecksumDataLength;
/// <summary>
/// Size of lpNCFDirectoryEntries & lpNCFDirectoryNames & lpNCFDirectoryInfo1Entries & lpNCFDirectoryInfo2Entries & lpNCFDirectoryCopyEntries & lpNCFDirectoryLocalEntries in bytes.
/// </summary>
public uint DirectorySize;
/// <summary>
/// Size of the directory names in bytes.
/// </summary>
public uint NameSize;
/// <summary>
/// Number of Info1 entires.
/// </summary>
public uint Info1Count;
/// <summary>
/// Number of files to copy.
/// </summary>
public uint CopyCount;
/// <summary>
/// Number of files to keep local.
/// </summary>
public uint LocalCount;
/// <summary>
/// Reserved
/// </summary>
public uint Dummy1;
/// <summary>
/// Reserved
/// </summary>
public uint Dummy2;
/// <summary>
/// Header checksum.
/// </summary>
public uint Checksum;
}
}

View File

@@ -0,0 +1,11 @@
namespace BurnOutSharp.Models.NCF
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/NCFFile.h"/>
public sealed class DirectoryInfo1Entry
{
/// <summary>
/// Reserved
/// </summary>
public uint Dummy0;
}
}

View File

@@ -0,0 +1,11 @@
namespace BurnOutSharp.Models.NCF
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/NCFFile.h"/>
public sealed class DirectoryInfo2Entry
{
/// <summary>
/// Reserved
/// </summary>
public uint Dummy0 { get; set; }
}
}

View File

@@ -0,0 +1,11 @@
namespace BurnOutSharp.Models.NCF
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/NCFFile.h"/>
public sealed class DirectoryLocalEntry
{
/// <summary>
/// Index of the directory item.
/// </summary>
public uint DirectoryIndex;
}
}

View File

@@ -0,0 +1,79 @@
namespace BurnOutSharp.Models.NCF
{
/// <summary>
/// Half-Life No Cache File
/// </summary>
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/NCFFile.h"/>
public sealed class File
{
/// <summary>
/// Header data
/// </summary>
public Header Header { get; set; }
/// <summary>
/// Directory header data
/// </summary>
public DirectoryHeader DirectoryHeader { get; set; }
/// <summary>
/// Directory entries data
/// </summary>
public DirectoryEntry[] DirectoryEntries { get; set; }
/// <summary>
/// Directory names data
/// </summary>
public string DirectoryNames { get; set; }
/// <summary>
/// Directory info 1 entries data
/// </summary>
public DirectoryInfo1Entry[] DirectoryInfo1Entries { get; set; }
/// <summary>
/// Directory info 2 entries data
/// </summary>
public DirectoryInfo2Entry[] DirectoryInfo2Entries { get; set; }
/// <summary>
/// Directory copy entries data
/// </summary>
public DirectoryCopyEntry[] DirectoryCopyEntries { get; set; }
/// <summary>
/// Directory local entries data
/// </summary>
public DirectoryLocalEntry[] DirectoryLocalEntries { get; set; }
/// <summary>
/// Unknown header data
/// </summary>
public UnknownHeader UnknownHeader { get; set; }
/// <summary>
/// Unknown entries data
/// </summary>
public UnknownEntry[] UnknownEntries { get; set; }
/// <summary>
/// Checksum header data
/// </summary>
public ChecksumHeader ChecksumHeader { get; set; }
/// <summary>
/// Checksum map header data
/// </summary>
public ChecksumMapHeader ChecksumMapHeader { get; set; }
/// <summary>
/// Checksum map entries data
/// </summary>
public ChecksumMapEntry[] ChecksumMapEntries { get; set; }
/// <summary>
/// Checksum entries data
/// </summary>
public ChecksumEntry[] ChecksumEntries { get; set; }
}
}

View File

@@ -0,0 +1,61 @@
namespace BurnOutSharp.Models.NCF
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/NCFFile.h"/>
public sealed class Header
{
/// <summary>
/// Always 0x00000001
/// </summary>
public uint Dummy0;
/// <summary>
/// Always 0x00000002
/// </summary>
public uint MajorVersion;
/// <summary>
/// NCF version number.
/// </summary>
public uint MinorVersion;
/// <summary>
/// Cache ID
/// </summary>
public uint CacheID;
/// <summary>
/// Last version played
/// </summary>
public uint LastVersionPlayed;
/// <summary>
/// Reserved
/// </summary>
public uint Dummy3;
/// <summary>
/// Reserved
/// </summary>
public uint Dummy4;
/// <summary>
/// Total size of NCF file in bytes.
/// </summary>
public uint FileSize;
/// <summary>
/// Size of each data block in bytes.
/// </summary>
public uint BlockSize;
/// <summary>
/// Number of data blocks.
/// </summary>
public uint BlockCount;
/// <summary>
/// Reserved
/// </summary>
public uint Dummy5;
}
}

View File

@@ -0,0 +1,11 @@
namespace BurnOutSharp.Models.NCF
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/NCFFile.h"/>
public sealed class UnknownEntry
{
/// <summary>
/// Reserved
/// </summary>
public uint Dummy0;
}
}

View File

@@ -0,0 +1,16 @@
namespace BurnOutSharp.Models.NCF
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/NCFFile.h"/>
public sealed class UnknownHeader
{
/// <summary>
/// Always 0x00000001
/// </summary>
public uint Dummy0;
/// <summary>
/// Always 0x00000000
/// </summary>
public uint Dummy1;
}
}

View File

@@ -0,0 +1,21 @@
namespace BurnOutSharp.Models.PAK
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/PAKFile.h"/>
public sealed class DirectoryItem
{
/// <summary>
/// Item Name
/// </summary>
public string ItemName;
/// <summary>
/// Item Offset
/// </summary>
public uint ItemOffset;
/// <summary>
/// Item Length
/// </summary>
public uint ItemLength;
}
}

View File

@@ -0,0 +1,19 @@
namespace BurnOutSharp.Models.PAK
{
/// <summary>
/// Half-Life Package File
/// </summary>
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/PAKFile.h"/>
public sealed class File
{
/// <summary>
/// Deserialized directory header data
/// </summary>
public Header Header { get; set; }
/// <summary>
/// Deserialized directory items data
/// </summary>
public DirectoryItem[] DirectoryItems { get; set; }
}
}

View File

@@ -0,0 +1,21 @@
namespace BurnOutSharp.Models.PAK
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/PAKFile.h"/>
public sealed class Header
{
/// <summary>
/// Signature
/// </summary>
public string Signature;
/// <summary>
/// Directory Offset
/// </summary>
public uint DirectoryOffset;
/// <summary>
/// Directory Length
/// </summary>
public uint DirectoryLength;
}
}

View File

@@ -0,0 +1,5 @@
namespace BurnOutSharp.Models.SGA
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/SGAFile.h"/>
public abstract class Directory { }
}

View File

@@ -0,0 +1,5 @@
namespace BurnOutSharp.Models.SGA
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/SGAFile.h"/>
public class Directory4 : SpecializedDirectory<Header4, DirectoryHeader4, Section4, Folder4, File4, ushort> { }
}

View File

@@ -0,0 +1,5 @@
namespace BurnOutSharp.Models.SGA
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/SGAFile.h"/>
public class Directory5 : SpecializedDirectory<Header4, DirectoryHeader5, Section5, Folder5, File4, uint> { }
}

View File

@@ -0,0 +1,5 @@
namespace BurnOutSharp.Models.SGA
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/SGAFile.h"/>
public class Directory6 : SpecializedDirectory<Header6, DirectoryHeader5, Section5, Folder5, File6, uint> { }
}

View File

@@ -0,0 +1,5 @@
namespace BurnOutSharp.Models.SGA
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/SGAFile.h"/>
public class Directory7 : SpecializedDirectory<Header6, DirectoryHeader7, Section5, Folder5, File7, uint> { }
}

View File

@@ -0,0 +1,22 @@
namespace BurnOutSharp.Models.SGA
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/SGAFile.h"/>
public class DirectoryHeader<T>
{
public uint SectionOffset;
public T SectionCount;
public uint FolderOffset;
public T FolderCount;
public uint FileOffset;
public T FileCount;
public uint StringTableOffset;
public T StringTableCount;
}
}

View File

@@ -0,0 +1,5 @@
namespace BurnOutSharp.Models.SGA
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/SGAFile.h"/>
public sealed class DirectoryHeader4 : DirectoryHeader<ushort> { }
}

View File

@@ -0,0 +1,5 @@
namespace BurnOutSharp.Models.SGA
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/SGAFile.h"/>
public class DirectoryHeader5 : DirectoryHeader<uint> { }
}

View File

@@ -0,0 +1,10 @@
namespace BurnOutSharp.Models.SGA
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/SGAFile.h"/>
public sealed class DirectoryHeader7 : DirectoryHeader5
{
public uint HashTableOffset;
public uint BlockSize;
}
}

View File

@@ -0,0 +1,16 @@
namespace BurnOutSharp.Models.SGA
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/SGAFile.h"/>
public class File
{
/// <summary>
///Header data
/// </summary>
public Header Header { get; set; }
/// <summary>
/// Directory data
/// </summary>
public Directory Directory { get; set; }
}
}

View File

@@ -0,0 +1,20 @@
namespace BurnOutSharp.Models.SGA
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/SGAFile.h"/>
public class File4
{
public uint NameOffset;
public uint Offset;
public uint SizeOnDisk;
public uint Size;
public uint TimeModified;
public byte Dummy0;
public byte Type;
}
}

View File

@@ -0,0 +1,8 @@
namespace BurnOutSharp.Models.SGA
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/SGAFile.h"/>
public class File6 : File4
{
public uint CRC32;
}
}

View File

@@ -0,0 +1,8 @@
namespace BurnOutSharp.Models.SGA
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/SGAFile.h"/>
public sealed class File7 : File6
{
public uint HashOffset;
}
}

View File

@@ -0,0 +1,10 @@
namespace BurnOutSharp.Models.SGA
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/SGAFile.h"/>
public sealed class FileHeader
{
public string Name;
public uint CRC32;
}
}

View File

@@ -0,0 +1,16 @@
namespace BurnOutSharp.Models.SGA
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/SGAFile.h"/>
public class Folder<T>
{
public uint NameOffset;
public T FolderStartIndex;
public T FolderEndIndex;
public T FileStartIndex;
public T FileEndIndex;
}
}

View File

@@ -0,0 +1,5 @@
namespace BurnOutSharp.Models.SGA
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/SGAFile.h"/>
public sealed class Folder4 : Folder<ushort> { }
}

View File

@@ -0,0 +1,5 @@
namespace BurnOutSharp.Models.SGA
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/SGAFile.h"/>
public sealed class Folder5 : Folder<uint> { }
}

View File

@@ -0,0 +1,12 @@
namespace BurnOutSharp.Models.SGA
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/SGAFile.h"/>
public class Header
{
public string Signature;
public ushort MajorVersion;
public ushort MinorVersion;
}
}

View File

@@ -0,0 +1,18 @@
namespace BurnOutSharp.Models.SGA
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/SGAFile.h"/>
public sealed class Header4 : Header
{
public byte[] FileMD5;
public string Name;
public byte[] HeaderMD5;
public uint HeaderLength;
public uint FileDataOffset;
public uint Dummy0;
}
}

View File

@@ -0,0 +1,14 @@
namespace BurnOutSharp.Models.SGA
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/SGAFile.h"/>
public sealed class Header6 : Header
{
public string Name;
public uint HeaderLength;
public uint FileDataOffset;
public uint Dummy0;
}
}

View File

@@ -0,0 +1,20 @@
namespace BurnOutSharp.Models.SGA
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/SGAFile.h"/>
public class Section<T>
{
public string Alias;
public string Name;
public T FolderStartIndex;
public T FolderEndIndex;
public T FileStartIndex;
public T FileEndIndex;
public T FolderRootIndex;
}
}

View File

@@ -0,0 +1,5 @@
namespace BurnOutSharp.Models.SGA
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/SGAFile.h"/>
public sealed class Section4 : Section<ushort> { }
}

View File

@@ -0,0 +1,5 @@
namespace BurnOutSharp.Models.SGA
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/SGAFile.h"/>
public sealed class Section5 : Section<uint> { }
}

View File

@@ -0,0 +1,46 @@
using System.Collections.Generic;
namespace BurnOutSharp.Models.SGA
{
/// <summary>
/// Specialization File7 and up where the CRC moved to the header and the CRC is of the compressed data and there are stronger hashes.
/// </summary>
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/SGAFile.h"/>
public class SpecializedDirectory<THeader, TDirectoryHeader, TSection, TFolder, TFile, U> : Directory
where THeader : Header
where TDirectoryHeader : DirectoryHeader<U>
where TSection : Section<U>
where TFolder : Folder<U>
where TFile : File4
{
/// <summary>
/// Source SGA file
/// </summary>
public File File { get; set; }
/// <summary>
/// Directory header data
/// </summary>
public TDirectoryHeader DirectoryHeader { get; set; }
/// <summary>
/// Sections data
/// </summary>
public TSection[] Sections { get; set; }
/// <summary>
/// Folders data
/// </summary>
public TFolder[] Folders { get; set; }
/// <summary>
/// Files data
/// </summary>
public TFile[] Files { get; set; }
/// <summary>
/// String table data
/// </summary>
public Dictionary<long, string> StringTable { get; set; }
}
}

View File

@@ -0,0 +1,14 @@
namespace BurnOutSharp.Models.VBSP
{
/// <summary>
/// Half-Life 2 Level
/// </summary>
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/VBSPFile.h"/>
public sealed class File
{
/// <summary>
/// Directory header data
/// </summary>
public Header Header { get; set; }
}
}

View File

@@ -0,0 +1,31 @@
namespace BurnOutSharp.Models.VBSP
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/VBSPFile.h"/>
public sealed class Header
{
/// <summary>
/// BSP file signature.
/// </summary>
public string Signature;
/// <summary>
/// BSP file version.
/// </summary>
/// <remarks>
/// 19-20: Source
/// 21: Source - The lump version property was moved to the start of the struct.
/// 0x00040014: Dark Messiah - Looks like the 32 bit version has been split into two 16 bit fields.
/// </remarks>
public int Version;
/// <summary>
/// Lumps.
/// </summary>
public Lump[] Lumps;
/// <summary>
/// The map's revision (iteration, version) number.
/// </summary>
public int MapRevision;
}
}

View File

@@ -0,0 +1,20 @@
namespace BurnOutSharp.Models.VBSP
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/VBSPFile.h"/>
public sealed class Lump
{
public uint Offset;
public uint Length;
/// <summary>
/// Default to zero.
/// </summary>
public uint Version;
/// <summary>
/// Default to (char)0, (char)0, (char)0, (char)0.
/// </summary>
public char[] FourCC;
}
}

View File

@@ -0,0 +1,16 @@
namespace BurnOutSharp.Models.VBSP
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/VBSPFile.h"/>
public sealed class LumpHeader
{
public int LumpOffset;
public int LumpID;
public int LumpVersion;
public int LumpLength;
public int MapRevision;
}
}

View File

@@ -0,0 +1,17 @@
namespace BurnOutSharp.Models.VPK
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/VPKFile.h"/>
public sealed class ArchiveHash
{
public uint ArchiveIndex;
public uint ArchiveOffset;
public uint Length;
/// <summary>
/// MD5
/// </summary>
public byte[] Hash;
}
}

View File

@@ -0,0 +1,21 @@
namespace BurnOutSharp.Models.VPK
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/VPKFile.h"/>
public sealed class DirectoryEntry
{
public uint CRC;
public ushort PreloadBytes;
public ushort ArchiveIndex;
public uint EntryOffset;
public uint EntryLength;
/// <summary>
/// Always 0xffff.
/// </summary>
public ushort Dummy0;
}
}

View File

@@ -0,0 +1,16 @@
namespace BurnOutSharp.Models.VPK
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/VPKFile.h"/>
public sealed class DirectoryItem
{
public string Extension;
public string Path;
public string Name;
public DirectoryEntry DirectoryEntry;
public byte[] PreloadData;
}
}

View File

@@ -0,0 +1,29 @@
namespace BurnOutSharp.Models.VPK
{
/// <summary>
/// Added in version 2.
/// </summary>
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/VPKFile.h"/>
public sealed class ExtendedHeader
{
/// <summary>
/// Reserved
/// </summary>
public uint Dummy0;
/// <summary>
/// Archive hash length
/// </summary>
public uint ArchiveHashLength;
/// <summary>
/// Looks like some more MD5 hashes.
/// </summary>
public uint ExtraLength;
/// <summary>
/// Reserved
/// </summary>
public uint Dummy1;
}
}

View File

@@ -0,0 +1,29 @@
namespace BurnOutSharp.Models.VPK
{
/// <summary>
/// Valve Package File
/// </summary>
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/VPKFile.h"/>
public sealed class File
{
/// <summary>
/// Header data
/// </summary>
public Header Header { get; set; }
/// <summary>
/// Extended header data
/// </summary>
public ExtendedHeader ExtendedHeader { get; set; }
/// <summary>
/// Archive hashes data
/// </summary>
public ArchiveHash[] ArchiveHashes { get; set; }
/// <summary>
/// Directory items data
/// </summary>
public DirectoryItem[] DirectoryItems { get; set; }
}
}

View File

@@ -0,0 +1,15 @@
namespace BurnOutSharp.Models.VPK
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/VPKFile.h"/>
public sealed class Header
{
/// <summary>
/// Always 0x55aa1234.
/// </summary>
public uint Signature;
public uint Version;
public uint DirectoryLength;
}
}

View File

@@ -0,0 +1,24 @@
namespace BurnOutSharp.Models.WAD
{
/// <summary>
/// Half-Life Texture Package File
/// </summary>
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/WADFile.h"/>
public sealed class File
{
/// <summary>
/// Deserialized header data
/// </summary>
public Header Header { get; set; }
/// <summary>
/// Deserialized lumps data
/// </summary>
public Lump[] Lumps { get; set; }
/// <summary>
/// Deserialized lump infos data
/// </summary>
public LumpInfo[] LumpInfos { get; set; }
}
}

View File

@@ -0,0 +1,12 @@
namespace BurnOutSharp.Models.WAD
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/WADFile.h"/>
public sealed class Header
{
public string Signature;
public uint LumpCount;
public uint LumpOffset;
}
}

View File

@@ -0,0 +1,22 @@
namespace BurnOutSharp.Models.WAD
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/WADFile.h"/>
public sealed class Lump
{
public uint Offset;
public uint DiskLength;
public uint Length;
public byte Type;
public byte Compression;
public byte Padding0;
public byte Padding1;
public string Name;
}
}

View File

@@ -0,0 +1,22 @@
namespace BurnOutSharp.Models.WAD
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/WADFile.h"/>
public sealed class LumpInfo
{
public string Name;
public uint Width;
public uint Height;
public uint PixelOffset;
// 12 bytes of unknown data
public byte[] PixelData;
public uint PaletteSize;
public byte[] PaletteData;
}
}

View File

@@ -0,0 +1,12 @@
namespace BurnOutSharp.Models.XZP
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/XZPFile.h"/>
public sealed class DirectoryEntry
{
public uint FileNameCRC;
public uint EntryLength;
public uint EntryOffset;
}
}

View File

@@ -0,0 +1,12 @@
namespace BurnOutSharp.Models.XZP
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/XZPFile.h"/>
public sealed class DirectoryItem
{
public uint FileNameCRC;
public uint NameOffset;
public uint TimeCreated;
}
}

View File

@@ -0,0 +1,8 @@
namespace BurnOutSharp.Models.XZP
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/XZPFile.h"/>
public sealed class DirectoryMapping
{
public ushort PreloadDirectoryEntryIndex;
}
}

View File

@@ -0,0 +1,39 @@
namespace BurnOutSharp.Models.XZP
{
/// <summary>
/// XBox Package File
/// </summary>
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/XZPFile.h"/>
public class File
{
/// <summary>
/// Header data
/// </summary>
public Header Header { get; set; }
/// <summary>
/// Directory entries data
/// </summary>
public DirectoryEntry[] DirectoryEntries { get; set; }
/// <summary>
/// Preload directory entries data
/// </summary>
public DirectoryEntry[] PreloadDirectoryEntries { get; set; }
/// <summary>
/// Preload directory mappings data
/// </summary>
public DirectoryMapping[] PreloadDirectoryMappings { get; set; }
/// <summary>
/// Directory items data
/// </summary>
public DirectoryItem[] DirectoryItems { get; set; }
/// <summary>
/// Footer data
/// </summary>
public Footer Footer { get; set; }
}
}

View File

@@ -0,0 +1,10 @@
namespace BurnOutSharp.Models.XZP
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/XZPFile.h"/>
public sealed class Footer
{
public uint FileLength;
public string Signature;
}
}

View File

@@ -0,0 +1,24 @@
namespace BurnOutSharp.Models.XZP
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/XZPFile.h"/>
public sealed class Header
{
public string Signature;
public uint Version;
public uint PreloadDirectoryEntryCount;
public uint DirectoryEntryCount;
public uint PreloadBytes;
public uint HeaderLength;
public uint DirectoryItemCount;
public uint DirectoryItemOffset;
public uint DirectoryItemLength;
}
}