CMapWorld stubs, and compile fixes

This commit is contained in:
Phillip Stephens 2016-07-28 00:33:55 -07:00
parent f92efa1a02
commit 62ce5286fe
10 changed files with 109 additions and 12 deletions

View File

@ -2,16 +2,103 @@
#define __URDE_CMAPWORLD_HPP__
#include "RetroTypes.hpp"
#include "zeus/CColor.hpp"
#include "zeus/CVector3f.hpp"
#include "zeus/CTransform.hpp"
namespace urde
{
class IWorld;
class CMapWorldInfo;
class CStateManager;
class CMapWorld
{
public:
/* skDrawProfileItemNames; */
enum class EMapAreaList
{
};
class CMapAreaBFSInfo
{
public:
CMapAreaBFSInfo(s32, s32, float, float);
u32 GetAreaIndex() const;
float GetDepth();
float GetOutlineDrawDepth() const;
float GetSurfaceDrawDepth() const;
};
class CMapObjectSortInfo
{
public:
enum class EObjectCode
{
};
private:
public:
CMapObjectSortInfo(float, int, EObjectCode, int, const zeus::CColor&, const zeus::CColor& );
const zeus::CColor& GetOutlineColor() const;
const zeus::CColor& GetSurfaceColor() const;
u32 GetLocalObjectIndex();
EObjectCode GetObjectCode() const;
u32 GetAreaIndex() const;
float GetZDistance() const;
};
class CMapAreaData
{
public:
CMapAreaData(u32, EMapAreaList, CMapAreaData*);
void Lock();
void Unlock();
bool IsLoaded() const;
void GetMapArea() const;
void GetNextMapAreaData() const;
void GetContainingList() const;
void NextMapAreaData();
void SetContainingList(EMapAreaList);
void SetNextMapArea(CMapAreaData*);
};
class CMapWorldDrawParms
{
public:
CMapWorldDrawParms(float, float, float, float, float, const CStateManager&, const zeus::CTransform&,
const zeus::CTransform&, const IWorld&, const CMapWorldInfo&, float, bool);
void GetWorld() const;
float GetOutlineWidthScale() const;
void GetPlaneProjectionTransform() const;
void GetPlayerAreaFlashIntensity() const;
void GetCameraTransform() const;
void GetAlphaOutlineUnvisited() const;
void GetAlphaSurfaceUnvisited() const;
void GetAlphaOutlineVisited() const;
void GetAlphaSurfaceVisited() const;
void GetMapWorldInfo() const;
void GetStateManager() const;
bool GetIsSortDoorSurfaces() const;
};
private:
public:
CMapWorld(CInputStream&);
u32 GetNumAreas() const;
void GetLoadedMapArea(s32) const;
void GetMapArea(s32) const;
void IsMapAreaInBFSInfoVector(const CMapWorld::CMapAreaData*, const std::vector<CMapAreaBFSInfo>&) const;
void SetWhichMapAreasLoaded(const IWorld&, int start, int count);
bool IsMapAreasStreaming() const;
void MoveMapAreaToList(CMapAreaData*, EMapAreaList);
void GetCurrentMapAreaDepth(const IWorld&, int) const;
void GetVisibleAreas(const IWorld&, const CMapWorldInfo&) const;
void Draw(const CMapWorldDrawParms&, int, int, float, float, bool) const;
void DoBFS(const IWorld&, int, int, float, float, bool, std::vector<CMapAreaBFSInfo>&) const;
bool IsMapAreaValid(const IWorld&, int, bool) const;
void DrawAreas(const CMapWorldDrawParms&, int, const std::vector<CMapAreaBFSInfo>&, bool) const;
void RecalculateWorldSphere(const CMapWorldInfo&, const IWorld&) const;
void ConstrainToWorldVolume(const zeus::CVector3f&, const zeus::CVector3f&) const;
void ClearTraversedFlags() const;
};
}

View File

