This commit is contained in:
billsonnn 2024-03-23 10:37:29 -04:00
parent 5c14af3c47
commit f4d3eba455
6 changed files with 27 additions and 8 deletions

View File

@ -1,5 +1,5 @@
import { IPlaneDrawingData, IPlaneVisualization, IRoomObjectSpriteVisualization, IRoomPlane, IRoomRenderingCanvas, RoomObjectCategory, RoomObjectSpriteData } from '@nitrots/api';
import { GetPixi, Vector3d } from '@nitrots/utils';
import { GetStage, Vector3d } from '@nitrots/utils';
import { Point, Rectangle } from 'pixi.js';
import { RoomEngine } from '../RoomEngine';
import { PlaneDrawingData } from '../object';
@ -389,7 +389,7 @@ export class SpriteDataCollector
{
const _local_8 = _arg_2.geometry;
const _local_9 = this.sortRoomPlanes(visualization.planes, _arg_2, _arg_3);
const _local_10 = GetPixi().stage;
const _local_10 = GetStage();
for(const _local_11 of _local_9)
{
@ -435,13 +435,13 @@ export class SpriteDataCollector
{
const _local_22 = SpriteDataCollector.sortQuadPoints(_local_15, _local_16, _local_17, _local_18);
for(const _local_23 of _local_12.getDrawingDatas(_local_8))
/* for(const _local_23 of _local_12.getDrawingDatas(_local_8))
{
_local_23.cornerPoints = _local_22;
_local_23.z = _local_11.z;
_local_5.push(_local_23);
}
} */
}
}

View File

@ -0,0 +1,12 @@
import { AutoDetectOptions, Renderer, autoDetectRenderer } from 'pixi.js';
let renderer: Renderer = null;
export const PrepareRenderer = async (options: Partial<AutoDetectOptions>): Promise<Renderer> =>
{
renderer = await autoDetectRenderer(options);
return renderer;
}
export const GetRenderer = () => renderer;

View File

@ -0,0 +1,5 @@
import { Container } from 'pixi.js';
const stage = new Container();
export const GetStage = () => stage;

View File

@ -1,3 +1,3 @@
import { GetPixi } from './GetPixi';
import { Ticker } from 'pixi.js';
export const GetTicker = () => GetPixi().ticker;
export const GetTicker = () => Ticker.shared;

View File

@ -1,5 +1,5 @@
import { Container, ExtractImageOptions, ExtractOptions, ExtractSystem, GenerateTextureOptions, GetPixelsOutput, ICanvas, Matrix, RenderTexture, Renderer, Sprite, Texture } from 'pixi.js';
import { GetPixi } from './GetPixi';
import { GetRenderer } from './GetRenderer';
export class TextureUtils
{
@ -125,7 +125,7 @@ export class TextureUtils
public static getRenderer(): Renderer
{
return GetPixi().renderer;
return GetRenderer();
}
public static getExtractor(): ExtractSystem

View File

@ -5,6 +5,8 @@ export * from './BinaryWriter';
export * from './ColorConverter';
export * from './FurniId';
export * from './GetPixi';
export * from './GetRenderer';
export * from './GetStage';
export * from './GetTicker';
export * from './GetTickerFPS';
export * from './GetTickerTime';