Files
fs2open.github.com/code/particle/effects/SingleParticleEffect.h
asarium 422753976f Add support for "Effects per second" feature
This allows specifying how many times per second an effect should be
triggered for a particle source instead of triggering the effect every
frame. This will allow modders to achieve more consistent particle
effects regardless of FPS.
2019-01-19 13:56:45 +01:00

44 lines
1.0 KiB
C++

#ifndef SINGLE_PARTICLE_EFFECT_H
#define SINGLE_PARTICLE_EFFECT_H
#pragma once
#include "globalincs/pstypes.h"
#include "particle/ParticleEffect.h"
#include "particle/ParticleManager.h"
#include "particle/util/ParticleProperties.h"
#include "particle/util/EffectTiming.h"
namespace particle {
namespace effects {
/**
* @ingroup particleEffects
*/
class SingleParticleEffect: public ParticleEffect {
private:
util::ParticleProperties m_particleProperties;
util::EffectTiming m_timing;
public:
explicit SingleParticleEffect(const SCP_string& name);
bool processSource(ParticleSource* source) override;
void parseValues(bool nocreate) override;
void pageIn() override;
void initializeSource(ParticleSource& source) override;
EffectType getType() const override { return EffectType::Single; }
util::ParticleProperties& getProperties() { return m_particleProperties; }
static SingleParticleEffect* createInstance(int effectID, float minSize, float maxSize,
float lifetime = -1.0f);
};
}
}
#endif // SINGLE_PARTICLE_EFFECT_H