CGameArea stubs

This commit is contained in:
Jack Andersen 2016-07-22 14:26:17 -10:00
parent 6bbed11859
commit 56f43706d3
7 changed files with 351 additions and 9 deletions

View File

@ -62,6 +62,7 @@ set(DATA_SPEC_LIBS
DNAMP3
DNAMP2
DNAMP1
ScriptObjectsMP1
DNACommon)
set(HECL_DATASPEC_DECLS
"/* RetroCommon specs */

View File

@ -35,5 +35,3 @@ add_library(DNAMP1
SCLY.hpp SCLY.cpp
FRME.cpp
DeafBabe.cpp)
target_link_libraries(DNAMP1 ScriptObjectsMP1)

View File

@ -169,7 +169,7 @@ CStateManager::CStateManager(const std::weak_ptr<CScriptMailbox>&,
x8ec_shadowTex = g_SimplePool->GetObj("DefaultShadow");
}
void CStateManager::UpdateVisors()
void CStateManager::UpdateThermalVisor()
{
xf28_thermColdScale2 = 0.f;
xf24_thermColdScale1 = 0.f;

View File

@ -132,7 +132,7 @@ class CStateManager
float xf2c_ = 1.f;
float xf30_ = 1.f;
void UpdateVisors();
void UpdateThermalVisor();
public:
enum class EScriptPersistence

View File

@ -3,6 +3,72 @@
namespace urde
{
void CGameArea::CAreaFog::SetCurrent() const
{
}
void CGameArea::CAreaFog::Update(float dt)
{
}
void CGameArea::CAreaFog::RollFogOut(float, float, const zeus::CColor& color)
{
}
void CGameArea::CAreaFog::FadeFog(ERglFogMode,
const zeus::CColor& color, const zeus::CVector2f& vec1,
float, const zeus::CVector2f& vec2)
{
}
void CGameArea::CAreaFog::SetFogExplicit(ERglFogMode, const zeus::CColor& color, const zeus::CVector2f& vec)
{
}
bool CGameArea::CAreaFog::IsFogDisabled() const
{
}
void CGameArea::CAreaFog::DisableFog()
{
}
CDummyGameArea::CDummyGameArea(CInputStream& in, int mlvlVersion)
{
}
bool CDummyGameArea::IGetScriptingMemoryAlways() const
{
}
TAreaId CDummyGameArea::IGetAreaId() const
{
}
ResId CDummyGameArea::IGetAreaAssetId() const
{
}
bool CDummyGameArea::IIsActive() const
{
}
TAreaId CDummyGameArea::IGetAttachedAreaId(int) const
{
}
u32 CDummyGameArea::IGetNumAttachedAreas() const
{
}
ResId CDummyGameArea::IGetStringTableAssetId() const
{
}
const zeus::CTransform& CDummyGameArea::IGetTM() const
{
}
static std::vector<SObjectTag> ReadDependencyList(CInputStream& in)
{
std::vector<SObjectTag> ret;
@ -35,9 +101,137 @@ CGameArea::CGameArea(CInputStream& in, int mlvlVersion)
for (int i=0 ; i<attachedCount ; ++i)
x8c_attachedAreaIndices.push_back(in.readUint16Big());
x9c_deps1 = ReadDependencyList(in);
xac_deps2 = ReadDependencyList(in);
x9c_deps1 = ::urde::ReadDependencyList(in);
xac_deps2 = ::urde::ReadDependencyList(in);
}
bool CGameArea::IGetScriptingMemoryAlways() const
{
}
TAreaId CGameArea::IGetAreaId() const
{
}
ResId CGameArea::IGetAreaAssetId() const
{
}
bool CGameArea::IIsActive() const
{
}
TAreaId CGameArea::IGetAttachedAreaId(int) const
{
}
u32 CGameArea::IGetNumAttachedAreas() const
{
}
ResId CGameArea::IGetStringTableAssetId() const
{
}
const zeus::CTransform& CGameArea::IGetTM() const
{
}
bool CGameArea::DoesAreaNeedEnvFx() const
{
}
bool CGameArea::DoesAreaNeedSkyNow() const
{
}
void CGameArea::UpdateFog(float dt)
{
}
bool CGameArea::OtherAreaOcclusionChanged()
{
}
void CGameArea::PingOcclusionState()
{
}
void CGameArea::PreRender()
{
}
void CGameArea::AliveUpdate(float dt)
{
}
void CGameArea::SetOcclusionState(EOcclusionState state)
{
}
void CGameArea::RemoveStaticGeometry()
{
}
void CGameArea::AddStaticGeometry()
{
}
void CGameArea::SetChain(CGameArea* other, int)
{
}
void CGameArea::StartStreamingMainArea()
{
}
u32 CGameArea::GetNumPartSizes() const
{
}
void CGameArea::AllocNewAreaData(int, int)
{
}
void CGameArea::Invalidate(CStateManager& mgr)
{
}
void CGameArea::CullDeadAreaRequests()
{
}
void CGameArea::StartStreamIn(CStateManager& mgr)
{
}
bool CGameArea::Validate(CStateManager& mgr)
{
}
void CGameArea::PostConstructArea()
{
}
void CGameArea::FillInStaticGeometry()
{
}
void CGameArea::VerifyTokenList()
{
}
void CGameArea::ClearTokenList()
{
}
u32 CGameArea::GetPreConstructedSize() const
{
}
bool CGameArea::VerifyHeader() const
{
}
}

View File

@ -8,15 +8,32 @@
#include "RetroTypes.hpp"
#include "IGameArea.hpp"
#include "hecl/ClientProcess.hpp"
#include "Graphics/CMetroidModelInstance.hpp"
namespace urde
{
class CStateManager;
enum class ERglFogMode
{
Four = 4
};
class CDummyGameArea : public IGameArea
{
public:
CDummyGameArea(CInputStream& in, int mlvlVersion);
bool IGetScriptingMemoryAlways() const;
TAreaId IGetAreaId() const;
ResId IGetAreaAssetId() const;
bool IIsActive() const;
TAreaId IGetAttachedAreaId(int) const;
u32 IGetNumAttachedAreas() const;
ResId IGetStringTableAssetId() const;
const zeus::CTransform& IGetTM() const;
};
class CGameArea : public IGameArea
{
int x4_mlvlVersion;
@ -52,6 +69,77 @@ class CGameArea : public IGameArea
std::list<std::shared_ptr<const hecl::ClientProcess::BufferTransaction>> xf8_loadTransactions;
public:
struct CPostConstructed
{
std::unique_ptr<uint8_t[]> x0_;
u32 x8_ = 0;
std::unique_ptr<uint8_t[]> xc_;
bool x48_owns = false;
std::vector<CMetroidModelInstance> x4c_;
std::unique_ptr<uint8_t> x5c_;
//std::vector<Something 68 bytes> x60_;
//std::vector<Something 80 bytes> x70_;
//std::vector<Something 68 bytes> x80_;
//std::vector<Something 80 bytes> x90_;
std::unique_ptr<uint8_t> xa0_;
u32 xa4_elemCount = 1024;
struct MapEntry
{
s16 x0_id = -1;
TUniqueId x4_uid = kInvalidUniqueId;
} xa8_map[1024];
u32 x10a8_ = 0;
CToken x10ac_;
// bool x10b8_ = 0; optional flag for CToken
u32 x10bc_ = 0;
std::unique_ptr<uint8_t[]> x10c0_;
std::unique_ptr<uint8_t[]> x10c4_;
std::unique_ptr<uint8_t> x10c8_;
u32 x10d0_ = 0;
u32 x10d4_ = 0;
u32 x10d8_ = 0;
u32 x10dc_ = 0;
u32 x10e0_ = 0;
float x10e4_ = 5.f;
u32 x10e8_ = -1;
u32 x10ec_ = 0;
// std::vector<CAramToken> x10f0_tokens;
u32 x1100_ = 0;
u32 x1104_ = 0;
union
{
struct
{
bool x1108_24_ : 1;
bool x1108_25_ : 1;
bool x1108_26_ : 1;
bool x1108_28_ : 1;
bool x1108_29_ : 1;
bool x1108_30_ : 1;
};
u8 _dummy = 0;
};
// std::vector<Something 8 bytes> x110c_;
float x111c_ = 0.f;
float x1120_ = 0.f;
float x1124_ = 0.f;
float x1128_ = 1.f;
float x112c_ = 0.f;
float x1130_ = 1.f;
float x1134_ = 0.f;
float x1138_ = 1.f;
u32 x113c_ = 0;
};
struct CAreaObjectList : public IAreaObjectList
{
bool IsQualified(const CEntity& ent);
};
enum class EOcclusionState
{
};
class CAreaFog
{
zeus::CVector2f x4_ = {0.f, 1024.f};
@ -61,13 +149,59 @@ public:
zeus::CVector3f x28_ = {0.5f};
float x34_ = 0.f;
public:
void SetFogExplicit(ERglFogMode, const zeus::CColor& color, const zeus::CVector2f& vec) {}
void DisableFog() {}
void Update(float dt) {}
void SetCurrent() const;
void Update(float dt);
void RollFogOut(float, float, const zeus::CColor& color);
void FadeFog(ERglFogMode, const zeus::CColor& color, const zeus::CVector2f& vec1,
float, const zeus::CVector2f& vec2);
void SetFogExplicit(ERglFogMode, const zeus::CColor& color, const zeus::CVector2f& vec);
bool IsFogDisabled() const;
void DisableFog();
};
CGameArea(CInputStream& in, int mlvlVersion);
bool IsFinishedOccluding() const;
void ReadDependencyList();
bool IGetScriptingMemoryAlways() const;
TAreaId IGetAreaId() const;
ResId IGetAreaAssetId() const;
bool IIsActive() const;
TAreaId IGetAttachedAreaId(int) const;
u32 IGetNumAttachedAreas() const;
ResId IGetStringTableAssetId() const;
const zeus::CTransform& IGetTM() const;
bool DoesAreaNeedEnvFx() const;
bool DoesAreaNeedSkyNow() const;
void UpdateFog(float dt);
bool OtherAreaOcclusionChanged();
void PingOcclusionState();
void PreRender();
void AliveUpdate(float dt);
void SetOcclusionState(EOcclusionState state);
void RemoveStaticGeometry();
void AddStaticGeometry();
//void TransferTokensToARAM();
//void TransferARAMTokensOver();
void SetChain(CGameArea* other, int);
void StartStreamingMainArea();
//void UnloadAllLoadedTextures();
//void ReloadAllLoadedTextures();
u32 GetNumPartSizes() const;
void AllocNewAreaData(int, int);
void Invalidate(CStateManager& mgr);
void CullDeadAreaRequests();
void StartStreamIn(CStateManager& mgr);
bool Validate(CStateManager& mgr);
void PostConstructArea();
void FillInStaticGeometry();
void VerifyTokenList();
void ClearTokenList();
u32 GetPreConstructedSize() const;
bool VerifyHeader() const;
const zeus::CTransform& GetTransform() const {return xc_transform;}
const zeus::CTransform& GetInverseTransform() const {return x3c_invTransform;}
const zeus::CAABox& GetAABB() const {return x6c_aabb;}

View File

@ -6,6 +6,7 @@
namespace urde
{
class CEntity;
class IGameArea
{
@ -43,6 +44,20 @@ public:
bool ShouldLoadOtherArea(s32 other) const;
zeus::CVector3f GetPoint(s32 idx) const;
};
struct IAreaObjectList
{
virtual bool IsQualified(const CEntity& ent)=0;
};
virtual bool IGetScriptingMemoryAlways() const=0;
virtual TAreaId IGetAreaId() const=0;
virtual ResId IGetAreaAssetId() const=0;
virtual bool IIsActive() const=0;
virtual TAreaId IGetAttachedAreaId(int) const=0;
virtual u32 IGetNumAttachedAreas() const=0;
virtual ResId IGetStringTableAssetId() const=0;
virtual const zeus::CTransform& IGetTM() const=0;
};
}