openfl / starling

Known as the "Cross-Platform Game Engine", Starling is a popular Stage3D framework for OpenFL and Haxe
Other
236 stars 68 forks source link

fix for BlendMode.isRegistered function error when calling it early #167

Closed MatseFR closed 1 year ago

MatseFR commented 1 year ago

if you call this when your main Starling class is created or added to stage, it results in an error because sBlendModes is null. Other BlendMode methods check for this and call registerDefaults() if needed so I did the same

joshtynjala commented 1 year ago

I see that AS3 Starling doesn't have this change. Maybe we should get it merged there first?

MatseFR commented 1 year ago

You're right, I didn't think about that. The same problem could easily occur in as3 by creating an FFParticleSystem and starting it right away I think. I'll try to find some time to do that in the next days.