2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-09 15:47:46 +00:00

Initial CParasite implementation

This commit is contained in:
2018-09-16 16:22:35 -07:00
parent ac33e46590
commit 02d54fd5ca
20 changed files with 564 additions and 78 deletions

View File

@@ -29,15 +29,15 @@ CCharacterInfo::CParticleResData::CParticleResData(CInputStream& in, u16 tableCo
}
}
static std::vector<std::pair<u32, std::pair<std::string, std::string>>>
static std::vector<std::pair<s32, std::pair<std::string, std::string>>>
MakeAnimInfoVector(CInputStream& in)
{
std::vector<std::pair<u32, std::pair<std::string, std::string>>> ret;
std::vector<std::pair<s32, std::pair<std::string, std::string>>> ret;
u32 animInfoCount = in.readUint32Big();
ret.reserve(animInfoCount);
for (u32 i=0 ; i<animInfoCount ; ++i)
{
u32 idx = in.readUint32Big();
s32 idx = in.readInt32Big();
std::string a = in.readString();
std::string b = in.readString();
ret.emplace_back(idx, std::make_pair(a, b));
@@ -99,4 +99,15 @@ CCharacterInfo::CCharacterInfo(CInputStream& in)
}
}
const s32 CCharacterInfo::GetAnimationIndex(std::string_view name) const
{
for (const auto& pair : x20_animInfo)
{
if (pair.second.second.compare(name.data()) == 0)
return pair.first;
}
return -1;
}
}