Compare commits

...
9 Commits
Author SHA1 Message Date
korenkonder df92e13d2c Release v0.4.10.7
A3DA, AuthDB
2021-10-03 18:32:46 +03:00
korenkonder 803f64e333 Release v0.4.10.6
A3DA
2021-09-26 19:16:56 +03:00
korenkonder a7e14e22ad Release v0.4.10.5
A3DA
2021-09-17 21:00:31 +03:00
korenkonder d94f45870d Release v0.4.10.4
A3DA
2021-05-26 22:43:16 +03:00
korenkonder 2b46e0f4bd Release v0.4.10.3
A3DA
2021-05-24 04:02:18 +03:00
korenkonder f1547f78b2 Release v0.4.10.2.1
A3DA
2021-05-23 21:11:34 +03:00
korenkonder 6c35326dda v0.4.10.2
A3DA
2021-05-22 14:13:54 +03:00
korenkonder 30a51f6bc4 Release v0.4.10.1
A3DA
2021-04-30 03:10:49 +03:00
korenkonder 54af060c13 Release v0.4.10.0
A3DA, AET, FARC
2021-04-29 07:41:23 +03:00
28 changed files with 1281 additions and 1126 deletions
-2
View File
@@ -1,2 +0,0 @@
# Auto detect text files and perform LF normalization
* text=auto
+4 -4
View File
@@ -27,15 +27,15 @@ namespace KKdBaseLib
Length = DataOffset = 0; Keys = null;
MaxFrames = k.Max ?? 0;
if (k.Type > KeyType.Static && k.Length > 1)
if (k.Type > KeyType.Static && k.Keys != null && k.Keys.Length > 1)
{
Type = k.Type;
Length = k.Length;
Length = k.Keys.Length;
Keys = k.Keys;
EPTypePost = k.EPTypePost;
EPTypePre = k.EPTypePre;
FrameDelta = k.Keys[k.Length - 1].F - k.Keys[0].F;
ValueDelta = k.Keys[k.Length - 1].V - k.Keys[0].V;
FrameDelta = k.Keys[Length - 1].F - k.Keys[0].F;
ValueDelta = k.Keys[Length - 1].V - k.Keys[0].V;
}
else
{
+76 -63
View File
@@ -9,9 +9,11 @@ namespace KKdBaseLib.Auth3D
public _ _;
public DOF? DOF;
public Fog[] Fog;
public Chara[] Chara;
public Curve[] Curve;
public Event[] Event;
public Light[] Light;
public Point[] Point;
public Object[] Object;
public Ambient[] Ambient;
public ObjectHRC[] ObjectHRC;
@@ -20,8 +22,6 @@ namespace KKdBaseLib.Auth3D
public PlayControl PlayControl;
public PostProcess? PostProcess;
public MaterialList[] MaterialList;
public ModelTransform[] Chara;
public ModelTransform[] Point;
public CameraAuxiliary? CameraAuxiliary;
}
@@ -36,8 +36,8 @@ namespace KKdBaseLib.Auth3D
public struct Ambient
{
public string Name;
public Vec4<Key>? LightDiffuse;
public Vec4<Key>? RimLightDiffuse;
public Vec4<Key?>? LightDiffuse;
public Vec4<Key?>? RimLightDiffuse;
}
public struct CameraAuxiliary
@@ -46,6 +46,7 @@ namespace KKdBaseLib.Auth3D
public Key? Exposure;
public Key? Saturate;
public Key? GammaRate;
public Key? ExposureRate;
public Key? AutoExposure;
}
@@ -57,10 +58,10 @@ namespace KKdBaseLib.Auth3D
public struct ViewPoint
{
public bool FOVHorizontal;
public float? Aspect;
public float? CameraApertureH;
public float? CameraApertureW;
public bool FOVIsHorizontal;
public float Aspect;
public float CameraApertureH;
public float CameraApertureW;
public Key FOV;
public Key Roll;
public Key FocalLength;
@@ -68,6 +69,12 @@ namespace KKdBaseLib.Auth3D
}
}
public struct Chara
{
public ModelTransform MT;
public string Name;
}
public struct Curve
{
public string Name;
@@ -82,12 +89,12 @@ namespace KKdBaseLib.Auth3D
public struct Event
{
public int? Type;
public float? End;
public float? Begin;
public float? ClipEnd;
public float? ClipBegin;
public float? TimeRefScale;
public int Type;
public float End;
public float Begin;
public float ClipEnd;
public float ClipBegin;
public float TimeRefScale;
public string Name;
public string Param1;
public string Ref;
@@ -95,11 +102,11 @@ namespace KKdBaseLib.Auth3D
public struct Fog
{
public int? Id;
public Key End;
public Key Start;
public Key Density;
public Vec4<Key>? Diffuse;
public int Id;
public Key? End;
public Key? Start;
public Key? Density;
public Vec4<Key?>? Color;
}
public enum CompressF16 : int
@@ -111,6 +118,7 @@ namespace KKdBaseLib.Auth3D
public enum EPType : int // Pre/Post Infinity
{
None = 0,
Linear = 1,
Cycle = 2,
CycleOffset = 3,
@@ -128,20 +136,18 @@ namespace KKdBaseLib.Auth3D
public struct Key
{
public KeyType Type;
public int Length;
public int? BinOffset;
public EPType EPTypePre;
public EPType EPTypePost;
public float? Max;
public float Value;
public RawD RawData;
public bool RawData;
public KFT3[] Keys;
public Key(A3DAKey k)
{
Type = 0;
Value = 0;
Length = 0;
BinOffset = null;
RawData = default;
Keys = null;
@@ -152,7 +158,6 @@ namespace KKdBaseLib.Auth3D
if (k.Length > 1)
{
Type = k.Type;
Length = (int)k.Length;
Keys = k.Keys;
}
else if (k.Length == 1)
@@ -161,25 +166,24 @@ namespace KKdBaseLib.Auth3D
Value = k.Keys[0].V;
}
}
public struct RawD
{
public int KeyType;
public int ValueListSize;
public string ValueType;
public string[] ValueList;
}
}
public struct Light
{
public int? Id;
public int Id;
public string Name;
public string Type;
public Vec4<Key>? Ambient;
public Vec4<Key>? Diffuse;
public Vec4<Key>? Specular;
public Vec4<Key>? Incandescence;
public Key? ConeAngle;
public Key? Constant;
public Key? DropOff;
public Key? Far;
public Key? Intensity;
public Key? Linear;
public Key? Quadratic;
public Vec4<Key?>? Ambient;
public Vec4<Key?>? Diffuse;
public Vec4<Key?>? Specular;
public Vec4<Key?>? ToneCurve;
public ModelTransform Position;
public ModelTransform SpotDirection;
}
@@ -187,23 +191,21 @@ namespace KKdBaseLib.Auth3D
public struct MaterialList
{
public string Name;
public string HashName;
public Key GlowIntensity;
public Vec4<Key>? BlendColor;
public Vec4<Key>? Incandescence;
public Key? GlowIntensity;
public Vec4<Key?>? BlendColor;
public Vec4<Key?>? Incandescence;
}
public struct MObjectHRC
{
public string Name;
public Node[] Node;
public Vec3<float?> JointOrient;
public ObjectNode[] Node;
public Instance[] Instances;
public ModelTransform MT;
public struct Instance
{
public bool? Shadow;
public bool Shadow;
public string Name;
public string UIDName;
public ModelTransform MT;
@@ -212,7 +214,6 @@ namespace KKdBaseLib.Auth3D
public struct ModelTransform
{
public bool Writed;
public int? BinOffset;
public Key Visibility;
public Vec3<Key> Rot;
@@ -220,17 +221,12 @@ namespace KKdBaseLib.Auth3D
public Vec3<Key> Trans;
}
public struct Node
{
public int? Parent;
public string Name;
public ModelTransform MT;
}
public struct Object
{
public int? MorphOffset;
public float PatOffset;
public float MorphOffset;
public string Name;
public string Pat;
public string Morph;
public string UIDName;
public string ParentName;
@@ -240,7 +236,7 @@ namespace KKdBaseLib.Auth3D
public struct TexturePattern
{
public int? PatOffset;
public float PatOffset;
public string Pat;
public string Name;
}
@@ -250,20 +246,31 @@ namespace KKdBaseLib.Auth3D
public string Name;
public Key? Rotate;
public Key? RotateFrame;
public Vec2<Key?> Offset;
public Vec2<Key?> Repeat;
public Vec2<Key?> Coverage;
public Vec2<Key?> TranslateFrame;
public Key? OffsetU;
public Key? OffsetV;
public Key? RepeatU;
public Key? RepeatV;
public Key? CoverageU;
public Key? CoverageV;
public Key? TranslateFrameU;
public Key? TranslateFrameV;
}
}
public struct ObjectHRC
{
public bool? Shadow;
public bool Shadow;
public string Name;
public string UIDName;
public Node[] Node;
public Vec3<float?> JointOrient;
public ObjectNode[] Node;
}
public struct ObjectNode
{
public Vec3? JointOrient;
public int Parent;
public string Name;
public ModelTransform MT;
}
public struct PlayControl
@@ -275,13 +282,19 @@ namespace KKdBaseLib.Auth3D
public int Size;
}
public struct Point
{
public ModelTransform MT;
public string Name;
}
public struct PostProcess
{
public Key? LensFlare;
public Key? LensGhost;
public Key? LensShaft;
public Vec4<Key>? Ambient;
public Vec4<Key>? Diffuse;
public Vec4<Key>? Specular;
public Vec4<Key?>? Intensity;
public Vec4<Key?>? Radius;
public Vec4<Key?>? SceneFade;
}
}
+3
View File
@@ -85,6 +85,9 @@ namespace KKdBaseLib.F2
private int length()
{
if (Array == null)
return 0;
int i, i0;
int length = 0x10;
for (i = 0; i < Array.Length; i++)
+3
View File
@@ -106,6 +106,9 @@ namespace KKdBaseLib.F2
private int length(bool shiftX = false)
{
if (Offsets.IsNull)
return 0;
int length = 4;
long offset = 0;
byte bitShift = (byte)(shiftX ? 3 : 2);
+10 -11
View File
@@ -2,7 +2,7 @@ using KKdBaseLib.Auth3D;
namespace KKdBaseLib.Interpolation
{
public class A3DAI : IInterpolation<float>, System.IDisposable //A3DA Interpolation
public class A3DAI : IInterpolation<float>, System.IDisposable // A3DA Interpolation
{
private A3DAKey a3daKey;
@@ -33,10 +33,10 @@ namespace KKdBaseLib.Interpolation
f = -df;
ResetFrameCount();
if (key.Keys != null && key.Length > 0)
if (key.Keys != null && key.Keys.Length > 0)
{
firstKey = key.Keys[0];
lastKey = key.Keys[key.Length - 1];
lastKey = key.Keys[key.Keys.Length - 1];
}
}
@@ -111,7 +111,6 @@ namespace KKdBaseLib.Interpolation
private float Interpolate(float frame)
{
float df = 0;
float ep = 0;
if (frame < firstKey.F)
@@ -119,7 +118,7 @@ namespace KKdBaseLib.Interpolation
if (a3daKey.EPTypePost < EPType.Linear || a3daKey.EPTypePost > EPType.CycleOffset)
return firstKey.V;
df = firstKey.F - frame;
float df = firstKey.F - frame;
if (a3daKey.EPTypePre == EPType.Linear)
return firstKey.V - df * firstKey.T1;
@@ -132,7 +131,7 @@ namespace KKdBaseLib.Interpolation
if (a3daKey.EPTypePost < EPType.Linear || a3daKey.EPTypePost > EPType.CycleOffset)
return lastKey.V;
df = frame - lastKey.F;
float df = frame - lastKey.F;
if (a3daKey.EPTypePost == EPType.Linear)
return lastKey.V + df * lastKey.T2;
@@ -165,17 +164,17 @@ namespace KKdBaseLib.Interpolation
float v;
if (frame <= c.F || frame >= n.F)
v = frame > c.F ? n.V : c.V;
else if (a3daKey.Type == KeyType.Linear || (a3daKey.Type == KeyType.Hermite && n.T1 == c.T2 && n.T1 == 0.0f))
else if (a3daKey.Type == KeyType.Linear)
{
float t = (frame - c.F) / (n.F - c.F);
v = (1.0f - t) * c.V + t * n.V;
}
else if (a3daKey.Type == KeyType.Hermite)
{
float t = (frame - c.F) / (n.F - c.F);
float t_2 = (1.0f - t) * (1.0f - t);
v = t_2 * c.V * (1.0f + 2.0f * t) + (t * n.V * (3.0f - 2.0f * t) +
(t_2 * c.T2 + t * (t - 1.0f) * n.T1) * (n.F - c.F)) * t;
float df = f - c.F;
float t = df / (n.F - c.F);
float t_1 = t - 1.0f;
return c.V + t * t * (3.0f - 2.0f * t) * (n.V - c.V) + (t_1 * c.T2 + t * n.T1) * df * t_1;
}
else v = c.V;
return v + ep;
@@ -1,6 +1,6 @@
namespace KKdBaseLib.Interpolation
{
public class PDI : IInterpolation<float> //Project DIVA Interpolation
public class MOTI : IInterpolation<float> // MOT Interpolation
{
private KFT2[] array;
private int length;
@@ -23,7 +23,7 @@ namespace KKdBaseLib.Interpolation
public bool IsNull => array == null || array.Length < 1;
public bool NotNull => array != null && array.Length > 0;
public PDI(KFT2[] array, float interpolationFramerate = 60, float requestedFramerate = 60)
public MOTI(KFT2[] array, float interpolationFramerate = 60, float requestedFramerate = 60)
{
length = 0;
this.array = array; f = -1; df = @if = rf = t = v = 0;
@@ -114,17 +114,12 @@ namespace KKdBaseLib.Interpolation
float v;
if (frame <= c.F || frame >= n.F)
v = frame > c.F ? n.V : c.V;
else if (n.T == c.T && n.T == 0.0f)
{
float t = (frame - c.F) / (n.F - c.F);
v = (1.0f - t) * c.V + t * n.V;
}
else
{
float t = (frame - c.F) / (n.F - c.F);
float df = f - c.F;
float t = df / (n.F - c.F);
float t_1 = t - 1.0f;
v = (t_1 * 2.0f - 1.0f) * (c.V - n.V) * t * t +
(t_1 * c.T + t * n.T) * t_1 * (frame - c.F) + c.V;
return c.V + t * t * (3.0f - 2.0f * t) * (n.V - c.V) + (t_1 * c.T + t * n.T) * df * t_1;
}
return v;
}
+5 -3
View File
@@ -70,7 +70,7 @@ namespace KKdBaseLib
new KFT3(F, V);
public IKF Check() =>
V == 0 ? (KFT0)this : (IKF)this;
V.ToU32() == 0x00000000 ? (KFT0)this : (IKF)this;
public override string ToString() => ToString(true, 7);
public string ToString(int round = 7, bool brackets = true) =>
@@ -135,7 +135,7 @@ namespace KKdBaseLib
new KFT3(F, V, T, T);
public IKF Check() =>
T == 0 ? (V == 0 ? (IKF)ToT0() : ToT1()) : this;
T.ToU32() == 0x00000000 ? (V.ToU32() == 0x00000000 ? (IKF)ToT0() : ToT1()) : this;
public override string ToString() => ToString(true, 7);
public string ToString(int round = 7, bool brackets = true) =>
@@ -199,7 +199,9 @@ namespace KKdBaseLib
public KFT3 ToT3() => this;
public IKF Check() =>
T1 == 0 && T2 == 0 ? (V == 0 ? (IKF)(KFT0)this : (KFT1)this) : T1 == T2 ? (KFT2)this : (IKF)this;
T1.ToU32() == 0x00000000 && T2.ToU32() == 0x00000000
? (V.ToU32() == 0x00000000 ? (IKF)(KFT0)this : (KFT1)this)
: T1.ToU32() == T2.ToU32() ? (KFT2)this : (IKF)this;
public override string ToString() => ToString(true, 7);
public string ToString(int round = 7, bool brackets = true) =>
+4 -4
View File
@@ -6,12 +6,12 @@
<Configuration></Configuration>
<Copyright>korenkonder (C) 2019-2021</Copyright>
<Description>A base library</Description>
<FileVersion>0.4.9.11</FileVersion>
<FileVersion>0.4.10.7</FileVersion>
<PackageId>KKdBaseLib</PackageId>
<Product>KKdBaseLib</Product>
<TargetFramework>net461</TargetFramework>
<Title>KKdBaseLib</Title>
<Version>0.4.9.11</Version>
<Version>0.4.10.7</Version>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
@@ -24,7 +24,7 @@
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>8.0</LangVersion>
<NoWarn>IDE0004, IDE0018, IDE0032, IDE0044, IDE0045, IDE0046, IDE0055, IDE0059, IDE0066, IDE0069, IDE1006</NoWarn>
<NoWarn>IDE0004, IDE0018, IDE0032, IDE0044, IDE0045, IDE0046, IDE0051, IDE0055, IDE0059, IDE0063, IDE0066, IDE0069, IDE1006</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
@@ -37,7 +37,7 @@
<DebugSymbols>true</DebugSymbols>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>8.0</LangVersion>
<NoWarn>IDE0004, IDE0018, IDE0032, IDE0044, IDE0045, IDE0046, IDE0055, IDE0059, IDE0066, IDE0069, IDE1006</NoWarn>
<NoWarn>IDE0004, IDE0018, IDE0032, IDE0044, IDE0045, IDE0046, IDE0051, IDE0055, IDE0059, IDE0063, IDE0066, IDE0069, IDE1006</NoWarn>
</PropertyGroup>
<ItemGroup>
<Reference Include="System.Windows.Forms" />
+7 -1
View File
@@ -27,7 +27,13 @@ namespace KKdBaseLib
{
this.keyArray = null; this.valArray = null; count = 0; index = 0;
if (keyArray == null || valArray == null || keyArray.Length != valArray.Length) return;
count = valArray.Length; this.keyArray = keyArray; this.valArray = valArray; }
count = this.keyArray.Length;
this.keyArray = new TKey [count];
this.valArray = new TValue[count];
System.Array.Copy(keyArray, this.keyArray, count);
System.Array.Copy(valArray, this.valArray, count);
}
public KeyValuePair<TKey, TValue> Current => index < count ?
new KeyValuePair<TKey, TValue>(keyArray[index], valArray[index]) : default;
+15 -1
View File
@@ -26,7 +26,21 @@ namespace KKdBaseLib
public KKdList(T[] array)
{ index = -1; count = array.Length; this.array = array; enumerator = new Enumerator(this.array); }
{
index = -1;
if (array != null)
{
count = array.Length;
this.array = new T[count];
System.Array.Copy(array, this.array, count);
}
else
{
count = 0;
this.array = null;
}
enumerator = new Enumerator(this.array);
}
public T Current => index > -1 && index < Count ? array[index] : default;
+43 -11
View File
@@ -45,7 +45,6 @@ namespace KKdBaseLib
{
if (dict == null || args.Length < 1) return false;
args[0] = args[0].ToLower();
if (args.Length > 1)
{
string[] newArgs = new string[args.Length - 1];
@@ -60,7 +59,16 @@ namespace KKdBaseLib
dict.FV(out string val, args.Split(split)) && bool.TryParse(val, out value);
public static bool FV (this A3DADict dict, ref int value, char split, string args) =>
dict.FV(out string val, args.Split(split)) && int.TryParse(val, out value);
dict.FV(out string val, args.Split(split)) && int.TryParse(val, out value);
public static bool FV (this A3DADict dict, ref uint value, char split, string args) =>
dict.FV(out string val, args.Split(split)) && uint.TryParse(val, out value);
public static bool FV (this A3DADict dict, ref long value, char split, string args) =>
dict.FV(out string val, args.Split(split)) && long.TryParse(val, out value);
public static bool FV (this A3DADict dict, ref ulong value, char split, string args) =>
dict.FV(out string val, args.Split(split)) && ulong.TryParse(val, out value);
public static bool FV (this A3DADict dict, ref float value, char split, string args) =>
dict.FV(out string val, args.Split(split)) && val.ToF32(out value);
@@ -74,11 +82,23 @@ namespace KKdBaseLib
public static bool FV (this A3DADict dict, out bool value, string args)
{ if (dict.FV(out string val , args.Split('.' )))
return bool.TryParse(val, out value); value = false; return false; }
return bool.TryParse(val, out value); value = false; return false; }
public static bool FV (this A3DADict dict, out int value, string args)
{ if (dict.FV(out string val , args.Split('.' )))
return int.TryParse(val, out value); value = 0; return false; }
return int.TryParse(val, out value); value = 0; return false; }
public static bool FV (this A3DADict dict, out uint value, string args)
{ if (dict.FV(out string val , args.Split('.' )))
return uint.TryParse(val, out value); value = 0; return false; }
public static bool FV (this A3DADict dict, out long value, string args)
{ if (dict.FV(out string val , args.Split('.' )))
return long.TryParse(val, out value); value = 0; return false; }
public static bool FV (this A3DADict dict, out ulong value, string args)
{ if (dict.FV(out string val , args.Split('.' )))
return ulong.TryParse(val, out value); value = 0; return false; }
public static bool FV (this A3DADict dict, out float value, string args)
{ if (dict.FV(out string val , args.Split('.' )))
@@ -88,14 +108,29 @@ namespace KKdBaseLib
{ if (dict.FV(out string val , args.Split('.' )))
return val.ToF64(out value); value = 0; return false; }
public static bool FV<T>(this A3DADict dict, out T value, string args) where T : struct
public static bool FV<T>(this A3DADict dict, out T value, string args) where T : struct, Enum
{ if (dict.FV(out string val , args.Split('.' )))
{ bool Val = Enum.TryParse(val, out T _value); value = _value; return Val; }
value = default; return false; }
public static bool FV (this A3DADict dict, out int? value, string args)
{ if (dict.FV(out string val , args.Split('.' )))
{ bool Val = int.TryParse(val, out int _value); value = _value; return Val; }
{ bool Val = int.TryParse(val, out int _value); value = _value; return Val; }
value = null; return false; }
public static bool FV (this A3DADict dict, out uint? value, string args)
{ if (dict.FV(out string val , args.Split('.' )))
{ bool Val = uint.TryParse(val, out uint _value); value = _value; return Val; }
value = null; return false; }
public static bool FV (this A3DADict dict, out long? value, string args)
{ if (dict.FV(out string val , args.Split('.' )))
{ bool Val = long.TryParse(val, out long _value); value = _value; return Val; }
value = null; return false; }
public static bool FV (this A3DADict dict, out ulong? value, string args)
{ if (dict.FV(out string val , args.Split('.' )))
{ bool Val = ulong.TryParse(val, out ulong _value); value = _value; return Val; }
value = null; return false; }
public static bool FV (this A3DADict dict, out float? value, string args)
@@ -119,7 +154,6 @@ namespace KKdBaseLib
value = null;
if (dict == null || args.Length < 1) return false;
args[0] = args[0].ToLower();
if (!dict.ContainsKey(args[0])) return false;
else if (args.Length > 1)
{
@@ -172,7 +206,6 @@ namespace KKdBaseLib
if (dict == null) dict = new A3DADict();
else if (args.Length < 1) return;
args[0] = args[0].ToLower();
if (args.Length > 1)
{
string[] newArgs = new string[args.Length - 1];
@@ -223,9 +256,8 @@ namespace KKdBaseLib
{
m /= 10;
j /= 10;
sort[i++] = ++j;
if (j * 10 >= length)
j++;
while (j % 10 == 9) j /= 10;
j++;
}
else if (j % 10 != 9)
sort[i++] = j++;
+1013 -753
View File
File diff suppressed because it is too large Load Diff
-146
View File
@@ -1,146 +0,0 @@
using KKdBaseLib;
using KKdMainLib.IO;
namespace KKdMainLib
{
public unsafe struct AddParam : System.IDisposable
{
private long i;
private Stream s;
public HeaderData Header;
public void AddParamReader(string file)
{
Header = new HeaderData();
s = File.OpenReader(file + ".adp");
Header.Count = s.RI64();
Header.DataLength = s.RI64();
Header.DataOffset = s.RI64();
if (Header.Count < 1 || Header.DataOffset > s.P || Header.DataLength > s.LI64
- Header.DataOffset || Header.Count * 0x20 > s.LI64 - Header.DataOffset) { s.C(); return; }
Header.Data = new HeaderData.Sub[Header.Count];
byte[] data = s.RBy(Header.DataLength, Header.DataOffset);
s.C();
fixed (byte* ptr = data)
{
HeaderData.Sub* hPtr = (HeaderData.Sub*)ptr;
for (i = 0; i < Header.Count; i++)
Header.Data[i] = hPtr[i];
}
data = null;
}
public void AddParamWriter(string file)
{
if (Header.Data == null || Header.Data.LongLength < 1) return;
Header.Count = Header.Data.LongLength;
Header.DataLength = Header.Count * 0x20;
Header.DataOffset = 0x18L;
byte[] data = new byte[Header.DataLength];
fixed (byte* ptr = data)
{
HeaderData.Sub* hPtr = (HeaderData.Sub*)ptr;
for (i = 0; i < Header.Count; i++)
hPtr[i] = Header.Data[i];
}
s = File.OpenWriter(file + ".adp", true);
s.W(Header.Count);
s.W(Header.DataLength);
s.W(Header.DataOffset);
s.W(data);
s.C();
data = null;
}
public void MsgPackReader(string file, bool json)
{
Header = new HeaderData();
MsgPack addParam;
MsgPack msgPack = file.ReadMPAllAtOnce(json);
if ((addParam = msgPack["AddParam", true]).IsNull) return;
Header.Count = addParam.Array.LongLength;
Header.Data = new HeaderData.Sub[Header.Count];
for (i = 0; i < Header.Count; i++)
{
ref HeaderData.Sub sub = ref Header.Data[i];
sub.Time = addParam[i].RF32("Time");
sub.Flags = addParam[i].RI32("Flags");
sub.Frame = addParam[i].RI32("Frame");
sub.ID = addParam[i].RI32("ID");
sub.Value = addParam[i].RF32("Value");
sub.PVBranch = addParam[i].RnI32("PVBranch") ?? 0;
float? f = addParam[i].RnF32("Value");
if (f.HasValue)
{
if (sub.ID == 0) { float v = 0; *(uint*)&v = addParam[i].RU32("Value"); sub.Value = v; }
else sub.Value = f.Value;
}
else { float v = 0; *(uint*)&v = 0xFFFFFFFF; sub.Value = v; }
}
msgPack.Dispose();
}
public void MsgPackWriter(string file, bool json)
{
if (Header.Data == null || Header.Data.LongLength < 1) return;
MsgPack addParam = new MsgPack(Header.Data.LongLength, "AddParam");
fixed (HeaderData.Sub* ptr = Header.Data)
for (i = 0; i < Header.Count; i++)
{
ref HeaderData.Sub sub = ref Header.Data[i];
addParam[i] = MsgPack.New.Add("Time", sub.Time).Add("Flags", sub.Flags).Add("Frame", sub.Frame);
if (sub.PVBranch > 0)
addParam[i] = addParam[i].Add("PVBranch", sub.PVBranch);
addParam[i] = addParam[i].Add("ID", sub.ID);
if (sub.ID == 0)
addParam[i] = addParam[i].Add("Value", *(uint*)&ptr[i].Value);
else if (*(uint*)&ptr[i].Value != 0xFFFFFFFF)
addParam[i] = addParam[i].Add("Value", sub.Value);
}
addParam.WriteAfterAll(false, true, file, json);
}
public void Dispose()
{ if (s != null) s.D(); s = null; Header = default; }
public struct HeaderData
{
public long Count;
public long DataLength;
public long DataOffset;
public Sub[] Data;
public struct Sub
{
public float Time;
public int Flags;
public int Frame;
public int Pad0C;
public int PVBranch;
public int ID;
public float Value;
public int Pad1C;
}
}
}
}
+1 -1
View File
@@ -753,7 +753,7 @@ namespace KKdMainLib
rootLayer[i0] = WL(ref aet.Composition[i].E[i0]);
msgPack.Add(rootLayer);
if (aet.Composition[i].C > 1)
if (aet.Composition.C > 1)
{
MsgPack compositions = new MsgPack(aet.Composition.C - 1, "Composition");
for (i = 0; i < aet.Composition.C - 1; i++)
+12 -5
View File
@@ -131,7 +131,7 @@ namespace KKdMainLib
else @struct.POF .Read(Data, sig == 0x31464F50);
}
else if (header.Depth == 0 && sig == 0x43505854)
subStructs.Add(new Struct { Header = header, DataOffset = stream.P, Data = stream.RBy(l) });
subStructs.Add(stream.RSt(header));
else if (header.Depth > depth) subStructs.Add(stream.RSt(header));
else { stream.PI64 -= header.Length; break; }
lastSig = sig;
@@ -248,7 +248,10 @@ 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
{
int i = 0;
@@ -256,9 +259,13 @@ namespace KKdMainLib
while (i < length)
{ hash = 0x100000001B3 * (hash ^ (ulong)array[i]); i++; }
return (hash >> 32) ^ hash;
}
}
public static uint HashMurmurHash(this byte[] array, uint salt = 0,
bool alreadyUpper = false, bool bigEndian = false) =>
array.HashMurmurHash(array.Length, salt, alreadyUpper, bigEndian);
public static uint HashMurmurHash(this byte[] array, int length, uint seed = 0,
public static uint HashMurmurHash(this byte[] array, int length, uint salt = 0,
bool alreadyUpper = false, bool bigEndian = false) // 0x814D7A9C in PCSB00554; MurmurHash
{
uint a, b, hash;
@@ -267,7 +274,7 @@ namespace KKdMainLib
const uint m = 0x7FD652AD;
const int r = 16;
hash = seed + 0xDEADBEEF;
hash = salt + 0xDEADBEEF;
if (alreadyUpper)
{
if (bigEndian)
+2 -2
View File
@@ -227,8 +227,8 @@ namespace KKdMainLib
using (Stream headerWriter = File.OpenWriter())
{
if (Signature == Farc.FArc) headerWriter.WE(0x20, true);
else if (Signature == Farc.FArC) headerWriter.WE(0x10, true);
if (Signature == Farc.FArc) headerWriter.WE(0x01, true);
else if (Signature == Farc.FArC) headerWriter.WE(0x01, true);
else if (Signature == Farc.FARC)
{
headerWriter.WE((int)FARCType, true);
+7 -10
View File
@@ -66,22 +66,22 @@ namespace KKdMainLib.IO
}
public static long RIX(this Stream stream ) =>
stream.IsX ? stream.RI64() : stream.RI32E( );
stream.IsX ? stream.RI64E( ) : stream.RI32E( );
public static long RIX(this Stream stream, bool isBE) =>
stream.IsX ? stream.RI64() : stream.RI32E(isBE);
stream.IsX ? stream.RI64E(isBE) : stream.RI32E(isBE);
public static void WX(this Stream stream, long val, ref POF pof)
{ if (stream.IsX) stream.W ( val);
{ if (stream.IsX) stream.WE( val);
else stream.WE((int)val); pof.Offsets.Add(stream.P); }
public static void WX(this Stream stream, long val, ref POF pof, bool isBE)
{ if (stream.IsX) stream.W ( val );
{ if (stream.IsX) stream.WE( val, isBE);
else stream.WE((int)val, isBE); pof.Offsets.Add(stream.P); }
public static void WX(this Stream stream, long val)
{ if (stream.IsX) stream.W ( val);
{ if (stream.IsX) stream.WE( val);
else stream.WE((int)val); }
public static void WX(this Stream stream, long val, bool isBE)
{ if (stream.IsX) stream.W ( val );
{ if (stream.IsX) stream.WE( val, isBE);
else stream.WE((int)val, isBE); }
public static byte[] RaO(this Stream stream, long offset = -1, long length = -1)
@@ -111,9 +111,6 @@ namespace KKdMainLib.IO
public static string RSaO(this Stream stream, long offset)
{
if (offset < 1)
return "";
long position = stream.PI64;
stream.PI64 = offset;
string s = stream.NTUTF8();
@@ -123,7 +120,7 @@ namespace KKdMainLib.IO
public static string RSaO(this Stream stream, long offset, long length)
{
if (offset < 1 || length < 1)
if (length < 1)
return "";
long position = stream.PI64;
+10 -3
View File
@@ -131,15 +131,19 @@ namespace KKdMainLib.IO
private object RF()
{
string s = " ";
string s = "";
_IO.SW();
if (_IO.PCUTF8() == '-') s += _IO.RCUTF8();
bool negative = false;
if (_IO.PCUTF8() == '-') { _IO.RCUTF8(); negative = true; }
if (_IO.PCUTF8() == '0') s += _IO.RCUTF8();
else s += RD ();
char c = _IO.PCUTF8();
if (c == '.') s += _IO.RCUTF8() + RD();
else if (negative && s == "0")
return (float)-0.0f;
else if (c != 'e' && c != 'E')
{
if (negative) s = "-" + s;
long val;
try { val = long.Parse(s); }
catch { return ulong.Parse(s); }
@@ -161,7 +165,10 @@ namespace KKdMainLib.IO
s += RD();
}
double d = s.ToF64();
return (float)d == d ? (float)d : d;
if ((float)d == d)
return negative ? (((float)d).ToU32() | 0x80000000).ToF32() : (float)d;
else
return negative ? (d.ToU64() | 0x8000000000000000).ToF64() : d;
}
private bool RBo()
+5 -5
View File
@@ -5,13 +5,13 @@
<Company></Company>
<Configuration></Configuration>
<Copyright>korenkonder (C) 2018-2021</Copyright>
<Description>A simple library for working with Project Diva AC/DT/F/AFT/F2/X/FT/M39 files</Description>
<FileVersion>0.4.9.11</FileVersion>
<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>
<PackageId>KKdMainLib</PackageId>
<Product>KKdMainLib</Product>
<TargetFramework>net461</TargetFramework>
<Title>KKdMainLib</Title>
<Version>0.4.9.11</Version>
<Version>0.4.10.7</Version>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
@@ -24,7 +24,7 @@
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>8.0</LangVersion>
<NoWarn>IDE0004, IDE0018, IDE0032, IDE0044, IDE0045, IDE0046, IDE0055, IDE0059, IDE0066, IDE0069, IDE1006</NoWarn>
<NoWarn>IDE0004, IDE0018, IDE0032, IDE0044, IDE0045, IDE0046, IDE0051, IDE0055, IDE0059, IDE0063, IDE0066, IDE0069, IDE1006</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
@@ -37,7 +37,7 @@
<DebugSymbols>true</DebugSymbols>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>8.0</LangVersion>
<NoWarn>IDE0004, IDE0018, IDE0032, IDE0044, IDE0045, IDE0046, IDE0055, IDE0059, IDE0066, IDE0069, IDE1006</NoWarn>
<NoWarn>IDE0004, IDE0018, IDE0032, IDE0044, IDE0045, IDE0046, IDE0051, IDE0055, IDE0059, IDE0063, IDE0066, IDE0069, IDE1006</NoWarn>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\KKdBaseLib\KKdBaseLib.csproj" />
+3 -3
View File
@@ -371,9 +371,9 @@ namespace KKdMainLib
public enum KeySetType : byte
{
None = 0b00,
Static = 0b01,
Linear = 0b10,
None = 0b00,
Static = 0b01,
Linear = 0b10,
Tangent = 0b11,
}
}
Binary file not shown.
+2 -2
View File
@@ -24,7 +24,7 @@
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>8.0</LangVersion>
<NoWarn>IDE0004, IDE0018, IDE0032, IDE0044, IDE0045, IDE0046, IDE0055, IDE0059, IDE0066, IDE0069, IDE1006</NoWarn>
<NoWarn>IDE0004, IDE0018, IDE0032, IDE0044, IDE0045, IDE0046, IDE0051, IDE0055, IDE0059, IDE0063, IDE0066, IDE0069, IDE1006</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
@@ -37,7 +37,7 @@
<DebugSymbols>true</DebugSymbols>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>8.0</LangVersion>
<NoWarn>IDE0004, IDE0018, IDE0032, IDE0044, IDE0045, IDE0046, IDE0055, IDE0059, IDE0066, IDE0069, IDE1006</NoWarn>
<NoWarn>IDE0004, IDE0018, IDE0032, IDE0044, IDE0045, IDE0046, IDE0051, IDE0055, IDE0059, IDE0063, IDE0066, IDE0069, IDE1006</NoWarn>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\KKdBaseLib\KKdBaseLib.csproj" />
+2 -3
View File
@@ -23,7 +23,7 @@
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>8.0</LangVersion>
<NoWarn>IDE0004, IDE0018, IDE0032, IDE0044, IDE0045, IDE0046, IDE0055, IDE0059, IDE0066, IDE0069, IDE1006</NoWarn>
<NoWarn>IDE0004, IDE0018, IDE0032, IDE0044, IDE0045, IDE0046, IDE0051, IDE0055, IDE0059, IDE0063, IDE0066, IDE0069, IDE1006</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
@@ -36,11 +36,10 @@
<DebugSymbols>true</DebugSymbols>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>8.0</LangVersion>
<NoWarn>IDE0004, IDE0018, IDE0032, IDE0044, IDE0045, IDE0046, IDE0055, IDE0059, IDE0066, IDE0069, IDE1006</NoWarn>
<NoWarn>IDE0004, IDE0018, IDE0032, IDE0044, IDE0045, IDE0046, IDE0051, IDE0055, IDE0059, IDE0063, IDE0066, IDE0069, IDE1006</NoWarn>
</PropertyGroup>
<ItemGroup>
<Compile Include="classes\A3D.cs" />
<Compile Include="classes\ADP.cs" />
<Compile Include="classes\AET.cs" />
<Compile Include="classes\BLT.cs" />
<Compile Include="classes\CCT.cs" />
+20 -24
View File
@@ -61,7 +61,7 @@ namespace PD_Tool
ConsoleDesign("5. DB_Tools");
ConsoleDesign("6. AC/DT/F/AFT Converting Tools");
ConsoleDesign("7. F/F2/FT Converting Tools");
ConsoleDesign("8. X/XHD Converting Tools");
ConsoleDesign("8. X/XHD/VRFL Converting Tools");
ConsoleDesign("9. FT/M39 Converting Tools");
ConsoleDesign(json ? "A. MsgPack to JSON" : "A. JSON to MsgPack");
ConsoleDesign(false);
@@ -179,7 +179,7 @@ namespace PD_Tool
if (choose.Length == 1)
{
Console.Clear();
Console.Title = "X/XHD Converting Tools";
Console.Title = "X/XHD/VRFL Converting Tools";
ConsoleDesign(true);
ConsoleDesign(" Choose converter:");
ConsoleDesign(false);
@@ -218,14 +218,13 @@ namespace PD_Tool
ConsoleDesign(" Choose converter:");
ConsoleDesign(false);
ConsoleDesign("1. A3DA" );
ConsoleDesign("2. AddParam");
ConsoleDesign("3. AET" );
ConsoleDesign("4. DEX" );
ConsoleDesign("5. DIVA" );
ConsoleDesign("6. MotHead" );
ConsoleDesign("7. MOT" );
ConsoleDesign("8. STR" );
ConsoleDesign("9. Table" );
ConsoleDesign("2. AET" );
ConsoleDesign("3. DEX" );
ConsoleDesign("4. DIVA" );
ConsoleDesign("5. MotHead" );
ConsoleDesign("6. MOT" );
ConsoleDesign("7. STR" );
ConsoleDesign("8. Table" );
ConsoleDesign(false);
ConsoleDesign("R. Return to Main Menu");
ConsoleDesign(false);
@@ -235,14 +234,13 @@ namespace PD_Tool
}
else localChoose = choose[1].ToString();
if (localChoose == "1") A3D.Processor(json);
else if (localChoose == "2") ADP.Processor(json);
else if (localChoose == "3") AET.Processor(json);
else if (localChoose == "4") DEX.Processor(json);
else if (localChoose == "5") DIV.Processor();
else if (localChoose == "6") MHD.Processor(json);
else if (localChoose == "7") MOT.Processor(json);
else if (localChoose == "8") STR.Processor(json);
else if (localChoose == "9") TBL.Processor(json);
else if (localChoose == "2") AET.Processor(json);
else if (localChoose == "3") DEX.Processor(json);
else if (localChoose == "4") DIV.Processor();
else if (localChoose == "5") MHD.Processor(json);
else if (localChoose == "6") MOT.Processor(json);
else if (localChoose == "7") STR.Processor(json);
else if (localChoose == "8") TBL.Processor(json);
else choose = localChoose;
}
else if (choose[0] == 'A')
@@ -312,8 +310,6 @@ namespace PD_Tool
string Filter = GetArgs("All", false, "*");
if (filetype == "a3da") Filter = GetArgs("A3DA", "a3da", "farc", "json", "mp") +
GetArgs("A3DA", true, "a3da") + GetArgs("FARC", true, "farc") + json + mp;
else if (filetype == "adp" ) Filter = GetArgs("ADP" , "adp", "json", "mp") +
GetArgs("ADP", true, "adp" ) + json + mp;
else if (filetype == "bin" ) Filter = GetArgs("BIN" , "bin", "json", "mp") +
bin + json + mp;
else if (filetype == "blt" ) Filter = GetArgs("BLT" , "blt", "json", "mp") +
@@ -350,15 +346,15 @@ namespace PD_Tool
else if (filetype == "vag" ) Filter = GetArgs("VAG" , "vag", "wav") +
GetArgs("VAG", true, "vag") + wav;
using OpenFileDialog ofd = new OpenFileDialog { InitialDirectory = Application.StartupPath,
Filter = Filter, Multiselect = true, Title = "Choose file(s) to open:" };
using OpenFileDialog ofd = new OpenFileDialog { Filter = Filter,
Multiselect = true, Title = "Choose file(s) to open:" };
if (ofd.ShowDialog() == DialogResult.OK) FileNames = ofd.FileNames;
}
else if (code == 2)
{
string Return = "";
using (OpenFileDialog ofd = new OpenFileDialog { InitialDirectory = Application.StartupPath,
ValidateNames = false, CheckFileExists = false, Filter = " | ", CheckPathExists = true,
using (OpenFileDialog ofd = new OpenFileDialog { ValidateNames = false,
CheckFileExists = false, Filter = " | ", CheckPathExists = true,
Title = "Choose any file in folder:", FileName = "Folder Selection." })
if (ofd.ShowDialog() == DialogResult.OK) Return = Path.GetDirectoryName(ofd.FileName);
return Return;
+3 -3
View File
@@ -2,7 +2,7 @@ using System.Reflection;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("PD_Tool")]
[assembly: AssemblyDescription("A simple tool for working with Project Diva AC/DT/F/AFT/F2/X/FT/M39 files")]
[assembly: AssemblyDescription("A simple tool for working with Project Diva AC/DT/F/AFT/F2/X/XHD/FT/VRFL/M39 files")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("PD_Tool")]
@@ -11,5 +11,5 @@ using System.Runtime.InteropServices;
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: Guid("7B5D5A3A-A6F8-4813-C97D-ACFC98F7397E")]
[assembly: AssemblyVersion("0.4.9.11")]
[assembly: AssemblyFileVersion("0.4.9.11")]
[assembly: AssemblyVersion("0.4.10.7")]
[assembly: AssemblyFileVersion("0.4.10.7")]
+26 -19
View File
@@ -24,6 +24,9 @@ namespace PD_Tool
Program.ConsoleDesign(true);
Program.ConsoleDesign(" Choose type of format to export:");
Program.ConsoleDesign(false);
Program.ConsoleDesign(" Tip: A3DC Opt - A3DC Optimization");
Program.ConsoleDesign(" WARNING! CHECK RESULTS AFTER CONVERTING ");
Program.ConsoleDesign(false);
Program.ConsoleDesign("1. A3DA [DT/AC/F]");
Program.ConsoleDesign("2. A3DC [DT/AC/F]");
Program.ConsoleDesign("3. A3DA [AFT/FT/M39]");
@@ -31,19 +34,21 @@ namespace PD_Tool
Program.ConsoleDesign("5. A3DC [F2]");
Program.ConsoleDesign("6. A3DC [MGF]");
Program.ConsoleDesign("7. A3DC [X]");
if (!mp) Program.ConsoleDesign($"8. {(json ? "JSON" : "MsgPack")}");
Program.ConsoleDesign("8. A3DC [XHD/VRFL]");
if (!mp) Program.ConsoleDesign($"9. {(json ? "JSON" : "MsgPack")}");
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.NULL;
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;
else return;
int state;
@@ -60,26 +65,26 @@ namespace PD_Tool
using (farc = new KKdFARC(file))
FARCProcessor(farc, choose, format);
else if (ext == ".a3da")
using (a3da = new KKdA3DA(true))
using (a3da = new KKdA3DA())
{
state = a3da.A3DAReader(filepath);
if (state == 1)
if (choose == "8") a3da.MsgPackWriter(filepath, json);
if (choose == "F") a3da.MsgPackWriter(filepath, json);
else
{
a3da.Head.Format = format;
File.WriteAllBytes(filepath + ".a3da", (choose == "1" ||
choose == "3") ? a3da.A3DAWriter() : a3da.A3DCWriter());
choose == "4") ? a3da.A3DAWriter() : a3da.A3DCWriter());
}
}
else if (ext == ".mp" || ext == ".json")
using (a3da = new KKdA3DA(true))
using (a3da = new KKdA3DA())
{
a3da.MsgPackReader(filepath, ext == ".json");
a3da.Head.Format = format;
File.WriteAllBytes(filepath + ".a3da", (choose == "1" ||
choose == "3") ? a3da.A3DAWriter() : a3da.A3DCWriter());
choose == "4") ? a3da.A3DAWriter() : a3da.A3DCWriter());
}
}
}
@@ -105,7 +110,7 @@ namespace PD_Tool
{
KKdA3DA a3da;
for (int i = 0; i < A3DAlist.Count; i++)
using (a3da = new KKdA3DA(true))
using (a3da = new KKdA3DA())
{
data = farc.FileReader(A3DAlist[i]);
int state = a3da.A3DAReader(data);
@@ -113,7 +118,8 @@ namespace PD_Tool
{
KKdFARC.FARCFile file = farc.Files[i];
a3da.Head.Format = format;
file.Data = (choose == "1"|| choose == "3") ? a3da.A3DAWriter() : a3da.A3DCWriter();
file.Data = (choose == "1"|| choose == "4")
? a3da.A3DAWriter() : a3da.A3DCWriter();
farc.Files[i] = file;
}
}
@@ -127,7 +133,7 @@ namespace PD_Tool
for (int i = 0; i < list.Count; i++)
{
KKdA3DA a3da;
using (a3da = new KKdA3DA(true))
using (a3da = new KKdA3DA())
{
data = farc.FileReader(list[i]);
int state = a3da.A3DAReader(data);
@@ -145,7 +151,7 @@ namespace PD_Tool
string ext = Path.GetExtension(list[i]).ToLower();
KKdA3DA a3da;
for (int i1 = 1; i1 < div; i1++)
using (a3da = new KKdA3DA(true))
using (a3da = new KKdA3DA())
{
string file = filename + "_div_" + i1 + ext;
data = farc.FileReader(file);
@@ -162,7 +168,8 @@ namespace PD_Tool
KKdFARC.FARCFile file = default;
file.Name = list[i];
a3daArray[i].Head.Format = format;
file.Data = (choose == "1" || choose == "3") ? a3daArray[i].A3DAWriter() : a3daArray[i].A3DCWriter();
file.Data = (choose == "1" || choose == "4")
? a3daArray[i].A3DAWriter() : a3daArray[i].A3DCWriter();
farc.Files.Add(file);
}
farc.Save();
-37
View File
@@ -1,37 +0,0 @@
using System;
using KKdMainLib;
using KKdMainLib.IO;
namespace PD_Tool
{
public class ADP
{
public static void Processor(bool json)
{
Console.Title = "Add Param Converter";
Program.Choose(1, "adp", out string[] fileNames);
if (fileNames.Length < 1) return;
string filepath, ext;
AddParam adp;
foreach (string file in fileNames)
using (adp = new AddParam())
{
filepath = Path.RemoveExtension(file);
ext = Path.GetExtension(file).ToLower();
Console.Title = "Add Param Converter: " + Path.GetFileNameWithoutExtension(file);
if (ext == ".adp")
{
adp.AddParamReader(filepath);
adp. MsgPackWriter(filepath, json);
}
else if (ext == ".mp" || ext == ".json")
{
adp. MsgPackReader(filepath, ext == ".json");
adp.AddParamWriter(filepath);
}
}
}
}
}