mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-05 13:01:52 +00:00
Fix dds and texture cube import
This commit is contained in:
@@ -728,6 +728,11 @@ static class DdsImporter
|
|||||||
{
|
{
|
||||||
height = 1;
|
height = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (depth == 0)
|
||||||
|
{
|
||||||
|
depth = 1;
|
||||||
|
}
|
||||||
|
|
||||||
offset += numBytes;
|
offset += numBytes;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -359,14 +359,18 @@ class ProcessedTexture : ProcessedResource
|
|||||||
|
|
||||||
public void SetSurfaceCount(int arraySize, int mipMapCount)
|
public void SetSurfaceCount(int arraySize, int mipMapCount)
|
||||||
{
|
{
|
||||||
|
ArraySize = arraySize;
|
||||||
|
|
||||||
|
if (IsCubeMap)
|
||||||
|
ArraySize *= 6;
|
||||||
|
|
||||||
Log.EngineLogger.AssertDebug(Surfaces == null || arraySize > Surfaces.GetLength(0));
|
Log.EngineLogger.AssertDebug(Surfaces == null || arraySize > Surfaces.GetLength(0));
|
||||||
Log.EngineLogger.AssertDebug(Surfaces == null ||mipMapCount > Surfaces.GetLength(1));
|
Log.EngineLogger.AssertDebug(Surfaces == null ||mipMapCount > Surfaces.GetLength(1));
|
||||||
|
|
||||||
ArraySize = arraySize;
|
|
||||||
MipMapCount = mipMapCount;
|
MipMapCount = mipMapCount;
|
||||||
|
|
||||||
TextureSurface[,] oldSurfaces = Surfaces;
|
TextureSurface[,] oldSurfaces = Surfaces;
|
||||||
Surfaces = new TextureSurface[arraySize, mipMapCount];
|
Surfaces = new TextureSurface[ArraySize, MipMapCount];
|
||||||
|
|
||||||
if (oldSurfaces != null)
|
if (oldSurfaces != null)
|
||||||
{
|
{
|
||||||
@@ -415,7 +419,8 @@ class TextureProcessor : IAssetProcessor
|
|||||||
{
|
{
|
||||||
ProcessedTexture.TextureSurface surface = new .(loadedSurface.Width, loadedSurface.Height, loadedSurface.Depth,
|
ProcessedTexture.TextureSurface surface = new .(loadedSurface.Width, loadedSurface.Height, loadedSurface.Depth,
|
||||||
loadedSurface.Data, loadedSurface.MipLevel, loadedSurface.ArrayIndex, loadedSurface.Pitch, loadedSurface.SlicePitch);
|
loadedSurface.Data, loadedSurface.MipLevel, loadedSurface.ArrayIndex, loadedSurface.Pitch, loadedSurface.SlicePitch);
|
||||||
processedTexture.Surfaces[loadedSurface.ArrayIndex, loadedSurface.MipLevel] = surface;
|
|
||||||
|
processedTexture.Surfaces[loadedSurface.ArrayIndex * (processedTexture.IsCubeMap ? 6 : 1) + loadedSurface.CubeFace, loadedSurface.MipLevel] = surface;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(config.GenerateMipMaps case .No))
|
if (!(config.GenerateMipMaps case .No))
|
||||||
|
|||||||
Reference in New Issue
Block a user