Fill the image blocks on XTX save

This commit is contained in:
KillzXGaming 2019-04-30 17:07:25 -04:00
parent 57d19b432d
commit 46ab6e64fa
7 changed files with 43 additions and 6 deletions

Binary file not shown.

View file

@ -221,12 +221,12 @@ namespace FirstPlugin
public void SaveFile(FileWriter writer)
{
SetupBlockSaving();
int Alignment = 512;
uint TextureInfoType = 2;
uint TextureBlockType = 3;
SetupBlockSaving(TextureBlockType);
writer.ByteOrder = Syroot.BinaryData.ByteOrder.LittleEndian;
writer.WriteSignature("DFvN");
writer.Write(HeaderSize);
@ -241,7 +241,6 @@ namespace FirstPlugin
{
if (block.BlockType == TextureBlockType)
{
block.Data = TextureBlocks[curTexBlock++];
block.WriteHeader(writer);
block.WriteBlock(writer, 512);
}
@ -262,11 +261,15 @@ namespace FirstPlugin
writer.Dispose();
}
private void SetupBlockSaving()
private void SetupBlockSaving(uint TextureBlockType)
{
foreach (var textureInfo in TextureInfos)
int curTex = 0;
foreach (var block in Blocks)
{
if (block.BlockType == TextureBlockType)
{
block.Data = TextureInfos[curTex].ImageData;
}
}
}

View file

@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Collada141;
namespace Switch_Toolbox.Library
{
public class DAE
{
public bool UseTransformMatrix = true;
public void LoadFile(string FileName)
{
COLLADA collada = COLLADA.Load(FileName);
foreach (var item in collada.Items)
{
if (item is library_geometries)
{
}
}
}
private void LoadGeometry()
{
}
}
}

View file

@ -205,6 +205,8 @@
<Compile Include="FileFormats\APNG\CRC.cs" />
<Compile Include="FileFormats\Assimp\AssimpSaver.cs" />
<Compile Include="FileFormats\Animation\SEANIM.cs" />
<Compile Include="FileFormats\DAE\collada_schema_1_4.cs" />
<Compile Include="FileFormats\DAE\DAE.cs" />
<Compile Include="FileFormats\OBJ.cs" />
<Compile Include="Forms\BatchFormatExport.cs">
<SubType>Form</SubType>