Fix exporting individual levels as dds for bffnt

This commit is contained in:
KillzXGaming 2019-07-17 16:42:47 -04:00
parent 90f22cba6d
commit aa0bbfc57c
5 changed files with 9 additions and 9 deletions

Binary file not shown.

View file

@ -9,7 +9,7 @@ using Toolbox.Library;
using Toolbox.Library.IO;
using Toolbox.Library.Forms;
namespace FirstPlugin.New
namespace FirstPlugin
{
public class SARC : IArchiveFile, IFileFormat
{

View file

@ -9,7 +9,7 @@ using Toolbox.Library;
using Toolbox.Library.IO;
using Toolbox.Library.Forms;
namespace FirstPlugin
namespace FirstPlugin.Old
{
public class SARC : TreeNodeFile, IFileFormat
{

View file

@ -100,16 +100,16 @@ namespace Toolbox.Library
//
//Gets a list of surfaces given the start index of the array and the amount of arrays to obtain
//
public List<Surface> GetSurfaces(int ArrayIndexStart = 0, int ArrayLength = 1 )
public List<Surface> GetSurfaces(int ArrayIndexStart = 0, bool GetAllSurfaces = true, int GetSurfaceAmount = 1 )
{
if (ArrayLength < ArrayCount)
ArrayLength = (int)ArrayCount;
if (GetAllSurfaces)
GetSurfaceAmount = (int)ArrayCount;
var surfaces = new List<Surface>();
for (int arrayLevel = 0; arrayLevel < ArrayCount; arrayLevel++)
{
bool IsLower = arrayLevel < ArrayIndexStart;
bool IsHigher = arrayLevel > (ArrayIndexStart + ArrayLength);
bool IsHigher = arrayLevel >= (ArrayIndexStart + GetSurfaceAmount);
if (!IsLower && !IsHigher)
{
List<byte[]> mips = new List<byte[]>();
@ -716,7 +716,7 @@ namespace Toolbox.Library
{
List<Surface> surfaces = null;
if (ExportSurfaceLevel)
surfaces = GetSurfaces(SurfaceLevel);
surfaces = GetSurfaces(SurfaceLevel, false);
else
surfaces = GetSurfaces();
@ -796,7 +796,7 @@ namespace Toolbox.Library
{
List<Surface> surfaces = null;
if (ExportSurfaceLevel)
surfaces = GetSurfaces(SurfaceLevel);
surfaces = GetSurfaces(SurfaceLevel, false, 1);
else
surfaces = GetSurfaces();

View file

@ -103,7 +103,7 @@ namespace Toolbox.Library.Rendering
if (UseMipmaps && GenericTexture.ArrayCount <= 1)
{
//Load surfaces with mip maps
Surfaces = GenericTexture.GetSurfaces(ArrayStartIndex, 6);
Surfaces = GenericTexture.GetSurfaces(ArrayStartIndex, false, 6);
}
else
{