CStateManager::InitializeResources() dependencies all in

This commit is contained in:
Jack Andersen 2016-08-14 15:19:04 -10:00
parent 24bfc47d1a
commit fb1ce432aa
25 changed files with 916 additions and 14 deletions

View File

@ -503,6 +503,9 @@ void CStateManager::FrameBegin()
void CStateManager::InitializeState(ResId mlvlId, TAreaId aid, ResId mreaId)
{
bool hadRandom = x900_activeRandom != nullptr;
x900_activeRandom = &x8fc_random;
if (xb3c_initPhase == InitPhase::LoadWorld)
{
CreateStandardGameObjects();
@ -577,7 +580,15 @@ void CStateManager::InitializeState(ResId mlvlId, TAreaId aid, ResId mreaId)
entId = x80c_allObjs->GetNextObjectIndex(entId);
}
/* TODO: Finish */
x84c_player->AsyncLoadSuit(*this);
x870_cameraManager->ResetCameras(*this);
if (!hadRandom)
x900_activeRandom = nullptr;
else
x900_activeRandom = &x8fc_random;
x880_envFxManager->AsyncLoadResources(*this);
}
void CStateManager::CreateStandardGameObjects()

View File

@ -111,6 +111,7 @@ class CStateManager
TLockedToken<CTexture> x8f0_shadowTex; /* DefaultShadow in MiscData */
CRandom16 x8fc_random;
CRandom16* x900_activeRandom = nullptr;
FScriptLoader x904_loaderFuncs[int(EScriptObjectType::ScriptObjectTypeMAX)] = {};
@ -284,6 +285,17 @@ public:
std::shared_ptr<CMapWorldInfo> MapWorldInfo() { return x8c0_mapWorldInfo; }
bool IsLayerActive(TAreaId area, int layerIdx) { return false; }
CPlayer& GetPlayer() const { return *x84c_player; }
CObjectList& GetAllObjectList() const { return *x80c_allObjs; }
CActorList& GetActorObjectList() const { return *x814_actorObjs; }
CPhysicsActorList& GetPhysicsActorObjectList() const { return *x81c_physActorObjs; }
CGameCameraList& GetCameraObjectList() const { return *x824_cameraObjs; }
CGameLightList& GetLightObjectList() const { return *x82c_lightObjs; }
CListeningAiList& GetListeningAiObjectList() const { return *x834_listenAiObjs; }
CAiWaypointList& GetAiWaypointObjectList() const { return *x83c_aiWaypointObjs; }
CPlatformAndDoorList& GetPlatformAndDoorObjectList() const { return *x844_platformAndDoorObjs; }
};
}

View File

@ -0,0 +1,22 @@
#include "CBallCamera.hpp"
namespace urde
{
CBallCamera::CBallCamera(TUniqueId uid, TUniqueId id2, const zeus::CTransform& xf,
float a, float b, float c, float d)
: CGameCamera(uid, true, "Ball Camera",
CEntityInfo(kInvalidAreaId, CEntity::NullConnectionList),
xf, a, b, c, d, id2, 0, 0)
{
}
void CBallCamera::ProcessInput(const CFinalInput&, CStateManager& mgr)
{
}
void CBallCamera::Reset(const zeus::CTransform&, CStateManager& mgr)
{
}
}

View File

@ -10,6 +10,9 @@ class CBallCamera : public CGameCamera
{
public:
CBallCamera(TUniqueId, TUniqueId, const zeus::CTransform& xf, float, float, float, float);
void ProcessInput(const CFinalInput&, CStateManager& mgr);
void Reset(const zeus::CTransform&, CStateManager& mgr);
};
}

View File

@ -5,6 +5,7 @@
#include "CStateManager.hpp"
#include "Input/CRumbleManager.hpp"
#include "World/CScriptWater.hpp"
#include "World/CPlayer.hpp"
namespace urde
{
@ -136,4 +137,19 @@ const CGameCamera* CCameraManager::GetCurrentCamera(const CStateManager& stateMg
return static_cast<const CGameCamera*>(camList->GetObjectById(GetCurrentCameraId()));
}
void CCameraManager::ResetCameras(CStateManager& mgr)
{
CGameCameraList& camList = mgr.GetCameraObjectList();
zeus::CTransform xf = mgr.GetPlayer().CreateTransformFromMovementDirection();
xf.origin = mgr.GetPlayer().GetEyePosition();
TUniqueId camId = camList.GetFirstObjectIndex();
while (camId != kInvalidUniqueId)
{
CGameCamera* camObj = static_cast<CGameCamera*>(camList.GetObjectById(camId));
camObj->Reset(xf, mgr);
camId = camList.GetNextObjectIndex(camId);
}
}
}

