cleanup RoomObjectSortableSpriteCacheItem

This commit is contained in:
Dank074 2021-05-09 02:29:43 -05:00
parent f5fee23147
commit 19d028e8da
3 changed files with 10 additions and 10 deletions

View File

@ -447,7 +447,7 @@ export class RoomSpriteCanvas implements IRoomRenderingCanvas
if(locationCache.locationChanged) update = true;
if(!sortableCache._Str_17574(visualization.instanceId, visualization.updateSpriteCounter) && !update)
if(!sortableCache.needsUpdate(visualization.instanceId, visualization.updateSpriteCounter) && !update)
{
return sortableCache.spriteCount;
}
@ -495,7 +495,7 @@ export class RoomSpriteCanvas implements IRoomRenderingCanvas
if(!this.isSpriteVisible(spriteX, spriteY, texture.width, texture.height)) continue;
}
let sortableSprite = sortableCache._Str_2505(spriteCount);
let sortableSprite = sortableCache.getSprite(spriteCount);
if(!sortableSprite)
{
@ -523,7 +523,7 @@ export class RoomSpriteCanvas implements IRoomRenderingCanvas
count++;
}
sortableCache._Str_20276(spriteCount);
sortableCache.setSpriteCount(spriteCount);
this._canvasUpdated = true;

View File

@ -67,7 +67,7 @@ export class RoomObjectCache
{
if(!item) continue;
const sprites = item.sprites && item.sprites._Str_9272;
const sprites = item.sprites && item.sprites.sprites;
if(!sprites || !sprites.length) continue;
@ -137,7 +137,7 @@ export class RoomObjectCache
for(const item of this._data.values())
{
for(const sprite of item.sprites._Str_9272)
for(const sprite of item.sprites.sprites)
{
if(sprite.sprite.spriteType === RoomObjectSpriteType._Str_8616) sprites.push(sprite);
}

View File

@ -27,7 +27,7 @@ export class RoomObjectSortableSpriteCacheItem
public dispose(): void
{
this._Str_20276(0);
this.setSpriteCount(0);
}
public addSprite(sprite: SortableSprite): void
@ -35,17 +35,17 @@ export class RoomObjectSortableSpriteCacheItem
this._sprites.push(sprite);
}
public _Str_2505(k: number): SortableSprite
public getSprite(k: number): SortableSprite
{
return this._sprites[k];
}
public get _Str_9272(): SortableSprite[]
public get sprites(): SortableSprite[]
{
return this._sprites;
}
public _Str_17574(k: number, _arg_2: number): boolean
public needsUpdate(k: number, _arg_2: number): boolean
{
if((k === this._updateId1) && (_arg_2 === this._updateId2)) return false;
@ -55,7 +55,7 @@ export class RoomObjectSortableSpriteCacheItem
return true;
}
public _Str_20276(k: number): void
public setSpriteCount(k: number): void
{
if(k < this._sprites.length)
{