metaforce/Runtime/World/CScriptPlayerActor.hpp

76 lines
3.1 KiB
C++
Raw Normal View History

2018-10-07 03:42:33 +00:00
#pragma once
#include "CScriptActor.hpp"
2018-05-13 23:27:47 +00:00
#include "CPlayerState.hpp"
namespace urde
{
class CScriptPlayerActor : public CScriptActor
{
2018-05-13 23:27:47 +00:00
CAnimRes x2e8_suitRes;
CPlayerState::EBeamId x304_beam;
CPlayerState::EPlayerSuit x308_suit = CPlayerState::EPlayerSuit::Invalid;
2018-05-14 04:38:58 +00:00
CPlayerState::EBeamId x30c_setBeamId = CPlayerState::EBeamId::Invalid;
2018-05-13 23:27:47 +00:00
s32 x310_loadedCharIdx = -1;
2018-05-14 04:38:58 +00:00
std::unique_ptr<CModelData> x314_beamModelData;
std::unique_ptr<CModelData> x318_suitModelData;
TLockedToken<CModel> x31c_beamModel; // Used to be single_ptr
TLockedToken<CModel> x320_suitModel; // Used to be single_ptr
TLockedToken<CSkinRules> x324_suitSkin; // Used to be single_ptr
TLockedToken<CSkinnedModel> x328_backupModelData; // Used to be optional
TLockedToken<CTexture> x338_phazonIndirectTexture; // Used to be optional
u32 x348_deallocateBackupCountdown = 0;
float x34c_phazonOffsetAngle = 0.f;
u32 x350_flags; /* 0x1: suit transition, 0x2: previous suit, 0x4: force reset
* 0x8: track in area data, 0x10: keep in state manager */
union
{
struct
{
2018-05-14 04:38:58 +00:00
bool x354_24_setBoundingBox : 1;
bool x354_25_deferOnlineModelData : 1;
bool x354_26_deferOfflineModelData : 1;
bool x354_27_beamModelLoading : 1;
bool x354_28_suitModelLoading : 1;
bool x354_29_loading : 1;
bool x354_30_enableLoading : 1;
bool x354_31_deferOnlineLoad : 1;
bool x355_24_areaTrackingLoad : 1;
};
2018-05-13 23:27:47 +00:00
u32 _dummy = 0;
};
2018-05-14 04:38:58 +00:00
TUniqueId x356_nextPlayerActor = kInvalidUniqueId;
2018-05-13 23:27:47 +00:00
u32 GetSuitCharIdx(const CStateManager& mgr, CPlayerState::EPlayerSuit suit) const;
2018-05-14 04:38:58 +00:00
u32 GetNextSuitCharIdx(const CStateManager& mgr) const;
2018-05-13 23:27:47 +00:00
void LoadSuit(u32 charIdx);
void LoadBeam(CPlayerState::EBeamId beam);
2018-05-14 04:38:58 +00:00
void PumpBeamModel(CStateManager& mgr);
void BuildBeamModelData();
void PumpSuitModel(CStateManager& mgr);
void SetupOfflineModelData();
void SetupOnlineModelData();
void SetupEnvFx(CStateManager& mgr, bool set);
void SetIntoStateManager(CStateManager& mgr, bool set);
void TouchModels_Internal(const CStateManager& mgr) const;
2018-05-13 23:27:47 +00:00
public:
2018-05-13 23:27:47 +00:00
CScriptPlayerActor(TUniqueId uid, std::string_view name, const CEntityInfo& info,
const zeus::CTransform& xf, const CAnimRes& animRes, CModelData&& mData,
2018-05-14 04:38:58 +00:00
const zeus::CAABox& aabox, bool setBoundingBox, const CMaterialList& list, float mass,
2018-05-13 23:27:47 +00:00
float zMomentum, const CHealthInfo& hInfo, const CDamageVulnerability& dVuln,
const CActorParameters& aParams, bool loop, bool active, u32 flags, CPlayerState::EBeamId beam);
void Think(float, CStateManager &);
void AcceptScriptMsg(EScriptObjectMessage, TUniqueId, CStateManager &);
void SetActive(bool active);
void PreRender(CStateManager &, const zeus::CFrustum &);
void AddToRenderer(const zeus::CFrustum &, const CStateManager &) const;
void Render(const CStateManager &mgr) const;
2018-05-14 04:38:58 +00:00
void TouchModels(const CStateManager& mgr) const;
};
}