Compare commits
4
Commits
v0.4.10.7
...
v0.4.10.11
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ec5f8c803e | ||
|
|
310d637072 | ||
|
|
4d05f6a878 | ||
|
|
35d7712d8f |
+11
-9
@@ -2,6 +2,7 @@ namespace KKdBaseLib.Auth3D
|
||||
{
|
||||
public struct Data
|
||||
{
|
||||
public string[] Auth2D;
|
||||
public string[] Motion;
|
||||
public string[] ObjectList;
|
||||
public string[] ObjectHRCList;
|
||||
@@ -62,9 +63,9 @@ namespace KKdBaseLib.Auth3D
|
||||
public float Aspect;
|
||||
public float CameraApertureH;
|
||||
public float CameraApertureW;
|
||||
public Key FOV;
|
||||
public Key Roll;
|
||||
public Key FocalLength;
|
||||
public Key? FocalLength;
|
||||
public Key? FOV;
|
||||
public Key? Roll;
|
||||
public ModelTransform MT;
|
||||
}
|
||||
}
|
||||
@@ -83,7 +84,6 @@ namespace KKdBaseLib.Auth3D
|
||||
|
||||
public struct DOF
|
||||
{
|
||||
public string Name;
|
||||
public ModelTransform MT;
|
||||
}
|
||||
|
||||
@@ -171,7 +171,6 @@ namespace KKdBaseLib.Auth3D
|
||||
public struct Light
|
||||
{
|
||||
public int Id;
|
||||
public string Name;
|
||||
public string Type;
|
||||
public Key? ConeAngle;
|
||||
public Key? Constant;
|
||||
@@ -230,6 +229,7 @@ namespace KKdBaseLib.Auth3D
|
||||
public string Morph;
|
||||
public string UIDName;
|
||||
public string ParentName;
|
||||
public string ParentNode;
|
||||
public ModelTransform MT;
|
||||
public TexturePattern[] TexPat;
|
||||
public TextureTransform[] TexTrans;
|
||||
@@ -262,6 +262,8 @@ namespace KKdBaseLib.Auth3D
|
||||
public bool Shadow;
|
||||
public string Name;
|
||||
public string UIDName;
|
||||
public string ParentName;
|
||||
public string ParentNode;
|
||||
public ObjectNode[] Node;
|
||||
}
|
||||
|
||||
@@ -275,11 +277,11 @@ namespace KKdBaseLib.Auth3D
|
||||
|
||||
public struct PlayControl
|
||||
{
|
||||
public int Begin;
|
||||
public float Begin;
|
||||
public int? Div;
|
||||
public int FPS;
|
||||
public int? Offset;
|
||||
public int Size;
|
||||
public float FPS;
|
||||
public float? Offset;
|
||||
public float Size;
|
||||
}
|
||||
|
||||
public struct Point
|
||||
|
||||
@@ -1,99 +0,0 @@
|
||||
//Original research by Samyuu
|
||||
|
||||
namespace KKdBaseLib
|
||||
{
|
||||
public static class DCC //Databank Checksum Calculator
|
||||
{
|
||||
private static readonly ushort[] ChecksumLookupTable = {
|
||||
0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50A5, 0x60C6, 0x70E7,
|
||||
0x8108, 0x9129, 0xA14A, 0xB16B, 0xC18C, 0xD1AD, 0xE1CE, 0xF1EF,
|
||||
0x1231, 0x0210, 0x3273, 0x2252, 0x52B5, 0x4294, 0x72F7, 0x62D6,
|
||||
0x9339, 0x8318, 0xB37B, 0xA35A, 0xD3BD, 0xC39C, 0xF3FF, 0xE3DE,
|
||||
0x2462, 0x3443, 0x0420, 0x1401, 0x64E6, 0x74C7, 0x44A4, 0x5485,
|
||||
0xA56A, 0xB54B, 0x8528, 0x9509, 0xE5EE, 0xF5CF, 0xC5AC, 0xD58D,
|
||||
0x3653, 0x2672, 0x1611, 0x0630, 0x76D7, 0x66F6, 0x5695, 0x46B4,
|
||||
0xB75B, 0xA77A, 0x9719, 0x8738, 0xF7DF, 0xE7FE, 0xD79D, 0xC7BC,
|
||||
0x48C4, 0x58E5, 0x6886, 0x78A7, 0x0840, 0x1861, 0x2802, 0x3823,
|
||||
0xC9CC, 0xD9ED, 0xE98E, 0xF9AF, 0x8948, 0x9969, 0xA90A, 0xB92B,
|
||||
0x5AF5, 0x4AD4, 0x7AB7, 0x6A96, 0x1A71, 0x0A50, 0x3A33, 0x2A12,
|
||||
0xDBFD, 0xCBDC, 0xFBBF, 0xEB9E, 0x9B79, 0x8B58, 0xBB3B, 0xAB1A,
|
||||
0x6CA6, 0x7C87, 0x4CE4, 0x5CC5, 0x2C22, 0x3C03, 0x0C60, 0x1C41,
|
||||
0xEDAE, 0xFD8F, 0xCDEC, 0xDDCD, 0xAD2A, 0xBD0B, 0x8D68, 0x9D49,
|
||||
0x7E97, 0x6EB6, 0x5ED5, 0x4EF4, 0x3E13, 0x2E32, 0x1E51, 0x0E70,
|
||||
0xFF9F, 0xEFBE, 0xDFDD, 0xCFFC, 0xBF1B, 0xAF3A, 0x9F59, 0x8F78,
|
||||
0x9188, 0x81A9, 0xB1CA, 0xA1EB, 0xD10C, 0xC12D, 0xF14E, 0xE16F,
|
||||
0x1080, 0x00A1, 0x30C2, 0x20E3, 0x5004, 0x4025, 0x7046, 0x6067,
|
||||
0x83B9, 0x9398, 0xA3FB, 0xB3DA, 0xC33D, 0xD31C, 0xE37F, 0xF35E,
|
||||
0x02B1, 0x1290, 0x22F3, 0x32D2, 0x4235, 0x5214, 0x6277, 0x7256,
|
||||
0xB5EA, 0xA5CB, 0x95A8, 0x8589, 0xF56E, 0xE54F, 0xD52C, 0xC50D,
|
||||
0x34E2, 0x24C3, 0x14A0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405,
|
||||
0xA7DB, 0xB7FA, 0x8799, 0x97B8, 0xE75F, 0xF77E, 0xC71D, 0xD73C,
|
||||
0x26D3, 0x36F2, 0x0691, 0x16B0, 0x6657, 0x7676, 0x4615, 0x5634,
|
||||
0xD94C, 0xC96D, 0xF90E, 0xE92F, 0x99C8, 0x89E9, 0xB98A, 0xA9AB,
|
||||
0x5844, 0x4865, 0x7806, 0x6827, 0x18C0, 0x08E1, 0x3882, 0x28A3,
|
||||
0xCB7D, 0xDB5C, 0xEB3F, 0xFB1E, 0x8BF9, 0x9BD8, 0xABBB, 0xBB9A,
|
||||
0x4A75, 0x5A54, 0x6A37, 0x7A16, 0x0AF1, 0x1AD0, 0x2AB3, 0x3A92,
|
||||
0xFD2E, 0xED0F, 0xDD6C, 0xCD4D, 0xBDAA, 0xAD8B, 0x9DE8, 0x8DC9,
|
||||
0x7C26, 0x6C07, 0x5C64, 0x4C45, 0x3CA2, 0x2C83, 0x1CE0, 0x0CC1,
|
||||
0xEF1F, 0xFF3E, 0xCF5D, 0xDF7C, 0xAF9B, 0xBFBA, 0x8FD9, 0x9FF8,
|
||||
0x6E17, 0x7E36, 0x4E55, 0x5E74, 0x2E93, 0x3EB2, 0x0ED1, 0x1EF0,
|
||||
};
|
||||
|
||||
public static ushort CalculateChecksum(byte[] data,
|
||||
int offset = 0, ushort seed = 0xFFFF)
|
||||
{
|
||||
int length = data.Length;
|
||||
ushort result = seed;
|
||||
for (int i = offset; i < length; i++)
|
||||
result = (ushort)(ChecksumLookupTable[(result >> 8) ^ data[i]] ^ (result << 8));
|
||||
return result;
|
||||
}
|
||||
|
||||
public static uint CalculateChecksumU32(byte[] data,
|
||||
int offset = 0, uint seed = 0xFFFFFFFF)
|
||||
{
|
||||
int length = data.Length;
|
||||
uint result = seed;
|
||||
for (int i = offset; i < length; i++)
|
||||
result = ChecksumLookupTable[(byte)(result >> 8) ^ data[i]] ^ (result << 8);
|
||||
return result;
|
||||
}
|
||||
|
||||
public static ulong CalculateChecksumU64(byte[] data,
|
||||
int offset = 0, ulong seed = 0xFFFFFFFFFFFFFFFF)
|
||||
{
|
||||
int length = data.Length;
|
||||
ulong result = seed;
|
||||
for (int i = offset; i < length; i++)
|
||||
result = ChecksumLookupTable[(byte)(result >> 8) ^ data[i]] ^ (result << 8);
|
||||
return result;
|
||||
}
|
||||
|
||||
public static unsafe ushort CalculateChecksum(byte* data,
|
||||
int length, int offset = 0, ushort seed = 0xFFFF)
|
||||
{
|
||||
ushort result = seed;
|
||||
for (int i = offset; i < length; i++)
|
||||
result = (ushort)(ChecksumLookupTable[(result >> 8) ^ data[i]] ^ (result << 8));
|
||||
return result;
|
||||
}
|
||||
|
||||
public static unsafe uint CalculateChecksumU32(byte* data,
|
||||
int length, int offset = 0, uint seed = 0xFFFFFFFF)
|
||||
{
|
||||
uint result = seed;
|
||||
for (int i = offset; i < length; i++)
|
||||
result = ChecksumLookupTable[(byte)(result >> 8) ^ data[i]] ^ (result << 8);
|
||||
return result;
|
||||
}
|
||||
|
||||
public static unsafe ulong CalculateChecksumU64(byte* data,
|
||||
int length, int offset = 0, ulong seed = 0xFFFFFFFFFFFFFFFF)
|
||||
{
|
||||
ulong result = seed;
|
||||
for (int i = offset; i < length; i++)
|
||||
result = ChecksumLookupTable[(byte)(result >> 8) ^ data[i]] ^ (result << 8);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -223,7 +223,7 @@ namespace KKdBaseLib.F2
|
||||
public int Size;
|
||||
public int Repeat;
|
||||
public SubENRSEntry[] Sub;
|
||||
|
||||
|
||||
public ENRSEntry(int offset, int count, int size, int repeat)
|
||||
{ Offset = offset; Count = count; Size = size; Repeat = repeat; Sub = new SubENRSEntry[count]; }
|
||||
|
||||
@@ -255,13 +255,12 @@ namespace KKdBaseLib.F2
|
||||
public int SizeSkip => Skip + Reverse * (2 << (byte)Type);
|
||||
public int Size => Reverse * (2 << (byte)Type);
|
||||
|
||||
public override string ToString() => "Skip: " + Skip +
|
||||
"; Reverse: " + Reverse + "; Type: " + Type;
|
||||
public override string ToString() =>
|
||||
$"Skip: {Skip}; Reverse: {Reverse}; Type: {Type}";
|
||||
}
|
||||
|
||||
public override string ToString() =>
|
||||
"Offset: " + Offset + "; Count: " + Count + "; " +
|
||||
"Size: " + Size + "; Repeat: " + Repeat;
|
||||
$"Offset: {Offset}; Count: {Count}; Size: {Size}; Repeat: {Repeat}";
|
||||
}
|
||||
|
||||
public override string ToString() =>
|
||||
|
||||
@@ -4,14 +4,14 @@
|
||||
<Authors>korenkonder</Authors>
|
||||
<Company></Company>
|
||||
<Configuration></Configuration>
|
||||
<Copyright>korenkonder (C) 2019-2021</Copyright>
|
||||
<Copyright>korenkonder (C) 2019-2022</Copyright>
|
||||
<Description>A base library</Description>
|
||||
<FileVersion>0.4.10.7</FileVersion>
|
||||
<FileVersion>0.4.10.11</FileVersion>
|
||||
<PackageId>KKdBaseLib</PackageId>
|
||||
<Product>KKdBaseLib</Product>
|
||||
<TargetFramework>net461</TargetFramework>
|
||||
<Title>KKdBaseLib</Title>
|
||||
<Version>0.4.10.7</Version>
|
||||
<Version>0.4.10.11</Version>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
|
||||
+158
-99
@@ -14,6 +14,8 @@ namespace KKdMainLib
|
||||
public Data Data;
|
||||
public A3DAHeader Head;
|
||||
|
||||
public static int Rounding = 9;
|
||||
|
||||
private Stream s;
|
||||
private bool a3dc;
|
||||
private int i, i0, i1;
|
||||
@@ -178,10 +180,8 @@ namespace KKdMainLib
|
||||
|
||||
if (dict.FV(out value, "dof.name"))
|
||||
{
|
||||
DOF dof = new DOF { Name = value };
|
||||
Head.Format = Format.AFT;
|
||||
dof.MT = RMT("dof");
|
||||
Data.DOF = dof;
|
||||
Data.DOF = new DOF { MT = RMT("dof") };
|
||||
}
|
||||
|
||||
if (dict.FV(out value, "ambient.length"))
|
||||
@@ -191,12 +191,24 @@ namespace KKdMainLib
|
||||
for (i0 = 0; i0 < Data.Ambient.Length; i0++)
|
||||
{
|
||||
name = "ambient." + i0;
|
||||
|
||||
dict.FV(out Data.Ambient[i0].Name, name + ".name");
|
||||
Data.Ambient[i0]. LightDiffuse = RRGBAKN(name + ".light.Diffuse");
|
||||
Data.Ambient[i0].RimLightDiffuse = RRGBAKN(name + ".rimlight.Diffuse");
|
||||
}
|
||||
}
|
||||
|
||||
if (dict.FV(out value, "auth_2d.length"))
|
||||
{
|
||||
Data.Auth2D = new string[int.Parse(value)];
|
||||
for (i0 = 0; i0 < Data.Ambient.Length; i0++)
|
||||
{
|
||||
name = "auth_2d." + i0;
|
||||
|
||||
dict.FV(out Data.Auth2D[i0], name + ".name");
|
||||
}
|
||||
}
|
||||
|
||||
if (dict.FV(out value, "camera_root.length"))
|
||||
{
|
||||
Data.CameraRoot = new CameraRoot[int.Parse(value)];
|
||||
@@ -206,24 +218,24 @@ namespace KKdMainLib
|
||||
nameView = name + ".view_point";
|
||||
|
||||
dict.FV(out Data.CameraRoot[i0].VP.Aspect, nameView + ".aspect");
|
||||
dict.FV(out i1, nameView + ".fov_is_horizontal");
|
||||
Data.CameraRoot[i0].VP.FOVIsHorizontal = i1 != 0;
|
||||
if (!Data.CameraRoot[i0].VP.FOVIsHorizontal)
|
||||
if (dict.FV(out i1, nameView + ".fov_is_horizontal"))
|
||||
{
|
||||
Data.CameraRoot[i0].VP.FOVIsHorizontal = i1 != 0;
|
||||
Data.CameraRoot[i0].VP.FOV = RKNS(nameView + ".fov");
|
||||
}
|
||||
else
|
||||
{
|
||||
dict.FV(out Data.CameraRoot[i0].VP.
|
||||
CameraApertureH, nameView + ".camera_aperture_h");
|
||||
dict.FV(out Data.CameraRoot[i0].VP.
|
||||
CameraApertureW, nameView + ".camera_aperture_w");
|
||||
Data.CameraRoot[i0].VP.FocalLength = RKNS(nameView + ".focal_length");
|
||||
}
|
||||
|
||||
Data.CameraRoot[i0]. MT = RMT(name);
|
||||
Data.CameraRoot[i0].Interest = RMT(name + ".interest");
|
||||
Data.CameraRoot[i0].VP. MT = RMT(nameView);
|
||||
if (!Data.CameraRoot[i0].VP.FOVIsHorizontal)
|
||||
Data.CameraRoot[i0].VP.FocalLength = RK(nameView + ".focal_length");
|
||||
else
|
||||
Data.CameraRoot[i0].VP.FOV = RK(nameView + ".fov");
|
||||
Data.CameraRoot[i0].VP.Roll = RK(nameView + ".roll");
|
||||
Data.CameraRoot[i0].VP.Roll = RKNS(nameView + ".roll");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -235,7 +247,7 @@ namespace KKdMainLib
|
||||
name = "chara." + i0;
|
||||
|
||||
dict.FV(out Data.Chara[i0].Name, name + ".name");
|
||||
|
||||
|
||||
Data.Chara[i0].MT = RMT(name);
|
||||
}
|
||||
}
|
||||
@@ -294,7 +306,6 @@ namespace KKdMainLib
|
||||
name = "light." + i0;
|
||||
|
||||
dict.FV(out Data.Light[i0].Id , name + ".id" );
|
||||
dict.FV(out Data.Light[i0].Name, name + ".name");
|
||||
dict.FV(out Data.Light[i0].Type, name + ".type");
|
||||
|
||||
Data.Light[i0].Ambient = RRGBAKN(name + ".Ambient");
|
||||
@@ -389,9 +400,9 @@ namespace KKdMainLib
|
||||
name = "material_list." + i0;
|
||||
dict.FV(out Data.MaterialList[i0].Name, name + ".name");
|
||||
|
||||
Data.MaterialList[i0].BlendColor = RRGBAK(name + ".blend_color");
|
||||
Data.MaterialList[i0].GlowIntensity = RK (name + ".glow_intensity");
|
||||
Data.MaterialList[i0].Incandescence = RRGBAK(name + ".incandescence");
|
||||
Data.MaterialList[i0].BlendColor = RRGBAKN(name + ".blend_color");
|
||||
Data.MaterialList[i0].GlowIntensity = RKN (name + ".glow_intensity");
|
||||
Data.MaterialList[i0].Incandescence = RRGBAKN(name + ".incandescence");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -413,6 +424,7 @@ namespace KKdMainLib
|
||||
dict.FV(out Data.Object[i0].MorphOffset, name + ".morph_offset");
|
||||
dict.FV(out Data.Object[i0]. Name, name + ".name");
|
||||
dict.FV(out Data.Object[i0]. ParentName, name + ".parent_name");
|
||||
dict.FV(out Data.Object[i0]. ParentNode, name + ".parent_node");
|
||||
if (dict.FV(out Data.Object[i0]. Pat , name + ".pat" ))
|
||||
dict.FV(out Data.Object[i0]. PatOffset, name + ".pat_offset");
|
||||
dict.FV(out Data.Object[i0]. UIDName, name + ".uid_name");
|
||||
@@ -464,8 +476,10 @@ namespace KKdMainLib
|
||||
{
|
||||
name = "objhrc." + i0;
|
||||
|
||||
dict.FV(out Data.ObjectHRC[i0]. Name, name + ".name");
|
||||
dict.FV(out Data.ObjectHRC[i0].UIDName, name + ".uid_name");
|
||||
dict.FV(out Data.ObjectHRC[i0]. Name, name + ".name");
|
||||
dict.FV(out Data.ObjectHRC[i0].ParentName, name + ".parent_name");
|
||||
dict.FV(out Data.ObjectHRC[i0].ParentNode, name + ".parent_node");
|
||||
dict.FV(out Data.ObjectHRC[i0]. UIDName, name + ".uid_name");
|
||||
dict.FV(out int shadow, name + ".shadow");
|
||||
Data.ObjectHRC[i0].Shadow = shadow != 0;
|
||||
if (dict.FV(out value, name + ".node.length"))
|
||||
@@ -474,7 +488,7 @@ namespace KKdMainLib
|
||||
for (i1 = 0; i1 < Data.ObjectHRC[i0].Node.Length; i1++)
|
||||
{
|
||||
nameView = name + ".node." + i1;
|
||||
|
||||
|
||||
if (dict.SW(nameView + ".joint_orient"))
|
||||
{
|
||||
Vec3 jointOrient = new Vec3();
|
||||
@@ -515,7 +529,7 @@ namespace KKdMainLib
|
||||
name = "point." + i0;
|
||||
|
||||
dict.FV(out Data.Point[i0].Name, name + ".name");
|
||||
|
||||
|
||||
Data.Point[i0].MT = RMT(name);
|
||||
}
|
||||
}
|
||||
@@ -555,6 +569,19 @@ namespace KKdMainLib
|
||||
W("ambient.length", Data.Fog.Length);
|
||||
}
|
||||
|
||||
if (Data.Auth2D != null)
|
||||
{
|
||||
so0 = Data.Auth2D.Length.SW();
|
||||
for (i0 = 0; i0 < Data.Auth2D.Length; i0++)
|
||||
{
|
||||
soi0 = so0[i0];
|
||||
name = "auth_2d." + soi0;
|
||||
|
||||
W(name + ".name", Data.Auth2D[soi0]);
|
||||
}
|
||||
W("auth_2d.length", Data.Fog.Length);
|
||||
}
|
||||
|
||||
if (Data.CameraAuxiliary != null)
|
||||
{
|
||||
name = "camera_auxiliary";
|
||||
@@ -587,19 +614,34 @@ namespace KKdMainLib
|
||||
W(ref cr.Interest, name + ".interest");
|
||||
W(ref cr.MT, name, 0b11110);
|
||||
W(nameView + ".aspect", cr.VP.Aspect);
|
||||
if (!cr.VP.FOVIsHorizontal)
|
||||
if (cr.VP.FOV.HasValue)
|
||||
{
|
||||
if (cr.VP.FOV.HasValue)
|
||||
{
|
||||
Key key = cr.VP.FOV.Value;
|
||||
W(ref key, nameView + ".fov");
|
||||
cr.VP.FOV = key;
|
||||
}
|
||||
W(nameView + ".fov_is_horizontal", cr.VP.FOVIsHorizontal ? 1 : 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
W(nameView + ".camera_aperture_h", cr.VP.CameraApertureH);
|
||||
W(nameView + ".camera_aperture_w", cr.VP.CameraApertureW);
|
||||
W(ref cr.VP.FocalLength, nameView + ".focal_length");
|
||||
}
|
||||
else
|
||||
{
|
||||
W(ref cr.VP.FOV, nameView + ".fov");
|
||||
W(nameView + ".fov_is_horizontal", 1);
|
||||
if (cr.VP.FocalLength.HasValue)
|
||||
{
|
||||
Key key = cr.VP.FocalLength.Value;
|
||||
W(ref key, nameView + ".focal_length");
|
||||
cr.VP.FocalLength = key;
|
||||
}
|
||||
}
|
||||
W(ref cr.VP.MT , nameView, 0b10000);
|
||||
W(ref cr.VP.Roll, nameView + ".roll");
|
||||
if (cr.VP.Roll.HasValue)
|
||||
{
|
||||
Key key = cr.VP.Roll.Value;
|
||||
W(ref key, nameView + ".roll");
|
||||
cr.VP.Roll = key;
|
||||
}
|
||||
W(ref cr.VP.MT , nameView, 0b01111);
|
||||
W(ref cr.MT , name , 0b00001);
|
||||
}
|
||||
@@ -635,7 +677,7 @@ namespace KKdMainLib
|
||||
if (Data.DOF != null && (Head.Format == Format.AFT || Head.Format == Format.FT))
|
||||
{
|
||||
DOF dof = Data.DOF.Value;
|
||||
W("dof.name", dof.Name);
|
||||
W("dof.name", "DOF");
|
||||
W(ref dof.MT, "dof");
|
||||
Data.DOF = dof;
|
||||
}
|
||||
@@ -710,7 +752,16 @@ namespace KKdMainLib
|
||||
}
|
||||
W(ref light.Specular , name + ".Specular" );
|
||||
W(name + ".id" , light.Id );
|
||||
W(name + ".name", light.Name);
|
||||
W(name + ".name", light.Id switch
|
||||
{
|
||||
0 => "Char",
|
||||
1 => "Stage",
|
||||
2 => "Sun",
|
||||
3 => "Reflect",
|
||||
5 => "CharColor",
|
||||
6 => "ToneCurve",
|
||||
_ => "none",
|
||||
});
|
||||
W(ref light.Position , name + ".position" );
|
||||
W(ref light.SpotDirection, name + ".spot_direction");
|
||||
W(name + ".type", light.Type);
|
||||
@@ -833,6 +884,7 @@ namespace KKdMainLib
|
||||
}
|
||||
W(name + ".name" , @object.Name );
|
||||
W(name + ".parent_name", @object.ParentName);
|
||||
W(name + ".parent_node", @object.ParentNode);
|
||||
if (@object.Pat != null)
|
||||
{
|
||||
W(name + ".pat" , @object.Pat );
|
||||
@@ -932,9 +984,11 @@ namespace KKdMainLib
|
||||
W(name + ".node.length", objectHRC.Node.Length);
|
||||
}
|
||||
|
||||
W(name + ".parent_name", objectHRC.ParentName);
|
||||
W(name + ".parent_node", objectHRC.ParentNode);
|
||||
if (objectHRC.Shadow)
|
||||
W(name + ".shadow", 1);
|
||||
W(name + ".uid_name", objectHRC.UIDName);
|
||||
W(name + ".uid_name", objectHRC. UIDName);
|
||||
}
|
||||
W("objhrc.length", Data.ObjectHRC.Length);
|
||||
}
|
||||
@@ -1002,13 +1056,8 @@ namespace KKdMainLib
|
||||
}
|
||||
|
||||
private Vec4<Key?>? RRGBAKN(string str) =>
|
||||
dict.FV(out bool b, str + ".") ? b ?
|
||||
(Vec4<Key?>?)new Vec4<Key?> { W = RKNS(str + ".a"), Z = RKNS(str + ".b"),
|
||||
Y = RKNS(str + ".g"), X = RKNS(str + ".r") } : null : null;
|
||||
|
||||
private Vec4<Key?> RRGBAK(string str) =>
|
||||
new Vec4<Key?> { W = RKNS(str + ".a"), Z = RKNS(str + ".b"),
|
||||
Y = RKNS(str + ".g"), X = RKNS(str + ".r") };
|
||||
dict.SW(str) ? (Vec4<Key?>?)new Vec4<Key?> { W = RKNS(str + ".a"), Z = RKNS(str + ".b"),
|
||||
Y = RKNS(str + ".g"), X = RKNS(str + ".r") } : null;
|
||||
|
||||
private Vec3<Key> RV3(string str) =>
|
||||
new Vec3<Key> { X = RK(str + ".x"), Y = RK(str + ".y"), Z = RK(str + ".z") };
|
||||
@@ -1206,9 +1255,9 @@ namespace KKdMainLib
|
||||
private void W(string Data, ulong val) =>
|
||||
W(Data, val.ToS());
|
||||
private void W(string Data, float val) =>
|
||||
W(Data, val.ToS(9));
|
||||
W(Data, val.ToS(Rounding));
|
||||
private void W(string Data, double val) =>
|
||||
W(Data, val.ToS(9));
|
||||
W(Data, val.ToS(Rounding));
|
||||
private void W(string Data, string val)
|
||||
{ if (val != null) s.W(Data + "=" + val + "\n"); }
|
||||
|
||||
@@ -1239,9 +1288,9 @@ namespace KKdMainLib
|
||||
RMT(ref Data.CameraRoot[i0]. MT);
|
||||
RMT(ref Data.CameraRoot[i0].Interest);
|
||||
RMT(ref Data.CameraRoot[i0].VP. MT);
|
||||
RK (ref Data.CameraRoot[i0].VP.FocalLength);
|
||||
RK (ref Data.CameraRoot[i0].VP.FOV );
|
||||
RK (ref Data.CameraRoot[i0].VP.Roll );
|
||||
RKN(ref Data.CameraRoot[i0].VP.FocalLength);
|
||||
RKN(ref Data.CameraRoot[i0].VP.FOV );
|
||||
RKN(ref Data.CameraRoot[i0].VP.Roll );
|
||||
}
|
||||
|
||||
if (Data.Chara != null)
|
||||
@@ -1380,7 +1429,7 @@ namespace KKdMainLib
|
||||
WO(ref Data.CameraRoot[i0].VP. MT, ReturnToOffset);
|
||||
WO(ref Data.CameraRoot[i0].Interest, ReturnToOffset);
|
||||
}
|
||||
|
||||
|
||||
if (Data.Chara != null)
|
||||
for (i0 = 0; i0 < Data.Chara.Length; i0++)
|
||||
WO(ref Data.Chara[i0].MT, ReturnToOffset);
|
||||
@@ -1422,7 +1471,7 @@ namespace KKdMainLib
|
||||
if (Data.ObjectHRC[i0].Node != null)
|
||||
for (i1 = 0; i1 < Data.ObjectHRC[i0].Node.Length; i1++)
|
||||
WO(ref Data.ObjectHRC[i0].Node[i1].MT, ReturnToOffset);
|
||||
|
||||
|
||||
if (Data.Point != null)
|
||||
for (i0 = 0; i0 < Data.Point.Length; i0++)
|
||||
WO(ref Data.Point[i0].MT, ReturnToOffset);
|
||||
@@ -1791,9 +1840,9 @@ namespace KKdMainLib
|
||||
MMT(ref Data.CameraRoot[i0]. MT, ref mData.CameraRoot[i0]. MT);
|
||||
MMT(ref Data.CameraRoot[i0].Interest, ref mData.CameraRoot[i0].Interest);
|
||||
MMT(ref Data.CameraRoot[i0].VP. MT, ref mData.CameraRoot[i0].VP. MT);
|
||||
MK (ref Data.CameraRoot[i0].VP.FocalLength, ref mData.CameraRoot[i0].VP.FocalLength);
|
||||
MK (ref Data.CameraRoot[i0].VP.FOV , ref mData.CameraRoot[i0].VP.FOV );
|
||||
MK (ref Data.CameraRoot[i0].VP.Roll , ref mData.CameraRoot[i0].VP.Roll );
|
||||
MKN(ref Data.CameraRoot[i0].VP.FocalLength, ref mData.CameraRoot[i0].VP.FocalLength);
|
||||
MKN(ref Data.CameraRoot[i0].VP.FOV , ref mData.CameraRoot[i0].VP.FOV );
|
||||
MKN(ref Data.CameraRoot[i0].VP.Roll , ref mData.CameraRoot[i0].VP.Roll );
|
||||
}
|
||||
|
||||
if (Data.Chara != null && mData.Chara != null)
|
||||
@@ -2039,6 +2088,14 @@ namespace KKdMainLib
|
||||
};
|
||||
}
|
||||
|
||||
if ((temp = a3d["Auth2D", true]).NotNull)
|
||||
{
|
||||
Data.Auth2D = new string[temp.Array.Length];
|
||||
|
||||
for (i = 0; i < Data.Auth2D.Length; i++)
|
||||
Data.Auth2D[i] = temp[i].RS();
|
||||
}
|
||||
|
||||
if ((temp = a3d["CameraAuxiliary"]).NotNull)
|
||||
Data.CameraAuxiliary = new CameraAuxiliary
|
||||
{
|
||||
@@ -2063,10 +2120,17 @@ namespace KKdMainLib
|
||||
|
||||
if ((temp1 = temp[i]["ViewPoint"]).IsNull) continue;
|
||||
|
||||
bool fovIsHorizontal = temp1.RB(temp1["FOVHorizontal"].NotNull
|
||||
? "FOVHorizontal" : "FOVIsHorizontal");
|
||||
|
||||
if (!fovIsHorizontal)
|
||||
if (temp1["FOVHorizontal"].Object != null || temp1["FOVIsHorizontal"].Object != null)
|
||||
Data.CameraRoot[i].VP = new CameraRoot.ViewPoint
|
||||
{
|
||||
MT = temp1.RMT(),
|
||||
Aspect = temp1.RF32("Aspect"),
|
||||
FOVIsHorizontal = temp1.RB(temp1["FOVHorizontal"].Object != null
|
||||
? "FOVHorizontal" : "FOVIsHorizontal"),
|
||||
FOV = temp1.RK ("FOV" ),
|
||||
Roll = temp1.RK ("Roll" ),
|
||||
};
|
||||
else
|
||||
Data.CameraRoot[i].VP = new CameraRoot.ViewPoint
|
||||
{
|
||||
MT = temp1.RMT(),
|
||||
@@ -2074,18 +2138,8 @@ namespace KKdMainLib
|
||||
CameraApertureH = temp1.RF32("CameraApertureH"),
|
||||
CameraApertureW = temp1.RF32("CameraApertureW"),
|
||||
FocalLength = temp1.RK ("FocalLength" ),
|
||||
FOVIsHorizontal = false,
|
||||
Roll = temp1.RK ("Roll" ),
|
||||
};
|
||||
else
|
||||
Data.CameraRoot[i].VP = new CameraRoot.ViewPoint
|
||||
{
|
||||
MT = temp1.RMT(),
|
||||
Aspect = temp1.RF32("Aspect"),
|
||||
FOVIsHorizontal = true,
|
||||
FOV = temp1.RK ("FOV" ),
|
||||
Roll = temp1.RK ("Roll" ),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2112,11 +2166,7 @@ namespace KKdMainLib
|
||||
}
|
||||
|
||||
if ((temp = a3d["DOF"]).NotNull)
|
||||
Data.DOF = new DOF
|
||||
{
|
||||
MT = temp.RMT(),
|
||||
Name = temp.RS("Name"),
|
||||
};
|
||||
Data.DOF = new DOF { MT = temp.RMT() };
|
||||
|
||||
if ((temp = a3d["Event", true]).NotNull)
|
||||
{
|
||||
@@ -2168,7 +2218,6 @@ namespace KKdMainLib
|
||||
Data.Light[i] = new Light
|
||||
{
|
||||
Id = temp[i].RI32 ("Id" ),
|
||||
Name = temp[i].RS ("Name" ),
|
||||
Type = temp[i].RS ("Type" ),
|
||||
Ambient = temp[i].RRGBAKN("Ambient" ),
|
||||
ConeAngle = temp[i].RKN ("ConeAngle" ),
|
||||
@@ -2188,7 +2237,6 @@ namespace KKdMainLib
|
||||
Data.Light[i] = new Light
|
||||
{
|
||||
Id = temp[i].RI32 ("Id" ),
|
||||
Name = temp[i].RS ("Name" ),
|
||||
Type = temp[i].RS ("Type" ),
|
||||
Ambient = temp[i].RRGBAKN("Ambient" ),
|
||||
ConeAngle = temp[i].RKN ("ConeAngle" ),
|
||||
@@ -2212,10 +2260,10 @@ namespace KKdMainLib
|
||||
for (i = 0; i < Data.MaterialList.Length; i++)
|
||||
Data.MaterialList[i] = new MaterialList
|
||||
{
|
||||
Name = temp[i].RS ( "Name"),
|
||||
BlendColor = temp[i].RRGBAK( "BlendColor"),
|
||||
GlowIntensity = temp[i].RK ("GlowIntensity"),
|
||||
Incandescence = temp[i].RRGBAK("Incandescence"),
|
||||
Name = temp[i].RS ( "Name"),
|
||||
BlendColor = temp[i].RRGBAKN( "BlendColor"),
|
||||
GlowIntensity = temp[i].RKN ("GlowIntensity"),
|
||||
Incandescence = temp[i].RRGBAKN("Incandescence"),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -2293,6 +2341,7 @@ namespace KKdMainLib
|
||||
MorphOffset = temp[i0].RF32("MorphOffset"),
|
||||
Name = temp[i0].RS ( "Name"),
|
||||
ParentName = temp[i0].RS ( "ParentName"),
|
||||
ParentNode = temp[i0].RS ( "ParentNode"),
|
||||
Pat = temp[i0].RS ( "Pat" ),
|
||||
PatOffset = temp[i0].RF32( "PatOffset"),
|
||||
UIDName = temp[i0].RS ( "UIDName"),
|
||||
@@ -2359,9 +2408,11 @@ namespace KKdMainLib
|
||||
{
|
||||
Data.ObjectHRC[i0] = new ObjectHRC
|
||||
{
|
||||
Name = temp[i0].RS( "Name"),
|
||||
Shadow = temp[i0].RB( "Shadow"),
|
||||
UIDName = temp[i0].RS("UIDName"),
|
||||
Name = temp[i0].RS( "Name"),
|
||||
ParentName = temp[i0].RS("ParentName"),
|
||||
ParentNode = temp[i0].RS("ParentNode"),
|
||||
Shadow = temp[i0].RB( "Shadow"),
|
||||
UIDName = temp[i0].RS( "UIDName"),
|
||||
};
|
||||
|
||||
if ((temp1 = temp[i0]["Node", true]).NotNull)
|
||||
@@ -2466,6 +2517,14 @@ namespace KKdMainLib
|
||||
a3d.Add(ambient);
|
||||
}
|
||||
|
||||
if (Data.Auth2D != null)
|
||||
{
|
||||
MsgPack auth2D = new MsgPack(Data.Ambient.Length, "Auth2D");
|
||||
for (i = 0; i < Data.Ambient.Length; i++)
|
||||
auth2D[i] = new MsgPack(null, Data.Ambient[i].Name);
|
||||
a3d.Add(auth2D);
|
||||
}
|
||||
|
||||
if (Data.CameraAuxiliary != null)
|
||||
{
|
||||
CameraAuxiliary ca = Data.CameraAuxiliary.Value;
|
||||
@@ -2483,14 +2542,13 @@ namespace KKdMainLib
|
||||
{
|
||||
MsgPack cameraRoot = new MsgPack(Data.CameraRoot.Length, "CameraRoot");
|
||||
for (i = 0; i < Data.CameraRoot.Length; i++)
|
||||
if (!Data.CameraRoot[i].VP.FOVIsHorizontal)
|
||||
if (Data.CameraRoot[i].VP.FOV.HasValue)
|
||||
cameraRoot[i] = MsgPack.New
|
||||
.Add("Interest", ref Data.CameraRoot[i].Interest)
|
||||
.Add(new MsgPack("ViewPoint")
|
||||
.Add("Aspect" , Data.CameraRoot[i].VP.Aspect )
|
||||
.Add("CameraApertureH", Data.CameraRoot[i].VP.CameraApertureH)
|
||||
.Add("CameraApertureW", Data.CameraRoot[i].VP.CameraApertureW)
|
||||
.Add("FocalLength" , ref Data.CameraRoot[i].VP.FocalLength )
|
||||
.Add("FOVIsHorizontal", Data.CameraRoot[i].VP.FOVIsHorizontal)
|
||||
.Add("FOV" , ref Data.CameraRoot[i].VP.FOV )
|
||||
.Add("Roll" , ref Data.CameraRoot[i].VP.Roll )
|
||||
.Add(ref Data.CameraRoot[i].VP.MT))
|
||||
.Add(ref Data.CameraRoot[i]. MT);
|
||||
@@ -2499,8 +2557,9 @@ namespace KKdMainLib
|
||||
.Add("Interest", ref Data.CameraRoot[i].Interest)
|
||||
.Add(new MsgPack("ViewPoint")
|
||||
.Add("Aspect" , Data.CameraRoot[i].VP.Aspect )
|
||||
.Add("FOVIsHorizontal", Data.CameraRoot[i].VP.FOVIsHorizontal)
|
||||
.Add("FOV" , ref Data.CameraRoot[i].VP.FOV )
|
||||
.Add("CameraApertureH", Data.CameraRoot[i].VP.CameraApertureH)
|
||||
.Add("CameraApertureW", Data.CameraRoot[i].VP.CameraApertureW)
|
||||
.Add("FocalLength" , ref Data.CameraRoot[i].VP.FocalLength )
|
||||
.Add("Roll" , ref Data.CameraRoot[i].VP.Roll )
|
||||
.Add(ref Data.CameraRoot[i].VP.MT))
|
||||
.Add(ref Data.CameraRoot[i]. MT);
|
||||
@@ -2527,7 +2586,7 @@ namespace KKdMainLib
|
||||
if (Data.DOF != null)
|
||||
{
|
||||
DOF dof = Data.DOF.Value;
|
||||
a3d.Add(new MsgPack("DOF").Add("Name", dof.Name).Add(ref dof.MT));
|
||||
a3d.Add(new MsgPack("DOF").Add(ref dof.MT));
|
||||
Data.DOF = dof;
|
||||
}
|
||||
|
||||
@@ -2564,7 +2623,6 @@ namespace KKdMainLib
|
||||
MsgPack light = new MsgPack(Data.Light.Length, "Light");
|
||||
for (i = 0; i < Data.Light.Length; i++)
|
||||
light[i] = MsgPack.New.Add("Id" , Data.Light[i].Id)
|
||||
.Add("Name", Data.Light[i].Name)
|
||||
.Add("Type", Data.Light[i].Type)
|
||||
.Add("Ambient" , ref Data.Light[i].Ambient )
|
||||
.Add("ConeAngle" , ref Data.Light[i].ConeAngle )
|
||||
@@ -2600,7 +2658,7 @@ namespace KKdMainLib
|
||||
instance[i1].Add("Shadow", true);
|
||||
instance[i1].Add("UIDName", Data.MObjectHRC[i0].Instances[i1].UIDName);
|
||||
}
|
||||
|
||||
|
||||
_mObjectHRC.Add(instance);
|
||||
}
|
||||
|
||||
@@ -2665,14 +2723,15 @@ namespace KKdMainLib
|
||||
{
|
||||
MsgPack _object = MsgPack.New;
|
||||
if (Data.Object[i0].Morph != null)
|
||||
_object.Add("Morph" , Data.Object[i0].Morph )
|
||||
.Add("MorphOffset", Data.Object[i0].MorphOffset);
|
||||
_object = _object.Add("Morph" , Data.Object[i0].Morph )
|
||||
.Add("MorphOffset", Data.Object[i0].MorphOffset);
|
||||
_object.Add("Name", Data.Object[i0].Name);
|
||||
if (Data.Object[i0].Pat != null)
|
||||
_object.Add("Pat" , Data.Object[i0].Pat )
|
||||
.Add("PatOffset", Data.Object[i0].PatOffset);
|
||||
_object.Add("ParentName", Data.Object[i0].ParentName)
|
||||
.Add( "UIDName", Data.Object[i0]. UIDName);
|
||||
_object = _object.Add("Pat" , Data.Object[i0].Pat )
|
||||
.Add("PatOffset", Data.Object[i0].PatOffset);
|
||||
_object = _object.Add("ParentName", Data.Object[i0].ParentName)
|
||||
.Add("ParentNode", Data.Object[i0].ParentNode)
|
||||
.Add( "UIDName", Data.Object[i0]. UIDName);
|
||||
if (Data.Object[i0].TexPat != null)
|
||||
{
|
||||
MsgPack texPat = new MsgPack(Data.Object[i0].TexPat.Length, "TexturePattern");
|
||||
@@ -2680,8 +2739,8 @@ namespace KKdMainLib
|
||||
{
|
||||
texPat[i1] = MsgPack.New.Add("Name", Data.Object[i0].TexPat[i1].Name);
|
||||
if (Data.Object[i0].TexPat[i1].Pat != null)
|
||||
texPat[i1].Add("Pat" , Data.Object[i0].TexPat[i1].Pat )
|
||||
.Add("PatOffset", Data.Object[i0].TexPat[i1].PatOffset);
|
||||
texPat[i1] = texPat[i1].Add("Pat" , Data.Object[i0].TexPat[i1].Pat )
|
||||
.Add("PatOffset", Data.Object[i0].TexPat[i1].PatOffset);
|
||||
}
|
||||
_object.Add(texPat);
|
||||
}
|
||||
@@ -2714,10 +2773,13 @@ namespace KKdMainLib
|
||||
MsgPack objectHRC = new MsgPack(Data.ObjectHRC.Length, "ObjectHRC");
|
||||
for (i0 = 0; i0 < Data.ObjectHRC.Length; i0++)
|
||||
{
|
||||
MsgPack _objectHRC = MsgPack.New.Add("Name", Data.MObjectHRC[i0].Instances[i1].Name);
|
||||
if (Data.MObjectHRC[i0].Instances[i1].Shadow)
|
||||
MsgPack _objectHRC = MsgPack.New
|
||||
.Add("Name", Data.ObjectHRC[i0].Name)
|
||||
.Add("ParentName", Data.ObjectHRC[i0].ParentName)
|
||||
.Add("ParentNode", Data.ObjectHRC[i0].ParentNode);
|
||||
if (Data.ObjectHRC[i0].Shadow)
|
||||
_objectHRC.Add("Shadow", true);
|
||||
_objectHRC.Add("UIDName", Data.MObjectHRC[i0].Instances[i1].UIDName);
|
||||
_objectHRC.Add("UIDName", Data.ObjectHRC[i0].UIDName);
|
||||
|
||||
if (Data.ObjectHRC[i0].Node != null)
|
||||
{
|
||||
@@ -2813,9 +2875,6 @@ namespace KKdMainLib
|
||||
public static Vec4<Key?>? RRGBAKN(this MsgPack msgPack, string name) =>
|
||||
msgPack[name].NotNull ? (Vec4<Key?>?)msgPack[name].RRGBAK() : null;
|
||||
|
||||
public static Vec4<Key?> RRGBAK(this MsgPack msgPack, string name) =>
|
||||
msgPack[name].RRGBAK();
|
||||
|
||||
public static Vec4<Key?> RRGBAK(this MsgPack msgPack) =>
|
||||
new Vec4<Key?> { X = msgPack.RKN("R"), Y = msgPack.RKN("G"),
|
||||
Z = msgPack.RKN("B"), W = msgPack.RKN("A") };
|
||||
|
||||
+10
-3
@@ -61,8 +61,7 @@ namespace KKdMainLib.DB
|
||||
s = File.OpenWriter(file + ".bin", true);
|
||||
|
||||
s.W("#A3DA__________\n");
|
||||
s.W("#" + DateTime.UtcNow.ToString("ddd MMM dd HH:mm:ss yyyy",
|
||||
System.Globalization.CultureInfo.InvariantCulture) + "\n");
|
||||
s.W("# date time was eliminated.\n");
|
||||
|
||||
if (Category != null)
|
||||
{
|
||||
@@ -75,18 +74,26 @@ namespace KKdMainLib.DB
|
||||
if (UIDs != null)
|
||||
{
|
||||
int[] so = UIDs.Length.SW();
|
||||
int max = -1;
|
||||
for (i = 0; i < UIDs.Length; i++)
|
||||
{
|
||||
if (UIDs[so[i]].Category != null && UIDs[so[i]].Category != "")
|
||||
s.W($"uid.{so[i]}.category=" + UIDs[so[i]].Category + "\n");
|
||||
if (UIDs[so[i]].OrgUid != null)
|
||||
s.W($"uid.{so[i]}.org_uid=" + UIDs[so[i]].OrgUid + "\n");
|
||||
{
|
||||
int orgUid = UIDs[so[i]].OrgUid.Value;
|
||||
s.W($"uid.{so[i]}.org_uid=" + orgUid + "\n");
|
||||
if (max < orgUid)
|
||||
max = orgUid;
|
||||
}
|
||||
if (UIDs[so[i]].Size != null)
|
||||
s.W($"uid.{so[i]}.size=" + UIDs[so[i]].Size + "\n");
|
||||
if (UIDs[so[i]].Value != null && UIDs[so[i]].Value != "")
|
||||
s.W($"uid.{so[i]}.value=" + UIDs[so[i]].Value + "\n");
|
||||
}
|
||||
s.W($"uid.length={UIDs.Length}\n");
|
||||
if (max != -1)
|
||||
s.W($"uid.max={max}\n");
|
||||
}
|
||||
|
||||
s.C();
|
||||
|
||||
+64
-64
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+61
-5
@@ -10,13 +10,13 @@ namespace KKdMainLib
|
||||
{
|
||||
private static readonly byte[] Key = "file access deny".ToASCII();
|
||||
|
||||
public static void Decrypt(this string file)
|
||||
public static void Decrypt(string file)
|
||||
{
|
||||
int streamLength, fileLength;
|
||||
byte[] encrypted, decrypted;
|
||||
using (Stream _IO = File.OpenReader(file))
|
||||
{
|
||||
if (_IO.RI64() != 0x454C494641564944) return;
|
||||
if (_IO.RU64() != 0x454C494641564944u) return;
|
||||
|
||||
streamLength = _IO.RI32();
|
||||
fileLength = _IO.RI32();
|
||||
@@ -36,8 +36,8 @@ namespace KKdMainLib
|
||||
using (Stream _IO = File.OpenWriter(file, fileLength))
|
||||
_IO.W(decrypted, fileLength < streamLength ? fileLength : streamLength);
|
||||
}
|
||||
|
||||
public static void Encrypt(this string file)
|
||||
|
||||
public static void Encrypt(string file)
|
||||
{
|
||||
byte[] data;
|
||||
using (Stream _IO = File.OpenReader(file))
|
||||
@@ -60,11 +60,67 @@ namespace KKdMainLib
|
||||
|
||||
using (Stream _IO = File.OpenWriter(file, dataAlign.Length))
|
||||
{
|
||||
_IO.W(0x454C494641564944);
|
||||
_IO.W(0x454C494641564944u);
|
||||
_IO.W(fileLength);
|
||||
_IO.W(fileLengthOrigin);
|
||||
_IO.W(encrypted);
|
||||
}
|
||||
}
|
||||
|
||||
public static byte[] Decrypt(byte[] data)
|
||||
{
|
||||
int streamLength, fileLength;
|
||||
byte[] encrypted, decrypted;
|
||||
using (Stream _IO = File.OpenReader(data))
|
||||
{
|
||||
if (_IO.RU64() != 0x454C494641564944u) return data;
|
||||
|
||||
streamLength = _IO.RI32();
|
||||
fileLength = _IO.RI32();
|
||||
encrypted = _IO.RBy(streamLength);
|
||||
decrypted = new byte[streamLength];
|
||||
}
|
||||
|
||||
using (AesManaged crypto = new AesManaged())
|
||||
{
|
||||
crypto.Key = Key; crypto.IV = new byte[16];
|
||||
crypto.Mode = CipherMode.ECB; crypto.Padding = PaddingMode.Zeros;
|
||||
using CryptoStream cryptoData = new CryptoStream(new MSIO.MemoryStream(encrypted),
|
||||
crypto.CreateDecryptor(crypto.Key, crypto.IV), CryptoStreamMode.Read);
|
||||
cryptoData.Read(decrypted, 0, streamLength);
|
||||
}
|
||||
|
||||
data = new byte[fileLength];
|
||||
Array.Copy(decrypted, data, fileLength < streamLength ? fileLength : streamLength);
|
||||
return data;
|
||||
}
|
||||
|
||||
public static byte[] Encrypt(byte[] data)
|
||||
{
|
||||
int fileLengthOrigin = data.Length;
|
||||
int fileLength = fileLengthOrigin.A(16);
|
||||
byte[] dataAlign = new byte[fileLength];
|
||||
Array.Copy(data, dataAlign, data.Length);
|
||||
data = null;
|
||||
byte[] encrypted = new byte[fileLength];
|
||||
using (AesManaged crypto = new AesManaged())
|
||||
{
|
||||
crypto.Key = Key; crypto.IV = new byte[16];
|
||||
crypto.Mode = CipherMode.ECB; crypto.Padding = PaddingMode.Zeros;
|
||||
using CryptoStream cryptoData = new CryptoStream(new MSIO.MemoryStream(dataAlign),
|
||||
crypto.CreateEncryptor(crypto.Key, crypto.IV), CryptoStreamMode.Read);
|
||||
cryptoData.Read(encrypted, 0, fileLength);
|
||||
}
|
||||
|
||||
using (Stream _IO = File.OpenWriter())
|
||||
{
|
||||
_IO.W(0x454C494641564944u);
|
||||
_IO.W(fileLength);
|
||||
_IO.W(fileLengthOrigin);
|
||||
_IO.W(encrypted);
|
||||
data = _IO.ToArray();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,15 +83,15 @@ namespace KKdMainLib
|
||||
return s.ToArray(true);
|
||||
}
|
||||
|
||||
public void DBWriter(string file, uint num2)
|
||||
public void DBWriter(string file, uint timestamp)
|
||||
{
|
||||
if (!Success) return;
|
||||
|
||||
byte[] data = DBWriter(file);
|
||||
if (data == null) return;
|
||||
|
||||
ushort num = DCC.CalculateChecksum(data);
|
||||
File.WriteAllBytes(file + "_" + num + "_" + num2 + ".dat", data);
|
||||
ushort hash = data.HashCRC16_CCITT();
|
||||
File.WriteAllBytes(file + "_" + hash + "_" + timestamp + ".dat", data);
|
||||
}
|
||||
|
||||
public void MsgPackReader(string file, bool json)
|
||||
|
||||
@@ -100,13 +100,14 @@ namespace KKdMainLib
|
||||
public static Struct RSt(this byte[] data)
|
||||
{
|
||||
if (data == null || data.Length < 1) return default;
|
||||
data = DIVAFILE.Decrypt(data);
|
||||
Struct @struct;
|
||||
using (Stream stream = File.OpenReader(data))
|
||||
@struct = stream.RSt(stream.ReadHeader(false));
|
||||
return @struct;
|
||||
}
|
||||
|
||||
public static Struct RSt(this Stream stream, Header header)
|
||||
private static Struct RSt(this Stream stream, Header header)
|
||||
{
|
||||
uint l = header.UseSectionSize ? header.SectionSize : header.DataSize;
|
||||
Struct @struct = new Struct { Header = header, DataOffset =
|
||||
@@ -163,7 +164,7 @@ namespace KKdMainLib
|
||||
if (@struct.HasSubStructs)
|
||||
for (int i = 0; i < @struct.SubStructs.Length; i++)
|
||||
stream.W(@struct.SubStructs[i], depth + 1, shiftX, useDepth);
|
||||
if (@struct.HasPOF || @struct.HasENRS || @struct.HasSubStructs)
|
||||
if (@struct.HasPOF || @struct.HasENRS || @struct.HasSubStructs)
|
||||
stream.WEOFC(depth + 1);
|
||||
}
|
||||
}
|
||||
@@ -248,29 +249,35 @@ namespace KKdMainLib
|
||||
}
|
||||
|
||||
public static class HashExt
|
||||
{
|
||||
{
|
||||
public static uint HashFNV1a64(this byte[] array) =>
|
||||
array.HashMurmurHash(array.Length);
|
||||
|
||||
public static ulong HashFNV1a64(this byte[] array, int length) // 0x1403B04D0 in SBZV_7.10; FNV 1a 64-bit
|
||||
// FNV 1a 64-bit Modified
|
||||
// 0x1403B04D0 in SBZV_7.10
|
||||
public static ulong HashFNV1a64m(this byte[] array, int length)
|
||||
{
|
||||
int i = 0;
|
||||
ulong hash = 0xCBF29CE484222325;
|
||||
while (i < length)
|
||||
{ hash = 0x100000001B3 * (hash ^ (ulong)array[i]); i++; }
|
||||
return (hash >> 32) ^ hash;
|
||||
}
|
||||
|
||||
return (hash >> 32) ^ hash; // Actual Modification
|
||||
}
|
||||
|
||||
public static uint HashMurmurHash(this byte[] array, uint salt = 0,
|
||||
bool alreadyUpper = false, bool bigEndian = false) =>
|
||||
array.HashMurmurHash(array.Length, salt, alreadyUpper, bigEndian);
|
||||
|
||||
// MurmurHash
|
||||
// 0x814D7A9C in PCSB00554
|
||||
// 0x8134C304 in PCSB01007
|
||||
// 0x0069CEA4 in NPEB02013
|
||||
public static uint HashMurmurHash(this byte[] array, int length, uint salt = 0,
|
||||
bool alreadyUpper = false, bool bigEndian = false) // 0x814D7A9C in PCSB00554; MurmurHash
|
||||
bool alreadyUpper = false, bool bigEndian = false)
|
||||
{
|
||||
uint a, b, hash;
|
||||
int i;
|
||||
|
||||
|
||||
const uint m = 0x7FD652AD;
|
||||
const int r = 16;
|
||||
|
||||
@@ -360,5 +367,51 @@ namespace KKdMainLib
|
||||
hash ^= hash >> 17;
|
||||
return hash;
|
||||
}
|
||||
|
||||
private static readonly ushort[] CRC16_CCITT_Table = {
|
||||
0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50A5, 0x60C6, 0x70E7,
|
||||
0x8108, 0x9129, 0xA14A, 0xB16B, 0xC18C, 0xD1AD, 0xE1CE, 0xF1EF,
|
||||
0x1231, 0x0210, 0x3273, 0x2252, 0x52B5, 0x4294, 0x72F7, 0x62D6,
|
||||
0x9339, 0x8318, 0xB37B, 0xA35A, 0xD3BD, 0xC39C, 0xF3FF, 0xE3DE,
|
||||
0x2462, 0x3443, 0x0420, 0x1401, 0x64E6, 0x74C7, 0x44A4, 0x5485,
|
||||
0xA56A, 0xB54B, 0x8528, 0x9509, 0xE5EE, 0xF5CF, 0xC5AC, 0xD58D,
|
||||
0x3653, 0x2672, 0x1611, 0x0630, 0x76D7, 0x66F6, 0x5695, 0x46B4,
|
||||
0xB75B, 0xA77A, 0x9719, 0x8738, 0xF7DF, 0xE7FE, 0xD79D, 0xC7BC,
|
||||
0x48C4, 0x58E5, 0x6886, 0x78A7, 0x0840, 0x1861, 0x2802, 0x3823,
|
||||
0xC9CC, 0xD9ED, 0xE98E, 0xF9AF, 0x8948, 0x9969, 0xA90A, 0xB92B,
|
||||
0x5AF5, 0x4AD4, 0x7AB7, 0x6A96, 0x1A71, 0x0A50, 0x3A33, 0x2A12,
|
||||
0xDBFD, 0xCBDC, 0xFBBF, 0xEB9E, 0x9B79, 0x8B58, 0xBB3B, 0xAB1A,
|
||||
0x6CA6, 0x7C87, 0x4CE4, 0x5CC5, 0x2C22, 0x3C03, 0x0C60, 0x1C41,
|
||||
0xEDAE, 0xFD8F, 0xCDEC, 0xDDCD, 0xAD2A, 0xBD0B, 0x8D68, 0x9D49,
|
||||
0x7E97, 0x6EB6, 0x5ED5, 0x4EF4, 0x3E13, 0x2E32, 0x1E51, 0x0E70,
|
||||
0xFF9F, 0xEFBE, 0xDFDD, 0xCFFC, 0xBF1B, 0xAF3A, 0x9F59, 0x8F78,
|
||||
0x9188, 0x81A9, 0xB1CA, 0xA1EB, 0xD10C, 0xC12D, 0xF14E, 0xE16F,
|
||||
0x1080, 0x00A1, 0x30C2, 0x20E3, 0x5004, 0x4025, 0x7046, 0x6067,
|
||||
0x83B9, 0x9398, 0xA3FB, 0xB3DA, 0xC33D, 0xD31C, 0xE37F, 0xF35E,
|
||||
0x02B1, 0x1290, 0x22F3, 0x32D2, 0x4235, 0x5214, 0x6277, 0x7256,
|
||||
0xB5EA, 0xA5CB, 0x95A8, 0x8589, 0xF56E, 0xE54F, 0xD52C, 0xC50D,
|
||||
0x34E2, 0x24C3, 0x14A0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405,
|
||||
0xA7DB, 0xB7FA, 0x8799, 0x97B8, 0xE75F, 0xF77E, 0xC71D, 0xD73C,
|
||||
0x26D3, 0x36F2, 0x0691, 0x16B0, 0x6657, 0x7676, 0x4615, 0x5634,
|
||||
0xD94C, 0xC96D, 0xF90E, 0xE92F, 0x99C8, 0x89E9, 0xB98A, 0xA9AB,
|
||||
0x5844, 0x4865, 0x7806, 0x6827, 0x18C0, 0x08E1, 0x3882, 0x28A3,
|
||||
0xCB7D, 0xDB5C, 0xEB3F, 0xFB1E, 0x8BF9, 0x9BD8, 0xABBB, 0xBB9A,
|
||||
0x4A75, 0x5A54, 0x6A37, 0x7A16, 0x0AF1, 0x1AD0, 0x2AB3, 0x3A92,
|
||||
0xFD2E, 0xED0F, 0xDD6C, 0xCD4D, 0xBDAA, 0xAD8B, 0x9DE8, 0x8DC9,
|
||||
0x7C26, 0x6C07, 0x5C64, 0x4C45, 0x3CA2, 0x2C83, 0x1CE0, 0x0CC1,
|
||||
0xEF1F, 0xFF3E, 0xCF5D, 0xDF7C, 0xAF9B, 0xBFBA, 0x8FD9, 0x9FF8,
|
||||
0x6E17, 0x7E36, 0x4E55, 0x5E74, 0x2E93, 0x3EB2, 0x0ED1, 0x1EF0,
|
||||
};
|
||||
|
||||
// CRC16-CCITT
|
||||
// 0x140011A90 in SBZV_7.10
|
||||
public static ushort HashCRC16_CCITT(this byte[] data, int offset = 0, ushort seed = 0xFFFF)
|
||||
{
|
||||
int length = data.Length;
|
||||
ushort hash = seed;
|
||||
for (int i = offset; i < length; i++)
|
||||
hash = (ushort)(CRC16_CCITT_Table[(hash >> 8) ^ data[i]] ^ (hash << 8));
|
||||
return hash;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ namespace KKdMainLib.F2
|
||||
s.W(blt.Brightpass.Z);
|
||||
s.W(blt.Range );
|
||||
}
|
||||
|
||||
|
||||
e.Array = new ENRS.ENRSEntry[2];
|
||||
e.Array[0] = new ENRS.ENRSEntry(0x00, 0x01, 0x10, 0x01);
|
||||
e.Array[0].Sub[0] = new ENRS.ENRSEntry.SubENRSEntry(0x00, 0x02, ENRS.ENRSEntry.Type.DWORD);
|
||||
|
||||
@@ -99,7 +99,7 @@ namespace KKdMainLib.F2
|
||||
s.W(cct.Gamma.Z );
|
||||
s.W(cct.Contrast );
|
||||
}
|
||||
|
||||
|
||||
e.Array = new ENRS.ENRSEntry[2];
|
||||
e.Array[0] = new ENRS.ENRSEntry(0x00, 0x01, 0x10, 0x01);
|
||||
e.Array[0].Sub[0] = new ENRS.ENRSEntry.SubENRSEntry(0x00, 0x02, ENRS.ENRSEntry.Type.DWORD);
|
||||
|
||||
@@ -91,7 +91,7 @@ namespace KKdMainLib.F2
|
||||
s.W(dft.Ratio );
|
||||
s.W(dft.Quality );
|
||||
}
|
||||
|
||||
|
||||
e.Array = new ENRS.ENRSEntry[2];
|
||||
e.Array[0] = new ENRS.ENRSEntry(0x00, 0x01, 0x10, 0x01);
|
||||
e.Array[0].Sub[0] = new ENRS.ENRSEntry.SubENRSEntry(0x00, 0x02, ENRS.ENRSEntry.Type.DWORD);
|
||||
|
||||
@@ -895,7 +895,7 @@ namespace KKdMainLib.F2
|
||||
ToneCurve = 0b00000001000000000,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public struct LITX
|
||||
{
|
||||
public int C;
|
||||
|
||||
@@ -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.7</FileVersion>
|
||||
<FileVersion>0.4.10.11</FileVersion>
|
||||
<PackageId>KKdMainLib</PackageId>
|
||||
<Product>KKdMainLib</Product>
|
||||
<TargetFramework>net461</TargetFramework>
|
||||
<Title>KKdMainLib</Title>
|
||||
<Version>0.4.10.7</Version>
|
||||
<Version>0.4.10.11</Version>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
|
||||
+760
-456
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@@ -334,6 +334,8 @@ namespace PD_Tool
|
||||
else if (filetype == "json") Filter = GetArgs("JSON", "json");
|
||||
else if (filetype == "igb" ) Filter = GetArgs("IGB", "igb");
|
||||
else if (filetype == "mgftxt") Filter = GetArgs("MGF2AFT txt", "txt");
|
||||
else if (filetype == "mhd" ) Filter = GetArgs("MotHead", "mhd", "bin", "json", "mp") +
|
||||
GetArgs("MotHead", true, "mhd") + bin + json + mp;
|
||||
else if (filetype == "mp" ) Filter = GetArgs("MessagePack", "mp");
|
||||
else if (filetype == "lit") Filter = GetArgs("LIT" , "lit", "json", "mp") +
|
||||
GetArgs("LIT", true, "lit") + json + mp;
|
||||
|
||||
@@ -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.7")]
|
||||
[assembly: AssemblyFileVersion("0.4.10.7")]
|
||||
[assembly: AssemblyVersion("0.4.10.11")]
|
||||
[assembly: AssemblyFileVersion("0.4.10.11")]
|
||||
|
||||
+19
-10
@@ -37,20 +37,29 @@ namespace PD_Tool
|
||||
Program.ConsoleDesign("8. A3DC [XHD/VRFL]");
|
||||
if (!mp) Program.ConsoleDesign($"9. {(json ? "JSON" : "MsgPack")}");
|
||||
Program.ConsoleDesign(false);
|
||||
Program.ConsoleDesign("X[Y] - X: option; Y: rounding in text (def. 9)");
|
||||
Program.ConsoleDesign(false);
|
||||
Program.ConsoleDesign(true);
|
||||
Console.WriteLine();
|
||||
choose = Console.ReadLine().ToUpper();
|
||||
if (choose == "1") format = Format.DT ;
|
||||
else if (choose == "2") format = Format.F ;
|
||||
else if (choose == "3") format = Format.AFT;
|
||||
else if (choose == "4") format = Format.AFT;
|
||||
else if (choose == "5") format = Format.F2 ;
|
||||
else if (choose == "6") format = Format.MGF;
|
||||
else if (choose == "7") format = Format.X ;
|
||||
else if (choose == "8") format = Format.XHD;
|
||||
else if (choose == "9") format = Format.NULL;
|
||||
if (choose == null || choose.Length < 1)
|
||||
return;
|
||||
else if (choose[0] == '1') format = Format.DT ;
|
||||
else if (choose[0] == '2') format = Format.F ;
|
||||
else if (choose[0] == '3') format = Format.AFT;
|
||||
else if (choose[0] == '4') format = Format.AFT;
|
||||
else if (choose[0] == '5') format = Format.F2 ;
|
||||
else if (choose[0] == '6') format = Format.MGF;
|
||||
else if (choose[0] == '7') format = Format.X ;
|
||||
else if (choose[0] == '8') format = Format.XHD;
|
||||
else if (choose[0] == '9') format = Format.NULL;
|
||||
else return;
|
||||
|
||||
if (int.TryParse(choose.Substring(1), out int rounding))
|
||||
KKdA3DA.Rounding = rounding;
|
||||
else
|
||||
KKdA3DA.Rounding = 9;
|
||||
|
||||
int state;
|
||||
string filepath, ext;
|
||||
KKdA3DA a3da;
|
||||
@@ -69,7 +78,7 @@ namespace PD_Tool
|
||||
{
|
||||
state = a3da.A3DAReader(filepath);
|
||||
if (state == 1)
|
||||
if (choose == "F") a3da.MsgPackWriter(filepath, json);
|
||||
if (choose == "9") a3da.MsgPackWriter(filepath, json);
|
||||
else
|
||||
{
|
||||
a3da.Head.Format = format;
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace PD_Tool
|
||||
if (file.EndsWith(".mp" )) { mp = false; break; }
|
||||
else if (file.EndsWith(".json")) { mp = false; break; }
|
||||
|
||||
uint num2 = (uint)((DateTime.Now.Ticks - 621355968000000000) / 10000000);
|
||||
uint timestamp = (uint)((DateTime.Now.Ticks - 621355968000000000) / 10000000);
|
||||
string[] file_split;
|
||||
string filepath, ext;
|
||||
KKdMainLib.DataBank db;
|
||||
@@ -48,7 +48,7 @@ namespace PD_Tool
|
||||
{
|
||||
Console.Title = "DataBank Converter: " + filename;
|
||||
db.MsgPackReader(filepath, json);
|
||||
db. DBWriter(filepath, num2);
|
||||
db. DBWriter(filepath, timestamp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace PD_Tool
|
||||
|
||||
if (head != 0x454C494641564944) return;
|
||||
System.Console.Title = "DIVAFILE Decrypt: " + Path.GetFileName(file);
|
||||
file.Decrypt();
|
||||
KKdMainLib.DIVAFILE.Decrypt(file);
|
||||
}
|
||||
|
||||
public static void Encrypt(string file)
|
||||
@@ -24,7 +24,7 @@ namespace PD_Tool
|
||||
|
||||
if (head == 0x454C494641564944) return;
|
||||
System.Console.Title = "DIVAFILE Encrypt: " + Path.GetFileName(file);
|
||||
file.Encrypt();
|
||||
KKdMainLib.DIVAFILE.Encrypt(file);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace PD_Tool
|
||||
public static void Processor(bool json)
|
||||
{
|
||||
Console.Title = "MotHead Converter";
|
||||
Program.Choose(1, "bin", out string[] fileNames);
|
||||
Program.Choose(1, "mhd", out string[] fileNames);
|
||||
if (fileNames.Length < 1) return;
|
||||
|
||||
string filepath, ext;
|
||||
@@ -21,9 +21,9 @@ namespace PD_Tool
|
||||
ext = Path.GetExtension(file).ToLower();
|
||||
|
||||
Console.Title = "MotHead Converter: " + Path.GetFileNameWithoutExtension(file);
|
||||
if (ext == ".bin")
|
||||
if (ext == ".bin" || ext == ".mhd")
|
||||
{
|
||||
mhd.MotHeadReader(filepath);
|
||||
mhd.MotHeadReader(filepath, ext);
|
||||
mhd.MsgPackWriter(filepath, json);
|
||||
}
|
||||
else if (ext == ".mp" || ext == ".json")
|
||||
|
||||
Reference in New Issue
Block a user