mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-09 09:07:43 +00:00
Additional work on CMapWorld rendering
This commit is contained in:
@@ -3,8 +3,11 @@
|
||||
|
||||
#include "RetroTypes.hpp"
|
||||
#include "zeus/CVector3f.hpp"
|
||||
#include "zeus/CVector4f.hpp"
|
||||
#include "zeus/CColor.hpp"
|
||||
#include "boo/graphicsdev/IGraphicsDataFactory.hpp"
|
||||
#include "hecl/VertexBufferPool.hpp"
|
||||
#include "hecl/UniformBufferPool.hpp"
|
||||
|
||||
namespace urde
|
||||
{
|
||||
@@ -19,6 +22,24 @@ public:
|
||||
LineLoop
|
||||
};
|
||||
|
||||
struct SDrawVertTex
|
||||
{
|
||||
zeus::CVector4f pos;
|
||||
zeus::CColor color;
|
||||
zeus::CVector2f uv;
|
||||
};
|
||||
|
||||
struct SDrawVertNoTex
|
||||
{
|
||||
zeus::CVector4f pos;
|
||||
zeus::CColor color;
|
||||
};
|
||||
|
||||
struct SDrawUniform
|
||||
{
|
||||
zeus::CColor moduColor;
|
||||
};
|
||||
|
||||
private:
|
||||
EPrimitiveMode m_mode;
|
||||
u32 m_maxVerts;
|
||||
@@ -38,10 +59,18 @@ private:
|
||||
zeus::CColor m_lastColor;
|
||||
float m_lastWidth;
|
||||
|
||||
static rstl::reserved_vector<SDrawVertTex, 256> g_StaticLineVertsTex;
|
||||
static rstl::reserved_vector<SDrawVertNoTex, 256> g_StaticLineVertsNoTex;
|
||||
|
||||
static hecl::VertexBufferPool<SDrawVertTex> s_vertPoolTex;
|
||||
static hecl::VertexBufferPool<SDrawVertNoTex> s_vertPoolNoTex;
|
||||
static hecl::UniformBufferPool<SDrawUniform> s_uniformPool;
|
||||
|
||||
public:
|
||||
boo::GraphicsDataToken m_gfxToken;
|
||||
boo::IGraphicsBufferD* m_vertBuf;
|
||||
boo::IGraphicsBufferD* m_uniformBuf;
|
||||
hecl::VertexBufferPool<SDrawVertTex>::Token m_vertBufTex;
|
||||
hecl::VertexBufferPool<SDrawVertNoTex>::Token m_vertBufNoTex;
|
||||
hecl::UniformBufferPool<SDrawUniform>::Token m_uniformBuf;
|
||||
boo::IShaderDataBinding* m_shaderBind = nullptr;
|
||||
|
||||
CLineRenderer(boo::IGraphicsDataFactory::Context& ctx,
|
||||
@@ -54,6 +83,13 @@ public:
|
||||
const zeus::CVector2f& uv=zeus::CVector2f::skZero);
|
||||
void Render(const zeus::CColor& moduColor=zeus::CColor::skWhite);
|
||||
|
||||
static void UpdateBuffers()
|
||||
{
|
||||
s_vertPoolTex.updateBuffers();
|
||||
s_vertPoolNoTex.updateBuffers();
|
||||
s_uniformPool.updateBuffers();
|
||||
}
|
||||
|
||||
static void Initialize();
|
||||
static void Shutdown();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user