mirror of
https://github.com/billsonnn/nitro-renderer.git
synced 2024-11-22 23:50:52 +01:00
Updates
This commit is contained in:
parent
d40d0ed30f
commit
20e2c371e5
@ -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);
|
||||
|
@ -43,7 +43,7 @@ export class RoomObjectSpriteVisualization implements IRoomObjectSpriteVisualiza
|
||||
|
||||
if(sprite) sprite.dispose();
|
||||
|
||||
this._sprites.pop();
|
||||
this._sprites.shift();
|
||||
}
|
||||
|
||||
this._sprites = null;
|
||||
|
@ -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
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user