mirror of
https://github.com/PrimeDecomp/prime.git
synced 2025-12-08 15:04:54 +00:00
Renaming & more CActor progress
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
|
||||
#include "Kyoto/Graphics/CColor.hpp"
|
||||
#include "Kyoto/Math/CVector3f.hpp"
|
||||
#include "Kyoto/Math/CTransform4f.hpp"
|
||||
|
||||
#include "Kyoto/Graphics/CTevCombiners.hpp"
|
||||
|
||||
@@ -49,6 +50,11 @@ public:
|
||||
static void StreamTexcoord(f32 u, f32 v);
|
||||
static void StreamVertex(const CVector3f& vtx);
|
||||
static void StreamEnd();
|
||||
|
||||
static const CTransform4f& GetViewMatrix() { return mViewMatrix; }
|
||||
|
||||
private:
|
||||
static CTransform4f mViewMatrix;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -9,6 +9,9 @@ public:
|
||||
// TODO
|
||||
}
|
||||
CAABox(const CVector3f& min, const CVector3f& max);// : min(min), max(max) {}
|
||||
CAABox(const CAABox& other) : min(other.min), max(other.max) {}
|
||||
|
||||
CVector3f ClosestPointAlongVector(const CVector3f& vec) const;
|
||||
|
||||
static CAABox mskInvertedBox;
|
||||
static CAABox mskNullBox;
|
||||
|
||||
33
include/Kyoto/Math/CFrustumPlanes.hpp
Normal file
33
include/Kyoto/Math/CFrustumPlanes.hpp
Normal file
@@ -0,0 +1,33 @@
|
||||
#ifndef _CFRUSTUMPLANES_HPP
|
||||
#define _CFRUSTUMPLANES_HPP
|
||||
|
||||
#include "types.h"
|
||||
|
||||
#include "Kyoto/Math/CVector3f.hpp"
|
||||
|
||||
#include "rstl/reserved_vector.hpp"
|
||||
#include "rstl/optional_object.hpp"
|
||||
|
||||
class CAABox;
|
||||
class CSphere;
|
||||
|
||||
class CPlane {
|
||||
private:
|
||||
f32 x;
|
||||
f32 y;
|
||||
f32 z;
|
||||
f32 d;
|
||||
};
|
||||
|
||||
class CFrustumPlanes {
|
||||
public:
|
||||
bool BoxInFrustumPlanes(const CAABox& box) const;
|
||||
bool BoxInFrustumPlanes(const rstl::optional_object< CAABox >& box) const;
|
||||
bool SphereInFrustumPlanes(const CSphere& sphere) const;
|
||||
bool PointInFrustumPlanes(const CVector3f& point) const;
|
||||
|
||||
private:
|
||||
rstl::reserved_vector< CPlane, 6 > x0_planes;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -9,6 +9,16 @@
|
||||
#include "Kyoto/Math/CVector2f.hpp"
|
||||
#include "rstl/pair.hpp"
|
||||
|
||||
class IRenderer {
|
||||
public:
|
||||
enum EDrawableSorting {
|
||||
kDS_SortedCallback,
|
||||
kDS_UnsortedCallback,
|
||||
};
|
||||
|
||||
// TODO vtable
|
||||
};
|
||||
|
||||
class CCubeRenderer {
|
||||
public:
|
||||
virtual ~CCubeRenderer();
|
||||
@@ -26,7 +36,7 @@ public:
|
||||
virtual void AddParticleGen1();
|
||||
virtual void AddParticleGen2();
|
||||
virtual void AddPlaneObject();
|
||||
virtual void AddDrawable();
|
||||
virtual void AddDrawable(const void* obj, const CVector3f& pos, const CAABox& bounds, s32 mode, IRenderer::EDrawableSorting sorting);
|
||||
virtual void SetDrawableCallback();
|
||||
virtual void SetWorldViewpoint();
|
||||
virtual void SetPerspective1();
|
||||
|
||||
@@ -28,7 +28,7 @@ class CSimpleShadow;
|
||||
|
||||
class CDamageInfo;
|
||||
class CDamageVulnerability;
|
||||
class CFrustum;
|
||||
class CFrustumPlanes;
|
||||
class CHealthInfo;
|
||||
class CScriptWater;
|
||||
class CWeaponMode;
|
||||
@@ -211,9 +211,9 @@ public:
|
||||
const CMaterialList& list, const CActorParameters& params, TUniqueId nextDrawNode);
|
||||
~CActor();
|
||||
|
||||
virtual void PreRender(CStateManager&, const CFrustum&);
|
||||
virtual void AddToRenderer(const CFrustum&, CStateManager&);
|
||||
virtual void Render(CStateManager&);
|
||||
virtual void PreRender(CStateManager&, const CFrustumPlanes&);
|
||||
virtual void AddToRenderer(const CFrustumPlanes&, const CStateManager&) const;
|
||||
virtual void Render(const CStateManager&) const;
|
||||
virtual bool CanRenderUnsorted(const CStateManager&) const;
|
||||
virtual void CalculateRenderBounds();
|
||||
virtual CHealthInfo* HealthInfo(CStateManager&);
|
||||
@@ -240,17 +240,67 @@ public:
|
||||
void UpdateSfxEmitters();
|
||||
void RemoveEmitter();
|
||||
void SetModelData(const CModelData& modelData);
|
||||
f32 GetAverageAnimVelocity(s32 anim);
|
||||
void EnsureRendered(const CStateManager& mgr) const;
|
||||
void EnsureRendered(const CStateManager& mgr, const CVector3f& pos, const CAABox& bounds) const;
|
||||
void DrawTouchBounds() const;
|
||||
|
||||
const CTransform4f& GetTransform() const { return x34_transform; }
|
||||
CVector3f GetTranslation() const { return x34_transform.GetTranslation(); }
|
||||
bool GetMuted() const { return xe5_26_muted; }
|
||||
bool HasAnimation() const { return x64_modelData && x64_modelData->GetAnimationData(); }
|
||||
bool HasModelData() const { return x64_modelData && (x64_modelData->GetAnimationData() || x64_modelData->HasNormalModel()); }
|
||||
|
||||
bool HasModelData() const { return GetModelData() && (GetModelData()->HasAnimation() || GetModelData()->HasNormalModel()); }
|
||||
CModelData* ModelData() { return x64_modelData.get(); }
|
||||
const CModelData* GetModelData() const { return x64_modelData.get(); }
|
||||
|
||||
bool HasAnimation() const { return GetModelData() && GetModelData()->HasAnimation(); }
|
||||
CAnimData* AnimationData() { return ModelData()->AnimationData(); }
|
||||
const CAnimData* GetAnimationData() const { return GetModelData()->GetAnimationData(); }
|
||||
f32 GetAverageAnimVelocity(s32 anim);
|
||||
|
||||
bool HasShadow() const { return !x94_simpleShadow.null(); }
|
||||
CSimpleShadow* Shadow() { return x94_simpleShadow.get(); }
|
||||
const CSimpleShadow* GetShadow() const { return x94_simpleShadow.get(); }
|
||||
|
||||
bool HasActorLights() const { return !x90_actorLights.null(); }
|
||||
CActorLights* ActorLights() { return x90_actorLights.get(); }
|
||||
const CActorLights* GetActorLights() const { return x90_actorLights.get(); }
|
||||
|
||||
const CModelFlags& GetModelFlags() const { return xb4_drawFlags; }
|
||||
void SetModelFlags(const CModelFlags& flags) { xb4_drawFlags = flags; }
|
||||
|
||||
bool GetTransformDirty() const { return xe4_27_notInSortedLists; }
|
||||
bool GetTransformDirtySpare() const { return xe4_28_transformDirty; }
|
||||
bool GetPreRenderHasMoved() const { return xe4_29_actorLightsDirty; }
|
||||
bool GetPreRenderClipped() const { return xe4_30_outOfFrustum; }
|
||||
bool GetCalculateLighting() const { return xe4_31_calculateLighting && HasActorLights(); }
|
||||
bool GetDrawShadow() const { return xe5_24_shadowEnabled; }
|
||||
bool GetShadowDirty() const { return xe5_25_shadowDirty; }
|
||||
bool GetMuted() const { return xe5_26_muted; }
|
||||
bool GetRenderParticleDatabaseInside() const { return xe6_29_renderParticleDBInside; }
|
||||
|
||||
void SetTransformDirty(bool b) { xe4_27_notInSortedLists = b; }
|
||||
void SetTransformDirtySpare(bool b) { xe4_28_transformDirty = b; }
|
||||
void SetPreRenderHasMoved(bool b) { xe4_29_actorLightsDirty = b; }
|
||||
void SetPreRenderClipped(bool b) { xe4_30_outOfFrustum = b; }
|
||||
void SetCalculateLighting(bool b) { xe4_31_calculateLighting = b; }
|
||||
void SetDrawShadow(bool b) { xe5_24_shadowEnabled = b; }
|
||||
void SetShadowDirty(bool b) { xe5_25_shadowDirty = b; }
|
||||
void SetMuted(bool b) { xe5_26_muted = b; }
|
||||
void SetRenderParticleDatabaseInside(bool b) { xe6_29_renderParticleDBInside = b; }
|
||||
|
||||
const CAABox& GetRenderBoundsCached() const { return x9c_renderBounds; }
|
||||
void SetRenderBounds(const CAABox& bounds) { x9c_renderBounds = bounds; }
|
||||
|
||||
// 000c0ec8 00001c 801711a8 4 GetUseInSortedLists__6CActorCFv CActor.o
|
||||
// 000c0ee4 000014 801711c4 4 SetUseInSortedLists__6CActorFb CActor.o
|
||||
// 000c0ef8 00001c 801711d8 4 GetCallTouch__6CActorCFv CActor.o
|
||||
// 000c0f14 000014 801711f4 4 SetCallTouch__6CActorFb CActor.o
|
||||
// GetOrbitDistanceCheck__6CActorCFv
|
||||
// GetCalculateLighting__6CActorCFv
|
||||
// GetDrawShadow__6CActorCFv
|
||||
// GetRenderBoundsCached__6CActorCFv
|
||||
// GetRenderParticleDatabaseInside__6CActorCFv
|
||||
|
||||
// HasModelParticles__6CActorCFv
|
||||
|
||||
protected:
|
||||
CTransform4f x34_transform;
|
||||
|
||||
@@ -3,9 +3,86 @@
|
||||
|
||||
#include "types.h"
|
||||
|
||||
#include "MetroidPrime/TGameTypes.hpp"
|
||||
|
||||
#include "Kyoto/Graphics/CColor.hpp"
|
||||
#include "Kyoto/Math/CVector3f.hpp"
|
||||
|
||||
#include "rstl/reserved_vector.hpp"
|
||||
|
||||
enum ELightType {
|
||||
kLT_Spot = 0,
|
||||
kLT_Point = 1,
|
||||
kLT_Directional = 2,
|
||||
kLT_LocalAmbient = 3,
|
||||
kLT_Custom = 4,
|
||||
};
|
||||
|
||||
class CLight {
|
||||
private:
|
||||
CVector3f x0_pos;
|
||||
CVector3f xc_dir;
|
||||
CColor x18_color;
|
||||
ELightType x1c_type;
|
||||
f32 x20_spotCutoff;
|
||||
f32 x24_distC;
|
||||
f32 x28_distL;
|
||||
f32 x2c_distQ;
|
||||
f32 x30_angleC;
|
||||
f32 x34_angleL;
|
||||
f32 x38_angleQ;
|
||||
u32 x3c_priority;
|
||||
u32 x40_lightId;
|
||||
mutable f32 x44_cachedRadius;
|
||||
mutable f32 x48_cachedIntensity;
|
||||
mutable bool x4c_24_intensityDirty : 1;
|
||||
mutable bool x4c_25_radiusDirty : 1;
|
||||
};
|
||||
CHECK_SIZEOF(CLight, 0x50)
|
||||
|
||||
class CGameArea;
|
||||
|
||||
class CActorLights {
|
||||
public:
|
||||
~CActorLights();
|
||||
|
||||
void BuildConstantAmbientLighting();
|
||||
bool BuildAreaLightList(const CStateManager& mgr, const CGameArea& area, const CAABox& bounds);
|
||||
void BuildDynamicLightList(const CStateManager& mgr, const CAABox& bounds);
|
||||
|
||||
bool GetNeedsRelight() const { return x298_24_dirty; }
|
||||
|
||||
private:
|
||||
rstl::reserved_vector< CLight, 4 > x0_areaLights;
|
||||
rstl::reserved_vector< CLight, 4 > x144_dynamicLights;
|
||||
CVector3f x288_ambientColor;
|
||||
TAreaId x294_aid;
|
||||
bool x298_24_dirty : 1;
|
||||
bool x298_25_castShadows : 1;
|
||||
bool x298_26_hasAreaLights : 1;
|
||||
bool x298_27_findShadowLight : 1;
|
||||
bool x298_28_inArea : 1;
|
||||
bool x298_29_ambienceGenerated : 1;
|
||||
bool x298_30_layer2 : 1;
|
||||
bool x298_31_disableWorldLights : 1;
|
||||
bool x299_24_inBrightLight : 1;
|
||||
bool x299_25_useBrightLightLag : 1;
|
||||
bool x299_26_ambientOnly : 1;
|
||||
bool x29a_findNearestDynamicLights;
|
||||
s32 x29c_shadowLightArrIdx;
|
||||
s32 x2a0_shadowLightIdx;
|
||||
u32 x2a4_lastUpdateFrame;
|
||||
u32 x2a8_areaUpdateFramePeriod;
|
||||
CVector3f x2ac_actorPosBias;
|
||||
s32 x2b8_maxAreaLights;
|
||||
s32 x2bc_maxDynamicLights;
|
||||
CVector3f x2c0_lastActorPos;
|
||||
f32 x2cc_actorPositionDeltaUpdateThreshold;
|
||||
f32 x2d0_shadowDynamicRangeThreshold;
|
||||
f32 x2d4_worldLightingLevel;
|
||||
s32 x2d8_brightLightIdx;
|
||||
u32 x2dc_brightLightLag;
|
||||
};
|
||||
CHECK_SIZEOF(CActorLights, 0x2e0)
|
||||
|
||||
#endif
|
||||
@@ -31,6 +31,7 @@ public:
|
||||
kAD_Backward,
|
||||
};
|
||||
|
||||
void PreRender();
|
||||
void SetParticleEffectState(const rstl::string& name, bool active, CStateManager& mgr) {
|
||||
x120_particleDB.SetParticleEffectState(name, active, mgr);
|
||||
}
|
||||
|
||||
81
include/MetroidPrime/CGameArea.hpp
Normal file
81
include/MetroidPrime/CGameArea.hpp
Normal file
@@ -0,0 +1,81 @@
|
||||
#ifndef _CGAMEAREA_HPP
|
||||
#define _CGAMEAREA_HPP
|
||||
|
||||
#include "types.h"
|
||||
|
||||
#include "MetroidPrime/TGameTypes.hpp"
|
||||
|
||||
#include "Kyoto/IObjectStore.hpp"
|
||||
#include "Kyoto/Math/CAABox.hpp"
|
||||
#include "Kyoto/Math/CTransform4f.hpp"
|
||||
|
||||
#include "rstl/auto_ptr.hpp"
|
||||
#include "rstl/list.hpp"
|
||||
#include "rstl/pair.hpp"
|
||||
#include "rstl/rc_ptr.hpp"
|
||||
#include "rstl/vector.hpp"
|
||||
|
||||
class IGameArea {
|
||||
public:
|
||||
virtual ~IGameArea();
|
||||
virtual const CTransform4f& IGetTM() const = 0;
|
||||
virtual CAssetId IGetStringTableAssetId() const = 0;
|
||||
virtual u32 IGetNumAttachedAreas() const = 0;
|
||||
virtual TAreaId IGetAttachedAreaId(int) const = 0;
|
||||
virtual bool IIsActive() const = 0;
|
||||
virtual CAssetId IGetAreaAssetId() const = 0;
|
||||
virtual s32 IGetAreaSaveId() const = 0;
|
||||
virtual rstl::pair< rstl::auto_ptr< u8 >, s32 > IGetScriptingMemoryAlways() const = 0;
|
||||
};
|
||||
|
||||
class Dock;
|
||||
class CToken;
|
||||
class IDvdRequest;
|
||||
|
||||
class CGameArea : public IGameArea {
|
||||
public:
|
||||
~CGameArea();
|
||||
const CTransform4f& IGetTM() const override;
|
||||
CAssetId IGetStringTableAssetId() const override;
|
||||
u32 IGetNumAttachedAreas() const override;
|
||||
TAreaId IGetAttachedAreaId(int) const override;
|
||||
bool IIsActive() const override;
|
||||
CAssetId IGetAreaAssetId() const override;
|
||||
s32 IGetAreaSaveId() const override;
|
||||
rstl::pair< rstl::auto_ptr< u8 >, s32 > IGetScriptingMemoryAlways() const override;
|
||||
|
||||
bool IsLoaded() const { return xf0_24_postConstructed; }
|
||||
bool IsActive() const { return xf0_25_active; }
|
||||
|
||||
private:
|
||||
enum EPhase {
|
||||
kP_LoadHeader,
|
||||
kP_LoadSecSizes,
|
||||
kP_ReserveSections,
|
||||
kP_LoadDataSections,
|
||||
kP_WaitForFinish,
|
||||
};
|
||||
TAreaId x4_selfIdx;
|
||||
CAssetId x8_nameSTRG;
|
||||
CTransform4f xc_transform;
|
||||
CTransform4f x3c_invTransform;
|
||||
CAABox x6c_aabb;
|
||||
CAssetId x84_mrea;
|
||||
s32 x88_areaId;
|
||||
rstl::vector< u16 > x8c_attachedAreaIndices;
|
||||
rstl::vector< SObjectTag > x9c_deps1;
|
||||
rstl::vector< SObjectTag > xac_deps2;
|
||||
rstl::vector< u32 > xbc_layerDepOffsets;
|
||||
rstl::vector< Dock > xcc_docks;
|
||||
rstl::vector< CToken > xdc_tokens;
|
||||
u32 xec_totalResourcesSize;
|
||||
bool xf0_24_postConstructed : 1;
|
||||
bool xf0_25_active : 1;
|
||||
bool xf0_26_tokensReady : 1;
|
||||
bool xf0_27_loadPaused : 1;
|
||||
bool xf0_28_validated : 1;
|
||||
EPhase xf4_phase;
|
||||
rstl::list< rstl::rc_ptr< IDvdRequest > > xf8_loadTransactions;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -15,8 +15,11 @@
|
||||
#include "rstl/pair.hpp"
|
||||
|
||||
class CAABox;
|
||||
class CActorLights;
|
||||
class CAnimData;
|
||||
class CFrustumPlanes;
|
||||
class CModel;
|
||||
class CModelFlags;
|
||||
|
||||
// TODO move
|
||||
#include "Kyoto/Math/CQuaternion.hpp"
|
||||
@@ -28,8 +31,14 @@ CHECK_SIZEOF(SAdvancementDeltas, 0x1c)
|
||||
|
||||
class CModelData {
|
||||
public:
|
||||
enum EWhichModel {
|
||||
kWM_Normal,
|
||||
kWM_XRay,
|
||||
kWM_Thermal,
|
||||
kWM_ThermalHot,
|
||||
};
|
||||
|
||||
// TODO these probably aren't real
|
||||
bool IsStaticModel() const { return xc_animData.get() == nullptr && !x1c_normalModel; }
|
||||
bool HasNormalModel() const { return x1c_normalModel; }
|
||||
|
||||
CModelData();
|
||||
@@ -40,19 +49,24 @@ public:
|
||||
|
||||
SAdvancementDeltas AdvanceAnimation(float dt, CStateManager& mgr, TAreaId aid, bool advTree);
|
||||
void AdvanceParticles(const CTransform4f& xf, float dt, CStateManager& mgr);
|
||||
void RenderParticles(const CFrustumPlanes& planes) const;
|
||||
void RenderUnsortedParts(EWhichModel which, const CTransform4f& xf, const CActorLights* lights, const CModelFlags& flags) const;
|
||||
|
||||
const CAnimData* GetAnimationData() const { return xc_animData.get(); }
|
||||
CAnimData* AnimationData() { return xc_animData.get(); }
|
||||
CAABox GetBounds(const CTransform4f& xf) const;
|
||||
CAABox GetBounds() const;
|
||||
|
||||
bool IsNull() const { return xc_animData.get() == nullptr && !x1c_normalModel; }
|
||||
bool HasAnimation() const { return !xc_animData.null(); }
|
||||
bool IsNull() const { return xc_animData.null() && !x1c_normalModel; }
|
||||
|
||||
void SetXRayModel(const rstl::pair< CAssetId, CAssetId >& assets);
|
||||
void SetInfraModel(const rstl::pair< CAssetId, CAssetId >& assets);
|
||||
void SetAmbientColor(const CColor& color) { x18_ambientColor = color; }
|
||||
void SetSortThermal(bool b) { x14_25_sortThermal = b; }
|
||||
|
||||
static EWhichModel GetRenderingModel(const CStateManager& mgr);
|
||||
|
||||
private:
|
||||
CVector3f x0_scale;
|
||||
rstl::auto_ptr< CAnimData > xc_animData;
|
||||
|
||||
22
include/MetroidPrime/CSimpleShadow.hpp
Normal file
22
include/MetroidPrime/CSimpleShadow.hpp
Normal file
@@ -0,0 +1,22 @@
|
||||
#ifndef _CSIMPLESHADOW_HPP
|
||||
#define _CSIMPLESHADOW_HPP
|
||||
|
||||
#include "types.h"
|
||||
|
||||
class CAABox;
|
||||
class CStateManager;
|
||||
class CTransform4f;
|
||||
|
||||
class CSimpleShadow {
|
||||
public:
|
||||
CAABox GetBounds() const;
|
||||
const CTransform4f& GetTransform() const;
|
||||
CAABox GetMaxShadowBox(const CAABox& bounds) const;
|
||||
void Calculate(const CAABox& bounds, const CTransform4f& xf, const CStateManager& mgr);
|
||||
bool Valid() const;
|
||||
|
||||
private:
|
||||
// TODO
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -8,19 +8,27 @@
|
||||
|
||||
#include "rstl/auto_ptr.hpp"
|
||||
#include "rstl/list.hpp"
|
||||
#include "rstl/rc_ptr.hpp"
|
||||
#include "rstl/reserved_vector.hpp"
|
||||
#include "rstl/single_ptr.hpp"
|
||||
|
||||
class CAABox;
|
||||
class CActor;
|
||||
class CActorModelParticles;
|
||||
class CCameraManager;
|
||||
class CEnvFxManager;
|
||||
class CFluidPlaneManager;
|
||||
class CMapWorldInfo;
|
||||
class CObjectList;
|
||||
class CPlayer;
|
||||
class CPlayerState;
|
||||
class CRumbleManager;
|
||||
class CScriptMailbox;
|
||||
class CStateManagerContainer;
|
||||
class CVector3f;
|
||||
class CWeaponMgr;
|
||||
class CWorld;
|
||||
class CWorldTransManager;
|
||||
|
||||
namespace SL {
|
||||
class CSortedListManager;
|
||||
@@ -29,8 +37,14 @@ class CSortedListManager;
|
||||
class CStateManager {
|
||||
public:
|
||||
void SendScriptMsg(TUniqueId uid, TEditorId target, EScriptObjectMessage msg, EScriptObjectState state);
|
||||
bool AddDrawableActor(const CActor& actor, const CVector3f& pos, const CAABox& bounds) const;
|
||||
|
||||
CCameraManager& GetCameraManager() { return *x870_cameraManager; }
|
||||
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(); }
|
||||
|
||||
private:
|
||||
u16 x0_nextFreeIndex;
|
||||
@@ -47,6 +61,14 @@ private:
|
||||
CEnvFxManager* x880_envFxManager;
|
||||
rstl::auto_ptr< CActorModelParticles > x884_actorModelParticles;
|
||||
CRumbleManager* x88c_rumbleManager;
|
||||
// TODO
|
||||
// rstl::multimap< TEditorId, TUniqueId > x890_scriptIdMap;
|
||||
// rstl::map< TEditorId, SScriptObjectStream > x8a4_loadedScriptObjects;
|
||||
u8 pad[0x28];
|
||||
rstl::rc_ptr< CPlayerState > x8b8_playerState;
|
||||
rstl::rc_ptr< CScriptMailbox > x8bc_mailbox;
|
||||
rstl::rc_ptr< CMapWorldInfo > x8c0_mapWorldInfo;
|
||||
rstl::rc_ptr< CWorldTransManager > x8c4_worldTransManager;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
111
include/MetroidPrime/CWorld.hpp
Normal file
111
include/MetroidPrime/CWorld.hpp
Normal file
@@ -0,0 +1,111 @@
|
||||
#ifndef _CWORLD_HPP
|
||||
#define _CWORLD_HPP
|
||||
|
||||
#include "types.h"
|
||||
|
||||
#include "MetroidPrime/TGameTypes.hpp"
|
||||
|
||||
#include "Kyoto/IObjectStore.hpp"
|
||||
|
||||
#include "rstl/string.hpp"
|
||||
|
||||
class CMapWorld;
|
||||
class IGameArea;
|
||||
|
||||
class IWorld {
|
||||
public:
|
||||
virtual ~IWorld();
|
||||
virtual CAssetId IGetWorldAssetId() const = 0;
|
||||
virtual CAssetId IGetStringTableAssetId() const = 0;
|
||||
virtual CAssetId IGetSaveWorldAssetId() const = 0;
|
||||
virtual const CMapWorld* IGetMapWorld() const = 0;
|
||||
virtual CMapWorld* IMapWorld() = 0;
|
||||
virtual const IGameArea* IGetAreaAlways(TAreaId id) const = 0;
|
||||
virtual TAreaId IGetCurrentAreaId() const = 0;
|
||||
virtual TAreaId IGetAreaId(CAssetId id) const = 0;
|
||||
virtual bool ICheckWorldComplete() = 0;
|
||||
virtual rstl::string IGetDefaultAudioTrack() const = 0;
|
||||
virtual s32 IGetAreaCount() const = 0;
|
||||
};
|
||||
|
||||
class CGameArea;
|
||||
class CRelay;
|
||||
class CSoundGroupData;
|
||||
class IDvdRequest;
|
||||
class IFactory;
|
||||
|
||||
// TODO move?
|
||||
enum EEnvFxType {
|
||||
kEFX_None,
|
||||
kEFX_Snow,
|
||||
kEFX_Rain,
|
||||
kEFX_UnderwaterFlake,
|
||||
};
|
||||
|
||||
class CWorld : public IWorld {
|
||||
public:
|
||||
~CWorld();
|
||||
CAssetId IGetWorldAssetId() const override;
|
||||
CAssetId IGetStringTableAssetId() const override;
|
||||
CAssetId IGetSaveWorldAssetId() const override;
|
||||
const CMapWorld* IGetMapWorld() const override;
|
||||
CMapWorld* IMapWorld() override;
|
||||
const IGameArea* IGetAreaAlways(TAreaId id) const override;
|
||||
TAreaId IGetCurrentAreaId() const override;
|
||||
TAreaId IGetAreaId(CAssetId id) const override;
|
||||
bool ICheckWorldComplete() override;
|
||||
rstl::string IGetDefaultAudioTrack() const override;
|
||||
s32 IGetAreaCount() const override;
|
||||
|
||||
const CGameArea& GetAreaAlways(TAreaId id) const {
|
||||
return *x18_areas[id.Value()];
|
||||
}
|
||||
const CGameArea* GetArea(TAreaId id) const {
|
||||
return x18_areas[id.Value()].get();
|
||||
}
|
||||
bool IsAreaValid(TAreaId id) const {
|
||||
return x18_areas[id.Value()]->IsLoaded();
|
||||
}
|
||||
|
||||
private:
|
||||
enum Phase {
|
||||
kP_Loading,
|
||||
kP_LoadingMap,
|
||||
kP_LoadingMapAreas,
|
||||
kP_LoadingSkyBox,
|
||||
kP_LoadingSoundGroups,
|
||||
kP_Done,
|
||||
};
|
||||
|
||||
Phase x4_phase;
|
||||
CAssetId x8_mlvlId;
|
||||
CAssetId xc_strgId;
|
||||
CAssetId x10_savwId;
|
||||
rstl::vector< rstl::auto_ptr< CGameArea > > x18_areas;
|
||||
CAssetId x24_mapwId;
|
||||
CMapWorld* x28_mapWorld;
|
||||
rstl::vector< CRelay > x2c_relays;
|
||||
rstl::rc_ptr< IDvdRequest > x3c_loadToken;
|
||||
rstl::single_ptr< u8 > x40_loadBuf;
|
||||
u32 x44_bufSz;
|
||||
u32 x48_chainCount;
|
||||
CGameArea* x4c_chainHeads[5];
|
||||
IObjectStore* x60_objectStore;
|
||||
IFactory* x64_resFactory;
|
||||
TAreaId x68_curAreaId;
|
||||
u32 x6c_loadedAudioGrpCount;
|
||||
bool x70_24_currentAreaNeedsAllocation : 1;
|
||||
bool x70_25_loadPaused : 1;
|
||||
bool x70_26_skyboxActive : 1;
|
||||
bool x70_27_skyboxVisible : 1;
|
||||
rstl::vector< CSoundGroupData > x74_soundGroupData;
|
||||
rstl::string x84_defAudioTrack;
|
||||
rstl::optional_object< TLockedToken< CModel > > x94_skyboxWorld;
|
||||
rstl::optional_object< TLockedToken< CModel > > xa4_skyboxWorldLoaded;
|
||||
rstl::optional_object< TLockedToken< CModel > > xb4_skyboxOverride;
|
||||
EEnvFxType xc4_neededFx;
|
||||
rstl::reserved_vector< CSfxHandle, 10 > xc8_globalSfxHandles;
|
||||
};
|
||||
CHECK_SIZEOF(CWorld, 0xf4)
|
||||
|
||||
#endif
|
||||
@@ -3,8 +3,19 @@
|
||||
|
||||
#include "types.h"
|
||||
|
||||
class CStateManager;
|
||||
|
||||
class CPlayerState {
|
||||
public:
|
||||
enum EPlayerVisor {
|
||||
kPV_Combat,
|
||||
kPV_XRay,
|
||||
kPV_Scan,
|
||||
kPV_Thermal,
|
||||
};
|
||||
|
||||
EPlayerVisor GetActiveVisor(const CStateManager& mgr) const;
|
||||
|
||||
void SetIsFusionEnabled(bool v);
|
||||
|
||||
private:
|
||||
|
||||
@@ -27,15 +27,14 @@ public:
|
||||
// x4_item = other.x4_item;
|
||||
// other.x0_has = false;
|
||||
// }
|
||||
T* get() { return x4_item; }
|
||||
/* const*/ T* get() const { return x4_item; }
|
||||
T* operator->() { return get(); }
|
||||
const T* operator->() const { return get(); }
|
||||
T* get() const { return x4_item; }
|
||||
T* operator->() const { return x4_item; }
|
||||
T& operator*() const { return *x4_item; }
|
||||
T* release() const {
|
||||
x0_has = false;
|
||||
return x4_item;
|
||||
}
|
||||
operator bool() const { return x0_has; }
|
||||
bool null() const { return x4_item == nullptr; }
|
||||
};
|
||||
} // namespace rstl
|
||||
|
||||
|
||||
@@ -17,8 +17,10 @@ class rc_ptr {
|
||||
|
||||
public:
|
||||
~rc_ptr();
|
||||
T* get() { return x0_refData->x0_ptr; }
|
||||
T* operator->() { return get(); }
|
||||
T* GetPtr() const { return x0_refData->x0_ptr; }
|
||||
// TODO ReleaseData__Q24rstl20rc_ptr
|
||||
T* operator->() const { return GetPtr(); }
|
||||
T& operator*() const { return *GetPtr(); }
|
||||
};
|
||||
|
||||
template < typename T >
|
||||
|
||||
@@ -20,7 +20,7 @@ public:
|
||||
delete x0_ptr;
|
||||
x0_ptr = ptr;
|
||||
}
|
||||
operator bool() const { return x0_ptr != nullptr; }
|
||||
bool null() const { return x0_ptr == nullptr; }
|
||||
T& operator*() { return *x0_ptr; }
|
||||
const T& operator*() const { return *x0_ptr; }
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user