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

CPASAnimState: Make use of size_t for indices

Same behavior, but plays nicer with containers.

This can technically result in less zero-extensions with regards to
memory indexing and registers, but this wasn't the underlying reason for the change.
This commit is contained in:
Lioncash
2020-04-06 13:02:18 -04:00
parent 4043b63721
commit 0b74a3e995
4 changed files with 16 additions and 13 deletions

View File

@@ -5,15 +5,18 @@ namespace urde {
CPASAnimInfo::CPASAnimInfo(u32 id, rstl::reserved_vector<CPASAnimParm::UParmValue, 8>&& parms)
: x0_id(id), x4_parms(std::move(parms)) {}
CPASAnimParm::UParmValue CPASAnimInfo::GetAnimParmValue(u32 idx) const {
if (idx >= x4_parms.size())
CPASAnimParm::UParmValue CPASAnimInfo::GetAnimParmValue(size_t idx) const {
if (idx >= x4_parms.size()) {
return CPASAnimParm::UParmValue{};
}
return x4_parms[idx];
}
CPASAnimParm CPASAnimInfo::GetAnimParmData(u32 idx, CPASAnimParm::EParmType type) const {
if (idx >= x4_parms.size())
CPASAnimParm CPASAnimInfo::GetAnimParmData(size_t idx, CPASAnimParm::EParmType type) const {
if (idx >= x4_parms.size()) {
return CPASAnimParm::NoParameter();
}
const CPASAnimParm::UParmValue& parm = x4_parms[idx];
switch (type) {