This commit is contained in:
billsonnn 2024-03-26 16:35:27 -04:00
parent d40d0ed30f
commit 20e2c371e5
5 changed files with 19 additions and 6 deletions

View File

@ -19,6 +19,8 @@ export class AssetManager implements IAssetManager
{
if(!name || !texture) return;
texture.label = name;
this._textures.set(name, texture);
}
@ -147,6 +149,8 @@ export class AssetManager implements IAssetManager
spritesheet = new Spritesheet(texture, data.spritesheet);
await spritesheet.parse();
spritesheet.textureSource.label = data.name ?? null;
}
this.createCollection(data, spritesheet);

View File

@ -43,7 +43,7 @@ export class RoomObjectSpriteVisualization implements IRoomObjectSpriteVisualiza
if(sprite) sprite.dispose();
this._sprites.pop();
this._sprites.shift();
}
this._sprites = null;

View File

@ -108,7 +108,14 @@ export class RoomPlane implements IRoomPlane
if(this._planeSprite) this._planeSprite.destroy();
if(this._planeTexture) this._planeTexture = null;
if(this._planeTexture)
{
//@ts-ignore
if(this._planeTexture.source?.hitMap) this._planeTexture.source.hitMap = null;
this._planeTexture.destroy(true);
this._planeTexture = null;
}
this._disposed = true;
}
@ -344,12 +351,15 @@ export class RoomPlane implements IRoomPlane
if(!this._planeTexture) this._planeTexture = TextureUtils.createRenderTexture(this._width, this._height);
this._planeTexture.source.label = `room_plane_${ this._uniqueId.toString() }`;
if(needsUpdate)
{
GetRenderer().render({
target: this._planeTexture,
container: this._planeSprite,
transform: this.getMatrixForDimensions(this._planeSprite.width, this._planeSprite.height)
transform: this.getMatrixForDimensions(this._planeSprite.width, this._planeSprite.height),
clear: true
});
}

View File

@ -317,11 +317,10 @@ export class RoomVisualization extends RoomObjectSpriteVisualization implements
if(plane) plane.dispose();
this._planes.pop();
this._planes.shift();
}
this._planes = [];
this._planes = [];
}
this._isPlaneSet = false;

View File

@ -155,7 +155,7 @@ export class PlaneMaskManager
if(!texture) return true;
const point = new Point((posX + asset.offsetX), (posY + asset.offsetY));
const point = new Point(Math.round(posX) + asset.offsetX, Math.round(posY) + asset.offsetY);
const matrix = new Matrix();