View File

@ -47,6 +47,7 @@ public:
static float DefaultFirstPersonFOV() {return 55.0f;}
static float DefaultThirdPersonFOV() {return 60.0f;}
void ResetCameras(CStateManager& mgr);
void SetSpecialCameras(CFirstPersonCamera& fp, CBallCamera& ball)
{
x7c_fpCamera = &fp;

View File

@ -9,4 +9,12 @@ CCinematicCamera::CCinematicCamera(TUniqueId uid, const std::string& name, const
{
}
void CCinematicCamera::ProcessInput(const CFinalInput&, CStateManager& mgr)
{
}
void CCinematicCamera::Reset(const zeus::CTransform&, CStateManager& mgr)
{
}
}

View File

@ -11,6 +11,9 @@ class CCinematicCamera : public CGameCamera
public:
CCinematicCamera(TUniqueId, const std::string& name, const CEntityInfo& info,
const zeus::CTransform& xf, bool, float, float, float, float, float, u32);
void ProcessInput(const CFinalInput&, CStateManager& mgr);
void Reset(const zeus::CTransform&, CStateManager& mgr);
};
}

View File

@ -0,0 +1,22 @@
#include "CFirstPersonCamera.hpp"
namespace urde
{
CFirstPersonCamera::CFirstPersonCamera(TUniqueId uid, const zeus::CTransform& xf, TUniqueId id2,
float, float a, float b, float c, float d)
: CGameCamera(uid, true, "First Person Camera",
CEntityInfo(kInvalidAreaId, CEntity::NullConnectionList),
xf, a, b, c, d, id2, 0, 0)
{
}
void CFirstPersonCamera::ProcessInput(const CFinalInput&, CStateManager& mgr)
{
}
void CFirstPersonCamera::Reset(const zeus::CTransform&, CStateManager& mgr)
{
}
}

View File

@ -10,6 +10,9 @@ class CFirstPersonCamera : public CGameCamera
{
public:
CFirstPersonCamera(TUniqueId, const zeus::CTransform& xf, TUniqueId, float, float, float, float, float);
void ProcessInput(const CFinalInput&, CStateManager& mgr);
void Reset(const zeus::CTransform&, CStateManager& mgr);
};
}

View File

@ -6,13 +6,18 @@
namespace urde
{
class CFinalInput;
class CGameCamera : public CActor
{
public:
CGameCamera(TUniqueId, bool active, const std::string& name, const CEntityInfo& info,
const zeus::CTransform& xf, float, float, float, float, TUniqueId, bool, u32);
const zeus::CTransform& xf, float fov, float nearz, float farz, float aspect,
TUniqueId, bool, u32);
const zeus::CTransform& GetTransform() const {return x34_transform;}
virtual void ProcessInput(const CFinalInput&, CStateManager& mgr)=0;
virtual void Reset(const zeus::CTransform&, CStateManager& mgr)=0;
};
}

View File

@ -0,0 +1,27 @@
#include "CPathCamera.hpp"
#include "CCameraManager.hpp"
namespace urde
{
CPathCamera::CPathCamera(TUniqueId uid, const std::string& name, const CEntityInfo& info,
const zeus::CTransform& xf, bool active, bool, bool, bool, bool,
float, float, float, float, float, float, float, u32,
EInitialSplinePosition)
: CGameCamera(uid, active, name, info, xf,
CCameraManager::DefaultThirdPersonFOV(),
CCameraManager::DefaultNearPlane(),
CCameraManager::DefaultFarPlane(),
CCameraManager::DefaultAspect(), kInvalidUniqueId, 0, 0)
{
}
void CPathCamera::ProcessInput(const CFinalInput&, CStateManager& mgr)
{
}
void CPathCamera::Reset(const zeus::CTransform&, CStateManager& mgr)
{
}
}

View File

@ -16,6 +16,9 @@ public:
const zeus::CTransform& xf, bool, bool, bool, bool, bool,
float, float, float, float, float, float, float, u32,
EInitialSplinePosition);
void ProcessInput(const CFinalInput&, CStateManager& mgr);
void Reset(const zeus::CTransform&, CStateManager& mgr);
};
}

View File

@ -89,6 +89,8 @@ public:
Thermal
};
void SetSortThermal(bool v) { x14_25_sortThermal = v; }
~CModelData();
CModelData(const CStaticRes& res);
CModelData(const CAnimRes& res);

