mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-09 00:27:42 +00:00
Work on CMapWorld rendering
This commit is contained in:
@@ -5,6 +5,10 @@
|
||||
#include "CResFactory.hpp"
|
||||
#include "zeus/CAABox.hpp"
|
||||
#include "zeus/CVector3f.hpp"
|
||||
#include "boo/graphicsdev/IGraphicsDataFactory.hpp"
|
||||
#include "Graphics/CLineRenderer.hpp"
|
||||
#include "Graphics/Shaders/CMapSurfaceShader.hpp"
|
||||
#include "CMappableObject.hpp"
|
||||
|
||||
namespace urde
|
||||
{
|
||||
@@ -14,11 +18,23 @@ class CMapArea
|
||||
public:
|
||||
class CMapAreaSurface
|
||||
{
|
||||
friend class CMapArea;
|
||||
zeus::CVector3f x0_normal;
|
||||
zeus::CVector3f xc_centroid;
|
||||
const u8* x18_surfOffset;
|
||||
const u8* x1c_outlineOffset;
|
||||
u32 m_primStart;
|
||||
u32 m_primCount;
|
||||
std::experimental::optional<CMapSurfaceShader> m_surfacePrims;
|
||||
std::vector<CLineRenderer> m_linePrims;
|
||||
public:
|
||||
void PostConstruct(const void*);
|
||||
void Draw(const zeus::CVector3f*, const zeus::CColor&, const zeus::CColor&, float) const;
|
||||
const zeus::CVector3f& GetNormal() const;
|
||||
const zeus::CVector3f& GetCenterPosition() const;
|
||||
CMapAreaSurface(const void* surfBuf);
|
||||
CMapAreaSurface(CMapAreaSurface&&) = default;
|
||||
void PostConstruct(const u8* buf, std::vector<u32>& index);
|
||||
void Draw(const zeus::CVector3f* verts, const zeus::CColor& surfColor,
|
||||
const zeus::CColor& lineColor, float lineWidth) const;
|
||||
const zeus::CVector3f& GetNormal() const { return x0_normal; }
|
||||
const zeus::CVector3f& GetCenterPosition() const { return xc_centroid; }
|
||||
};
|
||||
enum class EVisMode
|
||||
{
|
||||
@@ -39,20 +55,25 @@ private:
|
||||
u32 x30_surfaceCount;
|
||||
u32 x34_size;
|
||||
u8* x38_moStart;
|
||||
std::vector<CMappableObject> m_mappableObjects;
|
||||
u8* x3c_vertexStart;
|
||||
u8* x40_surfaceStart;
|
||||
std::vector<CMapAreaSurface> m_surfaces;
|
||||
std::unique_ptr<u8[]> x44_buf;
|
||||
boo::GraphicsDataToken m_gfxToken;
|
||||
boo::IGraphicsBufferS* m_vbo;
|
||||
boo::IGraphicsBufferS* m_ibo;
|
||||
|
||||
public:
|
||||
CMapArea(CInputStream&, u32);
|
||||
CMapArea(CInputStream& in, u32 size);
|
||||
void PostConstruct();
|
||||
bool GetIsVisibleToAutoMapper(bool, bool) const;
|
||||
bool GetIsVisibleToAutoMapper(bool worldVis, bool areaVis) const;
|
||||
zeus::CVector3f GetAreaCenterPoint() const { return x10_box.center(); }
|
||||
const zeus::CAABox& GetBoundingBox() const { return x10_box; }
|
||||
const zeus::CVector3f& GetVertices() const;
|
||||
void GetMappableObject(s32) const;
|
||||
void GetSurface(s32) const;
|
||||
u32 GetNumMappableObjects() const;
|
||||
u32 GetNumSurfaces() const;
|
||||
const CMappableObject& GetMappableObject(int idx) const { return m_mappableObjects[idx]; }
|
||||
const CMapAreaSurface& GetSurface(int idx) const { return m_surfaces[idx]; }
|
||||
u32 GetNumMappableObjects() const { return m_mappableObjects.size(); }
|
||||
u32 GetNumSurfaces() const { return m_surfaces.size(); }
|
||||
zeus::CTransform GetAreaPostTransform(const IWorld& world, TAreaId aid) const;
|
||||
static const zeus::CVector3f& GetAreaPostTranslate(const IWorld& world, TAreaId aid);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user