Skip to content

Commit

Permalink
Dds header size fix (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
CosmicDreamsOfCode authored Aug 19, 2024
1 parent 9df317b commit 532021e
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions Galanthus/SdfToc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -368,13 +368,13 @@ public bool TryGetDataFile(DataSlice inSlice, [NotNullWhen(true)] out string? pa
int outBufferSize = 0;

// get final file size
foreach (DataSlice dataSlice in inAsset.DataSlices)
if (inAsset.DdsIndex != -1)
{
if (inAsset.DdsIndex != -1)
{
outBufferSize += m_ddsHeaders[inAsset.DdsIndex].Size;
}
outBufferSize += m_ddsHeaders[inAsset.DdsIndex].Size;
}

foreach (DataSlice dataSlice in inAsset.DataSlices)
{
if (!TryGetDataFile(dataSlice, out string? _))
{
continue;
Expand All @@ -385,7 +385,6 @@ public bool TryGetDataFile(DataSlice inSlice, [NotNullWhen(true)] out string? pa
}
Block<byte> outBuffer = new(outBufferSize);


// add dds header
if (inAsset.DdsIndex != -1)
{
Expand Down

0 comments on commit 532021e

Please sign in to comment.