2022-10-09 05:13:17 +00:00
|
|
|
#ifndef _CSTATEMANAGER
|
|
|
|
#define _CSTATEMANAGER
|
2022-08-09 23:03:51 +00:00
|
|
|
|
|
|
|
#include "types.h"
|
|
|
|
|
2022-10-02 10:13:35 +00:00
|
|
|
#include "Kyoto/CObjectReference.hpp"
|
2022-09-18 05:55:13 +00:00
|
|
|
#include "Kyoto/CRandom16.hpp"
|
2022-11-15 01:08:30 +00:00
|
|
|
#include "Kyoto/Input/CFinalInput.hpp"
|
2023-10-17 21:36:08 +00:00
|
|
|
#include "Kyoto/Math/CFrustumPlanes.hpp"
|
2022-10-02 22:27:13 +00:00
|
|
|
#include "Kyoto/Math/CVector2f.hpp"
|
2022-10-02 10:13:35 +00:00
|
|
|
#include "Kyoto/Math/CVector2i.hpp"
|
2022-10-02 22:27:13 +00:00
|
|
|
#include "Kyoto/TOneStatic.hpp"
|
2022-10-02 10:13:35 +00:00
|
|
|
#include "Kyoto/TToken.hpp"
|
2022-10-02 22:27:13 +00:00
|
|
|
|
2023-10-17 21:36:08 +00:00
|
|
|
|
2022-08-13 01:26:00 +00:00
|
|
|
#include "MetroidPrime/CEntityInfo.hpp"
|
2022-09-18 05:55:13 +00:00
|
|
|
#include "MetroidPrime/CObjectList.hpp"
|
2022-10-04 00:00:46 +00:00
|
|
|
#include "MetroidPrime/Cameras/CCameraBlurPass.hpp"
|
|
|
|
#include "MetroidPrime/Cameras/CCameraFilterPass.hpp"
|
2022-11-15 01:08:30 +00:00
|
|
|
#include "MetroidPrime/Enemies/EListenNoiseType.hpp"
|
|
|
|
#include "MetroidPrime/ScriptLoader.hpp"
|
2022-08-13 01:26:00 +00:00
|
|
|
#include "MetroidPrime/TGameTypes.hpp"
|
2022-10-06 19:38:21 +00:00
|
|
|
#include "MetroidPrime/Weapons/WeaponTypes.hpp"
|
2022-08-13 01:26:00 +00:00
|
|
|
|
|
|
|
#include "rstl/auto_ptr.hpp"
|
|
|
|
#include "rstl/list.hpp"
|
2022-10-03 04:49:11 +00:00
|
|
|
#include "rstl/map.hpp"
|
2022-11-15 13:45:15 +00:00
|
|
|
#include "rstl/multimap.hpp"
|
2022-09-15 04:08:47 +00:00
|
|
|
#include "rstl/pair.hpp"
|
2022-08-16 02:14:28 +00:00
|
|
|
#include "rstl/rc_ptr.hpp"
|
2022-08-13 01:26:00 +00:00
|
|
|
#include "rstl/reserved_vector.hpp"
|
2023-10-17 21:36:08 +00:00
|
|
|
#include "rstl/set.hpp"
|
2022-08-13 01:26:00 +00:00
|
|
|
#include "rstl/single_ptr.hpp"
|
2022-11-14 13:37:44 +00:00
|
|
|
#include "rstl/string.hpp"
|
2022-08-13 01:26:00 +00:00
|
|
|
|
2023-10-17 21:36:08 +00:00
|
|
|
|
2022-08-16 02:14:28 +00:00
|
|
|
class CAABox;
|
|
|
|
class CActor;
|
2022-08-13 02:48:34 +00:00
|
|
|
class CActorModelParticles;
|
|
|
|
class CCameraManager;
|
|
|
|
class CEnvFxManager;
|
|
|
|
class CFluidPlaneManager;
|
2022-08-16 02:14:28 +00:00
|
|
|
class CMapWorldInfo;
|
2022-08-13 01:26:00 +00:00
|
|
|
class CObjectList;
|
|
|
|
class CPlayer;
|
2022-08-16 02:14:28 +00:00
|
|
|
class CPlayerState;
|
2022-08-13 02:48:34 +00:00
|
|
|
class CRumbleManager;
|
2022-08-16 02:14:28 +00:00
|
|
|
class CScriptMailbox;
|
2022-08-13 01:26:00 +00:00
|
|
|
class CStateManagerContainer;
|
2022-08-16 02:14:28 +00:00
|
|
|
class CVector3f;
|
2022-08-13 02:48:34 +00:00
|
|
|
class CWeaponMgr;
|
|
|
|
class CWorld;
|
2022-08-16 02:14:28 +00:00
|
|
|
class CWorldTransManager;
|
2022-09-14 05:24:12 +00:00
|
|
|
class CEntity;
|
2023-10-17 21:36:08 +00:00
|
|
|
class CSinglePathMaze;
|
2022-09-29 05:30:20 +00:00
|
|
|
class CRayCastResult;
|
2022-09-29 05:31:19 +00:00
|
|
|
class CMaterialFilter;
|
2022-11-14 23:08:47 +00:00
|
|
|
class CWorldLayerState;
|
2022-10-02 10:13:35 +00:00
|
|
|
class CLight;
|
|
|
|
class CDamageInfo;
|
|
|
|
class CTexture;
|
2022-11-27 23:26:24 +00:00
|
|
|
class CViewport;
|
2022-08-13 02:48:34 +00:00
|
|
|
|
|
|
|
namespace SL {
|
|
|
|
class CSortedListManager;
|
|
|
|
} // namespace SL
|
2022-08-13 01:26:00 +00:00
|
|
|
|
2022-09-19 04:19:46 +00:00
|
|
|
#define kMaxEntities 1024
|
|
|
|
typedef rstl::reserved_vector< TUniqueId, kMaxEntities > TEntityList;
|
|
|
|
|
2022-10-02 10:13:35 +00:00
|
|
|
enum EStateManagerTransition {
|
|
|
|
kSMT_InGame,
|
|
|
|
kSMT_MapScreen,
|
|
|
|
kSMT_PauseGame,
|
|
|
|
kSMT_LogBook,
|
|
|
|
kSMT_SaveGame,
|
|
|
|
kSMT_MessageScreen
|
|
|
|
};
|
|
|
|
|
2022-10-02 22:27:13 +00:00
|
|
|
enum EThermalDrawFlag {
|
|
|
|
kTD_Hot,
|
|
|
|
kTD_Cold,
|
|
|
|
kTD_Bypass,
|
|
|
|
};
|
|
|
|
|
2022-11-15 13:45:15 +00:00
|
|
|
struct SScriptObjectStream {
|
|
|
|
// CEntity* x0_obj;
|
|
|
|
EScriptObjectType x0_type;
|
|
|
|
u32 x4_position;
|
|
|
|
u32 x8_length;
|
|
|
|
};
|
|
|
|
|
2022-10-02 10:13:35 +00:00
|
|
|
struct SOnScreenTex {
|
|
|
|
CAssetId x0_id;
|
|
|
|
CVector2i x4_origin;
|
|
|
|
CVector2i xc_extent;
|
2022-11-15 01:08:30 +00:00
|
|
|
|
|
|
|
SOnScreenTex() : x0_id(kInvalidAssetId), x4_origin(0, 0), xc_extent(0, 0) {}
|
2022-10-02 10:13:35 +00:00
|
|
|
};
|
|
|
|
|
2022-10-02 22:27:13 +00:00
|
|
|
class CStateManager : public TOneStatic< CStateManager > {
|
2022-08-11 02:33:46 +00:00
|
|
|
public:
|
2022-10-03 04:49:11 +00:00
|
|
|
typedef rstl::map< TEditorId, TUniqueId > TIdList;
|
|
|
|
typedef rstl::pair< TIdList::const_iterator, TIdList::const_iterator > TIdListResult;
|
|
|
|
|
2022-11-15 01:08:30 +00:00
|
|
|
enum EGameState { kGS_Running, kGS_SoftPaused, kGS_Paused };
|
|
|
|
|
2022-10-04 00:00:46 +00:00
|
|
|
enum ECameraFilterStage {
|
|
|
|
kCFS_Zero,
|
|
|
|
kCFS_One,
|
|
|
|
kCFS_Two,
|
|
|
|
kCFS_Three,
|
|
|
|
kCFS_Four,
|
|
|
|
kCFS_Five,
|
|
|
|
kCFS_Six,
|
|
|
|
kCFS_Seven,
|
|
|
|
kCFS_Eight,
|
|
|
|
kCFS_Max,
|
|
|
|
};
|
|
|
|
|
2022-11-15 01:08:30 +00:00
|
|
|
CStateManager(const rstl::ncrc_ptr< CScriptMailbox >&, const rstl::ncrc_ptr< CMapWorldInfo >&,
|
|
|
|
const rstl::ncrc_ptr< CPlayerState >&, const rstl::ncrc_ptr< CWorldTransManager >&,
|
|
|
|
const rstl::ncrc_ptr< CWorldLayerState >&);
|
2022-11-14 23:08:47 +00:00
|
|
|
~CStateManager();
|
|
|
|
|
2022-10-23 13:44:06 +00:00
|
|
|
bool RenderLast(const TUniqueId&);
|
2022-10-02 10:13:35 +00:00
|
|
|
void ResetEscapeSequenceTimer(float);
|
2022-09-18 06:05:46 +00:00
|
|
|
void SendScriptMsg(TUniqueId uid, TEditorId target, EScriptObjectMessage msg,
|
|
|
|
EScriptObjectState state);
|
2023-10-17 21:36:08 +00:00
|
|
|
void DeliverScriptMsg(CEntity* ent, TUniqueId target, EScriptObjectMessage msg);
|
2022-09-19 04:19:46 +00:00
|
|
|
void SendScriptMsgAlways(TUniqueId uid, TUniqueId src, EScriptObjectMessage msg);
|
2022-08-16 02:14:28 +00:00
|
|
|
bool AddDrawableActor(const CActor& actor, const CVector3f& pos, const CAABox& bounds) const;
|
2022-09-13 04:26:54 +00:00
|
|
|
void SetupParticleHook(const CActor& actor) const;
|
2023-10-17 21:36:08 +00:00
|
|
|
void DeleteObjectRequest(TUniqueId uid);
|
2022-09-15 04:08:47 +00:00
|
|
|
rstl::pair< TEditorId, TUniqueId > GenerateObject(const TEditorId& eid);
|
2022-10-08 04:53:28 +00:00
|
|
|
void AddObject(CEntity*);
|
|
|
|
TUniqueId AllocateUniqueId();
|
2022-11-14 13:37:44 +00:00
|
|
|
const rstl::string& HashInstanceName(CInputStream& in);
|
2022-11-17 10:12:03 +00:00
|
|
|
bool SwapOutAllPossibleMemory();
|
2023-10-19 22:51:57 +00:00
|
|
|
void UpdateObjectInLists(CEntity&);
|
2022-09-14 05:24:12 +00:00
|
|
|
|
2022-10-28 21:42:35 +00:00
|
|
|
void BuildNearList(TEntityList& nearList, const CVector3f& pos, const CVector3f& dir, float mag,
|
|
|
|
const CMaterialFilter&, const CActor*) const;
|
2022-10-04 00:00:46 +00:00
|
|
|
void BuildNearList(TEntityList& nearList, const CAABox&, const CMaterialFilter&,
|
|
|
|
const CActor*) const;
|
2022-09-29 05:30:20 +00:00
|
|
|
bool RayCollideWorld(const CVector3f& start, const CVector3f& end, const TEntityList& nearList,
|
|
|
|
const CMaterialFilter& filter, const CActor* damagee) const;
|
2022-11-17 04:56:21 +00:00
|
|
|
|
|
|
|
CRayCastResult RayStaticIntersection(const CVector3f& pos, const CVector3f& dir, float length,
|
|
|
|
const CMaterialFilter& filter) const;
|
2022-09-29 05:30:20 +00:00
|
|
|
CRayCastResult RayWorldIntersection(TUniqueId& idOut, const CVector3f& pos, const CVector3f& dir,
|
2022-10-09 05:37:23 +00:00
|
|
|
float length, const CMaterialFilter& filter,
|
2022-09-29 05:30:20 +00:00
|
|
|
const TEntityList& list) const;
|
2022-09-29 23:55:38 +00:00
|
|
|
void BuildColliderList(TEntityList& out, const CActor& actor, const CAABox& aabb) const;
|
2022-11-28 17:00:49 +00:00
|
|
|
void BuildDynamicLightListForWorld();
|
2022-09-29 05:30:20 +00:00
|
|
|
|
2022-09-14 05:24:12 +00:00
|
|
|
CEntity* ObjectById(TUniqueId uid);
|
2022-09-15 04:08:47 +00:00
|
|
|
const CEntity* GetObjectById(TUniqueId uid) const;
|
2022-10-20 16:32:57 +00:00
|
|
|
TEditorId GetEditorIdForUniqueId(TUniqueId) const;
|
2022-09-15 04:08:47 +00:00
|
|
|
TUniqueId GetIdForScript(TEditorId eid) const;
|
2022-10-03 04:49:11 +00:00
|
|
|
TIdListResult GetIdListForScript(TEditorId) const;
|
2022-08-13 01:26:00 +00:00
|
|
|
|
2022-10-17 19:19:07 +00:00
|
|
|
void SetActorAreaId(CActor& actor, TAreaId);
|
2022-10-06 11:37:57 +00:00
|
|
|
TAreaId GetNextAreaId() const { return x8cc_nextAreaId; }
|
|
|
|
void SetCurrentAreaId(TAreaId);
|
2022-11-27 23:26:24 +00:00
|
|
|
TAreaId GetVisAreaId() const;
|
2022-10-06 11:37:57 +00:00
|
|
|
|
2022-10-06 19:38:21 +00:00
|
|
|
bool CanCreateProjectile(TUniqueId, EWeaponType, int) const;
|
|
|
|
|
2023-10-17 21:36:08 +00:00
|
|
|
CSinglePathMaze* SinglePathMaze();
|
|
|
|
const CSinglePathMaze* GetSinglePathMaze() const;
|
|
|
|
void SetSinglePathMaze(rstl::single_ptr< CSinglePathMaze > maze);
|
2022-09-18 05:55:13 +00:00
|
|
|
|
2022-09-21 05:18:07 +00:00
|
|
|
CPlayer* Player() { return x84c_player; }
|
|
|
|
const CPlayer* GetPlayer() const { return x84c_player; }
|
2022-08-16 02:14:28 +00:00
|
|
|
CCameraManager* CameraManager() { return x870_cameraManager; }
|
|
|
|
const CCameraManager* GetCameraManager() const { return x870_cameraManager; }
|
|
|
|
CPlayerState* PlayerState() { return x8b8_playerState.GetPtr(); }
|
|
|
|
const CPlayerState* GetPlayerState() const { return x8b8_playerState.GetPtr(); }
|
|
|
|
CWorld* World() { return x850_world.get(); }
|
|
|
|
const CWorld* GetWorld() const { return x850_world.get(); }
|
2022-10-15 16:24:27 +00:00
|
|
|
CScriptMailbox* Mailbox() { return x8bc_mailbox.GetPtr(); }
|
|
|
|
const CScriptMailbox* GetMailbox() const { return x8bc_mailbox.GetPtr(); }
|
2022-09-13 04:26:54 +00:00
|
|
|
CActorModelParticles* ActorModelParticles() { return x884_actorModelParticles.get(); }
|
2022-09-18 06:05:46 +00:00
|
|
|
const CActorModelParticles* GetActorModelParticles() const {
|
|
|
|
return x884_actorModelParticles.get();
|
|
|
|
}
|
2022-10-02 10:13:35 +00:00
|
|
|
CEnvFxManager* EnvFxManager() { return x880_envFxManager; }
|
|
|
|
const CEnvFxManager* GetEnvFxManager() const { return x880_envFxManager; }
|
2022-10-05 00:16:03 +00:00
|
|
|
CRumbleManager* GetRumbleManager() { return x88c_rumbleManager; }
|
2022-11-02 02:57:25 +00:00
|
|
|
CFluidPlaneManager* FluidPlaneManager() { return x87c_fluidPlaneManager; }
|
|
|
|
const CFluidPlaneManager* GetFluidPlaneManager() const { return x87c_fluidPlaneManager; }
|
2022-11-08 23:04:51 +00:00
|
|
|
CWorldTransManager* WorldTransManager() { return x8c4_worldTransManager.GetPtr(); }
|
|
|
|
const CWorldTransManager* GetWorldTransManager() const { return x8c4_worldTransManager.GetPtr(); }
|
2024-09-30 06:02:23 +00:00
|
|
|
EGameState GetGameState() const { return x904_gameState; }
|
2022-10-02 10:13:35 +00:00
|
|
|
|
2022-10-22 15:56:07 +00:00
|
|
|
CRandom16* Random() const { return x900_random; }
|
2022-11-25 12:41:28 +00:00
|
|
|
uint GetUpdateFrameIndex() const { return x8d8_updateFrameIdx; }
|
2022-09-18 05:55:13 +00:00
|
|
|
|
2022-11-10 06:50:18 +00:00
|
|
|
CObjectList& ObjectListById(EGameObjectList id) { return *x808_objectLists[id]; }
|
|
|
|
const CObjectList& GetObjectListById(EGameObjectList id) const { return *x808_objectLists[id]; }
|
2022-11-15 01:08:30 +00:00
|
|
|
|
2022-11-14 23:08:47 +00:00
|
|
|
void RemoveObject(TUniqueId);
|
2022-09-13 04:26:54 +00:00
|
|
|
|
2022-11-03 11:35:43 +00:00
|
|
|
const CFinalInput& GetFinalInput() const { return xb54_finalInput; }
|
|
|
|
|
2022-10-04 00:00:46 +00:00
|
|
|
CCameraFilterPass& CameraFilterPass(ECameraFilterStage stage) {
|
|
|
|
return xb84_camFilterPasses[size_t(stage)];
|
|
|
|
}
|
|
|
|
const CCameraFilterPass& GetCameraFilterPass(ECameraFilterStage stage) const {
|
|
|
|
return xb84_camFilterPasses[size_t(stage)];
|
|
|
|
}
|
2022-10-28 21:42:35 +00:00
|
|
|
|
2022-10-17 17:52:49 +00:00
|
|
|
CCameraBlurPass& CameraBlurPass(ECameraFilterStage idx) { return xd14_camBlurPasses[idx]; }
|
2022-10-28 21:42:35 +00:00
|
|
|
|
|
|
|
const CCameraBlurPass& GetCameraBlurPass(ECameraFilterStage idx) const {
|
|
|
|
return xd14_camBlurPasses[idx];
|
|
|
|
}
|
2022-10-04 00:00:46 +00:00
|
|
|
|
2022-10-09 05:37:23 +00:00
|
|
|
float GetThermalColdScale1() const { return xf24_thermColdScale1; }
|
|
|
|
float GetThermalColdScale2() const { return xf28_thermColdScale2; }
|
2022-10-23 13:44:06 +00:00
|
|
|
void SetThermalColdScale2(float s) { xf28_thermColdScale2 = s; }
|
2022-11-03 17:09:58 +00:00
|
|
|
// TODO ?
|
|
|
|
void AddThermalColdScale2(float s) { xf28_thermColdScale2 += s; }
|
2022-08-13 02:48:34 +00:00
|
|
|
|
2023-02-06 16:42:48 +00:00
|
|
|
const bool IsGeneratingObject() const { return xf94_26_generatingObject; }
|
2022-09-15 04:08:47 +00:00
|
|
|
void SetIsGeneratingObject(bool gen) { xf94_26_generatingObject = gen; }
|
|
|
|
|
2022-10-02 10:13:35 +00:00
|
|
|
void ApplyDamageToWorld(TUniqueId, const CActor&, const CVector3f&, const CDamageInfo& info,
|
2022-10-28 21:42:35 +00:00
|
|
|
const CMaterialFilter&);
|
2022-10-02 10:13:35 +00:00
|
|
|
bool ApplyDamage(TUniqueId damagerId, TUniqueId damageeId, TUniqueId radiusSender,
|
|
|
|
const CDamageInfo& info, const CMaterialFilter& filter,
|
|
|
|
const CVector3f& knockbackVec);
|
|
|
|
|
2022-11-09 23:45:24 +00:00
|
|
|
void InformListeners(const CVector3f&, EListenNoiseType);
|
|
|
|
|
2022-11-27 00:26:12 +00:00
|
|
|
// Fog
|
|
|
|
void SetupFogForArea(TAreaId area) const;
|
|
|
|
|
2022-10-05 18:05:56 +00:00
|
|
|
//
|
2022-10-19 23:08:22 +00:00
|
|
|
void ShowPausedHUDMemo(CAssetId strg, float time);
|
2022-10-05 18:05:56 +00:00
|
|
|
void QueueMessage(int frameCount, CAssetId msg, float f1);
|
2022-10-09 05:13:17 +00:00
|
|
|
int GetHUDMessageFrameCount() const { return xf80_hudMessageFrameCount; }
|
2022-10-05 18:05:56 +00:00
|
|
|
|
2022-11-09 23:45:24 +00:00
|
|
|
// Weapon
|
|
|
|
void RemoveWeaponId(TUniqueId, EWeaponType);
|
|
|
|
void AddWeaponId(TUniqueId, EWeaponType);
|
|
|
|
|
2022-11-27 23:26:24 +00:00
|
|
|
// Draw
|
|
|
|
CFrustumPlanes SetupViewForDraw(const CViewport&) const;
|
|
|
|
void DrawWorld() const;
|
|
|
|
|
2022-10-05 00:16:03 +00:00
|
|
|
// State transitions
|
2022-10-02 10:13:35 +00:00
|
|
|
void DeferStateTransition(EStateManagerTransition t);
|
2022-10-05 00:16:03 +00:00
|
|
|
void EnterMapScreen() { DeferStateTransition(kSMT_MapScreen); }
|
|
|
|
void EnterPauseScreen() { DeferStateTransition(kSMT_PauseGame); }
|
|
|
|
void EnterLogBookScreen() { DeferStateTransition(kSMT_LogBook); }
|
|
|
|
void EnterSaveGameScreen() { DeferStateTransition(kSMT_SaveGame); }
|
|
|
|
void EnterMessageScreen(uint, float);
|
|
|
|
bool GetWantsToEnterMapScreen() const { return xf90_deferredTransition == kSMT_MapScreen; }
|
|
|
|
bool GetWantsToEnterPauseScreen() const { return xf90_deferredTransition == kSMT_PauseGame; }
|
|
|
|
bool GetWantsToEnterLogBookScreen() const { return xf90_deferredTransition == kSMT_LogBook; }
|
|
|
|
bool GetWantsToEnterSaveGameScreen() const { return xf90_deferredTransition == kSMT_SaveGame; }
|
|
|
|
bool GetWantsToEnterMessageScreen() const {
|
|
|
|
return xf90_deferredTransition == kSMT_MessageScreen;
|
|
|
|
}
|
2022-10-28 21:42:35 +00:00
|
|
|
|
2022-10-23 13:44:06 +00:00
|
|
|
EThermalDrawFlag GetThermalDrawFlag() const { return xf34_thermalFlag; }
|
2022-10-05 00:16:03 +00:00
|
|
|
|
2022-10-20 16:32:57 +00:00
|
|
|
void SetLastTriggerId(TUniqueId uid) { xf74_lastTrigger = uid; }
|
|
|
|
TUniqueId GetLastTriggerId() const { return xf74_lastTrigger; }
|
|
|
|
|
2022-10-16 13:59:20 +00:00
|
|
|
void SetLastRelayId(const TUniqueId& uid) { xf76_lastRelay = uid; }
|
|
|
|
TUniqueId* GetLastRelayIdPtr() { return &xf76_lastRelay; }
|
|
|
|
TUniqueId GetLastRelayId() const { return xf76_lastRelay; }
|
|
|
|
|
2022-10-09 05:37:23 +00:00
|
|
|
void SetEnergyBarActorInfo(TUniqueId bossId, float maxEnergy, uint stringIdx);
|
2022-10-09 05:13:17 +00:00
|
|
|
void SetPendingOnScreenTex(CAssetId texId, const CVector2i& origin, const CVector2i& extent); /* {
|
|
|
|
xef4_pendingScreenTex.x0_id = texId;
|
|
|
|
xef4_pendingScreenTex.x4_origin = origin;
|
|
|
|
xef4_pendingScreenTex.xc_extent = extent;
|
|
|
|
}*/
|
2022-10-02 10:13:35 +00:00
|
|
|
const SOnScreenTex& GetPendingScreenTex() const { return xef4_pendingScreenTex; }
|
2022-11-08 14:23:03 +00:00
|
|
|
float IntegrateVisorFog(float f) const;
|
2022-10-02 10:13:35 +00:00
|
|
|
|
2022-10-05 00:16:03 +00:00
|
|
|
void QuitGame() { xf94_25_quitGame = true; }
|
|
|
|
bool GetWantsToQuit() const { return xf94_25_quitGame; }
|
|
|
|
void SetCinematicSkipObject(TUniqueId id) { xf38_skipCineSpecialFunc = id; }
|
2022-11-16 20:02:20 +00:00
|
|
|
void SetCinematicPause(bool pause) { xf94_29_cinematicPause = pause; }
|
2022-10-02 10:13:35 +00:00
|
|
|
void SetInSaveUI(bool b) { xf94_28_inSaveUI = b; }
|
|
|
|
bool GetInSaveUI() const { return xf94_28_inSaveUI; }
|
2022-11-03 11:35:43 +00:00
|
|
|
void SetInMapScreen(bool b) { xf94_27_inMapScreen = b; }
|
|
|
|
bool GetInMapScreen() const { return xf94_27_inMapScreen; }
|
2022-10-02 10:13:35 +00:00
|
|
|
void SetIsFullThreat(bool v) { xf94_30_fullThreat = v; }
|
2022-10-09 05:37:23 +00:00
|
|
|
uint GetInputFrameIdx() const { return x8d4_inputFrameIdx; }
|
2022-10-02 10:13:35 +00:00
|
|
|
|
2022-08-13 01:26:00 +00:00
|
|
|
private:
|
2022-11-15 01:08:30 +00:00
|
|
|
enum EInitPhase { kIP_LoadWorld, kIP_LoadFirstArea, kIP_Done };
|
|
|
|
|
2022-10-09 05:37:23 +00:00
|
|
|
ushort x0_nextFreeIndex;
|
2022-11-15 13:45:15 +00:00
|
|
|
rstl::reserved_vector< ushort, 1024 > x4_objectIndexArray;
|
2022-08-13 01:26:00 +00:00
|
|
|
rstl::reserved_vector< rstl::auto_ptr< CObjectList >, 8 > x808_objectLists;
|
|
|
|
CPlayer* x84c_player;
|
|
|
|
rstl::single_ptr< CWorld > x850_world;
|
|
|
|
rstl::list< rstl::reserved_vector< TUniqueId, 32 > > x854_graveyard;
|
|
|
|
rstl::single_ptr< CStateManagerContainer > x86c_stateManagerContainer;
|
2022-08-13 02:48:34 +00:00
|
|
|
CCameraManager* x870_cameraManager;
|
|
|
|
SL::CSortedListManager* x874_sortedListManager;
|
|
|
|
CWeaponMgr* x878_weaponMgr;
|
|
|
|
CFluidPlaneManager* x87c_fluidPlaneManager;
|
|
|
|
CEnvFxManager* x880_envFxManager;
|
2022-10-04 00:00:46 +00:00
|
|
|
rstl::single_ptr< CActorModelParticles > x884_actorModelParticles;
|
|
|
|
uint x888_;
|
2022-08-13 02:48:34 +00:00
|
|
|
CRumbleManager* x88c_rumbleManager;
|
2022-11-15 13:45:15 +00:00
|
|
|
rstl::multimap< TEditorId, TUniqueId > x890_scriptIdMap;
|
|
|
|
rstl::map< TEditorId, SScriptObjectStream > x8a4_loadedScriptObjects;
|
2022-08-16 02:14:28 +00:00
|
|
|
rstl::rc_ptr< CPlayerState > x8b8_playerState;
|
|
|
|
rstl::rc_ptr< CScriptMailbox > x8bc_mailbox;
|
|
|
|
rstl::rc_ptr< CMapWorldInfo > x8c0_mapWorldInfo;
|
|
|
|
rstl::rc_ptr< CWorldTransManager > x8c4_worldTransManager;
|
2022-11-14 23:08:47 +00:00
|
|
|
rstl::rc_ptr< CWorldLayerState > x8c8_worldLayerState;
|
2022-10-02 10:13:35 +00:00
|
|
|
|
|
|
|
TAreaId x8cc_nextAreaId;
|
|
|
|
TAreaId x8d0_prevAreaId;
|
2022-10-09 05:37:23 +00:00
|
|
|
uint x8d4_inputFrameIdx;
|
|
|
|
uint x8d8_updateFrameIdx;
|
|
|
|
uint x8dc_objectDrawToken;
|
2022-10-02 10:13:35 +00:00
|
|
|
|
|
|
|
rstl::vector< CLight > x8e0_dynamicLights;
|
|
|
|
|
2022-11-15 01:08:30 +00:00
|
|
|
TCachedToken< CTexture > x8f0_shadowTex;
|
2022-10-02 22:27:13 +00:00
|
|
|
CRandom16 x8fc_random;
|
2022-09-18 05:55:13 +00:00
|
|
|
CRandom16* x900_random;
|
2022-10-02 10:13:35 +00:00
|
|
|
|
2022-11-15 01:08:30 +00:00
|
|
|
EGameState x904_gameState;
|
|
|
|
rstl::reserved_vector< FScriptLoader, int(kST_MAX) > x90c_loaderFuncs;
|
|
|
|
EInitPhase xb3c_initPhase;
|
2023-10-17 21:36:08 +00:00
|
|
|
rstl::set< rstl::string > xb40_uniqueInstanceNames;
|
2022-10-02 10:13:35 +00:00
|
|
|
|
2022-11-03 11:35:43 +00:00
|
|
|
CFinalInput xb54_finalInput;
|
2022-10-04 00:00:46 +00:00
|
|
|
rstl::reserved_vector< CCameraFilterPass, kCFS_Max > xb84_camFilterPasses;
|
|
|
|
rstl::reserved_vector< CCameraBlurPass, kCFS_Max > xd14_camBlurPasses;
|
|
|
|
int xeec_hintIdx;
|
|
|
|
uint xef0_hintPeriods;
|
2022-10-02 10:13:35 +00:00
|
|
|
SOnScreenTex xef4_pendingScreenTex;
|
2022-10-02 22:27:13 +00:00
|
|
|
CAssetId xf08_pauseHudMessage;
|
2022-10-09 05:37:23 +00:00
|
|
|
float xf0c_escapeTimer;
|
|
|
|
float xf10_escapeTotalTime;
|
|
|
|
float xf14_curTimeMod900;
|
2022-10-02 22:27:13 +00:00
|
|
|
TUniqueId xf18_bossId;
|
2022-10-09 05:37:23 +00:00
|
|
|
float xf1c_totalBossEnergy;
|
2022-10-02 22:27:13 +00:00
|
|
|
uint xf20_bossStringIdx;
|
2022-10-09 05:37:23 +00:00
|
|
|
float xf24_thermColdScale1;
|
|
|
|
float xf28_thermColdScale2;
|
2022-11-15 13:45:15 +00:00
|
|
|
float xf2c_viewportScaleX;
|
|
|
|
float xf30_viewportScaleY;
|
2022-10-02 22:27:13 +00:00
|
|
|
EThermalDrawFlag xf34_thermalFlag;
|
|
|
|
TUniqueId xf38_skipCineSpecialFunc;
|
|
|
|
rstl::list< TUniqueId > xf3c_activeFlickerBats;
|
|
|
|
rstl::list< TUniqueId > xf54_activeParasites;
|
|
|
|
TUniqueId xf6c_playerActorHead;
|
2023-10-17 21:36:08 +00:00
|
|
|
rstl::single_ptr< CSinglePathMaze > xf70_currentMaze;
|
2022-10-02 22:27:13 +00:00
|
|
|
TUniqueId xf74_lastTrigger;
|
|
|
|
TUniqueId xf76_lastRelay;
|
2022-10-09 05:37:23 +00:00
|
|
|
float xf78_hudMessageTime;
|
2022-10-02 22:27:13 +00:00
|
|
|
unkptr xf7c_projectedShadow;
|
|
|
|
uint xf80_hudMessageFrameCount;
|
|
|
|
CAssetId xf84_;
|
|
|
|
CAssetId xf88_;
|
2022-10-09 05:37:23 +00:00
|
|
|
float xf8c_;
|
2022-10-02 10:13:35 +00:00
|
|
|
EStateManagerTransition xf90_deferredTransition;
|
2022-09-15 04:08:47 +00:00
|
|
|
bool xf94_24_readyToRender : 1;
|
|
|
|
bool xf94_25_quitGame : 1;
|
|
|
|
bool xf94_26_generatingObject : 1;
|
|
|
|
bool xf94_27_inMapScreen : 1;
|
|
|
|
bool xf94_28_inSaveUI : 1;
|
|
|
|
bool xf94_29_cinematicPause : 1;
|
|
|
|
bool xf94_30_fullThreat : 1;
|
2022-11-14 23:08:47 +00:00
|
|
|
|
|
|
|
void ClearGraveyard();
|
2022-11-15 13:45:15 +00:00
|
|
|
static void RendererDrawCallback(const void*, const void*, int);
|
2022-11-15 01:08:30 +00:00
|
|
|
static const bool MemoryAllocatorAllocationFailedCallback(const void*, unsigned int);
|
2022-08-11 02:33:46 +00:00
|
|
|
};
|
2022-10-02 22:27:13 +00:00
|
|
|
CHECK_SIZEOF(CStateManager, 0xf98)
|
2022-08-09 23:03:51 +00:00
|
|
|
|
2022-10-09 05:13:17 +00:00
|
|
|
#endif // _CSTATEMANAGER
|