Merge pull request #41 from lioncash/const

RuntimeCommon: Use const on member functions where applicable
This commit is contained in:
Phillip Stephens 2019-08-14 06:36:27 -07:00 committed by GitHub
commit 2ace76e3d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
91 changed files with 269 additions and 248 deletions

View File

@ -972,7 +972,7 @@ float CAutoMapper::GetDesiredMiniMapCameraDistance(const CStateManager& mgr) con
std::tan(M_PIF / 2.f - 0.5f * 2.f * M_PIF * (xa8_renderStates[0].x1c_camAngle / 360.f));
}
float CAutoMapper::GetClampedMapScreenCameraDistance(float v) {
float CAutoMapper::GetClampedMapScreenCameraDistance(float v) const {
if (x1bc_state == EAutoMapperState::MapScreenUniverse)
return zeus::clamp(g_tweakAutoMapper->GetMinUniverseCamDist(), v, g_tweakAutoMapper->GetMaxUniverseCamDist());
return zeus::clamp(g_tweakAutoMapper->GetMinCamDist(), v, g_tweakAutoMapper->GetMaxCamDist());

View File

@ -202,7 +202,7 @@ private:
static float GetMapAreaMiniMapDrawAlphaOutlineUnvisited(const CStateManager&);
float GetDesiredMiniMapCameraDistance(const CStateManager&) const;
static float GetBaseMapScreenCameraMoveSpeed();
float GetClampedMapScreenCameraDistance(float);
float GetClampedMapScreenCameraDistance(float) const;
float GetFinalMapScreenCameraMoveSpeed() const;
void ProcessMapRotateInput(const CFinalInput& input, const CStateManager& mgr);
void ProcessMapZoomInput(const CFinalInput& input, const CStateManager& mgr);

View File

@ -19,7 +19,7 @@ CMappableObject::CMappableObject(const void* buf) {
x10_transform.read34RowMajor(r);
}
zeus::CTransform CMappableObject::AdjustTransformForType() {
zeus::CTransform CMappableObject::AdjustTransformForType() const {
const float doorCenterX = g_tweakAutoMapper->GetDoorCenter().x();
const float doorCenterZ = g_tweakAutoMapper->GetDoorCenter().z();
if (x0_type == EMappableObjectType::BigDoor1) {

View File

@ -66,7 +66,7 @@ private:
std::optional<DoorSurface> m_doorSurface;
std::optional<CTexturedQuadFilter> m_texQuadFilter;
zeus::CTransform AdjustTransformForType();
zeus::CTransform AdjustTransformForType() const;
std::pair<zeus::CColor, zeus::CColor> GetDoorColors(int idx, const CMapWorldInfo& mwInfo, float alpha) const;
public:

View File

@ -16,7 +16,7 @@ public:
return msg;
}
void Clear() { m_list.clear(); }
operator bool() { return m_list.size() != 0; }
operator bool() const { return m_list.size() != 0; }
};
} // namespace urde

View File

@ -55,7 +55,7 @@ public:
return AsyncSeekRead(buf, len, ESeekOrigin::Cur, 0, std::move(cb));
}
u32 SyncRead(void* buf, u32 len) { return m_reader->readBytesToBuf(buf, len); }
u64 Length() { return m_reader->length(); }
u64 Length() const { return m_reader->length(); }
std::string_view GetPath() const { return x18_path; }
};
} // namespace urde

View File

@ -90,8 +90,8 @@ public:
CGameState();
CGameState(CBitStreamReader& stream, u32 saveIdx);
void SetCurrentWorldId(CAssetId id);
std::shared_ptr<CPlayerState> GetPlayerState() { return x98_playerState; }
std::shared_ptr<CWorldTransManager> GetWorldTransitionManager() { return x9c_transManager; }
std::shared_ptr<CPlayerState> GetPlayerState() const { return x98_playerState; }
std::shared_ptr<CWorldTransManager> GetWorldTransitionManager() const { return x9c_transManager; }
void SetTotalPlayTime(float time);
CPersistentOptions& SystemOptions() { return xa8_systemOptions; }
CGameOptions& GameOptions() { return x17c_gameOptions; }

View File

