import TileSet from "../components/TileSet" ; export function loadAsset ( player , entry , callback ) { player . getAssetData ( `assets/${ entry . storagePath }/tileset.json` , "json" , ( err , data ) => { const img = new Image ( ) ; img . onload = ( ) => { data . texture = new SupEngine . THREE . Texture ( img ) ; data . texture . needsUpdate = true ; data . texture . magFilter = SupEngine . THREE . NearestFilter ; data . texture . minFilter = SupEngine . THREE . NearestFilter ; callback ( null , new TileSet ( data ) ) ; } ; img . onerror = ( ) => { callback ( null , new TileSet ( data ) ) ; } ; img . src = `${ player . dataURL }assets/${ entry . storagePath }/image.dat` ; } ) ; } export function createOuterAsset ( player , asset ) { return new ( < any > window ) . Sup . TileSet ( asset ) ; }