Compare commits

...
1 Commits
Author SHA1 Message Date
korenkonder 9cbeaf59c2 Release v0.4.8.2
A3DA, AET, DataBank, FARC
2020-02-07 14:00:49 +03:00
25 changed files with 449 additions and 405 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
using KKdBaseLib.A3DA;
using KKdBaseLib.Auth3D;
namespace KKdBaseLib
{
+15 -15
View File
@@ -1,11 +1,11 @@
namespace KKdBaseLib.Aet
namespace KKdBaseLib.Auth2D
{
public struct AetHeader
public struct Header
{
public Pointer<AetData>[] Data;
public Pointer<Data>[] Data;
}
public struct AetData
public struct Data
{
public Pointer<string> Name;
public float StartFrame;
@@ -15,25 +15,25 @@
public uint Width;
public uint Height;
public Pointer<Vector2<CountPointer<KFT2>>> Camera;
public CountPointer<AetComposition > Compositions ;
public CountPointer<AetSurface> Surfaces;
public CountPointer<Composition > Compositions ;
public CountPointer<Surface> Surfaces;
public CountPointer<AetSoundEffect > SoundEffects ;
}
public struct AetComposition
public struct Composition
{
public int P;
public int C { get => E != null ? E.Length : 0;
set => E = value > -1 ? new AetLayer[value] : null; }
set => E = value > -1 ? new Layer[value] : null; }
public int O;
public AetLayer[] E;
public Layer[] E;
public override string ToString() => "Count: " + C;
}
public struct AetLayer
public struct Layer
{
public int ID;
public int Offset;
@@ -47,7 +47,7 @@
public AetLayerType Type;
public int DataOffset;
public int ParentLayer;
public CountPointer<AetMarker> Marker;
public CountPointer<Marker> Marker;
public Pointer<AnimationData> Data;
public Pointer<AudioData> ExtraData;
@@ -86,7 +86,7 @@
(ParentLayer > -1 ? $"; Parent Object ID: {ParentLayer}" : "");
}
public struct AetMarker
public struct Marker
{
public float Frame;
public Pointer<string> Name;
@@ -138,19 +138,19 @@
public CountPointer<KFT2> Data3;
}
public struct AetSurface
public struct Surface
{
public int O;
public uint Color;
public ushort Width;
public ushort Height;
public float Frames;
public CountPointer<AetSpriteIdentifier> Sprites;
public CountPointer<SpriteIdentifier> Sprites;
public override string ToString() => $"Width: {Width}; Height: {Height}; Color: {Color.ToString("X2")}";
}
public struct AetSpriteIdentifier
public struct SpriteIdentifier
{
public Pointer<string> Name;
public uint ID;
+8 -8
View File
@@ -1,6 +1,6 @@
namespace KKdBaseLib.A3DA
namespace KKdBaseLib.Auth3D
{
public struct A3DAData
public struct Data
{
public string[] Motion;
public string[] ObjectList;
@@ -284,7 +284,7 @@
public struct ObjectHRC
{
public float? Shadow;
public int? Shadow;
public string Name;
public string UIDName;
public Node[] Node;
@@ -293,11 +293,11 @@
public struct PlayControl
{
public float? Begin;
public float? Div;
public float? FPS;
public float? Offset;
public float? Size;
public int? Begin;
public int? Div;
public int? FPS;
public int? Offset;
public int? Size;
}
public struct PostProcess
+24
View File
@@ -62,5 +62,29 @@ namespace KKdBaseLib
result = ChecksumLookupTable[(byte)(result >> 8) ^ data[i]] ^ (result << 8);
return result;
}
public static unsafe ushort CalculateChecksum(byte* data, int length)
{
ushort result = 0xFFFF;
for (int i = 0; i < length; i++)
result = (ushort)(ChecksumLookupTable[(result >> 8) ^ data[i]] ^ (result << 8));
return result;
}
public static unsafe uint CalculateChecksumUInt(byte* data, int length)
{
uint result = 0xFFFFFFFF;
for (int i = 0; i < length; i++)
result = ChecksumLookupTable[(byte)(result >> 8) ^ data[i]] ^ (result << 8);
return result;
}
public static unsafe ulong CalculateChecksumULong(byte* data, int length)
{
ulong result = 0xFFFFFFFFFFFFFFFF;
for (int i = 0; i < length; i++)
result = ChecksumLookupTable[(byte)(result >> 8) ^ data[i]] ^ (result << 8);
return result;
}
}
}
+1 -1
View File
@@ -1,4 +1,4 @@
using KKdBaseLib.A3DA;
using KKdBaseLib.Auth3D;
namespace KKdBaseLib.Interpolation
{
+3 -3
View File
@@ -4,14 +4,14 @@
<Authors>korenkonder</Authors>
<Company></Company>
<Configuration></Configuration>
<Copyright>korenkonder © 2019</Copyright>
<Copyright>korenkonder © 2019-2020</Copyright>
<Description>A base library</Description>
<FileVersion>0.4.8.1</FileVersion>
<FileVersion>0.4.8.2</FileVersion>
<PackageId>KKdBaseLib</PackageId>
<Product>KKdBaseLib</Product>
<TargetFramework>netstandard2.0</TargetFramework>
<Title>KKdBaseLib</Title>
<Version>0.4.8.1</Version>
<Version>0.4.8.2</Version>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
+89 -78
View File
@@ -3,32 +3,33 @@
public struct KKdDict<TKey, TValue> : System.IDisposable, System.Collections.IEnumerator, INull
{
public static KKdDict<TKey, TValue> Null => new KKdDict<TKey, TValue>();
public static KKdDict<TKey, TValue> New => new KKdDict<TKey, TValue>() { Count = 0, Capacity = 0 };
public static KKdDict<TKey, TValue> New => new KKdDict<TKey, TValue>() { count = 0, Capacity = 0 };
public static KKdDict<TKey, TValue> NewReserve(int Capacity) =>
new KKdDict<TKey, TValue>() { Count = 0, Capacity = Capacity };
new KKdDict<TKey, TValue>() { count = 0, Capacity = Capacity };
private int count;
private int index;
private TKey [] keyArray;
private TValue[] valArray;
public int Count { get; private set; }
public int Count => count;
public bool IsNull => keyArray == null || valArray == null;
public bool NotNull => keyArray != null && valArray != null;
public int Capacity { get => keyArray != null && valArray != null ? valArray.Length : -1;
set { if (keyArray != null) System.Array.Resize(ref keyArray, value); else keyArray = new TKey [value];
if (valArray != null) System.Array.Resize(ref valArray, value); else valArray = new TValue[value];
if (Count >= value) Count = value; } }
set { if (keyArray != null) System.Array.Resize(ref keyArray, value); else keyArray = new TKey [value];
if (valArray != null) System.Array.Resize(ref valArray, value); else valArray = new TValue[value];
if (count >= value) count = value; } }
public KKdDict(TKey[] keyArray, TValue[] valArray)
{
this.keyArray = null; this.valArray = null; Count = 0; index = 0;
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 = valArray.Length; this.keyArray = keyArray; this.valArray = valArray; }
public KeyValuePair<TKey, TValue> Current => index < Count ?
public KeyValuePair<TKey, TValue> Current => index < count ?
new KeyValuePair<TKey, TValue>(keyArray[index], valArray[index]) : default;
object System.Collections.IEnumerator.Current => Current;
@@ -49,17 +50,16 @@
index < valArray.Length) { keyArray[index] = value.Key; valArray[index] = value.Value; } } }
public TValue this[TKey key]
{ get => valArray != null && valArray.Length > 0 && ContainsKey(key) ? valArray[IndexOf(key)] : default;
set { if (valArray != null && valArray.Length > 0 && ContainsKey(key)) valArray[IndexOf(key)] = value; } }
{ get => valArray != null && valArray.Length > 0 && CK(key, out int index) ? valArray[index] : default;
set { if (valArray != null && valArray.Length > 0) if (CK(key, out int index)) valArray[index] = value; else Add(key, value); } }
public bool MoveNext()
{ if (index == Count - 1) { index = 0; return false; }
{ if (index == count - 1) { index = 0; return false; }
else { index++ ; return true; } }
public System.Collections.IEnumerator GetEnumerator() => this;
public void Dispose() { valArray = null; Count = 0; index = 0; }
public void Dispose() { keyArray = null; valArray = null; count = 0; index = 0; }
public void Reset() => index = 0;
@@ -67,22 +67,22 @@
{
if (IsNull) return;
Count++;
if (keyArray.Length < Count) System.Array.Resize(ref keyArray, Count);
if (valArray.Length < Count) System.Array.Resize(ref valArray, Count);
keyArray[Count - 1] = pair.Key;
valArray[Count - 1] = pair.Value;
count++;
if (keyArray.Length < count) System.Array.Resize(ref keyArray, count);
if (valArray.Length < count) System.Array.Resize(ref valArray, count);
keyArray[count - 1] = pair.Key;
valArray[count - 1] = pair.Value;
}
public void Add(TKey key, TValue val)
{
if (IsNull) return;
Count++;
if (keyArray.Length < Count) System.Array.Resize(ref keyArray, Count);
if (valArray.Length < Count) System.Array.Resize(ref valArray, Count);
keyArray[Count - 1] = key;
valArray[Count - 1] = val;
count++;
if (keyArray.Length < count) System.Array.Resize(ref keyArray, count);
if (valArray.Length < count) System.Array.Resize(ref valArray, count);
keyArray[count - 1] = key;
valArray[count - 1] = val;
}
public bool RemoveKey(TKey key)
@@ -92,12 +92,10 @@
int index = IndexOf(key);
if (index == -1) return false;
for (int i = index + 1; i < Count; i++)
{
keyArray[i - 1] = keyArray[i];
valArray[i - 1] = valArray[i];
}
Count--;
if (index + 1 < count)
{ System.Array.Copy(keyArray, index + 1, keyArray, index, count - index);
System.Array.Copy(valArray, index + 1, valArray, index, count - index); }
count--;
return true;
}
@@ -108,94 +106,107 @@
int index = IndexOf(val);
if (index == -1) return false;
for (int i = index + 1; i < Count; i++)
{
keyArray[i - 1] = keyArray[i];
valArray[i - 1] = valArray[i];
}
Count--;
if (index + 1 < count)
{ System.Array.Copy(keyArray, index + 1, keyArray, index, count - index);
System.Array.Copy(valArray, index + 1, valArray, index, count - index); }
count--;
return true;
}
public void RemoveAt(int index)
{
if (IsNull) return;
if (IsNull || index < 0 || index >= count) return;
for (int i = index + 1; i < Count; i++)
{
keyArray[i - 1] = keyArray[i];
valArray[i - 1] = valArray[i];
}
Count--;
if (index + 1 < count)
{ System.Array.Copy(keyArray, index + 1, keyArray, index, count - index);
System.Array.Copy(valArray, index + 1, valArray, index, count - index); }
count--;
}
public void RemoveRange(int IndexStart, int IndexEnd)
public void RemoveRange(int indexStart, int indexEnd)
{
if (IsNull) return;
if (IndexEnd - IndexStart < 1) return;
int indexcount = indexEnd - indexStart;
if (IsNull || indexcount < 1 || indexStart < 0 || indexEnd > count) return;
if (IndexEnd - IndexStart != Count)
for (int i = IndexStart; i < Count; i++)
{
keyArray[i] = keyArray[i + IndexEnd - IndexStart];
valArray[i] = valArray[i + IndexEnd - IndexStart];
}
Count -= IndexEnd - IndexStart;
if ((indexEnd + indexcount) < count)
{ System.Array.Copy(keyArray, indexEnd, keyArray, indexStart, indexcount);
System.Array.Copy(valArray, indexEnd, valArray, indexStart, indexcount); }
count -= indexcount;
}
public TValue[] ToArray() => valArray;
public bool ContainsKey(TKey key)
public bool ContainsKey (TKey key) => CK(key, out int index);
public bool ContainsValue(TValue val) => CV(val, out int index);
public bool Contains (KeyValuePair<TKey, TValue> pair) => C(pair, out int index);
public bool ContainsKey (TKey key, out int index) => CK(key, out index);
public bool ContainsValue(TValue val, out int index) => CV(val, out index);
public bool Contains (KeyValuePair<TKey, TValue> pair, out int index) => C(pair, out index);
private bool CK(TKey key, out int index)
{
index = -1;
if (IsNull) return false;
for (int i = 0; i < Count; i++)
if (keyArray[i] == null && key == null) return true;
else if (keyArray[i] == null || key == null) continue;
else if (keyArray[i] .Equals(key) ) return true;
for (int i = 0; i < count; i++)
if (keyArray[i] == null && key == null) { index = i; return true; }
else if (keyArray[i] == null || key == null) continue;
else if (keyArray[i].Equals(key)) { index = i; return true; }
return false;
}
public bool ContainsValue(TValue val)
private bool CV(TValue val, out int index)
{
index = -1;
if (IsNull) return false;
for (int i = 0; i < Count; i++)
if (valArray[i] == null && val == null) return true;
else if (valArray[i] == null || val == null) continue;
else if (valArray[i] .Equals(val) ) return true;
for (int i = 0; i < count; i++)
if (valArray[i] == null && val == null) { index = i; return true; }
else if (valArray[i] == null || val == null) continue;
else if (valArray[i].Equals(val)) { index = i; return true; }
return false;
}
public bool Contains(KeyValuePair<TKey, TValue> pair)
private bool C(KeyValuePair<TKey, TValue> pair, out int index)
{
index = -1;
if (IsNull) return false;
for (int i = 0; i < Count; i++)
if ( keyArray[i] == null && pair.Key == null &&
valArray[i] == null && pair.Value == null ) return true;
else if ((keyArray[i] == null || pair.Key == null) &&
(valArray[i] == null || pair.Value == null)) continue;
else if ( keyArray[i] .Equals(pair.Key) &&
valArray[i] .Equals(pair.Value) ) return true;
for (int i = 0; i < count; i++)
if (keyArray[i] == null && pair.Key == null &&
valArray[i] == null && pair.Value == null) { index = i; return true; }
else if ((keyArray[i] == null || pair.Key == null) &&
(valArray[i] == null || pair.Value == null)) continue;
else if (keyArray[i].Equals(pair.Key ) &&
valArray[i].Equals(pair.Value)) { index = i; return true; }
return false;
}
public TKey GetKey(TValue val)
{
if (IsNull) return default;
for (int i = 0; i < count; i++)
if (keyArray[i] == null && val == null) return keyArray[i];
else if (keyArray[i] == null || val == null) continue;
else if (keyArray[i].Equals(val)) return keyArray[i];
return default;
}
private int IndexOf(TKey key)
{
if (IsNull) return -1;
for (int i = 0; i < Count; i++)
for (int i = 0; i < count; i++)
if (keyArray[i] == null && key == null) return i;
else if (keyArray[i] == null || key == null) continue;
else if (keyArray[i] .Equals(key) ) return i;
else if (keyArray[i].Equals(key)) return i;
return -1;
}
private int IndexOf(TValue val)
{
if (IsNull) return -1;
for (int i = 0; i < Count; i++)
if (keyArray[i] == null && val == null) return i;
else if (keyArray[i] == null || val == null) continue;
else if (keyArray[i] .Equals(val) ) return i;
for (int i = 0; i < count; i++)
if (valArray[i] == null && val == null) return i;
else if (valArray[i] == null || val == null) continue;
else if (valArray[i].Equals(val)) return i;
return -1;
}
}
+71 -42
View File
@@ -3,31 +3,37 @@ using System.Collections.Generic;
namespace KKdBaseLib
{
public struct KKdList<T> : System.IDisposable, IEnumerator, IEnumerable, INull
public struct KKdList<T> : System.IDisposable, IEnumerable<T>, IEnumerable, IEnumerator, INull
{
public static KKdList<T> Null => new KKdList<T>();
public static KKdList<T> New => new KKdList<T>() { Count = 0, Capacity = 0 };
public static KKdList<T> NewReserve(int Capacity) => new KKdList<T>() { Count = 0, Capacity = Capacity };
public static KKdList<T> New => new KKdList<T>() { count = 0, Capacity = 0 };
public static KKdList<T> NewReserve(int Capacity) => new KKdList<T>() { count = 0, Capacity = Capacity };
private int count;
private int index;
private T[] array;
public int Count { get; private set; }
private Enumerator enumerator;
public int Count => count;
public bool IsNull => array == null;
public bool NotNull => array != null;
public int Capacity { get => array != null ? array.Length : -1;
set { if (array != null) System.Array.Resize(ref array, value); else array = new T[value];
if (Count >= value) Count = value; } }
set { if (array != null) System.Array.Resize(ref array, value); else array = new T[value];
if (Count >= value) count = value; } }
public KKdList(T[] Array)
{ index = 0; Count = Array.Length; array = Array; }
public KKdList(T[] array)
{ index = -1; count = array.Length; this.array = array; enumerator = new Enumerator(this.array); }
public T Current => index < Count ? array[index] : default;
public T Current => index > -1 && index < Count ? array[index] : default;
object IEnumerator.Current => Current;
object IEnumerator.Current => enumerator.Current;
public bool MoveNext() => enumerator.MoveNext();
public void Reset() => enumerator.Reset();
public T this[ int index]
{ get => array != null && index > -1 && index < array.Length ? array[index] : default;
@@ -37,44 +43,41 @@ namespace KKdBaseLib
{ get => array != null && index < array.Length ? array[index] : default;
set { if (array != null && index < array.Length) array[index] = value; } }
public bool MoveNext()
{ if (index == Count - 1) { index = 0; return false; }
else { index++ ; return true; } }
public IEnumerator GetEnumerator() => enumerator = new Enumerator(array);
public IEnumerator GetEnumerator() => this;
IEnumerator<T> IEnumerable<T>.GetEnumerator() => enumerator = new Enumerator(array);
public void Dispose() { array = null; Count = 0; index = 0; }
IEnumerator IEnumerable.GetEnumerator() => enumerator = new Enumerator(array);
public void Reset() => index = 0;
public void Dispose() { array = null; count = 0; index = -1; }
public void Add(T item)
{
if (IsNull) return;
Count++;
if (array.Length < Count)
System.Array.Resize(ref array, Count);
array[Count - 1] = item;
count++;
if (array.Length < count)
System.Array.Resize(ref array, count);
array[count - 1] = item;
}
public void RemoveAt(int index)
{
if (IsNull) return;
if (IsNull || index < 0 || index >= count) return;
for (int i = index + 1; i < Count; i++)
array[i - 1] = array[i];
Count--;
if (index + 1 < count)
System.Array.Copy(array, index + 1, array, index, count - index);
count--;
}
public void RemoveRange(int IndexStart, int IndexEnd)
public void RemoveRange(int indexStart, int indexEnd)
{
if (IsNull) return;
if (IndexEnd - IndexStart < 1) return;
int indexCount = indexEnd - indexStart;
if (IsNull || indexCount < 1 || indexStart < 0 || indexEnd > count) return;
if (IndexEnd - IndexStart != Count)
for (int i = IndexStart; i < Count; i++)
array[i] = array[i + IndexEnd - IndexStart];
Count -= IndexEnd - IndexStart;
if ((indexEnd + indexCount) < count)
System.Array.Copy(array, indexEnd, array, indexStart, indexCount);
count -= indexCount;
}
public T[] ToArray() => array;
@@ -82,34 +85,60 @@ namespace KKdBaseLib
public bool Contains(T val)
{
if (IsNull) return false;
for (int i = 0; i < Count; i++)
for (int i = 0; i < count; i++)
if (array[i] == null && val == null) return true;
else if (array[i] == null || val == null) continue;
else if (array[i] .Equals(val) ) return true;
else if (array[i].Equals(val)) return true;
return false;
}
public int IndexOf(T val)
{
if (IsNull) return -1;
for (int i = 0; i < Count; i++)
for (int i = 0; i < count; i++)
if (array[i] == null && val == null) return i;
else if (array[i] == null || val == null) continue;
else if (array[i] .Equals(val) ) return i;
else if (array[i].Equals(val)) return i;
return -1;
}
public void Sort()
{ List<T> List = (List<T>)this; List.Sort(); array = List.ToArray(); Count = List.Count; }
{ List<T> List = (List<T>)this; List.Sort(); array = List.ToArray(); count = List.Count; }
public static explicit operator KKdList<T>( List<T> List) =>
new KKdList<T> { array = List.ToArray(), Count = List.Count };
public static explicit operator KKdList<T>( List<T> list) =>
new KKdList<T> { array = list.ToArray(), count = list.Count };
public static explicit operator List<T>(KKdList<T> List)
public static explicit operator List<T>(KKdList<T> list)
{ List<T> outList = new List<T>(); for (int i = 0; i < list.Count; i++) outList.Add(list[i]); return outList; }
public struct Enumerator : IEnumerator<T>, IEnumerator
{
List<T> list = new List<T>();
for (int i = 0; i < List.Count; i++) list.Add(List[i]);
return list;
private T[] array;
private int index;
private int count;
private T current;
internal Enumerator(T[] array)
{ this.array = array; count = index = 0; current = default;
if (array != null && array.Length > 0) { current = array[0]; count = array.Length; } }
public void Dispose()
{ array = null; count = index = 0; current = default; }
public bool MoveNext()
{
if (index < count) { current = array[index]; index++; return true; }
else { current = default; index = count + 1; return false; }
}
public T Current => current;
object IEnumerator.Current =>
(index == 0 || index == array.Length + 1) ? default : current;
void IEnumerator.Reset() => Reset();
public void Reset() { index = 0; current = default; }
}
}
}
+1 -1
View File
@@ -21,7 +21,7 @@ namespace KKdBaseLib
{ Object = KKdList<MsgPack>.New; this.Name = Name; }
public MsgPack(long Count, string Name = null)
{ Object = Count > 0 ? new MsgPack[Count] : null; this.Name = Name; }
{ Object = Count > -1 ? new MsgPack[Count] : null; this.Name = Name; }
public MsgPack(string Name, object Object)
{ this.Name = Name; this.Object = Object; }
+2 -2
View File
@@ -28,8 +28,8 @@
{ vec.X /= scale ; vec.Y /= scale ; vec.Z /= scale ; return vec; }
public static Vector3 operator /(Vector3 vec, Vector3 scale)
{ vec.X /= scale.X; vec.Y /= scale.Y; vec.Z /= scale.Z; return vec; }
public static bool operator ==(Vector3 A, Vector3 B) => A.Equals(B);
public static bool operator !=(Vector3 A, Vector3 B) => !A.Equals(B);
public static bool operator ==(Vector3 A, Vector3 B) => A.X == B.X && A.Y == B.Y && A.Z == B.Z;
public static bool operator !=(Vector3 A, Vector3 B) => A.X != B.X || A.Y != B.Y || A.Z != B.Z;
public static double Distance (Vector3 left, Vector3 right) =>
(right.X - left.X) * (right.X - left.X) + (right.Y - left.Y) *
+41 -43
View File
@@ -1,17 +1,17 @@
using System;
using System.Collections.Generic;
using KKdBaseLib;
using KKdBaseLib.F2;
using KKdBaseLib.A3DA;
using KKdBaseLib.Auth3D;
using KKdMainLib.IO;
using Extensions = KKdBaseLib.Extensions;
using Object = KKdBaseLib.A3DA.Object;
using Object = KKdBaseLib.Auth3D.Object;
using A3DADict = System.Collections.Generic.Dictionary<string, object>;
using UsedDict = System.Collections.Generic.Dictionary< int?, float?>;
namespace KKdMainLib
{
public struct A3DA : IDisposable
{
public A3DAData Data;
public Data Data;
public A3DAHeader Head;
private Stream _IO;
@@ -28,8 +28,8 @@ namespace KKdMainLib
private string nameView;
private string value;
private string[] dataArray;
private Dictionary<int?, float?> usedValues;
private Dictionary<string, object> dict;
private A3DADict dict;
private UsedDict usedValues;
private const string d = ".";
private const string BO = "bin_offset";
@@ -56,8 +56,8 @@ namespace KKdMainLib
name = "";
nameView = "";
dataArray = new string[4];
dict = new Dictionary<string, object>();
Data = new A3DAData();
dict = new A3DADict();
Data = new Data();
Head = new A3DAHeader();
Header header = new Header();
@@ -98,13 +98,9 @@ namespace KKdMainLib
if (header.Format == Format.DT)
Head.StringLength = _IO.L - 0x10;
string[] strData = _IO.RS(Head.StringLength).Replace("\r", "").Split('\n');
string[] strData = _IO.RS(Head.StringLength).Replace("\r\n", "\n").Replace("\r", "\n").Split('\n');
for (i = 0; i < strData.Length; i++)
{
dataArray = strData[i].Split('=');
if (dataArray.Length == 2)
dict.GetDictionary(dataArray[0], dataArray[1]);
}
dict.GetDictionary(strData[i]);
strData = null;
A3DAReader();
@@ -123,6 +119,7 @@ namespace KKdMainLib
name = "";
nameView = "";
dataArray = null;
dict.Clear();
dict = null;
return 1;
}
@@ -741,10 +738,10 @@ namespace KKdMainLib
name = "material_list" + d + soi0 + d;
ref MaterialList ml = ref Data.MaterialList[soi0];
W(ref ml.BlendColor , name + "blend_color" + d);
W(ref ml.GlowIntensity, name + "glow_intensity" + d);
W(ref ml.BlendColor , name + "blend_color" );
W(ref ml.GlowIntensity, name + "glow_intensity");
W(name + "hash_name=", ml.HashName);
W(ref ml.Incandescence, name + "incandescence" + d);
W(ref ml.Incandescence, name + "incandescence" );
W(name + "name=", ml. Name);
}
W("material_list.length=", Data.MaterialList.Length);
@@ -1015,15 +1012,16 @@ namespace KKdMainLib
private void W(ref ModelTransform mt, string str, byte flags = 0b11111)
{
if (a3dc && !mt.Writed && (flags & 0b10000) == 0b10000)
if (a3dc && !mt.Writed && (flags & 0b10000) != 0)
{ W(str + MTBO + "=", mt.BinOffset); mt.Writed = true; }
if (a3dc && Head.Format != Format.X && Head.Format != Format.XHD) return;
if ((flags & 0b01000) == 0b01000) W(ref mt.Rot , str + "rot" + d);
if ((flags & 0b00100) == 0b00100) W(ref mt.Scale , str + "scale" + d);
if ((flags & 0b00010) == 0b00010) W(ref mt.Trans , str + "trans" + d);
if ((flags & 0b00001) == 0b00001) W(ref mt.Visibility, str + "visibility" + d);
if (!a3dc)
{
if ((flags & 0b01000) != 0) W(ref mt.Rot , str + "rot" + d);
if ((flags & 0b00100) != 0) W(ref mt.Scale , str + "scale" + d);
if ((flags & 0b00010) != 0) W(ref mt.Trans , str + "trans" + d);
if ((flags & 0b00001) != 0) W(ref mt.Visibility, str + "visibility" + d);
}
}
private void W(ref Vector4<Key> rgba, string str)
@@ -1260,7 +1258,7 @@ namespace KKdMainLib
public byte[] A3DCWriter()
{
if (a3dcOpt) usedValues = new Dictionary<int?, float?>();
if (a3dcOpt) usedValues = new UsedDict();
if (Head.Format < Format.F2LE) Data._.CompressF16 = null;
_IO = File.OpenWriter();
@@ -1404,9 +1402,9 @@ namespace KKdMainLib
if (Data.MaterialList != null && (Head.Format == Format.X || Head.Format == Format.XHD))
for (i0 = 0; i0 < Data.MaterialList.Length; i0++)
{
W(ref Data.MaterialList[so0[i0]].BlendColor );
W(ref Data.MaterialList[so0[i0]].GlowIntensity);
W(ref Data.MaterialList[so0[i0]].Incandescence);
W(ref Data.MaterialList[i0].BlendColor );
W(ref Data.MaterialList[i0].GlowIntensity);
W(ref Data.MaterialList[i0].Incandescence);
}
if (Data.Object != null)
@@ -1637,7 +1635,7 @@ namespace KKdMainLib
}
}
public void A3DAMerger(ref A3DAData mData)
public void A3DAMerger(ref Data mData)
{
if (Data.Ambient != null && mData.Ambient != null)
for (i0 = 0; i0 < Data.Ambient.Length && i0 < mData.Ambient.Length; i0++)
@@ -1681,7 +1679,7 @@ namespace KKdMainLib
if (Data.DOF != null && mData.DOF != null)
{
DOF mDOF = mData.DOF.Value;
DOF dof = Data.DOF.Value;
DOF dof = Data.DOF.Value;
MMT(ref dof.MT, ref mDOF.MT);
Data.DOF = dof;
mData.DOF = mDOF;
@@ -1715,7 +1713,7 @@ namespace KKdMainLib
if (Data.MObjectHRC[i0].Instances != null && mData.MObjectHRC[i0].Instances != null)
{
ref MObjectHRC.Instance[] mI = ref mData.MObjectHRC[i0].Instances;
ref MObjectHRC.Instance[] i = ref Data.MObjectHRC[i0].Instances;
ref MObjectHRC.Instance[] i = ref Data.MObjectHRC[i0].Instances;
for (i1 = 0; i1 < i.Length && i1 < mI.Length; i1++)
MMT(ref i[i1].MT, ref mI[i1].MT);
}
@@ -1723,7 +1721,7 @@ namespace KKdMainLib
if (Data.MObjectHRC[i0].Node != null && mData.MObjectHRC[i0].Node != null)
{
ref Node[] mN = ref mData.MObjectHRC[i0].Node;
ref Node[] n = ref Data.MObjectHRC[i0].Node;
ref Node[] n = ref Data.MObjectHRC[i0].Node;
for (i1 = 0; i1 < n.Length && i1 < mN.Length; i1++)
MMT(ref n[i1].MT, ref mN[i1].MT);
}
@@ -1733,7 +1731,7 @@ namespace KKdMainLib
for (i0 = 0; i0 < Data.MaterialList.Length; i0++)
{
ref MaterialList mML = ref mData.MaterialList[i0];
ref MaterialList ml = ref Data.MaterialList[i0];
ref MaterialList ml = ref Data.MaterialList[i0];
MRGBAK(ref ml.BlendColor , ref mML.BlendColor );
MK (ref ml.GlowIntensity, ref mML.GlowIntensity);
MRGBAK(ref ml.Incandescence, ref mML.Incandescence);
@@ -1748,7 +1746,7 @@ namespace KKdMainLib
i1 < mData.Object[i0].TexTrans.Length; i1++)
{
ref Object.TextureTransform mTT = ref mData.Object[i0].TexTrans[i1];
ref Object.TextureTransform tt = ref Data.Object[i0].TexTrans[i1];
ref Object.TextureTransform tt = ref Data.Object[i0].TexTrans[i1];
MKUV(ref tt.Coverage , ref mTT.Coverage );
MKUV(ref tt.Offset , ref mTT.Offset );
MKUV(ref tt.Repeat , ref mTT.Repeat );
@@ -1763,7 +1761,7 @@ namespace KKdMainLib
if (Data.ObjectHRC[i0].Node != null && mData.ObjectHRC[i0].Node != null)
{
ref Node[] mN = ref mData.ObjectHRC[i0].Node;
ref Node[] n = ref Data.ObjectHRC[i0].Node;
ref Node[] n = ref Data.ObjectHRC[i0].Node;
for (i1 = 0; i1 < n.Length && i1 < mN.Length; i1++)
MMT(ref n[i1].MT, ref mN[i1].MT);
}
@@ -1776,7 +1774,7 @@ namespace KKdMainLib
if (Data.PostProcess != null && mData.PostProcess != null)
{
PostProcess mPP = mData.PostProcess.Value;
PostProcess pp = Data.PostProcess.Value;
PostProcess pp = Data.PostProcess.Value;
MRGBAK(ref pp.Ambient , ref mPP.Ambient );
MRGBAK(ref pp.Diffuse , ref mPP.Diffuse );
MRGBAK(ref pp.Specular , ref mPP.Specular );
@@ -2126,7 +2124,7 @@ namespace KKdMainLib
Data.ObjectHRC[i0] = new ObjectHRC
{
Name = temp[i0].RS ( "Name"),
Shadow = temp[i0].RnF32( "Shadow"),
Shadow = temp[i0].RnI32( "Shadow"),
UIDName = temp[i0].RS ("UIDName"),
};
@@ -2169,11 +2167,11 @@ namespace KKdMainLib
if ((temp = a3d["PlayControl"]).NotNull)
Data.PlayControl = new PlayControl
{
Begin = temp.RnF32("Begin" ),
Div = temp.RnF32("Div" ),
FPS = temp.RnF32("FPS" ),
Offset = temp.RnF32("Offset"),
Size = temp.RnF32("Size" ),
Begin = temp.RnI32("Begin" ),
Div = temp.RnI32("Div" ),
FPS = temp.RnI32("FPS" ),
Offset = temp.RnI32("Offset"),
Size = temp.RnI32("Size" ),
};
if ((temp = a3d["Point", true]).NotNull)
+55 -63
View File
@@ -1,10 +1,10 @@
//Original: AetSet.bt Version: 4.3 by samyuu
using KKdBaseLib;
using KKdBaseLib.Aet;
using KKdBaseLib.Auth2D;
using KKdMainLib.IO;
namespace KKdMainLib.Aet
namespace KKdMainLib
{
public struct Aet : System.IDisposable
{
@@ -12,7 +12,7 @@ namespace KKdMainLib.Aet
private int i, i0, i1, i2;
private const string x00 = "\0";
public AetHeader AET;
public Header AET;
public void AETReader(string file)
{
@@ -24,8 +24,8 @@ namespace KKdMainLib.Aet
while (true) { Pos = _IO.RI32(); if (Pos != 0 && Pos < _IO.L) i++; else break; }
_IO.P = 0;
AET.Data = new Pointer<AetData>[i];
for (i = 0; i < AET.Data.Length; i++) AET.Data[i] = _IO.RP<AetData>();
AET.Data = new Pointer<Data>[i];
for (i = 0; i < AET.Data.Length; i++) AET.Data[i] = _IO.RP<Data>();
for (i = 0; i < AET.Data.Length; i++) AETReader(ref AET.Data[i]);
_IO.C();
@@ -53,10 +53,10 @@ namespace KKdMainLib.Aet
data = null;
}
private void AETReader(ref Pointer<AetData> aetData)
private void AETReader(ref Pointer<Data> aetData)
{
_IO.P = aetData.O;
ref AetData aet = ref aetData.V;
ref Data aet = ref aetData.V;
aet.Name = _IO.RPS();
aet.StartFrame = _IO.RF32();
@@ -66,8 +66,8 @@ namespace KKdMainLib.Aet
aet.Width = _IO.RU32();
aet.Height = _IO.RU32();
aet.Camera = _IO.RP<Vector2<CountPointer<KFT2>>>();
aet.Compositions = _IO.ReadCountPointer<AetComposition>();
aet.Surfaces = _IO.ReadCountPointer<AetSurface >();
aet.Compositions = _IO.ReadCountPointer<Composition>();
aet.Surfaces = _IO.ReadCountPointer<Surface >();
aet.SoundEffects = _IO.ReadCountPointer<AetSoundEffect>();
if (aet.Camera.O > 0)
@@ -92,7 +92,7 @@ namespace KKdMainLib.Aet
_IO.P = aet.Compositions.O;
for (i = 0; i < aet.Compositions.C; i++)
aet.Compositions[i] = new AetComposition() { P = _IO.P, C = _IO.RI32(), O = _IO.RI32()};
aet.Compositions[i] = new Composition() { P = _IO.P, C = _IO.RI32(), O = _IO.RI32()};
i1 = 0;
RAL(ref aet.Compositions.E[aet.Compositions.C - 1]);
@@ -101,41 +101,33 @@ namespace KKdMainLib.Aet
_IO.P = aet.Surfaces.O;
for (i = 0; i < aet.Surfaces.C; i++)
aet.Surfaces[i] = new AetSurface { O = _IO.P, Color = _IO.RU32(), Width = _IO.RU16(),
Height = _IO.RU16(), Frames = _IO.RF32(), Sprites = _IO.ReadCountPointer<AetSpriteIdentifier>() };
aet.Surfaces[i] = new Surface { O = _IO.P, Color = _IO.RU32(), Width = _IO.RU16(),
Height = _IO.RU16(), Frames = _IO.RF32(), Sprites = _IO.ReadCountPointer<SpriteIdentifier>() };
for (i = 0; i < aet.Surfaces.C; i++)
{
_IO.P = aet.Surfaces[i].Sprites.O;
for (i0 = 0; i0 < aet.Surfaces[i].Sprites.C; i0++)
aet.Surfaces.E[i].Sprites[i0] = new AetSpriteIdentifier { Name = _IO.RPS(), ID = _IO.RU32() };
aet.Surfaces.E[i].Sprites[i0] = new SpriteIdentifier { Name = _IO.RPS(), ID = _IO.RU32() };
}
for (i = 0; i < aet.Compositions.C; i++)
{
for (i0 = 0; i0 < aet.Compositions[i].C; i0++)
{
ref AetLayer obj = ref aet.Compositions[i].E[i0];
ref Layer obj = ref aet.Compositions[i].E[i0];
obj.DataID = -1;
int dataOffset = obj.DataOffset;
if (dataOffset > 0)
{
if (obj.Type == AetLayer.AetLayerType.Pic)
{
if (obj.Type == Layer.AetLayerType.Pic)
for (i1 = 0; i1 < aet.Surfaces.C; i1++)
if (aet. Surfaces[i1].O == dataOffset) { obj.DataID = i1; break; }
}
else if (obj.Type == AetLayer.AetLayerType.Aif)
{
{ if (aet. Surfaces[i1].O == dataOffset) { obj.DataID = i1; break; } }
else if (obj.Type == Layer.AetLayerType.Aif)
for (i1 = 0; i1 < aet.SoundEffects.C; i1++)
if (aet.SoundEffects[i1].O == dataOffset) { obj.DataID = i1; break; }
}
else if (obj.Type == AetLayer.AetLayerType.Eff)
{
{ if (aet.SoundEffects[i1].O == dataOffset) { obj.DataID = i1; break; } }
else if (obj.Type == Layer.AetLayerType.Eff)
for (i1 = 0; i1 < aet.Compositions.C; i1++)
if (aet.Compositions[i1].P == dataOffset) { obj.DataID = i1; break; }
}
}
{ if (aet.Compositions[i1].P == dataOffset) { obj.DataID = i1; break; } }
ref int parentLayer = ref obj.ParentLayer;
if (parentLayer > 0)
@@ -151,13 +143,13 @@ namespace KKdMainLib.Aet
}
}
private void AETWriter(ref Pointer<AetData> aetData)
private void AETWriter(ref Pointer<Data> aetData)
{
ref AetData aet = ref aetData.V;
ref Data aet = ref aetData.V;
for (i = 0; i < aet.Surfaces.C; i++)
{
ref AetSurface region = ref aet.Surfaces.E[i];
ref Surface region = ref aet.Surfaces.E[i];
if (region.Sprites.C == 0) { region.Sprites.O = 0; continue; }
if (region.Sprites.C > 1) _IO.A(0x20);
region.Sprites.O = _IO.P;
@@ -168,7 +160,7 @@ namespace KKdMainLib.Aet
aet.Surfaces.O = _IO.P;
for (i = 0; i < aet.Surfaces.C; i++)
{
ref AetSurface region = ref aet.Surfaces.E[i];
ref Surface region = ref aet.Surfaces.E[i];
region.O = _IO.P;
_IO.W(region.Color);
_IO.W(region.Width);
@@ -191,7 +183,7 @@ namespace KKdMainLib.Aet
for (i0 = 0; i0 < aet.Compositions.E[i].C; i0++)
{
ref AetLayer obj = ref aet.Compositions.E[i].E[i0];
ref Layer obj = ref aet.Compositions.E[i].E[i0];
ref AnimationData data = ref obj.Data.V;
ref AnimationData.Perspective persp = ref data.Persp.V;
ref AudioData extraData = ref obj.ExtraData.V;
@@ -263,7 +255,7 @@ namespace KKdMainLib.Aet
aet.Compositions.E[i].E[0].Offset = _IO.P;
for (i0 = 0; i0 < aet.Compositions.E[i].C; i0++)
{
ref AetLayer obj = ref aet.Compositions.E[i].E[i0];
ref Layer obj = ref aet.Compositions.E[i].E[i0];
obj.Offset = _IO.P;
_IO.W(0L); _IO.W(0L); _IO.W(0L); _IO.W(0L); _IO.W(0L); _IO.W(0L);
}
@@ -297,7 +289,7 @@ namespace KKdMainLib.Aet
for (i = 0; i < aet.Surfaces.C; i++)
{
ref AetSurface region = ref aet.Surfaces.E[i];
ref Surface region = ref aet.Surfaces.E[i];
for (i0 = 0; i0 < region.Sprites.C; i0++)
WPS(ref usedValues, ref region.Sprites.E[i0].Name);
}
@@ -307,7 +299,7 @@ namespace KKdMainLib.Aet
{
for (i0 = 0; i0 < aet.Compositions.E[i].C; i0++)
{
ref AetLayer obj = ref aet.Compositions.E[i].E[i0];
ref Layer obj = ref aet.Compositions.E[i].E[i0];
for (i1 = 0; i1 < obj.Marker.C; i1++)
WPS(ref usedValues, ref obj.Marker.E[i1].Name);
}
@@ -337,10 +329,10 @@ namespace KKdMainLib.Aet
for (i = 0; i < aet.Compositions.C; i++)
for (i0 = 0; i0 < aet.Compositions.E[i].C; i0++)
{
ref AetLayer obj = ref aet.Compositions.E[i].E[i0];
if (obj.Type == AetLayer.AetLayerType.Pic) obj.DataOffset = aet.Surfaces [obj.DataID].O;
else if (obj.Type == AetLayer.AetLayerType.Aif) obj.DataOffset = aet.SoundEffects[obj.DataID].O;
else if (obj.Type == AetLayer.AetLayerType.Eff) obj.DataOffset = aet.Compositions[obj.DataID].O;
ref Layer obj = ref aet.Compositions.E[i].E[i0];
if (obj.Type == Layer.AetLayerType.Pic) obj.DataOffset = aet.Surfaces [obj.DataID].O;
else if (obj.Type == Layer.AetLayerType.Aif) obj.DataOffset = aet.SoundEffects[obj.DataID].O;
else if (obj.Type == Layer.AetLayerType.Eff) obj.DataOffset = aet.Compositions[obj.DataID].O;
else obj.DataOffset = 0;
if (obj.DataOffset == 0)
{
@@ -360,7 +352,7 @@ namespace KKdMainLib.Aet
for (i0 = 0; i0 < aet.Compositions.E[i].C; i0++)
{
ref AetLayer obj = ref aet.Compositions.E[i].E[i0];
ref Layer obj = ref aet.Compositions.E[i].E[i0];
ref AnimationData data = ref obj.Data.V;
ref AnimationData.Perspective persp = ref data.Persp.V;
ref AudioData extraData = ref obj.ExtraData.V;
@@ -425,7 +417,7 @@ namespace KKdMainLib.Aet
for (i = 0; i < aet.Compositions.C; i++)
for (i0 = 0; i0 < aet.Compositions.E[i].C; i0++)
{
ref AetLayer obj = ref aet.Compositions.E[i].E[i0];
ref Layer obj = ref aet.Compositions.E[i].E[i0];
_IO.P = obj.Offset;
_IO.W(obj.Name.O);
@@ -452,7 +444,7 @@ namespace KKdMainLib.Aet
_IO.W(obj.Data.O);
_IO.W(obj.ExtraData.O);
ref CountPointer<AetMarker> Marker = ref obj.Marker;
ref CountPointer<Marker> Marker = ref obj.Marker;
_IO.P = Marker.O;
for (i1 = 0; i1 < Marker.C; i1++)
{
@@ -465,7 +457,7 @@ namespace KKdMainLib.Aet
for (i = 0; i < aet.Surfaces.C; i++)
{
ref AetSurface region = ref aet.Surfaces.E[i];
ref Surface region = ref aet.Surfaces.E[i];
if (region.Sprites.C == 0) continue;
_IO.P = region.Sprites.O;
for (i0 = 0; i0 < region.Sprites.C; i0++)
@@ -501,24 +493,24 @@ namespace KKdMainLib.Aet
_IO.W(0L);
}
private void RAL(ref AetComposition layer)
private void RAL(ref Composition layer)
{
for (i0 = 0; i0 < layer.C; i0++, i1++)
{
layer.E[i0].ID = i1;
ref AetLayer obj = ref layer.E[i0];
ref Layer obj = ref layer.E[i0];
_IO.P = obj.Offset = layer.O + i0 * 0x30;
obj.Name = _IO.RPS();
obj.StartFrame = _IO.RF32();
obj. EndFrame = _IO.RF32();
obj.StartOffset = _IO.RF32();
obj.PlaybackSpeed = _IO.RF32();
obj.Flags = (AetLayer.AetLayerFlags)_IO.RU16();
obj.Flags = (Layer.AetLayerFlags)_IO.RU16();
obj.Pad = _IO.RU8();
obj.Type = (AetLayer.AetLayerType)_IO.RU8();
obj.Type = (Layer.AetLayerType)_IO.RU8();
obj.DataOffset = _IO.RI32();
obj.ParentLayer = _IO.RI32();
obj.Marker = _IO.ReadCountPointer<AetMarker>();
obj.Marker = _IO.ReadCountPointer<Marker>();
obj.Data = _IO.RP<AnimationData>();
obj.ExtraData = _IO.RP<AudioData>();
@@ -590,7 +582,7 @@ namespace KKdMainLib.Aet
_IO.P = obj.Marker.O;
for (i2 = 0; i2 < obj.Marker.C; i2++)
obj.Marker[i2] = new AetMarker() { Frame = _IO.RF32(), Name = _IO.RPSSJIS() };
obj.Marker[i2] = new Marker() { Frame = _IO.RF32(), Name = _IO.RPSSJIS() };
}
}
@@ -639,7 +631,7 @@ namespace KKdMainLib.Aet
if ((aet = msgPack["Aet", true]).NotNull)
if (aet.Array != null && aet.Array.Length > 0)
{
AET.Data = new Pointer<AetData>[aet.Array.Length];
AET.Data = new Pointer<Data>[aet.Array.Length];
for (int i = 0; i < AET.Data.Length; i++)
MsgPackReader(aet.Array[i], ref AET.Data[i]);
}
@@ -657,11 +649,11 @@ namespace KKdMainLib.Aet
aet.WriteAfterAll(true, file, json);
}
public void MsgPackReader(MsgPack msgPack, ref Pointer<AetData> aetData)
public void MsgPackReader(MsgPack msgPack, ref Pointer<Data> aetData)
{
int i, i0;
aetData = default;
ref AetData aet = ref aetData.V;
ref Data aet = ref aetData.V;
aet.Name.V = msgPack.RS ("Name" );
aet.StartFrame = msgPack.RF32("StartFrame");
@@ -691,7 +683,7 @@ namespace KKdMainLib.Aet
aet.Surfaces.C = temp.Array.Length;
for (i = 0; i < aet.Surfaces.C; i++)
{
ref AetSurface region = ref aet.Surfaces.E[i];
ref Surface region = ref aet.Surfaces.E[i];
region = default;
region.Color = temp[i].RU32("Color" );
region.Width = temp[i].RU16("Width" );
@@ -703,7 +695,7 @@ namespace KKdMainLib.Aet
{
region.Sprites.C = sprite.Array.Length;
for (i0 = 0; i0 < region.Sprites.C; i0++)
region.Sprites[i0] = new AetSpriteIdentifier() { Name = new Pointer<string>()
region.Sprites[i0] = new SpriteIdentifier() { Name = new Pointer<string>()
{ V = sprite[i0].RS("Name") }, ID = sprite[i0].RU32("ID") };
}
sprite.Dispose();
@@ -715,7 +707,7 @@ namespace KKdMainLib.Aet
aet.Compositions.C = temp.Array.Length + 1;
for (i = 0; i < aet.Compositions.C - 1; i++)
{
ref AetComposition layer = ref aet.Compositions.E[i];
ref Composition layer = ref aet.Compositions.E[i];
layer = default;
MsgPack @object;
if ((@object = temp[i]["Object", true]).NotNull)
@@ -739,11 +731,11 @@ namespace KKdMainLib.Aet
temp.Dispose();
}
public MsgPack MsgPackWriter(ref Pointer<AetData> aetData)
public MsgPack MsgPackWriter(ref Pointer<Data> aetData)
{
int i, i0;
if (aetData.O <= 0) return MsgPack.Null;
ref AetData aet = ref aetData.V;
ref Data aet = ref aetData.V;
MsgPack msgPack = MsgPack.New.Add("Name", aet.Name.V).Add("StartFrame", aet.StartFrame)
.Add("EndFrame", aet.EndFrame).Add("FrameRate", aet.FrameRate)
@@ -766,7 +758,7 @@ namespace KKdMainLib.Aet
MsgPack layers = new MsgPack(aet.Compositions.C - 1, "Composition");
for (i = 0; i < aet.Compositions.C - 1; i++)
{
ref AetComposition layer = ref aet.Compositions.E[i];
ref Composition layer = ref aet.Compositions.E[i];
MsgPack Object = MsgPack.New.Add("ID", i);
if (layer.C > 0)
{
@@ -783,7 +775,7 @@ namespace KKdMainLib.Aet
MsgPack regions = new MsgPack(aet.Surfaces.C, "Surface");
for (i = 0; i < aet.Surfaces.C; i++)
{
ref AetSurface region = ref aet.Surfaces.E[i];
ref Surface region = ref aet.Surfaces.E[i];
MsgPack entry = MsgPack.New.Add("ID", i).Add("Width", region.Width)
.Add("Height", region.Height).Add("Color", region.Color);
@@ -808,7 +800,7 @@ namespace KKdMainLib.Aet
return msgPack;
}
private AetLayer RAO(ref AetLayer layer, MsgPack msg)
private Layer RAO(ref Layer layer, MsgPack msg)
{
uint i;
layer = default;
@@ -818,7 +810,7 @@ namespace KKdMainLib.Aet
layer. EndFrame = msg.RF32( "EndFrame" );
layer.StartOffset = msg.RF32("StartOffset" );
layer.PlaybackSpeed = msg.RF32("PlaybackSpeed");
layer.Flags = (AetLayer.AetLayerFlags)msg.RU16("Flags");
layer.Flags = (Layer.AetLayerFlags)msg.RU16("Flags");
layer.Pad = msg.RU8("Pad");
System.Enum.TryParse(msg.RS("Type"), out layer.Type);
layer.DataID = msg.RnI32("DataID" ) ?? -1;
@@ -906,7 +898,7 @@ namespace KKdMainLib.Aet
return kf;
}
private MsgPack WMP(ref AetLayer layer, string name = null)
private MsgPack WMP(ref Layer layer, string name = null)
{
int i;
MsgPack @object = new MsgPack(name).Add("ID", layer.ID).Add("Name", layer.Name.V)
+7 -9
View File
@@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
using KKdBaseLib;
using KKdMainLib.IO;
using A3DADict = System.Collections.Generic.Dictionary<string, object>;
namespace KKdMainLib.DB
{
@@ -15,8 +15,7 @@ namespace KKdMainLib.DB
public void BINReader(string file)
{
Dictionary<string, object> dict = new Dictionary<string, object>();
string[] dataArray;
A3DADict dict = new A3DADict();
_IO = File.OpenReader(file + ".bin");
@@ -27,13 +26,10 @@ namespace KKdMainLib.DB
if (signature != 0x5F5F5F41) return;
_IO.RI64();
string[] strData = _IO.RS(_IO.L - _IO.P).Replace("\r", "").Split('\n');
string[] strData = _IO.RS(_IO.L - _IO.P).Replace("\r\n", "\n").Replace("\r", "\n").Split('\n');
for (i = 0; i < strData.Length; i++)
{
dataArray = strData[i].Split('=');
if (dataArray.Length == 2)
dict.GetDictionary(dataArray[0], dataArray[1]);
}
dict.GetDictionary(strData[i]);
strData = null;
if (dict.FindValue(out string value, "category.length"))
{
@@ -56,6 +52,8 @@ namespace KKdMainLib.DB
}
_IO.C();
dict.Clear();
dict = null;
}
public void BINWriter(string file)
+10 -22
View File
@@ -105,7 +105,7 @@ namespace KKdMainLib
msgPack.Dispose();
}
public void MsgPackWriter(string file, bool json, bool Compact = true)
public void MsgPackWriter(string file, bool json)
{
if (!Success) return;
MsgPack msgPack = MsgPack.New;
@@ -123,11 +123,10 @@ namespace KKdMainLib
else if (file.Contains("PvList"))
{
if (pvList != null)
{
if (Compact) msgPack.Add("Compact", Compact);
{msgPack.Add("Compact", true);
MsgPack PvList = new MsgPack(pvList.Length, "PvList");
for (i = 0; i < pvList.Length; i++) PvList[i] = pvList[i].WriteMP(Compact);
for (i = 0; i < pvList.Length; i++) PvList[i] = pvList[i].WriteMP();
msgPack.Add(PvList);
}
else msgPack.Add(new MsgPack("PvList", null));
@@ -140,7 +139,8 @@ namespace KKdMainLib
private bool disposed;
public void Dispose()
{ if (!disposed) { if (_IO != null) _IO.Dispose(); psrData = null; pvList = null; Success = false; disposed = true; } }
{ if (!disposed) { if (_IO != null) _IO.Dispose(); psrData = null;
pvList = null; Success = false; disposed = true; } }
public struct PsrData
{
@@ -287,26 +287,16 @@ namespace KKdMainLib
temp.Dispose();
}
public MsgPack WriteMP(bool Compact)
public MsgPack WriteMP()
{
MsgPack msgPack = MsgPack.New;
msgPack.Add("ID", PV_ID);
if (!Enable) msgPack.Add("Enable", Enable);
if ( Extra ) msgPack.Add("Extra" , Extra );
if (Compact)
{
if (AdvDemoStart.WU) msgPack.Add("AdvDemoStart", AdvDemoStart.WI());
if (AdvDemoEnd .WL) msgPack.Add("AdvDemoEnd" , AdvDemoEnd .WI());
if (StartShow .WL) msgPack.Add("StartShow" , StartShow .WI());
if ( EndShow .WU) msgPack.Add( "EndShow" , EndShow .WI());
}
else
{
if (AdvDemoStart.WU) msgPack.Add(AdvDemoStart.WriteMP("AdvDemoStart"));
if (AdvDemoEnd .WL) msgPack.Add(AdvDemoEnd .WriteMP("AdvDemoEnd" ));
if (StartShow .WL) msgPack.Add(StartShow .WriteMP("StartShow" ));
if ( EndShow .WU) msgPack.Add( EndShow .WriteMP( "EndShow" ));
}
if (AdvDemoStart.WU) msgPack.Add("AdvDemoStart", AdvDemoStart.WI());
if (AdvDemoEnd .WL) msgPack.Add("AdvDemoEnd" , AdvDemoEnd .WI());
if (StartShow .WL) msgPack.Add("StartShow" , StartShow .WI());
if ( EndShow .WU) msgPack.Add( "EndShow" , EndShow .WI());
return msgPack;
}
@@ -323,9 +313,7 @@ namespace KKdMainLib
private int day;
public int Year { get => year; set { year = value; CheckDate(); } }
public int Month { get => month; set { month = value; CheckDate(); } }
public int Day { get => day; set { day = value; CheckDate(); } }
public bool WU => Year != 2029 || Month != 1 || Day != 1;
+24 -23
View File
@@ -14,23 +14,22 @@ namespace KKdMainLib
public FARC(string File, bool IsDirectory = false)
{ if (IsDirectory) DirectoryPath = File; else FilePath = File; NewFARC(); }
private void NewFARC() { Files = KKdList<FARCFile>.New; Signature = Farc.FArC; cbc = ft = false; }
private void NewFARC() { Files = KKdList<FARCFile>.New; Signature = Farc.FArC; Format = Format.DT; }
public KKdList<FARCFile> Files = KKdList<FARCFile>.New;
public Type FARCType;
public Farc Signature = Farc.FArC;
public Format Format = Format.DT;
public string FilePath, DirectoryPath;
public bool HasFiles => Files.IsNull ? false : Files.Count > 0;
private bool cbc, ft;
private readonly byte[] key = Text.ToASCII("project_diva.bin");
private readonly byte[] keyFT = { 0x13, 0x72, 0xD5, 0x7B, 0x6E, 0x9E,
0x31, 0xEB, 0xA2, 0x39, 0xB8, 0x3C, 0x15, 0x57, 0xC6, 0xBB };
private AesManaged GetAes(bool isFT, byte[] iv) =>
new AesManaged { KeySize = 128, Key = isFT ? keyFT : key,
new AesManaged () { KeySize = 128, Key = isFT ? keyFT : key,
BlockSize = 128, Mode = isFT ? CipherMode.CBC : CipherMode.ECB,
Padding = PaddingMode.Zeros, IV = iv ?? new byte[16] };
@@ -53,12 +52,11 @@ namespace KKdMainLib
{
FARCType = (Type)reader.RI32E(true);
reader.RI32();
int farcMode = reader.RI32E(true);
ft = farcMode == 0x10;
cbc = farcMode != 0x10 && farcMode != 0x40;
if (cbc && (FARCType & Type.ECB) != 0)
Format = (FARCType & Type.ECB) != 0 && (farcMode & (farcMode - 1)) != 0 ? Format.FT : Format.DT;
if (Format == Format.FT && (FARCType & Type.ECB) != 0)
{
reader.Dispose();
byte[] header = new byte[headerLength - 0x08];
@@ -73,7 +71,6 @@ namespace KKdMainLib
reader = File.OpenReader(header);
farcMode = reader.RI32E(true);
ft = farcMode == 0x10;
}
}
@@ -90,9 +87,9 @@ namespace KKdMainLib
{
reader.NT();
reader.RI32();
if (Signature != Farc.FArc ) reader.RI32();
if (Signature != Farc.FArc) reader.RI32();
reader.RI32();
if (Signature == Farc.FARC && ft) reader.RI32();
if (Signature == Farc.FARC && Format == Format.FT) reader.RI32();
Count++;
}
reader.PI64 = Position;
@@ -106,7 +103,7 @@ namespace KKdMainLib
file.Offset = reader.RI32E(true);
if (Signature != Farc.FArc) file.SizeComp = reader.RI32E(true);
file.SizeUnc = reader.RI32E(true);
if (Signature == Farc.FARC && ft)
if (Signature == Farc.FARC && Format == Format.FT)
file.Type = (Type)reader.RI32E(true);
Files.Add(file);
}
@@ -166,7 +163,7 @@ namespace KKdMainLib
bool encrypted = false;
if ((FARCType & Type.ECB) != 0)
{
if ((ft && (file.Type & Type.ECB) != 0) || cbc)
if (Format == Format.FT && (file.Type & Type.ECB) != 0)
{
using (AesManaged aes = GetAes(true, null))
using (CryptoStream cryptoStream = new CryptoStream(stream,
@@ -183,7 +180,7 @@ namespace KKdMainLib
}
bool compressed = false;
if (((ft && (file.Type & Type.GZip) != 0) ||
if (((Format == Format.FT && (file.Type & Type.GZip) != 0) ||
(FARCType & Type.GZip) != 0) && file.SizeUnc > 0)
{
GZipStream gZipStream = new GZipStream(encrypted ? new MSIO.MemoryStream(file.Data) :
@@ -258,21 +255,26 @@ namespace KKdMainLib
else if (Signature == Farc.FARC)
{
headerWriter.WE((int)FARCType, true);
headerWriter.W (0x00);
headerWriter.W (0x00);
headerWriter.WE(0x40, true);
headerWriter.W (0x00);
headerWriter.W (0x00);
headerWriter.W (0x00);
}
int HeaderPartLength = Signature == Farc.FArc ? 0x09 : 0x0D;
for (int i = 0; i < Files.Count; i++)
headerWriter.L += Path.GetFileName(Files[i].Name).Length + HeaderPartLength + 1;
if (Signature != Farc.FArc)
for (int i = 0; i < Files.Count; i++)
{ headerWriter.W(Files[i].Name + "\0"); headerWriter.W(0x00L); headerWriter.W(0x00); }
else
for (int i = 0; i < Files.Count; i++)
{ headerWriter.W(Files[i].Name + "\0"); headerWriter.W(0x00L); }
writer.WE(headerWriter.L, true);
writer.W(headerWriter.ToArray(true));
writer.W (headerWriter.ToArray(true));
}
int align = writer.P.A(0x10) - writer.P;
for (int i1 = 0; i1 < align; i1++)
writer.W((byte)(Signature == Farc.FArc ? 0x00 : 0x78));
writer.F();
for (int i = 0; i < Files.Count; i++)
CompressStuff(i, ref writer);
@@ -280,10 +282,9 @@ namespace KKdMainLib
for (int i = 0; i < Files.Count; i++)
{
FARCFile file = Files[i];
writer.W(Path.GetFileName(file.Name) + "\0");
writer.W (file.Name + "\0");
writer.WE(file.Offset, true);
if (Signature != Farc.FArc)
writer.WE(file.SizeComp, true);
if (Signature != Farc.FArc) writer.WE(file.SizeComp, true);
writer.WE(file.SizeUnc, true);
}
writer.Dispose();
+1 -1
View File
@@ -113,7 +113,7 @@ namespace KKdMainLib.IO
KKdList<MsgPack> obj = KKdList<MsgPack>.New;
if (!Extensions.As(_IO, '[')) return null;
if (_IO.SW().PCUTF8() == ']')
{ _IO.RCUTF8(); return null; }
{ _IO.RCUTF8(); return obj.ToArray(); }
char c;
while (true)
+3 -1
View File
@@ -196,7 +196,7 @@ namespace KKdMainLib.IO
case float val: W(val); break;
case double val: W(val); break;
case string val: W(val); break;
case MsgPack.Ext val: WE(val); break;
case MsgPack.Ext val: W(val); break;
}
}
@@ -266,6 +266,8 @@ namespace KKdMainLib.IO
else { _IO.W(0xDF); _IO.WE( val, true); }
}
private void W(MsgPack.Ext val) => WE(val);
private void WE(MsgPack.Ext val)
{
if (val.Data == null) { WN(); return; }
+3 -3
View File
@@ -4,14 +4,14 @@
<Authors>korenkonder</Authors>
<Company></Company>
<Configuration></Configuration>
<Copyright>korenkonder © 2018-2019</Copyright>
<Copyright>korenkonder © 2018-2020</Copyright>
<Description>A simple library for working with Project Diva AC/DT/F/AFT/F2/X/FT files</Description>
<FileVersion>0.4.8.1</FileVersion>
<FileVersion>0.4.8.2</FileVersion>
<PackageId>KKdMainLib</PackageId>
<Product>KKdMainLib</Product>
<TargetFramework>netstandard2.0</TargetFramework>
<Title>KKdMainLib</Title>
<Version>0.4.8.1</Version>
<Version>0.4.8.2</Version>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
+39 -53
View File
@@ -3,6 +3,7 @@ using System.Linq;
using System.Globalization;
using System.Collections.Generic;
using KKdBaseLib;
using A3DADict = System.Collections.Generic.Dictionary<string, object>;
namespace KKdMainLib
{
@@ -38,14 +39,12 @@ namespace KKdMainLib
return s;
}
public static bool StartsWith(this Dictionary<string, object> dict, string args, char split = '.') =>
public static bool StartsWith(this A3DADict dict, string args, char split = '.') =>
dict.StartsWith(args.Split(split));
public static bool StartsWith(this Dictionary<string, object> dict, string[] args)
public static bool StartsWith(this A3DADict dict, string[] args)
{
Dictionary<string, object> bufDict = new Dictionary<string, object>();
if (dict == null) return false;
else if (args.Length < 1) return false;
if (dict == null || args.Length < 1) return false;
args[0] = args[0].ToLower();
if (args.Length > 1)
@@ -53,82 +52,64 @@ namespace KKdMainLib
string[] newArgs = new string[args.Length - 1];
for (int i = 0; i < args.Length - 1; i++)
newArgs[i] = args[i + 1];
if (!dict.ContainsKey(args[0]))
return false;
bufDict = (Dictionary<string, object>)dict[args[0]];
return StartsWith(bufDict, newArgs);
return dict.ContainsKey(args[0]) ? StartsWith((A3DADict)dict[args[0]], newArgs) : false;
}
return dict.ContainsKey(args[0]);
}
public static bool FindValue(this Dictionary<string, object> dict,
ref bool value, char split, string args) =>
public static bool FindValue(this A3DADict dict, ref bool value, char split, string args) =>
dict.FindValue(out string val, args.Split(split)) ? bool.TryParse(val, out value) : false;
public static bool FindValue(this Dictionary<string, object> dict,
ref int value, char split, string args) =>
public static bool FindValue(this A3DADict dict, ref int value, char split, string args) =>
dict.FindValue(out string val, args.Split(split)) ? int.TryParse(val, out value) : false;
public static bool FindValue(this Dictionary<string, object> dict,
ref float value, char split, string args) =>
public static bool FindValue(this A3DADict dict, ref float value, char split, string args) =>
dict.FindValue(out string val, args.Split(split)) ? val.ToF32( out value) : false;
public static bool FindValue(this Dictionary<string, object> dict,
ref double value, char split, string args) =>
public static bool FindValue(this A3DADict dict, ref double value, char split, string args) =>
dict.FindValue(out string val, args.Split(split)) ? val.ToF64( out value) : false;
public static bool FindValue(this Dictionary<string, object> Dict,
ref string value, char split, string args)
{ if (Dict.FindValue(out string val, args.Split(split)))
public static bool FindValue(this A3DADict dict, ref string value, char split, string args)
{ if (dict.FindValue(out string val, args.Split(split)))
{ value = val; return true; } return false; }
public static bool FindValue(this Dictionary<string, object> dict,
out bool value, string args)
public static bool FindValue(this A3DADict dict, out bool value, string args)
{ if (dict.FindValue(out string val, args.Split('.' )))
return bool.TryParse(val, out value); value = false; return false; }
public static bool FindValue(this Dictionary<string, object> Dict,
out int value, string args)
{ if (Dict.FindValue(out string val, args.Split('.' )))
public static bool FindValue(this A3DADict dict, out int value, string args)
{ if (dict.FindValue(out string val, args.Split('.' )))
return int.TryParse(val, out value); value = 0; return false; }
public static bool FindValue(this Dictionary<string, object> dict,
out float value, string args)
public static bool FindValue(this A3DADict dict, out float value, string args)
{ if (dict.FindValue(out string val, args.Split('.' )))
return val.ToF32(out value); value = 0; return false; }
public static bool FindValue(this Dictionary<string, object> dict,
out double value, string args)
public static bool FindValue(this A3DADict dict, out double value, string args)
{ if (dict.FindValue(out string val, args.Split('.' )))
return val.ToF64(out value); value = 0; return false; }
public static bool FindValue(this Dictionary<string, object> dict,
out int? value, string args)
public static bool FindValue(this A3DADict dict, out int? value, string args)
{ if (dict.FindValue(out string val, args.Split('.' )))
{ bool Val = int.TryParse(val, out int _value);
value = _value; return Val; } value = null; return false; }
public static bool FindValue(this Dictionary<string, object> dict,
out float? value, string args)
public static bool FindValue(this A3DADict dict, out float? value, string args)
{ if (dict.FindValue(out string val, args.Split('.' )))
return val.ToF32(out value); value = null; return false; }
public static bool FindValue(this Dictionary<string, object> dict,
out double? value, string args)
public static bool FindValue(this A3DADict dict, out double? value, string args)
{ if (dict.FindValue(out string val, args.Split('.' )))
return val.ToF64(out value); value = null; return false; }
public static bool FindValue(this Dictionary<string, object> dict,
out string value, string args)
public static bool FindValue(this A3DADict dict, out string value, string args)
{ if (dict.FindValue(out string val, args.Split('.' )))
{ value = val; return true; } value = null; return false; }
public static bool FindValue(this Dictionary<string, object> dict,
out string value, string[] args)
public static bool FindValue(this A3DADict dict, out string value, string[] args)
{
value = "";
if (dict == null) return false;
else if (args.Length < 1) return false;
if (dict == null || args.Length < 1) return false;
args[0] = args[0].ToLower();
if (!dict.ContainsKey(args[0])) return false;
@@ -136,12 +117,12 @@ namespace KKdMainLib
{
string[] newArgs = new string[args.Length - 1];
for (int i = 0; i < args.Length - 1; i++) newArgs[i] = args[i + 1];
return ((Dictionary<string, object>)dict[args[0]]).FindValue(out value, newArgs);
return ((A3DADict)dict[args[0]]).FindValue(out value, newArgs);
}
else if (args.Length == 1)
{
if (dict[args[0]].GetType() == dict.GetType())
return ((Dictionary<string, object>)dict[args[0]]).FindValue(out value, args);
return ((A3DADict)dict[args[0]]).FindValue(out value, args);
else if (dict[args[0]].GetType() != typeof(string)) return false;
}
@@ -149,15 +130,20 @@ namespace KKdMainLib
return true;
}
public static void GetDictionary(this Dictionary<string, object> dict,
string args, string value, char split = '.') =>
public static void GetDictionary(this A3DADict dict, string args, char split = '.')
{
string[] dataArray = args.Split('=');
if (dataArray.Length == 2)
dict.GetDictionary(dataArray[0].Split(split), dataArray[1]);
dataArray = null;
}
public static void GetDictionary(this A3DADict dict, string args, string value, char split = '.') =>
dict.GetDictionary(args.Split(split), value);
public static void GetDictionary(this Dictionary<string, object> dict,
string[] args, string value)
public static void GetDictionary(this A3DADict dict, string[] args, string value)
{
Dictionary<string, object> bufDict = new Dictionary<string, object>();
if (dict == null) dict = new Dictionary<string, object>();
if (dict == null) dict = new A3DADict();
else if (args.Length < 1) return;
args[0] = args[0].ToLower();
@@ -169,10 +155,10 @@ namespace KKdMainLib
if (dict[args[0]] != null)
{
if (dict[args[0]].GetType() == typeof(string))
dict[args[0]] = new Dictionary<string, object> { { "", dict[args[0]] } };
dict[args[0]] = new A3DADict { { "", dict[args[0]] } };
}
else dict[args[0]] = new Dictionary<string, object>();
bufDict = (Dictionary<string, object>)dict[args[0]];
else dict[args[0]] = new A3DADict();
A3DADict bufDict = (A3DADict)dict[args[0]];
bufDict.GetDictionary(newArgs, value);
dict[args[0]] = bufDict;
}
+1 -1
View File
@@ -4,7 +4,7 @@
<Authors>korenkonder</Authors>
<Company></Company>
<Configuration></Configuration>
<Copyright>korenkonder © 2019</Copyright>
<Copyright>korenkonder © 2019-2020</Copyright>
<Description>A simple library for working with Project Diva F/AFT/F2/X/FT audio files</Description>
<FileVersion>0.1.1.1</FileVersion>
<PackageId>KKdSoundLib</PackageId>
+31 -11
View File
@@ -57,8 +57,9 @@ namespace PD_Tool
ConsoleDesign("4. Encrypt to DIVAFILE");
ConsoleDesign("5. DB_Tools");
ConsoleDesign("6. AC/DT/F/AFT/FT Converting Tools");
ConsoleDesign("7. F/F2/X/FT Converting Tools");
ConsoleDesign(json ? "8. MsgPack to JSON" : "9. JSON to MsgPack");
ConsoleDesign("7. F/F2/FT Converting Tools");
ConsoleDesign("8. X/XHD Converting Tools");
ConsoleDesign(json ? "9. MsgPack to JSON" : "9. JSON to MsgPack");
ConsoleDesign(false);
ConsoleDesign(json ? "M. MessagePack" : "J. JSON");
ConsoleDesign("Q. Quit");
@@ -95,9 +96,8 @@ namespace PD_Tool
ConsoleDesign("3. DataBank");
ConsoleDesign("4. DEX" );
ConsoleDesign("5. DIVA" );
ConsoleDesign("6. MotHead" );
ConsoleDesign("7. MOT" );
ConsoleDesign("8. STR" );
ConsoleDesign("6. MOT" );
ConsoleDesign("7. STR" );
ConsoleDesign(false);
ConsoleDesign("R. Return to Main Menu");
ConsoleDesign(false);
@@ -109,14 +109,14 @@ namespace PD_Tool
else if (localChoose == "3") DB .Processor(json);
else if (localChoose == "4") DEX.Processor(json);
else if (localChoose == "5") DIV.Processor();
else if (localChoose == "6") MOT.Processor(json);
else if (localChoose == "7") STR.Processor(json);
else if (localChoose == "7") MOT.Processor(json);
else if (localChoose == "8") STR.Processor(json);
else choose = localChoose;
}
else if (choose == "7")
{
Console.Clear();
Console.Title = "F/F2/X/FT Converting Tools";
Console.Title = "F/F2/FT Converting Tools";
ConsoleDesign(true);
ConsoleDesign(" Choose converter:");
ConsoleDesign(false);
@@ -126,9 +126,8 @@ namespace PD_Tool
ConsoleDesign("4. DEX" );
ConsoleDesign("5. DOF" );
ConsoleDesign("6. Light" );
ConsoleDesign("7. Particles" );
ConsoleDesign("8. STR" );
ConsoleDesign("9. VAG" );
ConsoleDesign("7. STR" );
ConsoleDesign("8. VAG" );
ConsoleDesign(false);
ConsoleDesign("R. Return to Main Menu");
ConsoleDesign(false);
@@ -146,6 +145,27 @@ namespace PD_Tool
else choose = localChoose;
}
else if (choose == "8")
{
Console.Clear();
Console.Title = "X Converting Tools";
ConsoleDesign(true);
ConsoleDesign(" Choose converter:");
ConsoleDesign(false);
ConsoleDesign("1. A3DA" );
ConsoleDesign("2. DEX" );
ConsoleDesign("3. VAG" );
ConsoleDesign(false);
ConsoleDesign("R. Return to Main Menu");
ConsoleDesign(false);
ConsoleDesign(true);
Console.WriteLine();
string localChoose = Console.ReadLine();
if (localChoose == "1") A3D.Processor(json);
else if (localChoose == "2") DEX.Processor(json);
else if (localChoose == "3") VAG.Processor();
else choose = localChoose;
}
else if (choose == "9")
{
Console.Title = json ? "MsgPack to JSON" : "JSON to MsgPack";
Choose(1, json ? "mp" : "json", out string[] fileNames);
+3 -3
View File
@@ -6,10 +6,10 @@ using System.Runtime.InteropServices;
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("PD_Tool")]
[assembly: AssemblyCopyright("korenkonder © 2017-2019")]
[assembly: AssemblyCopyright("korenkonder © 2017-2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: Guid("7B5D5A3A-A6F8-4813-C97D-ACFC98F7397E")]
[assembly: AssemblyVersion("0.4.8.1")]
[assembly: AssemblyFileVersion("0.4.8.1")]
[assembly: AssemblyVersion("0.4.8.2")]
[assembly: AssemblyFileVersion("0.4.8.2")]
+1 -1
View File
@@ -1,6 +1,6 @@
using System;
using KKdMainLib.IO;
using KKdAet = KKdMainLib.Aet.Aet;
using KKdAet = KKdMainLib.Aet;
namespace PD_Tool
{
+1 -16
View File
@@ -16,21 +16,6 @@ namespace PD_Tool
if (file.EndsWith(".mp" )) { mp = false; break; }
else if (file.EndsWith(".json")) { mp = false; break; }
string choose = "1";
if (mp)
{
Console.Clear();
Program.ConsoleDesign(true);
Program.ConsoleDesign(" Choose type of exporting file:");
Program.ConsoleDesign(false);
Program.ConsoleDesign("1. Compact");
Program.ConsoleDesign("2. Normal");
Program.ConsoleDesign(false);
Program.ConsoleDesign(true);
Console.WriteLine();
choose = Console.ReadLine();
}
uint num2 = (uint)DateTime.Now.Subtract(new DateTime(1970, 1, 1)).TotalSeconds;
string[] file_split;
string filepath, ext;
@@ -51,7 +36,7 @@ namespace PD_Tool
Console.Title = "DataBank Converter: " + filename;
db. DBReader(file);
db.MsgPackWriter(filepath + file_split[0] + "_" +
file_split[1] + "_" + file_split[2], json, choose != "2");
file_split[1] + "_" + file_split[2], json);
}
else if ((ext == ".mp" || ext == ".json") && !mp)
{
+14 -4
View File
@@ -1,21 +1,31 @@
# PD_Tool
A simple tool for working with Project Diva DT/FT/F/F2/X files
A simple tool for working with Project Diva AC/DT/F/AFT/F2/X/FT files
# Dependencies:
+ `.NET Standard 2.0`: Required to build KKdBaseLib, KKdMainLib and KKdSoundLib C# projects.
+ `.NET Framework 4.6.1`: Required to run/build PD_Tool C# project.
# Tools:
- `FARC Extract/Create`
- `DIVAFILE Encrypt/Decrypt`
- `DIVAFILE Decrypt/Encrypt`
- `DB_Tools`
- `Aet DB Converter`
- `Auth DB Converter`
- `Spr DB Converter`
- `Converting Tools`
- `AC/DT/F/AFT/FT Converting Tools`
- `A3DA Converter`
- `AET Converter`
- `DataBank Converter`
- `DEX Converter`
- `DIVA Converter`
- `MOT Converter`
- `STR Converter`
- `F/F2/X/FT Converting Tools`
- `A3DA Converter`
- `Bloom Converter`
- `Color Correction Converter`
- `DEX Converter`
- `DOF Converter`
- `Light Converter`
- `STR Converter`
- `VAG Converter`