Skip to content

Commit

Permalink
Merge pull request #396 from RagnarokResearchLab/act-mystery-bytes
Browse files Browse the repository at this point in the history
Add ACT mystery bytes to the FileAnalyzer
  • Loading branch information
rdw-software authored Sep 25, 2024
2 parents 6344e7d + 566a8bd commit 64d44d6
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
32 changes: 32 additions & 0 deletions Tests/Tools/FileAnalyzer.spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,38 @@ describe("FileAnalyzer", function()
assertEquals(analysisResult.fields.version[2.5], 1)

assertEquals(analysisResult.fields.numAnimationClips[1], 5)

assertEquals(analysisResult.fields.animationFrameMysteryBytes, {
[-2004318072] = 1,
[-1532779871] = 1,
[-1465473371] = 1,
[-1263291727] = 1,
[0] = 11,
[4] = 1,
[32] = 1,
[66] = 1,
[145] = 1,
[480] = 1,
[640] = 1,
[724] = 1,
[904] = 1,
[1750] = 1,
[2366] = 1,
[3535] = 1,
[6757] = 1,
[6778] = 1,
[54647] = 1,
[67305985] = 2,
[134678021] = 2,
[286331153] = 1,
[572662306] = 1,
[858993459] = 1,
[1145324612] = 1,
[1431655765] = 1,
[1717986918] = 1,
[2004318071] = 1,
})
assertEquals(analysisResult.fields.spriteAnchorMysteryBytes, {})
end)
end)

Expand Down
19 changes: 19 additions & 0 deletions Tools/FileAnalyzer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@ function FileAnalyzer:AnalyzeACT(actFiles)
version = {},
numAnimationClips = {},
unknownHeaderField = {},
animationFrameMysteryBytes = {},
spriteAnchorMysteryBytes = {},
},
}

Expand Down Expand Up @@ -213,6 +215,23 @@ function FileAnalyzer:AnalyzeACT(actFiles)
analysisResult.fields.unknownHeaderField[act.unknownHeaderField] = analysisResult.fields.unknownHeaderField[act.unknownHeaderField]
+ 1

for _, clip in ipairs(act.animationClips) do
for _, frame in ipairs(clip.animationFrames) do
for _, bytes in ipairs(frame.mysteryBytes) do
analysisResult.fields.animationFrameMysteryBytes[bytes] = analysisResult.fields.animationFrameMysteryBytes[bytes]
or 0
analysisResult.fields.animationFrameMysteryBytes[bytes] = analysisResult.fields.animationFrameMysteryBytes[bytes]
+ 1
for _, anchor in ipairs(frame.anchors) do
analysisResult.fields.spriteAnchorMysteryBytes[anchor.mysteryBytes] = analysisResult.fields.spriteAnchorMysteryBytes[anchor.mysteryBytes]
or 0
analysisResult.fields.spriteAnchorMysteryBytes[anchor.mysteryBytes] = analysisResult.fields.spriteAnchorMysteryBytes[anchor.mysteryBytes]
+ 1
end
end
end
end

analysisResult.numFilesAnalyzed = analysisResult.numFilesAnalyzed + 1
end

Expand Down

0 comments on commit 64d44d6

Please sign in to comment.