Skip to content

Commit

Permalink
Add ID to faces, add RawLightmapData to Lighmaps lump
Browse files Browse the repository at this point in the history
  • Loading branch information
LogicAndTrick committed Jan 29, 2024
1 parent 6054b4a commit 8c988c1
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Sledge.Formats.Bsp/Lumps/Faces.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ public Faces()

public void Read(BinaryReader br, Blob blob, Version version)
{
var i = 0u;
while (br.BaseStream.Position < blob.Offset + blob.Length)
{
var face = new Face
{
ID = i++,
Plane = br.ReadUInt16(),
Side = br.ReadUInt16(),
FirstEdge = br.ReadInt32(),
Expand Down
2 changes: 2 additions & 0 deletions Sledge.Formats.Bsp/Lumps/Lightmaps.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ public class Lightmaps : ILump, IList<Lightmap>
private readonly IList<Lightmap> _lightmaps;
private byte[] _lightmapData;

public byte[] RawLightmapData => _lightmapData;

public Lightmaps()
{
_lightmaps = new List<Lightmap>();
Expand Down
1 change: 1 addition & 0 deletions Sledge.Formats.Bsp/Objects/Face.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ public class Face
{
public const int MaxLightmaps = 4;

public uint ID { get; set; }
public ushort Plane { get; set; }
public ushort Side { get; set; }
public int FirstEdge { get; set; }
Expand Down
4 changes: 2 additions & 2 deletions Sledge.Formats.Bsp/Sledge.Formats.Bsp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
<RepositoryUrl>https://github.com/LogicAndTrick/sledge-formats</RepositoryUrl>
<RepositoryType>Git</RepositoryType>
<PackageTags>half-life quake valve bsp</PackageTags>
<PackageReleaseNotes>Improve traceline implementation</PackageReleaseNotes>
<Version>1.0.14</Version>
<PackageReleaseNotes>Add ID to faces, add RawLightmapData to Lighmaps lump</PackageReleaseNotes>
<Version>1.0.15</Version>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
Expand Down

0 comments on commit 8c988c1

Please sign in to comment.