-------------------------------------------------------------------------------------- Description: Per-frame update method for all created Tr2ParticleSystem objects. Calls Update method of each system asyncronously. Arguments: arguments - Child emitter update arguments --------------------------------------------------------------------------------------
| 842 | // arguments - Child emitter update arguments |
| 843 | // -------------------------------------------------------------------------------------- |
| 844 | void Tr2ParticleSystem::UpdateAllSystems( const ITr2GenericEmitter::UpdateArguments& arguments ) |
| 845 | { |
| 846 | CCP_STATS_ZONE( __FUNCTION__ ); |
| 847 | |
| 848 | static Be::Time previousUpdateTime = -1; |
| 849 | |
| 850 | s_aliveParticleCount = 0; |
| 851 | s_updatedParticleCount = 0; |
| 852 | |
| 853 | if( previousUpdateTime != -1 && previousUpdateTime == arguments.time ) |
| 854 | { |
| 855 | return; |
| 856 | } |
| 857 | |
| 858 | std::set<Tr2ParticleSystem*>& allSystems = GetAllSystems(); |
| 859 | |
| 860 | Tr2ParallelDo( allSystems.begin(), |
| 861 | allSystems.end(), |
| 862 | [=]( Tr2ParticleSystem* system ) { system->Update( arguments ); } ); |
| 863 | |
| 864 | CCP_STATS_SET( statAliveParticleCount, s_aliveParticleCount ); |
| 865 | CCP_STATS_SET( statUpdatedParticleCount, s_updatedParticleCount ); |
| 866 | } |
| 867 | |
| 868 | // -------------------------------------------------------------------------------------- |
| 869 | // Description: |