@ -118,19 +118,19 @@ void CResLoader::GetTagListForFile(const char* pakName, std::vector<SObjectTag>&
}
}
bool CResLoader::GetResourceCompression(const SObjectTag& tag) {
bool CResLoader::GetResourceCompression(const SObjectTag& tag) const {
if (FindResource(tag.id))
return x50_cachedResInfo->IsCompressed();
return false;
}
u32 CResLoader::ResourceSize(const SObjectTag& tag) {
u32 CResLoader::ResourceSize(const SObjectTag& tag) const {
if (FindResource(tag.id))
return x50_cachedResInfo->GetSize();
return 0;
}
bool CResLoader::ResourceExists(const SObjectTag& tag) { return FindResource(tag.id); }
bool CResLoader::ResourceExists(const SObjectTag& tag) const { return FindResource(tag.id); }
FourCC CResLoader::GetResourceTypeById(CAssetId id) const {
if (id.IsValid() && FindResource(id))

View File

@ -36,9 +36,9 @@ public:
std::unique_ptr<u8[]> LoadResourceSync(const urde::SObjectTag& tag);
std::unique_ptr<u8[]> LoadNewResourcePartSync(const urde::SObjectTag& tag, u32 off, u32 size);
void GetTagListForFile(const char* pakName, std::vector<SObjectTag>& out) const;
bool GetResourceCompression(const SObjectTag& tag);
u32 ResourceSize(const SObjectTag& tag);
bool ResourceExists(const SObjectTag& tag);
bool GetResourceCompression(const SObjectTag& tag) const;
u32 ResourceSize(const SObjectTag& tag) const;
bool ResourceExists(const SObjectTag& tag) const;
FourCC GetResourceTypeById(CAssetId id) const;
const SObjectTag* GetResourceIdByName(std::string_view name) const;
bool AreAllPaksLoaded() const;

View File

@ -374,7 +374,7 @@ TAreaId CStateManager::GetVisAreaId() const {
return curArea;
}
s32 CStateManager::GetWeaponIdCount(TUniqueId uid, EWeaponType type) {
s32 CStateManager::GetWeaponIdCount(TUniqueId uid, EWeaponType type) const {
return x878_weaponManager->GetNumActive(uid, type);
}

View File

@ -220,7 +220,7 @@ public:
void AddDrawableActor(const CActor& actor, const zeus::CVector3f& vec, const zeus::CAABox& aabb) const;
bool SpecialSkipCinematic();
TAreaId GetVisAreaId() const;
s32 GetWeaponIdCount(TUniqueId, EWeaponType);
s32 GetWeaponIdCount(TUniqueId, EWeaponType) const;
void RemoveWeaponId(TUniqueId, EWeaponType);
void AddWeaponId(TUniqueId, EWeaponType);
void UpdateEscapeSequenceTimer(float);
@ -368,17 +368,23 @@ public:
const std::shared_ptr<CPlayerState>& GetPlayerState() const { return x8b8_playerState; }
CRandom16* GetActiveRandom() { return x900_activeRandom; }
const CRandom16* GetActiveRandom() const { return x900_activeRandom; }
zeus::CVector3f Random2f(float scaleMin, float scaleMax);
void SetActiveRandomToDefault() { x900_activeRandom = &x8fc_random; }
void ClearActiveRandom() { x900_activeRandom = nullptr; }
CRumbleManager& GetRumbleManager() { return *x88c_rumbleManager; }
const CRumbleManager& GetRumbleManager() const { return *x88c_rumbleManager; }
CCameraFilterPassPoly& GetCameraFilterPass(int idx) { return xb84_camFilterPasses[idx]; }
const CCameraFilterPassPoly& GetCameraFilterPass(int idx) const { return xb84_camFilterPasses[idx]; }
CCameraBlurPass& GetCameraBlurPass(int idx) { return xd14_camBlurPasses[idx]; }
const CCameraBlurPass& GetCameraBlurPass(int idx) const { return xd14_camBlurPasses[idx]; }
CEnvFxManager* GetEnvFxManager() { return x880_envFxManager; }
const CEnvFxManager* GetEnvFxManager() const { return x880_envFxManager; }
CWorld* WorldNC() { return x850_world.get(); }
const CWorld* GetWorld() const { return x850_world.get(); }
CRelayTracker* GetRelayTracker() { return x8bc_relayTracker.get(); }
const CRelayTracker* GetRelayTracker() const { return x8bc_relayTracker.get(); }
CCameraManager* GetCameraManager() const { return x870_cameraManager; }
CFluidPlaneManager* GetFluidPlaneManager() const { return x87c_fluidPlaneManager; }
CActorModelParticles* GetActorModelParticles() const { return x884_actorModelParticles; }

View File

@ -533,7 +533,7 @@ void CCameraManager::UpdateListener(CStateManager& mgr) {
CSfxManager::UpdateListener(xf.origin, zeus::skZero3f, xf.frontVector(), xf.upVector(), 1.f);
}
float CCameraManager::CalculateFogDensity(CStateManager& mgr, const CScriptWater* water) {
float CCameraManager::CalculateFogDensity(CStateManager& mgr, const CScriptWater* water) const {
float distanceFactor = 1.f - water->GetFluidPlane().GetAlpha();
float distance = 0;
if (mgr.GetPlayerState()->HasPowerUp(CPlayerState::EItemType::GravitySuit))

View File

@ -116,8 +116,13 @@ public:
void SkipCinematic(CStateManager& stateMgr);
CFirstPersonCamera* GetFirstPersonCamera() { return x7c_fpCamera; }
const CFirstPersonCamera* GetFirstPersonCamera() const { return x7c_fpCamera; }
CBallCamera* GetBallCamera() { return x80_ballCamera; }
const CBallCamera* GetBallCamera() const { return x80_ballCamera; }
CGameArea::CAreaFog& Fog() { return x3c_fog; }
const CGameArea::CAreaFog& Fog() const { return x3c_fog; }
float GetCameraBobMagnitude() const;
@ -127,7 +132,7 @@ public:
void UpdateRumble(float dt, CStateManager& mgr);
void UpdateListener(CStateManager& mgr);
float CalculateFogDensity(CStateManager&, const CScriptWater*);
float CalculateFogDensity(CStateManager&, const CScriptWater*) const;
void SetFogDensity(float, float);
void ProcessInput(const CFinalInput& input, CStateManager& stateMgr);

View File

@ -67,7 +67,7 @@ void CFirstPersonCamera::SkipCinematic() {
}
void CFirstPersonCamera::CalculateGunFollowOrientationAndTransform(zeus::CTransform& gunXf, zeus::CQuaternion& gunQ,
float dt, zeus::CVector3f& rVec) {
float dt, zeus::CVector3f& rVec) const {
zeus::CVector3f gunFrontVec = x190_gunFollowXf.frontVector();
gunFrontVec.z() = 0.f;
if (gunFrontVec.canBeNormalized())

View File

@ -28,7 +28,7 @@ public:
const zeus::CTransform& GetGunFollowTransform() const { return x190_gunFollowXf; }
void UpdateTransform(CStateManager& mgr, float dt);
void UpdateElevation(CStateManager& mgr);
void CalculateGunFollowOrientationAndTransform(zeus::CTransform&, zeus::CQuaternion&, float, zeus::CVector3f&);
void CalculateGunFollowOrientationAndTransform(zeus::CTransform&, zeus::CQuaternion&, float, zeus::CVector3f&) const;
void SetScriptPitchId(TUniqueId uid) { x1c4_pitchId = uid; }
void SetLockCamera(bool v) { x18c_lockCamera = v; }
void DeferBallTransitionProcessing() { x1c6_24_deferBallTransitionProcessing = true; }

View File

@ -63,7 +63,8 @@ zeus::CVector3f CGameCamera::ConvertToScreenSpace(const zeus::CVector3f& v) cons
return mtx.multiplyOneOverW(rVec);
}
zeus::CTransform CGameCamera::ValidateCameraTransform(const zeus::CTransform& newXf, const zeus::CTransform& oldXf) {
zeus::CTransform CGameCamera::ValidateCameraTransform(const zeus::CTransform& newXf,
const zeus::CTransform& oldXf) const {
zeus::CTransform xfCpy(newXf);
if (!zeus::close_enough(newXf.rightVector().magnitude(), 1.f) ||
!zeus::close_enough(newXf.frontVector().magnitude(), 1.f) ||

View File

@ -39,7 +39,7 @@ public:
zeus::CMatrix4f GetPerspectiveMatrix() const;
zeus::CVector3f ConvertToScreenSpace(const zeus::CVector3f&) const;
zeus::CTransform ValidateCameraTransform(const zeus::CTransform&, const zeus::CTransform&);
zeus::CTransform ValidateCameraTransform(const zeus::CTransform&, const zeus::CTransform&) const;
float GetNearClipDistance() const { return x160_znear; }
float GetFarClipDistance() const { return x164_zfar; }
float GetAspectRatio() const { return x168_aspect; }

View File

@ -31,7 +31,7 @@ void CABSAim::Start(CBodyController& bc, CStateManager& mgr) {
x4_needsIdle = true;
}
pas::EAnimationState CABSAim::GetBodyStateTransition(float dt, CBodyController& bc) {
pas::EAnimationState CABSAim::GetBodyStateTransition(float dt, CBodyController& bc) const {
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::AdditiveReaction))
return pas::EAnimationState::AdditiveReaction;
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::AdditiveFlinch))
@ -42,7 +42,7 @@ pas::EAnimationState CABSAim::GetBodyStateTransition(float dt, CBodyController&
}
pas::EAnimationState CABSAim::UpdateBody(float dt, CBodyController& bc, CStateManager& mgr) {
pas::EAnimationState st = GetBodyStateTransition(dt, bc);
const pas::EAnimationState st = GetBodyStateTransition(dt, bc);
if (st == pas::EAnimationState::Invalid) {
const zeus::CVector3f& target = bc.GetCommandMgr().GetAdditiveTargetVector();
if (target.canBeNormalized()) {
@ -106,14 +106,14 @@ void CABSFlinch::Start(CBodyController& bc, CStateManager& mgr) {
animData.AddAdditiveAnimation(x8_anim, x4_weight, false, true);
}
pas::EAnimationState CABSFlinch::GetBodyStateTransition(float dt, CBodyController& bc) {
pas::EAnimationState CABSFlinch::GetBodyStateTransition(float dt, CBodyController& bc) const {
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::AdditiveReaction))
return pas::EAnimationState::AdditiveReaction;
return pas::EAnimationState::Invalid;
}
pas::EAnimationState CABSFlinch::UpdateBody(float dt, CBodyController& bc, CStateManager& mgr) {
pas::EAnimationState st = GetBodyStateTransition(dt, bc);
const pas::EAnimationState st = GetBodyStateTransition(dt, bc);
if (st == pas::EAnimationState::Invalid) {
CAnimData& animData = *bc.GetOwner().ModelData()->AnimationData();
CCharAnimTime rem = animData.GetAdditiveAnimationTree(x8_anim)->VGetTimeRemaining();
@ -123,7 +123,7 @@ pas::EAnimationState CABSFlinch::UpdateBody(float dt, CBodyController& bc, CStat
return st;
}
pas::EAnimationState CABSIdle::GetBodyStateTransition(float dt, CBodyController& bc) {
pas::EAnimationState CABSIdle::GetBodyStateTransition(float dt, CBodyController& bc) const {
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::AdditiveReaction))
return pas::EAnimationState::AdditiveReaction;
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::AdditiveFlinch))
@ -154,14 +154,14 @@ void CABSReaction::Start(CBodyController& bc, CStateManager& mgr) {
}
}
pas::EAnimationState CABSReaction::GetBodyStateTransition(float dt, CBodyController& bc) {
pas::EAnimationState CABSReaction::GetBodyStateTransition(float dt, CBodyController& bc) const {
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::AdditiveReaction) && xc_type == pas::EAdditiveReactionType::IceBreakout)
return pas::EAnimationState::AdditiveReaction;
return pas::EAnimationState::Invalid;
}
pas::EAnimationState CABSReaction::UpdateBody(float dt, CBodyController& bc, CStateManager& mgr) {
pas::EAnimationState st = GetBodyStateTransition(dt, bc);
const pas::EAnimationState st = GetBodyStateTransition(dt, bc);
if (st == pas::EAnimationState::Invalid) {
if (x8_anim == -1)
return pas::EAnimationState::AdditiveIdle;

View File

@ -26,7 +26,7 @@ class CABSAim : public CAdditiveBodyState {
float x2c_hWeightVel = 0.f;
float x30_vWeight = 0.f;
float x34_vWeightVel = 0.f;
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc);
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc) const;
public:
void Start(CBodyController& bc, CStateManager& mgr) override;
@ -37,7 +37,7 @@ public:
class CABSFlinch : public CAdditiveBodyState {
float x4_weight = 1.f;
u32 x8_anim = 0;
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc);
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc) const;
public:
void Start(CBodyController& bc, CStateManager& mgr) override;
@ -46,7 +46,7 @@ public:
};
class CABSIdle : public CAdditiveBodyState {
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc);
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc) const;
public:
void Start(CBodyController& bc, CStateManager& mgr) override {}
@ -59,7 +59,7 @@ class CABSReaction : public CAdditiveBodyState {
s32 x8_anim = -1;
pas::EAdditiveReactionType xc_type = pas::EAdditiveReactionType::Invalid;
bool x10_active = false;
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc);
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc) const;
void StopAnimation(CBodyController& bc);
public:

View File

@ -242,7 +242,7 @@ void CBSGetup::Start(CBodyController& bc, CStateManager& mgr) {
}
}
pas::EAnimationState CBSGetup::GetBodyStateTransition(float dt, CBodyController& bc) {
pas::EAnimationState CBSGetup::GetBodyStateTransition(float dt, CBodyController& bc) const {
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::Hurled))
return pas::EAnimationState::Hurled;
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::KnockDown))
@ -289,7 +289,7 @@ void CBSKnockBack::Start(CBodyController& bc, CStateManager& mgr) {
x4_curTime = 0.f;
}
pas::EAnimationState CBSKnockBack::GetBodyStateTransition(float dt, CBodyController& bc) {
pas::EAnimationState CBSKnockBack::GetBodyStateTransition(float dt, CBodyController& bc) const {
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::Hurled))
return pas::EAnimationState::Hurled;
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::KnockDown))
@ -332,7 +332,7 @@ void CBSLieOnGround::Start(CBodyController& bc, CStateManager& mgr) {
}
}
pas::EAnimationState CBSLieOnGround::GetBodyStateTransition(float dt, CBodyController& bc) {
pas::EAnimationState CBSLieOnGround::GetBodyStateTransition(float dt, CBodyController& bc) const {
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::Die))
return pas::EAnimationState::Death;
if (x4_24_hasGroundHit && bc.GetCommandMgr().GetCmd(EBodyStateCmd::KnockBack))
@ -355,7 +355,7 @@ void CBSStep::Start(CBodyController& bc, CStateManager& mgr) {
bc.PlayBestAnimation(parms, *mgr.GetActiveRandom());
}
pas::EAnimationState CBSStep::GetBodyStateTransition(float dt, CBodyController& bc) {
pas::EAnimationState CBSStep::GetBodyStateTransition(float dt, CBodyController& bc) const {
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::Hurled))
return pas::EAnimationState::Hurled;
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::KnockDown))
@ -425,7 +425,7 @@ bool CBSTurn::FacingDest(CBodyController& bc) const {
return false;
}
pas::EAnimationState CBSTurn::GetBodyStateTransition(float dt, CBodyController& bc) {
pas::EAnimationState CBSTurn::GetBodyStateTransition(float dt, CBodyController& bc) const {
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::Hurled))
return pas::EAnimationState::Hurled;
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::KnockDown))
@ -526,7 +526,7 @@ void CBSLoopAttack::Start(CBodyController& bc, CStateManager& mgr) {
}
}
pas::EAnimationState CBSLoopAttack::GetBodyStateTransition(float dt, CBodyController& bc) {
pas::EAnimationState CBSLoopAttack::GetBodyStateTransition(float dt, CBodyController& bc) const {
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::Hurled))
return pas::EAnimationState::Hurled;
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::KnockDown))
@ -622,7 +622,7 @@ void CBSLoopReaction::Start(CBodyController& bc, CStateManager& mgr) {
}
}
pas::EAnimationState CBSLoopReaction::GetBodyStateTransition(float dt, CBodyController& bc) {
pas::EAnimationState CBSLoopReaction::GetBodyStateTransition(float dt, CBodyController& bc) const {
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::Hurled))
return pas::EAnimationState::Hurled;
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::KnockDown))
@ -734,7 +734,7 @@ void CBSGroundHit::Start(CBodyController& bc, CStateManager& mgr) {
xc_fallState = pas::EFallState(groundHitState->GetAnimParmData(best.second, 3).GetEnumValue());
}
pas::EAnimationState CBSGroundHit::GetBodyStateTransition(float dt, CBodyController& bc) {
pas::EAnimationState CBSGroundHit::GetBodyStateTransition(float dt, CBodyController& bc) const {
if (bc.IsAnimationOver()) {
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::Die))
return pas::EAnimationState::Death;
@ -777,7 +777,7 @@ void CBSGenerate::Start(CBodyController& bc, CStateManager& mgr) {
}
}
pas::EAnimationState CBSGenerate::GetBodyStateTransition(float dt, CBodyController& bc) {
pas::EAnimationState CBSGenerate::GetBodyStateTransition(float dt, CBodyController& bc) const {
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::Hurled))
return pas::EAnimationState::Hurled;
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::KnockDown))
@ -819,7 +819,7 @@ void CBSJump::Start(CBodyController& bc, CStateManager& mgr) {
}
}
pas::EAnimationState CBSJump::GetBodyStateTransition(float dt, CBodyController& bc) {
pas::EAnimationState CBSJump::GetBodyStateTransition(float dt, CBodyController& bc) const {
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::Hurled))
return pas::EAnimationState::Hurled;
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::KnockDown))
@ -991,7 +991,7 @@ void CBSHurled::Start(CBodyController& bc, CStateManager& mgr) {
x2c_24_needsRecover = false;
}
pas::EAnimationState CBSHurled::GetBodyStateTransition(float dt, CBodyController& bc) {
pas::EAnimationState CBSHurled::GetBodyStateTransition(float dt, CBodyController& bc) const {
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::NextState))
return pas::EAnimationState::LieOnGround;
if (x18_curTime > 0.25f) {
@ -1165,7 +1165,7 @@ void CBSSlide::Start(CBodyController& bc, CStateManager& mgr) {
}
}
pas::EAnimationState CBSSlide::GetBodyStateTransition(float dt, CBodyController& bc) {
pas::EAnimationState CBSSlide::GetBodyStateTransition(float dt, CBodyController& bc) const {
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::Hurled))
return pas::EAnimationState::Hurled;
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::KnockDown))
@ -1195,7 +1195,7 @@ void CBSTaunt::Start(CBodyController& bc, CStateManager& mgr) {
bc.PlayBestAnimation(parms, *mgr.GetActiveRandom());
}
pas::EAnimationState CBSTaunt::GetBodyStateTransition(float dt, CBodyController& bc) {
pas::EAnimationState CBSTaunt::GetBodyStateTransition(float dt, CBodyController& bc) const {
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::Hurled))
return pas::EAnimationState::Hurled;
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::KnockDown))
@ -1227,7 +1227,7 @@ void CBSScripted::Start(CBodyController& bc, CStateManager& mgr) {
bc.SetCurrentAnimation(playParms, cmd->IsLooped(), false);
}
pas::EAnimationState CBSScripted::GetBodyStateTransition(float dt, CBodyController& bc) {
pas::EAnimationState CBSScripted::GetBodyStateTransition(float dt, CBodyController& bc) const {
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::Hurled))
return pas::EAnimationState::Hurled;
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::KnockDown))
@ -1275,7 +1275,7 @@ void CBSCover::Start(CBodyController& bc, CStateManager& mgr) {
xc_needsExit = true;
}
pas::EAnimationState CBSCover::GetBodyStateTransition(float dt, CBodyController& bc) {
pas::EAnimationState CBSCover::GetBodyStateTransition(float dt, CBodyController& bc) const {
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::Hurled))
return pas::EAnimationState::Hurled;
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::KnockDown))
@ -1342,7 +1342,7 @@ void CBSWallHang::Start(CBodyController& bc, CStateManager& mgr) {
bc.PlayBestAnimation(parms, *mgr.GetActiveRandom());
}
pas::EAnimationState CBSWallHang::GetBodyStateTransition(float dt, CBodyController& bc) {
pas::EAnimationState CBSWallHang::GetBodyStateTransition(float dt, CBodyController& bc) const {
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::Hurled))
return pas::EAnimationState::Hurled;
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::KnockDown))
@ -1595,7 +1595,7 @@ bool CBSWallHang::ApplyGravity() const {
}
}
float CBSLocomotion::GetStartVelocityMagnitude(CBodyController& bc) {
float CBSLocomotion::GetStartVelocityMagnitude(const CBodyController& bc) const {
if (TCastToPtr<CPhysicsActor> act = bc.GetOwner()) {
float maxSpeed = bc.GetBodyStateInfo().GetMaxSpeed();
float ret = 0.f;

View File

@ -77,7 +77,7 @@ public:
class CBSGetup : public CBodyState {
pas::EFallState x4_fallState = pas::EFallState::Invalid;
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc);
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc) const;
public:
void Start(CBodyController& bc, CStateManager& mgr) override;
@ -89,7 +89,7 @@ class CBSKnockBack : public CBodyState {
float x4_curTime = 0.f;
float x8_rotateSpeed = 0.f;
float xc_remTime = 0.f;
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc);
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc) const;
public:
bool IsMoving() const override { return true; }
@ -100,7 +100,7 @@ public:
class CBSLieOnGround : public CBodyState {
bool x4_24_hasGroundHit : 1;
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc);
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc) const;
public:
CBSLieOnGround(CActor& actor);
@ -110,7 +110,7 @@ public:
};
class CBSStep : public CBodyState {
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc);
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc) const;
public:
bool IsMoving() const override { return true; }
@ -132,7 +132,7 @@ public:
void Start(CBodyController& bc, CStateManager& mgr) override;
pas::EAnimationState UpdateBody(float dt, CBodyController& bc, CStateManager& mgr) override;
void Shutdown(CBodyController&) override {}
virtual pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc);
virtual pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc) const;
};
class CBSFlyerTurn : public CBSTurn {
@ -146,7 +146,7 @@ class CBSLoopAttack : public CBodyState {
pas::ELoopAttackType x8_loopAttackType = pas::ELoopAttackType::Invalid;
bool xc_24_waitForAnimOver : 1;
bool xc_25_advance : 1;
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc);
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc) const;
public:
CBSLoopAttack() {
@ -163,7 +163,7 @@ class CBSLoopReaction : public CBodyState {
pas::ELoopState x4_state = pas::ELoopState::Invalid;
pas::EReactionType x8_reactionType = pas::EReactionType::Invalid;
bool xc_24_loopHit : 1;
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc);
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc) const;
bool PlayExitAnimation(CBodyController& bc, CStateManager& mgr) const;
public:
@ -177,7 +177,7 @@ class CBSGroundHit : public CBodyState {
float x4_rotateSpeed = 0.f;
float x8_remTime = 0.f;
pas::EFallState xc_fallState = pas::EFallState::Invalid;
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc);
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc) const;
public:
void Start(CBodyController& bc, CStateManager& mgr) override;
@ -186,7 +186,7 @@ public:
};
class CBSGenerate : public CBodyState {
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc);
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc) const;
public:
void Start(CBodyController& bc, CStateManager& mgr) override;
@ -210,7 +210,7 @@ class CBSJump : public CBodyState {
};
u32 _dummy = 0;
};
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc);
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc) const;
bool CheckForWallJump(CBodyController& bc, CStateManager& mgr);
void CheckForLand(CBodyController& bc, CStateManager& mgr);
void PlayJumpLoop(CStateManager& mgr, CBodyController& bc);
@ -236,7 +236,7 @@ class CBSHurled : public CBodyState {
mutable zeus::CVector3f x1c_lastTranslation;
mutable float x28_landedDur = 0.f;
bool x2c_24_needsRecover : 1;
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc);
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc) const;
void Recover(CStateManager& mgr, CBodyController& bc, pas::EHurledState state);
void PlayStrikeWallAnimation(CBodyController& bc, CStateManager& mgr);
void PlayLandAnimation(CBodyController& bc, CStateManager& mgr);
@ -255,7 +255,7 @@ public:
class CBSSlide : public CBodyState {
float x4_rotateSpeed = 0.f;
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc);
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc) const;
public:
bool ApplyHeadTracking() const override { return false; }
@ -266,7 +266,7 @@ public:
};
class CBSTaunt : public CBodyState {
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc);
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc) const;
public:
void Start(CBodyController& bc, CStateManager& mgr) override;
@ -283,7 +283,7 @@ class CBSScripted : public CBodyState {
u32 _dummy = 0;
};
float x8_remTime = 0.f;
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc);
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc) const;
public:
bool ApplyHeadTracking() const override { return false; }
@ -296,7 +296,7 @@ class CBSCover : public CBodyState {
pas::ECoverState x4_state = pas::ECoverState::Invalid;
pas::ECoverDirection x8_coverDirection = pas::ECoverDirection::Invalid;
bool xc_needsExit = false;
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc);
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc) const;
public:
bool ApplyHeadTracking() const override { return false; }
@ -318,7 +318,7 @@ class CBSWallHang : public CBodyState {
};
u32 _dummy = 0;
};
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc);
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc) const;
void FixInPlace(CBodyController& bc);
bool CheckForLand(CBodyController& bc, CStateManager& mgr);
bool CheckForWall(CBodyController& bc, CStateManager& mgr);
@ -339,7 +339,7 @@ public:
class CBSLocomotion : public CBodyState {
protected:
pas::ELocomotionType x4_locomotionType = pas::ELocomotionType::Invalid;
float GetStartVelocityMagnitude(CBodyController& bc);
float GetStartVelocityMagnitude(const CBodyController& bc) const;
void ReStartBodyState(CBodyController& bc, bool maintainVel);
float ComputeWeightPercentage(const std::pair<s32, float>& a, const std::pair<s32, float>& b, float f) const;

View File

@ -47,7 +47,7 @@ CBodyStateInfo::CBodyStateInfo(CActor& actor, EBodyType type) {
x1c_additiveStates.push_back({pas::EAnimationState::AdditiveReaction, std::make_unique<CABSReaction>()});
}
std::unique_ptr<CBodyState> CBodyStateInfo::SetupRestrictedFlyerBodyStates(int stateId, CActor& actor) {
std::unique_ptr<CBodyState> CBodyStateInfo::SetupRestrictedFlyerBodyStates(int stateId, CActor& actor) const {
switch (stateId) {
case 0:
return std::make_unique<CBSFall>();
@ -92,7 +92,7 @@ std::unique_ptr<CBodyState> CBodyStateInfo::SetupRestrictedFlyerBodyStates(int s
}
}
std::unique_ptr<CBodyState> CBodyStateInfo::SetupNewFlyerBodyStates(int stateId, CActor& actor) {
std::unique_ptr<CBodyState> CBodyStateInfo::SetupNewFlyerBodyStates(int stateId, CActor& actor) const {
switch (stateId) {
case 0:
return std::make_unique<CBSFall>();
@ -137,7 +137,7 @@ std::unique_ptr<CBodyState> CBodyStateInfo::SetupNewFlyerBodyStates(int stateId,
}
}
std::unique_ptr<CBodyState> CBodyStateInfo::SetupWallWalkerBodyStates(int stateId, CActor& actor) {
std::unique_ptr<CBodyState> CBodyStateInfo::SetupWallWalkerBodyStates(int stateId, CActor& actor) const {
switch (stateId) {
case 0:
return std::make_unique<CBSFall>();
@ -182,7 +182,7 @@ std::unique_ptr<CBodyState> CBodyStateInfo::SetupWallWalkerBodyStates(int stateI
}
}
std::unique_ptr<CBodyState> CBodyStateInfo::SetupPitchableBodyStates(int stateId, CActor& actor) {
std::unique_ptr<CBodyState> CBodyStateInfo::SetupPitchableBodyStates(int stateId, CActor& actor) const {
switch (stateId) {
case 0:
return std::make_unique<CBSFall>();
@ -227,7 +227,7 @@ std::unique_ptr<CBodyState> CBodyStateInfo::SetupPitchableBodyStates(int stateId
}
}
std::unique_ptr<CBodyState> CBodyStateInfo::SetupFlyerBodyStates(int stateId, CActor& actor) {
std::unique_ptr<CBodyState> CBodyStateInfo::SetupFlyerBodyStates(int stateId, CActor& actor) const {
switch (stateId) {
case 0:
return std::make_unique<CBSFall>();
@ -272,7 +272,7 @@ std::unique_ptr<CBodyState> CBodyStateInfo::SetupFlyerBodyStates(int stateId, CA
}
}
std::unique_ptr<CBodyState> CBodyStateInfo::SetupRestrictedBodyStates(int stateId, CActor& actor) {
std::unique_ptr<CBodyState> CBodyStateInfo::SetupRestrictedBodyStates(int stateId, CActor& actor) const {
switch (stateId) {
case 0:
return std::make_unique<CBSFall>();
@ -319,7 +319,7 @@ std::unique_ptr<CBodyState> CBodyStateInfo::SetupRestrictedBodyStates(int stateI
}
}
std::unique_ptr<CBodyState> CBodyStateInfo::SetupBiPedalBodyStates(int stateId, CActor& actor) {
std::unique_ptr<CBodyState> CBodyStateInfo::SetupBiPedalBodyStates(int stateId, CActor& actor) const {
switch (stateId) {
case 0:
return std::make_unique<CBSFall>();

View File

@ -17,13 +17,13 @@ class CBodyStateInfo {
pas::EAnimationState x2c_additiveState = pas::EAnimationState::AdditiveIdle;
float x30_maxPitch = 0.f;
bool x34_24_changeLocoAtEndOfAnimOnly;
std::unique_ptr<CBodyState> SetupRestrictedFlyerBodyStates(int stateId, CActor& actor);
std::unique_ptr<CBodyState> SetupNewFlyerBodyStates(int stateId, CActor& actor);
std::unique_ptr<CBodyState> SetupWallWalkerBodyStates(int stateId, CActor& actor);
std::unique_ptr<CBodyState> SetupPitchableBodyStates(int stateId, CActor& actor);
std::unique_ptr<CBodyState> SetupFlyerBodyStates(int stateId, CActor& actor);
std::unique_ptr<CBodyState> SetupRestrictedBodyStates(int stateId, CActor& actor);
std::unique_ptr<CBodyState> SetupBiPedalBodyStates(int stateId, CActor& actor);
std::unique_ptr<CBodyState> SetupRestrictedFlyerBodyStates(int stateId, CActor& actor) const;
std::unique_ptr<CBodyState> SetupNewFlyerBodyStates(int stateId, CActor& actor) const;
std::unique_ptr<CBodyState> SetupWallWalkerBodyStates(int stateId, CActor& actor) const;
std::unique_ptr<CBodyState> SetupPitchableBodyStates(int stateId, CActor& actor) const;
std::unique_ptr<CBodyState> SetupFlyerBodyStates(int stateId, CActor& actor) const;
std::unique_ptr<CBodyState> SetupRestrictedBodyStates(int stateId, CActor& actor) const;
std::unique_ptr<CBodyState> SetupBiPedalBodyStates(int stateId, CActor& actor) const;
public:
CBodyStateInfo(CActor& actor, EBodyType type);

View File

@ -54,7 +54,7 @@ const u8* CFBStreamedCompression::GetBitstreamPointer() const {
return chans;
}
std::unique_ptr<u32[]> CFBStreamedCompression::GetRotationsAndOffsets(u32 words, CInputStream& in) {
std::unique_ptr<u32[]> CFBStreamedCompression::GetRotationsAndOffsets(u32 words, CInputStream& in) const {
std::unique_ptr<u32[]> ret(new u32[words]);
Header head;
@ -80,7 +80,7 @@ std::unique_ptr<u32[]> CFBStreamedCompression::GetRotationsAndOffsets(u32 words,
return ret;
}
u8* CFBStreamedCompression::ReadBoneChannelDescriptors(u8* out, CInputStream& in) {
u8* CFBStreamedCompression::ReadBoneChannelDescriptors(u8* out, CInputStream& in) const {
u32 boneChanCount = in.readUint32Big();
*reinterpret_cast<u32*>(out) = boneChanCount;
out += 4;
@ -142,7 +142,7 @@ u8* CFBStreamedCompression::ReadBoneChannelDescriptors(u8* out, CInputStream& in
return out;
}
u32 CFBStreamedCompression::ComputeBitstreamWords(const u8* chans) {
u32 CFBStreamedCompression::ComputeBitstreamWords(const u8* chans) const {
u32 boneChanCount = *reinterpret_cast<const u32*>(chans);
chans += 4;
@ -188,7 +188,7 @@ u32 CFBStreamedCompression::ComputeBitstreamWords(const u8* chans) {
return (totalBits * keyCount + 31) / 32;
}
float CFBStreamedCompression::CalculateAverageVelocity(const u8* chans) {
float CFBStreamedCompression::CalculateAverageVelocity(const u8* chans) const {
u32 boneChanCount = *reinterpret_cast<const u32*>(chans);
chans += 4;

View File

@ -56,10 +56,10 @@ private:
float x10_averageVelocity;
zeus::CVector3f x14_rootOffset;
u8* ReadBoneChannelDescriptors(u8* out, CInputStream& in);
u32 ComputeBitstreamWords(const u8* chans);
std::unique_ptr<u32[]> GetRotationsAndOffsets(u32 words, CInputStream& in);
float CalculateAverageVelocity(const u8* chans);
u8* ReadBoneChannelDescriptors(u8* out, CInputStream& in) const;
u32 ComputeBitstreamWords(const u8* chans) const;
std::unique_ptr<u32[]> GetRotationsAndOffsets(u32 words, CInputStream& in) const;
float CalculateAverageVelocity(const u8* chans) const;
public:
CFBStreamedCompression(CInputStream& in, IObjectStore& objStore, bool pc);

View File

@ -154,7 +154,7 @@ void CModelData::SetInfraModel(const std::pair<CAssetId, CAssetId>& modelSkin) {
}
}
bool CModelData::IsDefinitelyOpaque(EWhichModel which) {
bool CModelData::IsDefinitelyOpaque(EWhichModel which) const {
if (x10_animData) {
CSkinnedModel& model = PickAnimatedModel(which);
return model.GetModelInst()->IsOpaque();

View File

@ -100,7 +100,7 @@ public:
const std::unique_ptr<CBooModel>& PickStaticModel(EWhichModel which) const;
void SetXRayModel(const std::pair<CAssetId, CAssetId>& modelSkin);
void SetInfraModel(const std::pair<CAssetId, CAssetId>& modelSkin);
bool IsDefinitelyOpaque(EWhichModel);
bool IsDefinitelyOpaque(EWhichModel) const;
bool GetIsLoop() const;
float GetAnimationDuration(int) const;
void EnableLooping(bool);
@ -144,7 +144,7 @@ public:
void SetScale(const zeus::CVector3f& scale) { x0_scale = scale; }
bool HasAnimData() const { return x10_animData != nullptr; }
bool HasNormalModel() const { return x1c_normalModel; }
bool HasModel(EWhichModel which) {
bool HasModel(EWhichModel which) const {
if (x10_animData) {
switch (which) {
case EWhichModel::Normal:

View File

@ -15,6 +15,7 @@ public:
void Add(const CSegIdList& list, const CCharLayoutInfo& layout, const CSegStatementSet& other, float weight);
CAnimPerSegmentData& operator[](const CSegId& idx) { return x4_segData[idx]; }
const CAnimPerSegmentData& operator[](const CSegId& idx) const { return x4_segData[idx]; }
};
} // namespace urde

View File

@ -116,7 +116,7 @@ public:
bool HasMaterial(EMaterialTypes type) const { return (x0_list & (1ull << u64(type))) != 0; }
bool SharesMaterials(const CMaterialList& other) {
bool SharesMaterials(const CMaterialList& other) const {
for (u32 i = 0; i < 64; i++) {
if ((x0_list & (1ull << i)) != 0 && (other.x0_list & (1ull << i)) != 0)
return true;

View File

@ -279,15 +279,15 @@ public:
void ReallyRenderFogVolume(const zeus::CColor& color, const zeus::CAABox& aabb, const CModel* model,
const CSkinnedModel* sModel);
const boo::ObjToken<boo::ITexture>& GetThermoPalette() { return x288_thermoPalette; }
const boo::ObjToken<boo::ITextureS>& GetFogRampTex() { return x1b8_fogVolumeRamp; }
const boo::ObjToken<boo::ITexture>& GetThermoPalette() const { return x288_thermoPalette; }
const boo::ObjToken<boo::ITextureS>& GetFogRampTex() const { return x1b8_fogVolumeRamp; }
const boo::ObjToken<boo::ITexture>& GetRandomStaticEntropyTex() const { return m_staticEntropy->GetBooTexture(); }
const boo::ObjToken<boo::IGraphicsBufferS>& GetScanLinesEvenVBO() const { return m_scanLinesEvenVBO; }
const boo::ObjToken<boo::IGraphicsBufferS>& GetScanLinesOddVBO() const { return m_scanLinesOddVBO; }
const boo::ObjToken<boo::ITexture>& GetClearTexture() { return m_clearTexture; }
const boo::ObjToken<boo::ITexture>& GetBlackTexture() { return m_blackTexture; }
const boo::ObjToken<boo::ITexture>& GetWhiteTexture() { return m_whiteTexture; }
const boo::ObjToken<boo::ITexture>& GetClearTexture() const { return m_clearTexture; }
const boo::ObjToken<boo::ITexture>& GetBlackTexture() const { return m_blackTexture; }
const boo::ObjToken<boo::ITexture>& GetWhiteTexture() const { return m_whiteTexture; }
boo::ObjToken<boo::ITexture> GetColorTexture(const zeus::CColor& color);

View File

@ -33,8 +33,8 @@ private:
EFontType m_ftype = EFontType::None;
std::string m_dolphinName;
size_t ComputeMippedTexelCount();
size_t ComputeMippedBlockCountDXT1();
size_t ComputeMippedTexelCount() const;
size_t ComputeMippedBlockCountDXT1() const;
void BuildI4FromGCN(CInputStream& in);
void BuildI8FromGCN(CInputStream& in);
void BuildIA4FromGCN(CInputStream& in);

View File

@ -27,7 +27,7 @@ constexpr uint8_t Convert6To8(uint8_t v) {
return (v << 2) | (v >> 4);
}
size_t CTexture::ComputeMippedTexelCount() {
size_t CTexture::ComputeMippedTexelCount() const {
size_t w = x4_w;
size_t h = x6_h;
size_t ret = w * h;
@ -41,7 +41,7 @@ size_t CTexture::ComputeMippedTexelCount() {
return ret;
}
size_t CTexture::ComputeMippedBlockCountDXT1() {
size_t CTexture::ComputeMippedBlockCountDXT1() const {
size_t w = x4_w / 4;
size_t h = x6_h / 4;
size_t ret = w * h;

View File

@ -56,6 +56,7 @@ public:
~CGuiFrame();
CGuiSys& GetGuiSys() { return x8_guiSys; }
const CGuiSys& GetGuiSys() const { return x8_guiSys; }
CAssetId GetAssetId() const { return x0_id; }
CGuiLight* GetFrameLight(int idx) const { return m_indexedLights[idx]; }
@ -100,6 +101,7 @@ public:
void ResetMouseState();
CGuiWidgetIdDB& GetWidgetIdDB() { return x18_idDB; }
const CGuiWidgetIdDB& GetWidgetIdDB() const { return x18_idDB; }
static std::unique_ptr<CGuiFrame> CreateFrame(CAssetId frmeId, CGuiSys& sys, CInputStream& in, CSimplePool* sp);
};

View File

@ -28,6 +28,8 @@ void CGuiGroup::SelectWorkerWidget(int workerId, bool setActive, bool setVisible
CGuiWidget* CGuiGroup::GetSelectedWidget() { return GetWorkerWidget(xbc_selectedWorker); }
const CGuiWidget* CGuiGroup::GetSelectedWidget() const { return GetWorkerWidget(xbc_selectedWorker); }
bool CGuiGroup::AddWorkerWidget(CGuiWidget* worker) {
++xb8_workerCount;
return true;

View File

@ -15,6 +15,7 @@ public:
void SelectWorkerWidget(int workerId, bool setActive, bool setVisible);
CGuiWidget* GetSelectedWidget();
const CGuiWidget* GetSelectedWidget() const;
bool AddWorkerWidget(CGuiWidget* worker) override;
void OnActiveChange() override;

View File

@ -39,6 +39,7 @@ public:
CGuiSys(IFactory& resFactory, CSimplePool& resStore, EUsageMode mode);
CSimplePool& GetResStore() { return x4_resStore; }
const CSimplePool& GetResStore() const { return x4_resStore; }
EUsageMode GetUsageMode() const { return x8_mode; }
void OnViewportResize();

View File

@ -228,7 +228,7 @@ void CHudMissileInterface::SetNumMissiles(int numMissiles, const CStateManager&
void CHudMissileInterface::SetMissileCapacity(int missileCapacity) { x4_missileCapacity = missileCapacity; }
CHudMissileInterface::EInventoryStatus CHudMissileInterface::GetMissileInventoryStatus() {
CHudMissileInterface::EInventoryStatus CHudMissileInterface::GetMissileInventoryStatus() const {
if (x64_energybart01_missilebar->GetSetEnergy() == 0.f)
return EInventoryStatus::Depleted;
return EInventoryStatus(x64_energybart01_missilebar->GetActualFraction() < g_tweakGui->GetMissileWarningFraction());

View File

@ -55,7 +55,7 @@ public:
void SetChargeBeamFactor(float t);
void SetNumMissiles(int numMissiles, const CStateManager& mgr);
void SetMissileCapacity(int missileCapacity);
EInventoryStatus GetMissileInventoryStatus();
EInventoryStatus GetMissileInventoryStatus() const;
static std::pair<zeus::CVector3f, zeus::CVector3f> CombatMissileBarCoordFunc(float t);
static std::pair<zeus::CVector3f, zeus::CVector3f> XRayMissileBarCoordFunc(float t);
static std::pair<zeus::CVector3f, zeus::CVector3f> ThermalMissileBarCoordFunc(float t);

View File

@ -14,7 +14,7 @@ COrbitPointMarker::COrbitPointMarker() {
x28_orbitPointModel = g_SimplePool->GetObj("CMDL_OrbitPoint");
}
bool COrbitPointMarker::CheckLoadComplete() { return x28_orbitPointModel.IsLoaded(); }
bool COrbitPointMarker::CheckLoadComplete() const { return x28_orbitPointModel.IsLoaded(); }
void COrbitPointMarker::Update(float dt, const CStateManager& mgr) {
x24_curTime += dt;

View File

@ -20,7 +20,7 @@ class COrbitPointMarker {
public:
COrbitPointMarker();
bool CheckLoadComplete();
bool CheckLoadComplete() const;
void Update(float dt, const CStateManager& mgr);
void Draw(const CStateManager& mgr) const;
};

View File

@ -17,6 +17,7 @@ class TObjOwnerParam : public IVParamObj {
public:
TObjOwnerParam(T&& obj) : m_param(std::move(obj)) {}
T& GetParam() { return m_param; }
const T& GetParam() const { return m_param; }
};
class CVParamTransfer {
@ -27,7 +28,7 @@ public:
CVParamTransfer(IVParamObj* obj) : m_ref(obj) {}
CVParamTransfer(const CVParamTransfer& other) : m_ref(other.m_ref) {}
IVParamObj* GetObj() const { return m_ref.get(); }
CVParamTransfer ShareTransferRef() { return CVParamTransfer(*this); }
CVParamTransfer ShareTransferRef() const { return CVParamTransfer(*this); }
template <class T>
T& GetOwnedObj() const {

View File

@ -57,7 +57,7 @@ ECardResult CMemoryCardDriver::SFileInfo::FileRead() {
}
}
ECardResult CMemoryCardDriver::SFileInfo::GetSaveDataOffset(u32& offOut) {
ECardResult CMemoryCardDriver::SFileInfo::GetSaveDataOffset(u32& offOut) const {
CMemoryCardSys::CardStat stat = {};
ECardResult result = CMemoryCardSys::GetStatus(x0_fileInfo.slot, x0_fileInfo.getFileNo(), stat);
if (result != ECardResult::READY) {
@ -135,7 +135,7 @@ void CMemoryCardDriver::NoCardFound() {
static_cast<CMain*>(g_Main)->SetCardBusy(false);
}
const CGameState::GameFileStateInfo* CMemoryCardDriver::GetGameFileStateInfo(int idx) {
const CGameState::GameFileStateInfo* CMemoryCardDriver::GetGameFileStateInfo(int idx) const {
SGameFileSlot* slot = xe4_fileSlots[idx].get();
if (!slot)
return nullptr;

View File

@ -78,7 +78,7 @@ private:
kabufuda::ECardResult StartRead();
kabufuda::ECardResult TryFileRead();
kabufuda::ECardResult FileRead();
kabufuda::ECardResult GetSaveDataOffset(u32& offOut);
kabufuda::ECardResult GetSaveDataOffset(u32& offOut) const;
};
struct SSaveHeader {
@ -126,7 +126,7 @@ public:
bool importPersistent);
void NoCardFound();
const CGameState::GameFileStateInfo* GetGameFileStateInfo(int idx);
const CGameState::GameFileStateInfo* GetGameFileStateInfo(int idx) const;
static SSaveHeader LoadSaveHeader(CMemoryInStream& in);
static std::unique_ptr<SGameFileSlot> LoadSaveFile(CMemoryInStream& in);
void ReadFinished();

View File

@ -41,7 +41,7 @@ public:
SaveReady = 16
};
bool IsHiddenFromFrontEnd() {
bool IsHiddenFromFrontEnd() const {
switch (x10_uiType) {
case EUIType::SaveReady:
case EUIType::Empty:

View File

@ -172,7 +172,7 @@ public:
void Update();
void Draw();
bool isRectDirty() { return m_rectIsDirty; }
bool isRectDirty() const { return m_rectIsDirty; }
const boo::SWindowRect& getWindowRect() {
m_rectIsDirty = false;
return m_windowRect;
@ -278,8 +278,8 @@ public:
void MemoryCardInitializePump();
bool CheckReset() { return m_doQuit; }
bool CheckTerminate() { return m_doQuit; }
bool CheckReset() const { return m_doQuit; }
bool CheckTerminate() const { return m_doQuit; }
void DrawDebugMetrics(double, CStopwatch&) {}
void DoPredrawMetrics() {}
void FillInAssetIDs();

View File

@ -1131,7 +1131,7 @@ void CBabygoth::UpdateHealthInfo(CStateManager& mgr) {
}
}
float CBabygoth::CalculateShellCrackHP(EShellState state) {
float CBabygoth::CalculateShellCrackHP(EShellState state) const {
if (state == EShellState::Default)
return x570_babyData.GetShellHitPoints();
else if (state == EShellState::CrackOne)

View File

@ -50,7 +50,7 @@ public:
const CDamageInfo& GetFireBreathDamage() const { return x4c_fireBreathDamage; }
const CDamageVulnerability& GetShellDamageVulnerability() const { return xd0_shellVulnerabilities; }
float GetShellHitPoints() const { return x140_shellHitPoints; }
s16 GetShellCrackSfx() { return x144_shellCrackSfx; }
s16 GetShellCrackSfx() const { return x144_shellCrackSfx; }
};
class CBabygoth final : public CPatterned {
@ -130,9 +130,9 @@ private:
void ApplySeparationBehavior(CStateManager&);
bool IsMouthCollisionActor(TUniqueId uid) { return x9f6_mouthCollisionActor == uid; }
bool IsMouthCollisionActor(TUniqueId uid) const { return x9f6_mouthCollisionActor == uid; }
bool IsShell(TUniqueId uid) {
bool IsShell(TUniqueId uid) const {
for (TUniqueId shellId : x9f8_shellIds) {
if (shellId == uid)
return true;
@ -172,7 +172,7 @@ private:
void UpdateHealth(CStateManager&);
float CalculateShellCrackHP(EShellState state);
float CalculateShellCrackHP(EShellState state) const;
void UpdateAttackTimeLeft(CStateManager& mgr);

View File

@ -718,9 +718,9 @@ void CFlaahgra::TurnAround(CStateManager& mgr, EStateMsg msg, float) {
x6cc_boneTracking->SetActive(false);
}
}
bool CFlaahgra::IsSphereCollider(TUniqueId uid) {
auto it = std::find(x7fc_sphereColliders.begin(), x7fc_sphereColliders.end(), uid);
bool CFlaahgra::IsSphereCollider(TUniqueId uid) const {
const auto it = std::find(x7fc_sphereColliders.cbegin(), x7fc_sphereColliders.cend(), uid);
return it != x7fc_sphereColliders.end();
}
@ -800,7 +800,7 @@ void CFlaahgra::UpdateScale(float t, float min, float max) {
ModelData()->SetScale(zeus::skOne3f * scale);
}
float CFlaahgra::GetEndActionTime() {
float CFlaahgra::GetEndActionTime() const {
CCharAnimTime eventTime =
GetModelData()->GetAnimationData()->GetTimeOfUserEvent(EUserEventType::EndAction, CCharAnimTime::Infinity());
if (eventTime == CCharAnimTime::Infinity())
@ -829,7 +829,7 @@ void CFlaahgra::Generate(CStateManager& mgr, EStateMsg msg, float) {
x7c0_ = 11.f;
}
}
zeus::CVector3f CFlaahgra::GetAttacktargetPos(CStateManager& mgr) const {
zeus::CVector3f CFlaahgra::GetAttacktargetPos(const CStateManager& mgr) const {
if (mgr.GetPlayer().GetMorphballTransitionState() == CPlayer::EPlayerMorphBallState::Morphed)
return mgr.GetPlayer().GetMorphBall()->GetBallToWorld().origin;
@ -988,7 +988,7 @@ void CFlaahgra::Attack(CStateManager& mgr, EStateMsg msg, float arg) {
}
}
u32 CFlaahgra::sub801ae828(CStateManager& mgr) {
u32 CFlaahgra::sub801ae828(const CStateManager& mgr) const {
const CPlayer& player = mgr.GetPlayer();
if (player.GetMorphballTransitionState() != CPlayer::EPlayerMorphBallState::Morphed) {
if (x7cc_ > 0.f || player.GetVelocity().magSquared() < 25.f)
@ -1000,7 +1000,7 @@ u32 CFlaahgra::sub801ae828(CStateManager& mgr) {
return 0;
}
zeus::CVector3f CFlaahgra::sub801ae754(CStateManager& mgr) {
zeus::CVector3f CFlaahgra::sub801ae754(const CStateManager& mgr) const {
float dt = (sub801ae650() && mgr.GetPlayer().GetMorphballTransitionState() != CPlayer::EPlayerMorphBallState::Morphed
? 0.75f
: 0.5f);
@ -1170,7 +1170,7 @@ bool CFlaahgra::CoverCheck(CStateManager& mgr, float) {
return false;
}
TUniqueId CFlaahgra::GetMirrorNearestPlayer(CStateManager& mgr) {
TUniqueId CFlaahgra::GetMirrorNearestPlayer(const CStateManager& mgr) const {
zeus::CVector3f playerPos = mgr.GetPlayer().GetTranslation();
TUniqueId nearId = kInvalidUniqueId;

View File

@ -164,23 +164,23 @@ class CFlaahgra : public CPatterned {
void SetMaterialProperties(const std::unique_ptr<CCollisionActorManager>&, CStateManager&);
bool sub801ae650() const { return (x7a8_ == 0 || x7a8_ == 1); }
bool sub801ae670() const { return (x7a8_ == 2 || x7a8_ == 3 || x7a8_ == 4); }
bool IsSphereCollider(TUniqueId);
bool IsSphereCollider(TUniqueId) const;
void SetCollisionActorBounds(CStateManager& mgr, const std::unique_ptr<CCollisionActorManager>& colMgr,
const zeus::CVector3f& extendedBounds);
void UpdateScale(float, float, float);
float GetEndActionTime();
float GetEndActionTime() const;
void SetupHealthInfo(CStateManager&);
zeus::CVector3f GetAttacktargetPos(CStateManager&) const;
zeus::CVector3f GetAttacktargetPos(const CStateManager&) const;
void RattlePlayer(CStateManager& mgr, const zeus::CVector3f& vec);
bool sub801e4f8() { return x7a8_ == 0 || x7a8_ == 1; }
bool sub801e4f8() const { return x7a8_ == 0 || x7a8_ == 1; }
void sub801ade80();
void UpdateHeadDamageVulnerability(CStateManager&, bool);
u32 sub801ae828(CStateManager&);
zeus::CVector3f sub801ae754(CStateManager&);
u32 sub801ae828(const CStateManager&) const;
zeus::CVector3f sub801ae754(const CStateManager&) const;
TUniqueId GetMirrorNearestPlayer(CStateManager&);
TUniqueId GetMirrorNearestPlayer(const CStateManager&) const;
public:
DEFINE_PATTERNED(Flaahgra);
CFlaahgra(TUniqueId, std::string_view, const CEntityInfo&, const zeus::CTransform&, const CAnimRes&,

View File

@ -164,16 +164,16 @@ void CJellyZap::RemoveSelfFromFishCloud(CStateManager&) {}
void CJellyZap::RemoveAllAttractors(CStateManager& mgr) { RemoveSelfFromFishCloud(mgr); }
bool CJellyZap::ClosestToPlayer(CStateManager& mgr) {
zeus::CVector3f playerPos = mgr.GetPlayer().GetTranslation();
float ourDistance = (playerPos - GetTranslation()).magnitude();
bool CJellyZap::ClosestToPlayer(const CStateManager& mgr) const {
const zeus::CVector3f playerPos = mgr.GetPlayer().GetTranslation();
const float ourDistance = (playerPos - GetTranslation()).magnitude();
float closestDistance = ourDistance;
for (CEntity* ent : mgr.GetPhysicsActorObjectList()) {
if (CJellyZap* zap = CPatterned::CastTo<CJellyZap>(ent)) {
if (zap->GetAreaIdAlways() != GetAreaIdAlways())
continue;
float tmpDist = (playerPos - zap->GetTranslation()).magnitude();
const float tmpDist = (playerPos - zap->GetTranslation()).magnitude();
if (tmpDist < closestDistance)
closestDistance = tmpDist;

View File

@ -28,7 +28,7 @@ class CJellyZap : public CPatterned {
void AddAttractor(CStateManager&);
void RemoveSelfFromFishCloud(CStateManager&);
void RemoveAllAttractors(CStateManager&);
bool ClosestToPlayer(CStateManager&);
bool ClosestToPlayer(const CStateManager&) const;
public:
DEFINE_PATTERNED(JellyZap)

View File

@ -785,13 +785,13 @@ bool CParasite::ShouldAttack(CStateManager& mgr, float arg) {
return false;
}
bool CParasite::CloseToWall(CStateManager& mgr) {
bool CParasite::CloseToWall(const CStateManager& mgr) const {
static CMaterialFilter filter = CMaterialFilter::MakeInclude(EMaterialTypes::Solid);
zeus::CAABox aabb = CPhysicsActor::GetBoundingBox();
float margin = x590_colSphere.GetSphere().radius + x5b0_collisionCloseMargin;
const float margin = x590_colSphere.GetSphere().radius + x5b0_collisionCloseMargin;
aabb.min -= zeus::CVector3f(margin);
aabb.max += zeus::CVector3f(margin);
CCollidableAABox cAABB(aabb, x68_material);
const CCollidableAABox cAABB(aabb, x68_material);
return CGameCollision::DetectStaticCollisionBoolean(mgr, cAABB, {}, filter);
}

View File

@ -82,7 +82,7 @@ class CParasite : public CWallWalker {
};
u16 _dummy = 0;
};
bool CloseToWall(CStateManager& mgr);
bool CloseToWall(const CStateManager& mgr) const;
void FaceTarget(const zeus::CVector3f& target);
TUniqueId RecursiveFindClosestWayPoint(CStateManager& mgr, TUniqueId id, float& dist);
TUniqueId GetClosestWaypointForState(EScriptObjectState state, CStateManager& mgr);

View File

@ -157,20 +157,20 @@ static CMaterialFilter kSolidFilter =
CMaterialFilter::MakeIncludeExclude({EMaterialTypes::Solid}, {EMaterialTypes::Character, EMaterialTypes::Player,
EMaterialTypes::ProjectilePassthrough});
bool CPuddleToadGamma::PlayerInVortexArea(const CStateManager& mgr) {
CPlayer& player = mgr.GetPlayer();
zeus::CTransform xf = GetLctrTransform(mMouthLocatorName);
bool CPuddleToadGamma::PlayerInVortexArea(const CStateManager& mgr) const {
const CPlayer& player = mgr.GetPlayer();
const zeus::CTransform xf = GetLctrTransform(mMouthLocatorName);
zeus::CVector3f playerOffset =
const zeus::CVector3f playerOffset =
player.GetTranslation() + zeus::CVector3f{0.f, 0.f, player.GetMorphBall()->GetBallRadius()};
zeus::CVector3f rotatedDir = GetTransform().rotate(zeus::skForward);
const zeus::CVector3f rotatedDir = GetTransform().rotate(zeus::skForward);
zeus::CVector3f suckPointToPlayer = (playerOffset - (xf.origin - (1.f * rotatedDir)));
float suckProj = suckPointToPlayer.normalized().dot(rotatedDir);
float playerDist = suckPointToPlayer.magnitude();
float suckAngleProj = (player.GetTranslation() - (xf.origin - (4.f * rotatedDir))).normalized().dot(rotatedDir);
const zeus::CVector3f suckPointToPlayer = (playerOffset - (xf.origin - (1.f * rotatedDir)));
const float suckProj = suckPointToPlayer.normalized().dot(rotatedDir);
const float playerDist = suckPointToPlayer.magnitude();
const float suckAngleProj = (player.GetTranslation() - (xf.origin - (4.f * rotatedDir))).normalized().dot(rotatedDir);
if (playerDist > 2.f) {
CRayCastResult result =
const CRayCastResult result =
mgr.RayStaticIntersection(suckPointToPlayer, 1.f / playerDist * suckPointToPlayer,
playerDist - player.GetMorphBall()->GetBallRadius(), kSolidFilter);
if (result.IsValid())

View File

@ -32,7 +32,7 @@ class CPuddleToadGamma final : public CPatterned {
static void CenterPlayer(CStateManager&, const zeus::CVector3f&, float);
void ShootPlayer(CStateManager&, float);
void SuckPlayer(CStateManager&, float);
bool PlayerInVortexArea(const CStateManager&);
bool PlayerInVortexArea(const CStateManager&) const;
void SetPlayerPosition(CStateManager&, const zeus::CVector3f&);
public:

View File

@ -516,7 +516,7 @@ void CSpacePirate::SquadRemove(CStateManager& mgr) {
}
}
bool CSpacePirate::CheckTargetable(CStateManager& mgr) { return GetModelAlphau8(mgr) > 127; }
bool CSpacePirate::CheckTargetable(const CStateManager& mgr) const { return GetModelAlphau8(mgr) > 127; }
bool CSpacePirate::FireProjectile(float dt, CStateManager& mgr) {
bool ret = false;
@ -619,7 +619,7 @@ void CSpacePirate::UpdateAttacks(float dt, CStateManager& mgr) {
xe7_31_targetable = CheckTargetable(mgr);
}
zeus::CVector3f CSpacePirate::GetTargetPos(CStateManager& mgr) {
zeus::CVector3f CSpacePirate::GetTargetPos(const CStateManager& mgr) {
if (x7c0_targetId != mgr.GetPlayer().GetUniqueId()) {
if (TCastToConstPtr<CActor> act = mgr.GetObjectById(x7c0_targetId))
if (act->GetActive())
@ -630,7 +630,7 @@ zeus::CVector3f CSpacePirate::GetTargetPos(CStateManager& mgr) {
return mgr.GetPlayer().GetTranslation();
}
void CSpacePirate::UpdateAimBodyState(float dt, CStateManager& mgr) {
void CSpacePirate::UpdateAimBodyState(float dt, const CStateManager& mgr) {
if (x400_25_alive && x637_25_enableAim && !x637_29_inWallHang && !x450_bodyController->IsFrozen() && !x634_27_melee &&
!x85c_ragDoll && (!x635_26_seated || x639_28_satUp) && x31c_faceVec.z() <= 0.f) {
x8c4_aimDelayTimer = std::max(0.f, x8c4_aimDelayTimer - dt);
@ -1239,8 +1239,8 @@ void CSpacePirate::Dead(CStateManager& mgr, EStateMsg msg, float dt) {
}
}
bool CSpacePirate::LineOfSightTest(CStateManager& mgr, const zeus::CVector3f& eyePos, const zeus::CVector3f& targetPos,
const CMaterialList& excludeList) const {
bool CSpacePirate::LineOfSightTest(const CStateManager& mgr, const zeus::CVector3f& eyePos,
const zeus::CVector3f& targetPos, const CMaterialList& excludeList) const {
return mgr.RayCollideWorld(eyePos, targetPos,
CMaterialFilter::MakeIncludeExclude({EMaterialTypes::Solid}, excludeList), this);
}
@ -1555,14 +1555,14 @@ void CSpacePirate::Attack(CStateManager& mgr, EStateMsg msg, float dt) {
}
}
bool CSpacePirate::CantJumpBack(CStateManager& mgr, const zeus::CVector3f& dir, float dist) const {
zeus::CVector3f center = GetBoundingBox().center();
bool CSpacePirate::CantJumpBack(const CStateManager& mgr, const zeus::CVector3f& dir, float dist) const {
const zeus::CVector3f center = GetBoundingBox().center();
if (!LineOfSightTest(mgr, center, center + dist * dir, {}))
return false;
zeus::CVector3f center2 = (dist * 0.5f) * dir + center;
const zeus::CVector3f center2 = (dist * 0.5f) * dir + center;
if (LineOfSightTest(mgr, center2, center2 + 5.f * zeus::skDown, {}))
return false;
zeus::CVector3f center3 = dist * dir + center;
const zeus::CVector3f center3 = dist * dir + center;
if (LineOfSightTest(mgr, center3, center3 + 5.f * zeus::skDown, {}))
return false;
return true;

View File

@ -225,11 +225,11 @@ private:
void SquadReset(CStateManager& mgr);
void SquadAdd(CStateManager& mgr);
void SquadRemove(CStateManager& mgr);
bool CheckTargetable(CStateManager& mgr);
bool CheckTargetable(const CStateManager& mgr) const;
bool FireProjectile(float dt, CStateManager& mgr);
void UpdateAttacks(float dt, CStateManager& mgr);
zeus::CVector3f GetTargetPos(CStateManager& mgr);
void UpdateAimBodyState(float dt, CStateManager& mgr);
zeus::CVector3f GetTargetPos(const CStateManager& mgr);
void UpdateAimBodyState(float dt, const CStateManager& mgr);
void SetCinematicCollision(CStateManager& mgr);
void SetNonCinematicCollision(CStateManager& mgr);
void CheckForProjectiles(CStateManager& mgr);
@ -237,11 +237,11 @@ private:
void SetVelocityForJump();
void AvoidActors(CStateManager& mgr);
void UpdateCantSeePlayer(CStateManager& mgr);
bool LineOfSightTest(CStateManager& mgr, const zeus::CVector3f& eyePos, const zeus::CVector3f& targetPos,
bool LineOfSightTest(const CStateManager& mgr, const zeus::CVector3f& eyePos, const zeus::CVector3f& targetPos,
const CMaterialList& excludeList) const;
void UpdateHeldPosition(CStateManager& mgr, float dt);
void CheckBlade(CStateManager& mgr);
bool CantJumpBack(CStateManager& mgr, const zeus::CVector3f& dir, float dist) const;
bool CantJumpBack(const CStateManager& mgr, const zeus::CVector3f& dir, float dist) const;
void UpdateLeashTimer(float dt);
pas::EStepDirection GetStrafeDir(CStateManager& mgr, float dist) const;

View File

@ -543,7 +543,7 @@ void CTryclops::DragPlayer(CStateManager& mgr, const zeus::CVector3f& locOrig) {
player.SetTransform(xf);
}
bool CTryclops::InRangeToLocator(const zeus::CVector3f& vec, float arg) {
bool CTryclops::InRangeToLocator(const zeus::CVector3f& vec, float arg) const {
return (vec - GetLctrTransform("ballGrab_locator"sv).origin).magSquared() <= arg;
}

View File

@ -27,7 +27,7 @@ class CTryclops : public CPatterned {
void ApplySeparation(CStateManager&);
void GrabBomb(CStateManager& mgr);
void DragPlayer(CStateManager& mgr, const zeus::CVector3f& locOrig);
bool InRangeToLocator(const zeus::CVector3f& vec, float);
bool InRangeToLocator(const zeus::CVector3f& vec, float) const;
bool sub80260180(const zeus::CVector3f&, const zeus::CVector3f&, const zeus::CAABox&, CStateManager&);
void SuckPlayer(CStateManager& mgr, float);
void AttractPlayer(CStateManager& mgr, const zeus::CVector3f& dest, float);

View File

@ -124,7 +124,7 @@ std::optional<zeus::CAABox> CWarWasp::GetTouchBounds() const {
return {x570_cSphere.CalculateAABox(GetTransform())};
}
zeus::CVector3f CWarWasp::GetProjectileAimPos(CStateManager& mgr, float zBias) {
zeus::CVector3f CWarWasp::GetProjectileAimPos(const CStateManager& mgr, float zBias) const {
zeus::CVector3f ret = mgr.GetPlayer().GetAimPosition(mgr, 0.f);
if (mgr.GetPlayer().GetMorphballTransitionState() != CPlayer::EPlayerMorphBallState::Morphed)
ret += zeus::CVector3f(0.f, 0.f, zBias);
@ -353,7 +353,7 @@ void CWarWasp::ApplySeparationBehavior(CStateManager& mgr, float sep) {
}
}
bool CWarWasp::PathToHiveIsClear(CStateManager& mgr) {
bool CWarWasp::PathToHiveIsClear(CStateManager& mgr) const {
zeus::CVector3f delta = x3a0_latestLeashPosition - GetTranslation();
if (GetTransform().basis[1].dot(delta) > 0.f) {
zeus::CAABox aabb(GetTranslation() - 10.f, GetTranslation() + 10.f);
@ -652,7 +652,7 @@ void CWarWasp::JumpBack(CStateManager& mgr, EStateMsg msg, float dt) {
}
}
zeus::CVector3f CWarWasp::CalcShuffleDest(CStateManager& mgr) {
zeus::CVector3f CWarWasp::CalcShuffleDest(const CStateManager& mgr) const {
zeus::CVector2f aimPos2d = GetProjectileAimPos(mgr, -1.25f).toVec2f();
zeus::CVector3f playerDir2d = mgr.GetPlayer().GetTransform().basis[1];
playerDir2d.z() = 0.f;
@ -754,7 +754,7 @@ void CWarWasp::ProjectileAttack(CStateManager& mgr, EStateMsg msg, float dt) {
}
}
s32 CWarWasp::GetAttackTeamSize(CStateManager& mgr, s32 team) {
s32 CWarWasp::GetAttackTeamSize(const CStateManager& mgr, s32 team) const {
s32 count = 0;
if (TCastToConstPtr<CTeamAiMgr> aimgr = mgr.GetObjectById(x674_aiMgr)) {
if (aimgr->IsPartOfTeam(GetUniqueId())) {
@ -769,21 +769,20 @@ s32 CWarWasp::GetAttackTeamSize(CStateManager& mgr, s32 team) {
return count;
}
float CWarWasp::CalcTimeToNextAttack(CStateManager& mgr) {
float CWarWasp::CalcTimeToNextAttack(CStateManager& mgr) const {
float mul = 1.f;
if (TCastToConstPtr<CTeamAiMgr> aimgr = mgr.GetObjectById(x674_aiMgr)) {
s32 maxCount = (x3fc_flavor == EFlavorType::Two) ?
aimgr->GetMaxRangedAttackerCount() : aimgr->GetMaxMeleeAttackerCount();
s32 count = (x3fc_flavor == EFlavorType::Two) ?
aimgr->GetNumAssignedOfRole(CTeamAiRole::ETeamAiRole::Ranged) :
aimgr->GetNumAssignedOfRole(CTeamAiRole::ETeamAiRole::Melee);
const s32 maxCount =
(x3fc_flavor == EFlavorType::Two) ? aimgr->GetMaxRangedAttackerCount() : aimgr->GetMaxMeleeAttackerCount();
const s32 count = (x3fc_flavor == EFlavorType::Two) ? aimgr->GetNumAssignedOfRole(CTeamAiRole::ETeamAiRole::Ranged)
: aimgr->GetNumAssignedOfRole(CTeamAiRole::ETeamAiRole::Melee);
if (count <= maxCount)
mul *= 0.5f;
}
return (mgr.GetActiveRandom()->Float() * x308_attackTimeVariation + x304_averageAttackTime) * mul;
}
float CWarWasp::CalcOffTotemAngle(CStateManager& mgr) {
float CWarWasp::CalcOffTotemAngle(CStateManager& mgr) const {
return mgr.GetActiveRandom()->Float() * zeus::degToRad(80.f) + zeus::degToRad(10.f);
}
@ -833,7 +832,7 @@ void CWarWasp::SetUpCircleTelegraphTeam(CStateManager& mgr) {
}
}
TUniqueId CWarWasp::GetAttackTeamLeader(CStateManager& mgr, s32 team) {
TUniqueId CWarWasp::GetAttackTeamLeader(const CStateManager& mgr, s32 team) const {
if (TCastToConstPtr<CTeamAiMgr> aimgr = mgr.GetObjectById(x674_aiMgr)) {
if (aimgr->IsPartOfTeam(GetUniqueId())) {
for (const CTeamAiRole& role : aimgr->GetRoles()) {
@ -866,7 +865,7 @@ void CWarWasp::TryCircleTeamMerge(CStateManager& mgr) {
}
}
float CWarWasp::GetTeamZStratum(s32 team) {
float CWarWasp::GetTeamZStratum(s32 team) const {
if (team > 0) {
if ((team & 1) == 1)
return -3.f - float(team / 2) * 3.f;
@ -878,19 +877,19 @@ float CWarWasp::GetTeamZStratum(s32 team) {
static const float Table[] = {0.4f, 0.6f, 1.f};
float CWarWasp::CalcSeekMagnitude(CStateManager& mgr) {
float ret = ((x708_circleAttackTeam >= 0 && x708_circleAttackTeam < 3) ? Table[x708_circleAttackTeam] : 1.f) * 0.9f;
float CWarWasp::CalcSeekMagnitude(const CStateManager& mgr) const {
const float ret = ((x708_circleAttackTeam >= 0 && x708_circleAttackTeam < 3) ? Table[x708_circleAttackTeam] : 1.f) * 0.9f;
if (TCastToConstPtr<CTeamAiMgr> aimgr = mgr.GetObjectById(x674_aiMgr)) {
if (aimgr->IsPartOfTeam(GetUniqueId())) {
if (aimgr->GetMaxMeleeAttackerCount() > 1) {
if (GetAttackTeamLeader(mgr, x708_circleAttackTeam) != GetUniqueId()) {
zeus::CVector3f fromPlatformCenter = GetTranslation() - x6b0_circleBurstPos;
const zeus::CVector3f fromPlatformCenter = GetTranslation() - x6b0_circleBurstPos;
float minAngle = zeus::degToRad(360.f);
for (const CTeamAiRole& role : aimgr->GetRoles()) {
if (const CWarWasp* other = CPatterned::CastTo<CWarWasp>(mgr.GetObjectById(role.GetOwnerId()))) {
if (x708_circleAttackTeam == other->x708_circleAttackTeam &&
GetTransform().basis[1].dot(other->GetTranslation() - GetTranslation()) > 0.f) {
float angle =
const float angle =
zeus::CVector3f::getAngleDiff(fromPlatformCenter, other->GetTranslation() - x6b0_circleBurstPos);
if (angle < minAngle)
minAngle = angle;
@ -1155,14 +1154,14 @@ bool CWarWasp::ShouldDodge(CStateManager& mgr, float arg) {
return false;
}
bool CWarWasp::CheckCircleAttackSpread(CStateManager& mgr, s32 team) {
bool CWarWasp::CheckCircleAttackSpread(const CStateManager& mgr, s32 team) const {
if (TCastToConstPtr<CTeamAiMgr> aimgr = mgr.GetObjectById(x674_aiMgr)) {
s32 teamSize = GetAttackTeamSize(mgr, team);
const s32 teamSize = GetAttackTeamSize(mgr, team);
if (teamSize == 1)
return true;
TUniqueId leaderId = GetAttackTeamLeader(mgr, team);
const TUniqueId leaderId = GetAttackTeamLeader(mgr, team);
if (const CWarWasp* leaderWasp = CPatterned::CastTo<CWarWasp>(mgr.GetObjectById(leaderId))) {
zeus::CVector3f platformToLeaderWasp = leaderWasp->GetTranslation() - x6b0_circleBurstPos;
const zeus::CVector3f platformToLeaderWasp = leaderWasp->GetTranslation() - x6b0_circleBurstPos;
float maxAng = 0.f;
for (const CTeamAiRole& role : aimgr->GetRoles()) {
if (role.GetOwnerId() == leaderId)
@ -1171,7 +1170,7 @@ bool CWarWasp::CheckCircleAttackSpread(CStateManager& mgr, s32 team) {
if (wasp2->x708_circleAttackTeam == team) {
if (leaderWasp->GetTransform().basis[1].dot(wasp2->GetTranslation() - leaderWasp->GetTranslation()) > 0.f)
return false;
float angle =
const float angle =
zeus::CVector3f::getAngleDiff(wasp2->GetTranslation() - x6b0_circleBurstPos, platformToLeaderWasp);
if (angle > maxAng)
maxAng = angle;

View File

@ -47,26 +47,26 @@ class CWarWasp : public CPatterned {
void SwarmRemove(CStateManager& mgr);
void ApplyDamage(CStateManager& mgr);
void SetUpCircleBurstWaypoint(CStateManager& mgr);
zeus::CVector3f GetProjectileAimPos(CStateManager& mgr, float zBias);
zeus::CVector3f GetProjectileAimPos(const CStateManager& mgr, float zBias) const;
zeus::CVector3f GetCloseInPos(const CStateManager& mgr, const zeus::CVector3f& aimPos) const;
float GetCloseInZBasis(const CStateManager& mgr) const;
void SetUpPathFindBehavior(CStateManager& mgr);
s32 GetAttackTeamSize(CStateManager& mgr, s32 team);
float CalcTimeToNextAttack(CStateManager& mgr);
float CalcOffTotemAngle(CStateManager& mgr);
s32 GetAttackTeamSize(const CStateManager& mgr, s32 team) const;
float CalcTimeToNextAttack(CStateManager& mgr) const;
float CalcOffTotemAngle(CStateManager& mgr) const;
void JoinCircleAttackTeam(s32 unit, CStateManager& mgr);
void SetUpCircleTelegraphTeam(CStateManager& mgr);
TUniqueId GetAttackTeamLeader(CStateManager& mgr, s32 team);
TUniqueId GetAttackTeamLeader(const CStateManager& mgr, s32 team) const;
void TryCircleTeamMerge(CStateManager& mgr);
float GetTeamZStratum(s32 team);
float CalcSeekMagnitude(CStateManager& mgr);
float GetTeamZStratum(s32 team) const;
float CalcSeekMagnitude(const CStateManager& mgr) const;
void UpdateTelegraphMoveSpeed(CStateManager& mgr);
bool CheckCircleAttackSpread(CStateManager& mgr, s32 team);
bool CheckCircleAttackSpread(const CStateManager& mgr, s32 team) const;
void ApplyNormalSteering(CStateManager& mgr);
void ApplySeparationBehavior(CStateManager& mgr, float sep);
bool PathToHiveIsClear(CStateManager& mgr);
bool PathToHiveIsClear(CStateManager& mgr) const;
bool SteerToDeactivatePos(CStateManager& mgr, EStateMsg msg, float dt);
zeus::CVector3f CalcShuffleDest(CStateManager& mgr);
zeus::CVector3f CalcShuffleDest(const CStateManager& mgr) const;
public:
DEFINE_PATTERNED(WarWasp)

View File

@ -566,7 +566,7 @@ void CElementGen::UpdatePSTranslationAndOrientation() {
sepo->GetValue(x74_curFrame, x2c0_SEPO);
}
std::unique_ptr<CParticleGen> CElementGen::ConstructChildParticleSystem(const TToken<CGenDescription>& desc) {
std::unique_ptr<CParticleGen> CElementGen::ConstructChildParticleSystem(const TToken<CGenDescription>& desc) const {
CElementGen* ret = new CElementGen(desc, EModelOrientationType::Normal,
x26d_27_enableOPTS ? EOptionalSystemFlags::Two : EOptionalSystemFlags::One);
ret->x26d_26_modelsUseLights = x26d_26_modelsUseLights;

View File

@ -172,7 +172,7 @@ public:
void CreateNewParticles(int);
void UpdatePSTranslationAndOrientation();
void UpdateChildParticleSystems(double);
std::unique_ptr<CParticleGen> ConstructChildParticleSystem(const TToken<CGenDescription>&);
std::unique_ptr<CParticleGen> ConstructChildParticleSystem(const TToken<CGenDescription>&) const;
void UpdateLightParameters();
void BuildParticleSystemBounds();
u32 GetEmitterTime() const { return x74_curFrame; }

View File

@ -133,6 +133,7 @@ public:
void EnterComboFire(s32 gunId, CStateManager& mgr);
void ReturnToDefault(CStateManager& mgr, float dt, bool setState);
CGunController* GunController() { return x328_gunController.get(); }
const CGunController* GunController() const { return x328_gunController.get(); }
};
} // namespace urde

View File

@ -811,7 +811,7 @@ void CPlayerGun::ChangeWeapon(const CPlayerState& playerState, CStateManager& mg
}
void CPlayerGun::GetLctrWithShake(zeus::CTransform& xfOut, const CModelData& mData, std::string_view lctrName,
bool shake, bool dyn) {
bool shake, bool dyn) const {
if (dyn)
xfOut = mData.GetScaledLocatorTransformDynamic(lctrName, nullptr);
else

View File

@ -284,7 +284,7 @@ private:
void ReturnToRestPose();
void ChangeWeapon(const CPlayerState& playerState, CStateManager& mgr);
void GetLctrWithShake(zeus::CTransform& xfOut, const CModelData& mData, std::string_view lctrName, bool shake,
bool dyn);
bool dyn) const;
void UpdateLeftArmTransform(const CModelData& mData, const CStateManager& mgr);
void ProcessGunMorph(float dt, CStateManager& mgr);
void SetPhazonBeamFeedback(bool active);
@ -338,6 +338,7 @@ public:
void SetTransform(const zeus::CTransform& xf) { x3e8_xf = xf; }
void SetAssistAimTransform(const zeus::CTransform& xf) { x478_assistAimXf = xf; }
CGrappleArm& GetGrappleArm() { return *x740_grappleArm; }
const CGrappleArm& GetGrappleArm() const { return *x740_grappleArm; }
void DamageRumble(const zeus::CVector3f& location, float damage, const CStateManager& mgr);
void ResetCharge(CStateManager& mgr, bool resetBeam);
void HandleBeamChange(const CFinalInput& input, CStateManager& mgr);

View File

@ -62,7 +62,7 @@ float CProjectileInfo::GetProjectileSpeed() const {
}
zeus::CVector3f CProjectileInfo::PredictInterceptPos(const zeus::CVector3f& gunPos, const zeus::CVector3f& aimPos,
const CPlayer& player, bool gravity, float dt) {
const CPlayer& player, bool gravity, float dt) const {
return PredictInterceptPos(gunPos, aimPos, player, gravity, GetProjectileSpeed(), dt);
}

View File

@ -19,7 +19,7 @@ public:
static zeus::CVector3f PredictInterceptPos(const zeus::CVector3f& gunPos, const zeus::CVector3f& aimPos,
const CPlayer& player, bool gravity, float speed, float dt);
zeus::CVector3f PredictInterceptPos(const zeus::CVector3f& gunPos, const zeus::CVector3f& aimPos,
const CPlayer& player, bool gravity, float dt);
const CPlayer& player, bool gravity, float dt) const;
const CDamageInfo& GetDamage() const { return xc_damageInfo; }
TToken<CWeaponDescription>& Token() { return x0_weaponDescription; }

View File

@ -212,7 +212,7 @@ void CFishCloud::BuildBoidNearPartitionList(const zeus::CVector3f& pos, float ra
}
}
void CFishCloud::PlaceBoid(CStateManager& mgr, CBoid& boid, const zeus::CAABox& aabb) {
void CFishCloud::PlaceBoid(CStateManager& mgr, CBoid& boid, const zeus::CAABox& aabb) const {
auto plane = FindClosestPlane(aabb, boid.x0_pos);
boid.x0_pos -= plane.pointToPlaneDist(boid.x0_pos) * plane.normal() + 0.0001f * plane.normal();
boid.xc_vel.y() = mgr.GetActiveRandom()->Float() - 0.5f;

View File

@ -100,7 +100,7 @@ class CFishCloud : public CActor {
void BuildBoidNearList(const zeus::CVector3f& pos, float radius, rstl::reserved_vector<CBoid*, 25>& nearList);
void BuildBoidNearPartitionList(const zeus::CVector3f& pos, float radius,
rstl::reserved_vector<CBoid*, 25>& nearList);
void PlaceBoid(CStateManager& mgr, CBoid& boid, const zeus::CAABox& aabb);
void PlaceBoid(CStateManager& mgr, CBoid& boid, const zeus::CAABox& aabb) const;
void ApplySeparation(CBoid& boid, const rstl::reserved_vector<CBoid*, 25>& nearList) const;
void ApplySeparation(CBoid& boid, const zeus::CVector3f& separateFrom,
float separationRadius, float separationMagnitude) const;

View File

@ -895,7 +895,7 @@ void CGameArea::LoadScriptObjects(CStateManager& mgr) {
mgr.InitScriptObjects(objIds);
}
std::pair<const u8*, u32> CGameArea::GetLayerScriptBuffer(int layer) {
std::pair<const u8*, u32> CGameArea::GetLayerScriptBuffer(int layer) const {
if (!xf0_24_postConstructed)
return {};
return x12c_postConstructed->x110c_layerPtrs[layer];

View File

@ -315,7 +315,7 @@ public:
void StartStreamIn(CStateManager& mgr);
void Validate(CStateManager& mgr);
void LoadScriptObjects(CStateManager& mgr);
std::pair<const u8*, u32> GetLayerScriptBuffer(int layer);
std::pair<const u8*, u32> GetLayerScriptBuffer(int layer) const;
void PostConstructArea();
void FillInStaticGeometry(bool textures = true);
void VerifyTokenList(CStateManager& stateMgr);

View File

@ -116,7 +116,7 @@ void CPFOpenList::Pop(CPFRegion* reg) {
reg->Data()->SetOpenLess(nullptr);
}
bool CPFOpenList::Test(CPFRegion* reg) { return x0_bitSet.Test(reg->GetIndex()); }
bool CPFOpenList::Test(const CPFRegion* reg) const { return x0_bitSet.Test(reg->GetIndex()); }
CPFArea::CPFArea(std::unique_ptr<u8[]>&& buf, u32 len) {
CMemoryInStream r(buf.get(), len);

View File

@ -53,7 +53,7 @@ public:
void Push(CPFRegion* reg);
CPFRegion* Pop();
void Pop(CPFRegion* reg);
bool Test(CPFRegion* reg);
bool Test(const CPFRegion* reg) const;
};
class CPFArea {

View File

@ -66,7 +66,7 @@ float CPFRegion::PointHeight(const zeus::CVector3f& point) const {
}
bool CPFRegion::FindClosestPointOnPolygon(const std::vector<zeus::CVector3f>& polyPoints, const zeus::CVector3f& normal,
const zeus::CVector3f& point, bool excludePolyPoints) {
const zeus::CVector3f& point, bool excludePolyPoints) const {
bool found = false;
size_t i;
for (i = 0; i < polyPoints.size(); ++i) {
@ -122,7 +122,7 @@ bool CPFRegion::FindClosestPointOnPolygon(const std::vector<zeus::CVector3f>& po
}
bool CPFRegion::FindBestPoint(std::vector<zeus::CVector3f>& polyPoints, const zeus::CVector3f& point, u32 flags,
float paddingSq) {
float paddingSq) const {
bool found = false;
bool isFlyer = (flags & 0x2) != 0;
x4c_regionData->SetBestPointDistanceSquared(paddingSq);

View File

@ -65,9 +65,9 @@ public:
const CPFNode* GetNode(u32 i) const { return x4_startNode + i; }
float PointHeight(const zeus::CVector3f& point) const;
bool FindClosestPointOnPolygon(const std::vector<zeus::CVector3f>&, const zeus::CVector3f&, const zeus::CVector3f&,
bool);
bool) const;
bool FindBestPoint(std::vector<zeus::CVector3f>& polyPoints, const zeus::CVector3f& point, u32 flags,
float paddingSq);
float paddingSq) const;
void SetLinkTo(s32 idx);
void DropToGround(zeus::CVector3f& point) const;
zeus::CVector3f GetLinkMidPoint(const CPFLink& link) const;

View File

@ -1165,7 +1165,7 @@ void CPatterned::UpdateAlphaDelta(float dt, CStateManager& mgr) {
x64_modelData->AnimationData()->GetParticleDB().SetModulationColorAllActiveEffects(zeus::CColor(1.f, alpha));
}
float CPatterned::CalcDyingThinkRate() {
float CPatterned::CalcDyingThinkRate() const {
float f0 = (x401_28_burning ? (x3f4_burnThinkRateTimer / 1.5f) : 1.f);
return zeus::max(0.1f, f0);
}

View File

@ -372,7 +372,7 @@ public:
void SetDestPos(const zeus::CVector3f& pos) { x2e0_destPos = pos; }
void UpdateAlphaDelta(float dt, CStateManager& mgr);
void SetModelAlpha(float a) { x42c_color.a() = a; }
float CalcDyingThinkRate();
float CalcDyingThinkRate() const;
void UpdateDamageColor(float dt);
CScriptCoverPoint* GetCoverPoint(CStateManager& mgr, TUniqueId id) const;
void SetCoverPoint(CScriptCoverPoint* cp, TUniqueId& id);

View File

@ -218,7 +218,7 @@ void CPhysicsActor::ComputeDerivedQuantities() {
x144_angularVelocity = xf4_inertiaTensorRecip * x108_angularMomentum;
}
bool CPhysicsActor::WillMove(const CStateManager&) {
bool CPhysicsActor::WillMove(const CStateManager&) const {
return !zeus::close_enough(zeus::skZero3f, x138_velocity) ||
!zeus::close_enough(zeus::skZero3f, x168_impulse) ||
!zeus::close_enough(zeus::skZero3f, x174_torque) ||

View File

@ -150,7 +150,7 @@ public:
void SetVelocityWR(const zeus::CVector3f& vel);
void SetVelocityOR(const zeus::CVector3f& vel);
void SetMomentumWR(const zeus::CVector3f& m) { x150_momentum = m; }
const zeus::CVector3f& GetConstantForce() { return xfc_constantForce; }
const zeus::CVector3f& GetConstantForce() const { return xfc_constantForce; }
void SetConstantForce(const zeus::CVector3f& f) { xfc_constantForce = f; }
void SetAngularMomentum(const zeus::CAxisAngle& m) { x108_angularMomentum = m; }
const zeus::CVector3f& GetMomentum() const { return x150_momentum; }
@ -170,7 +170,7 @@ public:
void ClearForcesAndTorques();
void Stop();
void ComputeDerivedQuantities();
bool WillMove(const CStateManager&);
bool WillMove(const CStateManager&) const;
void SetPhysicsState(const CPhysicsState& state);
CPhysicsState GetPhysicsState() const;
bool IsMovable() const { return xf8_24_movable; }

View File

@ -915,7 +915,7 @@ void CPlayer::Accept(IVisitor& visitor) { visitor.Visit(this); }
CHealthInfo* CPlayer::HealthInfo(CStateManager& mgr) { return &mgr.GetPlayerState()->HealthInfo(); }
bool CPlayer::IsUnderBetaMetroidAttack(CStateManager& mgr) const {
bool CPlayer::IsUnderBetaMetroidAttack(const CStateManager& mgr) const {
if (x274_energyDrain.GetEnergyDrainIntensity() > 0.f) {
for (const CEnergyDrainSource& source : x274_energyDrain.GetEnergyDrainSources())
if (CPatterned::CastTo<MP1::CMetroidBeta>(mgr.GetObjectById(source.GetEnergyDrainSourceId())))
@ -1000,7 +1000,7 @@ void CPlayer::UpdateScanningState(const CFinalInput& input, CStateManager& mgr,
}
}
bool CPlayer::ValidateScanning(const CFinalInput& input, CStateManager& mgr) {
bool CPlayer::ValidateScanning(const CFinalInput& input, const CStateManager& mgr) const {
if (ControlMapper::GetDigitalInput(ControlMapper::ECommands::ScanItem, input)) {
if (x304_orbitState == EPlayerOrbitState::OrbitObject) {
if (TCastToPtr<CActor> act = mgr.ObjectById(x310_orbitTargetId)) {
@ -2660,7 +2660,7 @@ void CPlayer::UpdateFootstepSounds(const CFinalInput& input, CStateManager& mgr,
}
}
u16 CPlayer::GetMaterialSoundUnderPlayer(CStateManager& mgr, const u16* table, u32 length, u16 defId) {
u16 CPlayer::GetMaterialSoundUnderPlayer(const CStateManager& mgr, const u16* table, u32 length, u16 defId) const {
u16 ret = defId;
zeus::CAABox aabb = GetBoundingBox();
aabb.accumulateBounds(x34_transform.origin + zeus::skDown);
@ -3274,7 +3274,7 @@ void CPlayer::ApplyGrappleForces(const CFinalInput& input, CStateManager& mgr, f
SetAngularVelocityOR(newAngVel);
}
bool CPlayer::ValidateFPPosition(const zeus::CVector3f& pos, CStateManager& mgr) {
bool CPlayer::ValidateFPPosition(const zeus::CVector3f& pos, const CStateManager& mgr) const {
CMaterialFilter solidFilter = CMaterialFilter::MakeInclude({EMaterialTypes::Solid});
zeus::CAABox aabb(x2d8_fpBounds.min - 1.f + pos, x2d8_fpBounds.max + 1.f + pos);
rstl::reserved_vector<TUniqueId, 1024> nearList;
@ -3837,7 +3837,7 @@ static zeus::CAABox BuildNearListBox(bool cropBottom, const zeus::CTransform& xf
return aabb.getTransformedAABox(xf);
}
TUniqueId CPlayer::FindAimTargetId(CStateManager& mgr) {
TUniqueId CPlayer::FindAimTargetId(CStateManager& mgr) const {
float dist = g_tweakPlayer->GetAimMaxDistance();
if (x9c6_24_extendTargetDistance)
dist *= 5.f;
@ -3917,7 +3917,7 @@ TUniqueId CPlayer::CheckEnemiesAgainstOrbitZone(const rstl::reserved_vector<TUni
return bestId;
}
TUniqueId CPlayer::FindOrbitTargetId(CStateManager& mgr) {
TUniqueId CPlayer::FindOrbitTargetId(CStateManager& mgr) const {
return FindBestOrbitableObject(x354_onScreenOrbitObjects, x330_orbitZoneMode, mgr);
}

View File

@ -381,13 +381,13 @@ public:
void TakeDamage(bool, const zeus::CVector3f&, float, EWeaponType, CStateManager& mgr);
void Accept(IVisitor& visitor) override;
CHealthInfo* HealthInfo(CStateManager& mgr) override;
bool IsUnderBetaMetroidAttack(CStateManager& mgr) const;
bool IsUnderBetaMetroidAttack(const CStateManager& mgr) const;
std::optional<zeus::CAABox> GetTouchBounds() const override;
void Touch(CActor& actor, CStateManager& mgr) override;
void DoPreThink(float dt, CStateManager& mgr);
void DoThink(float dt, CStateManager& mgr);
void UpdateScanningState(const CFinalInput& input, CStateManager& mgr, float);
bool ValidateScanning(const CFinalInput& input, CStateManager& mgr);
bool ValidateScanning(const CFinalInput& input, const CStateManager& mgr) const;
void FinishNewScan(CStateManager& mgr);
void SetScanningState(EPlayerScanState, CStateManager& mgr);
void SetSpawnedMorphBallState(EPlayerMorphBallState, CStateManager&);
@ -432,7 +432,7 @@ public:
void AcceptScriptMsg(EScriptObjectMessage, TUniqueId, CStateManager&) override;
void SetVisorSteam(float, float, float, CAssetId, bool);
void UpdateFootstepSounds(const CFinalInput& input, CStateManager&, float);
u16 GetMaterialSoundUnderPlayer(CStateManager& mgr, const u16*, u32, u16);
u16 GetMaterialSoundUnderPlayer(const CStateManager& mgr, const u16*, u32, u16) const;
static u16 SfxIdFromMaterial(const CMaterialList&, const u16*, u32, u16);
void UpdateCrosshairsState(const CFinalInput&);
void UpdateVisorTransition(float, CStateManager& mgr);
@ -460,7 +460,7 @@ public:
void UpdateGrappleArmTransform(const zeus::CVector3f&, CStateManager& mgr, float);
float GetGravity() const;
void ApplyGrappleForces(const CFinalInput& input, CStateManager& mgr, float);
bool ValidateFPPosition(const zeus::CVector3f& pos, CStateManager& mgr);
bool ValidateFPPosition(const zeus::CVector3f& pos, const CStateManager& mgr) const;
void UpdateGrappleState(const CFinalInput& input, CStateManager& mgr);
void ApplyGrappleJump(CStateManager& mgr);
void BeginGrapple(zeus::CVector3f&, CStateManager& mgr);
@ -482,11 +482,11 @@ public:
void UpdateAimTargetTimer(float);
bool ValidateAimTargetId(TUniqueId, CStateManager& mgr);
bool ValidateObjectForMode(TUniqueId, CStateManager& mgr) const;
TUniqueId FindAimTargetId(CStateManager& mgr);
TUniqueId FindAimTargetId(CStateManager& mgr) const;
TUniqueId GetAimTarget() const { return x3f4_aimTarget; }
TUniqueId CheckEnemiesAgainstOrbitZone(const rstl::reserved_vector<TUniqueId, 1024>&, EPlayerZoneInfo,
EPlayerZoneType, CStateManager& mgr) const;
TUniqueId FindOrbitTargetId(CStateManager& mgr);
TUniqueId FindOrbitTargetId(CStateManager& mgr) const;
void UpdateOrbitableObjects(CStateManager& mgr);
TUniqueId FindBestOrbitableObject(const std::vector<TUniqueId>&, EPlayerZoneInfo, CStateManager& mgr) const;
void FindOrbitableObjects(const rstl::reserved_vector<TUniqueId, 1024>&, std::vector<TUniqueId>&, EPlayerZoneInfo,

View File

@ -165,13 +165,13 @@ void CPlayerCameraBob::Update(float dt, CStateManager& mgr) {
zeus::lookAt(zeus::skZero3f, {0.f, 2.f, x78_camTranslation}, zeus::skUp);
}
zeus::CVector3f CPlayerCameraBob::CalculateRandomViewWanderPosition(CStateManager& mgr) {
zeus::CVector3f CPlayerCameraBob::CalculateRandomViewWanderPosition(CStateManager& mgr) const {
const float angle = (2.f * (M_PIF * mgr.GetActiveRandom()->Float()));
const float bias = kViewWanderRadius * mgr.GetActiveRandom()->Float();
return {(bias * std::sin(angle)), 1.f, (bias * std::cos(angle))};
}
float CPlayerCameraBob::CalculateRandomViewWanderPitch(CStateManager& mgr) {
float CPlayerCameraBob::CalculateRandomViewWanderPitch(CStateManager& mgr) const {
return zeus::degToRad((2.f * (mgr.GetActiveRandom()->Float() - 0.5f)) * kViewWanderRollVariation);
}

View File

@ -87,8 +87,8 @@ public:
void InitViewWander(CStateManager&);
void UpdateViewWander(float, CStateManager&);
void Update(float, CStateManager&);
zeus::CVector3f CalculateRandomViewWanderPosition(CStateManager&);
float CalculateRandomViewWanderPitch(CStateManager&);
zeus::CVector3f CalculateRandomViewWanderPosition(CStateManager&) const;
float CalculateRandomViewWanderPitch(CStateManager&) const;
void CalculateMovingTranslation(float& x, float& y) const;
float CalculateLandingTranslation() const;
zeus::CTransform CalculateCameraBobTransformation() const;

View File

@ -223,7 +223,7 @@ void CScriptDoor::ForceClosed(CStateManager& mgr) {
}
/* ORIGINAL 0-00 OFFSET: 8007E1C4 */
bool CScriptDoor::IsConnectedToArea(const CStateManager& mgr, TAreaId areaId) {
bool CScriptDoor::IsConnectedToArea(const CStateManager& mgr, TAreaId areaId) const {
const CScriptDock* dockEnt = TCastToConstPtr<CScriptDock>(mgr.GetObjectById(x282_dockId));
if (dockEnt) {
if (dockEnt->GetAreaId() == areaId)
@ -286,7 +286,7 @@ void CScriptDoor::OpenDoor(TUniqueId uid, CStateManager& mgr) {
}
/* ORIGINAL 0-00 OFFSET: 8007ED4C */
CScriptDoor::EDoorOpenCondition CScriptDoor::GetDoorOpenCondition(CStateManager& mgr) {
CScriptDoor::EDoorOpenCondition CScriptDoor::GetDoorOpenCondition(CStateManager& mgr) const {
const TCastToPtr<CScriptDock> dock = mgr.ObjectById(x282_dockId);
if (!dock)
return EDoorOpenCondition::Ready;

View File

@ -49,9 +49,9 @@ public:
void AddToRenderer(const zeus::CFrustum&, const CStateManager& mgr) const override;
void Render(const CStateManager&) const override {}
void ForceClosed(CStateManager&);
bool IsConnectedToArea(const CStateManager& mgr, TAreaId area);
bool IsConnectedToArea(const CStateManager& mgr, TAreaId area) const;
void OpenDoor(TUniqueId, CStateManager&);
EDoorOpenCondition GetDoorOpenCondition(CStateManager& mgr);
EDoorOpenCondition GetDoorOpenCondition(CStateManager& mgr) const;
void SetDoorAnimation(EDoorAnimType);
std::optional<zeus::CAABox> GetTouchBounds() const override;
std::optional<zeus::CAABox> GetProjectileBounds() const;

View File

@ -353,7 +353,7 @@ zeus::CAABox CScriptEffect::GetSortingBounds(const CStateManager& mgr) const {
return static_cast<const CScriptTrigger*>(mgr.GetObjectById(x13c_triggerId))->GetTriggerBoundsWR();
}
bool CScriptEffect::AreBothSystemsDeleteable() {
bool CScriptEffect::AreBothSystemsDeleteable() const {
bool ret = true;
if (x104_particleSystem && !x104_particleSystem->IsSystemDeletable())
ret = false;

View File

@ -65,7 +65,7 @@ public:
}
void CalculateRenderBounds() override;
zeus::CAABox GetSortingBounds(const CStateManager&) const override;
bool AreBothSystemsDeleteable();
bool AreBothSystemsDeleteable() const;
static void ResetParticleCounts() {
g_NumParticlesUpdating = 0;
g_NumParticlesRendered = 0;

View File

@ -20,7 +20,7 @@ public:
CAiTrigger() = default;
CAiTrigger* GetAnd() const { return x10_andTrig; }
CAiState* GetState() const { return x14_state; }
bool CallFunc(CStateManager& mgr, CAi& ai) {
bool CallFunc(CStateManager& mgr, CAi& ai) const {
if (x0_func) {
bool ret = (ai.*x0_func)(mgr, xc_arg);
return x18_lNot ? !ret : ret;

View File

@ -27,7 +27,7 @@ public:
}
TToken<CTexture> GetTexture() const;
zeus::CColor GetColor() { return x10_color; }
zeus::CColor GetColor() const { return x10_color; }
float GetScale() const;
float GetPosition() const;
};

View File

@ -111,7 +111,7 @@ public:
bool IsTransitionEnabled() const { return x30_type != ETransType::Disabled; }
void DisableTransition();
void TouchModels();
ETransType GetTransType() { return x30_type; }
ETransType GetTransType() const { return x30_type; }
void SetSfx(u16 sfx, u8 volume, u8 panning) {
x24_sfx = sfx;
x2c_volume = volume;