CEnvFxManager: Take std::vector by value and std::move

Same behavior, but allows calling code to move into the parameter,
avoiding copies.
This commit is contained in:
Lioncash 2020-03-26 02:56:07 -04:00
parent dd76e73e11
commit d9a9e0f51e
2 changed files with 4 additions and 4 deletions

View File

@ -23,11 +23,11 @@ namespace urde {
static rstl::reserved_vector<zeus::CVector2f, 256> g_SnowForces; static rstl::reserved_vector<zeus::CVector2f, 256> g_SnowForces;
CEnvFxManagerGrid::CEnvFxManagerGrid(const zeus::CVector2i& position, const zeus::CVector2i& extent, CEnvFxManagerGrid::CEnvFxManagerGrid(const zeus::CVector2i& position, const zeus::CVector2i& extent,
const std::vector<CVectorFixed8_8>& initialParticles, int reserve, std::vector<CVectorFixed8_8> initialParticles, int reserve, CEnvFxManager& parent,
CEnvFxManager& parent, boo::IGraphicsDataFactory::Context& ctx) boo::IGraphicsDataFactory::Context& ctx)
: x4_position(position) : x4_position(position)
, xc_extent(extent) , xc_extent(extent)
, x1c_particles(initialParticles) , x1c_particles(std::move(initialParticles))
, m_instBuf(parent.m_instPool.allocateBlock(CGraphics::g_BooFactory, reserve)) , m_instBuf(parent.m_instPool.allocateBlock(CGraphics::g_BooFactory, reserve))
, m_uniformBuf(parent.m_uniformPool.allocateBlock(CGraphics::g_BooFactory)) , m_uniformBuf(parent.m_uniformPool.allocateBlock(CGraphics::g_BooFactory))
, m_lineRenderer(ctx, CLineRenderer::EPrimitiveMode::Lines, reserve * 2, parent.x40_txtrEnvGradient->GetBooTexture(), , m_lineRenderer(ctx, CLineRenderer::EPrimitiveMode::Lines, reserve * 2, parent.x40_txtrEnvGradient->GetBooTexture(),

View File

@ -79,7 +79,7 @@ class CEnvFxManagerGrid {
public: public:
CEnvFxManagerGrid(const zeus::CVector2i& position, const zeus::CVector2i& extent, CEnvFxManagerGrid(const zeus::CVector2i& position, const zeus::CVector2i& extent,
const std::vector<CVectorFixed8_8>& initialParticles, int reserve, CEnvFxManager& parent, std::vector<CVectorFixed8_8> initialParticles, int reserve, CEnvFxManager& parent,
boo::IGraphicsDataFactory::Context& ctx); boo::IGraphicsDataFactory::Context& ctx);
void Render(const zeus::CTransform& xf, const zeus::CTransform& invXf, const zeus::CTransform& camXf, float fxDensity, void Render(const zeus::CTransform& xf, const zeus::CTransform& invXf, const zeus::CTransform& camXf, float fxDensity,
EEnvFxType fxType, const CEnvFxManager& parent) const; EEnvFxType fxType, const CEnvFxManager& parent) const;