Skip to content

Commit

Permalink
Add MPL3 flags
Browse files Browse the repository at this point in the history
  • Loading branch information
Luzifix committed Sep 9, 2024
1 parent cb14560 commit 2cd42ba
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Warcraft.NET/Files/WDT/Entries/SL/MPL3Entry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Numerics;
using Warcraft.NET.Extensions;
using Warcraft.NET.Files.Structures;
using Warcraft.NET.Files.WDT.Flags;

namespace Warcraft.NET.Files.WDT.Entries.SL
{
Expand Down Expand Up @@ -70,7 +71,7 @@ public class MPL3Entry
/// <summary>
/// Flags
/// </summary>
public ushort Flags { get; set; }
public MPL3Flags Flags { get; set; }

/// <summary>
/// Unknown value, wiki mentions it is "a packed value". 14336 appears to be the most common value.
Expand Down Expand Up @@ -100,7 +101,7 @@ public MPL3Entry(byte[] data)
TileY = br.ReadUInt16();
MLTAIndex = br.ReadInt16();
MTEXIndex = br.ReadInt16();
Flags = br.ReadUInt16();
Flags = (MPL3Flags)br.ReadUInt16();
Unknown1 = br.ReadUInt16();
}
}
Expand Down Expand Up @@ -135,7 +136,7 @@ public byte[] Serialize(long offset = 0)
bw.Write(TileY);
bw.Write(MLTAIndex);
bw.Write(MTEXIndex);
bw.Write(Flags);
bw.Write((ushort)Flags);
bw.Write(Unknown1);

return ms.ToArray();
Expand Down
16 changes: 16 additions & 0 deletions Warcraft.NET/Files/WDT/Flags/MPL3Flags.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using System;

namespace Warcraft.NET.Files.WDT.Flags
{
/// <summary>
/// Flags for the <see cref="MPHDFlags"/>.
/// </summary>
[Flags]
public enum MPL3Flags : ushort
{
/// <summary>
/// Enable raytracing for this light. (Only visible with enabled D3D12 + min shadowRt level 2)
/// </summary>
Raytraced = 0x1,
}
}

0 comments on commit 2cd42ba

Please sign in to comment.