Release v0.4.10.10

DEX, MotHead
This commit is contained in:
korenkonder
2022-01-13 14:44:23 +03:00
parent 4d05f6a878
commit 310d637072
4 changed files with 79 additions and 77 deletions
+64 -64
View File
@@ -32,43 +32,43 @@ namespace KKdMainLib
s.P = DEXOffset;
for (i = 0; i < Dex.Length; i++)
{
Dex[i].MainOffset = (int)s.RIX();
Dex[i].EyesOffset = (int)s.RIX();
Dex[i].FaceOffset = s.RIX();
Dex[i].FaceCLOffset = s.RIX();
}
s.P = DEXNameOffset;
for (i = 0; i < Dex.Length; i++)
Dex[i].NameOffset = (int)s.RIX();
Dex[i].NameOffset = s.RIX();
for (i = 0; i < Dex.Length; i++)
{
EXPElement element = new EXPElement();
Dex[i].Main = KKdList<EXPElement>.New;
s.P = Dex[i].MainOffset;
EXPData element = new EXPData();
Dex[i].Face = KKdList<EXPData>.New;
s.PI64 = Dex[i].FaceOffset;
while (true)
{
element.Frame = s.RF32();
element.Both = s.RU16();
element.Type = s.RU16();
element.ID = s.RU16();
element.Value = s.RF32();
element.Trans = s.RF32();
if (element.Frame == 999999 || element.Both == 0xFFFF) break;
Dex[i].Main.Add(element);
if (element.Type == 0xFFFF) break;
Dex[i].Face.Add(element);
}
Dex[i].Main.Capacity = Dex[i].Main.Count;
Dex[i].Face.Capacity = Dex[i].Face.Count;
Dex[i].Eyes = KKdList<EXPElement>.New;
s.P = Dex[i].EyesOffset;
Dex[i].FaceCL = KKdList<EXPData>.New;
s.PI64 = Dex[i].FaceCLOffset;
while(true)
{
element.Frame = s.RF32();
element.Both = s.RU16();
element.Type = s.RU16();
element.ID = s.RU16();
element.Value = s.RF32();
element.Trans = s.RF32();
if (element.Frame == 999999 || element.Both == 0xFFFF) break;
Dex[i].Eyes.Add(element);
if (element.Type == 0xFFFF) break;
Dex[i].FaceCL.Add(element);
}
Dex[i].Eyes.Capacity = Dex[i].Eyes.Count;
Dex[i].FaceCL.Capacity = Dex[i].FaceCL.Count;
Dex[i].Name = s.RSaO(Dex[i].NameOffset);
}
@@ -102,30 +102,30 @@ namespace KKdMainLib
for (i0 = 0; i0 < Dex.Length; i0++)
{
Dex[i0].MainOffset = s.P;
for (i1 = 0; i1 < Dex[i0].Main.Count; i1++)
Dex[i0].FaceOffset = s.P;
for (i1 = 0; i1 < Dex[i0].Face.Count; i1++)
{
s.W(Dex[i0].Main[i1].Frame);
s.W(Dex[i0].Main[i1].Both );
s.W(Dex[i0].Main[i1].ID );
s.W(Dex[i0].Main[i1].Value);
s.W(Dex[i0].Main[i1].Trans);
s.W(Dex[i0].Face[i1].Frame);
s.W(Dex[i0].Face[i1].Type );
s.W(Dex[i0].Face[i1].ID );
s.W(Dex[i0].Face[i1].Value);
s.W(Dex[i0].Face[i1].Trans);
}
s.W(999999f);
s.W(999999.0f);
s.W(0xFFFF);
s.W(0x0L);
s.A(0x20);
Dex[i0].EyesOffset = s.P;
for (i1 = 0; i1 < Dex[i0].Eyes.Count; i1++)
Dex[i0].FaceCLOffset = s.P;
for (i1 = 0; i1 < Dex[i0].FaceCL.Count; i1++)
{
s.W(Dex[i0].Eyes[i1].Frame);
s.W(Dex[i0].Eyes[i1].Both );
s.W(Dex[i0].Eyes[i1].ID );
s.W(Dex[i0].Eyes[i1].Value);
s.W(Dex[i0].Eyes[i1].Trans);
s.W(Dex[i0].FaceCL[i1].Frame);
s.W(Dex[i0].FaceCL[i1].Type );
s.W(Dex[i0].FaceCL[i1].ID );
s.W(Dex[i0].FaceCL[i1].Value);
s.W(Dex[i0].FaceCL[i1].Trans);
}
s.W(999999f);
s.W(999999.0f);
s.W(0xFFFF);
s.W(0x0L);
s.A(0x20);
@@ -140,8 +140,8 @@ namespace KKdMainLib
s.P = header.IsX ? 0x28 : 0x20;
for (i = 0; i < Dex.Length; i++)
{
s.WX(Dex[i].MainOffset);
s.WX(Dex[i].EyesOffset);
s.WX(Dex[i].FaceOffset);
s.WX(Dex[i].FaceCLOffset);
}
int namesPosition = s.P;
for (i = 0; i < Dex.Length; i++)
@@ -181,19 +181,19 @@ namespace KKdMainLib
Dex[i0] = new EXP { Name = dex[i0].RS("Name") };
MsgPack temp;
if ((temp = dex[i0]["Main", true]).NotNull)
if ((temp = dex[i0]["Face", true]).NotNull)
{
Dex[i0].Main = KKdList<EXPElement>.New;
Dex[i0].Main.Capacity = temp.Array.Length;
for (i1 = 0; i1 < Dex[i0].Main.Capacity; i1++)
Dex[i0].Main.Add(EXPElement.Read(temp[i1]));
Dex[i0].Face = KKdList<EXPData>.New;
Dex[i0].Face.Capacity = temp.Array.Length;
for (i1 = 0; i1 < Dex[i0].Face.Capacity; i1++)
Dex[i0].Face.Add(EXPData.Read(temp[i1]));
}
if ((temp = dex[i0]["Eyes", true]).NotNull)
if ((temp = dex[i0]["FaceCL", true]).NotNull)
{
Dex[i0].Eyes = KKdList<EXPElement>.New;
Dex[i0].Eyes.Capacity = temp.Array.Length;
for (i1 = 0; i1 < Dex[i0].Eyes.Capacity; i1++)
Dex[i0].Eyes.Add(EXPElement.Read(temp[i1]));
Dex[i0].FaceCL = KKdList<EXPData>.New;
Dex[i0].FaceCL.Capacity = temp.Array.Length;
for (i1 = 0; i1 < Dex[i0].FaceCL.Capacity; i1++)
Dex[i0].FaceCL.Add(EXPData.Read(temp[i1]));
}
temp.Dispose();
}
@@ -210,14 +210,14 @@ namespace KKdMainLib
for (i0 = 0; i0 < Dex.Length; i0++)
{
MsgPack exp = MsgPack.New.Add("Name", Dex[i0].Name);
MsgPack main = new MsgPack(Dex[i0].Main.Count, "Main");
for (i1 = 0; i1 < Dex[i0].Main.Count; i1++)
main[i1] = Dex[i0].Main[i1].Write();
MsgPack main = new MsgPack(Dex[i0].Face.Count, "Face");
for (i1 = 0; i1 < Dex[i0].Face.Count; i1++)
main[i1] = Dex[i0].Face[i1].Write();
exp.Add(main);
MsgPack eyes = new MsgPack(Dex[i0].Eyes.Count, "Eyes");
for (i1 = 0; i1 < Dex[i0].Eyes.Count; i1++)
eyes[i1] = Dex[i0].Eyes[i1].Write();
MsgPack eyes = new MsgPack(Dex[i0].FaceCL.Count, "FaceCL");
for (i1 = 0; i1 < Dex[i0].FaceCL.Count; i1++)
eyes[i1] = Dex[i0].FaceCL[i1].Write();
exp.Add(eyes);
dex[i0] = exp;
}
@@ -231,33 +231,33 @@ namespace KKdMainLib
public struct EXP
{
public int MainOffset;
public int EyesOffset;
public int NameOffset;
public long FaceOffset;
public long FaceCLOffset;
public long NameOffset;
public string Name;
public KKdList<EXPElement> Main;
public KKdList<EXPElement> Eyes;
public KKdList<EXPData> Face;
public KKdList<EXPData> FaceCL;
public override string ToString() => Name;
}
public struct EXPElement
public struct EXPData
{
public float Frame;
public ushort Both;
public ushort Type;
public ushort ID;
public float Value;
public float Trans;
public static EXPElement Read(MsgPack msg) =>
new EXPElement() { Frame = msg.RF32("F"), Both = msg.RU16("B"),
ID = msg.RU16("I"), Value = msg.RF32("V"),
Trans = msg.RF32("T"), };
public static EXPData Read(MsgPack msg) =>
new EXPData() { Frame = msg.RF32("Frame"), Type = msg.RU16("Type" ),
ID = msg.RU16("ID" ), Value = msg.RF32("Value"),
Trans = msg.RF32("Trans"), };
public MsgPack Write() =>
MsgPack.New.Add("F", Frame).Add("B", Both )
.Add("I", ID).Add("V", Value)
.Add("T", Trans);
MsgPack.New.Add("Frame", Frame).Add("Type" , Type )
.Add("ID" , ID ).Add("Value", Value)
.Add("Trans", Trans);
}
}
}
+3 -3
View File
@@ -4,14 +4,14 @@
<Authors>korenkonder</Authors>
<Company></Company>
<Configuration></Configuration>
<Copyright>korenkonder (C) 2018-2021</Copyright>
<Copyright>korenkonder (C) 2018-2022</Copyright>
<Description>A simple library for working with Project Diva AC/DT/F/AFT/F2/X/XHD/FT/VRFL/M39 files</Description>
<FileVersion>0.4.10.9</FileVersion>
<FileVersion>0.4.10.10</FileVersion>
<PackageId>KKdMainLib</PackageId>
<Product>KKdMainLib</Product>
<TargetFramework>net461</TargetFramework>
<Title>KKdMainLib</Title>
<Version>0.4.10.9</Version>
<Version>0.4.10.10</Version>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
+9 -7
View File
@@ -155,13 +155,15 @@ RETURN:
if ((int)data.Type == 0x3E || (int)data.Type == 0x49)
s.A(0x20, true);
data.Offset = s.P;
if (data.Array.Length >= 4 && s.P % 0x4 != 0)
s.A(0x04, true);
else if (data.Array.Length == 2 && s.P % 0x2 != 0)
s.A(0x02, true);
data.Offset = s.P;
s.W(data.Array);
if ((int)data.Type == 0x3C)
s.A(0x20, true);
}
@@ -180,18 +182,18 @@ RETURN:
int Size = GetSize2(data.Type);
if (data.Array == null || data.Array.Length < 1 || Size < 1) continue;
data.Offset = s.P;
if (data.Array.Length >= 4 && s.P % 0x4 != 0)
s.A(0x04, true);
else if (data.Array.Length == 2 && s.P % 0x2 != 0)
s.A(0x02, true);
data.Offset = s.P;
s.W(data.Array);
}
break;
}
}
s.A(0x20, true);
s.A(0x10, true);
Header.SubHeaderOffset = s.P;
i1 = Header.LastMotionID - Header.FirstMotionID;
@@ -1011,9 +1013,9 @@ RETURN:
public enum Type
{
WingReset = 0x40,
OsageReset = 0x41,
OsagePhysStep = 0x42,
WindReset = 0x40,
OsageReset = 0x41,
OsageStep = 0x42,
}
}
}
+3 -3
View File
@@ -6,10 +6,10 @@ using System.Runtime.InteropServices;
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("PD_Tool")]
[assembly: AssemblyCopyright("korenkonder (C) 2017-2021")]
[assembly: AssemblyCopyright("korenkonder (C) 2017-2022")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: Guid("7B5D5A3A-A6F8-4813-C97D-ACFC98F7397E")]
[assembly: AssemblyVersion("0.4.10.9")]
[assembly: AssemblyFileVersion("0.4.10.9")]
[assembly: AssemblyVersion("0.4.10.10")]
[assembly: AssemblyFileVersion("0.4.10.10")]