Skip to content
Open
17 changes: 9 additions & 8 deletions Core/GameEngine/Include/GameClient/ParticleSys.h
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ class ParticleSystemTemplate : public MemoryPoolObject, protected ParticleSystem

void validate();

AsciiString getName() const { return m_name; }
const AsciiString& getName() const { return m_name; }

// This function was made const because of update modules' module data being all const.
ParticleSystem *createSlaveSystem( Bool createSlaves = TRUE ) const ; ///< if returns non-null, it is a slave system for use
Expand Down Expand Up @@ -607,15 +607,16 @@ class ParticleSystem : public MemoryPoolObject,
void setInitialDelay( UnsignedInt delay ) { m_delayLeft = delay; }

const AsciiString& getParticleTypeName() const { return m_particleTypeName; } ///< return the name of the particles
const Bool isUsingDrawables() const { return m_particleType == DRAWABLE; }
const Bool isUsingStreak() const { return m_particleType == STREAK; }
const Bool isUsingSmudge() const { return m_particleType == SMUDGE; }
const Bool isUsingVolumeParticles() const { return m_particleType == VOLUME_PARTICLE; }
const UnsignedInt getVolumeParticleDepth() const { return m_volumeParticleDepth; }
Bool isUsingParticles() const { return m_particleType == PARTICLE; }
Bool isUsingDrawables() const { return m_particleType == DRAWABLE; }
Bool isUsingStreak() const { return m_particleType == STREAK; }
Bool isUsingSmudge() const { return m_particleType == SMUDGE; }
Bool isUsingVolumeParticles() const { return m_particleType == VOLUME_PARTICLE; }
UnsignedInt getVolumeParticleDepth() const { return m_volumeParticleDepth; }

Bool shouldBillboard() { return !m_isGroundAligned; }
Bool shouldBillboard() const { return !m_isGroundAligned; }

ParticleShaderType getShaderType() { return m_shaderType; }
ParticleShaderType getShaderType() const { return m_shaderType; }

void setSlave( ParticleSystem *slave ); ///< set a slave system for us
ParticleSystem *getSlave() { return m_slaveSystem; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,21 @@ class W3DParticleSystemManager : public ParticleSystemManager
virtual Int getOnScreenParticleCount() override { return m_onScreenParticleCount; }

private:
Bool finishedBatch(const ParticleSystem& system, const RefCountPtr<TextureClass>& texture);
void initializeBatch(const ParticleSystem& system, const RefCountPtr<TextureClass>& texture);
void flushParticleBatch(RenderInfoClass& rinfo, UnsignedInt& pointCount);

enum { MAX_POINTS_PER_GROUP = 512 };

RefCountPtr<TextureClass> m_batchTexture; ///< the texture used as the drawing surface for batched particle draws
PointGroupClass *m_pointGroup; ///< the point group that contains all of the particles
StreakLineClass *m_streakLine; ///< the streak class that contains all of the streaks
ShareBufferClass<Vector3> *m_posBuffer; ///< array of particle positions
ShareBufferClass<Vector4> *m_RGBABuffer; ///< array of particle color and alpha
ShareBufferClass<float> *m_sizeBuffer; ///< array of particle sizes
ShareBufferClass<uint8> *m_angleBuffer; ///< array of particle orientations

ParticleSystemInfo::ParticleShaderType m_batchShaderType;
Bool m_readyToRender; ///< if true, it is OK to render
Bool m_batchBillboard;
};
Loading
Loading