- try bugfix for titi's verticle rotation
- added deep copy for child particles
This commit is contained in:
parent
94e0fca857
commit
5400126332
|
@ -52,6 +52,25 @@ ParticleSystemType::ParticleSystemType() {
|
||||||
minmaxIsPercent=false;
|
minmaxIsPercent=false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ParticleSystemType::ParticleSystemType(const ParticleSystemType &src) {
|
||||||
|
if(checkMemory) {
|
||||||
|
printf("++ Create ParticleSystemType #2 [%p]\n",this);
|
||||||
|
memoryObjectList[this]++;
|
||||||
|
}
|
||||||
|
|
||||||
|
copyAll(src);
|
||||||
|
}
|
||||||
|
|
||||||
|
ParticleSystemType & ParticleSystemType::operator=(const ParticleSystemType &src) {
|
||||||
|
if(checkMemory) {
|
||||||
|
printf("++ Create ParticleSystemType #3 [%p]\n",this);
|
||||||
|
memoryObjectList[this]++;
|
||||||
|
}
|
||||||
|
|
||||||
|
copyAll(src);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
ParticleSystemType::~ParticleSystemType() {
|
ParticleSystemType::~ParticleSystemType() {
|
||||||
if(checkMemory) {
|
if(checkMemory) {
|
||||||
printf("-- Delete ParticleSystemType [%p] type = [%s]\n",this,type.c_str());
|
printf("-- Delete ParticleSystemType [%p] type = [%s]\n",this,type.c_str());
|
||||||
|
@ -62,6 +81,41 @@ ParticleSystemType::~ParticleSystemType() {
|
||||||
delete *it;
|
delete *it;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ParticleSystemType::copyAll(const ParticleSystemType &src) {
|
||||||
|
this->type = src.type;
|
||||||
|
this->texture = src.texture;
|
||||||
|
this->model = src.model;
|
||||||
|
this->modelCycle = src.modelCycle;
|
||||||
|
this->primitive = src.primitive;
|
||||||
|
this->offset = src.offset;
|
||||||
|
this->color = src.color;
|
||||||
|
this->colorNoEnergy = src.colorNoEnergy;
|
||||||
|
this->size = src.size;
|
||||||
|
this->sizeNoEnergy = src.sizeNoEnergy;
|
||||||
|
this->speed = src.speed;
|
||||||
|
this->gravity = src.gravity;
|
||||||
|
this->emissionRate = src.emissionRate;
|
||||||
|
this->energyMax = src.energyMax;
|
||||||
|
this->energyVar = src.energyVar;
|
||||||
|
this->mode = src.mode;
|
||||||
|
this->teamcolorNoEnergy = src.teamcolorNoEnergy;
|
||||||
|
this->teamcolorEnergy = src.teamcolorEnergy;
|
||||||
|
this->alternations = src.alternations;
|
||||||
|
for(Children::iterator it = children.begin(); it != children.end(); it++) {
|
||||||
|
UnitParticleSystemType *child = *it;
|
||||||
|
|
||||||
|
// Deep copy the child particles
|
||||||
|
UnitParticleSystemType *newCopy = new UnitParticleSystemType();
|
||||||
|
*newCopy = *child;
|
||||||
|
children.push_back(newCopy);
|
||||||
|
}
|
||||||
|
|
||||||
|
this->minmaxEnabled = src.minmaxEnabled;
|
||||||
|
this->minHp = src.minHp;
|
||||||
|
this->maxHp = src.maxHp;
|
||||||
|
this->minmaxIsPercent = src.minmaxIsPercent;
|
||||||
|
}
|
||||||
|
|
||||||
void ParticleSystemType::load(const XmlNode *particleSystemNode, const string &dir,
|
void ParticleSystemType::load(const XmlNode *particleSystemNode, const string &dir,
|
||||||
RendererInterface *renderer, std::map<string,vector<pair<string, string> > > &loadedFileList,
|
RendererInterface *renderer, std::map<string,vector<pair<string, string> > > &loadedFileList,
|
||||||
string parentLoader, string techtreePath) {
|
string parentLoader, string techtreePath) {
|
||||||
|
|
|
@ -77,9 +77,15 @@ protected:
|
||||||
int maxHp;
|
int maxHp;
|
||||||
bool minmaxIsPercent;
|
bool minmaxIsPercent;
|
||||||
|
|
||||||
|
void copyAll(const ParticleSystemType &src);
|
||||||
public:
|
public:
|
||||||
ParticleSystemType();
|
|
||||||
|
ParticleSystemType();
|
||||||
virtual ~ParticleSystemType();
|
virtual ~ParticleSystemType();
|
||||||
|
|
||||||
|
ParticleSystemType & operator=(const ParticleSystemType &src);
|
||||||
|
ParticleSystemType(const ParticleSystemType &src);
|
||||||
|
|
||||||
void load(const XmlNode *particleSystemNode, const string &dir,
|
void load(const XmlNode *particleSystemNode, const string &dir,
|
||||||
RendererInterface *renderer, std::map<string,vector<pair<string, string> > > &loadedFileList,
|
RendererInterface *renderer, std::map<string,vector<pair<string, string> > > &loadedFileList,
|
||||||
string parentLoader, string techtreePath);
|
string parentLoader, string techtreePath);
|
||||||
|
|
|
@ -252,10 +252,10 @@ Unit::Unit(int id, UnitPathInterface *unitpath, const Vec2i &pos, const UnitType
|
||||||
usePathfinderExtendedMaxNodes = false;
|
usePathfinderExtendedMaxNodes = false;
|
||||||
this->currentAttackBoostOriginatorEffect.skillType = NULL;
|
this->currentAttackBoostOriginatorEffect.skillType = NULL;
|
||||||
|
|
||||||
float targetRotationZ=.0f;
|
targetRotationZ=.0f;
|
||||||
float targetRotationX=.0f;
|
targetRotationX=.0f;
|
||||||
float rotationZ=.0f;
|
rotationZ=.0f;
|
||||||
float rotationX=.0f;
|
rotationX=.0f;
|
||||||
|
|
||||||
|
|
||||||
RandomGen random;
|
RandomGen random;
|
||||||
|
|
Loading…
Reference in New Issue