mirror of
https://github.com/billsonnn/nitro-renderer.git
synced 2024-11-23 08:00:51 +01:00
Update to pixi-7-2-4
This commit is contained in:
parent
c95b1e852b
commit
1e375e59ac
57
package.json
57
package.json
@ -22,38 +22,31 @@
|
||||
},
|
||||
"main": "./index",
|
||||
"dependencies": {
|
||||
"@pixi/app": "~6.5.0",
|
||||
"@pixi/basis": "~6.5.0",
|
||||
"@pixi/canvas-display": "~6.5.0",
|
||||
"@pixi/canvas-extract": "~6.5.0",
|
||||
"@pixi/canvas-renderer": "~6.5.0",
|
||||
"@pixi/constants": "~6.5.0",
|
||||
"@pixi/core": "~6.5.0",
|
||||
"@pixi/display": "~6.5.0",
|
||||
"@pixi/events": "~6.5.0",
|
||||
"@pixi/extensions": "~6.5.0",
|
||||
"@pixi/extract": "~6.5.0",
|
||||
"@pixi/filter-alpha": "~6.5.0",
|
||||
"@pixi/filter-color-matrix": "~6.5.0",
|
||||
"@pixi/graphics": "~6.5.0",
|
||||
"@pixi/graphics-extras": "~6.5.0",
|
||||
"@pixi/interaction": "~6.5.0",
|
||||
"@pixi/loaders": "~6.5.0",
|
||||
"@pixi/math": "~6.5.0",
|
||||
"@pixi/math-extras": "~6.5.0",
|
||||
"@pixi/mixin-cache-as-bitmap": "~6.5.0",
|
||||
"@pixi/mixin-get-child-by-name": "~6.5.0",
|
||||
"@pixi/mixin-get-global-position": "~6.5.0",
|
||||
"@pixi/polyfill": "~6.5.0",
|
||||
"@pixi/runner": "~6.5.0",
|
||||
"@pixi/settings": "~6.5.0",
|
||||
"@pixi/sprite": "~6.5.0",
|
||||
"@pixi/sprite-tiling": "~6.5.0",
|
||||
"@pixi/spritesheet": "~6.5.0",
|
||||
"@pixi/text": "~6.5.0",
|
||||
"@pixi/ticker": "~6.5.0",
|
||||
"@pixi/tilemap": "^3.2.2",
|
||||
"@pixi/utils": "~6.5.0",
|
||||
"@pixi/app": "~7.2.4",
|
||||
"@pixi/assets": "^7.2.4",
|
||||
"@pixi/basis": "~7.2.4",
|
||||
"@pixi/canvas-display": "~7.2.4",
|
||||
"@pixi/canvas-extract": "~7.2.4",
|
||||
"@pixi/canvas-renderer": "~7.2.4",
|
||||
"@pixi/compressed-textures": "^7.2.4",
|
||||
"@pixi/core": "~7.2.4",
|
||||
"@pixi/display": "~7.2.4",
|
||||
"@pixi/events": "~7.2.4",
|
||||
"@pixi/extensions": "~7.2.4",
|
||||
"@pixi/extract": "~7.2.4",
|
||||
"@pixi/filter-alpha": "~7.2.4",
|
||||
"@pixi/filter-color-matrix": "~7.2.4",
|
||||
"@pixi/graphics": "~7.2.4",
|
||||
"@pixi/graphics-extras": "~7.2.4",
|
||||
"@pixi/math-extras": "~7.2.4",
|
||||
"@pixi/mixin-cache-as-bitmap": "~7.2.4",
|
||||
"@pixi/mixin-get-child-by-name": "~7.2.4",
|
||||
"@pixi/mixin-get-global-position": "~7.2.4",
|
||||
"@pixi/sprite": "~7.2.4",
|
||||
"@pixi/sprite-tiling": "~7.2.4",
|
||||
"@pixi/spritesheet": "~7.2.4",
|
||||
"@pixi/text": "~7.2.4",
|
||||
"@pixi/tilemap": "^4.0.0",
|
||||
"gifuct-js": "^2.1.2",
|
||||
"howler": "^2.2.3",
|
||||
"pako": "^2.0.4"
|
||||
|
@ -1,5 +1,4 @@
|
||||
import { Resource, Texture } from '@pixi/core';
|
||||
import { Rectangle } from '@pixi/math';
|
||||
import { Rectangle, Resource, Texture } from '@pixi/core';
|
||||
import { IGraphicAsset } from './IGraphicAsset';
|
||||
|
||||
export class GraphicAsset implements IGraphicAsset
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { BaseTexture, Resource, Texture } from '@pixi/core';
|
||||
import { Spritesheet } from '@pixi/spritesheet';
|
||||
import { Dict } from '@pixi/utils';
|
||||
import { GetTickerTime } from '../../pixi-proxy';
|
||||
import { Dict } from '../utils';
|
||||
import { GraphicAsset } from './GraphicAsset';
|
||||
import { GraphicAssetPalette } from './GraphicAssetPalette';
|
||||
import { IAsset } from './IAsset';
|
||||
|
@ -1,5 +1,4 @@
|
||||
import { Resource, Texture } from '@pixi/core';
|
||||
import { Rectangle } from '@pixi/math';
|
||||
import { Rectangle, Resource, Texture } from '@pixi/core';
|
||||
|
||||
export interface IGraphicAsset
|
||||
{
|
||||
|
@ -1,6 +1,5 @@
|
||||
import { RenderTexture } from '@pixi/core';
|
||||
import { Point, Rectangle, RenderTexture } from '@pixi/core';
|
||||
import { DisplayObject } from '@pixi/display';
|
||||
import { Point, Rectangle } from '@pixi/math';
|
||||
import { IRoomGeometry, IRoomManager, IRoomObject, IRoomObjectController, IRoomObjectLogicFactory, IRoomObjectVisualizationFactory, IRoomRendererFactory, IRoomRenderingCanvas, IVector3D } from '../../room';
|
||||
import { IPetCustomPart } from '../avatar';
|
||||
import { IRoomSessionManager, ISessionDataManager } from '../session';
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Point } from '@pixi/math';
|
||||
import { Point } from '@pixi/core';
|
||||
import { IVector3D } from './IVector3D';
|
||||
|
||||
export interface IRoomGeometry
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Point } from '@pixi/math';
|
||||
import { Point } from '@pixi/core';
|
||||
|
||||
export interface IPlaneDrawingData
|
||||
{
|
||||
|
@ -1,5 +1,4 @@
|
||||
import { RenderTexture } from '@pixi/core';
|
||||
import { Rectangle } from '@pixi/math';
|
||||
import { Rectangle, RenderTexture } from '@pixi/core';
|
||||
import { IRoomGeometry } from '../../IRoomGeometry';
|
||||
import { IRoomObject } from '../IRoomObject';
|
||||
import { IObjectVisualizationData } from './IRoomObjectVisualizationData';
|
||||
|
@ -1,9 +1,8 @@
|
||||
import { RenderTexture } from '@pixi/core';
|
||||
import { Point, RenderTexture } from '@pixi/core';
|
||||
import { DisplayObject } from '@pixi/display';
|
||||
import { Point } from '@pixi/math';
|
||||
import { IRoomGeometry } from '../IRoomGeometry';
|
||||
import { ISortableSprite } from '../object';
|
||||
import { RoomObjectSpriteData } from '../RoomObjectSpriteData';
|
||||
import { ISortableSprite } from '../object';
|
||||
import { IRoomCanvasMouseListener } from './IRoomCanvasMouseListener';
|
||||
|
||||
export interface IRoomRenderingCanvas
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { Application, IApplicationOptions } from '@pixi/app';
|
||||
import { SCALE_MODES } from '@pixi/constants';
|
||||
import { settings } from '@pixi/settings';
|
||||
import { BaseTexture, TextureGCSystem, settings } from '@pixi/core';
|
||||
import { AssetManager, IAvatarRenderManager, ICommunicationManager, IConfigurationManager, IEventDispatcher, ILinkEventTracker, ILocalizationManager, IRoomCameraWidgetManager, IRoomEngine, ISessionDataManager, ISoundManager, NitroConfiguration, NitroLogger } from '../api';
|
||||
import { EventDispatcher } from '../common';
|
||||
import { GetTicker, PixiApplicationProxy } from '../pixi-proxy';
|
||||
@ -21,9 +21,10 @@ import { HabboWebTools } from './utils/HabboWebTools';
|
||||
|
||||
LegacyExternalInterface.available;
|
||||
|
||||
settings.SCALE_MODE = (!(window.devicePixelRatio % 1)) ? SCALE_MODES.NEAREST : SCALE_MODES.LINEAR;
|
||||
BaseTexture.defaultOptions.scaleMode = (!(window.devicePixelRatio % 1)) ? SCALE_MODES.NEAREST : SCALE_MODES.LINEAR;
|
||||
TextureGCSystem.defaultMaxIdle = 120;
|
||||
|
||||
settings.ROUND_PIXELS = true;
|
||||
settings.GC_MAX_IDLE = 120;
|
||||
|
||||
export class Nitro implements INitro
|
||||
{
|
||||
@ -45,7 +46,7 @@ export class Nitro implements INitro
|
||||
private _soundManager: ISoundManager = new SoundManager();
|
||||
private _linkTrackers: ILinkEventTracker[] = [];
|
||||
|
||||
constructor(options?: IApplicationOptions)
|
||||
constructor(options?: Partial<IApplicationOptions>)
|
||||
{
|
||||
if(!Nitro.INSTANCE) Nitro.INSTANCE = this;
|
||||
|
||||
|
@ -1,21 +1,10 @@
|
||||
import '@pixi/canvas-display';
|
||||
import { BatchRenderer, extensions } from '@pixi/core';
|
||||
import { Extract } from '@pixi/extract';
|
||||
import '@pixi/extract';
|
||||
import '@pixi/graphics-extras';
|
||||
import { InteractionManager } from '@pixi/interaction';
|
||||
import '@pixi/math-extras';
|
||||
import '@pixi/mixin-cache-as-bitmap';
|
||||
import '@pixi/mixin-get-child-by-name';
|
||||
import '@pixi/mixin-get-global-position';
|
||||
import '@pixi/polyfill';
|
||||
import { TilingSpriteRenderer } from '@pixi/sprite-tiling';
|
||||
import { SpritesheetLoader } from '@pixi/spritesheet';
|
||||
import { TickerPlugin } from '@pixi/ticker';
|
||||
|
||||
extensions.add(
|
||||
BatchRenderer,
|
||||
Extract,
|
||||
TilingSpriteRenderer,
|
||||
InteractionManager,
|
||||
SpritesheetLoader,
|
||||
TickerPlugin);
|
||||
import '@pixi/sprite-tiling';
|
||||
import '@pixi/spritesheet';
|
||||
import '@pixi/ticker';
|
||||
|
@ -1,7 +1,6 @@
|
||||
import { RenderTexture, Texture } from '@pixi/core';
|
||||
import { Rectangle, RenderTexture, Texture } from '@pixi/core';
|
||||
import { Container } from '@pixi/display';
|
||||
import { ColorMatrixFilter } from '@pixi/filter-color-matrix';
|
||||
import { Rectangle } from '@pixi/math';
|
||||
import { Sprite } from '@pixi/sprite';
|
||||
import { AdvancedMap, AvatarAction, AvatarDirectionAngle, AvatarScaleType, AvatarSetType, IActionDefinition, IActiveActionData, IAdvancedMap, IAnimationLayerData, IAvatarDataContainer, IAvatarEffectListener, IAvatarFigureContainer, IAvatarImage, IGraphicAsset, IPartColor, ISpriteDataContainer } from '../../api';
|
||||
import { GetTickerTime, NitroContainer, NitroSprite, PaletteMapFilter, PixiApplicationProxy, TextureUtils } from '../../pixi-proxy';
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { Container } from '@pixi/display';
|
||||
import { Point } from '@pixi/math';
|
||||
import { Point } from '@pixi/core';
|
||||
import { Container } from '@pixi/display';
|
||||
|
||||
export class AvatarImageBodyPartContainer
|
||||
{
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Point } from '@pixi/math';
|
||||
import { Point } from '@pixi/core';
|
||||
import { AvatarDirectionAngle, IActionDefinition, IActiveActionData, IAssetAnimation, IAssetManager, IAvatarFigureContainer, IAvatarImage, IAvatarRenderManager, IFigureData, IFigurePartSet, IPartColor, IStructureData } from '../../api';
|
||||
import { EventDispatcher } from '../../common';
|
||||
import { AvatarImagePartContainer } from './AvatarImagePartContainer';
|
||||
|
7
src/nitro/avatar/cache/AvatarImageCache.ts
vendored
7
src/nitro/avatar/cache/AvatarImageCache.ts
vendored
@ -1,12 +1,11 @@
|
||||
import { Texture } from '@pixi/core';
|
||||
import { Matrix, Point, Rectangle } from '@pixi/math';
|
||||
import { Matrix, Point, Rectangle, Texture } from '@pixi/core';
|
||||
import { AvatarDirectionAngle, AvatarFigurePartType, AvatarScaleType, GeometryType, IActiveActionData, IAvatarImage, RoomObjectSpriteData } from '../../../api';
|
||||
import { GetTickerTime, NitroContainer, NitroSprite } from '../../../pixi-proxy';
|
||||
import { AssetAliasCollection } from '../alias';
|
||||
import { AvatarAnimationLayerData } from '../animation';
|
||||
import { AvatarImageBodyPartContainer } from '../AvatarImageBodyPartContainer';
|
||||
import { AvatarImagePartContainer } from '../AvatarImagePartContainer';
|
||||
import { AvatarStructure } from '../AvatarStructure';
|
||||
import { AssetAliasCollection } from '../alias';
|
||||
import { AvatarAnimationLayerData } from '../animation';
|
||||
import { AvatarCanvas } from '../structure';
|
||||
import { AvatarImageActionCache } from './AvatarImageActionCache';
|
||||
import { AvatarImageBodyPartCache } from './AvatarImageBodyPartCache';
|
||||
|
3
src/nitro/avatar/cache/ImageData.ts
vendored
3
src/nitro/avatar/cache/ImageData.ts
vendored
@ -1,6 +1,5 @@
|
||||
import { Resource, Texture } from '@pixi/core';
|
||||
import { Point, Rectangle, Resource, Texture } from '@pixi/core';
|
||||
import { Container } from '@pixi/display';
|
||||
import { Point, Rectangle } from '@pixi/math';
|
||||
|
||||
export class ImageData
|
||||
{
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Point } from '@pixi/math';
|
||||
import { Point } from '@pixi/core';
|
||||
import { AvatarScaleType } from '../../../api';
|
||||
|
||||
export class AvatarCanvas
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Point } from '@pixi/math';
|
||||
import { Point } from '@pixi/core';
|
||||
import { AnimationActionPart } from './AnimationActionPart';
|
||||
|
||||
export class AnimationAction
|
||||
|
@ -1,6 +1,5 @@
|
||||
import { RenderTexture, Resource, Texture } from '@pixi/core';
|
||||
import { Matrix, Point, Rectangle, RenderTexture, Resource, Texture } from '@pixi/core';
|
||||
import { Container, DisplayObject } from '@pixi/display';
|
||||
import { Matrix, Point, Rectangle } from '@pixi/math';
|
||||
import { ICommunicationManager, IConnection, IFurnitureStackingHeightMap, IGetImageListener, IImageResult, ILegacyWallGeometry, IMessageComposer, IObjectData, IPetColorResult, IPetCustomPart, IRoomContentListener, IRoomContentLoader, IRoomCreator, IRoomEngine, IRoomEngineServices, IRoomGeometry, IRoomInstance, IRoomManager, IRoomManagerListener, IRoomObject, IRoomObjectController, IRoomObjectLogicFactory, IRoomObjectVisualizationFactory, IRoomRenderer, IRoomRendererFactory, IRoomRenderingCanvas, IRoomSessionManager, ISelectedRoomObjectData, ISessionDataManager, ITileObjectMap, IUpdateReceiver, IVector3D, LegacyDataType, MouseEventType, NitroConfiguration, NitroLogger, ObjectDataFactory, RoomControllerLevel, RoomObjectCategory, RoomObjectUserType, RoomObjectVariable, ToolbarIconEnum, Vector3d } from '../../api';
|
||||
import { NitroManager } from '../../common';
|
||||
import { BadgeImageReadyEvent, NitroEventDispatcher, NitroToolbarAnimateIconEvent, RoomBackgroundColorEvent, RoomDragEvent, RoomEngineEvent, RoomEngineObjectEvent, RoomObjectEvent, RoomObjectFurnitureActionEvent, RoomObjectMouseEvent, RoomSessionEvent, RoomToObjectOwnAvatarMoveEvent } from '../../events';
|
||||
@ -398,7 +397,6 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato
|
||||
const overlay = new NitroSprite(Texture.EMPTY);
|
||||
|
||||
overlay.name = RoomEngine.OVERLAY;
|
||||
overlay.interactive = false;
|
||||
|
||||
displayObject.addChild(overlay);
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Point } from '@pixi/math';
|
||||
import { Point } from '@pixi/core';
|
||||
import { IVector3D, Vector3d } from '../../../api';
|
||||
import { RoomFloorHole } from './RoomFloorHole';
|
||||
import { RoomMapData } from './RoomMapData';
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Point } from '@pixi/math';
|
||||
import { Point } from '@pixi/core';
|
||||
import { IVector3D, Vector3d } from '../../../api';
|
||||
|
||||
export class RoomWallData
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Point } from '@pixi/math';
|
||||
import { Point } from '@pixi/core';
|
||||
import { IRoomGeometry, IRoomObjectModel, MouseEventType, NitroConfiguration, RoomObjectVariable, Vector3d } from '../../../../../api';
|
||||
import { RoomObjectEvent, RoomObjectMouseEvent, RoomObjectTileMouseEvent, RoomObjectWallMouseEvent, RoomSpriteMouseEvent } from '../../../../../events';
|
||||
import { ColorConverter, RoomObjectLogicBase, RoomObjectUpdateMessage } from '../../../../../room';
|
||||
|
@ -1,5 +1,4 @@
|
||||
import { Resource, Texture } from '@pixi/core';
|
||||
import { Matrix } from '@pixi/math';
|
||||
import { Matrix, Resource, Texture } from '@pixi/core';
|
||||
import { IGraphicAsset, IRoomObjectSprite, RoomObjectVariable } from '../../../../../api';
|
||||
import { NitroSprite, TextureUtils } from '../../../../../pixi-proxy';
|
||||
import { IsometricImageFurniVisualization } from './IsometricImageFurniVisualization';
|
||||
|
@ -1,5 +1,4 @@
|
||||
import { RenderTexture, Resource, Texture } from '@pixi/core';
|
||||
import { Matrix } from '@pixi/math';
|
||||
import { Matrix, RenderTexture, Resource, Texture } from '@pixi/core';
|
||||
import { GetAssetManager, IGraphicAsset } from '../../../../../api';
|
||||
import { NitroSprite, PixiApplicationProxy } from '../../../../../pixi-proxy';
|
||||
import { FurnitureBBVisualization } from './FurnitureBBVisualization';
|
||||
|
@ -1,7 +1,6 @@
|
||||
import { RenderTexture, Texture } from '@pixi/core';
|
||||
import { Matrix, RenderTexture, Texture } from '@pixi/core';
|
||||
import { AlphaFilter } from '@pixi/filter-alpha';
|
||||
import { Graphics } from '@pixi/graphics';
|
||||
import { Matrix } from '@pixi/math';
|
||||
import { AdvancedMap, IAdvancedMap, IGraphicAsset, IParticleSystem, IRoomObjectSprite } from '../../../../../api';
|
||||
import { NitroPoint, NitroSprite, PixiApplicationProxy } from '../../../../../pixi-proxy';
|
||||
import { Vector3D } from '../../../../avatar';
|
||||
|
@ -1,5 +1,4 @@
|
||||
import { Resource, Texture } from '@pixi/core';
|
||||
import { Matrix } from '@pixi/math';
|
||||
import { Matrix, Resource, Texture } from '@pixi/core';
|
||||
import { IGraphicAsset } from '../../../../../api';
|
||||
import { NitroSprite, NitroTexture, TextureUtils } from '../../../../../pixi-proxy';
|
||||
import { FurnitureAnimatedVisualization } from './FurnitureAnimatedVisualization';
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Point } from '@pixi/math';
|
||||
import { Point } from '@pixi/core';
|
||||
import { IPlaneDrawingData } from '../../../../../api';
|
||||
|
||||
export class PlaneDrawingData implements IPlaneDrawingData
|
||||
|
@ -1,5 +1,4 @@
|
||||
import { Renderer, RenderTexture, Resource, Texture } from '@pixi/core';
|
||||
import { Matrix, Point } from '@pixi/math';
|
||||
import { Matrix, Point, Renderer, RenderTexture, Resource, Texture } from '@pixi/core';
|
||||
import { Sprite } from '@pixi/sprite';
|
||||
import { IRoomGeometry, IRoomPlane, IVector3D, Vector3d } from '../../../../../api';
|
||||
import { PixiApplicationProxy, PlaneTextureCache } from '../../../../../pixi-proxy';
|
||||
@ -51,7 +50,7 @@ export class RoomPlane implements IRoomPlane
|
||||
private _rectangleMasks: RoomPlaneRectangleMask[];
|
||||
private _maskChanged: boolean;
|
||||
private _maskBitmapData: RenderTexture;
|
||||
private _maskPixels: Uint8Array;
|
||||
private _maskPixels: Uint8Array | Uint8ClampedArray;
|
||||
private _bitmapMasksOld: RoomPlaneBitmapMask[];
|
||||
private _rectangleMasksOld: RoomPlaneRectangleMask[];
|
||||
private _cornerA: Vector3d;
|
||||
@ -862,7 +861,7 @@ export class RoomPlane implements IRoomPlane
|
||||
this.combineTextureMask(canvas, this._maskPixels);
|
||||
}
|
||||
|
||||
private combineTextureMask(canvas: RenderTexture, maskPixels: Uint8Array): void
|
||||
private combineTextureMask(canvas: RenderTexture, maskPixels: Uint8Array | Uint8ClampedArray): void
|
||||
{
|
||||
if(!canvas || !maskPixels) return;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Rectangle } from '@pixi/math';
|
||||
import { Rectangle } from '@pixi/core';
|
||||
import { AlphaTolerance, IObjectVisualizationData, IPlaneVisualization, IRoomGeometry, IRoomObjectModel, IRoomObjectSprite, IRoomPlane, RoomObjectSpriteType, RoomObjectVariable, Vector3d } from '../../../../../api';
|
||||
import { PlaneTextureCache } from '../../../../../pixi-proxy';
|
||||
import { RoomObjectSpriteVisualization } from '../../../../../room';
|
||||
|
@ -1,5 +1,4 @@
|
||||
import { RenderTexture } from '@pixi/core';
|
||||
import { Matrix, Point } from '@pixi/math';
|
||||
import { Matrix, Point, RenderTexture } from '@pixi/core';
|
||||
import { Sprite } from '@pixi/sprite';
|
||||
import { IAssetPlaneMaskData, IAssetPlaneTextureBitmap, IGraphicAssetCollection, IVector3D } from '../../../../../../api';
|
||||
import { PixiApplicationProxy } from '../../../../../../pixi-proxy';
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Point } from '@pixi/math';
|
||||
import { Point } from '@pixi/core';
|
||||
import { IGraphicAsset } from '../../../../../../../api';
|
||||
|
||||
export class AnimationItem
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Matrix, Point } from '@pixi/math';
|
||||
import { Matrix, Point } from '@pixi/core';
|
||||
import { Sprite } from '@pixi/sprite';
|
||||
import { TilingSprite } from '@pixi/sprite-tiling';
|
||||
import { IGraphicAsset, IVector3D } from '../../../../../../../api';
|
||||
|
@ -1,5 +1,4 @@
|
||||
import { RenderTexture } from '@pixi/core';
|
||||
import { Point, Rectangle } from '@pixi/math';
|
||||
import { Point, Rectangle, RenderTexture } from '@pixi/core';
|
||||
import { Sprite } from '@pixi/sprite';
|
||||
import { IVector3D, NitroLogger, Vector3d } from '../../../../../../../api';
|
||||
import { PlaneTextureCache, TextureUtils } from '../../../../../../../pixi-proxy';
|
||||
|
@ -1,5 +1,4 @@
|
||||
import { RenderTexture, Resource, Texture } from '@pixi/core';
|
||||
import { Point } from '@pixi/math';
|
||||
import { Point, RenderTexture, Resource, Texture } from '@pixi/core';
|
||||
import { IAssetPlaneMaterial, IAssetPlaneMaterialCellColumn, IAssetPlaneTexture, IAssetPlaneVisualization, IAssetPlaneVisualizationData, IAssetPlaneVisualizationLayer, IGraphicAsset, IGraphicAssetCollection, IRoomGeometry, IVector3D, Vector3d } from '../../../../../../../api';
|
||||
import { PlaneTextureCache } from '../../../../../../../pixi-proxy';
|
||||
import { Rasterizer, RoomGeometry } from '../../../../../../../room';
|
||||
|
@ -1,6 +1,5 @@
|
||||
import { RenderTexture, Texture } from '@pixi/core';
|
||||
import { Point, Rectangle, RenderTexture, Texture } from '@pixi/core';
|
||||
import { Container, DisplayObject } from '@pixi/display';
|
||||
import { Point, Rectangle } from '@pixi/math';
|
||||
import { Sprite } from '@pixi/sprite';
|
||||
import { IGetImageListener, IImageResult, IObjectData, IRoomEngine, IRoomObjectController, IRoomRenderingCanvas, IVector3D, LegacyDataType, RoomObjectCategory, RoomObjectUserType, RoomObjectVariable, Vector3d } from '../../../api';
|
||||
import { NitroEventDispatcher, RoomEngineEvent, RoomEngineObjectEvent } from '../../../events';
|
||||
|
@ -1,8 +1,8 @@
|
||||
import { Point, Rectangle } from '@pixi/math';
|
||||
import { Point, Rectangle } from '@pixi/core';
|
||||
import { IPlaneDrawingData, IPlaneVisualization, IRoomObjectSpriteVisualization, IRoomPlane, IRoomRenderingCanvas, RoomObjectCategory, RoomObjectSpriteData, Vector3d } from '../../../api';
|
||||
import { PixiApplicationProxy } from '../../../pixi-proxy';
|
||||
import { PlaneDrawingData } from '../object';
|
||||
import { RoomEngine } from '../RoomEngine';
|
||||
import { PlaneDrawingData } from '../object';
|
||||
|
||||
export class SpriteDataCollector
|
||||
{
|
||||
|
@ -1,3 +1,3 @@
|
||||
import { IPoint } from '@pixi/math';
|
||||
import { IPoint } from '@pixi/core';
|
||||
|
||||
export type INitroPoint = IPoint
|
||||
|
@ -1,4 +1,5 @@
|
||||
import { Point } from '@pixi/math';
|
||||
|
||||
import { Point } from '@pixi/core';
|
||||
import { INitroPoint } from './INitroPoint';
|
||||
|
||||
export class NitroPoint extends Point implements INitroPoint
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Polygon } from '@pixi/math';
|
||||
import { Polygon } from '@pixi/core';
|
||||
|
||||
export class NitroPolygon extends Polygon
|
||||
{}
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Rectangle } from '@pixi/math';
|
||||
import { Rectangle } from '@pixi/core';
|
||||
|
||||
export class NitroRectangle extends Rectangle
|
||||
{}
|
||||
|
@ -4,7 +4,7 @@ export class PixiApplicationProxy extends Application
|
||||
{
|
||||
private static INSTANCE: Application = null;
|
||||
|
||||
constructor(options?: IApplicationOptions)
|
||||
constructor(options?: Partial<IApplicationOptions>)
|
||||
{
|
||||
super(options);
|
||||
|
||||
|
@ -1,4 +0,0 @@
|
||||
import { InteractionEvent } from '@pixi/interaction';
|
||||
|
||||
export class PixiInteractionEventProxy extends InteractionEvent
|
||||
{}
|
@ -1,9 +1,8 @@
|
||||
import { AbstractRenderer, Renderer, RenderTexture, Texture } from '@pixi/core';
|
||||
import { ICanvas, IRenderer, Matrix, Rectangle, RenderTexture, Texture } from '@pixi/core';
|
||||
import { DisplayObject } from '@pixi/display';
|
||||
import { Extract } from '@pixi/extract';
|
||||
import { Matrix, Rectangle } from '@pixi/math';
|
||||
import { IExtract } from '@pixi/extract';
|
||||
import { Sprite } from '@pixi/sprite';
|
||||
import { PixiApplicationProxy } from './PixiApplicationProxy';
|
||||
import { TextureUtils } from './TextureUtils';
|
||||
|
||||
export class PlaneTextureCache
|
||||
{
|
||||
@ -87,43 +86,26 @@ export class PlaneTextureCache
|
||||
|
||||
public clearAndFillRenderTexture(renderTexture: RenderTexture, color: number = 16777215): RenderTexture
|
||||
{
|
||||
if(!renderTexture) return null;
|
||||
|
||||
const sprite = new Sprite(Texture.WHITE);
|
||||
|
||||
sprite.tint = color;
|
||||
|
||||
sprite.width = renderTexture.width;
|
||||
sprite.height = renderTexture.height;
|
||||
|
||||
return this.writeToRenderTexture(sprite, renderTexture);
|
||||
return TextureUtils.clearAndFillRenderTexture(renderTexture, color);
|
||||
}
|
||||
|
||||
public writeToRenderTexture(displayObject: DisplayObject, renderTexture: RenderTexture, clear: boolean = true, transform: Matrix = null): RenderTexture
|
||||
{
|
||||
if(!displayObject || !renderTexture) return null;
|
||||
|
||||
this.getRenderer().render(displayObject, {
|
||||
renderTexture,
|
||||
clear,
|
||||
transform
|
||||
});
|
||||
|
||||
return renderTexture;
|
||||
return TextureUtils.writeToRenderTexture(displayObject, renderTexture, clear, transform);
|
||||
}
|
||||
|
||||
public getPixels(displayObject: DisplayObject | RenderTexture, frame: Rectangle = null): Uint8Array
|
||||
public getPixels(displayObject: DisplayObject | RenderTexture, frame: Rectangle = null): Uint8Array | Uint8ClampedArray
|
||||
{
|
||||
return this.getExtractor().pixels(displayObject);
|
||||
return TextureUtils.getPixels(displayObject, frame);
|
||||
}
|
||||
|
||||
public getRenderer(): Renderer | AbstractRenderer
|
||||
public getRenderer(): IRenderer<ICanvas>
|
||||
{
|
||||
return PixiApplicationProxy.instance.renderer;
|
||||
return TextureUtils.getRenderer();
|
||||
}
|
||||
|
||||
public getExtractor(): Extract
|
||||
public getExtractor(): IExtract
|
||||
{
|
||||
return (this.getRenderer().plugins.extract as Extract);
|
||||
return TextureUtils.getExtractor();
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +1,6 @@
|
||||
import { AbstractRenderer, Renderer, RenderTexture, Resource, Texture } from '@pixi/core';
|
||||
import { ICanvas, IRenderer, Matrix, Rectangle, RenderTexture, Resource, settings, Texture } from '@pixi/core';
|
||||
import { DisplayObject } from '@pixi/display';
|
||||
import { Extract } from '@pixi/extract';
|
||||
import { Matrix, Rectangle } from '@pixi/math';
|
||||
import { settings } from '@pixi/settings';
|
||||
import { IExtract } from '@pixi/extract';
|
||||
import { Sprite } from '@pixi/sprite';
|
||||
import { PixiApplicationProxy } from './PixiApplicationProxy';
|
||||
|
||||
@ -42,7 +40,7 @@ export class TextureUtils
|
||||
return this.getExtractor().base64(target);
|
||||
}
|
||||
|
||||
public static generateCanvas(target: DisplayObject | RenderTexture): HTMLCanvasElement
|
||||
public static generateCanvas(target: DisplayObject | RenderTexture): ICanvas
|
||||
{
|
||||
if(!target) return null;
|
||||
|
||||
@ -111,18 +109,18 @@ export class TextureUtils
|
||||
return renderTexture;
|
||||
}
|
||||
|
||||
public static getPixels(displayObject: DisplayObject | RenderTexture, frame: Rectangle = null): Uint8Array
|
||||
public static getPixels(displayObject: DisplayObject | RenderTexture, frame: Rectangle = null): Uint8Array | Uint8ClampedArray
|
||||
{
|
||||
return this.getExtractor().pixels(displayObject);
|
||||
}
|
||||
|
||||
public static getRenderer(): Renderer | AbstractRenderer
|
||||
public static getRenderer(): IRenderer<ICanvas>
|
||||
{
|
||||
return PixiApplicationProxy.instance.renderer;
|
||||
}
|
||||
|
||||
public static getExtractor(): Extract
|
||||
public static getExtractor(): IExtract
|
||||
{
|
||||
return (this.getRenderer().plugins.extract as Extract);
|
||||
return this.getRenderer().extract;
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,4 @@
|
||||
export { POINT_STRUCT_SIZE } from '@pixi/tilemap';
|
||||
export * from './adjustment-filter';
|
||||
export * from './CopyChannelFilter';
|
||||
export * from './GetTicker';
|
||||
export * from './GetTickerFPS';
|
||||
@ -19,6 +18,6 @@ export * from './NitroTexture';
|
||||
export * from './NitroTilemap';
|
||||
export * from './PaletteMapFilter';
|
||||
export * from './PixiApplicationProxy';
|
||||
export * from './PixiInteractionEventProxy';
|
||||
export * from './RoomTextureUtils';
|
||||
export * from './TextureUtils';
|
||||
export * from './adjustment-filter';
|
||||
|
@ -1,5 +1,4 @@
|
||||
import { RenderTexture } from '@pixi/core';
|
||||
import { Point, Rectangle } from '@pixi/math';
|
||||
import { Point, Rectangle, RenderTexture } from '@pixi/core';
|
||||
import { IGraphicAssetCollection, IObjectVisualizationData, IRoomGeometry, IRoomObjectController, IRoomObjectSprite, IRoomObjectSpriteVisualization, RoomObjectSpriteData } from '../../../api';
|
||||
import { NitroContainer, NitroSprite, TextureUtils } from '../../../pixi-proxy';
|
||||
import { RoomObjectSprite } from './RoomObjectSprite';
|
||||
|
@ -1,7 +1,6 @@
|
||||
import { RenderTexture } from '@pixi/core';
|
||||
import { Matrix, Point, Rectangle, RenderTexture } from '@pixi/core';
|
||||
import { Container, DisplayObject } from '@pixi/display';
|
||||
import { Graphics } from '@pixi/graphics';
|
||||
import { Matrix, Point, Rectangle } from '@pixi/math';
|
||||
import { Sprite } from '@pixi/sprite';
|
||||
import { IRoomCanvasMouseListener, IRoomGeometry, IRoomObject, IRoomObjectSprite, IRoomObjectSpriteVisualization, IRoomRenderingCanvas, IRoomSpriteCanvasContainer, IRoomSpriteMouseEvent, MouseEventType, RoomObjectSpriteData, RoomObjectSpriteType, Vector3d } from '../../api';
|
||||
import { RoomSpriteMouseEvent } from '../../events';
|
||||
@ -124,8 +123,6 @@ export class RoomSpriteCanvas implements IRoomRenderingCanvas
|
||||
if(!this._master)
|
||||
{
|
||||
this._master = new NitroSprite();
|
||||
|
||||
this._master.interactiveChildren = false;
|
||||
}
|
||||
|
||||
if(!this._display)
|
||||
@ -237,7 +234,7 @@ export class RoomSpriteCanvas implements IRoomRenderingCanvas
|
||||
|
||||
if(this._master)
|
||||
{
|
||||
if(this._master.hitArea)
|
||||
/* if(this._master.hitArea)
|
||||
{
|
||||
const hitArea = (this._master.hitArea as Rectangle);
|
||||
|
||||
@ -247,7 +244,7 @@ export class RoomSpriteCanvas implements IRoomRenderingCanvas
|
||||
else
|
||||
{
|
||||
this._master.hitArea = new Rectangle(0, 0, width, height);
|
||||
}
|
||||
} */
|
||||
|
||||
if(this._master.filterArea)
|
||||
{
|
||||
|
@ -1,6 +1,5 @@
|
||||
import { BLEND_MODES } from '@pixi/constants';
|
||||
import { BaseTexture, Resource, Texture } from '@pixi/core';
|
||||
import { Point } from '@pixi/math';
|
||||
import { BaseTexture, Point, Resource, Texture } from '@pixi/core';
|
||||
import { Sprite } from '@pixi/sprite';
|
||||
import { AlphaTolerance } from '../../../api';
|
||||
import { TextureUtils } from '../../../pixi-proxy';
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Point } from '@pixi/math';
|
||||
import { Point } from '@pixi/core';
|
||||
|
||||
export class PointMath
|
||||
{
|
||||
|
@ -1,6 +1,5 @@
|
||||
import { Resource, Texture } from '@pixi/core';
|
||||
import { Matrix, Resource, Texture } from '@pixi/core';
|
||||
import { Graphics } from '@pixi/graphics';
|
||||
import { Matrix } from '@pixi/math';
|
||||
import { Sprite } from '@pixi/sprite';
|
||||
import { PixiApplicationProxy, TextureUtils } from '../../pixi-proxy';
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Point } from '@pixi/math';
|
||||
import { Point } from '@pixi/core';
|
||||
import { IRoomGeometry, IVector3D, Vector3d } from '../../api';
|
||||
|
||||
export class RoomGeometry implements IRoomGeometry
|
||||
|
Loading…
Reference in New Issue
Block a user