Whenever FlxSprite functions (makeGraphic(), loadGraphic(), set_pixels()) are called for the first time, the input/created bitmapdata is always duplicated. One gets stored in frames[0], and another is created by framePixels = frame.paint(framePixels, ...) where parameter framePixels is null. This is fine if I have multiple frames, but for a static background image, I only need one copy of the image. This is a problem when I have 64 bg images that take up 36 MB alone, duplicating takes up 72 MB for no reason.
Is there any way to skip set_frames()/getFlxFrameBitmapData() while keeping FLX_RENDER_TILE enabled? Or would this require a new class?
Whenever
FlxSprite
functions (makeGraphic()
,loadGraphic()
,set_pixels()
) are called for the first time, the input/created bitmapdata is always duplicated. One gets stored inframes[0]
, and another is created byframePixels = frame.paint(framePixels, ...)
where parameterframePixels
is null. This is fine if I have multiple frames, but for a static background image, I only need one copy of the image. This is a problem when I have 64 bg images that take up 36 MB alone, duplicating takes up 72 MB for no reason.Is there any way to skip
set_frames()
/getFlxFrameBitmapData()
while keepingFLX_RENDER_TILE
enabled? Or would this require a new class?