@ -9,7 +9,15 @@ class CMapWorldInfo
{
std::map<TEditorId, bool> x14_;
public:
CMapWorldInfo()=default;
CMapWorldInfo(CInputStream&);
void PutTo(COutputStream&);
bool IsMapped() const;
void SetIsMapped(bool) const;
void SetDoorVisited(TEditorId eid, bool val);
bool IsDoorVisited() const;
bool IsAreaVisted(TAreaId) const;
void SetAreaVisited(TAreaId, bool) const;
};
}

View File

@ -250,6 +250,7 @@ public:
CWorld* GetWorld() {return x850_world.get();}
CRelayTracker* GetRelayTracker() { return x8bc_relayTracker.get(); }
CCameraManager* GetCameraManager() { return x870_cameraManager.get(); }
std::shared_ptr<CMapWorldInfo> MapWorldInfo() { return x8c0_mapWorldInfo; }
};

View File

@ -69,6 +69,8 @@ public:
return x4_cineCameras.back();
return x0_curCameraId;
}
CBallCamera* GetBallCamera() { return x80_ballCamera; }
};
}

View File

@ -32,8 +32,8 @@ COBBTree::COBBTree(CInputStream& in)
CCollisionSurface COBBTree::GetSurface(u16 idx) const
{
u32 surfIdx = idx * 3;
CCollisionEdge edge1 = x18_indexData.x50_surfaceIndices[x18_indexData.x50_surfaceIndices[surfIdx]];
CCollisionEdge edge2 = x18_indexData.x50_surfaceIndices[x18_indexData.x50_surfaceIndices[surfIdx + 1]];
CCollisionEdge edge1 = x18_indexData.x40_edges[x18_indexData.x50_surfaceIndices[surfIdx]];
CCollisionEdge edge2 = x18_indexData.x40_edges[x18_indexData.x50_surfaceIndices[surfIdx + 1]];
u16 vert1 = edge2.GetVertIndex1();
u16 vert2 = edge2.GetVertIndex2();
u16 vert3 = edge1.GetVertIndex1();

View File

@ -71,7 +71,7 @@ public:
COBBTree(const COBBTree::SIndexData&, const CNode*);
COBBTree(CInputStream&);
void GetSurface(u16) const;
CCollisionSurface GetSurface(u16) const;
zeus::CAABox CalculateLocalAABox() const;
zeus::CAABox CalculateAABox(const zeus::CTransform&) const;
};

View File

@ -177,8 +177,6 @@ const zeus::CVector3f& CParticleElectric::GetGlobalScale() const
const zeus::CColor& CParticleElectric::GetModulationColor() const
{
if (!x1bc_hasModuColor)
return zeus::CColor::skWhite;
return x1b8_moduColor;
}

View File

@ -1,6 +1,6 @@
#include "CProjectileWeaponDataFactory.hpp"
#include "CWeaponDescription.hpp"
#include "CCollisionResponseData.hpp"
#include "Collision/CCollisionResponseData.hpp"
#include "CElectricDescription.hpp"
#include "CSwooshDescription.hpp"
#include "CGenDescription.hpp"

View File

@ -7,7 +7,7 @@
#include "zeus/zeus.hpp"
#include "Collision/CMaterialFilter.hpp"
#include "Character/CModelData.hpp"
#include "Particle/CCollisionResponseData.hpp"
#include "Collision/CCollisionResponseData.hpp"
namespace urde
{

View File

@ -6,6 +6,8 @@
#include "AutoMapper/CMapWorldInfo.hpp"
#include "CStateManager.hpp"
#include "CWorld.hpp"
#include "Camera/CCameraManager.hpp"
#include "Camera/CBallCamera.hpp"
namespace urde
{
@ -83,10 +85,9 @@ void CScriptDoor::ForceClosed(CStateManager & mgr)
x2a8_26_ = false;
x2a8_25_ = false;
/* TODO: Figure out what goes here this */
/*
* mgr->x870->x80_->sub_80083118(x8_uid)
* mgr->x870->x80_->sub_800830F4(x8_uid)
/* TODO: Figure out what goes here this
* mgr.GetCameraManager()->GetBallCamera()->sub_80083118(x8_uid);
* mgr.GetCameraManager()->GetBallCamera()->sub_800830F4(x8_uid);
*/
SetDoorAnimation(EDoorAnimType::Close);