rpgtkoolmv / corescript

http://www.rpgmakerweb.com/products/programs/rpg-maker-mv
MIT License
311 stars 75 forks source link

Bitmap._requestImage discards _reuseImages & dropped Image object #135

Closed felixjones closed 6 years ago

felixjones commented 6 years ago

We can see that lines 966 and 968 initialise this._image to an Image object: https://github.com/rpgtkoolmv/corescript/blob/9524d3b595843e86d0cbd3ee17af8873ab3fd4bf/js/rpg_core/Bitmap.js#L964-L970

However later on this handle is replaced with a new image object on line 975: https://github.com/rpgtkoolmv/corescript/blob/9524d3b595843e86d0cbd3ee17af8873ab3fd4bf/js/rpg_core/Bitmap.js#L974-L978

Is there behaviour that is not obvious here?

This looks like a bug, the result is that the image reuse mechanism isn't being used at all and duplicate image objects are being allocated needlessly. The effects of fixing this should probably be investigated.

krmbn0576 commented 6 years ago

Thanks! It's probably a bug... We'll investigate 🙂

ghost commented 6 years ago

Thanks for point out issue. This must be a bug.