View File

@ -15,5 +15,7 @@ class CBooRenderer* g_Renderer = nullptr;
DataSpec::ITweakGame* g_tweakGame = nullptr;
DataSpec::ITweakPlayer* g_tweakPlayer = nullptr;
DataSpec::ITweakPlayerControl* g_tweakPlayerControl = nullptr;
DataSpec::ITweakPlayerGun* g_tweakPlayerGun = nullptr;
DataSpec::ITweakGunRes* g_tweakGunRes = nullptr;
}

View File

@ -0,0 +1,10 @@
#include "CEnvFxManager.hpp"
namespace urde
{
void CEnvFxManager::AsyncLoadResources(CStateManager& mgr)
{
}
}

View File

@ -3,6 +3,7 @@
namespace urde
{
class CStateManager;
enum class EEnvFxType
{
@ -20,6 +21,8 @@ enum class EPhazonType
class CEnvFxManager
{
public:
void AsyncLoadResources(CStateManager& mgr);
};
}

View File

@ -0,0 +1,14 @@
#include "CGrappleArm.hpp"
namespace urde
{
CGrappleArm::CGrappleArm(const zeus::CVector3f& vec)
{
}
void CGrappleArm::AsyncLoadSuit(CStateManager& mgr)
{
}
}

View File

@ -14,6 +14,7 @@ class CGrappleArm
public:
CGrappleArm(const zeus::CVector3f& vec);
void AsyncLoadSuit(CStateManager& mgr);
};
}

View File

@ -7,4 +7,8 @@ CGunWeapon::CGunWeapon(u32, EWeaponType type, TUniqueId, EMaterialTypes, const z
{
}
void CGunWeapon::AsyncLoadSuitArm(CStateManager& mgr)
{
}
}

View File

@ -8,11 +8,13 @@
namespace urde
{
class CStateManager;
class CGunWeapon
{
public:
CGunWeapon(u32, EWeaponType type, TUniqueId, EMaterialTypes, const zeus::CVector3f& vec);
void AsyncLoadSuitArm(CStateManager& mgr);
};
}

View File

