Skip to content

Commit

Permalink
Fixed NJM reading (was always reading 16 bit before)
Browse files Browse the repository at this point in the history
  • Loading branch information
Justin113D committed Apr 1, 2024
1 parent e6390ad commit 3776564
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/SA3D.Modeling/File/AnimationFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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)
{
Expand All @@ -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
Expand Down

0 comments on commit 3776564

Please sign in to comment.