From da75543c76cbccd28598815d7f5893a00a1ec7f7 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 1 Apr 2020 00:27:53 -0400 Subject: [PATCH] CRainSplashGenerator: Dehardcode line vector size in constructor We can query the capacity instead. --- Runtime/Graphics/CRainSplashGenerator.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Runtime/Graphics/CRainSplashGenerator.cpp b/Runtime/Graphics/CRainSplashGenerator.cpp index b43c43654..dd91613c3 100644 --- a/Runtime/Graphics/CRainSplashGenerator.cpp +++ b/Runtime/Graphics/CRainSplashGenerator.cpp @@ -75,8 +75,9 @@ CRainSplashGenerator::SSplashLine::SSplashLine(boo::IGraphicsDataFactory::Contex : m_renderer(ctx, CLineRenderer::EPrimitiveMode::LineStrip, 3, nullptr, false) {} CRainSplashGenerator::SRainSplash::SRainSplash(boo::IGraphicsDataFactory::Context& ctx) { - for (int i = 0; i < 4; ++i) + for (size_t i = 0; i < x0_lines.capacity(); ++i) { x0_lines.emplace_back(ctx); + } } void CRainSplashGenerator::SSplashLine::Update(float dt, CStateManager& mgr) {