...
 
Commits (6)
......@@ -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());
......
......@@ -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);
......
......@@ -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) {
......
......@@ -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:
......
......@@ -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
......@@ -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
......@@ -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; }
......
......@@ -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))
......
......@@ -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;
......
......@@ -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);
}
......
......@@ -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; }
......
......@@ -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))
......
......@@ -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);
......
......@@ -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())
......
......@@ -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; }
......
......@@ -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) ||
......
......@@ -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; }
......
......@@ -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;
......
......@@ -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:
......
......@@ -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;
......
......@@ -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;
......
......@@ -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>();
......
......@@ -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);
......
......@@ -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;
......
......@@ -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);
......
......@@ -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();
......
......@@ -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:
......
......@@ -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
......@@ -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;
......
......@@ -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);
......
......@@ -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);
......
......@@ -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;
......
......@@ -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);
};
......
......@@ -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;
......
......@@ -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;
......
......@@ -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();
......
......@@ -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());
......
......@@ -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);
......
......@@ -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;
......
......@@ -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;
};
......
......@@ -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 {
......
......@@ -97,19 +97,15 @@ void CFrontEndUI::SNewFileSelectFrame::FinishedLoading() {
worker->SetIsSelectable(false);
worker->SetVisibility(false, ETraversalMode::Children);
x20_tablegroup_fileselect->SetMenuAdvanceCallback(
std::bind(&SNewFileSelectFrame::DoFileMenuAdvance, this, std::placeholders::_1));
x20_tablegroup_fileselect->SetMenuAdvanceCallback([this](CGuiTableGroup* caller) { DoFileMenuAdvance(caller); });
x20_tablegroup_fileselect->SetMenuSelectionChangeCallback(
std::bind(&SNewFileSelectFrame::DoSelectionChange, this, std::placeholders::_1, std::placeholders::_2));
x20_tablegroup_fileselect->SetMenuCancelCallback(
std::bind(&SNewFileSelectFrame::DoFileMenuCancel, this, std::placeholders::_1));
[this](CGuiTableGroup* caller, int oldSel) { DoSelectionChange(caller, oldSel); });
x20_tablegroup_fileselect->SetMenuCancelCallback([this](CGuiTableGroup* caller) { DoFileMenuCancel(caller); });
x40_tablegroup_popup->SetMenuAdvanceCallback(
std::bind(&SNewFileSelectFrame::DoPopupAdvance, this, std::placeholders::_1));
x40_tablegroup_popup->SetMenuAdvanceCallback([this](CGuiTableGroup* caller) { DoPopupAdvance(caller); });
x40_tablegroup_popup->SetMenuSelectionChangeCallback(
std::bind(&SNewFileSelectFrame::DoSelectionChange, this, std::placeholders::_1, std::placeholders::_2));
x40_tablegroup_popup->SetMenuCancelCallback(
std::bind(&SNewFileSelectFrame::DoPopupCancel, this, std::placeholders::_1));
[this](CGuiTableGroup* caller, int oldSel) { DoSelectionChange(caller, oldSel); });
x40_tablegroup_popup->SetMenuCancelCallback([this](CGuiTableGroup* caller) { DoPopupCancel(caller); });
for (int i = 0; i < 3; ++i)
x64_fileSelections[i] = FindFileSelectOption(x1c_loadedFrame, i);
......@@ -868,12 +864,12 @@ void CFrontEndUI::SFusionBonusFrame::FinishedLoading() {
SetTableColors(x28_tablegroup_options);
SetTableColors(x2c_tablegroup_fusionsuit);
x28_tablegroup_options->SetMenuAdvanceCallback(std::bind(&SFusionBonusFrame::DoAdvance, this, std::placeholders::_1));
x28_tablegroup_options->SetMenuAdvanceCallback([this](CGuiTableGroup* caller) { DoAdvance(caller); });
x28_tablegroup_options->SetMenuSelectionChangeCallback(
std::bind(&SFusionBonusFrame::DoSelectionChange, this, std::placeholders::_1, std::placeholders::_2));
x28_tablegroup_options->SetMenuCancelCallback(std::bind(&SFusionBonusFrame::DoCancel, this, std::placeholders::_1));
[this](CGuiTableGroup* caller, int oldSel) { DoSelectionChange(caller, oldSel); });
x28_tablegroup_options->SetMenuCancelCallback([this](CGuiTableGroup* caller) { DoCancel(caller); });
x2c_tablegroup_fusionsuit->SetMenuSelectionChangeCallback(
std::bind(&SFusionBonusFrame::DoSelectionChange, this, std::placeholders::_1, std::placeholders::_2));
[this](CGuiTableGroup* caller, int oldSel) { DoSelectionChange(caller, oldSel); });
}
bool CFrontEndUI::SFusionBonusFrame::PumpLoad() {
......@@ -1112,10 +1108,10 @@ void CFrontEndUI::SFrontEndFrame::FinishedLoading() {
if (proceed)
proceed->TextSupport().SetText(g_MainStringTable->GetString(85));
x18_tablegroup_mainmenu->SetMenuAdvanceCallback(std::bind(&SFrontEndFrame::DoAdvance, this, std::placeholders::_1));
x18_tablegroup_mainmenu->SetMenuAdvanceCallback([this](CGuiTableGroup* caller) { DoAdvance(caller); });
x18_tablegroup_mainmenu->SetMenuSelectionChangeCallback(
std::bind(&SFrontEndFrame::DoSelectionChange, this, std::placeholders::_1, std::placeholders::_2));
x18_tablegroup_mainmenu->SetMenuCancelCallback(std::bind(&SFrontEndFrame::DoCancel, this, std::placeholders::_1));
[this](CGuiTableGroup* caller, int oldSel) { DoSelectionChange(caller, oldSel); });
x18_tablegroup_mainmenu->SetMenuCancelCallback([this](CGuiTableGroup* caller) { DoCancel(caller); });
HandleActiveChange(x18_tablegroup_mainmenu);
}
......@@ -1531,31 +1527,27 @@ void CFrontEndUI::SOptionsFrontEndFrame::FinishedLoading() {
x30_tablegroup_triple = static_cast<CGuiTableGroup*>(x1c_loadedFrame->FindWidget("tablegroup_triple"));
x34_slidergroup_slider = static_cast<CGuiSliderGroup*>(x1c_loadedFrame->FindWidget("slidergroup_slider"));
x24_tablegroup_leftmenu->SetMenuAdvanceCallback(
std::bind(&SOptionsFrontEndFrame::DoLeftMenuAdvance, this, std::placeholders::_1));
x24_tablegroup_leftmenu->SetMenuAdvanceCallback([this](CGuiTableGroup* caller) { DoLeftMenuAdvance(caller); });
x24_tablegroup_leftmenu->SetMenuSelectionChangeCallback(
std::bind(&SOptionsFrontEndFrame::DoMenuSelectionChange, this, std::placeholders::_1, std::placeholders::_2));
[this](CGuiTableGroup* caller, int oldSel) { DoMenuSelectionChange(caller, oldSel); });
x38_rowPitch = x24_tablegroup_leftmenu->GetWorkerWidget(1)->GetIdlePosition().z() -
x24_tablegroup_leftmenu->GetWorkerWidget(0)->GetIdlePosition().z();
x28_tablegroup_rightmenu->SetMenuSelectionChangeCallback(
std::bind(&SOptionsFrontEndFrame::DoMenuSelectionChange, this, std::placeholders::_1, std::placeholders::_2));
x28_tablegroup_rightmenu->SetMenuCancelCallback(
std::bind(&SOptionsFrontEndFrame::DoMenuCancel, this, std::placeholders::_1));
[this](CGuiTableGroup* caller, int oldSel) { DoMenuSelectionChange(caller, oldSel); });
x28_tablegroup_rightmenu->SetMenuCancelCallback([this](CGuiTableGroup* caller) { DoMenuCancel(caller); });
x2c_tablegroup_double->SetMenuSelectionChangeCallback(
std::bind(&SOptionsFrontEndFrame::DoMenuSelectionChange, this, std::placeholders::_1, std::placeholders::_2));
x2c_tablegroup_double->SetMenuCancelCallback(
std::bind(&SOptionsFrontEndFrame::DoMenuCancel, this, std::placeholders::_1));
[this](CGuiTableGroup* caller, int oldSel) { DoMenuSelectionChange(caller, oldSel); });
x2c_tablegroup_double->SetMenuCancelCallback([this](CGuiTableGroup* caller) { DoMenuCancel(caller); });
x30_tablegroup_triple->SetMenuSelectionChangeCallback(
std::bind(&SOptionsFrontEndFrame::DoMenuSelectionChange, this, std::placeholders::_1, std::placeholders::_2));
x30_tablegroup_triple->SetMenuCancelCallback(
std::bind(&SOptionsFrontEndFrame::DoMenuCancel, this, std::placeholders::_1));
[this](CGuiTableGroup* caller, int oldSel) { DoMenuSelectionChange(caller, oldSel); });
x30_tablegroup_triple->SetMenuCancelCallback([this](CGuiTableGroup* caller) { DoMenuCancel(caller); });
x34_slidergroup_slider->SetSelectionChangedCallback(
std::bind(&SOptionsFrontEndFrame::DoSliderChange, this, std::placeholders::_1, std::placeholders::_2));
[this](CGuiSliderGroup* caller, float value) { DoSliderChange(caller, value); });
FindTextPanePair(x1c_loadedFrame, "textpane_double0").SetPairText(x20_loadedPauseStrg->GetString(95)); // Off
FindTextPanePair(x1c_loadedFrame, "textpane_double1").SetPairText(x20_loadedPauseStrg->GetString(94)); // On
......
......@@ -141,10 +141,10 @@ void CGBASupport::Update(float dt) {
case EPhase::StartJoyBusBoot:
x34_phase = EPhase::PollJoyBusBoot;
if (!g_JbusEndpoint || g_JbusEndpoint->GBAJoyBootAsync(
x40_siChan * 2, 2, x2c_buffer.get(), x28_fileSize, &x3c_status,
std::bind(JoyBootDone, std::placeholders::_1, std::placeholders::_2)) != jbus::GBA_READY)
if (!g_JbusEndpoint || g_JbusEndpoint->GBAJoyBootAsync(x40_siChan * 2, 2, x2c_buffer.get(), x28_fileSize,
&x3c_status, JoyBootDone) != jbus::GBA_READY) {
x34_phase = EPhase::Failed;
}
break;
case EPhase::PollJoyBusBoot:
......
......@@ -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;
......
......@@ -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();
......
......@@ -207,11 +207,11 @@ void COptionsScreen::VActivate() {
.SetText(xc_pauseStrg.GetString(98));
x18c_slidergroup_slider->SetSelectionChangedCallback(
std::bind(&COptionsScreen::OnSliderChanged, this, std::placeholders::_1, std::placeholders::_2));
[this](CGuiSliderGroup* caller, float value) { OnSliderChanged(caller, value); });
x190_tablegroup_double->SetMenuSelectionChangeCallback(
std::bind(&COptionsScreen::OnEnumChanged, this, std::placeholders::_1, std::placeholders::_2));
[this](CGuiTableGroup* caller, int oldSel) { OnEnumChanged(caller, oldSel); });
x194_tablegroup_triple->SetMenuSelectionChangeCallback(
std::bind(&COptionsScreen::OnEnumChanged, this, std::placeholders::_1, std::placeholders::_2));
[this](CGuiTableGroup* caller, int oldSel) { OnEnumChanged(caller, oldSel); });
}
void COptionsScreen::RightTableSelectionChanged(int oldSel, int newSel) { UpdateOptionView(); }
......
......@@ -79,10 +79,10 @@ void CPauseScreen::InitializeFrameGlue() {
deco->SetColor(color);
}
x34_loadedPauseScreenInstructions->SetMouseDownCallback(std::bind(&CPauseScreen::OnWidgetMouseDown, this,
std::placeholders::_1, std::placeholders::_2));
x34_loadedPauseScreenInstructions->SetMouseUpCallback(std::bind(&CPauseScreen::OnWidgetMouseUp, this,
std::placeholders::_1, std::placeholders::_2));
x34_loadedPauseScreenInstructions->SetMouseDownCallback(
[this](CGuiWidget* caller, bool resume) { OnWidgetMouseDown(caller, resume); });
x34_loadedPauseScreenInstructions->SetMouseUpCallback(
[this](CGuiWidget* caller, bool cancel) { OnWidgetMouseUp(caller, cancel); });
}
bool CPauseScreen::CheckLoadComplete(const CStateManager& mgr) {
......
......@@ -151,25 +151,21 @@ void CPauseScreenBase::InitializeFrameGlue() {
x190_tablegroup_double->SetWorkersMouseActive(false);
x194_tablegroup_triple->SetWorkersMouseActive(false);
x70_tablegroup_leftlog->SetMenuAdvanceCallback(
std::bind(&CPauseScreenBase::OnLeftTableAdvance, this, std::placeholders::_1));
x70_tablegroup_leftlog->SetMenuAdvanceCallback([this](CGuiTableGroup* caller) { OnLeftTableAdvance(caller); });
x70_tablegroup_leftlog->SetMenuSelectionChangeCallback(
std::bind(&CPauseScreenBase::OnTableSelectionChange, this, std::placeholders::_1, std::placeholders::_2));
x84_tablegroup_rightlog->SetMenuAdvanceCallback(
std::bind(&CPauseScreenBase::OnRightTableAdvance, this, std::placeholders::_1));
[this](CGuiTableGroup* caller, int oldSel) { OnTableSelectionChange(caller, oldSel); });
x84_tablegroup_rightlog->SetMenuAdvanceCallback([this](CGuiTableGroup* caller) { OnRightTableAdvance(caller); });
x84_tablegroup_rightlog->SetMenuSelectionChangeCallback(
std::bind(&CPauseScreenBase::OnTableSelectionChange, this, std::placeholders::_1, std::placeholders::_2));
x84_tablegroup_rightlog->SetMenuCancelCallback(
std::bind(&CPauseScreenBase::OnRightTableCancel, this, std::placeholders::_1));
[this](CGuiTableGroup* caller, int oldSel) { OnTableSelectionChange(caller, oldSel); });
x84_tablegroup_rightlog->SetMenuCancelCallback([this](CGuiTableGroup* caller) { OnRightTableCancel(caller); });
x18c_slidergroup_slider->SetSelectionChangedCallback({});
x190_tablegroup_double->SetMenuSelectionChangeCallback({});
x194_tablegroup_triple->SetMenuSelectionChangeCallback({});
x8_frame.SetMouseUpCallback(std::bind(&CPauseScreenBase::OnWidgetMouseUp, this,
std::placeholders::_1, std::placeholders::_2));
x8_frame.SetMouseScrollCallback(std::bind(&CPauseScreenBase::OnWidgetScroll, this,
std::placeholders::_1, std::placeholders::_2,
std::placeholders::_3, std::placeholders::_4));
x8_frame.SetMouseUpCallback([this](CGuiWidget* widget, bool cancel) { OnWidgetMouseUp(widget, cancel); });
x8_frame.SetMouseScrollCallback([this](CGuiWidget* widget, const boo::SScrollDelta& delta, int accumX, int accumY) {
OnWidgetScroll(widget, delta, accumX, accumY);
});
}
bool CPauseScreenBase::IsReady() {
......
......@@ -29,9 +29,9 @@ void CQuitGameScreen::FinishedLoading() {
x14_tablegroup_quitgame = static_cast<CGuiTableGroup*>(x10_loadedFrame->FindWidget("tablegroup_quitgame"));
x14_tablegroup_quitgame->SetVertical(false);
x14_tablegroup_quitgame->SetMenuAdvanceCallback(std::bind(&CQuitGameScreen::DoAdvance, this, std::placeholders::_1));
x14_tablegroup_quitgame->SetMenuAdvanceCallback([this](CGuiTableGroup* caller) { DoAdvance(caller); });
x14_tablegroup_quitgame->SetMenuSelectionChangeCallback(
std::bind(&CQuitGameScreen::DoSelectionChange, this, std::placeholders::_1, std::placeholders::_2));
[this](CGuiTableGroup* caller, int oldSel) { DoSelectionChange(caller, oldSel); });
static_cast<CGuiTextPane*>(x10_loadedFrame->FindWidget("textpane_title"))
->TextSupport()
......@@ -46,8 +46,7 @@ void CQuitGameScreen::FinishedLoading() {