mirror of https://github.com/AxioDL/metaforce.git
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:
parent
dd76e73e11
commit
d9a9e0f51e
|
@ -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(),
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue