Issue withe Tilesheet and the bitmap it uses

Hi everybody.

Is there a known issue with tilesheets not accessing the correct bitmapData?
I generate tileSheets at runtime from SVGs, for some small animations that I want pixel perfect.
I have a few of them and they work fine, but for some tilesheets I generated in a loop, and store in a map, the latest bitmapData I generated is used even for the tilesheets created previously. It is a different bitmapData object every time, I tried different refactoring, nothing works.
It works perfectly in flash, but not when targeting native.


Do you have a way to reproduce that someone could look at? Thank you!

I’m working on it.
It’s a bit complicated.

I actually figured out that the problems comes from the bitmapdata themselves, and some bugs related to copyChannel or copyPixels.

Ok , finally, here is a simplified version of my issue.

First test on flash, you get the normal behavior.
Then test on native ( windows / neko ) and you should see 3 times the same icon.

Comment the line 187 to see that copyChannel seems to be the issue.

Thanks, I’ll take a look. I wonder if it is copyChannel or draw :confused:

draw seems fine with me.

A little precision:
I use this method multiple time in my project ( to draw the outline, and a color swapable background for the icons ), called in the same frame, and i have no issues with them.
It just seams like a memory issue shared only by the BitmapData instances in a same class.
Maybe something to do with the fact it is stored in a static variable?

Great news!

In the GIT builds, your copyChannel sample is working now. It was a GL texture reference that needed to be nulled out so it would be properly recreated

Nice, thanks, great support. :fonzie:
I’m not at the office, I’ll try first thing tomorrow.