@ -19,8 +19,481 @@ CPlayer::CPlayer(TUniqueId uid, const zeus::CTransform& xf, const zeus::CAABox&
x768_morphball.reset(new CMorphBall(*this, f4));
}
bool CPlayer::IsTransparent() const
{
}
void CPlayer::Update(float, CStateManager& mgr)
{
}
bool CPlayer::IsPlayerDeadEnough() const
{
}
void CPlayer::AsyncLoadSuit(CStateManager& mgr)
{
x490_gun->AsyncLoadSuit(mgr);
}
void CPlayer::LoadAnimationTokens()
{
}
bool CPlayer::CanRenderUnsorted(CStateManager& mgr) const
{
}
const CDamageVulnerability& CPlayer::GetDamageVulnerability(const zeus::CVector3f& v1,
const zeus::CVector3f& v2,
const CDamageInfo& info) const
{
}
const CDamageVulnerability& CPlayer::GetDamageVulnerability() const
{
}
zeus::CVector3f CPlayer::GetHomingPosition(CStateManager& mgr, float) const
{
}
zeus::CVector3f CPlayer::GetAimPosition(CStateManager& mgr, float) const
{
}
void CPlayer::FluidFXThink(CActor::EFluidState, CScriptWater& water, CStateManager& mgr)
{
}
zeus::CVector3f CPlayer::GetDamageLocationWR() const
{
}
float CPlayer::GetPrevDamageAmount() const
{
}
float CPlayer::GetDamageAmount() const
{
}
bool CPlayer::WasDamaged() const
{
}
void CPlayer::TakeDamage(bool, const zeus::CVector3f&, float, EWeaponType, CStateManager& mgr)
{
}
void CPlayer::Accept(IVisitor& visitor)
{
}
CHealthInfo& CPlayer::HealthInfo(CStateManager& mgr)
{
}
bool CPlayer::IsUnderBetaMetroidAttack(CStateManager& mgr) const
{
}
rstl::optional_object<zeus::CAABox> CPlayer::GetTouchBounds() const
{
}
void CPlayer::Touch(CActor&, CStateManager& mgr)
{
}
void CPlayer::UpdateScanningState(const CFinalInput& input, CStateManager& mgr, float)
{
}
void CPlayer::ValidateScanning(const CFinalInput& input, CStateManager& mgr)
{
}
void CPlayer::SetScanningState(EPlayerScanState, CStateManager& mgr)
{
}
bool CPlayer::GetExplorationMode() const
{
}
bool CPlayer::GetCombatMode() const
{
}
void CPlayer::RenderGun(CStateManager& mgr, const zeus::CVector3f&) const
{
}
void CPlayer::Render(CStateManager& mgr) const
{
}
void CPlayer::RenderReflectedPlayer(CStateManager& mgr) const
{
}
void CPlayer::PreRender(CStateManager& mgr, const zeus::CFrustum&)
{
}
void CPlayer::CalculateRenderBounds()
{
}
void CPlayer::AddToRenderer(const zeus::CFrustum&, CStateManager&)
{
}
void CPlayer::ComputeFreeLook(const CFinalInput& input)
{
}
void CPlayer::UpdateFreeLook(float dt)
{
}
float CPlayer::GetMaximumPlayerPositiveVerticalVelocity(CStateManager&) const
{
}
void CPlayer::ProcessInput(const CFinalInput&, CStateManager&)
{
}
bool CPlayer::GetFrozenState() const
{
}
void CPlayer::Think(float, CStateManager&)
{
}
void CPlayer::PreThink(float, CStateManager&)
{
}
void CPlayer::AcceptScriptMsg(EScriptObjectMessage, TUniqueId, CStateManager&)
{
}
void CPlayer::SetVisorSteam(float, float, float, u32, bool)
{
}
void CPlayer::UpdateFootstepBounds(const CFinalInput& input, CStateManager&, float)
{
}
u16 CPlayer::GetMaterialSoundUnderPlayer(CStateManager& mgr, const u16*, int, u16)
{
}
u16 CPlayer::SfxIdFromMaterial(const CMaterialList&, const u16*, u16)
{
}
void CPlayer::UpdateCrosshairsState(const CFinalInput&)
{
}
void CPlayer::UpdateVisorTransition(float, CStateManager& mgr)
{
}
void CPlayer::UpdateVisorState(const CFinalInput&, float, CStateManager& mgr)
{
}
void CPlayer::ForceGunOrientation(const zeus::CTransform&, CStateManager& mgr)
{
}
void CPlayer::UpdateDebugCamera(CStateManager& mgr)
{
}
CFirstPersonCamera& CPlayer::GetFirstPersonCamera(CStateManager& mgr)
{
}
void CPlayer::UpdateGunTransform(const zeus::CVector3f&, float, CStateManager& mgr, bool)
{
}
void CPlayer::DrawGun(CStateManager& mgr)
{
}
void CPlayer::HolsterGun(CStateManager& mgr)
{
}
bool CPlayer::GetMorphballTransitionState() const
{
}
void CPlayer::UpdateGrappleArmTransform(const zeus::CVector3f&, CStateManager& mgr, float)
{
}
void CPlayer::ApplyGrappleForces(const CFinalInput& input, CStateManager& mgr, float)
{
}
bool CPlayer::ValidateFPPosition(const zeus::CVector3f& pos, CStateManager& mgr)
{
}
void CPlayer::UpdateGrappleState(const CFinalInput& input, CStateManager& mgr)
{
}
void CPlayer::ApplyGrappleJump(CStateManager& mgr)
{
}
void CPlayer::BeginGrapple(zeus::CVector3f&, CStateManager& mgr)
{
}
void CPlayer::BreakGrapple(CStateManager& mgr)
{
}
void CPlayer::PreventFallingCameraPitch()
{
}
void CPlayer::OrbitCarcass(CStateManager&)
{
}
void CPlayer::OrbitPoint(EPlayerOrbitType, CStateManager& mgr)
{
}
zeus::CVector3f CPlayer::GetHUDOrbitTargetPosition() const
{
}
void CPlayer::SetOrbitState(EPlayerOrbitState, CStateManager& mgr)
{
}
void CPlayer::SetOrbitTargetId(TUniqueId)
{
}
void CPlayer::UpdateOrbitPosition(float, CStateManager& mgr)
{
}
void CPlayer::UpdateOrbitZPosition()
{
}
void CPlayer::UpdateOrbitFixedPosition()
{
}
void CPlayer::SetOrbitPosition(float, CStateManager& mgr)
{
}
void CPlayer::UpdateAimTarget(CStateManager& mgr)
{
}
void CPlayer::UpdateAimTargetTimer(float)
{
}
bool CPlayer::ValidateAimTargetId(TUniqueId, CStateManager& mgr)
{
}
bool CPlayer::ValidateObjectForMode(TUniqueId, CStateManager& mgr) const
{
}
TUniqueId CPlayer::FindAimTargetId(CStateManager& mgr)
{
}
TUniqueId CPlayer::CheckEnemiesAgainstOrbitZone(const std::vector<TUniqueId>&, EPlayerZoneInfo,
EPlayerZoneType, CStateManager& mgr) const
{
}
TUniqueId CPlayer::FindOrbitTargetId(CStateManager& mgr)
{
}
void CPlayer::UpdateOrbitableObjects(CStateManager& mgr)
{
}
TUniqueId CPlayer::FindBestOrbitableObject(const std::vector<TUniqueId>&, EPlayerZoneInfo, CStateManager& mgr) const
{
}
void CPlayer::FindOrbitableObjects(const std::vector<TUniqueId>&, std::vector<TUniqueId>&, EPlayerZoneInfo,
EPlayerZoneType, CStateManager& mgr, bool) const
{
}
bool CPlayer::WithinOrbitScreenBox(const zeus::CVector3f&, EPlayerZoneInfo, EPlayerZoneType) const
{
}
bool CPlayer::WithinOrbitScreenEllipse(const zeus::CVector3f&, EPlayerZoneInfo) const
{
}
void CPlayer::CheckOrbitDisableSourceList(CStateManager& mgr)
{
}
void CPlayer::CheckOrbitDisableSourceList() const
{
}
void CPlayer::RemoveOrbitDisableSource(TUniqueId)
{
}
void CPlayer::AddOrbitDisableSource(CStateManager& mgr, TUniqueId)
{
}
void CPlayer::UpdateOrbitPreventionTimer(float)
{
}
void CPlayer::UpdateOrbitModeTimer(float)
{
}
void CPlayer::UpdateOrbitZone(CStateManager& mgr)
{
}
void CPlayer::UpdateOrbitInput(const CFinalInput& input, CStateManager& mgr)
{
}
void CPlayer::UpdateOrbitSelection(const CFinalInput& input, CStateManager& mgr)
{
}
void CPlayer::UpdateOrbitOrientation(CStateManager& mgr)
{
}
void CPlayer::UpdateOrbitTarget(CStateManager& mgr)
{
}
float CPlayer::GetOrbitMaxLockDistance(CStateManager& mgr) const
{
}
float CPlayer::GetOrbitMaxTargetDistance(CStateManager& mgr) const
{
}
bool CPlayer::ValidateOrbitTargetId(TUniqueId, CStateManager& mgr) const
{
}
bool CPlayer::ValidateCurrentOrbitTargetId(CStateManager& mgr)
{
}
bool CPlayer::ValidateOrbitTargetIdAndPointer(TUniqueId, CStateManager& mgr) const
{
}
zeus::CVector3f CPlayer::GetBallPosition() const
{
}
zeus::CVector3f CPlayer::GetEyePosition() const
{
}
float CPlayer::GetEyeHeight() const
{
}
float CPlayer::GetStepUpHeight() const
{
}
float CPlayer::GetStepDownHeight() const
{
}
void CPlayer::Teleport(const zeus::CTransform& xf, CStateManager& mgr, bool)
{
}
zeus::CTransform CPlayer::CreateTransformFromMovementDirection() const
{
}
const CCollisionPrimitive& CPlayer::GetCollisionPrimitive() const
{
}
zeus::CTransform CPlayer::GetPrimitiveTransform() const
{
}
bool CPlayer::CollidedWith(TUniqueId, const CCollisionInfoList&, CStateManager& mgr)
{
}
float CPlayer::GetActualFirstPersonMaxVelocity() const
{
}
void CPlayer::SetMoveState(EPlayerMovementState, CStateManager& mgr)
{
}
float CPlayer::JumpInput(const CFinalInput& input, CStateManager& mgr)
{
}
float CPlayer::TurnInput(const CFinalInput& input) const
{
}
float CPlayer::StrafeInput(const CFinalInput& input) const
{
}
float CPlayer::ForwardInput(const CFinalInput& input, float) const
{
}
void CPlayer::ComputeMovement(const CFinalInput& input, CStateManager& mgr, float)
{
}
float CPlayer::GetWeight() const
{
}
float CPlayer::GetDampedClampedVelocityWR() const
{
}
}

