I noticed in FFParticleSystem.initInstance that textures that are SubTextures build their frame by referencing SubTexture.clipping multiple times.
var frame:Frame = new Frame(1, 1, st.clipping.x, st.clipping.y, st.clipping.width,
st.clipping.height, st.rotated);
The clipping property on SubTextures must generate the clipping from scratch each time, here it is from Starling 1.8:
public function get clipping():Rectangle
{
var topLeft:Point = new Point();
var bottomRight:Point = new Point();
MatrixUtil.transformCoords(mTransformationMatrix, 0.0, 0.0, topLeft);
MatrixUtil.transformCoords(mTransformationMatrix, 1.0, 1.0, bottomRight);
var clipping:Rectangle = new Rectangle(topLeft.x, topLeft.y,
bottomRight.x - topLeft.x, bottomRight.y - topLeft.y);
RectangleUtil.normalize(clipping);
return clipping;
}
Would it be more performant to call clipping once into a local var and use that var when initializing frame?
I noticed in FFParticleSystem.initInstance that textures that are SubTextures build their frame by referencing SubTexture.clipping multiple times.
The clipping property on SubTextures must generate the clipping from scratch each time, here it is from Starling 1.8:
Would it be more performant to call clipping once into a local var and use that var when initializing frame?