()
| 1759 | ); |
| 1760 | |
| 1761 | const loadTileMap = () => { |
| 1762 | /** @type {TileMapHelper.TileMapManager} */ |
| 1763 | const manager = TilemapHelper.TileMapManager.getManager( |
| 1764 | this._project |
| 1765 | ); |
| 1766 | manager.getOrLoadTileMap( |
| 1767 | this._loadTileMapWithCallback.bind(this), |
| 1768 | tilemapJsonFile, |
| 1769 | tilesetJsonFile, |
| 1770 | levelIndex, |
| 1771 | pako, |
| 1772 | (tileMap) => { |
| 1773 | if (this._wasDestroyed) return; |
| 1774 | if (!tileMap) { |
| 1775 | this._onLoadingError(); |
| 1776 | // _loadTileMapWithCallback already log errors |
| 1777 | return; |
| 1778 | } |
| 1779 | |
| 1780 | this._editableTileMap = tileMap; |
| 1781 | |
| 1782 | /** @type {TileMapHelper.TileTextureCache} */ |
| 1783 | manager.getOrLoadTextureCache( |
| 1784 | this._loadTileMapWithCallback.bind(this), |
| 1785 | (textureName) => |
| 1786 | this._pixiResourcesLoader.getPIXITexture( |
| 1787 | this._project, |
| 1788 | mapping[textureName] || textureName |
| 1789 | ), |
| 1790 | tilemapAtlasImage, |
| 1791 | tilemapJsonFile, |
| 1792 | tilesetJsonFile, |
| 1793 | levelIndex, |
| 1794 | (textureCache) => { |
| 1795 | if (this._wasDestroyed) return; |
| 1796 | if (!textureCache) { |
| 1797 | this._onLoadingError(); |
| 1798 | // getOrLoadTextureCache already log warns and errors. |
| 1799 | return; |
| 1800 | } |
| 1801 | this._onLoadingSuccess(); |
| 1802 | if (!this._editableTileMap) return; |
| 1803 | |
| 1804 | this.width = this._editableTileMap.getWidth(); |
| 1805 | this.height = this._editableTileMap.getHeight(); |
| 1806 | TilemapHelper.PixiTileMapHelper.updatePixiTileMap( |
| 1807 | this.tileMapPixiObject, |
| 1808 | this._editableTileMap, |
| 1809 | textureCache, |
| 1810 | displayMode, |
| 1811 | layerIndex, |
| 1812 | 0, |
| 1813 | this._editableTileMap.getDimensionX(), |
| 1814 | 0, |
| 1815 | this._editableTileMap.getDimensionY() |
| 1816 | ); |
| 1817 | } |
| 1818 | ); |
nothing calls this directly
no test coverage detected