Minor CActor fixes

Former-commit-id: b61e1774c1
This commit is contained in:
Luke Street 2022-12-07 01:14:03 -05:00
parent 4a4e040adf
commit 23d5e95417
7 changed files with 21 additions and 18 deletions

View File

@ -2284,7 +2284,7 @@ lbl_800548D8:
/* 800548E8 00051848 80 7F 08 84 */ lwz r3, 0x884(r31) /* 800548E8 00051848 80 7F 08 84 */ lwz r3, 0x884(r31)
/* 800548EC 0005184C 7F E4 FB 78 */ mr r4, r31 /* 800548EC 0005184C 7F E4 FB 78 */ mr r4, r31
/* 800548F0 00051850 7F C5 F3 78 */ mr r5, r30 /* 800548F0 00051850 7F C5 F3 78 */ mr r5, r30
/* 800548F4 00051854 48 18 F5 31 */ bl Render__20CActorModelParticlesCFRC6CActor /* 800548F4 00051854 48 18 F5 31 */ bl Render__20CActorModelParticlesCFRC13CStateManagerRC6CActor
lbl_800548F8: lbl_800548F8:
/* 800548F8 00051858 57 A0 06 3F */ clrlwi. r0, r29, 0x18 /* 800548F8 00051858 57 A0 06 3F */ clrlwi. r0, r29, 0x18
/* 800548FC 0005185C 41 82 00 14 */ beq lbl_80054910 /* 800548FC 0005185C 41 82 00 14 */ beq lbl_80054910

View File

@ -422,8 +422,8 @@ lbl_801E3E04:
/* 801E3E1C 001E0D7C 38 21 00 20 */ addi r1, r1, 0x20 /* 801E3E1C 001E0D7C 38 21 00 20 */ addi r1, r1, 0x20
/* 801E3E20 001E0D80 4E 80 00 20 */ blr /* 801E3E20 001E0D80 4E 80 00 20 */ blr
.global Render__20CActorModelParticlesCFRC6CActor .global Render__20CActorModelParticlesCFRC13CStateManagerRC6CActor
Render__20CActorModelParticlesCFRC6CActor: Render__20CActorModelParticlesCFRC13CStateManagerRC6CActor:
/* 801E3E24 001E0D84 94 21 FF A0 */ stwu r1, -0x60(r1) /* 801E3E24 001E0D84 94 21 FF A0 */ stwu r1, -0x60(r1)
/* 801E3E28 001E0D88 7C 08 02 A6 */ mflr r0 /* 801E3E28 001E0D88 7C 08 02 A6 */ mflr r0
/* 801E3E2C 001E0D8C 3C C0 80 5A */ lis r6, mModelMatrix__9CGraphics@ha /* 801E3E2C 001E0D8C 3C C0 80 5A */ lis r6, mModelMatrix__9CGraphics@ha

View File

@ -1618,7 +1618,7 @@ lbl_800781AC:
/* 800781DC 0007513C 80 7D 08 84 */ lwz r3, 0x884(r29) /* 800781DC 0007513C 80 7D 08 84 */ lwz r3, 0x884(r29)
/* 800781E0 00075140 7F A4 EB 78 */ mr r4, r29 /* 800781E0 00075140 7F A4 EB 78 */ mr r4, r29
/* 800781E4 00075144 7F 85 E3 78 */ mr r5, r28 /* 800781E4 00075144 7F 85 E3 78 */ mr r5, r28
/* 800781E8 00075148 48 16 BC 3D */ bl Render__20CActorModelParticlesCFRC6CActor /* 800781E8 00075148 48 16 BC 3D */ bl Render__20CActorModelParticlesCFRC13CStateManagerRC6CActor
/* 800781EC 0007514C 48 00 00 20 */ b lbl_8007820C /* 800781EC 0007514C 48 00 00 20 */ b lbl_8007820C
lbl_800781F0: lbl_800781F0:
/* 800781F0 00075150 7F 83 E3 78 */ mr r3, r28 /* 800781F0 00075150 7F 83 E3 78 */ mr r3, r28

View File

