Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
ParticleSystemManager Class Referenceabstract

#include <ParticleSys.h>

Inherits SubsystemInterface, and Snapshot.

Inherited by W3DParticleSystemManager.

Public Types

typedef std::list< ParticleSystem * > ParticleSystemList
 
typedef std::list< ParticleSystem * >::iterator ParticleSystemListIt
 
typedef std::hash_map< AsciiString, ParticleSystemTemplate *, rts::hash< AsciiString >, rts::equal_to< AsciiString > > TemplateMap
 

Public Member Functions

 ParticleSystemManager (void)
 
virtual ~ParticleSystemManager ()
 
virtual void init (void)
 initialize the manager
 
virtual void reset (void)
 reset the manager and all particle systems
 
virtual void update (void)
 update all particle systems
 
virtual Int getOnScreenParticleCount (void)=0
 returns the number of particles on screen
 
virtual void setOnScreenParticleCount (int count)
 
ParticleSystemTemplatefindTemplate (const AsciiString &name) const
 
ParticleSystemTemplatefindParentTemplate (const AsciiString &name, int parentNum) const
 
ParticleSystemTemplatenewTemplate (const AsciiString &name)
 
ParticleSystemcreateParticleSystem (const ParticleSystemTemplate *sysTemplate, Bool createSlaves=TRUE)
 given a template, instantiate a particle system
 
ParticleSystemID createAttachedParticleSystemID (const ParticleSystemTemplate *sysTemplate, Object *attachTo, Bool createSlaves=TRUE)
 given a template, instantiate a particle system attached to the given object, and return its ID
 
ParticleSystemfindParticleSystem (ParticleSystemID id)
 find a particle system given a unique system identifier
 
void destroyParticleSystemByID (ParticleSystemID id)
 destroy the particle system with the given id (if it still exists)
 
TemplateMap::iterator beginParticleSystemTemplate ()
 return iterators to the particle system template
 
TemplateMap::iterator endParticleSystemTemplate ()
 
TemplateMap::const_iterator beginParticleSystemTemplate () const
 
TemplateMap::const_iterator endParticleSystemTemplate () const
 
void destroyAttachedSystems (Object *obj)
 destroy attached systems to object
 
void setLocalPlayerIndex (Int index)
 
void addParticle (Particle *particleToAdd, ParticlePriorityType priority)
 
void removeParticle (Particle *particleToRemove)
 
Int removeOldestParticles (UnsignedInt count, ParticlePriorityType priorityCap)
 
UnsignedInt getParticleCount (void) const
 
UnsignedInt getFieldParticleCount (void) const
 
UnsignedInt getParticleSystemCount (void) const
 
ParticleSystemListgetAllParticleSystems (void)
 
virtual void doParticles (RenderInfoClass &rinfo)=0
 
virtual void queueParticleRender ()=0
 
virtual void preloadAssets (TimeOfDay timeOfDay)
 
void friend_addParticleSystem (ParticleSystem *particleSystemToAdd)
 
void friend_removeParticleSystem (ParticleSystem *particleSystemToRemove)
 
- Public Member Functions inherited from SubsystemInterface
 SubsystemInterface ()
 
virtual ~SubsystemInterface ()
 
virtual void postProcessLoad ()
 
virtual void draw (void)
 
void UPDATE (void)
 
void DRAW (void)
 
AsciiString getName (void)
 
void setName (AsciiString name)
 
- Public Member Functions inherited from Snapshot
 Snapshot (void)
 
 ~Snapshot (void)
 

Protected Member Functions

virtual void crc (Xfer *xfer)
 
virtual void xfer (Xfer *xfer)
 
virtual void loadPostProcess (void)
 

Protected Attributes

Particlem_allParticlesHead [NUM_PARTICLE_PRIORITIES]
 
Particlem_allParticlesTail [NUM_PARTICLE_PRIORITIES]
 
ParticleSystemID m_uniqueSystemID
 unique system ID to assign to each system created
 
ParticleSystemList m_allParticleSystemList
 
UnsignedInt m_particleCount
 
UnsignedInt m_fieldParticleCount
 this does not need to be xfered, since it is evaluated every frame
 
UnsignedInt m_particleSystemCount
 
Int m_onScreenParticleCount
 number of particles displayed on screen per frame
 
UnsignedInt m_lastLogicFrameUpdate
 
Int m_localPlayerIndex
 used to tell particle systems which particles can be skipped due to player shroud status
 
- Protected Attributes inherited from SubsystemInterface
AsciiString m_name
 

Detailed Description

The particle system manager, responsible for maintaining all ParticleSystems

Definition at line 713 of file ParticleSys.h.

Member Typedef Documentation

◆ ParticleSystemList

Definition at line 719 of file ParticleSys.h.

◆ ParticleSystemListIt

Definition at line 720 of file ParticleSys.h.

◆ TemplateMap

Constructor & Destructor Documentation

