1
0
mirror of synced 2024-12-15 09:01:23 +01:00
Switch-Toolbox/File_Format_Library/FileFormats/DKCTF/Common.cs

106 lines
2.3 KiB
C#
Raw Normal View History

2019-08-17 00:07:03 +02:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Runtime.InteropServices;
using Toolbox.Library.IO;
namespace DKCTF
{
//Documentation from https://github.com/Kinnay/Nintendo-File-Formats/wiki/DKCTF-Types#cformdescriptor
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public class CFormDescriptor
{
public Magic Magic = "RFRM";
public ulong DataSize;
public ulong Unknown;
public Magic FormType;
public uint VersionA;
public uint VersionB;
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public class CChunkDescriptor
{
public Magic ChunkType;
public long DataSize;
2019-08-17 00:07:03 +02:00
public uint Unknown;
public long DataOffset;
2019-08-17 00:07:03 +02:00
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public class CMayaSpline
{
public Magic ChunkType;
public ulong DataSize;
public uint Unknown;
public ulong DataOffset;
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public class CMayaSplineKnot
{
public float Time;
public float Value;
public ETangentType TangentType1;
public ETangentType TangentType2;
public float FieldC;
public float Field10;
public float Field14;
public float Field18;
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public class CObjectTag
{
public Magic Type;
public CGuid Objectid;
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public class CObjectId
{
public CGuid Guid;
public override string ToString()
{
return Guid.ToString();
}
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public class CGuid
{
public uint Part1;
public ushort Part2;
public ushort Part3;
public ulong Part4;
public override string ToString()
{
return $"{Part1}|{Part2}|{Part3}|{Part4}";
}
}
2019-08-17 00:07:03 +02:00
public enum ETangentType
{
Linear,
Flat,
Smooth,
Step,
Clamped,
Fixed,
}
public enum EInfinityType
{
Constant,
Linear,
Cycle,
CycleRelative,
Oscillate,
}
}