mirror of
https://github.com/glest/glest-source.git
synced 2025-08-27 01:44:23 +02:00
- unit particles now support minHp / mapHp tags
This commit is contained in:
@@ -58,6 +58,7 @@ public:
|
||||
|
||||
public:
|
||||
Particle() {
|
||||
speedUpRelative = 0;
|
||||
size = 0;
|
||||
energy = 0;
|
||||
}
|
||||
@@ -93,6 +94,20 @@ public:
|
||||
virtual void logParticleInfo(string info)= 0;
|
||||
};
|
||||
|
||||
|
||||
class ParticleSystemTypeInterface {
|
||||
public:
|
||||
|
||||
ParticleSystemTypeInterface() {};
|
||||
virtual ~ParticleSystemTypeInterface() {};
|
||||
|
||||
virtual bool getMinmaxEnabled() const = 0;
|
||||
virtual int getMinHp() const = 0;
|
||||
virtual int getMaxHp() const = 0;
|
||||
virtual bool getMinmaxIsPercent() const = 0;
|
||||
|
||||
};
|
||||
|
||||
// =====================================================
|
||||
// class ParticleSystem
|
||||
// =====================================================
|
||||
@@ -344,12 +359,15 @@ private:
|
||||
float startTime;
|
||||
float endTime;
|
||||
|
||||
ParticleSystemTypeInterface *particleSystemType;
|
||||
|
||||
public:
|
||||
enum Shape{
|
||||
sLinear, // generated in a sphere, flying in direction
|
||||
sSpherical, // generated in a sphere, flying away from center
|
||||
sConical, // generated in a cone at angle from direction
|
||||
};
|
||||
|
||||
bool relative;
|
||||
bool relativeDirection;
|
||||
bool fixed;
|
||||
@@ -376,6 +394,13 @@ public:
|
||||
|
||||
virtual ParticleSystemType getParticleSystemType() const { return pst_UnitParticleSystem;}
|
||||
|
||||
ParticleSystemTypeInterface * getParticleType() const {
|
||||
return particleSystemType;
|
||||
}
|
||||
void setParticleType(ParticleSystemTypeInterface *type) {
|
||||
particleSystemType = type;
|
||||
}
|
||||
|
||||
//virtual
|
||||
virtual void initParticle(Particle *p, int particleIndex);
|
||||
virtual void updateParticle(Particle *p);
|
||||
|
@@ -1009,6 +1009,8 @@ Vec3f UnitParticleSystem::lightColor=Vec3f(1.0f,1.0f,1.0f);
|
||||
|
||||
UnitParticleSystem::UnitParticleSystem(int particleCount) :
|
||||
GameParticleSystem(particleCount), parent(NULL) {
|
||||
|
||||
particleSystemType = NULL;
|
||||
radius= 0.5f;
|
||||
speed= 0.01f;
|
||||
windSpeed= Vec3f(0.0f);
|
||||
|
Reference in New Issue
Block a user