View File

@ -4,16 +4,73 @@
#include "CPhysicsActor.hpp"
#include "zeus/CAABox.hpp"
#include "zeus/CTransform.hpp"
#include "CWeaponMgr.hpp"
namespace urde
{
class CMaterialList;
class CMorphBall;
class CPlayerGun;
class CDamageInfo;
class CScriptWater;
class IVisitor;
class CFinalInput;
class CFirstPersonCamera;
class CPlayer : public CPhysicsActor
{
friend class CStateManager;
public:
enum class EPlayerScanState
{
};
enum class EPlayerOrbitType
{
};
enum class EPlayerOrbitState
{
};
enum class EPlayerZoneInfo
{
};
enum class EPlayerZoneType
{
};
enum class EPlayerMovementState
{
};
private:
struct CVisorSteam
{
float x0_;
float x4_;
float x8_;
u32 xc_;
float x10_ = 0.f;
float x14_ = 0.f;
float x18_ = 0.f;
u32 x1c_ = 0;
float x20_ = 0.f;
float x24_ = 0.f;
bool x28_ = false;
void SetSteam(float a, float b, float c, u32 d, bool e)
{
if (x1c_ == -1 || a > x10_)
{
x10_ = a;
x14_ = b;
x18_ = c;
x1c_ = d;
}
x28_ = e;
}
void Update(float dt);
CVisorSteam(float a, float b, float c, u32 d, bool e)
: x0_(a), x4_(b), x8_(c), xc_(d), x1c_(e) {}
};
std::unique_ptr<CPlayerGun> x490_gun;
std::unique_ptr<CMorphBall> x768_morphball;
@ -22,7 +79,128 @@ public:
CPlayer(TUniqueId, const zeus::CTransform&, const zeus::CAABox&, unsigned int,
const zeus::CVector3f&, float, float, float, float, const CMaterialList&);
bool IsTransparent() const;
void Update(float, CStateManager& mgr);
bool IsPlayerDeadEnough() const;
void AsyncLoadSuit(CStateManager& mgr);
void LoadAnimationTokens();
bool CanRenderUnsorted(CStateManager& mgr) const;
const CDamageVulnerability& GetDamageVulnerability(const zeus::CVector3f& v1,
const zeus::CVector3f& v2,
const CDamageInfo& info) const;
const CDamageVulnerability& GetDamageVulnerability() const;
zeus::CVector3f GetHomingPosition(CStateManager& mgr, float) const;
zeus::CVector3f GetAimPosition(CStateManager& mgr, float) const;
void FluidFXThink(CActor::EFluidState, CScriptWater& water, CStateManager& mgr);
zeus::CVector3f GetDamageLocationWR() const;
float GetPrevDamageAmount() const;
float GetDamageAmount() const;
bool WasDamaged() const;
void TakeDamage(bool, const zeus::CVector3f&, float, EWeaponType, CStateManager& mgr);
void Accept(IVisitor& visitor);
CHealthInfo& HealthInfo(CStateManager& mgr);
bool IsUnderBetaMetroidAttack(CStateManager& mgr) const;
rstl::optional_object<zeus::CAABox> GetTouchBounds() const;
void Touch(CActor&, CStateManager& mgr);
void UpdateScanningState(const CFinalInput& input, CStateManager& mgr, float);
void ValidateScanning(const CFinalInput& input, CStateManager& mgr);
void SetScanningState(EPlayerScanState, CStateManager& mgr);
bool GetExplorationMode() const;
bool GetCombatMode() const;
void RenderGun(CStateManager& mgr, const zeus::CVector3f&) const;
void Render(CStateManager& mgr) const;
void RenderReflectedPlayer(CStateManager& mgr) const;
void PreRender(CStateManager& mgr, const zeus::CFrustum&);
void CalculateRenderBounds();
void AddToRenderer(const zeus::CFrustum&, CStateManager&);
void ComputeFreeLook(const CFinalInput& input);
void UpdateFreeLook(float dt);
float GetMaximumPlayerPositiveVerticalVelocity(CStateManager&) const;
void ProcessInput(const CFinalInput&, CStateManager&);
bool GetFrozenState() const;
void Think(float, CStateManager&);
void PreThink(float, CStateManager&);
void AcceptScriptMsg(EScriptObjectMessage, TUniqueId, CStateManager&);
void SetVisorSteam(float, float, float, u32, bool);
void UpdateFootstepBounds(const CFinalInput& input, CStateManager&, float);
u16 GetMaterialSoundUnderPlayer(CStateManager& mgr, const u16*, int, u16);
u16 SfxIdFromMaterial(const CMaterialList&, const u16*, u16);
void UpdateCrosshairsState(const CFinalInput&);
void UpdateVisorTransition(float, CStateManager& mgr);
void UpdateVisorState(const CFinalInput&, float, CStateManager& mgr);
void ForceGunOrientation(const zeus::CTransform&, CStateManager& mgr);
void UpdateDebugCamera(CStateManager& mgr);
CFirstPersonCamera& GetFirstPersonCamera(CStateManager& mgr);
void UpdateGunTransform(const zeus::CVector3f&, float, CStateManager& mgr, bool);
void DrawGun(CStateManager& mgr);
void HolsterGun(CStateManager& mgr);
bool GetMorphballTransitionState() const;
void UpdateGrappleArmTransform(const zeus::CVector3f&, CStateManager& mgr, float);
void ApplyGrappleForces(const CFinalInput& input, CStateManager& mgr, float);
bool ValidateFPPosition(const zeus::CVector3f& pos, CStateManager& mgr);
void UpdateGrappleState(const CFinalInput& input, CStateManager& mgr);
void ApplyGrappleJump(CStateManager& mgr);
void BeginGrapple(zeus::CVector3f&, CStateManager& mgr);
void BreakGrapple(CStateManager& mgr);
void PreventFallingCameraPitch();
void OrbitCarcass(CStateManager&);
void OrbitPoint(EPlayerOrbitType, CStateManager& mgr);
zeus::CVector3f GetHUDOrbitTargetPosition() const;
void SetOrbitState(EPlayerOrbitState, CStateManager& mgr);
void SetOrbitTargetId(TUniqueId);
void UpdateOrbitPosition(float, CStateManager& mgr);
void UpdateOrbitZPosition();
void UpdateOrbitFixedPosition();
void SetOrbitPosition(float, CStateManager& mgr);
void UpdateAimTarget(CStateManager& mgr);
void UpdateAimTargetTimer(float);
bool ValidateAimTargetId(TUniqueId, CStateManager& mgr);
bool ValidateObjectForMode(TUniqueId, CStateManager& mgr) const;
TUniqueId FindAimTargetId(CStateManager& mgr);
TUniqueId CheckEnemiesAgainstOrbitZone(const std::vector<TUniqueId>&, EPlayerZoneInfo,
EPlayerZoneType, CStateManager& mgr) const;
TUniqueId FindOrbitTargetId(CStateManager& mgr);
void UpdateOrbitableObjects(CStateManager& mgr);
TUniqueId FindBestOrbitableObject(const std::vector<TUniqueId>&, EPlayerZoneInfo, CStateManager& mgr) const;
void FindOrbitableObjects(const std::vector<TUniqueId>&, std::vector<TUniqueId>&, EPlayerZoneInfo,
EPlayerZoneType, CStateManager& mgr, bool) const;
bool WithinOrbitScreenBox(const zeus::CVector3f&, EPlayerZoneInfo, EPlayerZoneType) const;
bool WithinOrbitScreenEllipse(const zeus::CVector3f&, EPlayerZoneInfo) const;
void CheckOrbitDisableSourceList(CStateManager& mgr);
void CheckOrbitDisableSourceList() const;
void RemoveOrbitDisableSource(TUniqueId);
void AddOrbitDisableSource(CStateManager& mgr, TUniqueId);
void UpdateOrbitPreventionTimer(float);
void UpdateOrbitModeTimer(float);
void UpdateOrbitZone(CStateManager& mgr);
void UpdateOrbitInput(const CFinalInput& input, CStateManager& mgr);
void UpdateOrbitSelection(const CFinalInput& input, CStateManager& mgr);
void UpdateOrbitOrientation(CStateManager& mgr);
void UpdateOrbitTarget(CStateManager& mgr);
float GetOrbitMaxLockDistance(CStateManager& mgr) const;
float GetOrbitMaxTargetDistance(CStateManager& mgr) const;
bool ValidateOrbitTargetId(TUniqueId, CStateManager& mgr) const;
bool ValidateCurrentOrbitTargetId(CStateManager& mgr);
bool ValidateOrbitTargetIdAndPointer(TUniqueId, CStateManager& mgr) const;
zeus::CVector3f GetBallPosition() const;
zeus::CVector3f GetEyePosition() const;
float GetEyeHeight() const;
float GetStepUpHeight() const;
float GetStepDownHeight() const;
void Teleport(const zeus::CTransform& xf, CStateManager& mgr, bool);
zeus::CTransform CreateTransformFromMovementDirection() const;
const CCollisionPrimitive& GetCollisionPrimitive() const;
zeus::CTransform GetPrimitiveTransform() const;
bool CollidedWith(TUniqueId, const CCollisionInfoList&, CStateManager& mgr);
float GetActualFirstPersonMaxVelocity() const;
void SetMoveState(EPlayerMovementState, CStateManager& mgr);
float JumpInput(const CFinalInput& input, CStateManager& mgr);
float TurnInput(const CFinalInput& input) const;
float StrafeInput(const CFinalInput& input) const;
float ForwardInput(const CFinalInput& input, float) const;
void ComputeMovement(const CFinalInput& input, CStateManager& mgr, float);
float GetWeight() const;
float GetDampedClampedVelocityWR() const;
};
}

