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

Several initial character classes

This commit is contained in:
Jack Andersen
2016-04-09 18:49:02 -10:00
parent ac0d2d8828
commit 4f7d6e167f
30 changed files with 788 additions and 210 deletions

View File

@@ -0,0 +1,30 @@
#include "CPASDatabase.hpp"
namespace urde
{
void CPASDatabase::AddAnimState(CPASAnimState&& state)
{
auto it = std::lower_bound(x0_states.begin(), x0_states.end(), state,
[](const CPASAnimState& item, const CPASAnimState& test) -> bool {return item.GetId() < test.GetId();});
x0_states.insert(it, std::move(state));
}
CPASDatabase::CPASDatabase(CInputStream& in)
{
in.readUint32Big();
u32 animStateCount = in.readUint32Big();
u32 defaultState = in.readUint32Big();
x0_states.reserve(animStateCount);
for (u32 i=0 ; i<animStateCount ; ++i)
{
CPASAnimState state(in);
AddAnimState(std::move(state));
}
if (animStateCount)
SetDefaultState(defaultState);
}
}