@ -49,7 +49,9 @@ public:
const TLockedToken< CSkinnedModel >& GetModelData() const { return xd8_modelData; } const TLockedToken< CSkinnedModel >& GetModelData() const { return xd8_modelData; }
void SetIsAnimating(bool v) { x220_24_animating = v; } void SetIsAnimating(bool v) { x220_24_animating = v; }
void SetParticleEffectState(const rstl::string& name, bool active, CStateManager& mgr); void SetParticleEffectState(const rstl::string& name, bool active, CStateManager& mgr) {
x120_particleDB.SetParticleEffectState(name, active, mgr);
}
int GetCharacterIndex() const { return x204_charIdx; } int GetCharacterIndex() const { return x204_charIdx; }
float GetAverageVelocity(int idx) const; float GetAverageVelocity(int idx) const;
@ -98,7 +100,8 @@ public:
// PreRender__9CAnimDataFv // PreRender__9CAnimDataFv
// SetupRender__9CAnimDataCFRC13CSkinnedModelRCQ24rstl37optional_object<18CVertexMorphEffect>PCf // SetupRender__9CAnimDataCFRC13CSkinnedModelRCQ24rstl37optional_object<18CVertexMorphEffect>PCf
// Render__9CAnimDataCFRC13CSkinnedModelRC11CModelFlagsRCQ24rstl37optional_object<18CVertexMorphEffect>PCf // Render__9CAnimDataCFRC13CSkinnedModelRC11CModelFlagsRCQ24rstl37optional_object<18CVertexMorphEffect>PCf
void Render(const CSkinnedModel&, const CModelFlags&, const rstl::optional_object<CVertexMorphEffect>&, const float*) const; void Render(const CSkinnedModel&, const CModelFlags&,
const rstl::optional_object< CVertexMorphEffect >&, const float*) const;
// RenderAuxiliary__9CAnimDataCFRC14CFrustumPlanes // RenderAuxiliary__9CAnimDataCFRC14CFrustumPlanes
// RecalcPoseBuilder__9CAnimDataCFPC13CCharAnimTime // RecalcPoseBuilder__9CAnimDataCFPC13CCharAnimTime
float GetAnimationDuration(int animIn) const; float GetAnimationDuration(int animIn) const;

View File

@ -51,15 +51,15 @@ public:
CStaticRes(CAssetId id, const CVector3f& scale) : x0_cmdlId(id), x4_scale(scale) {} CStaticRes(CAssetId id, const CVector3f& scale) : x0_cmdlId(id), x4_scale(scale) {}
}; };
enum EWhichModel {
kWM_Normal,
kWM_XRay,
kWM_Thermal,
kWM_ThermalHot,
};
class CModelData { class CModelData {
public: public:
enum EWhichModel {
kWM_Normal,
kWM_XRay,
kWM_Thermal,
kWM_ThermalHot,
};
// TODO these probably aren't real // TODO these probably aren't real
bool HasNormalModel() const { return x1c_normalModel; } bool HasNormalModel() const { return x1c_normalModel; }

View File

@ -296,7 +296,7 @@ void CActor::AddToRenderer(const CFrustumPlanes& planes, const CStateManager& mg
void CActor::EnsureRendered(const CStateManager& mgr, const CVector3f& pos, void CActor::EnsureRendered(const CStateManager& mgr, const CVector3f& pos,
const CAABox& bounds) const { const CAABox& bounds) const {
if (GetModelData()) { if (GetModelData()) {
const EWhichModel which = CModelData::GetRenderingModel(mgr); const CModelData::EWhichModel which = CModelData::GetRenderingModel(mgr);
GetModelData()->RenderUnsortedParts(which, GetTransform(), GetActorLights(), GetModelFlags()); GetModelData()->RenderUnsortedParts(which, GetTransform(), GetActorLights(), GetModelFlags());
} }
mgr.AddDrawableActor(*this, pos, bounds); mgr.AddDrawableActor(*this, pos, bounds);
@ -354,8 +354,8 @@ void CActor::Render(const CStateManager& mgr) const {
} }
void CActor::RenderInternal(const CStateManager& mgr) const { void CActor::RenderInternal(const CStateManager& mgr) const {
EWhichModel which = CModelData::GetRenderingModel(mgr); CModelData::EWhichModel which = CModelData::GetRenderingModel(mgr);
if (which == kWM_ThermalHot) { if (which == CModelData::kWM_ThermalHot) {
if (GetModelData()->GetSortThermal()) { if (GetModelData()->GetSortThermal()) {
uchar addMag; uchar addMag;
uchar mulMag = 255; uchar mulMag = 255;

View File

@ -230,7 +230,7 @@ void CGunWeapon::Update(float dt, CStateManager& mgr) {
LoadFxIdle(dt, mgr); LoadFxIdle(dt, mgr);
if ((x210_loadFlags & 0x1f) == 0x1f) { if ((x210_loadFlags & 0x1f) == 0x1f) {
CSkinnedModel& model = x10_solidModelData->PickAnimatedModel(kWM_Normal); CSkinnedModel& model = x10_solidModelData->PickAnimatedModel(CModelData::kWM_Normal);
bool flag1 = model.GetModel()->IsLoaded(x20c_shaderIdx); bool flag1 = model.GetModel()->IsLoaded(x20c_shaderIdx);
bool flag2 = xb0_suitArmModelData->IsLoaded(0); bool flag2 = xb0_suitArmModelData->IsLoaded(0);
if (flag1 && flag2) { if (flag1 && flag2) {
@ -358,7 +358,7 @@ void CGunWeapon::DrawHologram(const CStateManager& mgr, const CTransform4f& xf,
// TODO // TODO
if (x218_29_drawHologram) { if (x218_29_drawHologram) {
x60_holoModelData->FlatDraw(kWM_Normal, xf, false, flags); x60_holoModelData->FlatDraw(CModelData::kWM_Normal, xf, false, flags);
} else { } else {
const CVector3f& scale = x10_solidModelData->GetScale(); const CVector3f& scale = x10_solidModelData->GetScale();
CTransform4f modelMatrix(xf); CTransform4f modelMatrix(xf);