CFluidUVMotion: Collapse separate resize and assignment into a constructor call

We can pre-size and insert the elements all at the same time.
This commit is contained in:
Lioncash 2020-04-16 21:10:48 -04:00
parent c85f1a64dd
commit ed125031f3
1 changed files with 5 additions and 9 deletions

View File

@ -6,15 +6,11 @@
namespace urde { namespace urde {
CFluidUVMotion::CFluidUVMotion(float timeToWrap, float orientation, const CFluidUVMotion::SFluidLayerMotion& colorLayer, CFluidUVMotion::CFluidUVMotion(float timeToWrap, float orientation, const SFluidLayerMotion& colorLayer,
const CFluidUVMotion::SFluidLayerMotion& pattern1Layer, const SFluidLayerMotion& pattern1Layer, const SFluidLayerMotion& pattern2Layer)
const CFluidUVMotion::SFluidLayerMotion& pattern2Layer) : x0_fluidLayers{{colorLayer, pattern1Layer, pattern2Layer}}
: x4c_ooTimeToWrap(1.f / timeToWrap), x50_orientation(orientation) { , x4c_ooTimeToWrap(1.f / timeToWrap)
x0_fluidLayers.resize(3); , x50_orientation(orientation) {}
x0_fluidLayers[0] = colorLayer;
x0_fluidLayers[1] = pattern1Layer;
x0_fluidLayers[2] = pattern2Layer;
}
CFluidUVMotion::CFluidUVMotion(float timeToWrap, float orientation) CFluidUVMotion::CFluidUVMotion(float timeToWrap, float orientation)
: x4c_ooTimeToWrap(1.f / timeToWrap), x50_orientation(orientation) { : x4c_ooTimeToWrap(1.f / timeToWrap), x50_orientation(orientation) {