diff --git a/examples/particle-system/effects/image-effect-source.cpp b/examples/particle-system/effects/image-effect-source.cpp index 2e52a1e..52d558a 100644 --- a/examples/particle-system/effects/image-effect-source.cpp +++ b/examples/particle-system/effects/image-effect-source.cpp @@ -84,8 +84,8 @@ uint32_t ImageExplodeEffectSource::Update(ParticleList& particleList, uint32_t c float particleScale = 4.0f; float pixelSize = 2.0f; - uint32_t halfWidth = (mImageWidth/2) * particleScale; - uint32_t halfHeight = (mImageHeight/2) * particleScale; + auto halfWidth = (float(mImageWidth)*0.5f) * particleScale; + auto halfHeight = (float(mImageHeight)*0.5f) * particleScale; for(auto y = 0u ; y < mImageHeight; ++y) { @@ -103,7 +103,7 @@ uint32_t ImageExplodeEffectSource::Update(ParticleList& particleList, uint32_t c auto& scale = particle.Get(ParticleStream::SCALE_STREAM_BIT); color = GetColorAt(x, y, mPixelBuffer); // Set basePosition - position = basePosition = Vector3(x* particleScale -halfWidth, y* particleScale -halfHeight, 0); + position = basePosition = Vector3(float(x) * particleScale - halfWidth, float(y)* particleScale - halfHeight, 0); scale = Vector3(pixelSize, pixelSize, 1); velocity = Vector3::ZERO; } diff --git a/examples/particle-system/particle-system-example.cpp b/examples/particle-system/particle-system-example.cpp index 7d6a889..cda518d 100644 --- a/examples/particle-system/particle-system-example.cpp +++ b/examples/particle-system/particle-system-example.cpp @@ -100,6 +100,8 @@ public: emitterActor.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER); emitterActor.SetProperty(Actor::Property::POSITION, Vector2(0.0, 0.0f)); emitterActor.SetProperty(Actor::Property::SIZE, Vector2(1.0, 1.0f)); + emitterActor.SetProperty(Actor::Property::UPDATE_AREA_HINT, Vector4(0, 0, window.GetSize().GetWidth(), window.GetSize().GetHeight())); + window.Add(emitterActor); mEmitterActor = emitterActor;