From 56bcb79dcd8152b54196141d1682fdbf715b5fe2 Mon Sep 17 00:00:00 2001 From: Florian Rival Date: Sun, 12 May 2024 19:59:14 +0200 Subject: [PATCH 1/2] Refactor PixiResourcesLoader to remove static methods and type it properly in extensions --- Extensions/JsExtensionTypes.d.ts | 133 +++++++++++++++--- Extensions/TileMap/JsExtension.js | 1 + newIDE/app/src/MainFrame/index.js | 4 +- .../src/ObjectEditor/Editors/Model3DEditor.js | 4 +- .../src/ObjectEditor/Editors/SpineEditor.js | 5 +- .../ObjectsRenderingService.js | 12 +- .../ObjectsRendering/PixiResourcesLoader.js | 56 +++----- .../Renderers/Rendered3DInstance.js | 4 +- .../Renderers/RenderedCustomObjectInstance.js | 4 +- .../Renderers/RenderedIconInstance.js | 2 +- .../Renderers/RenderedInstance.js | 4 +- .../Renderers/RenderedPanelSpriteInstance.js | 6 +- .../RenderedParticleEmitterInstance.js | 2 +- .../Renderers/RenderedSprite3DInstance.js | 2 +- .../Renderers/RenderedSpriteInstance.js | 2 +- .../Renderers/RenderedTextInstance.js | 8 +- .../Renderers/RenderedTiledSpriteInstance.js | 9 +- .../Renderers/RenderedUnknownInstance.js | 2 +- newIDE/app/src/SceneEditor/index.js | 18 +-- 19 files changed, 186 insertions(+), 92 deletions(-) diff --git a/Extensions/JsExtensionTypes.d.ts b/Extensions/JsExtensionTypes.d.ts index 2f499275802d..b1181925cd1e 100644 --- a/Extensions/JsExtensionTypes.d.ts +++ b/Extensions/JsExtensionTypes.d.ts @@ -4,6 +4,107 @@ type GDNamespace = typeof import('../GDevelop.js/types'); // in this file and merge it with the other namespace declarations. declare namespace PIXI {} +/** + * Expose functions to load PIXI textures or fonts, given the names of + * resources and a gd.Project. + */ +declare class PixiResourcesLoader { + burstCache(); + + async reloadResource(project: gd.Project, resourceName: string); + + /** + * Reload the given resources. + */ + async reloadResources( + project: gd.Project, + resourceNames: Array + ): Promise; + + /** + * Return the PIXI texture represented by the given resource. + * If not loaded, it will load it. + */ + getPIXITexture(project: gd.Project, resourceName: string): PIXI.Texture; + + /** + * Return the three.js texture associated to the specified resource name. + * Returns a placeholder texture if not found. + * @param project The project + * @param resourceName The name of the resource + * @returns The requested texture, or a placeholder if not found. + */ + getThreeTexture(project: gd.Project, resourceName: string): THREE.Texture; + + /** + * Return the three.js material associated to the specified resource name. + * @param project The project + * @param resourceName The name of the resource + * @param options Set if the material should be transparent or not. + * @returns The requested material. + */ + getThreeMaterial( + project: gd.Project, + resourceName: string, + { useTransparentTexture }: { useTransparentTexture: boolean } + ): THREE.Material; + + /** + * Return the three.js material associated to the specified resource name. + * @param project The project + * @param resourceName The name of the resource + * @param options + * @returns The requested material. + */ + get3DModel( + project: gd.Project, + resourceName: string + ): Promise; + + /** + * Return the Pixi spine data for the specified resource name. + * @param project The project + * @param spineName The name of the spine json resource + * @returns The requested spine skeleton. + */ + async getSpineData( + project: gd.Project, + spineName: string + ): Promise; + + /** + * Return the PIXI video texture represented by the given resource. + * If not loaded, it will load it. + * @returns The PIXI.Texture to be used. It can be loading, so you + * should listen to PIXI.Texture `update` event, and refresh your object + * if this event is triggered. + */ + getPIXIVideoTexture(project: gd.Project, resourceName: string): PIXI.Texture; + + /** + * Load the given font from its url/filename. + * @returns a Promise that resolves with the font-family to be used + * to render a text with the font. + */ + loadFontFamily(project: gd.Project, resourceName: string): Promise; + + /** + * Get the font family name for the given font resource. + * The font won't be loaded. + * @returns The font-family to be used to render a text with the font. + */ + getFontFamily(project: gd.Project, resourceName: string): string; + + /** + * Get the data from a bitmap font file (fnt/xml) resource in the IDE. + */ + getBitmapFontData(project: gd.Project, resourceName: string): Promise; + + getInvalidPIXITexture(); + + getResourceJsonData(project: gd.Project, resourceName: string); +} + /** * RenderedInstance is the base class used for creating 2D renderers of instances, * which display on the scene editor, using Pixi.js, the instance of an object (see InstancesEditor). @@ -14,17 +115,17 @@ class RenderedInstance { _instance: gd.InitialInstance; _associatedObjectConfiguration: gd.ObjectConfiguration; _pixiContainer: PIXI.Container; - _pixiResourcesLoader: Class; + _pixiResourcesLoader: PixiResourcesLoader; _pixiObject: PIXI.DisplayObject; wasUsed: boolean; constructor( - project: gdProject, - layout: gdLayout, - instance: gdInitialInstance, - associatedObjectConfiguration: gdObjectConfiguration, + project: gd.Project, + layout: gd.Layout, + instance: gd.InitialInstance, + associatedObjectConfiguration: gd.ObjectConfiguration, pixiContainer: PIXI.Container, - pixiResourcesLoader: Class + pixiResourcesLoader: PixiResourcesLoader ); /** @@ -85,25 +186,25 @@ class RenderedInstance { * It can also display 2D artifacts on Pixi 2D plane (3D object shadow projected on the plane for instance). */ class Rendered3DInstance { - _project: gdProject; - _layout: gdLayout; - _instance: gdInitialInstance; - _associatedObjectConfiguration: gdObjectConfiguration; + _project: gd.Project; + _layout: gd.Layout; + _instance: gd.InitialInstance; + _associatedObjectConfiguration: gd.ObjectConfiguration; _pixiContainer: PIXI.Container; _threeGroup: THREE.Group; - _pixiResourcesLoader: Class; + _pixiResourcesLoader: PixiResourcesLoader; _pixiObject: PIXI.DisplayObject; _threeObject: THREE.Object3D | null; wasUsed: boolean; constructor( - project: gdProject, - layout: gdLayout, - instance: gdInitialInstance, - associatedObjectConfiguration: gdObjectConfiguration, + project: gd.Project, + layout: gd.Layout, + instance: gd.InitialInstance, + associatedObjectConfiguration: gd.ObjectConfiguration, pixiContainer: PIXI.Container, threeGroup: THREE.Group, - pixiResourcesLoader: Class + pixiResourcesLoader: PixiResourcesLoader ); /** diff --git a/Extensions/TileMap/JsExtension.js b/Extensions/TileMap/JsExtension.js index 3b21b120771d..b4ac0a217773 100644 --- a/Extensions/TileMap/JsExtension.js +++ b/Extensions/TileMap/JsExtension.js @@ -1290,6 +1290,7 @@ module.exports = { manager.getOrLoadTextureCache( this._loadTileMapWithCallback.bind(this), (textureName) => + // @ts-ignore this._pixiResourcesLoader.getPIXITexture( this._project, mapping[textureName] || textureName diff --git a/newIDE/app/src/MainFrame/index.js b/newIDE/app/src/MainFrame/index.js index 896540b4e8db..59f7adfe2b01 100644 --- a/newIDE/app/src/MainFrame/index.js +++ b/newIDE/app/src/MainFrame/index.js @@ -175,7 +175,7 @@ import useCreateProject from '../Utils/UseCreateProject'; import newNameGenerator from '../Utils/NewNameGenerator'; import { addDefaultLightToAllLayers } from '../ProjectCreation/CreateProject'; import useEditorTabsStateSaving from './EditorTabs/UseEditorTabsStateSaving'; -import PixiResourcesLoader from '../ObjectsRendering/PixiResourcesLoader'; +import { pixiResourcesLoader } from '../ObjectsRendering/PixiResourcesLoader'; import useResourcesWatcher from './ResourcesWatcher'; import { extractGDevelopApiErrorStatusAndCode } from '../Utils/GDevelopServices/Errors'; import useVersionHistory from '../VersionHistory/UseVersionHistory'; @@ -901,7 +901,7 @@ const MainFrame = (props: Props) => { // the URL to a resource with a name in the old project is not re-used // for another resource with the same name in the new project. ResourcesLoader.burstAllUrlsCache(); - PixiResourcesLoader.burstCache(); + pixiResourcesLoader.burstCache(); const state = await setState(state => ({ ...state, diff --git a/newIDE/app/src/ObjectEditor/Editors/Model3DEditor.js b/newIDE/app/src/ObjectEditor/Editors/Model3DEditor.js index 76a7aeff65be..e25680d6edc8 100644 --- a/newIDE/app/src/ObjectEditor/Editors/Model3DEditor.js +++ b/newIDE/app/src/ObjectEditor/Editors/Model3DEditor.js @@ -25,7 +25,7 @@ import { makeDragSourceAndDropTarget } from '../../UI/DragAndDrop/DragSourceAndD import { DragHandleIcon } from '../../UI/DragHandle'; import DropIndicator from '../../UI/SortableVirtualizedItemList/DropIndicator'; import GDevelopThemeContext from '../../UI/Theme/GDevelopThemeContext'; -import PixiResourcesLoader from '../../ObjectsRendering/PixiResourcesLoader'; +import { pixiResourcesLoader } from '../../ObjectsRendering/PixiResourcesLoader'; import useAlertDialog from '../../UI/Alert/useAlertDialog'; import { type GLTF } from 'three/examples/jsm/loaders/GLTFLoader'; import * as SkeletonUtils from 'three/examples/jsm/utils/SkeletonUtils'; @@ -155,7 +155,7 @@ const Model3DEditor = ({ const [gltf, setGltf] = React.useState(null); const loadGltf = React.useCallback( async (modelResourceName: string) => { - const newModel3d = await PixiResourcesLoader.get3DModel( + const newModel3d = await pixiResourcesLoader.get3DModel( project, modelResourceName ); diff --git a/newIDE/app/src/ObjectEditor/Editors/SpineEditor.js b/newIDE/app/src/ObjectEditor/Editors/SpineEditor.js index 7e7f026d9ffe..9cdcbc930791 100644 --- a/newIDE/app/src/ObjectEditor/Editors/SpineEditor.js +++ b/newIDE/app/src/ObjectEditor/Editors/SpineEditor.js @@ -24,7 +24,8 @@ import { makeDragSourceAndDropTarget } from '../../UI/DragAndDrop/DragSourceAndD import { DragHandleIcon } from '../../UI/DragHandle'; import DropIndicator from '../../UI/SortableVirtualizedItemList/DropIndicator'; import GDevelopThemeContext from '../../UI/Theme/GDevelopThemeContext'; -import PixiResourcesLoader, { +import { + pixiResourcesLoader, type SpineDataOrLoadingError, } from '../../ObjectsRendering/PixiResourcesLoader'; import useAlertDialog from '../../UI/Alert/useAlertDialog'; @@ -109,7 +110,7 @@ const SpineEditor = ({ React.useEffect( () => { (async () => { - const spineData = await PixiResourcesLoader.getSpineData( + const spineData = await pixiResourcesLoader.getSpineData( project, spineResourceName ); diff --git a/newIDE/app/src/ObjectsRendering/ObjectsRenderingService.js b/newIDE/app/src/ObjectsRendering/ObjectsRenderingService.js index 8475e21e7785..b9f0607a661a 100644 --- a/newIDE/app/src/ObjectsRendering/ObjectsRenderingService.js +++ b/newIDE/app/src/ObjectsRendering/ObjectsRenderingService.js @@ -10,7 +10,7 @@ import RenderedTextEntryInstance from './Renderers/RenderedTextEntryInstance'; import RenderedParticleEmitterInstance from './Renderers/RenderedParticleEmitterInstance'; import RenderedCustomObjectInstance from './Renderers/RenderedCustomObjectInstance'; import RenderedSprite3DInstance from './Renderers/RenderedSprite3DInstance'; -import PixiResourcesLoader from './PixiResourcesLoader'; +import { pixiResourcesLoader } from './PixiResourcesLoader'; import ResourcesLoader from '../ResourcesLoader'; import RenderedInstance from './Renderers/RenderedInstance'; import Rendered3DInstance from './Renderers/Rendered3DInstance'; @@ -90,7 +90,7 @@ const ObjectsRenderingService = { associatedObjectConfiguration, pixiContainer, threeGroup, - PixiResourcesLoader + pixiResourcesLoader ); } else if (this.renderers.hasOwnProperty(objectType)) return new this.renderers[objectType]( @@ -99,7 +99,7 @@ const ObjectsRenderingService = { instance, associatedObjectConfiguration, pixiContainer, - PixiResourcesLoader + pixiResourcesLoader ); else { if (project.hasEventsBasedObject(objectType)) { @@ -116,7 +116,7 @@ const ObjectsRenderingService = { associatedObjectConfiguration, pixiContainer, threeGroup, - PixiResourcesLoader + pixiResourcesLoader ); } else { return new RenderedCustomObjectInstance( @@ -126,7 +126,7 @@ const ObjectsRenderingService = { associatedObjectConfiguration, pixiContainer, threeGroup, - PixiResourcesLoader + pixiResourcesLoader ); } } @@ -140,7 +140,7 @@ const ObjectsRenderingService = { instance, associatedObjectConfiguration, pixiContainer, - PixiResourcesLoader + pixiResourcesLoader ); } }, diff --git a/newIDE/app/src/ObjectsRendering/PixiResourcesLoader.js b/newIDE/app/src/ObjectsRendering/PixiResourcesLoader.js index e237f84a1212..424f869bf6d0 100644 --- a/newIDE/app/src/ObjectsRendering/PixiResourcesLoader.js +++ b/newIDE/app/src/ObjectsRendering/PixiResourcesLoader.js @@ -234,7 +234,7 @@ const getEmbedderResources = ( * This internally uses ResourcesLoader to get the URL of the resources. */ export default class PixiResourcesLoader { - static burstCache() { + burstCache() { loadedBitmapFonts = {}; loadedFontFamilies = {}; loadedTextures = {}; @@ -245,7 +245,7 @@ export default class PixiResourcesLoader { spineDataPromises = {}; } - static async _reloadEmbedderResources( + async _reloadEmbedderResources( project: gdProject, embeddedResourceName: string, embedderResourceKind: ResourceKind @@ -262,7 +262,7 @@ export default class PixiResourcesLoader { ); } - static async reloadResource(project: gdProject, resourceName: string) { + async reloadResource(project: gdProject, resourceName: string) { const loadedTexture = loadedTextures[resourceName]; if (loadedTexture && loadedTexture.textureCacheIds) { // The property textureCacheIds indicates that the PIXI.Texture object has some @@ -279,7 +279,7 @@ export default class PixiResourcesLoader { await this._reloadEmbedderResources(project, resourceName, 'atlas'); } - await PixiResourcesLoader.loadTextures(project, [resourceName]); + await this.reloadResources(project, [resourceName]); if (loadedOrLoading3DModelPromises[resourceName]) { delete loadedOrLoading3DModelPromises[resourceName]; @@ -333,9 +333,9 @@ export default class PixiResourcesLoader { } } /** - * (Re)load the PIXI texture represented by the given resources. + * Reload the the given resources. */ - static async loadTextures( + async reloadResources( project: gdProject, resourceNames: Array ): Promise { @@ -449,7 +449,7 @@ export default class PixiResourcesLoader { * should listen to PIXI.Texture `update` event, and refresh your object * if this event is triggered. */ - static getPIXITexture(project: gdProject, resourceName: string) { + getPIXITexture(project: gdProject, resourceName: string) { if (loadedTextures[resourceName]) { // TODO: we never consider textures as not valid anymore. When we // update the IDE to unload textures, we should handle loading them again @@ -494,20 +494,14 @@ export default class PixiResourcesLoader { * @param resourceName The name of the resource * @returns The requested texture, or a placeholder if not found. */ - static getThreeTexture( - project: gdProject, - resourceName: string - ): THREE.Texture { + getThreeTexture(project: gdProject, resourceName: string): THREE.Texture { const loadedThreeTexture = loadedThreeTextures[resourceName]; if (loadedThreeTexture) return loadedThreeTexture; // Texture is not loaded, load it now from the PixiJS texture. // TODO (3D) - optimization: don't load the PixiJS Texture if not used by PixiJS. // TODO (3D) - optimization: Ideally we could even share the same WebGL texture. - const pixiTexture = PixiResourcesLoader.getPIXITexture( - project, - resourceName - ); + const pixiTexture = this.getPIXITexture(project, resourceName); // @ts-ignore - source does exist on resource. const image = pixiTexture.baseTexture.resource.source; @@ -540,7 +534,7 @@ export default class PixiResourcesLoader { * @param options Set if the material should be transparent or not. * @returns The requested material. */ - static getThreeMaterial( + getThreeMaterial( project: gdProject, resourceName: string, { useTransparentTexture }: {| useTransparentTexture: boolean |} @@ -566,7 +560,7 @@ export default class PixiResourcesLoader { * @param options * @returns The requested material. */ - static get3DModel( + get3DModel( project: gdProject, resourceName: string ): Promise { @@ -584,7 +578,7 @@ export default class PixiResourcesLoader { * @param spineTextureAtlasName The name of the atlas texture resource. * @returns The requested texture atlas, or null if it could not be loaded. */ - static async _getSpineTextureAtlas( + async _getSpineTextureAtlas( project: gdProject, spineTextureAtlasName: string ): Promise { @@ -707,7 +701,7 @@ export default class PixiResourcesLoader { * @param spineName The name of the spine json resource * @returns The requested spine skeleton. */ - static async getSpineData( + async getSpineData( project: gdProject, spineName: string ): Promise { @@ -811,7 +805,7 @@ export default class PixiResourcesLoader { * should listen to PIXI.Texture `update` event, and refresh your object * if this event is triggered. */ - static getPIXIVideoTexture(project: gdProject, resourceName: string) { + getPIXIVideoTexture(project: gdProject, resourceName: string) { if (loadedTextures[resourceName]) { // TODO: we never consider textures as not valid anymore. When we // update the IDE to unload textures, we should handle loading them again @@ -860,10 +854,7 @@ export default class PixiResourcesLoader { * @returns a Promise that resolves with the font-family to be used * to render a text with the font. */ - static loadFontFamily( - project: gdProject, - resourceName: string - ): Promise { + loadFontFamily(project: gdProject, resourceName: string): Promise { // Avoid reloading a font if it's already cached if (loadedFontFamilies[resourceName]) { return Promise.resolve(loadedFontFamilies[resourceName]); @@ -909,7 +900,7 @@ export default class PixiResourcesLoader { * The font won't be loaded. * @returns The font-family to be used to render a text with the font. */ - static getFontFamily(project: gdProject, resourceName: string) { + getFontFamily(project: gdProject, resourceName: string) { if (loadedFontFamilies[resourceName]) { return loadedFontFamilies[resourceName]; } @@ -921,10 +912,7 @@ export default class PixiResourcesLoader { /** * Get the data from a bitmap font file (fnt/xml) resource in the IDE. */ - static getBitmapFontData( - project: gdProject, - resourceName: string - ): Promise { + getBitmapFontData(project: gdProject, resourceName: string): Promise { if (loadedBitmapFonts[resourceName]) { return Promise.resolve(loadedBitmapFonts[resourceName].data); } @@ -963,17 +951,14 @@ export default class PixiResourcesLoader { }); } - static getInvalidPIXITexture() { + getInvalidPIXITexture() { return invalidTexture; } /** * Get the data from a json resource in the IDE. */ - static getResourceJsonData( - project: gdProject, - resourceName: string - ): Promise { + getResourceJsonData(project: gdProject, resourceName: string): Promise { if (!project.getResourcesManager().hasResource(resourceName)) return Promise.reject( new Error(`Can't find resource called ${resourceName}.`) @@ -999,3 +984,6 @@ export default class PixiResourcesLoader { .then(response => response.data); } } + +/** The global, unique instance of PixiResourcesLoader. */ +export const pixiResourcesLoader = new PixiResourcesLoader(); diff --git a/newIDE/app/src/ObjectsRendering/Renderers/Rendered3DInstance.js b/newIDE/app/src/ObjectsRendering/Renderers/Rendered3DInstance.js index 0f7ef641fb58..7a9b1e01d6d0 100644 --- a/newIDE/app/src/ObjectsRendering/Renderers/Rendered3DInstance.js +++ b/newIDE/app/src/ObjectsRendering/Renderers/Rendered3DInstance.js @@ -15,7 +15,7 @@ export default class Rendered3DInstance { _associatedObjectConfiguration: gdObjectConfiguration; _pixiContainer: PIXI.Container; _threeGroup: THREE.Group; - _pixiResourcesLoader: Class; + _pixiResourcesLoader: PixiResourcesLoader; _pixiObject: PIXI.DisplayObject; _threeObject: THREE.Object3D | null; wasUsed: boolean; @@ -27,7 +27,7 @@ export default class Rendered3DInstance { associatedObjectConfiguration: gdObjectConfiguration, pixiContainer: PIXI.Container, threeGroup: THREE.Group, - pixiResourcesLoader: Class + pixiResourcesLoader: PixiResourcesLoader ) { this._pixiObject = null; this._threeObject = null; diff --git a/newIDE/app/src/ObjectsRendering/Renderers/RenderedCustomObjectInstance.js b/newIDE/app/src/ObjectsRendering/Renderers/RenderedCustomObjectInstance.js index b61c97ee61f1..2190bbd1887a 100644 --- a/newIDE/app/src/ObjectsRendering/Renderers/RenderedCustomObjectInstance.js +++ b/newIDE/app/src/ObjectsRendering/Renderers/RenderedCustomObjectInstance.js @@ -45,7 +45,7 @@ export default class RenderedCustomObjectInstance extends Rendered3DInstance associatedObjectConfiguration: gdObjectConfiguration, pixiContainer: PIXI.Container, threeGroup: THREE.Group, - pixiResourcesLoader: Class + pixiResourcesLoader: PixiResourcesLoader ) { super( project, @@ -175,7 +175,7 @@ export default class RenderedCustomObjectInstance extends Rendered3DInstance if (this.childrenRenderedInstances.length === 0) { // Show a placeholder. this._pixiObject = new PIXI.Sprite( - PixiResourcesLoader.getInvalidPIXITexture() + this._pixiResourcesLoader.getInvalidPIXITexture() ); this._pixiContainer.addChild(this._pixiObject); } diff --git a/newIDE/app/src/ObjectsRendering/Renderers/RenderedIconInstance.js b/newIDE/app/src/ObjectsRendering/Renderers/RenderedIconInstance.js index 2d80dc59e7f5..fcbbdc7b320f 100644 --- a/newIDE/app/src/ObjectsRendering/Renderers/RenderedIconInstance.js +++ b/newIDE/app/src/ObjectsRendering/Renderers/RenderedIconInstance.js @@ -15,7 +15,7 @@ export default function makeRenderer(iconPath: string) { instance: gdInitialInstance, associatedObjectConfiguration: gdObjectConfiguration, pixiContainer: PIXI.Container, - pixiResourcesLoader: Class + pixiResourcesLoader: PixiResourcesLoader ) { super( project, diff --git a/newIDE/app/src/ObjectsRendering/Renderers/RenderedInstance.js b/newIDE/app/src/ObjectsRendering/Renderers/RenderedInstance.js index fb305b5da7a5..a8e874cc03dd 100644 --- a/newIDE/app/src/ObjectsRendering/Renderers/RenderedInstance.js +++ b/newIDE/app/src/ObjectsRendering/Renderers/RenderedInstance.js @@ -12,7 +12,7 @@ export default class RenderedInstance { _instance: gdInitialInstance; _associatedObjectConfiguration: gdObjectConfiguration; _pixiContainer: PIXI.Container; - _pixiResourcesLoader: Class; + _pixiResourcesLoader: PixiResourcesLoader; _pixiObject: PIXI.DisplayObject; wasUsed: boolean; @@ -22,7 +22,7 @@ export default class RenderedInstance { instance: gdInitialInstance, associatedObjectConfiguration: gdObjectConfiguration, pixiContainer: PIXI.Container, - pixiResourcesLoader: Class + pixiResourcesLoader: PixiResourcesLoader ) { this._pixiObject = null; this._instance = instance; diff --git a/newIDE/app/src/ObjectsRendering/Renderers/RenderedPanelSpriteInstance.js b/newIDE/app/src/ObjectsRendering/Renderers/RenderedPanelSpriteInstance.js index 948a5f7b5d57..fe5075501992 100644 --- a/newIDE/app/src/ObjectsRendering/Renderers/RenderedPanelSpriteInstance.js +++ b/newIDE/app/src/ObjectsRendering/Renderers/RenderedPanelSpriteInstance.js @@ -28,7 +28,7 @@ export default class RenderedPanelSpriteInstance extends RenderedInstance { instance: gdInitialInstance, associatedObjectConfiguration: gdObjectConfiguration, pixiContainer: PIXI.Container, - pixiResourcesLoader: Class + pixiResourcesLoader: PixiResourcesLoader ) { super( project, @@ -86,7 +86,7 @@ export default class RenderedPanelSpriteInstance extends RenderedInstance { this._associatedObjectConfiguration ); this._textureName = panelSprite.getTexture(); - const texture = PixiResourcesLoader.getPIXITexture( + const texture = this._pixiResourcesLoader.getPIXITexture( this._project, this._textureName ); @@ -237,7 +237,7 @@ export default class RenderedPanelSpriteInstance extends RenderedInstance { this._associatedObjectConfiguration ); this._textureName = panelSprite.getTexture(); - const texture = PixiResourcesLoader.getPIXITexture( + const texture = this._pixiResourcesLoader.getPIXITexture( this._project, this._textureName ); diff --git a/newIDE/app/src/ObjectsRendering/Renderers/RenderedParticleEmitterInstance.js b/newIDE/app/src/ObjectsRendering/Renderers/RenderedParticleEmitterInstance.js index eaf4054c6750..ee9c318240a5 100644 --- a/newIDE/app/src/ObjectsRendering/Renderers/RenderedParticleEmitterInstance.js +++ b/newIDE/app/src/ObjectsRendering/Renderers/RenderedParticleEmitterInstance.js @@ -16,7 +16,7 @@ export default class RenderedParticleEmitterInstance extends RenderedInstance { instance: gdInitialInstance, associatedObjectConfiguration: gdObjectConfiguration, pixiContainer: PIXI.Container, - pixiResourcesLoader: Class + pixiResourcesLoader: PixiResourcesLoader ) { super( project, diff --git a/newIDE/app/src/ObjectsRendering/Renderers/RenderedSprite3DInstance.js b/newIDE/app/src/ObjectsRendering/Renderers/RenderedSprite3DInstance.js index 9a7a622bbace..b483a01c9b92 100644 --- a/newIDE/app/src/ObjectsRendering/Renderers/RenderedSprite3DInstance.js +++ b/newIDE/app/src/ObjectsRendering/Renderers/RenderedSprite3DInstance.js @@ -29,7 +29,7 @@ export default class RenderedSprite3DInstance extends Rendered3DInstance { associatedObjectConfiguration: gdObjectConfiguration, pixiContainer: PIXI.Container, threeGroup: THREE.Group, - pixiResourcesLoader: Class + pixiResourcesLoader: PixiResourcesLoader ) { super( project, diff --git a/newIDE/app/src/ObjectsRendering/Renderers/RenderedSpriteInstance.js b/newIDE/app/src/ObjectsRendering/Renderers/RenderedSpriteInstance.js index be44092eee12..6eba16ad30e2 100644 --- a/newIDE/app/src/ObjectsRendering/Renderers/RenderedSpriteInstance.js +++ b/newIDE/app/src/ObjectsRendering/Renderers/RenderedSpriteInstance.js @@ -24,7 +24,7 @@ export default class RenderedSpriteInstance extends RenderedInstance { instance: gdInitialInstance, associatedObjectConfiguration: gdObjectConfiguration, pixiContainer: PIXI.Container, - pixiResourcesLoader: Class + pixiResourcesLoader: PixiResourcesLoader ) { super( project, diff --git a/newIDE/app/src/ObjectsRendering/Renderers/RenderedTextInstance.js b/newIDE/app/src/ObjectsRendering/Renderers/RenderedTextInstance.js index 8ecae964239d..f95f2cbdac71 100644 --- a/newIDE/app/src/ObjectsRendering/Renderers/RenderedTextInstance.js +++ b/newIDE/app/src/ObjectsRendering/Renderers/RenderedTextInstance.js @@ -38,7 +38,7 @@ export default class RenderedTextInstance extends RenderedInstance { instance: gdInitialInstance, associatedObjectConfiguration: gdObjectConfiguration, pixiContainer: PIXI.Container, - pixiResourcesLoader: Class + pixiResourcesLoader: PixiResourcesLoader ) { super( project, @@ -133,10 +133,8 @@ export default class RenderedTextInstance extends RenderedInstance { if (this._fontName !== textObjectConfiguration.getFontName()) { //Avoid calling loadFontFamily if the font didn't changed. this._fontName = textObjectConfiguration.getFontName(); - PixiResourcesLoader.loadFontFamily( - this._project, - textObjectConfiguration.getFontName() - ) + this._pixiResourcesLoader + .loadFontFamily(this._project, textObjectConfiguration.getFontName()) .then(fontFamily => { // Once the font is loaded, we can use the given fontFamily. this._fontFamily = fontFamily; diff --git a/newIDE/app/src/ObjectsRendering/Renderers/RenderedTiledSpriteInstance.js b/newIDE/app/src/ObjectsRendering/Renderers/RenderedTiledSpriteInstance.js index 6876d5df3942..321d342e7f56 100644 --- a/newIDE/app/src/ObjectsRendering/Renderers/RenderedTiledSpriteInstance.js +++ b/newIDE/app/src/ObjectsRendering/Renderers/RenderedTiledSpriteInstance.js @@ -17,7 +17,7 @@ export default class RenderedTiledSpriteInstance extends RenderedInstance { instance: gdInitialInstance, associatedObjectConfiguration: gdObjectConfiguration, pixiContainer: PIXI.Container, - pixiResourcesLoader: Class + pixiResourcesLoader: PixiResourcesLoader ) { super( project, @@ -34,7 +34,10 @@ export default class RenderedTiledSpriteInstance extends RenderedInstance { ); this._texture = tiledSprite.getTexture(); this._pixiObject = new PIXI.TilingSprite( - PixiResourcesLoader.getPIXITexture(project, tiledSprite.getTexture()), + this._pixiResourcesLoader.getPIXITexture( + project, + tiledSprite.getTexture() + ), tiledSprite.getWidth(), tiledSprite.getHeight() ); @@ -80,7 +83,7 @@ export default class RenderedTiledSpriteInstance extends RenderedInstance { if (this._texture !== tiledSprite.getTexture()) { this._texture = tiledSprite.getTexture(); - this._pixiObject.texture = PixiResourcesLoader.getPIXITexture( + this._pixiObject.texture = this._pixiResourcesLoader.getPIXITexture( this._project, tiledSprite.getTexture() ); diff --git a/newIDE/app/src/ObjectsRendering/Renderers/RenderedUnknownInstance.js b/newIDE/app/src/ObjectsRendering/Renderers/RenderedUnknownInstance.js index 25ac70ba4002..9aeb3f02e218 100644 --- a/newIDE/app/src/ObjectsRendering/Renderers/RenderedUnknownInstance.js +++ b/newIDE/app/src/ObjectsRendering/Renderers/RenderedUnknownInstance.js @@ -14,7 +14,7 @@ export default class RenderedUnknownInstance extends RenderedInstance { instance: gdInitialInstance, associatedObjectConfiguration: gdObjectConfiguration, pixiContainer: PIXI.Container, - pixiResourcesLoader: Class + pixiResourcesLoader: PixiResourcesLoader ) { super( project, diff --git a/newIDE/app/src/SceneEditor/index.js b/newIDE/app/src/SceneEditor/index.js index 0bdba908bfc8..cde44b181610 100644 --- a/newIDE/app/src/SceneEditor/index.js +++ b/newIDE/app/src/SceneEditor/index.js @@ -38,7 +38,7 @@ import { getHistoryInitialState, saveToHistory, } from '../Utils/History'; -import PixiResourcesLoader from '../ObjectsRendering/PixiResourcesLoader'; +import { pixiResourcesLoader } from '../ObjectsRendering/PixiResourcesLoader'; import { type ObjectWithContext, type GroupWithContext, @@ -236,7 +236,7 @@ export default class SceneEditor extends React.Component { // through the RenderedInstance's, triggering crashes. So the scene rendering // is paused during this period. editorDisplay.startSceneRendering(false); - await PixiResourcesLoader.reloadResource(project, resourceName); + await pixiResourcesLoader.reloadResource(project, resourceName); editorDisplay.forceUpdateObjectsList(); @@ -1610,12 +1610,14 @@ export default class SceneEditor extends React.Component { .toJSArray(); resourcesInUse.delete(); - PixiResourcesLoader.loadTextures(project, objectResourceNames).then(() => { - if (this.editorDisplay) - this.editorDisplay.instancesHandlers.resetInstanceRenderersFor( - object.getName() - ); - }); + pixiResourcesLoader + .reloadResources(project, objectResourceNames) + .then(() => { + if (this.editorDisplay) + this.editorDisplay.instancesHandlers.resetInstanceRenderersFor( + object.getName() + ); + }); }; render() { From ae0f2687a538d873fef296dc2049243eb5706d4c Mon Sep 17 00:00:00 2001 From: Florian Rival Date: Sun, 12 May 2024 20:33:36 +0200 Subject: [PATCH 2/2] Update typing for TileMapHelper --- Extensions/TileMap/TileMapRuntimeManager.ts | 2 +- Extensions/TileMap/helper/TileMapHelper.js | 2 +- .../TileMap/helper/TileMapHelper.js.map | 2 +- .../helper/dts/render/TileMapManager.d.ts | 2 +- .../helper/dts/render/TileMapManager.d.ts.map | 2 +- .../helper/dts/render/TileMapPixiHelper.d.ts | 4 ++-- .../dts/render/TileMapPixiHelper.d.ts.map | 2 +- .../dts/render/ldtk/LDtkPixiHelper.d.ts | 7 ++----- .../dts/render/ldtk/LDtkPixiHelper.d.ts.map | 2 +- .../dts/render/tiled/TiledPixiHelper.d.ts | 4 ++-- .../dts/render/tiled/TiledPixiHelper.d.ts.map | 2 +- Extensions/TileMap/tilemapruntimeobject.ts | 6 +----- .../src/render/TileMapManager.ts | 2 +- .../src/render/TileMapPixiHelper.ts | 4 ++-- .../src/render/ldtk/LDtkPixiHelper.ts | 21 ++++++++----------- .../src/render/tiled/TiledPixiHelper.ts | 6 +++--- 16 files changed, 30 insertions(+), 40 deletions(-) diff --git a/Extensions/TileMap/TileMapRuntimeManager.ts b/Extensions/TileMap/TileMapRuntimeManager.ts index b06411668eef..0e052c70bfdc 100644 --- a/Extensions/TileMap/TileMapRuntimeManager.ts +++ b/Extensions/TileMap/TileMapRuntimeManager.ts @@ -88,7 +88,7 @@ namespace gdjs { * @param callback A function called when the tiles textures are split. */ getOrLoadTextureCache( - getTexture: (textureName: string) => PIXI.BaseTexture, + getTexture: (textureName: string) => PIXI.Texture, atlasImageResourceName: string, tileMapJsonResourceName: string, tileSetJsonResourceName: string, diff --git a/Extensions/TileMap/helper/TileMapHelper.js b/Extensions/TileMap/helper/TileMapHelper.js index 649004896a7e..b942d94da6b1 100644 --- a/Extensions/TileMap/helper/TileMapHelper.js +++ b/Extensions/TileMap/helper/TileMapHelper.js @@ -1,2 +1,2 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).TileMapHelper={})}(this,(function(e){"use strict";const t=2147483648,i=1073741824,l=536870912;var s;function n(e){const t=s.isFlippedDiagonally(e),i=s.isFlippedHorizontally(e),l=s.isFlippedVertically(e);let n=0;return t?(n=10,!i&&l?n=2:i&&!l?n=6:i&&l&&(n=14)):(n=0,!i&&l?n=8:i&&!l?n=12:i&&l&&(n=4)),n}function o(e,s,n,o){let r=e;return s&&(r|=t),n&&(r|=i),o&&(r|=l),r}!function(e){e.tileIdMask=536870911,e.getTileId=function(t){return t&e.tileIdMask},e.setFlippedHorizontally=function(e,i){return e&=2147483647,i&&(e|=t),e},e.setFlippedVertically=function(e,t){return e&=-1073741825,t&&(e|=i),e},e.setFlippedDiagonally=function(e,t){return e&=-536870913,t&&(e|=l),e},e.isFlippedHorizontally=function(e){return 0!=(e&t)},e.isFlippedVertically=function(e){return 0!=(e&i)},e.isFlippedDiagonally=function(e){return 0!=(e&l)}}(s||(s={}));class r{constructor(e,t,i,l,s){this.tileWidth=e,this.tileHeight=t,this.dimX=i,this.dimY=l,this._tileSet=s,this._layers=[]}getWidth(){return this.tileWidth*this.dimX}getHeight(){return this.tileHeight*this.dimY}getTileHeight(){return this.tileHeight}getTileWidth(){return this.tileWidth}getDimensionX(){return this.dimX}getDimensionY(){return this.dimY}getTileDefinition(e){return this._tileSet.get(e)}getTileDefinitions(){return this._tileSet.values()}addTileLayer(e){const t=new h(this,e);return this._layers.push(t),t}addObjectLayer(e){const t=new d(this,e);return this._layers.push(t),t}getBackgroundResourceName(){return this._backgroundResourceName}getLayers(){return this._layers}pointIsInsideTile(e,t,i){const l=Math.floor(e/this.tileWidth),s=Math.floor(t/this.tileHeight);for(const e of this._layers){const t=e;if(!t)continue;const n=t.getTileId(l,s);if(void 0===n)return!1;if(this._tileSet.get(n).hasTaggedHitBox(i))return!0}return!1}setBackgroundResourceName(e){this._backgroundResourceName=e}}class a{constructor(e,t){this.visible=!0,this.tileMap=e,this.id=t}setVisible(e){this.visible=e}isVisible(){return this.visible}}class d extends a{constructor(e,t){super(e,t),this.objects=[]}add(e){this.objects.push(e)}}class c{constructor(e,t,i){this.tileId=i,this.x=e,this.y=t}getTileId(){return s.getTileId(this.tileId)}setFlippedHorizontally(e){this.tileId=s.setFlippedHorizontally(this.tileId,e)}setFlippedVertically(e){this.tileId=s.setFlippedVertically(this.tileId,e)}setFlippedDiagonally(e){this.tileId=s.setFlippedDiagonally(this.tileId,e)}isFlippedHorizontally(){return s.isFlippedHorizontally(this.tileId)}isFlippedVertically(){return s.isFlippedVertically(this.tileId)}isFlippedDiagonally(){return s.isFlippedDiagonally(this.tileId)}}class h extends a{constructor(e,t){super(e,t),this._tiles=[],this._tiles.length=this.tileMap.getDimensionY();for(let e=0;e=l.length||(l[e]=i+1)}removeTile(e,t){const i=this._tiles[t];!i||e>=i.length||(i[e]=0)}setFlippedHorizontally(e,t,i){const l=this._tiles[t];if(!l||e>=l.length)return;const n=l[e];0!==n&&(l[e]=s.setFlippedHorizontally(n,i))}setFlippedVertically(e,t,i){const l=this._tiles[t];if(!l||e>=l.length)return;const n=l[e];0!==n&&(l[e]=s.setFlippedVertically(n,i))}setFlippedDiagonally(e,t,i){const l=this._tiles[t];if(!l||e>=l.length)return;const n=l[e];0!==n&&(l[e]=s.setFlippedDiagonally(n,i))}isFlippedHorizontally(e,t){const i=this._tiles[t];return!(!i||e>=i.length)&&s.isFlippedHorizontally(i[e])}isFlippedVertically(e,t){const i=this._tiles[t];return!(!i||e>=i.length)&&s.isFlippedVertically(i[e])}isFlippedDiagonally(e,t){const i=this._tiles[t];return!(!i||e>=i.length)&&s.isFlippedDiagonally(i[e])}getTileGID(e,t){const i=this._tiles[t];if(i&&!(e>=i.length)&&0!==i[e])return i[e]-1}getTileId(e,t){const i=this._tiles[t];if(!i||e>=i.length||0===i[e])return;return s.getTileId(i[e]-1)}getDimensionX(){return 0===this._tiles.length?0:this._tiles[0].length}getDimensionY(){return this._tiles.length}getWidth(){return this.tileMap.getWidth()}getHeight(){return this.tileMap.getHeight()}}class u{constructor(e){this.taggedHitBoxes=[],this.animationLength=null!=e?e:0,this.stackedTiles=[]}addHitBox(e,t){let i=this.taggedHitBoxes.find((t=>t.tag===e));i||(i={tag:e,polygons:[]},this.taggedHitBoxes.push(i)),i.polygons.push(t)}hasTaggedHitBox(e){return this.taggedHitBoxes.some((t=>t.tag===e))}getHitBoxes(e){const t=this.taggedHitBoxes.find((t=>t.tag===e));return t&&t.polygons}getAnimationLength(){return this.animationLength}getStackTileId(){return this.stackTileId}getStackedTiles(){return this.stackedTiles}hasStackedTiles(){return this.stackedTiles.length>0}setStackedTiles(e,...t){this.stackedTiles=t,this.stackTileId=e}}class p{constructor(){this._cachedValues=new Map,this._callbacks=new Map}getOrLoad(e,t,i){{const t=this._cachedValues.get(e);if(t)return void i(t)}{const t=this._callbacks.get(e);if(t)return void t.push(i);this._callbacks.set(e,[i])}t((t=>{t&&this._cachedValues.set(e,t);const i=this._callbacks.get(e);this._callbacks.delete(e);for(const e of i)e(t)}))}}class g{constructor(){this._levelBackgroundTextures=new Map,this._textures=new Map}setTexture(e,t){this._textures.set(e,t)}getTexture(e){return this._textures.get(e)}getLevelBackgroundTexture(e){return this._levelBackgroundTextures.get(e)}setLevelBackgroundTexture(e,t){this._levelBackgroundTextures.set(e,t)}}const f=(e,t)=>{const{data:i,compression:l}=t;if(!i)return i;let s=4;const n=[];let o=atob(i).split("").map((function(e){return e.charCodeAt(0)}));try{const t=(e,t)=>e[t]+(e[t+1]<<8)+(e[t+2]<<16)+(e[t+3]<<24)>>>0;if("zlib"===l){const i=new Uint8Array(o),l=e.inflate(i);for(;s<=l.length;)n.push(t(l,s-4)),s+=4}else{if("zstd"===l)return console.error("Zstandard compression is not supported for layers in a Tilemap. Use instead zlib compression or no compression."),null;for(;s<=o.length;)n.push(t(o,s-4)),s+=4}return n}catch(e){return console.error("Failed to decompress and unzip base64 layer.data string",e),null}},y=e=>{const s=e&t,n=e&i,o=e&l;return{id:T(536870911&e),flippedHorizontally:!!s,flippedVertically:!!n,flippedDiagonally:!!o}};function T(e){return 0===e?void 0:e-1}var _,x,k,I,m,w;function b(e,t){let i=e<<16;return i+=t,i}function M(e,t,i,l){var s;if(e[l])return e[l];let n=null;const o=t[l];return(null==o?void 0:o.relPath)?(n=i(o.relPath),"res/error48.png"===(null===(s=n.baseTexture)||void 0===s?void 0:s.cacheId)&&(console.error(`The atlas texture "${o.relPath}" can't be loaded`),n=null)):console.error(`The tileset "${o.identifier}" doesn't seems to contain an atlas texture`),e[l]=n,n}!function(e){e.parseAtlas=function(e,t,i,l){if(!e.tiledversion)return console.warn("The loaded Tiled map does not contain a 'tiledversion' key. Are you sure this file has been exported from Tiled (mapeditor.org)?"),null;if(!e.tilesets.length||"source"in e.tilesets[0])return console.warn("The loaded Tiled map seems not to contain any tileset data (nothing in 'tilesets' key)."),null;const s=e.tilesets[0],{tilewidth:n,tileheight:o,tilecount:r,image:a,columns:d,spacing:c,margin:h}=s,u=void 0===s.firstgid?1:s.firstgid;i||(i=l(a));const p=r/d,f=n*d+c*(d-1)+2*h,y=o*p+c*(p-1)+2*h;if(i.width-1?t:0];if(!s||!s.layerInstances)return null;const n={};for(const t of e.defs.tilesets)n[t.uid]=t;const o=new g,r={},a={};for(let e=s.layerInstances.length-1;e>=0;--e){const t=s.layerInstances[e];if("Entities"===t.__type)continue;const i=t.__tilesetDefUid;if("number"!=typeof i)continue;const d=n[i],c=M(a,n,l,i);if(!c)continue;const h={},u=d.tileGridSize;for(const e of[...t.autoLayerTiles,...t.gridTiles]){if(h[e.t])continue;const t=b(i,e.t);if(r[t])h[e.t]=!0;else{try{const[i,l]=e.src,s=new PIXI.Rectangle(i,l,u,u),n=new PIXI.Texture(c,s);o.setTexture(t,n)}catch(e){console.error("An error occurred while creating a PIXI.Texture to be used in a TileMap:",e)}h[e.t]=!0,r[t]=!0}}}if(s.bgRelPath){const e=l(s.bgRelPath),t=new PIXI.Rectangle(0,0,s.pxWid,s.pxHei),i=new PIXI.Texture(e,t);o.setLevelBackgroundTexture(s.bgRelPath,i)}return o}}(x||(x={})),e.PixiTileMapHelper=void 0,(k=e.PixiTileMapHelper||(e.PixiTileMapHelper={})).parseAtlas=function(e,t,i,l){return"ldtk"===e.kind?x.parseAtlas(e.data,t,i,l):"tiled"===e.kind?_.parseAtlas(e.data,t,i,l):(console.warn("The loaded Tiled map data does not contain a 'tiledversion' or '__header__' key. Are you sure this file has been exported from Tiled (mapeditor.org) or LDtk (ldtk.io)?"),null)},k.updatePixiTileMap=function(e,t,i,l,o){const r=e;if(!r)return;r.clear();const a=t.getBackgroundResourceName();if(a){const e=i.getLevelBackgroundTexture(a);r.tile(e,0,0)}for(const e of t.getLayers())if(!("index"===l&&o!==e.id||"visible"===l&&!e.isVisible()))if(e instanceof d){const t=e;for(const e of t.objects){const l=e.getTileId(),s=i.getTexture(l);if(s){const i=n(l);r.tile(s,e.x,e.y-t.tileMap.getTileHeight(),{rotate:i})}}}else if(e instanceof h){const t=e,l=t.tileMap.getTileWidth(),o=t.tileMap.getTileHeight(),a=t.tileMap.getDimensionX(),d=t.tileMap.getDimensionY(),c=t.getAlpha();for(let e=0;e0&&o.tileAnimX(l,g.getAnimationLength())}}}},k.updatePixiCollisionMask=function(e,t,i,l,s,n,o,r){if(e){e.clear(),e.lineStyle(l,s,n),e.drawRect(0,0,t.getWidth(),t.getHeight());for(const l of t.getLayers()){const s=t.getTileWidth(),n=t.getTileHeight();if(l instanceof h){const t=l;for(let l=0;l-1?t:0];if(!i||!i.layerInstances)return null;const l=new Map;let s=0,n=0,a=0;for(let e=i.layerInstances.length-1;e>=0;--e){const t=i.layerInstances[e],o=t.__tilesetDefUid,r={};for(const e of[...t.autoLayerTiles,...t.gridTiles]){if(r[e.t])continue;const t=b(o,e.t);if(l.has(t)){r[e.t]=!0;continue}const i=new u(0);r[e.t]=!0,l.set(t,i)}"IntGrid"!==t.__type&&"AutoLayer"!==t.__type&&"Tiles"!==t.__type||(0===s?(s=t.__gridSize,n=t.__cWid,a=t.__cHei):t.__gridSize!==s&&console.warn("Grid size is different across layers. Only the first layer grid size will be followed."))}const d=new r(s,s,n,a,l),c=new Map;let h=268435455;for(let e=i.layerInstances.length-1;e>=0;--e){const t=i.layerInstances[e],s=t.__gridSize,n=t.__tilesetDefUid,r=d.addTileLayer(e);r.setAlpha(t.__opacity),r.setVisible(t.visible);for(const e of[...t.autoLayerTiles,...t.gridTiles]){const t=Math.floor(e.px[0]/s),i=Math.floor(e.px[1]/s),a=b(n,e.t),d=r.getTileId(t,i);if(void 0===d)r.setTile(t,i,a),r.setFlippedHorizontally(t,i,1===e.f||3===e.f),r.setFlippedVertically(t,i,2===e.f||3===e.f);else{const s=o(a,1===e.f||3===e.f,2===e.f||3===e.f,!1),n=l.get(d);if(null==n?void 0:n.hasStackedTiles()){const e=`${n.getStackedTiles().map((e=>`${e}`)).join(";")};${s}`,o=c.get(e);if(o)r.setTile(t,i,o.getStackTileId());else{const o=new u(0);o.setStackedTiles(h,...n.getStackedTiles(),s),l.set(h,o),h-=1,c.set(e,o),r.setTile(t,i,o.getStackTileId())}}else{const e=r.getTileGID(t,i),n=`${e};${s}`,o=new u(0);o.setStackedTiles(h,e,s),l.set(h,o),h-=1,c.set(n,o),r.setTile(t,i,o.getStackTileId())}}}}return i.bgRelPath&&d.setBackgroundResourceName(i.bgRelPath),d}}(I||(I={})),function(e){e.load=function(e,t){if(!e.tiledversion)return console.warn("The loaded Tiled map does not contain a 'tiledversion' key. Are you sure this file has been exported from Tiled (mapeditor.org)?"),null;const i=new Map;for(const t of e.tilesets){const l=void 0===t.firstgid?1:t.firstgid;if(t.tiles)for(const s of t.tiles){const t=new u(s.animation?s.animation.length:0),n=s.type||s.class;if(s.objectgroup)for(const e of s.objectgroup.objects){const i=e.type||e.class||n;if(!i||0===i.length)continue;let l=null;if(e.polygon){const t=e.rotation*Math.PI/180;let i=Math.cos(t),s=Math.sin(t);-1!==i&&1!==i||(s=0),-1!==s&&1!==s||(i=0),l=e.polygon.map((t=>[e.x+t.x*i-t.y*s,e.y+t.x*s+t.y*i]))}else void 0!==e.x&&void 0!==e.y&&void 0!==e.width&&void 0!==e.height&&(l=[[e.x,e.y],[e.x,e.y+e.height],[e.x+e.width,e.y+e.height],[e.x+e.width,e.y]]);l&&t.addHitBox(i,l)}else if(n){const i=[[0,0],[0,e.tileheight],[e.tilewidth,e.tileheight],[e.tilewidth,0]];t.addHitBox(n,i)}i.set(T(l+s.id),t)}for(let e=0;e{e(t,i,(e=>{if(!e)return void n(null);const t=w.load(e,l,s);n(t)}))}),n)}getOrLoadTextureCache(t,i,l,s,n,o,r){const a=s+"|"+n+"|"+l+"|"+o;this._textureCacheCaches.getOrLoad(a,(r=>{t(s,n,(t=>{if(!t)return void r(null);const s=l?i(l):null,n=e.PixiTileMapHelper.parseAtlas(t,o,s,i);r(n)}))}),r)}clearCaches(){this._tileMapCache=new p,this._textureCacheCaches=new p}}e.EditableTileMap=r,e.EditableTileMapLayer=h,e.TileDefinition=u,e.TileMapManager=v,e.TileTextureCache=g,Object.defineProperty(e,"__esModule",{value:!0})})); +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).TileMapHelper={})}(this,(function(e){"use strict";const t=2147483648,i=1073741824,l=536870912;var s;function n(e){const t=s.isFlippedDiagonally(e),i=s.isFlippedHorizontally(e),l=s.isFlippedVertically(e);let n=0;return t?(n=10,!i&&l?n=2:i&&!l?n=6:i&&l&&(n=14)):(n=0,!i&&l?n=8:i&&!l?n=12:i&&l&&(n=4)),n}function o(e,s,n,o){let r=e;return s&&(r|=t),n&&(r|=i),o&&(r|=l),r}!function(e){e.tileIdMask=536870911,e.getTileId=function(t){return t&e.tileIdMask},e.setFlippedHorizontally=function(e,i){return e&=2147483647,i&&(e|=t),e},e.setFlippedVertically=function(e,t){return e&=-1073741825,t&&(e|=i),e},e.setFlippedDiagonally=function(e,t){return e&=-536870913,t&&(e|=l),e},e.isFlippedHorizontally=function(e){return!!(e&t)},e.isFlippedVertically=function(e){return!!(e&i)},e.isFlippedDiagonally=function(e){return!!(e&l)}}(s||(s={}));class r{constructor(e,t,i,l,s){this.tileWidth=e,this.tileHeight=t,this.dimX=i,this.dimY=l,this._tileSet=s,this._layers=[]}getWidth(){return this.tileWidth*this.dimX}getHeight(){return this.tileHeight*this.dimY}getTileHeight(){return this.tileHeight}getTileWidth(){return this.tileWidth}getDimensionX(){return this.dimX}getDimensionY(){return this.dimY}getTileDefinition(e){return this._tileSet.get(e)}getTileDefinitions(){return this._tileSet.values()}addTileLayer(e){const t=new h(this,e);return this._layers.push(t),t}addObjectLayer(e){const t=new d(this,e);return this._layers.push(t),t}getBackgroundResourceName(){return this._backgroundResourceName}getLayers(){return this._layers}pointIsInsideTile(e,t,i){const l=Math.floor(e/this.tileWidth),s=Math.floor(t/this.tileHeight);for(const e of this._layers){const t=e;if(!t)continue;const n=t.getTileId(l,s);if(void 0===n)return!1;if(this._tileSet.get(n).hasTaggedHitBox(i))return!0}return!1}setBackgroundResourceName(e){this._backgroundResourceName=e}}class a{constructor(e,t){this.visible=!0,this.tileMap=e,this.id=t}setVisible(e){this.visible=e}isVisible(){return this.visible}}class d extends a{constructor(e,t){super(e,t),this.objects=[]}add(e){this.objects.push(e)}}class c{constructor(e,t,i){this.tileId=i,this.x=e,this.y=t}getTileId(){return s.getTileId(this.tileId)}setFlippedHorizontally(e){this.tileId=s.setFlippedHorizontally(this.tileId,e)}setFlippedVertically(e){this.tileId=s.setFlippedVertically(this.tileId,e)}setFlippedDiagonally(e){this.tileId=s.setFlippedDiagonally(this.tileId,e)}isFlippedHorizontally(){return s.isFlippedHorizontally(this.tileId)}isFlippedVertically(){return s.isFlippedVertically(this.tileId)}isFlippedDiagonally(){return s.isFlippedDiagonally(this.tileId)}}class h extends a{constructor(e,t){super(e,t),this._tiles=[],this._tiles.length=this.tileMap.getDimensionY();for(let e=0;e=l.length||(l[e]=i+1)}removeTile(e,t){const i=this._tiles[t];!i||e>=i.length||(i[e]=0)}setFlippedHorizontally(e,t,i){const l=this._tiles[t];if(!l||e>=l.length)return;const n=l[e];0!==n&&(l[e]=s.setFlippedHorizontally(n,i))}setFlippedVertically(e,t,i){const l=this._tiles[t];if(!l||e>=l.length)return;const n=l[e];0!==n&&(l[e]=s.setFlippedVertically(n,i))}setFlippedDiagonally(e,t,i){const l=this._tiles[t];if(!l||e>=l.length)return;const n=l[e];0!==n&&(l[e]=s.setFlippedDiagonally(n,i))}isFlippedHorizontally(e,t){const i=this._tiles[t];return!(!i||e>=i.length)&&s.isFlippedHorizontally(i[e])}isFlippedVertically(e,t){const i=this._tiles[t];return!(!i||e>=i.length)&&s.isFlippedVertically(i[e])}isFlippedDiagonally(e,t){const i=this._tiles[t];return!(!i||e>=i.length)&&s.isFlippedDiagonally(i[e])}getTileGID(e,t){const i=this._tiles[t];if(i&&!(e>=i.length)&&0!==i[e])return i[e]-1}getTileId(e,t){const i=this._tiles[t];if(!i||e>=i.length||0===i[e])return;return s.getTileId(i[e]-1)}getDimensionX(){return 0===this._tiles.length?0:this._tiles[0].length}getDimensionY(){return this._tiles.length}getWidth(){return this.tileMap.getWidth()}getHeight(){return this.tileMap.getHeight()}}class u{constructor(e){this.taggedHitBoxes=[],this.animationLength=null!=e?e:0,this.stackedTiles=[]}addHitBox(e,t){let i=this.taggedHitBoxes.find((t=>t.tag===e));i||(i={tag:e,polygons:[]},this.taggedHitBoxes.push(i)),i.polygons.push(t)}hasTaggedHitBox(e){return this.taggedHitBoxes.some((t=>t.tag===e))}getHitBoxes(e){const t=this.taggedHitBoxes.find((t=>t.tag===e));return t&&t.polygons}getAnimationLength(){return this.animationLength}getStackTileId(){return this.stackTileId}getStackedTiles(){return this.stackedTiles}hasStackedTiles(){return this.stackedTiles.length>0}setStackedTiles(e,...t){this.stackedTiles=t,this.stackTileId=e}}class p{constructor(){this._cachedValues=new Map,this._callbacks=new Map}getOrLoad(e,t,i){{const t=this._cachedValues.get(e);if(t)return void i(t)}{const t=this._callbacks.get(e);if(t)return void t.push(i);this._callbacks.set(e,[i])}t((t=>{t&&this._cachedValues.set(e,t);const i=this._callbacks.get(e);this._callbacks.delete(e);for(const e of i)e(t)}))}}class g{constructor(){this._levelBackgroundTextures=new Map,this._textures=new Map}setTexture(e,t){this._textures.set(e,t)}getTexture(e){return this._textures.get(e)}getLevelBackgroundTexture(e){return this._levelBackgroundTextures.get(e)}setLevelBackgroundTexture(e,t){this._levelBackgroundTextures.set(e,t)}}const f=(e,t)=>{const{data:i,compression:l}=t;if(!i)return i;let s=4;const n=[];let o=atob(i).split("").map((function(e){return e.charCodeAt(0)}));try{const t=(e,t)=>e[t]+(e[t+1]<<8)+(e[t+2]<<16)+(e[t+3]<<24)>>>0;if("zlib"===l){const i=new Uint8Array(o),l=e.inflate(i);for(;s<=l.length;)n.push(t(l,s-4)),s+=4}else{if("zstd"===l)return console.error("Zstandard compression is not supported for layers in a Tilemap. Use instead zlib compression or no compression."),null;for(;s<=o.length;)n.push(t(o,s-4)),s+=4}return n}catch(e){return console.error("Failed to decompress and unzip base64 layer.data string",e),null}},y=e=>{const s=e&t,n=e&i,o=e&l;return{id:T(536870911&e),flippedHorizontally:!!s,flippedVertically:!!n,flippedDiagonally:!!o}};function T(e){return 0===e?void 0:e-1}var _,x,k,I,m,b;function w(e,t){let i=e<<16;return i+=t,i}function M(e,t,i,l){var s;if(e[l])return e[l];let n=null;const o=t[l];return(null==o?void 0:o.relPath)?(n=i(o.relPath),"res/error48.png"===(null===(s=n.baseTexture)||void 0===s?void 0:s.cacheId)&&(console.error(`The atlas texture "${o.relPath}" can't be loaded`),n=null)):console.error(`The tileset "${o.identifier}" doesn't seems to contain an atlas texture`),e[l]=n,n}!function(e){e.parseAtlas=function(e,t,i,l){if(!e.tiledversion)return console.warn("The loaded Tiled map does not contain a 'tiledversion' key. Are you sure this file has been exported from Tiled (mapeditor.org)?"),null;if(!e.tilesets.length||"source"in e.tilesets[0])return console.warn("The loaded Tiled map seems not to contain any tileset data (nothing in 'tilesets' key)."),null;const s=e.tilesets[0],{tilewidth:n,tileheight:o,tilecount:r,image:a,columns:d,spacing:c,margin:h}=s,u=void 0===s.firstgid?1:s.firstgid;i||(i=l(a));const p=r/d,f=n*d+c*(d-1)+2*h,y=o*p+c*(p-1)+2*h;if(i.width-1?t:0];if(!s||!s.layerInstances)return null;const n={};for(const t of e.defs.tilesets)n[t.uid]=t;const o=new g,r={},a={};for(let e=s.layerInstances.length-1;e>=0;--e){const t=s.layerInstances[e];if("Entities"===t.__type)continue;const i=t.__tilesetDefUid;if("number"!=typeof i)continue;const d=n[i],c=M(a,n,l,i);if(!c)continue;const h={},u=d.tileGridSize;for(const e of[...t.autoLayerTiles,...t.gridTiles]){if(h[e.t])continue;const t=w(i,e.t);if(r[t])h[e.t]=!0;else{try{const[i,l]=e.src,s=new PIXI.Rectangle(i,l,u,u),n=new PIXI.Texture(c.baseTexture,s);o.setTexture(t,n)}catch(e){console.error("An error occurred while creating a PIXI.Texture to be used in a TileMap:",e)}h[e.t]=!0,r[t]=!0}}}if(s.bgRelPath){const e=l(s.bgRelPath),t=new PIXI.Rectangle(0,0,s.pxWid,s.pxHei),i=new PIXI.Texture(e.baseTexture,t);o.setLevelBackgroundTexture(s.bgRelPath,i)}return o}}(x||(x={})),e.PixiTileMapHelper=void 0,(k=e.PixiTileMapHelper||(e.PixiTileMapHelper={})).parseAtlas=function(e,t,i,l){return"ldtk"===e.kind?x.parseAtlas(e.data,t,i,l):"tiled"===e.kind?_.parseAtlas(e.data,t,i,l):(console.warn("The loaded Tiled map data does not contain a 'tiledversion' or '__header__' key. Are you sure this file has been exported from Tiled (mapeditor.org) or LDtk (ldtk.io)?"),null)},k.updatePixiTileMap=function(e,t,i,l,o){const r=e;if(!r)return;r.clear();const a=t.getBackgroundResourceName();if(a){const e=i.getLevelBackgroundTexture(a);r.tile(e,0,0)}for(const e of t.getLayers())if(!("index"===l&&o!==e.id||"visible"===l&&!e.isVisible()))if(e instanceof d){const t=e;for(const e of t.objects){const l=e.getTileId(),s=i.getTexture(l);if(s){const i=n(l);r.tile(s,e.x,e.y-t.tileMap.getTileHeight(),{rotate:i})}}}else if(e instanceof h){const t=e,l=t.tileMap.getTileWidth(),o=t.tileMap.getTileHeight(),a=t.tileMap.getDimensionX(),d=t.tileMap.getDimensionY(),c=t.getAlpha();for(let e=0;e0&&o.tileAnimX(l,g.getAnimationLength())}}}},k.updatePixiCollisionMask=function(e,t,i,l,s,n,o,r){if(e){e.clear(),e.lineStyle(l,s,n),e.drawRect(0,0,t.getWidth(),t.getHeight());for(const l of t.getLayers()){const s=t.getTileWidth(),n=t.getTileHeight();if(l instanceof h){const t=l;for(let l=0;l-1?t:0];if(!i||!i.layerInstances)return null;const l=new Map;let s=0,n=0,a=0;for(let e=i.layerInstances.length-1;e>=0;--e){const t=i.layerInstances[e],o=t.__tilesetDefUid,r={};for(const e of[...t.autoLayerTiles,...t.gridTiles]){if(r[e.t])continue;const t=w(o,e.t);if(l.has(t)){r[e.t]=!0;continue}const i=new u(0);r[e.t]=!0,l.set(t,i)}"IntGrid"!==t.__type&&"AutoLayer"!==t.__type&&"Tiles"!==t.__type||(0===s?(s=t.__gridSize,n=t.__cWid,a=t.__cHei):t.__gridSize!==s&&console.warn("Grid size is different across layers. Only the first layer grid size will be followed."))}const d=new r(s,s,n,a,l),c=new Map;let h=268435455;for(let e=i.layerInstances.length-1;e>=0;--e){const t=i.layerInstances[e],s=t.__gridSize,n=t.__tilesetDefUid,r=d.addTileLayer(e);r.setAlpha(t.__opacity),r.setVisible(t.visible);for(const e of[...t.autoLayerTiles,...t.gridTiles]){const t=Math.floor(e.px[0]/s),i=Math.floor(e.px[1]/s),a=w(n,e.t),d=r.getTileId(t,i);if(void 0===d)r.setTile(t,i,a),r.setFlippedHorizontally(t,i,1===e.f||3===e.f),r.setFlippedVertically(t,i,2===e.f||3===e.f);else{const s=o(a,1===e.f||3===e.f,2===e.f||3===e.f,!1),n=l.get(d);if(null==n?void 0:n.hasStackedTiles()){const e=`${n.getStackedTiles().map((e=>`${e}`)).join(";")};${s}`,o=c.get(e);if(o)r.setTile(t,i,o.getStackTileId());else{const o=new u(0);o.setStackedTiles(h,...n.getStackedTiles(),s),l.set(h,o),h-=1,c.set(e,o),r.setTile(t,i,o.getStackTileId())}}else{const e=r.getTileGID(t,i),n=`${e};${s}`,o=new u(0);o.setStackedTiles(h,e,s),l.set(h,o),h-=1,c.set(n,o),r.setTile(t,i,o.getStackTileId())}}}}return i.bgRelPath&&d.setBackgroundResourceName(i.bgRelPath),d}}(I||(I={})),function(e){e.load=function(e,t){if(!e.tiledversion)return console.warn("The loaded Tiled map does not contain a 'tiledversion' key. Are you sure this file has been exported from Tiled (mapeditor.org)?"),null;const i=new Map;for(const t of e.tilesets){const l=void 0===t.firstgid?1:t.firstgid;if(t.tiles)for(const s of t.tiles){const t=new u(s.animation?s.animation.length:0),n=s.type||s.class;if(s.objectgroup)for(const e of s.objectgroup.objects){const i=e.type||e.class||n;if(!i||0===i.length)continue;let l=null;if(e.polygon){const t=e.rotation*Math.PI/180;let i=Math.cos(t),s=Math.sin(t);-1!==i&&1!==i||(s=0),-1!==s&&1!==s||(i=0),l=e.polygon.map((t=>[e.x+t.x*i-t.y*s,e.y+t.x*s+t.y*i]))}else void 0!==e.x&&void 0!==e.y&&void 0!==e.width&&void 0!==e.height&&(l=[[e.x,e.y],[e.x,e.y+e.height],[e.x+e.width,e.y+e.height],[e.x+e.width,e.y]]);l&&t.addHitBox(i,l)}else if(n){const i=[[0,0],[0,e.tileheight],[e.tilewidth,e.tileheight],[e.tilewidth,0]];t.addHitBox(n,i)}i.set(T(l+s.id),t)}for(let e=0;e{e(t,i,(e=>{if(!e)return void n(null);const t=b.load(e,l,s);n(t)}))}),n)}getOrLoadTextureCache(t,i,l,s,n,o,r){const a=s+"|"+n+"|"+l+"|"+o;this._textureCacheCaches.getOrLoad(a,(r=>{t(s,n,(t=>{if(!t)return void r(null);const s=l?i(l):null,n=e.PixiTileMapHelper.parseAtlas(t,o,s,i);r(n)}))}),r)}clearCaches(){this._tileMapCache=new p,this._textureCacheCaches=new p}}e.EditableTileMap=r,e.EditableTileMapLayer=h,e.TileDefinition=u,e.TileMapManager=v,e.TileTextureCache=g,Object.defineProperty(e,"__esModule",{value:!0})})); //# sourceMappingURL=TileMapHelper.js.map diff --git a/Extensions/TileMap/helper/TileMapHelper.js.map b/Extensions/TileMap/helper/TileMapHelper.js.map index cca600510580..18d2ede2a5d9 100644 --- a/Extensions/TileMap/helper/TileMapHelper.js.map +++ b/Extensions/TileMap/helper/TileMapHelper.js.map @@ -1 +1 @@ -{"version":3,"file":"TileMapHelper.js","sources":["../../../SharedLibs/src/model/GID.ts","../../../SharedLibs/src/model/TileMapModel.ts","../../../SharedLibs/src/render/ResourceCache.ts","../../../SharedLibs/src/render/TileTextureCache.ts","../../../SharedLibs/src/load/tiled/TiledTileMapLoaderHelper.ts","../../../SharedLibs/src/render/tiled/TiledPixiHelper.ts","../../../SharedLibs/src/render/ldtk/LDtkPixiHelper.ts","../../../SharedLibs/src/render/TileMapPixiHelper.ts","../../../SharedLibs/src/load/ldtk/LDtkTileMapLoader.ts","../../../SharedLibs/src/load/tiled/TiledTileMapLoader.ts","../../../SharedLibs/src/load/TileMapLoader.ts","../../../SharedLibs/src/load/ldtk/LDtkTileMapLoaderHelper.ts","../../../SharedLibs/src/render/TileMapManager.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,null,null,null],"names":["FLIPPED_HORIZONTALLY_FLAG","FLIPPED_VERTICALLY_FLAG","FLIPPED_DIAGONALLY_FLAG","FlippingHelper","getPixiRotate","tileGID","flippedDiagonally","isFlippedDiagonally","flippedHorizontally","isFlippedHorizontally","flippedVertically","isFlippedVertically","rotate","getTileGID","tileId","tileIdMask","getTileId","setFlippedHorizontally","setFlippedVertically","setFlippedDiagonally","EditableTileMap","constructor","tileWidth","tileHeight","dimX","dimY","tileSet","this","_tileSet","_layers","getWidth","getHeight","getTileHeight","getTileWidth","getDimensionX","getDimensionY","getTileDefinition","get","getTileDefinitions","values","addTileLayer","id","layer","EditableTileMapLayer","push","addObjectLayer","EditableObjectLayer","getBackgroundResourceName","_backgroundResourceName","getLayers","pointIsInsideTile","x","y","tag","indexX","Math","floor","indexY","tileLayer","undefined","hasTaggedHitBox","setBackgroundResourceName","resourceName","AbstractEditableLayer","tileMap","visible","setVisible","isVisible","super","objects","add","object","TileObject","_tiles","length","index","Int32Array","_alpha","getAlpha","setAlpha","alpha","setTile","console","error","tilesRow","removeTile","TileDefinition","animationLength","taggedHitBoxes","stackedTiles","addHitBox","polygon","taggedHitBox","find","hitbox","polygons","some","getHitBoxes","getAnimationLength","getStackTileId","stackTileId","getStackedTiles","hasStackedTiles","setStackedTiles","tiles","ResourceCache","_cachedValues","Map","_callbacks","getOrLoad","key","load","callback","value","callbacks","set","delete","TileTextureCache","_levelBackgroundTextures","_textures","setTexture","texture","getTexture","getLevelBackgroundTexture","name","setLevelBackgroundTexture","decodeBase64LayerData","pako","tiledLayer","data","compression","decodedData","step1","atob","split","map","charCodeAt","decodeArray","arr","binData","Uint8Array","decompressedData","inflate","extractTileUidFlippedStates","globalTileUid","getTileIdFromTiledGUI","tiledGUI","TiledPixiHelper","LDtkPixiHelper","PixiTileMapHelper","LDtkTileMapLoader","TiledTileMapLoader","TileMapLoader","getLDtkTileId","tileSetId","uniqueId","getAtlasTexture","atlasTextures","tilesetCache","tilesetId","tileset","relPath","baseTexture","_a","cacheId","identifier","parseAtlas","levelIndex","atlasTexture","tiledversion","warn","tilesets","tiledSet","tilewidth","tileheight","tilecount","image","columns","spacing","margin","firstGid","firstgid","rows","expectedAtlasWidth","expectedAtlasHeight","width","height","textureCache","tileSetIndex","rect","PIXI","Rectangle","Texture","level","levels","layerInstances","defs","uid","levelTileCache","iLayer","__type","__tilesetDefUid","layerTileCache","gridSize","tileGridSize","tile","autoLayerTiles","gridTiles","t","src","bgRelPath","pxWid","pxHei","exports","kind","updatePixiTileMap","untypedPixiTileMap","displayMode","layerIndex","pixiTileMap","clear","bgResourceName","objectLayer","dimensionX","dimensionY","xPos","yPos","tileDefinition","tileTexture","pixiTilemapFrame","tileAnimX","updatePixiCollisionMask","pixiGraphics","typeFilter","outlineSize","outlineColor","outlineOpacity","fillColor","fillOpacity","lineStyle","drawRect","hitboxes","vertices","beginFill","vertexX","vertexY","swap","moveTo","lineTo","closePath","endFill","ldtkTileMap","ldtkLevel","tileCache","has","tileDef","__gridSize","__cWid","__cHei","editableTileMap","composedTileMap","nextComposedTileId","editableTileLayer","__opacity","px","oldTileId","f","oldTileDef","hash","join","oldTileGID","tiledTileMap","definitions","tiledTileSet","animation","tileClass","type","class","objectgroup","angle","rotation","PI","cos","sin","point","tileIndex","collisionTileMap","layers","tiledObject","gid","tileGid","tileSlotIndex","layerData","encoding","collisionTileLayer","opacity","tileUid","tileMapFileContent","TileMapManager","_tileMapCache","_textureCacheCaches","getManager","instanceHolder","tileMapCollisionMaskManager","identify","info","__header__","app","getOrLoadTileMap","loadTileMap","tileMapJsonResourceName","tileSetJsonResourceName","getOrLoadTextureCache","atlasImageResourceName","clearCaches"],"mappings":"qPAEO,MAAMA,EAA4B,WAC5BC,EAA0B,WAC1BC,EAA0B,UAKjC,IAAWC,EAoEX,SAAUC,EAAcC,GAC5B,MAAMC,EAAoBH,EAAeI,oBAAoBF,GACvDG,EAAsBL,EAAeM,sBAAsBJ,GAC3DK,EAAoBP,EAAeQ,oBAAoBN,GAE7D,IAAIO,EAAS,EAoBb,OAnBIN,GACFM,EAAS,IACJJ,GAAuBE,EAC1BE,EAAS,EACAJ,IAAwBE,EACjCE,EAAS,EACAJ,GAAuBE,IAChCE,EAAS,MAGXA,EAAS,GACJJ,GAAuBE,EAC1BE,EAAS,EACAJ,IAAwBE,EACjCE,EAAS,GACAJ,GAAuBE,IAChCE,EAAS,IAGNA,CACT,CAEM,SAAUC,EACdC,EACAN,EACAE,EACAJ,GAEA,IAAID,EAAUS,EAUd,OATIN,IACFH,GAAWL,GAETU,IACFL,GAAWJ,GAETK,IACFD,GAAWH,GAENG,CACT,EAjHA,SAAiBF,GACFA,EAAUY,WAAG,UAMVZ,EAAAa,UAAhB,SAA0BF,GACxB,OAAOA,EAASX,EAAeY,UAChC,EAEeZ,EAAAc,uBAAhB,SACEH,EACAN,GAMA,OAJAM,GAAU,WACNN,IACFM,GAAUd,GAELc,CACR,EAEeX,EAAAe,qBAAhB,SACEJ,EACAJ,GAMA,OAJAI,IAAU,WACNJ,IACFI,GAAUb,GAELa,CACR,EAEeX,EAAAgB,qBAAhB,SACEL,EACAR,GAMA,OAJAQ,IAAU,UACNR,IACFQ,GAAUZ,GAELY,CACR,EAEeX,EAAAM,sBAAhB,SAAsCK,GACpC,OAAgD,IAAxCA,E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gR,cAAgB,IAAIlM,EACzB9E,KAAKiR,oBAAsB,IAAInM,CAChC"} \ No newline at end of file +{"version":3,"file":"TileMapHelper.js","sources":["../../../SharedLibs/src/model/GID.ts","../../../SharedLibs/src/model/TileMapModel.ts","../../../SharedLibs/src/render/ResourceCache.ts","../../../SharedLibs/src/render/TileTextureCache.ts","../../../SharedLibs/src/load/tiled/TiledTileMapLoaderHelper.ts","../../../SharedLibs/src/render/tiled/TiledPixiHelper.ts","../../../SharedLibs/src/render/ldtk/LDtkPixiHelper.ts","../../../SharedLibs/src/render/TileMapPixiHelper.ts","../../../SharedLibs/src/load/ldtk/LDtkTileMapLoader.ts","../../../SharedLibs/src/load/tiled/TiledTileMapLoader.ts","../../../SharedLibs/src/load/TileMapLoader.ts","../../../SharedLibs/src/load/ldtk/LDtkTileMapLoaderHelper.ts","../../../SharedLibs/src/render/TileMapManager.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,null,null,null],"names":["FLIPPED_HORIZONTALLY_FLAG","FLIPPED_VERTICALLY_FLAG","FLIPPED_DIAGONALLY_FLAG","FlippingHelper","getPixiRotate","tileGID","flippedDiagonally","isFlippedDiagonally","flippedHorizontally","isFlippedHorizontally","flippedVertically","isFlippedVertically","rotate","getTileGID","tileId","tileIdMask","getTileId","setFlippedHorizontally","setFlippedVertically","setFlippedDiagonally","EditableTileMap","constructor","tileWidth","tileHeight","dimX","dimY","tileSet","this","_tileSet","_layers","getWidth","getHeight","getTileHeight","getTileWidth","getDimensionX","getDimensionY","getTileDefinition","get","getTileDefinitions","values","addTileLayer","id","layer","EditableTileMapLayer","push","addObjectLayer","EditableObjectLayer","getBackgroundResourceName","_backgroundResourceName","getLayers","pointIsInsideTile","x","y","tag","indexX","Math","floor","indexY","tileLayer","undefined","hasTaggedHitBox","setBackgroundResourceName","resourceName","AbstractEditableLayer","tileMap","visible","setVisible","isVisible","super","objects","add","object","TileObject","_tiles","length","index","Int32Array","_alpha","getAlpha","setAlpha","alpha","setTile","console","error","tilesRow","removeTile","TileDefinition","animationLength","taggedHitBoxes","stackedTiles","addHitBox","polygon","taggedHitBox","find","hitbox","polygons","some","getHitBoxes","getAnimationLength","getStackTileId","stackTileId","getStackedTiles","hasStackedTiles","setStackedTiles","tiles","ResourceCache","_cachedValues","Map","_callbacks","getOrLoad","key","load","callback","value","callbacks","set","delete","TileTextureCache","_levelBackgroundTextures","_textures","setTexture","texture","getTexture","getLevelBackgroundTexture","name","setLevelBackgroundTexture","decodeBase64LayerData","pako","tiledLayer","data","compression","decodedData","step1","atob","split","map","charCodeAt","decodeArray","arr","binData","Uint8Array","decompressedData","inflate","extractTileUidFlippedStates","globalTileUid","getTileIdFromTiledGUI","tiledGUI","TiledPixiHelper","LDtkPixiHelper","PixiTileMapHelper","LDtkTileMapLoader","TiledTileMapLoader","TileMapLoader","getLDtkTileId","tileSetId","uniqueId","getAtlasTexture","atlasTextures","tilesetCache","tilesetId","tileset","relPath","_a","baseTexture","cacheId","identifier","parseAtlas","levelIndex","atlasTexture","tiledversion","warn","tilesets","tiledSet","tilewidth","tileheight","tilecount","image","columns","spacing","margin","firstGid","firstgid","rows","expectedAtlasWidth","expectedAtlasHeight","width","height","textureCache","tileSetIndex","rect","PIXI","Rectangle","Texture","level","levels","layerInstances","defs","uid","levelTileCache","iLayer","__type","__tilesetDefUid","layerTileCache","gridSize","tileGridSize","tile","autoLayerTiles","gridTiles","t","src","bgRelPath","pxWid","pxHei","exports","kind","updatePixiTileMap","untypedPixiTileMap","displayMode","layerIndex","pixiTileMap","clear","bgResourceName","objectLayer","dimensionX","dimensionY","xPos","yPos","tileDefinition","tileTexture","pixiTilemapFrame","tileAnimX","updatePixiCollisionMask","pixiGraphics","typeFilter","outlineSize","outlineColor","outlineOpacity","fillColor","fillOpacity","lineStyle","drawRect","hitboxes","vertices","beginFill","vertexX","vertexY","swap","moveTo","lineTo","closePath","endFill","ldtkTileMap","ldtkLevel","tileCache","has","tileDef","__gridSize","__cWid","__cHei","editableTileMap","composedTileMap","nextComposedTileId","editableTileLayer","__opacity","px","oldTileId","f","oldTileDef","hash","join","oldTileGID","tiledTileMap","definitions","tiledTileSet","animation","tileClass","type","class","objectgroup","angle","rotation","PI","cos","sin","point","tileIndex","collisionTileMap","layers","tiledObject","gid","tileGid","tileSlotIndex","layerData","encoding","collisionTileLayer","opacity","tileUid","tileMapFileContent","TileMapManager","_tileMapCache","_textureCacheCaches","getManager","instanceHolder","tileMapCollisionMaskManager","identify","info","__header__","app","getOrLoadTileMap","loadTileMap","tileMapJsonResourceName","tileSetJsonResourceName","getOrLoadTextureCache","atlasImageResourceName","clearCaches"],"mappings":"qPAEO,MAAMA,EAA4B,WAC5BC,EAA0B,WAC1BC,EAA0B,UAKjC,IAAWC,EAoEX,SAAUC,EAAcC,GAC5B,MAAMC,EAAoBH,EAAeI,oBAAoBF,GACvDG,EAAsBL,EAAeM,sBAAsBJ,GAC3DK,EAAoBP,EAAeQ,oBAAoBN,GAE7D,IAAIO,EAAS,EAoBb,OAnBIN,GACFM,EAAS,IACJJ,GAAuBE,EAC1BE,EAAS,EACAJ,IAAwBE,EACjCE,EAAS,EACAJ,GAAuBE,IAChCE,EAAS,MAGXA,EAAS,GACJJ,GAAuBE,EAC1BE,EAAS,EACAJ,IAAwBE,EACjCE,EAAS,GACAJ,GAAuBE,IAChCE,EAAS,IAGNA,CACT,CAEM,SAAUC,EACdC,EACAN,EACAE,EACAJ,GAEA,IAAID,EAAUS,EAUd,OATIN,IACFH,GAAWL,GAETU,IACFL,GAAWJ,GAETK,IACFD,GAAWH,GAENG,CACT,EAjHA,SAAiBF,GACFA,EAAUY,WAAG,UAMVZ,EAAAa,UAAhB,SAA0BF,GACxB,OAAOA,EAASX,EAAeY,UAChC,EAEeZ,EAAAc,uBAAhB,SACEH,EACAN,GAMA,OAJAM,GAAU,WACNN,IACFM,GAAUd,GAELc,CACR,EAEeX,EAAAe,qBAAhB,SACEJ,EACAJ,GAMA,OAJAI,IAAU,WACNJ,IACFI,GAAUb,GA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X,KACE9H,EAAetC,EAAAA,kBAAkBiB,WACrCmI,EACAlI,EACAC,EACA9C,GAEFV,EAAS2E,EAAa,GAEzB,GAEH3E,EAEH,CAED,WAAA0M,GACE/R,KAAKgR,cAAgB,IAAIlM,EACzB9E,KAAKiR,oBAAsB,IAAInM,CAChC"} \ No newline at end of file diff --git a/Extensions/TileMap/helper/dts/render/TileMapManager.d.ts b/Extensions/TileMap/helper/dts/render/TileMapManager.d.ts index f80d3720d8a8..0098bd665d27 100644 --- a/Extensions/TileMap/helper/dts/render/TileMapManager.d.ts +++ b/Extensions/TileMap/helper/dts/render/TileMapManager.d.ts @@ -58,7 +58,7 @@ export declare class TileMapManager { tileSetJsonResourceName: string, callback: (tileMapFileContent: TileMapFileContent | null) => void ) => void, - getTexture: (textureName: string) => PIXI.BaseTexture, + getTexture: (textureName: string) => PIXI.Texture, atlasImageResourceName: string, tileMapJsonResourceName: string, tileSetJsonResourceName: string, diff --git a/Extensions/TileMap/helper/dts/render/TileMapManager.d.ts.map b/Extensions/TileMap/helper/dts/render/TileMapManager.d.ts.map index 372feed4dc93..e246b90b2434 100644 --- a/Extensions/TileMap/helper/dts/render/TileMapManager.d.ts.map +++ b/Extensions/TileMap/helper/dts/render/TileMapManager.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"TileMapManager.d.ts","sourceRoot":"","sources":["../../src/render/TileMapManager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAGtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAEhE;;;;;;;GAOG;AACH,qBAAa,cAAc;IACzB,OAAO,CAAC,aAAa,CAAiC;IACtD,OAAO,CAAC,mBAAmB,CAAkC;;IAO7D;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,cAAc,EAAE,MAAM,GAAG,cAAc;IAWzD;;;OAGG;IACH,MAAM,C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B,OAAO,CAAC,aAAa,CAAiC;IACtD,OAAO,CAAC,mBAAmB,CAAkC;;IAO7D;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,cAAc,EAAE,MAAM,GAAG,cAAc;IAWzD;;;OAGG;IACH,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,GAAG,GAAG,kBAAkB,GAAG,IAAI;IAwBrD;;;;;;;OAOG;IACH,gBAAgB,CACd,WAAW,EAAE,CACX,uBAAuB,EAAE,MAAM,EAC/B,uBAAuB,EAAE,MAAM,EAC/B,QAAQ,EAAE,CAAC,kBAAkB,EAAE,kBAAkB,GAAG,IAAI,KAAK,IAAI,KAC9D,IAAI,EACT,uBAAuB,EAAE,MAAM,EAC/B,uBAAuB,EAAE,MAAM,EAC/B,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,GAAG,EACT,QAAQ,EAAE,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI,KAAK,IAAI,GAClD,IAAI;IAiCP;;;;;;;;OAQG;IACH,qBAAqB,CACnB,WAAW,EAAE,CACX,uBAAuB,EAAE,MAAM,EAC/B,uBAAuB,EAAE,MAAM,EAC/B,QAAQ,EAAE,CAAC,kBAAkB,EAAE,kBAAkB,GAAG,IAAI,KAAK,IAAI,KAC9D,IAAI,EACT,UAAU,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC,OAAO,EACjD,sBAAsB,EAAE,MAAM,EAC9B,uBAAuB,EAAE,MAAM,EAC/B,uBAAuB,EAAE,MAAM,EAC/B,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,CAAC,YAAY,EAAE,gBAAgB,GAAG,IAAI,KAAK,IAAI,GACxD,IAAI;IAwCP,WAAW,IAAI,IAAI;CAIpB"} \ No newline at end of file diff --git a/Extensions/TileMap/helper/dts/render/TileMapPixiHelper.d.ts b/Extensions/TileMap/helper/dts/render/TileMapPixiHelper.d.ts index e9ed4138e4ff..2289fa205e46 100644 --- a/Extensions/TileMap/helper/dts/render/TileMapPixiHelper.d.ts +++ b/Extensions/TileMap/helper/dts/render/TileMapPixiHelper.d.ts @@ -15,8 +15,8 @@ export declare namespace PixiTileMapHelper { function parseAtlas( tileMap: TileMapFileContent, levelIndex: number, - atlasTexture: PIXI.BaseTexture | null, - getTexture: (textureName: string) => PIXI.BaseTexture + atlasTexture: PIXI.Texture | null, + getTexture: (textureName: string) => PIXI.Texture ): TileTextureCache | null; /** * Re-renders the tile map whenever its rendering settings have been changed diff --git a/Extensions/TileMap/helper/dts/render/TileMapPixiHelper.d.ts.map b/Extensions/TileMap/helper/dts/render/TileMapPixiHelper.d.ts.map index c950c66121a6..ccd031f4111f 100644 --- a/Extensions/TileMap/helper/dts/render/TileMapPixiHelper.d.ts.map +++ b/Extensions/TileMap/helper/dts/render/TileMapPixiHelper.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"TileMapPixiHelper.d.ts","sourceRoot":"","sources":["../../src/render/TileMapPixiHelper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAEL,eAAe,EAEhB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAGtD,yBAAiB,iBAAiB,CAAC;IACjC;;;;;;;;OAQG;IACH,SAAgB,UAAU,CACxB,OAAO,EAAE,kBAAkB,EAC3B,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,IAAI,EACpD,UAAU,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,GACnE,gBAAgB,GAAG,IAAI,CAuBzB;IAED;;;;;;;;;;;;OAYG;IACH,SAAgB,iBAAiB,CAC/B,kBAAkB,EAAE,GAAG,EACvB,OAAO,EAAE,eAAe,EACxB,YAAY,EAAE,gBAAgB,EAC9B,WAAW,EAAE,OAAO,GAAG,SAAS,GAAG,KAAK,EACxC,UAAU,EAAE,MAAM,GACjB,IAAI,CA0GN;IAED;;OAEG;IACH,SAAgB,uBAAuB,CACrC,YAAY,EAAE,IAAI,CAAC,QAAQ,EAC3B,OAAO,EAAE,eAAe,EACxB,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,OAAO,EACpB,YAAY,EAAE,OAAO,EACrB,cAAc,EAAE,KAAK,EACrB,SAAS,EAAE,OAAO,EAClB,WAAW,EAAE,KAAK,GACjB,IAAI,CAgEN;CACF"} \ No newline at end of file +{"version":3,"file":"TileMapPixiHelper.d.ts","sourceRoot":"","sources":["../../src/render/TileMapPixiHelper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAEL,eAAe,EAEhB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAGtD,yBAAiB,iBAAiB,CAAC;IACjC;;;;;;;;OAQG;IACH,SAAgB,UAAU,CACxB,OAAO,EAAE,kBAAkB,EAC3B,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,IAAI,CAAC,OAAO,GAAG,IAAI,EACjC,UAAU,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC,OAAO,GAChD,gBAAgB,GAAG,IAAI,CAuBzB;IAED;;;;;;;;;;;;OAYG;IACH,SAAgB,iBAAiB,CAC/B,kBAAkB,EAAE,GAAG,EACvB,OAAO,EAAE,eAAe,EACxB,YAAY,EAAE,gBAAgB,EAC9B,WAAW,EAAE,OAAO,GAAG,SAAS,GAAG,KAAK,EACxC,UAAU,EAAE,MAAM,GACjB,IAAI,CA0GN;IAED;;OAEG;IACH,SAAgB,uBAAuB,CACrC,YAAY,EAAE,IAAI,CAAC,QAAQ,EAC3B,OAAO,EAAE,eAAe,EACxB,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,OAAO,EACpB,YAAY,EAAE,OAAO,EACrB,cAAc,EAAE,KAAK,EACrB,SAAS,EAAE,OAAO,EAClB,WAAW,EAAE,KAAK,GACjB,IAAI,CAgEN;CACF"} \ No newline at end of file diff --git a/Extensions/TileMap/helper/dts/render/ldtk/LDtkPixiHelper.d.ts b/Extensions/TileMap/helper/dts/render/ldtk/LDtkPixiHelper.d.ts index cdad7797646d..bad309cf8140 100644 --- a/Extensions/TileMap/helper/dts/render/ldtk/LDtkPixiHelper.d.ts +++ b/Extensions/TileMap/helper/dts/render/ldtk/LDtkPixiHelper.d.ts @@ -1,7 +1,5 @@ import { TileTextureCache } from '../TileTextureCache'; import { LDtkTileMap } from '../../load/ldtk/LDtkFormat'; -type Texture = PIXI.BaseTexture; -type TextureLoader = (textureName: string) => PIXI.BaseTexture; export declare namespace LDtkPixiHelper { /** * Split an atlas image into Pixi textures. @@ -15,9 +13,8 @@ export declare namespace LDtkPixiHelper { function parseAtlas( tileMap: LDtkTileMap, levelIndex: number, - atlasTexture: Texture | null, - getTexture: TextureLoader + atlasTexture: PIXI.Texture | null, + getTexture: (textureName: string) => PIXI.Texture ): TileTextureCache | null; } -export {}; //# sourceMappingURL=LDtkPixiHelper.d.ts.map diff --git a/Extensions/TileMap/helper/dts/render/ldtk/LDtkPixiHelper.d.ts.map b/Extensions/TileMap/helper/dts/render/ldtk/LDtkPixiHelper.d.ts.map index 6437d528afb1..8308b1c65c13 100644 --- a/Extensions/TileMap/helper/dts/render/ldtk/LDtkPixiHelper.d.ts.map +++ b/Extensions/TileMap/helper/dts/render/ldtk/LDtkPixiHelper.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"LDtkPixiHelper.d.ts","sourceRoot":"","sources":["../../../src/render/ldtk/LDtkPixiHelper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAkB,MAAM,4BAA4B,CAAC;AAGzE,KAAK,OAAO,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AAC/C,KAAK,aAAa,GAAG,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AAmC9E,yBAAiB,cAAc,CAAC;IAC9B;;;;;;;;OAQG;IACH,SAAgB,UAAU,CACxB,OAAO,EAAE,WAAW,EACpB,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,OAAO,GAAG,IAAI,EAC5B,UAAU,EAAE,aAAa,GACxB,gBAAgB,GAAG,IAAI,CAoFzB;CACF"} \ No newline at end of file +{"version":3,"file":"LDtkPixiHelper.d.ts","sourceRoot":"","sources":["../../../src/render/ldtk/LDtkPixiHelper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAkB,MAAM,4BAA4B,CAAC;AAoCzE,yBAAiB,cAAc,CAAC;IAC9B;;;;;;;;OAQG;IACH,SAAgB,UAAU,CACxB,OAAO,EAAE,WAAW,EACpB,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,IAAI,CAAC,OAAO,GAAG,IAAI,EACjC,UAAU,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC,OAAO,GAChD,gBAAgB,GAAG,IAAI,CAoFzB;CACF"} \ No newline at end of file diff --git a/Extensions/TileMap/helper/dts/render/tiled/TiledPixiHelper.d.ts b/Extensions/TileMap/helper/dts/render/tiled/TiledPixiHelper.d.ts index c3d61484d162..b2046c1236a5 100644 --- a/Extensions/TileMap/helper/dts/render/tiled/TiledPixiHelper.d.ts +++ b/Extensions/TileMap/helper/dts/render/tiled/TiledPixiHelper.d.ts @@ -13,8 +13,8 @@ export declare namespace TiledPixiHelper { function parseAtlas( tileMap: TiledTileMap, levelIndex: number, - atlasTexture: PIXI.BaseTexture | null, - getTexture: (textureName: string) => PIXI.BaseTexture + atlasTexture: PIXI.Texture | null, + getTexture: (textureName: string) => PIXI.Texture ): TileTextureCache | null; } //# sourceMappingURL=TiledPixiHelper.d.ts.map diff --git a/Extensions/TileMap/helper/dts/render/tiled/TiledPixiHelper.d.ts.map b/Extensions/TileMap/helper/dts/render/tiled/TiledPixiHelper.d.ts.map index 2a5028f13e80..8cc2fa185769 100644 --- a/Extensions/TileMap/helper/dts/render/tiled/TiledPixiHelper.d.ts.map +++ b/Extensions/TileMap/helper/dts/render/tiled/TiledPixiHelper.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"TiledPixiHelper.d.ts","sourceRoot":"","sources":["../../../src/render/tiled/TiledPixiHelper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAG5D,yBAAiB,eAAe,CAAC;IAC/B;;;;;;;;OAQG;IACH,SAAgB,UAAU,CACxB,OAAO,EAAE,YAAY,EACrB,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,IAAI,EACpD,UAAU,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,GACnE,gBAAgB,GAAG,IAAI,CA8FzB;CACF"} \ No newline at end of file +{"version":3,"file":"TiledPixiHelper.d.ts","sourceRoot":"","sources":["../../../src/render/tiled/TiledPixiHelper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAG5D,yBAAiB,eAAe,CAAC;IAC/B;;;;;;;;OAQG;IACH,SAAgB,UAAU,CACxB,OAAO,EAAE,YAAY,EACrB,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,IAAI,CAAC,OAAO,GAAG,IAAI,EACjC,UAAU,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC,OAAO,GAChD,gBAAgB,GAAG,IAAI,CA8FzB;CACF"} \ No newline at end of file diff --git a/Extensions/TileMap/tilemapruntimeobject.ts b/Extensions/TileMap/tilemapruntimeobject.ts index d5f0d725d708..1ebcfe9ea879 100644 --- a/Extensions/TileMap/tilemapruntimeobject.ts +++ b/Extensions/TileMap/tilemapruntimeobject.ts @@ -136,11 +136,7 @@ namespace gdjs { this._tilemapJsonFile, textureName ); - return (game - .getImageManager() - .getPIXITexture(mappedName) as unknown) as PIXI.BaseTexture< - PIXI.Resource - >; + return game.getImageManager().getPIXITexture(mappedName); }, this._tilemapAtlasImage, this._tilemapJsonFile, diff --git a/SharedLibs/TileMapHelper/src/render/TileMapManager.ts b/SharedLibs/TileMapHelper/src/render/TileMapManager.ts index 7031d71fb8f0..36d9ad5bcc49 100644 --- a/SharedLibs/TileMapHelper/src/render/TileMapManager.ts +++ b/SharedLibs/TileMapHelper/src/render/TileMapManager.ts @@ -132,7 +132,7 @@ export class TileMapManager { tileSetJsonResourceName: string, callback: (tileMapFileContent: TileMapFileContent | null) => void ) => void, - getTexture: (textureName: string) => PIXI.BaseTexture, + getTexture: (textureName: string) => PIXI.Texture, atlasImageResourceName: string, tileMapJsonResourceName: string, tileSetJsonResourceName: string, diff --git a/SharedLibs/TileMapHelper/src/render/TileMapPixiHelper.ts b/SharedLibs/TileMapHelper/src/render/TileMapPixiHelper.ts index 1b6359274e37..8604769c208a 100644 --- a/SharedLibs/TileMapHelper/src/render/TileMapPixiHelper.ts +++ b/SharedLibs/TileMapHelper/src/render/TileMapPixiHelper.ts @@ -23,8 +23,8 @@ export namespace PixiTileMapHelper { export function parseAtlas( tileMap: TileMapFileContent, levelIndex: number, - atlasTexture: PIXI.BaseTexture | null, - getTexture: (textureName: string) => PIXI.BaseTexture + atlasTexture: PIXI.Texture | null, + getTexture: (textureName: string) => PIXI.Texture ): TileTextureCache | null { if (tileMap.kind === "ldtk") { return LDtkPixiHelper.parseAtlas( diff --git a/SharedLibs/TileMapHelper/src/render/ldtk/LDtkPixiHelper.ts b/SharedLibs/TileMapHelper/src/render/ldtk/LDtkPixiHelper.ts index 213c3657787b..44250b6fe3a6 100644 --- a/SharedLibs/TileMapHelper/src/render/ldtk/LDtkPixiHelper.ts +++ b/SharedLibs/TileMapHelper/src/render/ldtk/LDtkPixiHelper.ts @@ -2,20 +2,17 @@ import { TileTextureCache } from "../TileTextureCache"; import { LDtkTileMap, LDtkTilesetDef } from "../../load/ldtk/LDtkFormat"; import { getLDtkTileId } from "../../load/ldtk/LDtkTileMapLoaderHelper"; -type Texture = PIXI.BaseTexture; -type TextureLoader = (textureName: string) => PIXI.BaseTexture; - function getAtlasTexture( - atlasTextures: Record, + atlasTextures: Record, tilesetCache: Record, - getTexture: TextureLoader, + getTexture: (textureName: string) => PIXI.Texture, tilesetId: number -): Texture | null { +): PIXI.Texture | null { if (atlasTextures[tilesetId]) { return atlasTextures[tilesetId]; } - let texture: Texture | null = null; + let texture: PIXI.Texture | null = null; const tileset = tilesetCache[tilesetId]; if (tileset?.relPath) { @@ -51,8 +48,8 @@ export namespace LDtkPixiHelper { export function parseAtlas( tileMap: LDtkTileMap, levelIndex: number, - atlasTexture: Texture | null, - getTexture: TextureLoader + atlasTexture: PIXI.Texture | null, + getTexture: (textureName: string) => PIXI.Texture ): TileTextureCache | null { const level = tileMap.levels[levelIndex > -1 ? levelIndex : 0]; if (!level || !level.layerInstances) { @@ -68,7 +65,7 @@ export namespace LDtkPixiHelper { // List the tiles that have been loaded to Pixi by all the layers of the level. // The keys are a composition (getLDtkTileId) between the tileset's id and the tile's id. const levelTileCache: Record = {}; - const atlasTextures: Record = {}; + const atlasTextures: Record = {}; for (let iLayer = level.layerInstances.length - 1; iLayer >= 0; --iLayer) { const layer = level.layerInstances[iLayer]; @@ -113,7 +110,7 @@ export namespace LDtkPixiHelper { const [x, y] = tile.src; const rect = new PIXI.Rectangle(x, y, gridSize, gridSize); - const texture = new PIXI.Texture(atlasTexture, rect); + const texture = new PIXI.Texture(atlasTexture.baseTexture, rect); textureCache.setTexture(tileId, texture); } catch (error) { @@ -131,7 +128,7 @@ export namespace LDtkPixiHelper { if (level.bgRelPath) { const atlasTexture = getTexture(level.bgRelPath); const rect = new PIXI.Rectangle(0, 0, level.pxWid, level.pxHei); - const texture = new PIXI.Texture(atlasTexture!, rect); + const texture = new PIXI.Texture(atlasTexture!.baseTexture, rect); textureCache.setLevelBackgroundTexture(level.bgRelPath, texture); } diff --git a/SharedLibs/TileMapHelper/src/render/tiled/TiledPixiHelper.ts b/SharedLibs/TileMapHelper/src/render/tiled/TiledPixiHelper.ts index 0069ed505c08..98d8cb13124a 100644 --- a/SharedLibs/TileMapHelper/src/render/tiled/TiledPixiHelper.ts +++ b/SharedLibs/TileMapHelper/src/render/tiled/TiledPixiHelper.ts @@ -15,8 +15,8 @@ export namespace TiledPixiHelper { export function parseAtlas( tileMap: TiledTileMap, levelIndex: number, - atlasTexture: PIXI.BaseTexture | null, - getTexture: (textureName: string) => PIXI.BaseTexture + atlasTexture: PIXI.Texture | null, + getTexture: (textureName: string) => PIXI.Texture ): TileTextureCache | null { if (!tileMap.tiledversion) { console.warn( @@ -99,7 +99,7 @@ export namespace TiledPixiHelper { try { const rect = new PIXI.Rectangle(x, y, tilewidth, tileheight); - const texture = new PIXI.Texture(atlasTexture!, rect); + const texture = new PIXI.Texture(atlasTexture!.baseTexture, rect); textureCache.setTexture(tileId, texture); } catch (error) {