Closed moly closed 11 years ago
This was marked under the "Future release" milestone, but considering how it doesn't break any existing code, assuming this fix works as expected (I haven't tested it), shall we include it for "v2.56"?
Since it's an optimization, I think we should wait for the "Future release" milestone.
My mistake, the pull request was marked for Flixel v2.56, while I noticed now the issue was marked Future release. It doesn't break any existing code, so unless anyone feels differently, I'll let it slide and just keep the commit (luckily commits are really easy to undo).
Merged in c2fc664abcba114563e2573266c794451773ed5d
In the FlxCamera::fill function, it's possible to skip a call to
copyPixels
if the fill colour is fully opaque orBlendAlpha
is false:I ran a very basic test to confirm this is actually faster:
The stage size was set to 800x600.
Original flixel: 23741 My fix: 9206
As you can see, the function is now more than twice as quick when using solid fills. I would note that
fill()
is typically only called once per camera per frame, so the effect in most games will possibly not be very noticeable.