Skip to content

Commit

Permalink
code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
pfcDorn committed Aug 29, 2024
1 parent b8accbc commit 9f0cc28
Showing 1 changed file with 28 additions and 28 deletions.
56 changes: 28 additions & 28 deletions Runtime/Scripts/SceneImporter/ImporterTextures.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,35 +134,35 @@ private void CheckForDuplicateImages()
}

private Stream GetImageStream(GLTFImage image)
{
{
Stream stream = null;
if (image.Uri == null)
{
if (image.BufferView == null)
return null;
var bufferView = image.BufferView.Value;
BufferCacheData bufferContents = _assetCache.BufferCache[bufferView.Buffer.Id];
if (bufferContents.bufferData.IsCreated)
{
bufferContents.Stream.Position = bufferView.ByteOffset + bufferContents.ChunkOffset;
stream = new SubStream(bufferContents.Stream, 0, bufferView.ByteLength);
}
}
else
{
string uri = image.Uri;

byte[] bufferData;
URIHelper.TryParseBase64(uri, out bufferData);
if (bufferData != null)
{
stream = new MemoryStream(bufferData, 0, bufferData.Length, false, true);
}
}

return stream;
}
if (image.Uri == null)
{
if (image.BufferView == null)
return null;

var bufferView = image.BufferView.Value;
BufferCacheData bufferContents = _assetCache.BufferCache[bufferView.Buffer.Id];
if (bufferContents.bufferData.IsCreated)
{
bufferContents.Stream.Position = bufferView.ByteOffset + bufferContents.ChunkOffset;
stream = new SubStream(bufferContents.Stream, 0, bufferView.ByteLength);
}
}
else
{
string uri = image.Uri;

byte[] bufferData;
URIHelper.TryParseBase64(uri, out bufferData);
if (bufferData != null)
{
stream = new MemoryStream(bufferData, 0, bufferData.Length, false, true);
}
}

return stream;
}

protected async Task ConstructImage(GLTFImage image, int imageCacheIndex, bool markGpuOnly, bool isLinear, bool isNormal)
{
Expand Down

0 comments on commit 9f0cc28

Please sign in to comment.