You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is an oversight from Urho3D, Its been there since version 1.4.x, so probably forever. The last two modes, BLEND_SUBTRACT and BLEND_SUBTRACTALPHA are only used when there is a light and the light is negative. Particle2D does not support these functions, so it's just possible crash code. I filled out the two blend function arrays with BLEND_ADD and BLEND_ADDALPHA values, so it will not crash if those enums are programmed, and this models how the enums are used when lights are present.
ParticleEmitter2D does not respond correctly to the duration parameter from pex file, and this too is a Urho3D oversight. The line "if (emissionTime_ >= 0.0f)", the comparison should be ">" instead of ">=", otherwise the particle emits forever, instead of stopping when a duration is set.
When a pex file does not include the duration parameter, it defaults to a looping particle. You can change pex file with a duration parameter to looping, by assigning it to -1.0 To test this in a sample that uses a pex file, add the line "<duration value="3.00"/>" somewhere after the <particleEmitterConfig> tag. and that particle will only emit for 3 seconds.
In ParticleEffect2D line 187, access is made to srcBlendFuncs and destBlendFuncs using the an index of 0 -> MAX_BLENDMODES.
MAX_BLENDMODES is 9, srcBlendFuncs and destBlendFuncs are arrays with 7 elements.
So potentially array element 8 could be accessed.
It looks like the srcBlendFuncs and destBlendFuncs are missing an entry, however I'm not sure what the value should be, else i'd make a PR.
Code in question:
Sam.
The text was updated successfully, but these errors were encountered: