From 19d028e8da12ec94c4915ba9931dc250fd88bd86 Mon Sep 17 00:00:00 2001 From: Dank074 Date: Sun, 9 May 2021 02:29:43 -0500 Subject: [PATCH] cleanup RoomObjectSortableSpriteCacheItem --- src/room/renderer/RoomSpriteCanvas.ts | 6 +++--- src/room/renderer/cache/RoomObjectCache.ts | 4 ++-- .../cache/RoomObjectSortableSpriteCacheItem.ts | 10 +++++----- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/room/renderer/RoomSpriteCanvas.ts b/src/room/renderer/RoomSpriteCanvas.ts index 4c09710f..4aabceb9 100644 --- a/src/room/renderer/RoomSpriteCanvas.ts +++ b/src/room/renderer/RoomSpriteCanvas.ts @@ -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; diff --git a/src/room/renderer/cache/RoomObjectCache.ts b/src/room/renderer/cache/RoomObjectCache.ts index c080769c..8c39578d 100644 --- a/src/room/renderer/cache/RoomObjectCache.ts +++ b/src/room/renderer/cache/RoomObjectCache.ts @@ -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); } diff --git a/src/room/renderer/cache/RoomObjectSortableSpriteCacheItem.ts b/src/room/renderer/cache/RoomObjectSortableSpriteCacheItem.ts index 8b5c0c2b..e90db65d 100644 --- a/src/room/renderer/cache/RoomObjectSortableSpriteCacheItem.ts +++ b/src/room/renderer/cache/RoomObjectSortableSpriteCacheItem.ts @@ -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) {