Break load costume into more functions, and update how bitmaps are loaded

This commit is contained in:
DD Liu 2018-07-10 10:21:21 -04:00
parent e156b0536c
commit 6aefd13af6
3 changed files with 114 additions and 65 deletions
src/engine

View file

@ -995,6 +995,15 @@ class Runtime extends EventEmitter {
this.v2SvgAdapter = svgAdapter;
}
/**
* Set the bitmap adapter for the VM/runtime, which converts scratch 2
* bitmaps to scratch 3 bitmaps. (Scratch 3 bitmaps are all bitmap resolution 2)
* @param {!function} bitmapAdapter The adapter to attach
*/
attachV2BitmapAdapter (bitmapAdapter) {
this.v2BitmapAdapter = bitmapAdapter;
}
/**
* Attach the storage module
* @param {!ScratchStorage} storage The storage module to attach