CParticleSwoosh: Make use of std::array where applicable

Same behavior, no implicit array to pointer decay.
This commit is contained in:
Lioncash 2020-04-11 20:20:45 -04:00
parent 76e226f831
commit 9d6b9142bb
3 changed files with 6 additions and 5 deletions

View File

@ -96,7 +96,7 @@ void CParticleSwooshShaders::BuildShaderDataBinding(boo::IGraphicsDataFactory::C
};
const std::array<boo::ObjToken<boo::IGraphicsBuffer>, 1> uniforms{gen.m_uniformBuf.get()};
for (size_t i = 0; i < std::size(gen.m_dataBind); ++i) {
for (size_t i = 0; i < gen.m_dataBind.size(); ++i) {
gen.m_dataBind[i] =
ctx.newShaderDataBinding((*pipeline)[i], gen.m_vertBuf.get(), nullptr, nullptr, uniforms.size(),
uniforms.data(), nullptr, texr ? 1 : 0, textures.data(), nullptr, nullptr);

View File

@ -586,9 +586,9 @@ void CParticleSwoosh::Render3SidedSolidNoSplineNoGaps() {
if (x15c_swooshes.size() < 2)
return;
zeus::CVector3f p0[2];
zeus::CVector3f p1[2];
zeus::CVector3f p2[2];
std::array<zeus::CVector3f, 2> p0;
std::array<zeus::CVector3f, 2> p1;
std::array<zeus::CVector3f, 2> p2;
int curIdx = x158_curParticle;
bool lastActive = false;

View File

@ -1,5 +1,6 @@
#pragma once
#include <array>
#include <memory>
#include <vector>
@ -102,7 +103,7 @@ class CParticleSwoosh : public CParticleGen {
float x208_maxRadius = 0.f;
zeus::CColor x20c_moduColor = zeus::skWhite;
boo::ObjToken<boo::IShaderDataBinding> m_dataBind[2];
std::array<boo::ObjToken<boo::IShaderDataBinding>, 2> m_dataBind;
boo::ObjToken<boo::IGraphicsBufferD> m_vertBuf;
boo::ObjToken<boo::IGraphicsBufferD> m_uniformBuf;
std::unique_ptr<CLineRenderer> m_lineRenderer;