From ed125031f3ec909c42dd39a15540bcb4eb025451 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 16 Apr 2020 21:10:48 -0400 Subject: [PATCH] CFluidUVMotion: Collapse separate resize and assignment into a constructor call We can pre-size and insert the elements all at the same time. --- Runtime/World/CFluidUVMotion.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/Runtime/World/CFluidUVMotion.cpp b/Runtime/World/CFluidUVMotion.cpp index e8ad7cc6e..2018038ec 100644 --- a/Runtime/World/CFluidUVMotion.cpp +++ b/Runtime/World/CFluidUVMotion.cpp @@ -6,15 +6,11 @@ namespace urde { -CFluidUVMotion::CFluidUVMotion(float timeToWrap, float orientation, const CFluidUVMotion::SFluidLayerMotion& colorLayer, - const CFluidUVMotion::SFluidLayerMotion& pattern1Layer, - const CFluidUVMotion::SFluidLayerMotion& pattern2Layer) -: x4c_ooTimeToWrap(1.f / timeToWrap), x50_orientation(orientation) { - x0_fluidLayers.resize(3); - x0_fluidLayers[0] = colorLayer; - x0_fluidLayers[1] = pattern1Layer; - x0_fluidLayers[2] = pattern2Layer; -} +CFluidUVMotion::CFluidUVMotion(float timeToWrap, float orientation, const SFluidLayerMotion& colorLayer, + const SFluidLayerMotion& pattern1Layer, const SFluidLayerMotion& pattern2Layer) +: x0_fluidLayers{{colorLayer, pattern1Layer, pattern2Layer}} +, x4c_ooTimeToWrap(1.f / timeToWrap) +, x50_orientation(orientation) {} CFluidUVMotion::CFluidUVMotion(float timeToWrap, float orientation) : x4c_ooTimeToWrap(1.f / timeToWrap), x50_orientation(orientation) {