[Windows] Automated build.
[0ad.git] / source / graphics / ParticleManager.h
blob23a622fcf3a1a39b39205f9ba780af897c1c0eb0
1 /* Copyright (C) 2019 Wildfire Games.
2 * This file is part of 0 A.D.
4 * 0 A.D. is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 2 of the License, or
7 * (at your option) any later version.
9 * 0 A.D. is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
18 #ifndef INCLUDED_PARTICLEMANAGER
19 #define INCLUDED_PARTICLEMANAGER
21 #include "graphics/ParticleEmitter.h"
22 #include "graphics/ParticleEmitterType.h"
24 #include <boost/random/mersenne_twister.hpp>
25 #include <list>
26 #include <unordered_map>
28 class SceneCollector;
30 class CParticleManager
32 public:
33 CParticleManager();
34 ~CParticleManager();
36 CParticleEmitterTypePtr LoadEmitterType(const VfsPath& path);
38 /**
39 * Tell the manager to handle rendering of an emitter that is no longer
40 * attached to a unit.
42 void AddUnattachedEmitter(const CParticleEmitterPtr& emitter);
44 /**
45 * Delete unattached emitters if we don't wish to see them anymore (like in actor viewer)
47 void ClearUnattachedEmitters();
49 void RenderSubmit(SceneCollector& collector, const CFrustum& frustum);
51 void Interpolate(const float simFrameLength);
53 float GetCurrentTime() const { return m_CurrentTime; }
55 Status ReloadChangedFile(const VfsPath& path);
57 /// Random number generator shared between all particle emitters.
58 boost::mt19937 m_RNG;
60 private:
61 float m_CurrentTime;
63 std::list<CParticleEmitterPtr> m_UnattachedEmitters;
65 std::unordered_map<VfsPath, CParticleEmitterTypePtr> m_EmitterTypes;
68 #endif // INCLUDED_PARTICLEMANAGER