Library/Anim: Implement AnimInfo#1127
Conversation
d5f437a to
f403969
Compare
MonsterDruide1
left a comment
There was a problem hiding this comment.
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.
german77
left a comment
There was a problem hiding this comment.
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).
MonsterDruide1
left a comment
There was a problem hiding this comment.
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.
german77
left a comment
There was a problem hiding this comment.
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).
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
strcmpandisEqualStringwhich 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
tryFindAnimInfoandfindAnimInfogenerate different assembly code. No idea on how to match that. _ZNK2al13AnimInfoTable15tryFindAnimInfoEPKcThis change is
Report for 1.0 (a76cdfb - 12c0198)
📈 Matched code: 15.18% (+0.01%, +1052 bytes)
✅ 7 new matches
Project/Anim/AnimInfoal::AnimInfoTable::sort()Project/Anim/AnimInfoal::AnimInfoTable::findAnimInfo(char const*) constProject/Anim/AnimInfoal::AnimInfoTable::AnimInfoTable(int)Project/Anim/AnimInfoal::AnimInfoTable::add(char const*, void*, float, bool)Project/Anim/AnimInfoal::AnimResInfo::AnimResInfo()Project/Anim/AnimInfoal::AnimResInfo::getFrameMax() constProject/Anim/AnimInfoal::AnimResInfo::isLoop() const📈 1 improvement in an unmatched item
Project/Anim/AnimInfoal::AnimInfoTable::tryFindAnimInfo(char const*) const