fix Particles not being drawn with the new image member
This commit is contained in:
parent
500e81329a
commit
79c5012033
@ -42,6 +42,7 @@ Particle::Particle() {
|
|||||||
length = 0;
|
length = 0;
|
||||||
destructionAction = DestructionAction::None;
|
destructionAction = DestructionAction::None;
|
||||||
destructionTime = 0.0f;
|
destructionTime = 0.0f;
|
||||||
|
destructionSet = false;
|
||||||
trail = false;
|
trail = false;
|
||||||
flippable = true;
|
flippable = true;
|
||||||
flip = false;
|
flip = false;
|
||||||
@ -224,13 +225,16 @@ void Particle::destructionUpdate() {
|
|||||||
} else if (destructionAction == DestructionAction::Fade) {
|
} else if (destructionAction == DestructionAction::Fade) {
|
||||||
color.setAlphaF(destructionFactor);
|
color.setAlphaF(destructionFactor);
|
||||||
} else if (destructionAction == DestructionAction::Image) {
|
} else if (destructionAction == DestructionAction::Image) {
|
||||||
size = 1.0f;
|
if (!destructionSet) {
|
||||||
color = Color::White;
|
size = 1.0f;
|
||||||
type = Particle::Type::Textured;
|
color = Color::White;
|
||||||
image = destructionImage;
|
type = Particle::Type::Textured;
|
||||||
angularVelocity = 0.0f;
|
image = destructionImage;
|
||||||
length = 0.0f;
|
angularVelocity = 0.0f;
|
||||||
rotation = 0.0f;
|
length = 0.0f;
|
||||||
|
rotation = 0.0f;
|
||||||
|
destructionSet = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -100,6 +100,7 @@ struct Particle {
|
|||||||
DestructionAction destructionAction;
|
DestructionAction destructionAction;
|
||||||
AssetPath destructionImage;
|
AssetPath destructionImage;
|
||||||
float destructionTime;
|
float destructionTime;
|
||||||
|
bool destructionSet;
|
||||||
|
|
||||||
float timeToLive;
|
float timeToLive;
|
||||||
Layer layer;
|
Layer layer;
|
||||||
|
@ -182,7 +182,7 @@ void WorldPainter::renderParticles(WorldRenderData& renderData, Particle::Layer
|
|||||||
} else if (particle.type == Particle::Type::Textured || particle.type == Particle::Type::Animated) {
|
} else if (particle.type == Particle::Type::Textured || particle.type == Particle::Type::Animated) {
|
||||||
Drawable drawable;
|
Drawable drawable;
|
||||||
if (particle.type == Particle::Type::Textured)
|
if (particle.type == Particle::Type::Textured)
|
||||||
drawable = Drawable::makeImage(particle.string, 1.0f / TilePixels, true, Vec2F(0, 0));
|
drawable = Drawable::makeImage(particle.image, 1.0f / TilePixels, true, Vec2F(0, 0));
|
||||||
else
|
else
|
||||||
drawable = particle.animation->drawable(1.0f / TilePixels);
|
drawable = particle.animation->drawable(1.0f / TilePixels);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user