From 16807ff08f3adb6c8edc2a15fdbda92591efac9a Mon Sep 17 00:00:00 2001 From: Bill Date: Sun, 13 Jun 2021 02:17:00 -0400 Subject: [PATCH] Fix calculateVertices issues --- src/room/object/visualization/utils/index.ts | 2 +- src/room/renderer/RoomSpriteCanvas.ts | 6 +++--- src/room/renderer/utils/ExtendedSprite.ts | 17 ++++------------- 3 files changed, 8 insertions(+), 17 deletions(-) diff --git a/src/room/object/visualization/utils/index.ts b/src/room/object/visualization/utils/index.ts index fbad1632..e65d8bbf 100644 --- a/src/room/object/visualization/utils/index.ts +++ b/src/room/object/visualization/utils/index.ts @@ -1,5 +1,5 @@ export * from './GraphicAsset'; -export * from './GraphicAssetCollection'; +//export * from './GraphicAssetCollection'; export * from './GraphicAssetPalette'; export * from './IGraphicAsset'; export * from './IGraphicAssetCollection'; diff --git a/src/room/renderer/RoomSpriteCanvas.ts b/src/room/renderer/RoomSpriteCanvas.ts index e2097a0b..6b45a696 100644 --- a/src/room/renderer/RoomSpriteCanvas.ts +++ b/src/room/renderer/RoomSpriteCanvas.ts @@ -549,11 +549,11 @@ export class RoomSpriteCanvas implements IRoomRenderingCanvas { if((index < 0) || (index >= this._spriteCount)) return null; - const sprite = this._display.getChildAt(index); + const sprite = (this._display.getChildAt(index) as ExtendedSprite); if(!sprite) return null; - return sprite as ExtendedSprite; + return sprite; } protected getExtendedSpriteIdentifier(sprite: ExtendedSprite): string @@ -678,7 +678,7 @@ export class RoomSpriteCanvas implements IRoomRenderingCanvas extendedSprite.offsetX = sprite.offsetX; extendedSprite.offsetY = sprite.offsetY; extendedSprite.name = sprite.name; - extendedSprite.varyingDepth = sprite.varyingDepth; + extendedSprite.varyingDepth = sprite.varyingDepth; extendedSprite.clickHandling = sprite.clickHandling; extendedSprite.blendMode = sprite.blendMode; extendedSprite.filters = sprite.filters; diff --git a/src/room/renderer/utils/ExtendedSprite.ts b/src/room/renderer/utils/ExtendedSprite.ts index aceeed9b..658bba94 100644 --- a/src/room/renderer/utils/ExtendedSprite.ts +++ b/src/room/renderer/utils/ExtendedSprite.ts @@ -1,4 +1,4 @@ -import { BaseTexture, BLEND_MODES, Point, Renderer, RenderTexture, Sprite, Texture } from 'pixi.js'; +import { BaseTexture, BLEND_MODES, Point, RenderTexture, Sprite, Texture } from 'pixi.js'; import { Nitro } from '../../../nitro/Nitro'; export class ExtendedSprite extends Sprite @@ -38,20 +38,11 @@ export class ExtendedSprite extends Sprite return true; } - public render(renderer: Renderer): void + public calculateVertices(): void { - try - { - //@ts-ignore - if(!this._texture || !this._texture._uvs || !this._texture._uvs.uvsFloat32) return; - } + if(!this.texture.orig) return; - catch (err) - { - return; - } - - super.render(renderer); + super.calculateVertices(); } public setTexture(texture: Texture): void