◆ ParticleSystemManager()

ParticleSystemManager::ParticleSystemManager ( void )

Definition at line 2825 of file ParticleSys.cpp.

◆ ~ParticleSystemManager()

ParticleSystemManager::~ParticleSystemManager ( )
virtual

Definition at line 2853 of file ParticleSys.cpp.

Member Function Documentation

◆ addParticle()

void ParticleSystemManager::addParticle ( Particle * particleToAdd,
ParticlePriorityType priority )

Add a particle to the global particle list.

Definition at line 3116 of file ParticleSys.cpp.

◆ beginParticleSystemTemplate() [1/2]

TemplateMap::iterator ParticleSystemManager::beginParticleSystemTemplate ( )
inline

return iterators to the particle system template

Definition at line 756 of file ParticleSys.h.

◆ beginParticleSystemTemplate() [2/2]

TemplateMap::const_iterator ParticleSystemManager::beginParticleSystemTemplate ( ) const
inline

Definition at line 758 of file ParticleSys.h.

◆ crc()

void ParticleSystemManager::crc ( Xfer * xfer)
protectedvirtual

CRC

Implements Snapshot.

Definition at line 3246 of file ParticleSys.cpp.

◆ createAttachedParticleSystemID()

ParticleSystemID ParticleSystemManager::createAttachedParticleSystemID ( const ParticleSystemTemplate * sysTemplate,
Object * attachTo,
Bool createSlaves = TRUE )

given a template, instantiate a particle system attached to the given object, and return its ID

given a template, instantiate a particle system. if attachTo is not null, attach the particle system to the given object. return the particle system's ID, NOT its pointer.

Definition at line 2982 of file ParticleSys.cpp.

◆ createParticleSystem()

ParticleSystem * ParticleSystemManager::createParticleSystem ( const ParticleSystemTemplate * sysTemplate,
Bool createSlaves = TRUE )

given a template, instantiate a particle system

Given a file containing particle system properties, create a new instance of it

Definition at line 2968 of file ParticleSys.cpp.

◆ destroyAttachedSystems()

void ParticleSystemManager::destroyAttachedSystems ( Object * obj)

destroy attached systems to object

Destroy any particle systems that are attached to this object

Definition at line 3087 of file ParticleSys.cpp.

◆ destroyParticleSystemByID()

void ParticleSystemManager::destroyParticleSystemByID ( ParticleSystemID id)

destroy the particle system with the given id (if it still exists)

destroy the particle system with the given id (if it still exists)

Definition at line 3021 of file ParticleSys.cpp.

◆ doParticles()

virtual void ParticleSystemManager::doParticles ( RenderInfoClass & rinfo)
pure virtual

Implemented in W3DParticleSystemManager.

◆ endParticleSystemTemplate() [1/2]

TemplateMap::iterator ParticleSystemManager::endParticleSystemTemplate ( )
inline

Definition at line 757 of file ParticleSys.h.

◆ endParticleSystemTemplate() [2/2]

TemplateMap::const_iterator ParticleSystemManager::endParticleSystemTemplate ( ) const
inline

Definition at line 759 of file ParticleSys.h.

◆ findParentTemplate()

ParticleSystemTemplate * ParticleSystemManager::findParentTemplate ( const AsciiString & name,
int parentNum ) const

Find a particle system's parent. Should really only be called by TheScriptEngine

Definition at line 3064 of file ParticleSys.cpp.

◆ findParticleSystem()

ParticleSystem * ParticleSystemManager::findParticleSystem ( ParticleSystemID id)

find a particle system given a unique system identifier

Find a particle system with the matching system id

Definition at line 2996 of file ParticleSys.cpp.

◆ findTemplate()

ParticleSystemTemplate * ParticleSystemManager::findTemplate ( const AsciiString & name) const

Locate an existing ParticleSystemTemplate

Definition at line 3031 of file ParticleSys.cpp.

◆ friend_addParticleSystem()

void ParticleSystemManager::friend_addParticleSystem ( ParticleSystem * particleSystemToAdd)

Add a particle system to the master particle system list.

Definition at line 3178 of file ParticleSys.cpp.

◆ friend_removeParticleSystem()

void ParticleSystemManager::friend_removeParticleSystem ( ParticleSystem * particleSystemToRemove)

Remove a particle system from the master particle system list.

Definition at line 3187 of file ParticleSys.cpp.

◆ getAllParticleSystems()

ParticleSystemList & ParticleSystemManager::getAllParticleSystems ( void )
inline

Definition at line 775 of file ParticleSys.h.

◆ getFieldParticleCount()

UnsignedInt ParticleSystemManager::getFieldParticleCount ( void ) const
inline

Definition at line 770 of file ParticleSys.h.

◆ getOnScreenParticleCount()

virtual Int ParticleSystemManager::getOnScreenParticleCount ( void )
pure virtual

returns the number of particles on screen