View File

@ -15,7 +15,18 @@ CPlayerGun::CPlayerGun(TUniqueId id)
x668_ = g_tweakPlayerGun->GetSomething1();
x66c_ = g_tweakPlayerGun->GetSomething2();
x832_31_ = true;
x833_24_ = true;
x833_30_ = true;
x6e0_.SetSortThermal(true);
/* TODO: Finish */
}
void CPlayerGun::AsyncLoadSuit(CStateManager& mgr)
{
x72c_currentBeam->AsyncLoadSuitArm(mgr);
x740_grappleArm->AsyncLoadSuit(mgr);
}
}

View File

@ -26,7 +26,28 @@ class CPlayerGun
{
struct CGunMorph
{
CGunMorph(float, float);
float x0_ = 0.f;
float x4_;
float x8_ = 0.f;
float xc_ = 0.1f;
float x10_;
float x14_ = 2.f;
float x18_ = 1.f;
u32 x1c_ = 2;
u32 x20_ = 1;
union
{
struct
{
bool x24_24_ : 1;
bool x24_25_ : 1;
};
u8 _dummy = 0;
};
CGunMorph(float a, float b)
: x4_(a), x10_(std::fabs(b)) {}
};
CActorLights x0_lights;
@ -116,24 +137,69 @@ class CPlayerGun
u32 x6c4_ = 0;
zeus::CAABox x6c8_;
CModelData x6e0_;
u32 x72c_ = 0;
CGunWeapon* x72c_currentBeam = nullptr;
u32 x730_ = 0;
u32 x734_ = 0;
u32 x738_ = 0;
std::unique_ptr<CGunMotion> x73c_;
std::unique_ptr<CGrappleArm> x740_;
std::unique_ptr<CAuxWeapon> x744_;
std::unique_ptr<CPowerBeam> x74c_;
std::unique_ptr<CIceBeam> x750_;
std::unique_ptr<CWaveBeam> x754_;
std::unique_ptr<CPlasmaBeam> x758_;
std::unique_ptr<CPhazonBeam> x75c_;
u32 x760_[4] = {};
std::unique_ptr<CGunMotion> x73c_gunMotion;
std::unique_ptr<CGrappleArm> x740_grappleArm;
std::unique_ptr<CAuxWeapon> x744_auxWeapon;
std::unique_ptr<CPowerBeam> x74c_powerBeam;
std::unique_ptr<CIceBeam> x750_iceBeam;
std::unique_ptr<CWaveBeam> x754_waveBeam;
std::unique_ptr<CPlasmaBeam> x758_plasmaBeam;
std::unique_ptr<CPhazonBeam> x75c_phazonBeam;
CGunWeapon* x760_selectableBeams[4] = {};
std::unique_ptr<CElementGen> x774_;
std::unique_ptr<CWorldShadow> x82c_;
std::unique_ptr<CWorldShadow> x82c_shadow;
union
{
struct
{
bool x832_24_ : 1;
bool x832_25_ : 1;
bool x832_26_ : 1;
bool x832_27_ : 1;
bool x832_28_ : 1;
bool x832_29_ : 1;
bool x832_30_ : 1;
bool x832_31_ : 1;
bool x833_24_ : 1;
bool x833_25_ : 1;
bool x833_26_ : 1;
bool x833_27_ : 1;
bool x833_28_ : 1;
bool x833_29_ : 1;
bool x833_30_ : 1;
bool x833_31_ : 1;
bool x834_24_ : 1;
bool x834_25_ : 1;
bool x834_26_ : 1;
bool x834_27_ : 1;
bool x834_28_ : 1;
bool x834_29_ : 1;
bool x834_30_ : 1;
bool x834_31_ : 1;
bool x835_24_ : 1;
bool x835_25_ : 1;
bool x835_26_ : 1;
bool x835_27_ : 1;
bool x835_28_ : 1;
bool x835_29_ : 1;
bool x835_30_ : 1;
bool x835_31_ : 1;
};
u32 _dummy = 0;
};
public:
CPlayerGun(TUniqueId id);
void AsyncLoadSuit(CStateManager& mgr);
};
}