2016-07-23 21:41:18 +00:00
|
|
|
#ifndef __URDE_CMAPWORLD_HPP__
|
|
|
|
#define __URDE_CMAPWORLD_HPP__
|
|
|
|
|
2016-07-24 22:51:15 +00:00
|
|
|
#include "RetroTypes.hpp"
|
2016-07-29 17:00:23 +00:00
|
|
|
#include "CToken.hpp"
|
2016-07-28 07:33:55 +00:00
|
|
|
#include "zeus/CColor.hpp"
|
|
|
|
#include "zeus/CVector3f.hpp"
|
|
|
|
#include "zeus/CTransform.hpp"
|
2017-03-20 06:59:46 +00:00
|
|
|
#include "CMapArea.hpp"
|
2016-07-24 22:51:15 +00:00
|
|
|
|
2016-07-23 21:41:18 +00:00
|
|
|
namespace urde
|
|
|
|
{
|
|
|
|
class IWorld;
|
2016-07-28 07:33:55 +00:00
|
|
|
class CMapWorldInfo;
|
|
|
|
class CStateManager;
|
2016-07-23 21:41:18 +00:00
|
|
|
class CMapWorld
|
|
|
|
{
|
|
|
|
public:
|
2016-07-28 07:33:55 +00:00
|
|
|
/* 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
|
|
|
|
{
|
2016-07-29 17:00:23 +00:00
|
|
|
TCachedToken<CMapArea> x0_area;
|
2016-07-28 07:33:55 +00:00
|
|
|
public:
|
|
|
|
CMapAreaData(u32, EMapAreaList, CMapAreaData*);
|
|
|
|
void Lock();
|
|
|
|
void Unlock();
|
|
|
|
bool IsLoaded() const;
|
2017-03-20 05:09:53 +00:00
|
|
|
const CMapArea* GetMapArea() const { return x0_area.IsLoaded() ? x0_area.GetObj() : nullptr; }
|
2016-07-28 07:33:55 +00:00
|
|
|
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:
|
2016-07-29 17:00:23 +00:00
|
|
|
std::vector<CMapAreaData> x0_areas;
|
2016-07-28 07:33:55 +00:00
|
|
|
public:
|
|
|
|
CMapWorld(CInputStream&);
|
|
|
|
u32 GetNumAreas() const;
|
2017-03-20 05:09:53 +00:00
|
|
|
const CMapArea* GetMapArea(TAreaId) const;
|
2016-07-31 01:43:34 +00:00
|
|
|
void IsMapAreaInBFSInfoVector(const CMapAreaData*, const std::vector<CMapAreaBFSInfo>&) const;
|
2016-07-24 22:51:15 +00:00
|
|
|
void SetWhichMapAreasLoaded(const IWorld&, int start, int count);
|
2016-07-23 21:41:18 +00:00
|
|
|
bool IsMapAreasStreaming() const;
|
2016-07-28 07:33:55 +00:00
|
|
|
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;
|
2016-07-23 21:41:18 +00:00
|
|
|
};
|
|
|
|
|
2016-10-08 20:32:36 +00:00
|
|
|
CFactoryFnReturn FMapWorldFactory(const SObjectTag& tag, CInputStream& in, const CVParamTransfer& param,
|
|
|
|
CObjectReference* selfRef);
|
|
|
|
|
2016-07-23 21:41:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif // __URDE_CMAPWORLD_HPP__
|