Skip to content

Commit

Permalink
Improve face hdr check
Browse files Browse the repository at this point in the history
  • Loading branch information
rihi committed Feb 13, 2022
1 parent 4f1317e commit 3126531
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/java/info/ata4/bsplib/BspFileReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -204,11 +204,11 @@ public void loadFaces() {
}

// prioritize LUMP_FACES_HDR over LUMP_FACES
if (bspFile.getLump(LumpType.LUMP_FACES_HDR).getLength() != 0)
bspData.faces = readDStructChunksLump(LumpType.LUMP_FACES_HDR, this::faceDStructSupplier);
else
bspData.faces = readDStructChunksLump(LumpType.LUMP_FACES, this::faceDStructSupplier);
boolean useHdrLump = bspFile.canReadLump(LumpType.LUMP_FACES_HDR)
&& bspFile.getLump(LumpType.LUMP_FACES_HDR).getLength() != 0;
LumpType faceLumpType = useHdrLump ? LumpType.LUMP_FACES_HDR : LumpType.LUMP_FACES;

bspData.faces = readDStructChunksLump(faceLumpType, this::faceDStructSupplier);
L.fine(String.format("%d faces", bspData.faces.size()));
}

Expand Down

0 comments on commit 3126531

Please sign in to comment.