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;
|
||||
destructionAction = DestructionAction::None;
|
||||
destructionTime = 0.0f;
|
||||
destructionSet = false;
|
||||
trail = false;
|
||||
flippable = true;
|
||||
flip = false;
|
||||
@ -224,6 +225,7 @@ void Particle::destructionUpdate() {
|
||||
} else if (destructionAction == DestructionAction::Fade) {
|
||||
color.setAlphaF(destructionFactor);
|
||||
} else if (destructionAction == DestructionAction::Image) {
|
||||
if (!destructionSet) {
|
||||
size = 1.0f;
|
||||
color = Color::White;
|
||||
type = Particle::Type::Textured;
|
||||
@ -231,6 +233,8 @@ void Particle::destructionUpdate() {
|
||||
angularVelocity = 0.0f;
|
||||
length = 0.0f;
|
||||
rotation = 0.0f;
|
||||
destructionSet = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -100,6 +100,7 @@ struct Particle {
|
||||
DestructionAction destructionAction;
|
||||
AssetPath destructionImage;
|
||||
float destructionTime;
|
||||
bool destructionSet;
|
||||
|
||||
float timeToLive;
|
||||
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) {
|
||||
Drawable drawable;
|
||||
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
|
||||
drawable = particle.animation->drawable(1.0f / TilePixels);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user