mirror of
https://github.com/billsonnn/nitro-renderer.git
synced 2025-02-18 19:02:35 +01:00
Updates
This commit is contained in:
parent
5c14af3c47
commit
f4d3eba455
@ -1,5 +1,5 @@
|
|||||||
import { IPlaneDrawingData, IPlaneVisualization, IRoomObjectSpriteVisualization, IRoomPlane, IRoomRenderingCanvas, RoomObjectCategory, RoomObjectSpriteData } from '@nitrots/api';
|
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 { Point, Rectangle } from 'pixi.js';
|
||||||
import { RoomEngine } from '../RoomEngine';
|
import { RoomEngine } from '../RoomEngine';
|
||||||
import { PlaneDrawingData } from '../object';
|
import { PlaneDrawingData } from '../object';
|
||||||
@ -389,7 +389,7 @@ export class SpriteDataCollector
|
|||||||
{
|
{
|
||||||
const _local_8 = _arg_2.geometry;
|
const _local_8 = _arg_2.geometry;
|
||||||
const _local_9 = this.sortRoomPlanes(visualization.planes, _arg_2, _arg_3);
|
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)
|
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);
|
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.cornerPoints = _local_22;
|
||||||
_local_23.z = _local_11.z;
|
_local_23.z = _local_11.z;
|
||||||
|
|
||||||
_local_5.push(_local_23);
|
_local_5.push(_local_23);
|
||||||
}
|
} */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
12
packages/utils/src/GetRenderer.ts
Normal file
12
packages/utils/src/GetRenderer.ts
Normal 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;
|
5
packages/utils/src/GetStage.ts
Normal file
5
packages/utils/src/GetStage.ts
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
import { Container } from 'pixi.js';
|
||||||
|
|
||||||
|
const stage = new Container();
|
||||||
|
|
||||||
|
export const GetStage = () => stage;
|
@ -1,3 +1,3 @@
|
|||||||
import { GetPixi } from './GetPixi';
|
import { Ticker } from 'pixi.js';
|
||||||
|
|
||||||
export const GetTicker = () => GetPixi().ticker;
|
export const GetTicker = () => Ticker.shared;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { Container, ExtractImageOptions, ExtractOptions, ExtractSystem, GenerateTextureOptions, GetPixelsOutput, ICanvas, Matrix, RenderTexture, Renderer, Sprite, Texture } from 'pixi.js';
|
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
|
export class TextureUtils
|
||||||
{
|
{
|
||||||
@ -125,7 +125,7 @@ export class TextureUtils
|
|||||||
|
|
||||||
public static getRenderer(): Renderer
|
public static getRenderer(): Renderer
|
||||||
{
|
{
|
||||||
return GetPixi().renderer;
|
return GetRenderer();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static getExtractor(): ExtractSystem
|
public static getExtractor(): ExtractSystem
|
||||||
|
@ -5,6 +5,8 @@ export * from './BinaryWriter';
|
|||||||
export * from './ColorConverter';
|
export * from './ColorConverter';
|
||||||
export * from './FurniId';
|
export * from './FurniId';
|
||||||
export * from './GetPixi';
|
export * from './GetPixi';
|
||||||
|
export * from './GetRenderer';
|
||||||
|
export * from './GetStage';
|
||||||
export * from './GetTicker';
|
export * from './GetTicker';
|
||||||
export * from './GetTickerFPS';
|
export * from './GetTickerFPS';
|
||||||
export * from './GetTickerTime';
|
export * from './GetTickerTime';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user