mirror of
https://github.com/billsonnn/nitro-renderer.git
synced 2025-01-18 14:36:26 +01:00
Updates
This commit is contained in:
parent
0d805b3b36
commit
faa37ebacb
@ -34,10 +34,6 @@ export class MessageClassManager
|
||||
{
|
||||
if(!header || !handler) return;
|
||||
|
||||
const existing = this._messageIdByEvent.get(handler);
|
||||
|
||||
if(existing) return;
|
||||
|
||||
this._messageIdByEvent.set(handler, header);
|
||||
}
|
||||
|
||||
@ -45,10 +41,6 @@ export class MessageClassManager
|
||||
{
|
||||
if(!header || !handler) return;
|
||||
|
||||
const existing = this._messageIdByComposer.get(handler);
|
||||
|
||||
if(existing) return;
|
||||
|
||||
this._messageIdByComposer.set(handler, header);
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Resource, Texture } from '@pixi/core';
|
||||
import { BaseTexture, Resource, Texture } from '@pixi/core';
|
||||
import { Spritesheet } from '@pixi/spritesheet';
|
||||
import { Dict } from '@pixi/utils';
|
||||
import { AssetManager } from '../../../../core/asset/AssetManager';
|
||||
@ -17,6 +17,7 @@ export class GraphicAssetCollection implements IGraphicAssetCollection
|
||||
private _referenceTimestamp: number;
|
||||
|
||||
private _name: string;
|
||||
private _baseTexture: BaseTexture;
|
||||
private _data: IAssetData;
|
||||
private _textures: Map<string, Texture<Resource>>;
|
||||
private _assets: Map<string, GraphicAsset>;
|
||||
@ -28,6 +29,7 @@ export class GraphicAssetCollection implements IGraphicAssetCollection
|
||||
if(!data) throw new Error('invalid_collection');
|
||||
|
||||
this._name = data.name;
|
||||
this._baseTexture = ((spritesheet && spritesheet.baseTexture) || null);
|
||||
this._data = data;
|
||||
this._textures = new Map();
|
||||
this._assets = new Map();
|
||||
@ -230,6 +232,11 @@ export class GraphicAssetCollection implements IGraphicAssetCollection
|
||||
return asset;
|
||||
}
|
||||
|
||||
public getTexture(name: string): Texture<Resource>
|
||||
{
|
||||
return this._textures.get(name);
|
||||
}
|
||||
|
||||
public getPaletteNames(): string[]
|
||||
{
|
||||
return Array.from(this._palettes.keys());
|
||||
@ -357,6 +364,11 @@ export class GraphicAssetCollection implements IGraphicAssetCollection
|
||||
return this._name;
|
||||
}
|
||||
|
||||
public get baseTexture(): BaseTexture
|
||||
{
|
||||
return this._baseTexture;
|
||||
}
|
||||
|
||||
public get data(): IAssetData
|
||||
{
|
||||
return this._data;
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Resource, Texture } from '@pixi/core';
|
||||
import { BaseTexture, Resource, Texture } from '@pixi/core';
|
||||
import { IAssetData } from '../../../../core/asset/interfaces';
|
||||
import { GraphicAssetPalette } from './GraphicAssetPalette';
|
||||
import { IGraphicAsset } from './IGraphicAsset';
|
||||
@ -11,6 +11,7 @@ export interface IGraphicAssetCollection
|
||||
define(data: IAssetData): void;
|
||||
getAsset(name: string): IGraphicAsset;
|
||||
getAssetWithPalette(name: string, paletteName: string): IGraphicAsset;
|
||||
getTexture(name: string): Texture<Resource>;
|
||||
getPaletteNames(): string[];
|
||||
getPaletteColors(paletteName: string): number[];
|
||||
getPalette(name: string): GraphicAssetPalette;
|
||||
@ -19,5 +20,6 @@ export interface IGraphicAssetCollection
|
||||
referenceCount: number;
|
||||
referenceTimestamp: number;
|
||||
name: string;
|
||||
baseTexture: BaseTexture;
|
||||
data: IAssetData;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user