mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-10 09:07:42 +00:00
Graphics/Shaders: Use std::array where applicable
Makes the arrays strongly typed and impervious to array->pointer decay. This also allows simplifying some operations (such as being able to call fill() instead of needing to use std::fill, etc).
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
|
||||
namespace urde {
|
||||
|
||||
static boo::ObjToken<boo::IShaderPipeline> s_Pipelines[4];
|
||||
static std::array<boo::ObjToken<boo::IShaderPipeline>, 4> s_Pipelines;
|
||||
|
||||
void CFogVolumePlaneShader::Initialize() {
|
||||
s_Pipelines[0] = hecl::conv->convert(Shader_CFogVolumePlaneShader0{});
|
||||
@@ -26,9 +26,10 @@ void CFogVolumePlaneShader::CommitResources(size_t capacity) {
|
||||
m_vertCapacity = capacity;
|
||||
CGraphics::CommitResources([this, capacity](boo::IGraphicsDataFactory::Context& ctx) {
|
||||
m_vbo = ctx.newDynamicBuffer(boo::BufferUse::Vertex, sizeof(zeus::CVector4f), capacity);
|
||||
for (int i = 0; i < 4; ++i)
|
||||
for (size_t i = 0; i < m_dataBinds.size(); ++i) {
|
||||
m_dataBinds[i] = ctx.newShaderDataBinding(s_Pipelines[i], m_vbo.get(), nullptr, nullptr, 0, nullptr, nullptr,
|
||||
nullptr, nullptr, 0, nullptr, nullptr, nullptr);
|
||||
}
|
||||
return true;
|
||||
} BooTrace);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user