Add and use NCF constants

This commit is contained in:
Matt Nadareski
2022-12-28 14:02:09 -08:00
parent 94dfba4b4f
commit 283672e909
4 changed files with 45 additions and 31 deletions

View File

@@ -8,35 +8,6 @@ namespace BurnOutSharp.Builders
{
public static class NCF
{
#region Constants
/// <summary>
/// The item is a file.
/// </summary>
public const int HL_NCF_FLAG_FILE = 0x00004000;
/// <summary>
/// The item is encrypted.
/// </summary>
public const int HL_NCF_FLAG_ENCRYPTED = 0x00000100;
/// <summary>
/// Backup the item before overwriting it.
/// </summary>
public const int HL_NCF_FLAG_BACKUP_LOCAL = 0x00000040;
/// <summary>
/// The item is to be copied to the disk.
/// </summary>
public const int HL_NCF_FLAG_COPY_LOCAL = 0x0000000a;
/// <summary>
/// Don't overwrite the item if copying it to the disk and the item already exis
/// </summary>
public const int HL_NCF_FLAG_COPY_LOCAL_NO_OVERWRITE = 0x00000001;
#endregion
#region Byte Data
/// <summary>
@@ -390,7 +361,7 @@ namespace BurnOutSharp.Builders
directoryEntry.NameOffset = data.ReadUInt32();
directoryEntry.ItemSize = data.ReadUInt32();
directoryEntry.ChecksumIndex = data.ReadUInt32();
directoryEntry.DirectoryFlags = data.ReadUInt32();
directoryEntry.DirectoryFlags = (HL_NCF_FLAG)data.ReadUInt32();
directoryEntry.ParentIndex = data.ReadUInt32();
directoryEntry.NextIndex = data.ReadUInt32();
directoryEntry.FirstIndex = data.ReadUInt32();

View File

@@ -5,6 +5,11 @@ namespace BurnOutSharp.Models.GCF
[Flags]
public enum HL_GCF_FLAG : uint
{
/// <summary>
/// Folder
/// </summary>
HL_GCF_FLAG_FOLDER = 0x00000000,
/// <summary>
/// Don't overwrite the item if copying it to the disk and the item already exists.
/// </summary>

View File

@@ -26,7 +26,7 @@ namespace BurnOutSharp.Models.NCF
/// <summary>
/// Flags for the directory item. (0x00000000 == Folder).
/// </summary>
public uint DirectoryFlags;
public HL_NCF_FLAG DirectoryFlags;
/// <summary>
/// Index of the parent directory item. (0xFFFFFFFF == None).

View File

@@ -0,0 +1,38 @@
using System;
namespace BurnOutSharp.Models.NCF
{
[Flags]
public enum HL_NCF_FLAG : uint
{
/// <summary>
/// Folder
/// </summary>
HL_NCF_FLAG_FOLDER = 0x00000000,
/// <summary>
/// Don't overwrite the item if copying it to the disk and the item already exis
/// </summary>
HL_NCF_FLAG_COPY_LOCAL_NO_OVERWRITE = 0x00000001,
/// <summary>
/// The item is to be copied to the disk.
/// </summary>
HL_NCF_FLAG_COPY_LOCAL = 0x0000000a,
/// <summary>
/// Backup the item before overwriting it.
/// </summary>
HL_NCF_FLAG_BACKUP_LOCAL = 0x00000040,
/// <summary>
/// The item is encrypted.
/// </summary>
HL_NCF_FLAG_ENCRYPTED = 0x00000100,
/// <summary>
/// The item is a file.
/// </summary>
HL_NCF_FLAG_FILE = 0x00004000,
}
}