metaforce/Runtime/CStateManager.hpp

468 lines
19 KiB
C++
Raw Normal View History

2016-04-13 06:07:23 +00:00
#ifndef __URDE_CSTATEMANAGER_HPP__
#define __URDE_CSTATEMANAGER_HPP__
2015-08-17 05:26:58 +00:00
#include <memory>
#include <set>
2015-08-17 05:26:58 +00:00
#include "CBasics.hpp"
2016-04-18 01:58:13 +00:00
#include "World/ScriptObjectSupport.hpp"
#include "GameObjectLists.hpp"
#include "Camera/CCameraManager.hpp"
2016-04-17 02:50:45 +00:00
#include "Camera/CCameraFilter.hpp"
#include "CRandom16.hpp"
2016-04-17 05:35:32 +00:00
#include "zeus/CAABox.hpp"
2016-11-22 20:43:16 +00:00
#include "Weapon/CWeaponMgr.hpp"
2016-04-17 05:35:32 +00:00
#include "World/CAi.hpp"
#include "CToken.hpp"
#include "World/ScriptLoader.hpp"
#include "Input/CFinalInput.hpp"
#include "CSortedLists.hpp"
#include "World/CFluidPlaneManager.hpp"
#include "World/CEnvFxManager.hpp"
#include "World/CActorModelParticles.hpp"
#include "Input/CRumbleManager.hpp"
2017-02-12 03:17:18 +00:00
#include "Camera/CCameraShakeData.hpp"
2017-06-01 05:34:24 +00:00
#include "Graphics/Shaders/CColoredQuadFilter.hpp"
2015-08-17 05:26:58 +00:00
2016-03-04 23:04:53 +00:00
namespace urde
{
2016-07-24 23:14:58 +00:00
class CRelayTracker;
2015-08-22 01:58:41 +00:00
class CMapWorldInfo;
class CPlayerState;
class CWorldTransManager;
class CObjectList;
2016-04-17 02:50:45 +00:00
class CSortedListManager;
class CFluidPlaneManager;
class CEnvFxManager;
class CActorModelParticles;
class CTeamAiTypes;
class CRumbleManager;
2016-04-17 05:35:32 +00:00
class CActor;
class CLight;
class CDamageInfo;
class CMaterialFilter;
class CFinalInput;
class CPlayer;
class CWorld;
class CTexture;
2016-10-09 07:45:04 +00:00
class CWorldLayerState;
2017-03-06 06:33:51 +00:00
class CProjectedShadow;
2017-02-12 03:17:18 +00:00
namespace MP1
{
class CMFGameLoader;
}
struct SScriptObjectStream
{
2017-02-14 04:27:20 +00:00
//CEntity* x0_obj;
EScriptObjectType x0_type;
u32 x4_position;
u32 x8_length;
};
2017-02-12 03:17:18 +00:00
struct SOnScreenTex
{
ResId x0_id = -1;
zeus::CVector2i x4_origin;
zeus::CVector2i xc_extent;
};
2017-02-18 02:19:50 +00:00
enum class EStateManagerTransition
{
InGame,
MapScreen,
PauseGame,
LogBook,
SaveGame,
MessageScreen
};
2015-08-18 05:54:43 +00:00
class CStateManager
2015-08-17 05:26:58 +00:00
{
2017-02-12 03:17:18 +00:00
friend class MP1::CMFGameLoader;
2017-04-03 01:39:23 +00:00
public:
enum class EGameState
{
Running,
SoftPaused,
Paused
};
2017-02-12 03:17:18 +00:00
2017-04-03 01:39:23 +00:00
private:
2017-01-15 03:59:37 +00:00
s16 x0_nextFreeIndex = 0;
TUniqueId x8_idArr[1024] = {};
2017-03-24 05:30:16 +00:00
/*
std::unique_ptr<CObjectList> x80c_allObjs;
2016-04-17 02:50:45 +00:00
std::unique_ptr<CActorList> x814_actorObjs;
std::unique_ptr<CPhysicsActorList> x81c_physActorObjs;
std::unique_ptr<CGameCameraList> x824_cameraObjs;
std::unique_ptr<CGameLightList> x82c_lightObjs;
std::unique_ptr<CListeningAiList> x834_listenAiObjs;
std::unique_ptr<CAiWaypointList> x83c_aiWaypointObjs;
std::unique_ptr<CPlatformAndDoorList> x844_platformAndDoorObjs;
2017-03-24 05:30:16 +00:00
*/
std::unique_ptr<CObjectList> x808_objLists[8] =
{std::make_unique<CObjectList>(EGameObjectList::All),
std::make_unique<CActorList>(),
std::make_unique<CPhysicsActorList>(),
std::make_unique<CGameCameraList>(),
std::make_unique<CGameLightList>(),
std::make_unique<CListeningAiList>(),
std::make_unique<CAiWaypointList>(),
std::make_unique<CPlatformAndDoorList>()};
2016-04-17 05:35:32 +00:00
std::unique_ptr<CPlayer> x84c_player;
std::unique_ptr<CWorld> x850_world;
2016-04-17 05:35:32 +00:00
/* Used to be a list of 32-element reserved_vectors */
2017-03-24 05:30:16 +00:00
std::vector<TUniqueId> x854_objectGraveyard;
struct CStateManagerContainer
{
CCameraManager x0_cameraManager;
CSortedListManager x3c0_sortedListManager;
CWeaponMgr xe3d8_weaponManager;
CFluidPlaneManager xe3ec_fluidPlaneManager;
CEnvFxManager xe510_envFxManager;
CActorModelParticles xf168_actorModelParticles;
CRumbleManager xf250_rumbleManager;
u32 xf344_ = 0;
rstl::reserved_vector<TUniqueId, 20> xf370_;
2017-03-20 05:09:53 +00:00
rstl::reserved_vector<TUniqueId, 20> xf39c_renderLast;
};
2016-08-14 03:05:50 +00:00
std::unique_ptr<CStateManagerContainer> x86c_stateManagerContainer;
CCameraManager* x870_cameraManager = nullptr;
CSortedListManager* x874_sortedListManager = nullptr;
CWeaponMgr* x878_weaponManager = nullptr;
CFluidPlaneManager* x87c_fluidPlaneManager = nullptr;
CEnvFxManager* x880_envFxManager = nullptr;
CActorModelParticles* x884_actorModelParticles = nullptr;
CRumbleManager* x88c_rumbleManager = nullptr;
std::multimap<TEditorId, TUniqueId> x890_scriptIdMap;
std::map<TEditorId, SScriptObjectStream> x8a4_loadedScriptObjects;
std::shared_ptr<CPlayerState> x8b8_playerState;
std::shared_ptr<CRelayTracker> x8bc_relayTracker;
std::shared_ptr<CMapWorldInfo> x8c0_mapWorldInfo;
std::shared_ptr<CWorldTransManager> x8c4_worldTransManager;
2016-10-09 07:45:04 +00:00
std::shared_ptr<CWorldLayerState> x8c8_worldLayerState;
2016-10-09 07:45:04 +00:00
TAreaId x8cc_nextAreaId = 0;
TAreaId x8d0_prevAreaId = kInvalidAreaId;
//u32 x8d0_extFrameIdx = 0;
2017-03-24 05:30:16 +00:00
u32 x8d4_inputFrameIdx = 0;
u32 x8d8_updateFrameIdx = 0;
u32 x8dc_objectDrawToken = 0;
std::vector<CLight> x8e0_dynamicLights;
TLockedToken<CTexture> x8f0_shadowTex; /* DefaultShadow in MiscData */
CRandom16 x8fc_random;
CRandom16* x900_activeRandom = nullptr;
2017-04-03 01:39:23 +00:00
EGameState x904_gameState = EGameState::Running;
2017-02-12 03:17:18 +00:00
u32 x908_ = 0;
2016-09-16 22:21:19 +00:00
FScriptLoader x90c_loaderFuncs[int(EScriptObjectType::ScriptObjectTypeMAX)] = {};
bool xab0_worldLoaded = false;
enum class EInitPhase
{
LoadWorld,
LoadFirstArea,
Done
} xb3c_initPhase = EInitPhase::LoadWorld;
2017-03-26 05:53:04 +00:00
std::set<std::string> xb40_uniqueInstanceNames;
CFinalInput xb54_finalInput;
2017-06-01 05:34:24 +00:00
CCameraFilterPassPoly xb84_camFilterPasses[9];
CCameraBlurPass xd14_camBlurPasses[9];
2016-04-17 02:50:45 +00:00
s32 xe60_ = -1;
zeus::CVector3f xe64_;
TUniqueId xe70_ = kInvalidUniqueId;
zeus::CVector3f xe74_ = {0.f, 1.f, 1.f};
s32 xe80_ = 2;
TUniqueId xe84_ = kInvalidUniqueId;
union
{
struct
{
2017-01-24 17:23:10 +00:00
bool xe86_24_ : 1;
bool xe86_25_ : 1;
bool xe86_26_ : 1;
bool xe86_27_ : 1;
bool xe86_28_ : 1;
bool xe86_29_ : 1;
};
u16 _dummy = 0;
};
2017-02-12 03:17:18 +00:00
2017-03-24 05:30:16 +00:00
u32 xeec_hintIdx = -1;
u32 xef0_hintPeriods = 0;
2017-02-12 03:17:18 +00:00
SOnScreenTex xef4_pendingScreenTex;
2017-02-18 02:19:50 +00:00
ResId xf08_pauseHudMessage = -1;
2017-03-26 05:53:04 +00:00
float xf0c_escapeTimer = 0.f;
float xf10_escapeTotalTime = 0.f;
2017-03-24 05:30:16 +00:00
float xf14_curTimeMod900 = 0.f;
2017-04-04 05:48:13 +00:00
TUniqueId xf18_bossId = kInvalidUniqueId;
float xf1c_totalBossEnergy = 0.f;
u32 xf20_bossStringIdx = 0;
float xf24_thermColdScale1 = 0.f;
float xf28_thermColdScale2 = 0.f;
zeus::CVector2f xf2c_viewportScale = {1.f, 1.f};
u32 xf34_particleFlags = 2;
2017-02-18 02:19:50 +00:00
TUniqueId xf38_skipCineSpecialFunc = kInvalidUniqueId;
2017-02-12 03:17:18 +00:00
std::list<u32> xf3c_;
u32 xf50_ = 0;
std::list<u32> xf54_;
u32 xf68_ = 0;
TUniqueId xf6c_playerActor = kInvalidUniqueId;
u32 xf70_ = 0;
2017-01-15 03:59:37 +00:00
TUniqueId xf74_lastTrigger = kInvalidUniqueId;
2017-01-18 22:30:02 +00:00
TUniqueId xf76_lastRelay = kInvalidUniqueId;
2017-02-12 03:17:18 +00:00
2017-02-18 02:19:50 +00:00
float xf78_hudMessageTime = 0.f;
2017-03-06 06:33:51 +00:00
CProjectedShadow* xf7c_projectedShadow = nullptr;
2017-02-18 02:19:50 +00:00
u32 xf80_hudMessageFrameCount = 0;
2017-02-12 03:17:18 +00:00
ResId xf84_ = -1;
ResId xf88_ = -1;
float xf8c_ = 0.f;
2017-02-18 02:19:50 +00:00
EStateManagerTransition xf90_deferredTransition = EStateManagerTransition::InGame;
2017-02-12 03:17:18 +00:00
2017-01-24 17:23:10 +00:00
union
{
struct
{
2017-02-12 03:17:18 +00:00
bool xf94_24_ : 1;
2017-02-18 02:19:50 +00:00
bool xf94_25_quitGame : 1;
2017-01-24 17:23:10 +00:00
bool xf94_26_generatingObject : 1;
2017-02-18 02:19:50 +00:00
bool xf94_27_inMapScreen : 1;
bool xf94_28_inSaveUI : 1;
2017-02-12 03:17:18 +00:00
bool xf94_29_ : 1;
2017-04-09 06:14:22 +00:00
bool xf94_30_fullThreat : 1;
2017-01-24 17:23:10 +00:00
};
u32 xf94_ = 0;
};
2017-06-01 05:34:24 +00:00
CColoredQuadFilter m_deathWhiteout = { EFilterType::Add };
CColoredQuadFilter m_escapeWhiteout = { EFilterType::Add };
2017-02-12 03:17:18 +00:00
void UpdateThermalVisor();
static void RendererDrawCallback(const void*, const void*, int);
2017-02-12 03:17:18 +00:00
2015-08-17 05:26:58 +00:00
public:
2016-07-24 23:14:58 +00:00
CStateManager(const std::weak_ptr<CRelayTracker>&,
2015-08-17 05:26:58 +00:00
const std::weak_ptr<CMapWorldInfo>&,
const std::weak_ptr<CPlayerState>&,
2016-10-09 07:45:04 +00:00
const std::weak_ptr<CWorldTransManager>&,
const std::weak_ptr<CWorldLayerState>&);
2015-08-19 05:48:57 +00:00
u32 GetInputFrameIdx() const { return x8d4_inputFrameIdx; }
bool RenderLast(TUniqueId);
2016-11-20 21:53:15 +00:00
void AddDrawableActorPlane(const CActor& actor, const zeus::CPlane&, const zeus::CAABox& aabb) const;
2016-04-17 05:35:32 +00:00
void AddDrawableActor(const CActor& actor, const zeus::CVector3f& vec, const zeus::CAABox& aabb) const;
2017-02-18 02:19:50 +00:00
bool SpecialSkipCinematic();
TAreaId GetVisAreaId() const;
2017-03-26 05:53:04 +00:00
s32 GetWeaponIdCount(TUniqueId, EWeaponType);
2016-04-17 05:35:32 +00:00
void RemoveWeaponId(TUniqueId, EWeaponType);
void AddWeaponId(TUniqueId, EWeaponType);
void UpdateEscapeSequenceTimer(float);
2017-04-03 01:39:23 +00:00
float GetEscapeSequenceTimer() const { return xf0c_escapeTimer; }
2016-04-17 05:35:32 +00:00
void ResetEscapeSequenceTimer(float);
void SetupParticleHook(const CActor& actor) const;
void MurderScriptInstanceNames();
2017-01-15 03:59:37 +00:00
std::string HashInstanceName(CInputStream& in);
2016-04-17 05:35:32 +00:00
void SetActorAreaId(CActor& actor, TAreaId);
void TouchSky() const;
void TouchPlayerActor();
2016-04-17 05:35:32 +00:00
void DrawSpaceWarp(const zeus::CVector3f&, float) const;
void DrawReflection(const zeus::CVector3f&);
2017-03-26 05:53:04 +00:00
static void ReflectionDrawer(void*, const zeus::CVector3f&);
2016-04-17 05:35:32 +00:00
void CacheReflection();
bool CanCreateProjectile(TUniqueId, EWeaponType, int) const;
2017-04-13 19:28:31 +00:00
const std::vector<CLight>& GetDynamicLightList() const { return x8e0_dynamicLights; }
void BuildDynamicLightListForWorld();
2016-04-17 05:35:32 +00:00
void DrawDebugStuff() const;
void RenderCamerasAndAreaLights() const;
void DrawE3DeathEffect() const;
void DrawAdditionalFilters() const;
zeus::CFrustum SetupViewForDraw(const SViewport& vp) const;
2017-03-06 06:33:51 +00:00
void ResetViewAfterDraw(const SViewport& backupViewport, const zeus::CTransform& backupViewMatrix) const;
2016-04-17 05:35:32 +00:00
void DrawWorld() const;
void SetupFogForArea(const CGameArea& area) const;
bool SetupFogForDraw() const;
2016-04-17 05:35:32 +00:00
void PreRender();
2017-02-19 09:27:01 +00:00
bool GetVisSetForArea(TAreaId, TAreaId, CPVSVisSet& setOut) const;
2016-04-17 05:35:32 +00:00
void RecursiveDrawTree(TUniqueId) const;
void SendScriptMsg(CEntity* dest, TUniqueId src, EScriptObjectMessage msg);
2016-07-24 04:46:32 +00:00
void SendScriptMsg(TUniqueId dest, TUniqueId src, EScriptObjectMessage msg);
void SendScriptMsg(TUniqueId src, TEditorId dest,
EScriptObjectMessage msg, EScriptObjectState state);
void SendScriptMsgAlways(TUniqueId dest, TUniqueId src, EScriptObjectMessage);
2016-04-17 05:35:32 +00:00
void FreeScriptObjects(TAreaId);
2017-02-14 04:27:20 +00:00
void FreeScriptObject(TUniqueId);
std::pair<const SScriptObjectStream*, TEditorId> GetBuildForScript(TEditorId) const;
2016-04-22 20:22:45 +00:00
TEditorId GetEditorIdForUniqueId(TUniqueId) const;
2016-04-17 05:35:32 +00:00
TUniqueId GetIdForScript(TEditorId) const;
std::pair<std::multimap<TEditorId, TUniqueId>::const_iterator,
std::multimap<TEditorId, TUniqueId>::const_iterator>
GetIdListForScript(TEditorId) const;
2016-07-24 04:46:32 +00:00
void LoadScriptObjects(TAreaId, CInputStream& in, std::vector<TEditorId>& idsOut);
2017-02-19 09:27:01 +00:00
void InitializeScriptObjects(const std::vector<TEditorId>& objIds);
2017-02-14 04:27:20 +00:00
std::pair<TEditorId, TUniqueId> LoadScriptObject(TAreaId, EScriptObjectType, u32, CInputStream& in);
2017-01-24 17:23:10 +00:00
std::pair<TEditorId, TUniqueId> GenerateObject(TEditorId);
2017-02-19 09:27:01 +00:00
void InitScriptObjects(const std::vector<TEditorId>& ids);
2016-04-17 05:35:32 +00:00
void InformListeners(const zeus::CVector3f&, EListenNoiseType);
2017-03-29 02:51:12 +00:00
void ApplyKnockBack(CActor& actor, const CDamageInfo& info,
2016-04-17 05:35:32 +00:00
const CDamageVulnerability&, const zeus::CVector3f&, float);
2017-03-29 02:51:12 +00:00
void KnockBackPlayer(CPlayer& player, const zeus::CVector3f& pos, float power, float resistance);
void ApplyDamageToWorld(TUniqueId, const CActor&, const zeus::CVector3f&,
2016-04-17 05:35:32 +00:00
const CDamageInfo& info, const CMaterialFilter&);
2017-03-29 02:51:12 +00:00
void ProcessRadiusDamage(const CActor&, CActor&, TUniqueId senderId,
2016-04-17 05:35:32 +00:00
const CDamageInfo& info, const CMaterialFilter&);
2017-03-29 02:51:12 +00:00
void ApplyRadiusDamage(const CActor&, const zeus::CVector3f&, CActor&,
2016-04-17 05:35:32 +00:00
const CDamageInfo& info);
bool TestRayDamage(const zeus::CVector3f& pos, const CActor& damagee,
const rstl::reserved_vector<TUniqueId, 1024>& nearList);
2017-06-19 07:00:50 +00:00
bool RayCollideWorld(const zeus::CVector3f& start, const zeus::CVector3f& end,
const rstl::reserved_vector<TUniqueId, 1024>& nearList,
const CMaterialFilter& filter, const CActor& damagee);
2017-06-19 07:00:50 +00:00
bool RayCollideWorldInternal(const zeus::CVector3f& start, const zeus::CVector3f& end,
const CMaterialFilter& filter,
const rstl::reserved_vector<TUniqueId, 1024>& nearList,
const CActor* damagee);
bool MultiRayCollideWorld(const zeus::CMRay& ray, const CMaterialFilter& filter);
2017-03-29 02:51:12 +00:00
void TestBombHittingWater(const CActor& damager, const zeus::CVector3f& pos, CActor& damagee);
2016-11-22 20:43:16 +00:00
bool ApplyLocalDamage(const zeus::CVector3f&, const zeus::CVector3f&, CActor&, float,
2016-04-17 05:35:32 +00:00
const CWeaponMode&);
2017-01-15 03:59:37 +00:00
bool ApplyDamage(TUniqueId, TUniqueId, TUniqueId, const CDamageInfo& info,
const CMaterialFilter&, const zeus::CVector3f&);
2016-04-17 05:35:32 +00:00
void UpdateAreaSounds();
void FrameEnd();
void ProcessPlayerInput();
2017-04-03 01:39:23 +00:00
void SetGameState(EGameState state);
EGameState GetGameState() const { return x904_gameState; }
2016-04-17 05:35:32 +00:00
void ProcessInput(const CFinalInput& input);
void Update(float dt);
void UpdateGameState();
2017-03-24 05:30:16 +00:00
void UpdateHintState(float dt);
2017-06-30 01:39:34 +00:00
void PreThinkObjects(float dt);
2017-03-24 05:30:16 +00:00
void MovePlatforms(float dt);
void MoveDoors(float dt);
2017-03-26 05:53:04 +00:00
void CrossTouchActors();
2017-03-24 05:30:16 +00:00
void ThinkEffectsAndActors(float dt);
2017-08-02 07:13:11 +00:00
void PostUpdatePlayer(float dt);
2017-03-24 05:30:16 +00:00
void ShowPausedHUDMemo(ResId strg, float time);
2017-03-26 05:53:04 +00:00
void ClearGraveyard();
2017-02-18 02:19:50 +00:00
void FrameBegin(s32 frameCount);
void InitializeState(ResId mlvlId, TAreaId aid, ResId mreaId);
2016-04-17 05:35:32 +00:00
void CreateStandardGameObjects();
2017-03-24 05:30:16 +00:00
const std::unique_ptr<CObjectList>& GetObjectList() const { return x808_objLists[0]; }
2016-04-17 05:35:32 +00:00
CObjectList* ObjectListById(EGameObjectList type);
const CObjectList* GetObjectListById(EGameObjectList type) const;
void RemoveObject(TUniqueId);
void UpdateRoomAcoustics(TAreaId);
TAreaId GetNextAreaId() const { return x8cc_nextAreaId; }
2016-04-17 05:35:32 +00:00
void SetCurrentAreaId(TAreaId);
CEntity* ObjectById(TUniqueId uid);
const CEntity* GetObjectById(TUniqueId uid) const;
void AreaUnloaded(TAreaId);
void PrepareAreaUnload(TAreaId);
void AreaLoaded(TAreaId);
void BuildNearList(rstl::reserved_vector<TUniqueId, 1024>& listOut,
const zeus::CVector3f&, const zeus::CVector3f&, float,
const CMaterialFilter&, const CActor*) const;
void BuildColliderList(rstl::reserved_vector<TUniqueId, 1024>& listOut,
const CActor&, const zeus::CAABox&) const;
void BuildNearList(rstl::reserved_vector<TUniqueId, 1024>& listOut,
const zeus::CAABox&, const CMaterialFilter&, const CActor*) const;
void UpdateActorInSortedLists(CActor&);
void UpdateSortedLists();
2017-03-24 05:30:16 +00:00
std::experimental::optional<zeus::CAABox> CalculateObjectBounds(const CActor&);
void AddObject(CEntity&);
void AddObject(CEntity*);
CRayCastResult RayStaticIntersection(const zeus::CVector3f& pos, const zeus::CVector3f& dir, float length,
const CMaterialFilter& filter) const;
CRayCastResult RayWorldIntersection(TUniqueId& idOut, const zeus::CVector3f& pos,
const zeus::CVector3f& dir, float length, const CMaterialFilter& filter,
const rstl::reserved_vector<TUniqueId, 1024>& list) const;
2016-04-17 05:35:32 +00:00
void UpdateObjectInLists(CEntity&);
TUniqueId AllocateUniqueId();
2017-02-18 02:19:50 +00:00
void DeferStateTransition(EStateManagerTransition t);
EStateManagerTransition GetDeferredStateTransition() const { return xf90_deferredTransition; }
bool CanShowMapScreen() const;
TUniqueId GetSkipCinematicSpecialFunction() const { return xf38_skipCineSpecialFunc; }
void SetSkipCinematicSpecialFunction(TUniqueId id) { xf38_skipCineSpecialFunc = id; }
float GetHUDMessageTime() const { return xf78_hudMessageTime; }
ResId GetPauseHUDMessage() const { return xf08_pauseHudMessage; }
void IncrementHUDMessageFrameCounter() { ++xf80_hudMessageFrameCount; }
bool ShouldQuitGame() const { return xf94_25_quitGame; }
void SetInSaveUI(bool b) { xf94_28_inSaveUI = b; }
void SetInMapScreen(bool b) { xf94_27_inMapScreen = b; }
bool GetInMapScreen() const { return xf94_27_inMapScreen; }
2017-04-09 06:14:22 +00:00
bool IsFullThreat() const { return xf94_30_fullThreat; }
2016-04-17 02:50:45 +00:00
2016-04-17 05:35:32 +00:00
const std::shared_ptr<CPlayerState>& GetPlayerState() const {return x8b8_playerState;}
2016-08-21 20:39:18 +00:00
CRandom16* GetActiveRandom() {return x900_activeRandom;}
2017-02-18 02:19:50 +00:00
void SetActiveRandomToDefault() { x900_activeRandom = &x8fc_random; }
void ClearActiveRandom() { x900_activeRandom = nullptr; }
2016-04-17 02:50:45 +00:00
CRumbleManager& GetRumbleManager() {return *x88c_rumbleManager;}
2017-06-01 05:34:24 +00:00
CCameraFilterPassPoly& GetCameraFilterPass(int idx) {return xb84_camFilterPasses[idx];}
CCameraBlurPass& GetCameraBlurPass(int idx) {return xd14_camBlurPasses[idx];}
2016-04-19 00:17:49 +00:00
CEnvFxManager* GetEnvFxManager() { return x880_envFxManager; }
CWorld* WorldNC() {return x850_world.get();}
const CWorld* GetWorld() const { return x850_world.get(); }
CRelayTracker* GetRelayTracker() { return x8bc_relayTracker.get(); }
CCameraManager* GetCameraManager() const { return x870_cameraManager; }
CFluidPlaneManager* GetFluidPlaneManager() const { return x87c_fluidPlaneManager; }
2017-07-14 05:14:19 +00:00
CActorModelParticles* GetActorModelParticles() const { return x884_actorModelParticles; }
2016-04-22 20:22:45 +00:00
2016-10-09 07:45:04 +00:00
const std::shared_ptr<CMapWorldInfo>& MapWorldInfo() const { return x8c0_mapWorldInfo; }
const std::shared_ptr<CWorldLayerState>& LayerState() const { return x8c8_worldLayerState; }
2016-08-07 00:20:02 +00:00
CPlayer& GetPlayer() const { return *x84c_player; }
CPlayer* Player() const { return x84c_player.get(); }
2017-03-24 05:30:16 +00:00
CObjectList& GetAllObjectList() const { return *x808_objLists[0]; }
CActorList& GetActorObjectList() const { return static_cast<CActorList&>(*x808_objLists[1]); }
CPhysicsActorList& GetPhysicsActorObjectList() const { return static_cast<CPhysicsActorList&>(*x808_objLists[2]); }
CGameCameraList& GetCameraObjectList() const { return static_cast<CGameCameraList&>(*x808_objLists[3]); }
CGameLightList& GetLightObjectList() const { return static_cast<CGameLightList&>(*x808_objLists[4]); }
CListeningAiList& GetListeningAiObjectList() const { return static_cast<CListeningAiList&>(*x808_objLists[5]); }
CAiWaypointList& GetAiWaypointObjectList() const { return static_cast<CAiWaypointList&>(*x808_objLists[6]); }
CPlatformAndDoorList& GetPlatformAndDoorObjectList() const { return static_cast<CPlatformAndDoorList&>(*x808_objLists[7]); }
2016-12-20 21:51:50 +00:00
std::pair<u32, u32> CalculateScanCompletionRate() const;
2017-01-18 22:30:02 +00:00
void SetLastTriggerId(TUniqueId uid) { xf74_lastTrigger = uid; }
TUniqueId GetLastTriggerId() const { return xf74_lastTrigger; }
void SetLastRelayId(TUniqueId uid) { xf76_lastRelay = uid; }
TUniqueId* GetLastRelayIdPtr() { return &xf76_lastRelay; }
TUniqueId GetLastRelayId() const { return xf76_lastRelay; }
2017-01-24 17:23:10 +00:00
bool GetIsGeneratingObject() const { return xf94_26_generatingObject; }
void SetIsGeneratingObject(bool gen) { xf94_26_generatingObject = gen; }
u32 GetParticleFlags() const { return xf34_particleFlags; }
const CFinalInput& GetFinalInput() const { return xb54_finalInput; }
2017-04-04 05:48:13 +00:00
void SetBossParams(TUniqueId bossId, float maxEnergy, u32 stringIdx);
2017-04-08 20:40:36 +00:00
TUniqueId GetBossId() const { return xf18_bossId; }
float GetTotalBossEnergy() const { return xf1c_totalBossEnergy; }
u32 GetBossStringIdx() const { return xf20_bossStringIdx; }
2017-05-18 19:27:21 +00:00
const SOnScreenTex& GetPendingScreenTex() const { return xef4_pendingScreenTex; }
void SetViewportScale(const zeus::CVector2f& scale) { xf2c_viewportScale = scale; }
2017-07-20 06:04:40 +00:00
float GetThermalColdScale2() const { return xf28_thermColdScale2; }
void SetThermalColdScale2(float s) { xf28_thermColdScale2 = s; }
2017-03-26 05:53:04 +00:00
static float g_EscapeShakeCountdown;
static bool g_EscapeShakeCountdownInit;
2015-08-17 05:26:58 +00:00
};
}
2015-08-17 05:26:58 +00:00
#endif