From 3776564cc6c3a38e7e2933c3e62d8649a388578b Mon Sep 17 00:00:00 2001 From: Justin113D Date: Mon, 1 Apr 2024 11:20:16 +0200 Subject: [PATCH] Fixed NJM reading (was always reading 16 bit before) --- src/SA3D.Modeling/File/AnimationFile.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/SA3D.Modeling/File/AnimationFile.cs b/src/SA3D.Modeling/File/AnimationFile.cs index 7998a51..9659d1d 100644 --- a/src/SA3D.Modeling/File/AnimationFile.cs +++ b/src/SA3D.Modeling/File/AnimationFile.cs @@ -173,7 +173,7 @@ public static AnimationFile Read(EndianStackReader reader, uint address, uint? n { if(reader.ReadUInt(address) == NMDM) { - return ReadNM(reader, address, nodeCount); + return ReadNM(reader, address, nodeCount, shortRot); } else if((reader.ReadULong(address) & HeaderMask) == SAANIM) { @@ -190,7 +190,7 @@ public static AnimationFile Read(EndianStackReader reader, uint address, uint? n } } - private static AnimationFile ReadNM(EndianStackReader reader, uint address, uint? nodeCount) + private static AnimationFile ReadNM(EndianStackReader reader, uint address, uint? nodeCount, bool shortrot) { if(nodeCount == null) { @@ -206,7 +206,7 @@ private static AnimationFile ReadNM(EndianStackReader reader, uint address, uint { uint dataAddress = address + 8; reader.ImageBase = unchecked((uint)-dataAddress); - Motion motion = Motion.Read(reader, dataAddress, nodeCount.Value, new(), true); + Motion motion = Motion.Read(reader, dataAddress, nodeCount.Value, new(), shortrot); return new(motion, new()); } finally