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

Initial Flaahgra implementations

This commit is contained in:
2019-06-10 01:28:33 -07:00
parent 0322b5b234
commit b7b65b04a4
6 changed files with 593 additions and 3 deletions

View File

@@ -2182,7 +2182,32 @@ CEntity* ScriptLoader::LoadPlayerActor(CStateManager& mgr, CInputStream& in, int
}
CEntity* ScriptLoader::LoadFlaahgra(CStateManager& mgr, CInputStream& in, int propCount, const CEntityInfo& info) {
return nullptr;
if (!EnsurePropertyCount(propCount, MP1::CFlaahgraData::GetNumProperties(), "Flaahgra"))
return nullptr;
SScaledActorHead actHead = LoadScaledActorHead(in, mgr);
auto pair = CPatternedInfo::HasCorrectParameterCount(in);
if (!pair.first)
return nullptr;
CPatternedInfo pInfo(in, pair.second);
CActorParameters actParms = LoadActorParameters(in);
MP1::CFlaahgraData flaahgraData(in);
CAnimRes animRes(pInfo.GetAnimationParameters().GetACSFile(), pInfo.GetAnimationParameters().GetCharacter(),
actHead.x40_scale, pInfo.GetAnimationParameters().GetInitialAnimation(), true);
if (!pInfo.GetAnimationParameters().GetACSFile().IsValid()) {
animRes = CAnimRes(flaahgraData.GetAnimationParameters().GetACSFile(),
flaahgraData.GetAnimationParameters().GetCharacter(), actHead.x40_scale,
flaahgraData.GetAnimationParameters().GetInitialAnimation(), true);
}
if (!animRes.GetId().IsValid())
return nullptr;
return new MP1::CFlaahgra(mgr.AllocateUniqueId(), actHead.x0_name, info, actHead.x10_transform, animRes, pInfo,
actParms, flaahgraData);
}
CEntity* ScriptLoader::LoadAreaAttributes(CStateManager& mgr, CInputStream& in, int propCount,