Implemented in W3DParticleSystemManager.

◆ getParticleCount()

UnsignedInt ParticleSystemManager::getParticleCount ( void ) const
inline

Definition at line 768 of file ParticleSys.h.

◆ getParticleSystemCount()

UnsignedInt ParticleSystemManager::getParticleSystemCount ( void ) const
inline

Definition at line 772 of file ParticleSys.h.

◆ init()

void ParticleSystemManager::init ( void )
virtual

initialize the manager

Initialize the manager

Read INI data and build templates

Implements SubsystemInterface.

Definition at line 2867 of file ParticleSys.cpp.

◆ loadPostProcess()

void ParticleSystemManager::loadPostProcess ( void )
protectedvirtual

Load post process

Implements Snapshot.

Definition at line 3352 of file ParticleSys.cpp.

◆ newTemplate()

ParticleSystemTemplate * ParticleSystemManager::newTemplate ( const AsciiString & name)

Create a new ParticleSystemTemplate

Definition at line 3046 of file ParticleSys.cpp.

◆ preloadAssets()

void ParticleSystemManager::preloadAssets ( TimeOfDay timeOfDay)
virtual

Preload particle system textures

Definition at line 3228 of file ParticleSys.cpp.

◆ queueParticleRender()

virtual void ParticleSystemManager::queueParticleRender ( )
pure virtual

Implemented in W3DParticleSystemManager.

◆ removeOldestParticles()

Int ParticleSystemManager::removeOldestParticles ( UnsignedInt count,
ParticlePriorityType priorityCap )

Remove the oldest N number of particles from the lowest priority lists first. We will not remove particles from any priorities higher or equal to the priorityCap parameter.

Definition at line 3201 of file ParticleSys.cpp.

◆ removeParticle()

void ParticleSystemManager::removeParticle ( Particle * particleToRemove)

Remove a particle from the global particle list.

Definition at line 3148 of file ParticleSys.cpp.

◆ reset()

void ParticleSystemManager::reset ( void )
virtual

reset the manager and all particle systems

Reset the manager and all particle systems

Implements SubsystemInterface.

Definition at line 2892 of file ParticleSys.cpp.

◆ setLocalPlayerIndex()

void ParticleSystemManager::setLocalPlayerIndex ( Int index)
inline

Definition at line 764 of file ParticleSys.h.

◆ setOnScreenParticleCount()

void ParticleSystemManager::setOnScreenParticleCount ( int count)
virtual

sets the count of the particles on screen after each frame

Definition at line 2960 of file ParticleSys.cpp.

◆ update()

void ParticleSystemManager::update ( void )
virtual

update all particle systems

Update all particle systems

Implements SubsystemInterface.

Definition at line 2928 of file ParticleSys.cpp.

◆ xfer()

void ParticleSystemManager::xfer ( Xfer * xfer)
protectedvirtual

Xfer method Version Info: 1: Initial version

Implements Snapshot.

Definition at line 3256 of file ParticleSys.cpp.

Member Data Documentation

◆ m_allParticlesHead

Particle* ParticleSystemManager::m_allParticlesHead[NUM_PARTICLE_PRIORITIES]
protected

Definition at line 793 of file ParticleSys.h.

◆ m_allParticlesTail

Particle* ParticleSystemManager::m_allParticlesTail[NUM_PARTICLE_PRIORITIES]
protected

Definition at line 794 of file ParticleSys.h.

◆ m_allParticleSystemList

ParticleSystemList ParticleSystemManager::m_allParticleSystemList
protected

Definition at line 798 of file ParticleSys.h.

◆ m_fieldParticleCount

UnsignedInt ParticleSystemManager::m_fieldParticleCount
protected

this does not need to be xfered, since it is evaluated every frame

Definition at line 801 of file ParticleSys.h.

◆ m_lastLogicFrameUpdate

UnsignedInt ParticleSystemManager::m_lastLogicFrameUpdate
protected

Definition at line 804 of file ParticleSys.h.

◆ m_localPlayerIndex

Int ParticleSystemManager::m_localPlayerIndex
protected

used to tell particle systems which particles can be skipped due to player shroud status

Definition at line 805 of file ParticleSys.h.

◆ m_onScreenParticleCount

Int ParticleSystemManager::m_onScreenParticleCount
protected

number of particles displayed on screen per frame

Definition at line 803 of file ParticleSys.h.

◆ m_particleCount

UnsignedInt ParticleSystemManager::m_particleCount
protected

Definition at line 800 of file ParticleSys.h.

◆ m_particleSystemCount

UnsignedInt ParticleSystemManager::m_particleSystemCount
protected

Definition at line 802 of file ParticleSys.h.

◆ m_uniqueSystemID

ParticleSystemID ParticleSystemManager::m_uniqueSystemID
protected

unique system ID to assign to each system created

Definition at line 796 of file ParticleSys.h.


The documentation for this class was generated from the following files: