v0.4.10.2

A3DA
This commit is contained in:
korenkonder
2021-05-22 14:13:54 +03:00
parent 30a51f6bc4
commit 6c35326dda
10 changed files with 565 additions and 617 deletions
+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
{
+16 -16
View File
@@ -36,8 +36,8 @@ namespace KKdBaseLib.Auth3D
public struct Ambient
{
public string Name;
public Vec3<Key>? LightDiffuse;
public Vec3<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;
}
@@ -99,7 +100,7 @@ namespace KKdBaseLib.Auth3D
public Key? End;
public Key? Start;
public Key? Density;
public Vec3<Key>? Diffuse;
public Vec4<Key?>? Diffuse;
}
public enum CompressF16 : int
@@ -129,7 +130,6 @@ namespace KKdBaseLib.Auth3D
public struct Key
{
public KeyType Type;
public int Length;
public int? BinOffset;
public EPType EPTypePre;
public EPType EPTypePost;
@@ -142,7 +142,6 @@ namespace KKdBaseLib.Auth3D
{
Type = 0;
Value = 0;
Length = 0;
BinOffset = null;
RawData = default;
Keys = null;
@@ -153,7 +152,6 @@ namespace KKdBaseLib.Auth3D
if (k.Length > 1)
{
Type = k.Type;
Length = (int)k.Length;
Keys = k.Keys;
}
else if (k.Length == 1)
@@ -184,10 +182,10 @@ namespace KKdBaseLib.Auth3D
public Key? Intensity;
public Key? Linear;
public Key? Quadratic;
public Vec3<Key>? Ambient;
public Vec3<Key>? Diffuse;
public Vec4<Key>? Specular;
public Vec3<Key>? Incandescence;
public Vec4<Key?>? Ambient;
public Vec4<Key?>? Diffuse;
public Vec4<Key?>? Specular;
public Vec4<Key?>? Incandescence;
public ModelTransform Position;
public ModelTransform SpotDirection;
}
@@ -197,8 +195,8 @@ namespace KKdBaseLib.Auth3D
public ulong HashName;
public string Name;
public Key GlowIntensity;
public Vec4<Key>? BlendColor;
public Vec3<Key>? Incandescence;
public Vec4<Key?>? BlendColor;
public Vec4<Key?>? Incandescence;
}
public struct MObjectHRC
@@ -237,8 +235,10 @@ namespace KKdBaseLib.Auth3D
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;
@@ -292,8 +292,8 @@ namespace KKdBaseLib.Auth3D
public Key? LensFlare;
public Key? LensGhost;
public Key? LensShaft;
public Vec3<Key>? Ambient;
public Vec3<Key>? Diffuse;
public Vec4<Key>? Specular;
public Vec4<Key?>? Ambient;
public Vec4<Key?>? Diffuse;
public Vec4<Key?>? Specular;
}
}
+2 -2
View File
@@ -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];
}
}
+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) =>
+2 -2
View File
@@ -6,12 +6,12 @@
<Configuration></Configuration>
<Copyright>korenkonder (C) 2019-2021</Copyright>
<Description>A base library</Description>
<FileVersion>0.4.10.1</FileVersion>
<FileVersion>0.4.10.2</FileVersion>
<PackageId>KKdBaseLib</PackageId>
<Product>KKdBaseLib</Product>
<TargetFramework>net461</TargetFramework>
<Title>KKdBaseLib</Title>
<Version>0.4.10.1</Version>
<Version>0.4.10.2</Version>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
+517 -578
View File
File diff suppressed because it is too large Load Diff
+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()
+2 -2
View File
@@ -6,12 +6,12 @@
<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.10.1</FileVersion>
<FileVersion>0.4.10.2</FileVersion>
<PackageId>KKdMainLib</PackageId>
<Product>KKdMainLib</Product>
<TargetFramework>net461</TargetFramework>
<Title>KKdMainLib</Title>
<Version>0.4.10.1</Version>
<Version>0.4.10.2</Version>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
+2 -2
View File
@@ -11,5 +11,5 @@ using System.Runtime.InteropServices;
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: Guid("7B5D5A3A-A6F8-4813-C97D-ACFC98F7397E")]
[assembly: AssemblyVersion("0.4.10.1")]
[assembly: AssemblyFileVersion("0.4.10.1")]
[assembly: AssemblyVersion("0.4.10.2")]
[assembly: AssemblyFileVersion("0.4.10.2")]
+5 -5
View File
@@ -62,7 +62,7 @@ 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)
@@ -75,7 +75,7 @@ namespace PD_Tool
}
}
else if (ext == ".mp" || ext == ".json")
using (a3da = new KKdA3DA(true))
using (a3da = new KKdA3DA())
{
a3da.MsgPackReader(filepath, ext == ".json");
a3da.Head.Format = format;
@@ -107,7 +107,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);
@@ -129,7 +129,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);
@@ -147,7 +147,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);