Skip to content

Library/Anim: Implement AnimInfo#1127

Open
german77 wants to merge 1 commit into
MonsterDruide1:masterfrom
german77:AnimInfo
Open

Library/Anim: Implement AnimInfo#1127
german77 wants to merge 1 commit into
MonsterDruide1:masterfrom
german77:AnimInfo

Conversation

@german77
Copy link
Copy Markdown
Contributor

@german77 german77 commented Apr 27, 2026

AnimInfo uses binary search and heap sort to speed up lookup times. However there are some clues to inline code here. For starters heap sort is almost identical to PtrArray heap sort. Binary search uses both strcmp and isEqualString which probably means mInfoEntries is a sead object.

Similarly to PtrArray implementations. I wasn't able to fully clean the code. But I did manage to get the proper for loops for this one.

Finaly tryFindAnimInfo and findAnimInfo generate different assembly code. No idea on how to match that. _ZNK2al13AnimInfoTable15tryFindAnimInfoEPKc


This change is Reviewable


Report for 1.0 (a76cdfb - 12c0198)

📈 Matched code: 15.18% (+0.01%, +1052 bytes)

✅ 7 new matches
Unit Item Bytes Before After
Project/Anim/AnimInfo al::AnimInfoTable::sort() +564 0.00% 100.00%
Project/Anim/AnimInfo al::AnimInfoTable::findAnimInfo(char const*) const +224 0.00% 100.00%
Project/Anim/AnimInfo al::AnimInfoTable::AnimInfoTable(int) +116 0.00% 100.00%
Project/Anim/AnimInfo al::AnimInfoTable::add(char const*, void*, float, bool) +116 0.00% 100.00%
Project/Anim/AnimInfo al::AnimResInfo::AnimResInfo() +12 0.00% 100.00%
Project/Anim/AnimInfo al::AnimResInfo::getFrameMax() const +12 0.00% 100.00%
Project/Anim/AnimInfo al::AnimResInfo::isLoop() const +8 0.00% 100.00%
📈 1 improvement in an unmatched item
Unit Item Bytes Before After
Project/Anim/AnimInfo al::AnimInfoTable::tryFindAnimInfo(char const*) const +56 0.00% 25.00%

@github-actions github-actions Bot added the status:waiting for review This PR is ready to take the first or another look at it! label Apr 27, 2026
@german77 german77 force-pushed the AnimInfo branch 3 times, most recently from d5f437a to f403969 Compare April 27, 2026 20:02
Copy link
Copy Markdown
Owner

@MonsterDruide1 MonsterDruide1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this just open-ead/sead#255 used in the game?

@MonsterDruide1 reviewed all commit messages and made 1 comment.
Reviewable status: 0 of 3 files reviewed, all discussions resolved.

@github-actions github-actions Bot added status:waiting for author Reviews have shown that the author of this PR needs to change some things. and removed status:waiting for review This PR is ready to take the first or another look at it! labels Apr 27, 2026
Copy link
Copy Markdown
Contributor Author

@german77 german77 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Close but array types are different. That's an array of pointers but this is an array of objects. So is very likely this is ObjArray or something around that

@german77 made 1 comment.
Reviewable status: 0 of 3 files reviewed, all discussions resolved (waiting on MonsterDruide1).

@github-actions github-actions Bot added status:waiting for review This PR is ready to take the first or another look at it! and removed status:waiting for author Reviews have shown that the author of this PR needs to change some things. labels Apr 27, 2026
Copy link
Copy Markdown
Owner

@MonsterDruide1 MonsterDruide1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you simplify the code here by adding a proper implementation of ObjArray's sorting stuff to sead?

@MonsterDruide1 made 1 comment.
Reviewable status: 0 of 3 files reviewed, all discussions resolved.

@github-actions github-actions Bot added status:waiting for author Reviews have shown that the author of this PR needs to change some things. and removed status:waiting for review This PR is ready to take the first or another look at it! labels May 10, 2026
Copy link
Copy Markdown
Contributor Author

@german77 german77 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried swapping to any of the container types of sead. Sadly none of them match something as simple as the ctor

@german77 made 1 comment.
Reviewable status: 0 of 3 files reviewed, all discussions resolved (waiting on MonsterDruide1).

@github-actions github-actions Bot added status:waiting for review This PR is ready to take the first or another look at it! and removed status:waiting for author Reviews have shown that the author of this PR needs to change some things. labels May 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status:waiting for review This PR is ready to take the first or another look at it!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants