-
-
Notifications
You must be signed in to change notification settings - Fork 249
Fix Bugs around Particle System in Release/2.10.0 #2935
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…ParticleSystem Refactor memory allocation checks of particle system's attributes like fade-in, scale in, and fix bugs related to setting and updating opacity and scale fade-in. Let current particle count 0 (because all existed particles are removed) during system reset.
All implementation is inside setTotalParticle(). Fix the missing allocation of scale in, opacity fade in, HSV, and animation. Meanwhile, added assertions and for particle limits
|
(I'm not a maintainer)
I believe you should remove them indeed. Explanations for the bug and the fix are welcome in a commit message, comments about the current code's behavior are great in the code. And no need for so may slashes :) |
Got it, I'll erase them away later on because now it's time for me to go to bed. 🛏 |
For all comments written by me, I use neater comments in place of huge comments (`/// BUG from WUCJ638: ... //`).
For all comments written by me, I use neater comments in place of huge comments (`/// BUG from WUCJ638: ... //`).
Summary
This PR fixes several particle system bugs in Axmol 2.10.0, specifically related to:
SpawnFadeIn / SpawnScaleIn:
setTotalParticles(), causing null pointer crashes._spawnFadeInor_spawnScaleInis set to0.0f.Loop Animation crash:
setTotalParticles(),_particleCountwasn’t set to 0, leading to invalid access in_animations.at(_particleData.animIndex[i]).Changes
ParticleSystemQuad::setTotalParticles()if enabled.0.0fto avoid invisible particles._particleCount = 0insetTotalParticles()andresetSystem()to prevent stale animation indices.Testing
Verified on Windows 10 with Visual Studio 2026 (MSVC 19.50).
ParticleTest from 42 to 55 pass without crash; emission shape unaffected, by simply adding
at the end of
onEnter()HSV & advanced animations not fully tested (because I haven't used them in my projects).