summaryrefslogtreecommitdiff
path: root/NW4RTools/Models
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2012-02-20 05:30:01 +0100
committerTreeki <treeki@gmail.com>2012-02-20 05:30:01 +0100
commit31380b4bb93d1fb65faff8f71753de80fb0a8c9d (patch)
tree8880321028df33877fec9af6c424afe48e7ac4ef /NW4RTools/Models
parent364e99d849378546323d1d06307b6773e813b742 (diff)
downloadnw4rtools-31380b4bb93d1fb65faff8f71753de80fb0a8c9d.tar.gz
nw4rtools-31380b4bb93d1fb65faff8f71753de80fb0a8c9d.zip
AnmChr/Clr/TexSrt writing done for now. Not 100% perfect but it works!
Diffstat (limited to 'NW4RTools/Models')
-rw-r--r--NW4RTools/Models/Animation/CharacterAnim.cs2
-rw-r--r--NW4RTools/Models/Animation/Shared.cs40
-rwxr-xr-x[-rw-r--r--]NW4RTools/Models/ByteCode.cs3
3 files changed, 44 insertions, 1 deletions
diff --git a/NW4RTools/Models/Animation/CharacterAnim.cs b/NW4RTools/Models/Animation/CharacterAnim.cs
index dd496f6..72efd56 100644
--- a/NW4RTools/Models/Animation/CharacterAnim.cs
+++ b/NW4RTools/Models/Animation/CharacterAnim.cs
@@ -81,6 +81,8 @@ namespace NW4RTools.Models.Animation {
public STFormatType ScaleFormat;
public STFormatType TranslateFormat;
public RotateFormatType RotateFormat;
+
+ public bool ScaleUseModel, RotateUseModel, TranslateUseModel;
}
public CharacterAnim() {
diff --git a/NW4RTools/Models/Animation/Shared.cs b/NW4RTools/Models/Animation/Shared.cs
index f87bea6..62cca94 100644
--- a/NW4RTools/Models/Animation/Shared.cs
+++ b/NW4RTools/Models/Animation/Shared.cs
@@ -28,5 +28,45 @@ namespace NW4RTools.Models.Animation {
Values = null;
FloatValues = null;
}
+
+
+ public bool IsConstWith(float cv) {
+ return (IsConstant && (ConstValue == cv));
+ }
+
+
+ public override bool Equals(object obj) {
+ return obj is KeyframeAnim && this == (KeyframeAnim)obj;
+ }
+
+ public override int GetHashCode() {
+ return
+ IsConstant.GetHashCode() ^
+ ConstValue.GetHashCode() ^
+ BaseValue.GetHashCode() ^
+ Multiplier.GetHashCode() ^
+ Misc.ArrayHash(Keyframes) ^
+ Misc.ArrayHash(Values) ^
+ Misc.ArrayHash(FloatValues);
+ }
+
+ public static bool operator ==(KeyframeAnim x, KeyframeAnim y) {
+ return
+ (x.IsConstant == y.IsConstant) &&
+ (x.ConstValue == y.ConstValue) &&
+ (x.BaseValue == y.BaseValue) &&
+ (x.Multiplier == y.Multiplier) &&
+ Misc.ArrayCompare(x.Keyframes, y.Keyframes) &&
+ Misc.ArrayCompare(x.Values, y.Values) &&
+ Misc.ArrayCompare(x.FloatValues, y.FloatValues);
+ }
+
+ public static bool operator !=(KeyframeAnim x, KeyframeAnim y) {
+ return !(x == y);
+ }
+
+ public void Dump() {
+ Console.WriteLine("IsC:{0} CV:{1} KF:{2} BV:{3} M:{4} V:{5} FV:{6}", IsConstant, ConstValue, Keyframes, BaseValue, Multiplier, Values, FloatValues);
+ }
}
}
diff --git a/NW4RTools/Models/ByteCode.cs b/NW4RTools/Models/ByteCode.cs
index 6df6dee..62968e9 100644..100755
--- a/NW4RTools/Models/ByteCode.cs
+++ b/NW4RTools/Models/ByteCode.cs
@@ -50,7 +50,8 @@ namespace NW4RTools.Models {
public UInt16 MaterialID;
public UInt16 ShapeID;
- public UInt16 NodeID;
+ public UInt16 NodeID;
+ public byte Unk;
}
// According to BrawlLib: in NodeMix, this is for "primary influences"