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

Finish CSamusDoll

This commit is contained in:
Jack Andersen
2017-05-05 19:21:42 -10:00
parent 4ff1475f0e
commit b2d375a1d7
27 changed files with 1721 additions and 229 deletions

View File

@@ -813,4 +813,10 @@ zeus::CAABox CAnimData::GetBoundingBox() const
return search->second;
}
void CAnimData::SubstituteModelData(const TCachedToken<CSkinnedModel>& model)
{
xd8_modelData = model;
x108_aabb = xd8_modelData->GetModel()->GetAABB();
}
}

View File

@@ -10,6 +10,7 @@
#include "CAdditiveAnimPlayback.hpp"
#include "CCharLayoutInfo.hpp"
#include "CAnimPlaybackParms.hpp"
#include "IAnimReader.hpp"
#include <set>
enum class EUserEventType
@@ -219,6 +220,7 @@ public:
CSegId GetLocatorSegId(const std::string& name) const;
zeus::CAABox GetBoundingBox(const zeus::CTransform& xf) const;
zeus::CAABox GetBoundingBox() const;
void SubstituteModelData(const TCachedToken<CSkinnedModel>& model);
static void FreeCache();
static void InitializeCache();
const CHierarchyPoseBuilder& GetPoseBuilder() const { return x2fc_poseBuilder; }

View File

@@ -379,4 +379,54 @@ void CModelData::Render(EWhichModel which, const zeus::CTransform& xf,
}
}
void CModelData::InvSuitDraw(EWhichModel which, const zeus::CTransform& xf, const CActorLights* lights,
const zeus::CColor& alphaColor, const zeus::CColor& additiveColor)
{
CGraphics::SetModelMatrix(xf * zeus::CTransform::Scale(x0_scale));
if (x10_animData)
{
CSkinnedModel& model = PickAnimatedModel(which);
model.GetModelInst()->DisableAllLights();
CModelFlags flags = {};
/* Z-prime */
flags.m_extendedShader = EExtendedShader::SolidColorBackfaceCullLEqualAlphaOnly;
flags.x4_color = zeus::CColor::skWhite;
x10_animData->Render(model, flags, {}, nullptr);
/* Normal Blended */
lights->ActivateLights(*model.GetModelInst());
flags.m_extendedShader = EExtendedShader::Lighting;
flags.x4_color = alphaColor;
x10_animData->Render(model, flags, {}, nullptr);
/* Selection Additive */
flags.m_extendedShader = EExtendedShader::ForcedAdditive;
flags.x4_color = additiveColor;
x10_animData->Render(model, flags, {}, nullptr);
}
else
{
CBooModel& model = *PickStaticModel(which);
model.DisableAllLights();
CModelFlags flags = {};
/* Z-prime */
flags.m_extendedShader = EExtendedShader::SolidColorBackfaceCullLEqualAlphaOnly;
flags.x4_color = zeus::CColor::skWhite;
model.Draw(flags, nullptr, nullptr);
/* Normal Blended */
lights->ActivateLights(model);
flags.m_extendedShader = EExtendedShader::Lighting;
flags.x4_color = alphaColor;
model.Draw(flags, nullptr, nullptr);
/* Selection Additive */
flags.m_extendedShader = EExtendedShader::ForcedAdditive;
flags.x4_color = additiveColor;
model.Draw(flags, nullptr, nullptr);
}
}
}

View File

@@ -139,6 +139,9 @@ public:
void Render(EWhichModel, const zeus::CTransform& xf,
const CActorLights* lights, const CModelFlags& drawFlags);
void InvSuitDraw(EWhichModel which, const zeus::CTransform& xf, const CActorLights* lights,
const zeus::CColor& color0, const zeus::CColor& color1);
CAnimData* AnimationData() { return x10_animData.get(); }
const CAnimData* GetAnimationData() const { return x10_animData.get(); }
const TLockedToken<CModel>& GetNormalModel() const { return x1c_normalModel; }