From 9d6b9142bb5c4a2c2f1170b02b78f1a7d3ef78ac Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sat, 11 Apr 2020 20:20:45 -0400 Subject: [PATCH] CParticleSwoosh: Make use of std::array where applicable Same behavior, no implicit array to pointer decay. --- Runtime/Graphics/Shaders/CParticleSwooshShaders.cpp | 2 +- Runtime/Particle/CParticleSwoosh.cpp | 6 +++--- Runtime/Particle/CParticleSwoosh.hpp | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Runtime/Graphics/Shaders/CParticleSwooshShaders.cpp b/Runtime/Graphics/Shaders/CParticleSwooshShaders.cpp index 02e56af04..8d83479e6 100644 --- a/Runtime/Graphics/Shaders/CParticleSwooshShaders.cpp +++ b/Runtime/Graphics/Shaders/CParticleSwooshShaders.cpp @@ -96,7 +96,7 @@ void CParticleSwooshShaders::BuildShaderDataBinding(boo::IGraphicsDataFactory::C }; const std::array, 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); diff --git a/Runtime/Particle/CParticleSwoosh.cpp b/Runtime/Particle/CParticleSwoosh.cpp index 2017a328d..00501a7bf 100644 --- a/Runtime/Particle/CParticleSwoosh.cpp +++ b/Runtime/Particle/CParticleSwoosh.cpp @@ -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 p0; + std::array p1; + std::array p2; int curIdx = x158_curParticle; bool lastActive = false; diff --git a/Runtime/Particle/CParticleSwoosh.hpp b/Runtime/Particle/CParticleSwoosh.hpp index e913e1ec8..626e976a5 100644 --- a/Runtime/Particle/CParticleSwoosh.hpp +++ b/Runtime/Particle/CParticleSwoosh.hpp @@ -1,5 +1,6 @@ #pragma once +#include #include #include @@ -102,7 +103,7 @@ class CParticleSwoosh : public CParticleGen { float x208_maxRadius = 0.f; zeus::CColor x20c_moduColor = zeus::skWhite; - boo::ObjToken m_dataBind[2]; + std::array, 2> m_dataBind; boo::ObjToken m_vertBuf; boo::ObjToken m_uniformBuf; std::unique_ptr m_lineRenderer;