@combos-fun/plugin-renderer 0.1.12 → 0.1.14-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -339,6 +339,20 @@ function getSuportCompressedTextureFormats(gl) {
|
|
|
339
339
|
return result;
|
|
340
340
|
}
|
|
341
341
|
|
|
342
|
+
/** Pixi init options with engine-only quality fields removed. */
|
|
343
|
+
function pixiRenderOptions(params = {}, quality) {
|
|
344
|
+
const { maxPixelRatio: _maxPixelRatio, adaptivePixelRatio: _adaptivePixelRatio, pauseWhenHidden: _pauseWhenHidden, pixelRatio: _pixelRatio, devicePixelRatio: _devicePixelRatio, ...rest } = params;
|
|
345
|
+
return {
|
|
346
|
+
...rest,
|
|
347
|
+
resolution: quality.pixelRatio,
|
|
348
|
+
autoDensity: quality.autoDensity,
|
|
349
|
+
antialias: quality.antialias,
|
|
350
|
+
...(quality.powerPreference === 'default' ? {} : { powerPreference: quality.powerPreference }),
|
|
351
|
+
autoStart: true,
|
|
352
|
+
sharedTicker: true,
|
|
353
|
+
};
|
|
354
|
+
}
|
|
355
|
+
|
|
342
356
|
exports.RENDERER_TYPE = void 0;
|
|
343
357
|
(function (RENDERER_TYPE) {
|
|
344
358
|
RENDERER_TYPE[RENDERER_TYPE["UNKNOWN"] = 0] = "UNKNOWN";
|
|
@@ -350,12 +364,23 @@ let Renderer$2 = class Renderer extends engine.System {
|
|
|
350
364
|
super(...arguments);
|
|
351
365
|
this.application = null;
|
|
352
366
|
this.multiApps = [];
|
|
367
|
+
this.quality = null;
|
|
368
|
+
this.adaptive = null;
|
|
369
|
+
this.viewWidth = 0;
|
|
370
|
+
this.viewHeight = 0;
|
|
353
371
|
}
|
|
354
372
|
static { }
|
|
355
373
|
static { this.systemName = 'Renderer'; }
|
|
356
374
|
async init(params) {
|
|
357
375
|
this.params = params ?? {};
|
|
376
|
+
this.quality = engine.resolveRenderQuality(this.params, { adaptivePixelRatio: false });
|
|
377
|
+
this.adaptive = new engine.AdaptivePixelRatio({
|
|
378
|
+
pixelRatio: this.quality.pixelRatio,
|
|
379
|
+
ceiling: this.quality.pixelRatioCeiling,
|
|
380
|
+
enabled: this.quality.adaptivePixelRatio,
|
|
381
|
+
});
|
|
358
382
|
const app = await this.createApplication(this.params);
|
|
383
|
+
this.rememberView(app);
|
|
359
384
|
this.application = app;
|
|
360
385
|
this.game.canvas = app.canvas;
|
|
361
386
|
this.containerManager = new ContainerManager();
|
|
@@ -402,21 +427,27 @@ let Renderer$2 = class Renderer extends engine.System {
|
|
|
402
427
|
thisObserverInfo[key].push(...observerInfo[key]);
|
|
403
428
|
}
|
|
404
429
|
}
|
|
405
|
-
async createApplication(params) {
|
|
406
|
-
const
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
};
|
|
430
|
+
async createApplication(params = {}) {
|
|
431
|
+
const quality = engine.resolveRenderQuality(params, { adaptivePixelRatio: false });
|
|
432
|
+
const callerPreference = params.preference;
|
|
433
|
+
const initOptions = pixiRenderOptions(params, quality);
|
|
434
|
+
initOptions.preference = callerPreference ?? ['webgpu', 'webgl'];
|
|
411
435
|
const app = new rendererAdapter.Application();
|
|
412
436
|
try {
|
|
413
437
|
await app.init(initOptions);
|
|
414
438
|
}
|
|
415
439
|
catch {
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
440
|
+
if (callerPreference == null) {
|
|
441
|
+
try {
|
|
442
|
+
await app.init({ ...initOptions, preference: 'webgl' });
|
|
443
|
+
}
|
|
444
|
+
catch {
|
|
445
|
+
await app.init({ ...initOptions, preference: 'canvas' });
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
else {
|
|
449
|
+
await app.init({ ...initOptions, preference: 'canvas' });
|
|
450
|
+
}
|
|
420
451
|
}
|
|
421
452
|
pixi_js.Ticker.shared.stop();
|
|
422
453
|
pixi_js.Ticker.shared.autoStart = false;
|
|
@@ -464,8 +495,30 @@ let Renderer$2 = class Renderer extends engine.System {
|
|
|
464
495
|
return;
|
|
465
496
|
}
|
|
466
497
|
this.hierarchy.update();
|
|
498
|
+
if (engine.shouldPauseRendering(this.quality?.pauseWhenHidden !== false))
|
|
499
|
+
return;
|
|
500
|
+
const next = this.adaptive?.sample(e?.deltaTime ?? 0);
|
|
501
|
+
if (next != null)
|
|
502
|
+
this.applyPixelRatio(next);
|
|
467
503
|
this.application.ticker.update(e.time);
|
|
468
504
|
}
|
|
505
|
+
rememberView(app) {
|
|
506
|
+
const width = this.params?.width || app.renderer?.screen?.width || 0;
|
|
507
|
+
const height = this.params?.height || app.renderer?.screen?.height || 0;
|
|
508
|
+
if (width)
|
|
509
|
+
this.viewWidth = width;
|
|
510
|
+
if (height)
|
|
511
|
+
this.viewHeight = height;
|
|
512
|
+
}
|
|
513
|
+
applyPixelRatio(ratio) {
|
|
514
|
+
const renderer = this.application?.renderer;
|
|
515
|
+
if (!renderer || !(ratio > 0))
|
|
516
|
+
return;
|
|
517
|
+
renderer.resolution = ratio;
|
|
518
|
+
if (this.viewWidth > 0 && this.viewHeight > 0) {
|
|
519
|
+
renderer.resize(this.viewWidth, this.viewHeight);
|
|
520
|
+
}
|
|
521
|
+
}
|
|
469
522
|
onDestroy() {
|
|
470
523
|
this.application?.destroy();
|
|
471
524
|
for (const app of this.multiApps) {
|
|
@@ -485,6 +538,8 @@ let Renderer$2 = class Renderer extends engine.System {
|
|
|
485
538
|
return;
|
|
486
539
|
}
|
|
487
540
|
this.params = { ...this.params, width, height };
|
|
541
|
+
this.viewWidth = width;
|
|
542
|
+
this.viewHeight = height;
|
|
488
543
|
this.application.renderer.resize(width, height);
|
|
489
544
|
}
|
|
490
545
|
};
|
|
@@ -499,7 +554,7 @@ var Renderer$1 = Renderer$2;
|
|
|
499
554
|
/** Auto-generated by scripts/build-package.mjs — do not edit. */
|
|
500
555
|
Object.assign(Renderer$1, {
|
|
501
556
|
packageName: "@combos-fun/plugin-renderer",
|
|
502
|
-
packageVersion: "0.1.
|
|
557
|
+
packageVersion: "0.1.14-beta.0",
|
|
503
558
|
});
|
|
504
559
|
|
|
505
560
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-renderer.cjs.js","sources":["../lib/manager/RendererManager.ts","../lib/manager/ContainerManager.ts","../lib/Transform2D.ts","../lib/PixiHierarchy.ts","../lib/compressedTexture/ability.ts","../lib/System.ts","../lib/__combosPackageMeta.gen.ts","../lib/Renderer.ts","../lib/index.ts"],"sourcesContent":["import isEqual from 'lodash-es/isEqual';\nimport { GameObject, Game, ComponentChanged, OBSERVER_TYPE } from '@combos-fun/engine';\nimport Renderer from '../Renderer';\nimport RendererSystem from '../System';\n\nclass RendererManager {\n game: Game;\n rendererSystem: RendererSystem;\n constructor({ game, rendererSystem }) {\n this.game = game;\n this.rendererSystem = rendererSystem;\n }\n renderers: Renderer[] = [];\n register(...renderers: Renderer[]) {\n for (const renderer of renderers) {\n renderer.game = this.game;\n renderer.rendererManager = this.rendererSystem.rendererManager;\n renderer.containerManager = this.rendererSystem.containerManager;\n this.renderers.push(renderer);\n }\n }\n componentChanged(changes: ComponentChanged[]) {\n for (const changed of changes) {\n for (const renderer of this.renderers) {\n const props = renderer.observerInfo[changed.componentName];\n if (props) {\n if ([OBSERVER_TYPE.ADD, OBSERVER_TYPE.REMOVE].indexOf(changed.type) > -1) {\n try {\n renderer.componentChanged && renderer.componentChanged(changed);\n } catch (e) {\n console.error(`gameObject: ${changed.gameObject.name}, ${changed.componentName} is error.`, changed, e);\n }\n continue;\n }\n\n const index = props.findIndex(prop => {\n return isEqual(prop, changed.prop);\n });\n\n if (index > -1) {\n try {\n renderer.componentChanged && renderer.componentChanged(changed);\n } catch (e) {\n console.error(\n `gameObject: ${changed.gameObject && changed.gameObject.name}, ${\n changed.componentName\n } is componentChanged error.`,\n changed,\n e,\n );\n }\n }\n }\n }\n }\n }\n update(gameObject: GameObject) {\n for (const component of gameObject.components) {\n for (const renderer of this.renderers) {\n const cache = [];\n const props = renderer.observerInfo[component.name];\n if (props && cache.indexOf(gameObject) === -1) {\n cache.push(gameObject);\n try {\n renderer.rendererUpdate && renderer.rendererUpdate(gameObject);\n } catch (e) {\n console.info(`gameObject: ${gameObject.name}, ${component.name} is update error`, e);\n }\n }\n }\n }\n }\n}\nexport default RendererManager;\n","import { Point, ObservablePoint } from 'pixi.js';\nimport { Container } from '@combos-fun/renderer-adapter';\nimport type Transform2D from '../Transform2D';\n\nexport default class ContainerManager {\n containerMap: { [propName: number]: Container } = {};\n addContainer({ name, container }: { name: number; container: Container }) {\n this.containerMap[name] = container;\n }\n getContainer(name: number) {\n return this.containerMap[name];\n }\n removeContainer(name: number) {\n this.containerMap[name]?.destroy({ children: true });\n delete this.containerMap[name];\n }\n updateTransform({\n name,\n transform,\n parentSize,\n }: {\n name: number;\n transform: Transform2D;\n parentSize?: { width: number; height: number };\n }) {\n const container = this.containerMap[name];\n if (!container || !transform) return;\n const { anchor, origin, position, rotation, scale, size, skew } = transform;\n container.rotation = rotation;\n container.scale = scale as Point;\n container.pivot.x = size.width * origin.x;\n container.pivot.y = size.height * origin.y;\n container.skew = skew as ObservablePoint;\n let x = position.x;\n let y = position.y;\n if (parentSize) {\n x = x + parentSize.width * anchor.x;\n y = y + parentSize.height * anchor.y;\n }\n\n container.position = { x, y } as Point;\n }\n}\n","import { Component } from '@combos-fun/engine';\nimport type { ComponentParams } from '@combos-fun/engine';\nimport { Field } from '@combos-fun/inspector-decorator';\n\ninterface Vector2 {\n x: number;\n y: number;\n}\n\ninterface Size2 {\n width: number;\n height: number;\n}\n\nexport interface TransformMatrix {\n a: number;\n b: number;\n c: number;\n d: number;\n tx: number;\n ty: number;\n array?: number[];\n}\n\nexport interface Transform2DParams extends ComponentParams {\n position?: Vector2;\n size?: Size2;\n origin?: Vector2;\n anchor?: Vector2;\n scale?: Vector2;\n skew?: Vector2;\n rotation?: number;\n}\n\n/** 2D layout pose. Hierarchy lives on GameObject. */\nclass Transform2D extends Component<Transform2DParams> {\n static componentName: string = 'Transform2D';\n readonly name: string = 'Transform2D';\n\n worldTransform: TransformMatrix;\n\n init(params: Transform2DParams = {}) {\n const props = ['position', 'size', 'origin', 'anchor', 'scale', 'skew'];\n for (const key of props) {\n Object.assign(this[key], params[key]);\n }\n this.rotation = params.rotation ?? this.rotation;\n }\n\n @Field({\n type: 'vector2',\n step: 1,\n group: 'Transform2D',\n label: 'Position',\n description: 'Position on the design canvas (x right, y down).',\n })\n position: Vector2 = {x: 0, y: 0};\n\n @Field({\n type: 'size',\n step: 1,\n min: 0,\n group: 'Transform2D',\n label: 'Size',\n description: 'Width and height of the object in design pixels.',\n })\n size: Size2 = {width: 0, height: 0};\n\n @Field({\n type: 'vector2',\n step: 0.1,\n group: 'Transform2D',\n label: 'Origin',\n description: 'Local origin used for layout math.',\n })\n origin: Vector2 = {x: 0, y: 0};\n\n @Field({\n type: 'vector2',\n step: 0.1,\n group: 'Transform2D',\n label: 'Anchor',\n description: 'Anchor point (0–1) used when positioning and scaling.',\n })\n anchor: Vector2 = {x: 0, y: 0};\n\n @Field({\n type: 'vector2',\n step: 0.1,\n group: 'Transform2D',\n label: 'Scale',\n description: 'Scale multipliers on X and Y (1 = original size).',\n })\n scale: Vector2 = {x: 1, y: 1};\n\n @Field({\n type: 'vector2',\n step: 0.1,\n group: 'Transform2D',\n label: 'Skew',\n description: 'Skew amounts on X and Y.',\n })\n skew: Vector2 = {x: 0, y: 0};\n\n @Field({\n type: 'number',\n step: 0.1,\n group: 'Transform2D',\n label: 'Rotation',\n description: 'Rotation in radians.',\n editor: 'number-stepper',\n })\n rotation: number = 0;\n}\n\nexport default Transform2D;\n","import { decorators, ComponentChanged, OBSERVER_TYPE, Scene, LOAD_SCENE_MODE, GameObject } from '@combos-fun/engine';\nimport EventEmitter from 'eventemitter3';\nimport { Application, Container } from '@combos-fun/renderer-adapter';\nimport Render from './System';\nimport ContainerManager from './manager/ContainerManager';\nimport Transform2D from './Transform2D';\n\ntype RenderSortDirty = { sortDirty: boolean };\n\n@decorators.componentObserver({\n GameObject: ['parent'],\n Transform2D: [],\n})\nexport default class PixiHierarchy extends EventEmitter {\n name: string = 'PixiHierarchy';\n waitRemoveIds: number[] = [];\n system: Render;\n containerManager: ContainerManager;\n waitChangeScenes: {\n scene: Scene;\n mode: LOAD_SCENE_MODE;\n application: Application;\n }[] = [];\n constructor({ system, containerManager }) {\n super();\n this.containerManager = containerManager;\n this.init(system);\n }\n init(system: Render) {\n this.system = system;\n this.on('changeScene', ({ scene, mode, application }) => {\n this.waitChangeScenes.push({ scene, mode, application });\n });\n }\n update() {\n for (const id of this.waitRemoveIds) {\n this.containerManager.removeContainer(id);\n }\n this.waitRemoveIds = [];\n\n for (const sceneInfo of this.waitChangeScenes) {\n this.ensureSceneContainer(sceneInfo.scene);\n const container = this.containerManager.getContainer(sceneInfo.scene.id);\n if (container) {\n sceneInfo.application.stage.removeChildren();\n sceneInfo.application.stage.addChild(container);\n }\n }\n this.waitChangeScenes = [];\n }\n ensureSceneContainer(scene: Scene) {\n if (this.containerManager.getContainer(scene.id)) return;\n const container = new Container();\n container.label = scene.name;\n this.containerManager.addContainer({\n name: scene.id,\n container,\n });\n }\n ensureContainer(gameObject: GameObject, transform: Transform2D) {\n if (this.containerManager.getContainer(gameObject.id)) {\n transform.worldTransform = this.containerManager.getContainer(gameObject.id)\n .worldTransform as unknown as Transform2D['worldTransform'];\n return;\n }\n const container = new Container();\n container.label = gameObject.name;\n this.containerManager.addContainer({\n name: gameObject.id,\n container,\n });\n transform.worldTransform = container.worldTransform as unknown as Transform2D['worldTransform'];\n }\n componentChanged(changed: ComponentChanged) {\n if (changed.componentName === 'GameObject') {\n this.reparent(changed.gameObject);\n return;\n }\n if (changed.componentName !== 'Transform2D') return;\n if (changed.type === OBSERVER_TYPE.ADD) {\n this.ensureContainer(changed.gameObject, changed.component as Transform2D);\n this.reparent(changed.gameObject);\n } else if (changed.type === OBSERVER_TYPE.REMOVE) {\n this.waitRemoveIds.push(changed.gameObject.id);\n }\n }\n reparent(gameObject?: GameObject) {\n if (!gameObject) return;\n const container = this.containerManager.getContainer(gameObject.id);\n if (!container) return;\n if (gameObject.parent) {\n const parentContainer = this.containerManager.getContainer(gameObject.parent.id);\n if (parentContainer && container.parent !== parentContainer) {\n parentContainer.addChild(container);\n }\n const render = gameObject.parent.getComponent('Render') as unknown as RenderSortDirty;\n if (render) {\n render.sortDirty = true;\n }\n } else if (container.parent) {\n const transform = gameObject.getComponent(Transform2D);\n if (transform) {\n delete transform.worldTransform;\n }\n container.parent.removeChild(container);\n }\n }\n destroy() {\n this.removeAllListeners();\n this.waitRemoveIds = null;\n this.waitChangeScenes = null;\n this.system = null;\n this.containerManager = null;\n }\n}\n","/**\n * Inspired by PixiJS v6\n */\nexport type CompressedTextureExtensions = {\n s3tc?: WEBGL_compressed_texture_s3tc,\n s3tc_sRGB: WEBGL_compressed_texture_s3tc_srgb,\n etc: WEBGL_compressed_texture_etc,\n etc1: WEBGL_compressed_texture_etc1,\n pvrtc: WEBKIT_WEBGL_compressed_texture_pvrtc,\n atc: WEBGL_compressed_texture_atc,\n astc: WEBGL_compressed_texture_astc\n};\nexport type CompressedTextureExtensionRef = keyof CompressedTextureExtensions;\nlet result = undefined;\nexport interface SuportedCompressedTexture {\n s3tc: boolean,\n etc: boolean,\n etc1: boolean,\n pvrtc: boolean,\n atc: boolean,\n astc: boolean,\n}\nexport function getSuportCompressedTextureFormats(gl: WebGLRenderingContext): SuportedCompressedTexture {\n if (result) return result;\n\n if (!gl) {\n // #if _DEBUG\n console.warn('WebGL not available for compressed textures. Silently failing.');\n // #endif\n\n return {\n s3tc: false,\n etc: false,\n etc1: false,\n pvrtc: false,\n atc: false,\n astc: false,\n };\n }\n\n result = {\n s3tc: !!gl.getExtension('WEBGL_compressed_texture_s3tc'),\n etc: !!gl.getExtension('WEBGL_compressed_texture_etc'),\n etc1: !!gl.getExtension('WEBGL_compressed_texture_etc1'),\n pvrtc: !!gl.getExtension('WEBGL_compressed_texture_pvrtc')\n || !!gl.getExtension('WEBKIT_WEBGL_compressed_texture_pvrtc'),\n atc: !!gl.getExtension('WEBGL_compressed_texture_atc'),\n astc: !!gl.getExtension('WEBGL_compressed_texture_astc')\n };\n\n try {\n console.log('Supported compressed texture formats: ' + Object.keys(result).filter((type) => result[type]).join(', '))\n } catch (e) { }\n return result;\n}","import { System, decorators, Game, LOAD_SCENE_MODE, PureObserverInfo } from '@combos-fun/engine';\nimport { Application } from '@combos-fun/renderer-adapter';\nimport RendererManager from './manager/RendererManager';\nimport ContainerManager from './manager/ContainerManager';\nimport PixiHierarchy from './PixiHierarchy';\nimport Transform2D from './Transform2D';\nimport { Ticker } from 'pixi.js';\nimport type { ApplicationOptions } from 'pixi.js';\nimport type { Renderer as PixiRenderer } from 'pixi.js';\nimport type { WebGLRenderer } from 'pixi.js';\nimport { registerCompressedTexture } from './compressedTexture';\nimport { SuportedCompressedTexture, getSuportCompressedTextureFormats } from './compressedTexture/ability';\n\nexport enum RENDERER_TYPE {\n UNKNOWN = 0,\n WEBGL = 1,\n CANVAS = 2,\n}\n\n@decorators.componentObserver({\n GameObject: ['parent'],\n Transform2D: [],\n})\nexport default class Renderer extends System<Partial<ApplicationOptions>> {\n static systemName: string = 'Renderer';\n params: Partial<ApplicationOptions>;\n rendererManager: RendererManager;\n containerManager: ContainerManager;\n application: Application | null = null;\n game: Game;\n hierarchy: PixiHierarchy;\n multiApps: Application[] = [];\n suportedCompressedTextureFormats: SuportedCompressedTexture;\n\n async init(params?: Partial<ApplicationOptions>) {\n this.params = params ?? {};\n const app = await this.createApplication(this.params);\n this.application = app;\n this.game.canvas = app.canvas;\n this.containerManager = new ContainerManager();\n this.rendererManager = new RendererManager({\n game: this.game,\n rendererSystem: this,\n });\n\n this.hierarchy = new PixiHierarchy({\n system: this,\n containerManager: this.containerManager,\n });\n this.game.on('sceneChanged', async ({ scene, mode, params: sceneParams }) => {\n let application: Application | null = this.application;\n if (mode === LOAD_SCENE_MODE.MULTI_CANVAS) {\n application = await this.createApplication(sceneParams);\n this.multiApps.push(application);\n }\n if (!application) {\n return;\n }\n scene.canvas = application.canvas;\n this.hierarchy.ensureSceneContainer(scene);\n this.hierarchy.emit('changeScene', {\n scene,\n mode,\n application,\n });\n });\n\n const gl = (app.renderer as WebGLRenderer).gl;\n if (gl) {\n this.suportedCompressedTextureFormats = getSuportCompressedTextureFormats(gl);\n registerCompressedTexture(gl);\n }\n }\n\n registerObserver(observerInfo: PureObserverInfo): void {\n const Ctor = this.constructor as typeof Renderer & { observerInfo: PureObserverInfo };\n if (!Ctor.observerInfo) {\n Ctor.observerInfo = {} as PureObserverInfo;\n }\n const thisObserverInfo = Ctor.observerInfo;\n for (const key in observerInfo) {\n if (!thisObserverInfo[key]) {\n thisObserverInfo[key] = [];\n }\n thisObserverInfo[key].push(...observerInfo[key]);\n }\n }\n\n private async createApplication(params: Partial<ApplicationOptions>): Promise<Application> {\n const initOptions: Partial<ApplicationOptions> = {\n ...params,\n autoStart: true,\n sharedTicker: true,\n };\n\n const app = new Application();\n try {\n await app.init(initOptions);\n } catch {\n await app.init({\n ...initOptions,\n preference: 'canvas',\n });\n }\n\n Ticker.shared.stop();\n Ticker.shared.autoStart = false;\n\n return app;\n }\n\n update() {\n const changes = this.componentObserver.clear();\n for (const changed of changes) {\n if (changed.componentName === 'GameObject' && changed.gameObject) {\n this.ensureTransform2D(changed.gameObject);\n if (changed.gameObject.parent) this.ensureTransform2D(changed.gameObject.parent);\n }\n this.hierarchy.componentChanged(changed);\n }\n if (!this.application) {\n return;\n }\n for (const gameObject of this.game.gameObjects) {\n const transform = gameObject.getComponent(Transform2D);\n if (transform) {\n this.containerManager.updateTransform({\n name: gameObject.id,\n transform,\n parentSize: gameObject.parent?.getComponent(Transform2D)?.size,\n });\n }\n this.rendererManager.update(gameObject);\n }\n }\n\n private ensureTransform2D(gameObject: Game['gameObjects'][number]) {\n if (!gameObject || gameObject.destroyed || gameObject === gameObject.scene) return;\n let transform = gameObject.getComponent(Transform2D);\n if (!transform) {\n transform = gameObject.addComponent(new Transform2D());\n }\n if (!transform) return;\n this.hierarchy.ensureContainer(gameObject, transform);\n this.hierarchy.reparent(gameObject);\n }\n\n lateUpdate(e) {\n if (!this.application) {\n return;\n }\n this.hierarchy.update();\n this.application.ticker.update(e.time);\n }\n\n onDestroy() {\n this.application?.destroy();\n for (const app of this.multiApps) {\n app && app.destroy();\n }\n this.hierarchy.destroy();\n this.hierarchy = null;\n this.params = null;\n this.rendererManager = null;\n this.containerManager = null;\n this.application = null;\n this.game = null;\n this.multiApps = null;\n }\n\n resize(width, height) {\n if (!this.application) {\n return;\n }\n this.params = { ...this.params, width, height };\n this.application.renderer.resize(width, height);\n }\n}\n","/** Auto-generated by scripts/build-package.mjs — do not edit. */\n\nimport Renderer from './System';\n\nObject.assign(Renderer, {\n packageName: \"@combos-fun/plugin-renderer\",\n packageVersion: \"0.1.12\",\n});\n","/* eslint-disable @typescript-eslint/no-unused-vars */\n\nimport { GameObject, Game, PureObserverInfo, ComponentChanged, System, UpdateParams } from '@combos-fun/engine';\nimport ContainerManager from './manager/ContainerManager';\nimport RendererManager from './manager/RendererManager';\n\nexport default class Renderer<T extends {} = {}> extends System<T> {\n /**\n * Renderer name\n */\n name: string;\n\n /**\n * currentGame\n */\n game: Game;\n\n /**\n * observer component props info\n */\n static observerInfo: PureObserverInfo;\n\n /**\n * observer component props info\n */\n observerInfo: PureObserverInfo;\n\n /**\n * containerManager\n */\n containerManager: ContainerManager;\n rendererManager: RendererManager;\n\n constructor(params?: T) {\n super(params);\n const Ctor = this.constructor as typeof Renderer & { observerInfo: PureObserverInfo };\n this.observerInfo = Ctor.observerInfo;\n }\n\n // init(arg?: any): void;\n\n /**\n * Called when an observed component property changes.\n */\n componentChanged(_changed: ComponentChanged) { }\n\n /**\n * Called every frame.\n * @param _gameObject gameObject\n */\n rendererUpdate(_gameObject: GameObject) { }\n\n override update(e?: UpdateParams): void {\n const changes = this.componentObserver.clear();\n for (const changed of changes) {\n this.componentChanged(changed);\n }\n }\n\n protected asyncIdMap: Record<number, number> = {}\n\n protected increaseAsyncId(id: number) {\n this.asyncIdMap[id] = (this.asyncIdMap[id] || 0) + 1;\n return this.asyncIdMap[id];\n }\n\n protected validateAsyncId(id: number, asyncId: number) {\n return this.asyncIdMap[id] === asyncId;\n }\n}\n","import RendererSystem, { RENDERER_TYPE } from './System';\nimport RendererManager from './manager/RendererManager';\nimport ContainerManager from './manager/ContainerManager';\nimport Renderer from './Renderer';\nimport Transform2D from './Transform2D';\n\n/** Shared resource cache key separator used across renderer plugins */\nexport const RESOURCE_KEY_SPLIT = '_s|r|c_';\n\nexport type { Transform2DParams, TransformMatrix } from './Transform2D';\nexport { RendererManager, ContainerManager, RendererSystem, RENDERER_TYPE, Renderer, Transform2D };\n\n"],"names":["OBSERVER_TYPE","isEqual","Component","__decorate","Field","PixiHierarchy","EventEmitter","Container","decorators","RENDERER_TYPE","Renderer","System","LOAD_SCENE_MODE","Application","Ticker"],"mappings":";;;;;;;;;;;;;;;AAKA,MAAM,eAAe,CAAA;AAGnB,IAAA,WAAA,CAAY,EAAE,IAAI,EAAE,cAAc,EAAE,EAAA;QAIpC,IAAA,CAAA,SAAS,GAAe,EAAE;AAHxB,QAAA,IAAI,CAAC,IAAI,GAAG,IAAI;AAChB,QAAA,IAAI,CAAC,cAAc,GAAG,cAAc;IACtC;IAEA,QAAQ,CAAC,GAAG,SAAqB,EAAA;AAC/B,QAAA,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE;AAChC,YAAA,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI;YACzB,QAAQ,CAAC,eAAe,GAAG,IAAI,CAAC,cAAc,CAAC,eAAe;YAC9D,QAAQ,CAAC,gBAAgB,GAAG,IAAI,CAAC,cAAc,CAAC,gBAAgB;AAChE,YAAA,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC;QAC/B;IACF;AACA,IAAA,gBAAgB,CAAC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ources":["../lib/manager/RendererManager.ts","../lib/manager/ContainerManager.ts","../lib/Transform2D.ts","../lib/PixiHierarchy.ts","../lib/compressedTexture/ability.ts","../lib/renderOptions.ts","../lib/System.ts","../lib/__combosPackageMeta.gen.ts","../lib/Renderer.ts","../lib/index.ts"],"sourcesContent":["import isEqual from 'lodash-es/isEqual';\nimport { GameObject, Game, ComponentChanged, OBSERVER_TYPE } from '@combos-fun/engine';\nimport Renderer from '../Renderer';\nimport RendererSystem from '../System';\n\nclass RendererManager {\n game: Game;\n rendererSystem: RendererSystem;\n constructor({ game, rendererSystem }) {\n this.game = game;\n this.rendererSystem = rendererSystem;\n }\n renderers: Renderer[] = [];\n register(...renderers: Renderer[]) {\n for (const renderer of renderers) {\n renderer.game = this.game;\n renderer.rendererManager = this.rendererSystem.rendererManager;\n renderer.containerManager = this.rendererSystem.containerManager;\n this.renderers.push(renderer);\n }\n }\n componentChanged(changes: ComponentChanged[]) {\n for (const changed of changes) {\n for (const renderer of this.renderers) {\n const props = renderer.observerInfo[changed.componentName];\n if (props) {\n if ([OBSERVER_TYPE.ADD, OBSERVER_TYPE.REMOVE].indexOf(changed.type) > -1) {\n try {\n renderer.componentChanged && renderer.componentChanged(changed);\n } catch (e) {\n console.error(`gameObject: ${changed.gameObject.name}, ${changed.componentName} is error.`, changed, e);\n }\n continue;\n }\n\n const index = props.findIndex(prop => {\n return isEqual(prop, changed.prop);\n });\n\n if (index > -1) {\n try {\n renderer.componentChanged && renderer.componentChanged(changed);\n } catch (e) {\n console.error(\n `gameObject: ${changed.gameObject && changed.gameObject.name}, ${\n changed.componentName\n } is componentChanged error.`,\n changed,\n e,\n );\n }\n }\n }\n }\n }\n }\n update(gameObject: GameObject) {\n for (const component of gameObject.components) {\n for (const renderer of this.renderers) {\n const cache = [];\n const props = renderer.observerInfo[component.name];\n if (props && cache.indexOf(gameObject) === -1) {\n cache.push(gameObject);\n try {\n renderer.rendererUpdate && renderer.rendererUpdate(gameObject);\n } catch (e) {\n console.info(`gameObject: ${gameObject.name}, ${component.name} is update error`, e);\n }\n }\n }\n }\n }\n}\nexport default RendererManager;\n","import { Point, ObservablePoint } from 'pixi.js';\nimport { Container } from '@combos-fun/renderer-adapter';\nimport type Transform2D from '../Transform2D';\n\nexport default class ContainerManager {\n containerMap: { [propName: number]: Container } = {};\n addContainer({ name, container }: { name: number; container: Container }) {\n this.containerMap[name] = container;\n }\n getContainer(name: number) {\n return this.containerMap[name];\n }\n removeContainer(name: number) {\n this.containerMap[name]?.destroy({ children: true });\n delete this.containerMap[name];\n }\n updateTransform({\n name,\n transform,\n parentSize,\n }: {\n name: number;\n transform: Transform2D;\n parentSize?: { width: number; height: number };\n }) {\n const container = this.containerMap[name];\n if (!container || !transform) return;\n const { anchor, origin, position, rotation, scale, size, skew } = transform;\n container.rotation = rotation;\n container.scale = scale as Point;\n container.pivot.x = size.width * origin.x;\n container.pivot.y = size.height * origin.y;\n container.skew = skew as ObservablePoint;\n let x = position.x;\n let y = position.y;\n if (parentSize) {\n x = x + parentSize.width * anchor.x;\n y = y + parentSize.height * anchor.y;\n }\n\n container.position = { x, y } as Point;\n }\n}\n","import { Component } from '@combos-fun/engine';\nimport type { ComponentParams } from '@combos-fun/engine';\nimport { Field } from '@combos-fun/inspector-decorator';\n\ninterface Vector2 {\n x: number;\n y: number;\n}\n\ninterface Size2 {\n width: number;\n height: number;\n}\n\nexport interface TransformMatrix {\n a: number;\n b: number;\n c: number;\n d: number;\n tx: number;\n ty: number;\n array?: number[];\n}\n\nexport interface Transform2DParams extends ComponentParams {\n position?: Vector2;\n size?: Size2;\n origin?: Vector2;\n anchor?: Vector2;\n scale?: Vector2;\n skew?: Vector2;\n rotation?: number;\n}\n\n/** 2D layout pose. Hierarchy lives on GameObject. */\nclass Transform2D extends Component<Transform2DParams> {\n static componentName: string = 'Transform2D';\n readonly name: string = 'Transform2D';\n\n worldTransform: TransformMatrix;\n\n init(params: Transform2DParams = {}) {\n const props = ['position', 'size', 'origin', 'anchor', 'scale', 'skew'];\n for (const key of props) {\n Object.assign(this[key], params[key]);\n }\n this.rotation = params.rotation ?? this.rotation;\n }\n\n @Field({\n type: 'vector2',\n step: 1,\n group: 'Transform2D',\n label: 'Position',\n description: 'Position on the design canvas (x right, y down).',\n })\n position: Vector2 = {x: 0, y: 0};\n\n @Field({\n type: 'size',\n step: 1,\n min: 0,\n group: 'Transform2D',\n label: 'Size',\n description: 'Width and height of the object in design pixels.',\n })\n size: Size2 = {width: 0, height: 0};\n\n @Field({\n type: 'vector2',\n step: 0.1,\n group: 'Transform2D',\n label: 'Origin',\n description: 'Local origin used for layout math.',\n })\n origin: Vector2 = {x: 0, y: 0};\n\n @Field({\n type: 'vector2',\n step: 0.1,\n group: 'Transform2D',\n label: 'Anchor',\n description: 'Anchor point (0–1) used when positioning and scaling.',\n })\n anchor: Vector2 = {x: 0, y: 0};\n\n @Field({\n type: 'vector2',\n step: 0.1,\n group: 'Transform2D',\n label: 'Scale',\n description: 'Scale multipliers on X and Y (1 = original size).',\n })\n scale: Vector2 = {x: 1, y: 1};\n\n @Field({\n type: 'vector2',\n step: 0.1,\n group: 'Transform2D',\n label: 'Skew',\n description: 'Skew amounts on X and Y.',\n })\n skew: Vector2 = {x: 0, y: 0};\n\n @Field({\n type: 'number',\n step: 0.1,\n group: 'Transform2D',\n label: 'Rotation',\n description: 'Rotation in radians.',\n editor: 'number-stepper',\n })\n rotation: number = 0;\n}\n\nexport default Transform2D;\n","import { decorators, ComponentChanged, OBSERVER_TYPE, Scene, LOAD_SCENE_MODE, GameObject } from '@combos-fun/engine';\nimport EventEmitter from 'eventemitter3';\nimport { Application, Container } from '@combos-fun/renderer-adapter';\nimport Render from './System';\nimport ContainerManager from './manager/ContainerManager';\nimport Transform2D from './Transform2D';\n\ntype RenderSortDirty = { sortDirty: boolean };\n\n@decorators.componentObserver({\n GameObject: ['parent'],\n Transform2D: [],\n})\nexport default class PixiHierarchy extends EventEmitter {\n name: string = 'PixiHierarchy';\n waitRemoveIds: number[] = [];\n system: Render;\n containerManager: ContainerManager;\n waitChangeScenes: {\n scene: Scene;\n mode: LOAD_SCENE_MODE;\n application: Application;\n }[] = [];\n constructor({ system, containerManager }) {\n super();\n this.containerManager = containerManager;\n this.init(system);\n }\n init(system: Render) {\n this.system = system;\n this.on('changeScene', ({ scene, mode, application }) => {\n this.waitChangeScenes.push({ scene, mode, application });\n });\n }\n update() {\n for (const id of this.waitRemoveIds) {\n this.containerManager.removeContainer(id);\n }\n this.waitRemoveIds = [];\n\n for (const sceneInfo of this.waitChangeScenes) {\n this.ensureSceneContainer(sceneInfo.scene);\n const container = this.containerManager.getContainer(sceneInfo.scene.id);\n if (container) {\n sceneInfo.application.stage.removeChildren();\n sceneInfo.application.stage.addChild(container);\n }\n }\n this.waitChangeScenes = [];\n }\n ensureSceneContainer(scene: Scene) {\n if (this.containerManager.getContainer(scene.id)) return;\n const container = new Container();\n container.label = scene.name;\n this.containerManager.addContainer({\n name: scene.id,\n container,\n });\n }\n ensureContainer(gameObject: GameObject, transform: Transform2D) {\n if (this.containerManager.getContainer(gameObject.id)) {\n transform.worldTransform = this.containerManager.getContainer(gameObject.id)\n .worldTransform as unknown as Transform2D['worldTransform'];\n return;\n }\n const container = new Container();\n container.label = gameObject.name;\n this.containerManager.addContainer({\n name: gameObject.id,\n container,\n });\n transform.worldTransform = container.worldTransform as unknown as Transform2D['worldTransform'];\n }\n componentChanged(changed: ComponentChanged) {\n if (changed.componentName === 'GameObject') {\n this.reparent(changed.gameObject);\n return;\n }\n if (changed.componentName !== 'Transform2D') return;\n if (changed.type === OBSERVER_TYPE.ADD) {\n this.ensureContainer(changed.gameObject, changed.component as Transform2D);\n this.reparent(changed.gameObject);\n } else if (changed.type === OBSERVER_TYPE.REMOVE) {\n this.waitRemoveIds.push(changed.gameObject.id);\n }\n }\n reparent(gameObject?: GameObject) {\n if (!gameObject) return;\n const container = this.containerManager.getContainer(gameObject.id);\n if (!container) return;\n if (gameObject.parent) {\n const parentContainer = this.containerManager.getContainer(gameObject.parent.id);\n if (parentContainer && container.parent !== parentContainer) {\n parentContainer.addChild(container);\n }\n const render = gameObject.parent.getComponent('Render') as unknown as RenderSortDirty;\n if (render) {\n render.sortDirty = true;\n }\n } else if (container.parent) {\n const transform = gameObject.getComponent(Transform2D);\n if (transform) {\n delete transform.worldTransform;\n }\n container.parent.removeChild(container);\n }\n }\n destroy() {\n this.removeAllListeners();\n this.waitRemoveIds = null;\n this.waitChangeScenes = null;\n this.system = null;\n this.containerManager = null;\n }\n}\n","/**\n * Inspired by PixiJS v6\n */\nexport type CompressedTextureExtensions = {\n s3tc?: WEBGL_compressed_texture_s3tc,\n s3tc_sRGB: WEBGL_compressed_texture_s3tc_srgb,\n etc: WEBGL_compressed_texture_etc,\n etc1: WEBGL_compressed_texture_etc1,\n pvrtc: WEBKIT_WEBGL_compressed_texture_pvrtc,\n atc: WEBGL_compressed_texture_atc,\n astc: WEBGL_compressed_texture_astc\n};\nexport type CompressedTextureExtensionRef = keyof CompressedTextureExtensions;\nlet result = undefined;\nexport interface SuportedCompressedTexture {\n s3tc: boolean,\n etc: boolean,\n etc1: boolean,\n pvrtc: boolean,\n atc: boolean,\n astc: boolean,\n}\nexport function getSuportCompressedTextureFormats(gl: WebGLRenderingContext): SuportedCompressedTexture {\n if (result) return result;\n\n if (!gl) {\n // #if _DEBUG\n console.warn('WebGL not available for compressed textures. Silently failing.');\n // #endif\n\n return {\n s3tc: false,\n etc: false,\n etc1: false,\n pvrtc: false,\n atc: false,\n astc: false,\n };\n }\n\n result = {\n s3tc: !!gl.getExtension('WEBGL_compressed_texture_s3tc'),\n etc: !!gl.getExtension('WEBGL_compressed_texture_etc'),\n etc1: !!gl.getExtension('WEBGL_compressed_texture_etc1'),\n pvrtc: !!gl.getExtension('WEBGL_compressed_texture_pvrtc')\n || !!gl.getExtension('WEBKIT_WEBGL_compressed_texture_pvrtc'),\n atc: !!gl.getExtension('WEBGL_compressed_texture_atc'),\n astc: !!gl.getExtension('WEBGL_compressed_texture_astc')\n };\n\n try {\n console.log('Supported compressed texture formats: ' + Object.keys(result).filter((type) => result[type]).join(', '))\n } catch (e) { }\n return result;\n}","import type { ApplicationOptions } from 'pixi.js';\nimport type { RenderQualityInput, ResolvedRenderQuality } from '@combos-fun/engine';\n\n/** Pixi init options with engine-only quality fields removed. */\nexport function pixiRenderOptions(\n params: Partial<ApplicationOptions> & RenderQualityInput = {},\n quality: ResolvedRenderQuality,\n): Partial<ApplicationOptions> {\n const {\n maxPixelRatio: _maxPixelRatio,\n adaptivePixelRatio: _adaptivePixelRatio,\n pauseWhenHidden: _pauseWhenHidden,\n pixelRatio: _pixelRatio,\n devicePixelRatio: _devicePixelRatio,\n ...rest\n } = params;\n return {\n ...rest,\n resolution: quality.pixelRatio,\n autoDensity: quality.autoDensity,\n antialias: quality.antialias,\n ...(quality.powerPreference === 'default' ? {} : { powerPreference: quality.powerPreference }),\n autoStart: true,\n sharedTicker: true,\n };\n}\n","import { System, decorators, Game, LOAD_SCENE_MODE, PureObserverInfo, AdaptivePixelRatio, resolveRenderQuality, shouldPauseRendering } from '@combos-fun/engine';\nimport type { RenderQualityInput, ResolvedRenderQuality, UpdateParams } from '@combos-fun/engine';\nimport { Application } from '@combos-fun/renderer-adapter';\nimport RendererManager from './manager/RendererManager';\nimport ContainerManager from './manager/ContainerManager';\nimport PixiHierarchy from './PixiHierarchy';\nimport Transform2D from './Transform2D';\nimport { Ticker } from 'pixi.js';\nimport type { ApplicationOptions } from 'pixi.js';\nimport type { WebGLRenderer } from 'pixi.js';\nimport { registerCompressedTexture } from './compressedTexture';\nimport { SuportedCompressedTexture, getSuportCompressedTextureFormats } from './compressedTexture/ability';\nimport { pixiRenderOptions } from './renderOptions';\n\nexport enum RENDERER_TYPE {\n UNKNOWN = 0,\n WEBGL = 1,\n CANVAS = 2,\n}\n\n@decorators.componentObserver({\n GameObject: ['parent'],\n Transform2D: [],\n})\nexport default class Renderer extends System<Partial<ApplicationOptions> & RenderQualityInput> {\n static systemName: string = 'Renderer';\n params: Partial<ApplicationOptions> & RenderQualityInput;\n rendererManager: RendererManager;\n containerManager: ContainerManager;\n application: Application | null = null;\n game: Game;\n hierarchy: PixiHierarchy;\n multiApps: Application[] = [];\n suportedCompressedTextureFormats: SuportedCompressedTexture;\n private quality: ResolvedRenderQuality | null = null;\n private adaptive: AdaptivePixelRatio | null = null;\n private viewWidth = 0;\n private viewHeight = 0;\n\n async init(params?: Partial<ApplicationOptions> & RenderQualityInput) {\n this.params = params ?? {};\n this.quality = resolveRenderQuality(this.params, { adaptivePixelRatio: false });\n this.adaptive = new AdaptivePixelRatio({\n pixelRatio: this.quality.pixelRatio,\n ceiling: this.quality.pixelRatioCeiling,\n enabled: this.quality.adaptivePixelRatio,\n });\n const app = await this.createApplication(this.params);\n this.rememberView(app);\n this.application = app;\n this.game.canvas = app.canvas;\n this.containerManager = new ContainerManager();\n this.rendererManager = new RendererManager({\n game: this.game,\n rendererSystem: this,\n });\n\n this.hierarchy = new PixiHierarchy({\n system: this,\n containerManager: this.containerManager,\n });\n this.game.on('sceneChanged', async ({ scene, mode, params: sceneParams }) => {\n let application: Application | null = this.application;\n if (mode === LOAD_SCENE_MODE.MULTI_CANVAS) {\n application = await this.createApplication(sceneParams);\n this.multiApps.push(application);\n }\n if (!application) {\n return;\n }\n scene.canvas = application.canvas;\n this.hierarchy.ensureSceneContainer(scene);\n this.hierarchy.emit('changeScene', {\n scene,\n mode,\n application,\n });\n });\n\n const gl = (app.renderer as WebGLRenderer).gl;\n if (gl) {\n this.suportedCompressedTextureFormats = getSuportCompressedTextureFormats(gl);\n registerCompressedTexture(gl);\n }\n }\n\n registerObserver(observerInfo: PureObserverInfo): void {\n const Ctor = this.constructor as typeof Renderer & { observerInfo: PureObserverInfo };\n if (!Ctor.observerInfo) {\n Ctor.observerInfo = {} as PureObserverInfo;\n }\n const thisObserverInfo = Ctor.observerInfo;\n for (const key in observerInfo) {\n if (!thisObserverInfo[key]) {\n thisObserverInfo[key] = [];\n }\n thisObserverInfo[key].push(...observerInfo[key]);\n }\n }\n\n private async createApplication(params: Partial<ApplicationOptions> & RenderQualityInput = {}): Promise<Application> {\n const quality = resolveRenderQuality(params, { adaptivePixelRatio: false });\n const callerPreference = params.preference;\n const initOptions = pixiRenderOptions(params, quality);\n initOptions.preference = callerPreference ?? ['webgpu', 'webgl'];\n\n const app = new Application();\n try {\n await app.init(initOptions);\n } catch {\n if (callerPreference == null) {\n try {\n await app.init({ ...initOptions, preference: 'webgl' });\n } catch {\n await app.init({ ...initOptions, preference: 'canvas' });\n }\n } else {\n await app.init({ ...initOptions, preference: 'canvas' });\n }\n }\n\n Ticker.shared.stop();\n Ticker.shared.autoStart = false;\n\n return app;\n }\n\n update() {\n const changes = this.componentObserver.clear();\n for (const changed of changes) {\n if (changed.componentName === 'GameObject' && changed.gameObject) {\n this.ensureTransform2D(changed.gameObject);\n if (changed.gameObject.parent) this.ensureTransform2D(changed.gameObject.parent);\n }\n this.hierarchy.componentChanged(changed);\n }\n if (!this.application) {\n return;\n }\n for (const gameObject of this.game.gameObjects) {\n const transform = gameObject.getComponent(Transform2D);\n if (transform) {\n this.containerManager.updateTransform({\n name: gameObject.id,\n transform,\n parentSize: gameObject.parent?.getComponent(Transform2D)?.size,\n });\n }\n this.rendererManager.update(gameObject);\n }\n }\n\n private ensureTransform2D(gameObject: Game['gameObjects'][number]) {\n if (!gameObject || gameObject.destroyed || gameObject === gameObject.scene) return;\n let transform = gameObject.getComponent(Transform2D);\n if (!transform) {\n transform = gameObject.addComponent(new Transform2D());\n }\n if (!transform) return;\n this.hierarchy.ensureContainer(gameObject, transform);\n this.hierarchy.reparent(gameObject);\n }\n\n lateUpdate(e: UpdateParams) {\n if (!this.application) {\n return;\n }\n this.hierarchy.update();\n if (shouldPauseRendering(this.quality?.pauseWhenHidden !== false)) return;\n const next = this.adaptive?.sample(e?.deltaTime ?? 0);\n if (next != null) this.applyPixelRatio(next);\n this.application.ticker.update(e.time);\n }\n\n private rememberView(app: Application) {\n const width = this.params?.width || app.renderer?.screen?.width || 0;\n const height = this.params?.height || app.renderer?.screen?.height || 0;\n if (width) this.viewWidth = width;\n if (height) this.viewHeight = height;\n }\n\n private applyPixelRatio(ratio: number) {\n const renderer = this.application?.renderer;\n if (!renderer || !(ratio > 0)) return;\n renderer.resolution = ratio;\n if (this.viewWidth > 0 && this.viewHeight > 0) {\n renderer.resize(this.viewWidth, this.viewHeight);\n }\n }\n\n onDestroy() {\n this.application?.destroy();\n for (const app of this.multiApps) {\n app && app.destroy();\n }\n this.hierarchy.destroy();\n this.hierarchy = null;\n this.params = null;\n this.rendererManager = null;\n this.containerManager = null;\n this.application = null;\n this.game = null;\n this.multiApps = null;\n }\n\n resize(width, height) {\n if (!this.application) {\n return;\n }\n this.params = { ...this.params, width, height };\n this.viewWidth = width;\n this.viewHeight = height;\n this.application.renderer.resize(width, height);\n }\n}\n","/** Auto-generated by scripts/build-package.mjs — do not edit. */\n\nimport Renderer from './System';\n\nObject.assign(Renderer, {\n packageName: \"@combos-fun/plugin-renderer\",\n packageVersion: \"0.1.14-beta.0\",\n});\n","/* eslint-disable @typescript-eslint/no-unused-vars */\n\nimport { GameObject, Game, PureObserverInfo, ComponentChanged, System, UpdateParams } from '@combos-fun/engine';\nimport ContainerManager from './manager/ContainerManager';\nimport RendererManager from './manager/RendererManager';\n\nexport default class Renderer<T extends {} = {}> extends System<T> {\n /**\n * Renderer name\n */\n name: string;\n\n /**\n * currentGame\n */\n game: Game;\n\n /**\n * observer component props info\n */\n static observerInfo: PureObserverInfo;\n\n /**\n * observer component props info\n */\n observerInfo: PureObserverInfo;\n\n /**\n * containerManager\n */\n containerManager: ContainerManager;\n rendererManager: RendererManager;\n\n constructor(params?: T) {\n super(params);\n const Ctor = this.constructor as typeof Renderer & { observerInfo: PureObserverInfo };\n this.observerInfo = Ctor.observerInfo;\n }\n\n // init(arg?: any): void;\n\n /**\n * Called when an observed component property changes.\n */\n componentChanged(_changed: ComponentChanged) { }\n\n /**\n * Called every frame.\n * @param _gameObject gameObject\n */\n rendererUpdate(_gameObject: GameObject) { }\n\n override update(e?: UpdateParams): void {\n const changes = this.componentObserver.clear();\n for (const changed of changes) {\n this.componentChanged(changed);\n }\n }\n\n protected asyncIdMap: Record<number, number> = {}\n\n protected increaseAsyncId(id: number) {\n this.asyncIdMap[id] = (this.asyncIdMap[id] || 0) + 1;\n return this.asyncIdMap[id];\n }\n\n protected validateAsyncId(id: number, asyncId: number) {\n return this.asyncIdMap[id] === asyncId;\n }\n}\n","import RendererSystem, { RENDERER_TYPE } from './System';\nimport RendererManager from './manager/RendererManager';\nimport ContainerManager from './manager/ContainerManager';\nimport Renderer from './Renderer';\nimport Transform2D from './Transform2D';\n\n/** Shared resource cache key separator used across renderer plugins */\nexport const RESOURCE_KEY_SPLIT = '_s|r|c_';\n\nexport type { Transform2DParams, TransformMatrix } from './Transform2D';\nexport { RendererManager, ContainerManager, RendererSystem, RENDERER_TYPE, Renderer, Transform2D };\n\n"],"names":["OBSERVER_TYPE","isEqual","Component","__decorate","Field","PixiHierarchy","EventEmitter","Container","decorators","RENDERER_TYPE","Renderer","System","resolveRenderQuality","AdaptivePixelRatio","LOAD_SCENE_MODE","Application","Ticker","shouldPauseRendering"],"mappings":";;;;;;;;;;;;;;;AAKA,MAAM,eAAe,CAAA;AAGnB,IAAA,WAAA,CAAY,EAAE,IAAI,EAAE,cAAc,EAAE,EAAA;QAIpC,IAAA,CAAA,SAAS,GAAe,EAAE;AAHxB,QAAA,IAAI,CAAC,IAAI,GAAG,IAAI;AAChB,QAAA,IAAI,CAAC,cAAc,GAAG,cAAc;IACtC;IAEA,QAAQ,CAAC,GAAG,SAAqB,EAAA;AAC/B,QAAA,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE;AAChC,YAAA,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI;YACzB,QAAQ,CAAC,eAAe,GAAG,IAAI,CAAC,cAAc,CAAC,eAAe;YAC9D,QAAQ,CAAC,gBAAgB,GAAG,IAAI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O,CAAC;QAChC;IACF;AAIU,IAAA,eAAe,CAAC,EAAU,EAAA;AAClC,QAAA,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC;AACpD,QAAA,OAAO,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC;IAC5B;IAEU,eAAe,CAAC,EAAU,EAAE,OAAe,EAAA;QACnD,OAAO,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,KAAK,OAAO;IACxC;AACD;;AC/DD;AACO,MAAM,kBAAkB,GAAG;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("tslib"),t=require("@combos-fun/engine"),n=require("@combos-fun/renderer-adapter"),r=require("lodash-es/isEqual"),o=require("eventemitter3"),a=require("@combos-fun/inspector-decorator"),s=require("pixi.js");function i(e){return e&&e.__esModule?e:{default:e}}var c=i(r),p=i(o);class h{constructor({game:e,rendererSystem:t}){this.renderers=[],this.game=e,this.rendererSystem=t}register(...e){for(const t of e)t.game=this.game,t.rendererManager=this.rendererSystem.rendererManager,t.containerManager=this.rendererSystem.containerManager,this.renderers.push(t)}componentChanged(e){for(const n of e)for(const e of this.renderers){const r=e.observerInfo[n.componentName];if(r){if([t.OBSERVER_TYPE.ADD,t.OBSERVER_TYPE.REMOVE].indexOf(n.type)>-1){try{e.componentChanged&&e.componentChanged(n)}catch(e){console.error(`gameObject: ${n.gameObject.name}, ${n.componentName} is error.`,n,e)}continue}if(r.findIndex(e=>c.default(e,n.prop))>-1)try{e.componentChanged&&e.componentChanged(n)}catch(e){console.error(`gameObject: ${n.gameObject&&n.gameObject.name}, ${n.componentName} is componentChanged error.`,n,e)}}}}update(e){for(const t of e.components)for(const n of this.renderers){const r=[];if(n.observerInfo[t.name]&&-1===r.indexOf(e)){r.push(e);try{n.rendererUpdate&&n.rendererUpdate(e)}catch(n){console.info(`gameObject: ${e.name}, ${t.name} is update error`,n)}}}}}class d{constructor(){this.containerMap={}}addContainer({name:e,container:t}){this.containerMap[e]=t}getContainer(e){return this.containerMap[e]}removeContainer(e){this.containerMap[e]?.destroy({children:!0}),delete this.containerMap[e]}updateTransform({name:e,transform:t,parentSize:n}){const r=this.containerMap[e];if(!r||!t)return;const{anchor:o,origin:a,position:s,rotation:i,scale:c,size:p,skew:h}=t;r.rotation=i,r.scale=c,r.pivot.x=p.width*a.x,r.pivot.y=p.height*a.y,r.skew=h;let d=s.x,m=s.y;n&&(d+=n.width*o.x,m+=n.height*o.y),r.position={x:d,y:m}}}class m extends t.Component{constructor(){super(...arguments),this.name="Transform2D",this.position={x:0,y:0},this.size={width:0,height:0},this.origin={x:0,y:0},this.anchor={x:0,y:0},this.scale={x:1,y:1},this.skew={x:0,y:0},this.rotation=0}static{this.componentName="Transform2D"}init(e={}){const t=["position","size","origin","anchor","scale","skew"];for(const n of t)Object.assign(this[n],e[n]);this.rotation=e.rotation??this.rotation}}e.__decorate([a.Field({type:"vector2",step:1,group:"Transform2D",label:"Position",description:"Position on the design canvas (x right, y down)."})],m.prototype,"position",void 0),e.__decorate([a.Field({type:"size",step:1,min:0,group:"Transform2D",label:"Size",description:"Width and height of the object in design pixels."})],m.prototype,"size",void 0),e.__decorate([a.Field({type:"vector2",step:.1,group:"Transform2D",label:"Origin",description:"Local origin used for layout math."})],m.prototype,"origin",void 0),e.__decorate([a.Field({type:"vector2",step:.1,group:"Transform2D",label:"Anchor",description:"Anchor point (0–1) used when positioning and scaling."})],m.prototype,"anchor",void 0),e.__decorate([a.Field({type:"vector2",step:.1,group:"Transform2D",label:"Scale",description:"Scale multipliers on X and Y (1 = original size)."})],m.prototype,"scale",void 0),e.__decorate([a.Field({type:"vector2",step:.1,group:"Transform2D",label:"Skew",description:"Skew amounts on X and Y."})],m.prototype,"skew",void 0),e.__decorate([a.Field({type:"number",step:.1,group:"Transform2D",label:"Rotation",description:"Rotation in radians.",editor:"number-stepper"})],m.prototype,"rotation",void 0);let l=class extends p.default{constructor({system:e,containerManager:t}){super(),this.name="PixiHierarchy",this.waitRemoveIds=[],this.waitChangeScenes=[],this.containerManager=t,this.init(e)}init(e){this.system=e,this.on("changeScene",({scene:e,mode:t,application:n})=>{this.waitChangeScenes.push({scene:e,mode:t,application:n})})}update(){for(const e of this.waitRemoveIds)this.containerManager.removeContainer(e);this.waitRemoveIds=[];for(const e of this.waitChangeScenes){this.ensureSceneContainer(e.scene);const t=this.containerManager.getContainer(e.scene.id);t&&(e.application.stage.removeChildren(),e.application.stage.addChild(t))}this.waitChangeScenes=[]}ensureSceneContainer(e){if(this.containerManager.getContainer(e.id))return;const t=new n.Container;t.label=e.name,this.containerManager.addContainer({name:e.id,container:t})}ensureContainer(e,t){if(this.containerManager.getContainer(e.id))return void(t.worldTransform=this.containerManager.getContainer(e.id).worldTransform);const r=new n.Container;r.label=e.name,this.containerManager.addContainer({name:e.id,container:r}),t.worldTransform=r.worldTransform}componentChanged(e){"GameObject"!==e.componentName?"Transform2D"===e.componentName&&(e.type===t.OBSERVER_TYPE.ADD?(this.ensureContainer(e.gameObject,e.component),this.reparent(e.gameObject)):e.type===t.OBSERVER_TYPE.REMOVE&&this.waitRemoveIds.push(e.gameObject.id)):this.reparent(e.gameObject)}reparent(e){if(!e)return;const t=this.containerManager.getContainer(e.id);if(t)if(e.parent){const n=this.containerManager.getContainer(e.parent.id);n&&t.parent!==n&&n.addChild(t);const r=e.parent.getComponent("Render");r&&(r.sortDirty=!0)}else if(t.parent){const n=e.getComponent(m);n&&delete n.worldTransform,t.parent.removeChild(t)}}destroy(){this.removeAllListeners(),this.waitRemoveIds=null,this.waitChangeScenes=null,this.system=null,this.containerManager=null}};l=e.__decorate([t.decorators.componentObserver({GameObject:["parent"],Transform2D:[]})],l);var g=l;let u;var f;exports.RENDERER_TYPE=void 0,(f=exports.RENDERER_TYPE||(exports.RENDERER_TYPE={}))[f.UNKNOWN=0]="UNKNOWN",f[f.WEBGL=1]="WEBGL",f[f.CANVAS=2]="CANVAS";let y=class extends t.System{constructor(){super(...arguments),this.application=null,this.multiApps=[]}static{this.systemName="Renderer"}async init(e){this.params=e??{};const n=await this.createApplication(this.params);this.application=n,this.game.canvas=n.canvas,this.containerManager=new d,this.rendererManager=new h({game:this.game,rendererSystem:this}),this.hierarchy=new g({system:this,containerManager:this.containerManager}),this.game.on("sceneChanged",async({scene:e,mode:n,params:r})=>{let o=this.application;n===t.LOAD_SCENE_MODE.MULTI_CANVAS&&(o=await this.createApplication(r),this.multiApps.push(o)),o&&(e.canvas=o.canvas,this.hierarchy.ensureSceneContainer(e),this.hierarchy.emit("changeScene",{scene:e,mode:n,application:o}))});const r=n.renderer.gl;r&&(this.suportedCompressedTextureFormats=function(e){if(u)return u;if(!e)return console.warn("WebGL not available for compressed textures. Silently failing."),{s3tc:!1,etc:!1,etc1:!1,pvrtc:!1,atc:!1,astc:!1};u={s3tc:!!e.getExtension("WEBGL_compressed_texture_s3tc"),etc:!!e.getExtension("WEBGL_compressed_texture_etc"),etc1:!!e.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:!!e.getExtension("WEBGL_compressed_texture_pvrtc")||!!e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:!!e.getExtension("WEBGL_compressed_texture_atc"),astc:!!e.getExtension("WEBGL_compressed_texture_astc")};try{console.log("Supported compressed texture formats: "+Object.keys(u).filter(e=>u[e]).join(", "))}catch(e){}return u}(r))}registerObserver(e){const t=this.constructor;t.observerInfo||(t.observerInfo={});const n=t.observerInfo;for(const t in e)n[t]||(n[t]=[]),n[t].push(...e[t])}async createApplication(e){const t={...e,autoStart:!0,sharedTicker:!0},r=new n.Application;try{await r.init(t)}catch{await r.init({...t,preference:"canvas"})}return s.Ticker.shared.stop(),s.Ticker.shared.autoStart=!1,r}update(){const e=this.componentObserver.clear();for(const t of e)"GameObject"===t.componentName&&t.gameObject&&(this.ensureTransform2D(t.gameObject),t.gameObject.parent&&this.ensureTransform2D(t.gameObject.parent)),this.hierarchy.componentChanged(t);if(this.application)for(const e of this.game.gameObjects){const t=e.getComponent(m);t&&this.containerManager.updateTransform({name:e.id,transform:t,parentSize:e.parent?.getComponent(m)?.size}),this.rendererManager.update(e)}}ensureTransform2D(e){if(!e||e.destroyed||e===e.scene)return;let t=e.getComponent(m);t||(t=e.addComponent(new m)),t&&(this.hierarchy.ensureContainer(e,t),this.hierarchy.reparent(e))}lateUpdate(e){this.application&&(this.hierarchy.update(),this.application.ticker.update(e.time))}onDestroy(){this.application?.destroy();for(const e of this.multiApps)e&&e.destroy();this.hierarchy.destroy(),this.hierarchy=null,this.params=null,this.rendererManager=null,this.containerManager=null,this.application=null,this.game=null,this.multiApps=null}resize(e,t){this.application&&(this.params={...this.params,width:e,height:t},this.application.renderer.resize(e,t))}};y=e.__decorate([t.decorators.componentObserver({GameObject:["parent"],Transform2D:[]})],y);var v=y;Object.assign(v,{packageName:"@combos-fun/plugin-renderer",packageVersion:"0.1.12"});class _ extends t.System{constructor(e){super(e),this.asyncIdMap={};const t=this.constructor;this.observerInfo=t.observerInfo}componentChanged(e){}rendererUpdate(e){}update(e){const t=this.componentObserver.clear();for(const e of t)this.componentChanged(e)}increaseAsyncId(e){return this.asyncIdMap[e]=(this.asyncIdMap[e]||0)+1,this.asyncIdMap[e]}validateAsyncId(e,t){return this.asyncIdMap[e]===t}}exports.ContainerManager=d,exports.RESOURCE_KEY_SPLIT="_s|r|c_",exports.Renderer=_,exports.RendererManager=h,exports.RendererSystem=v,exports.Transform2D=m;
|
|
1
|
+
"use strict";var e=require("tslib"),t=require("@combos-fun/engine"),n=require("@combos-fun/renderer-adapter"),r=require("lodash-es/isEqual"),i=require("eventemitter3"),a=require("@combos-fun/inspector-decorator"),s=require("pixi.js");function o(e){return e&&e.__esModule?e:{default:e}}var c=o(r),p=o(i);class h{constructor({game:e,rendererSystem:t}){this.renderers=[],this.game=e,this.rendererSystem=t}register(...e){for(const t of e)t.game=this.game,t.rendererManager=this.rendererSystem.rendererManager,t.containerManager=this.rendererSystem.containerManager,this.renderers.push(t)}componentChanged(e){for(const n of e)for(const e of this.renderers){const r=e.observerInfo[n.componentName];if(r){if([t.OBSERVER_TYPE.ADD,t.OBSERVER_TYPE.REMOVE].indexOf(n.type)>-1){try{e.componentChanged&&e.componentChanged(n)}catch(e){console.error(`gameObject: ${n.gameObject.name}, ${n.componentName} is error.`,n,e)}continue}if(r.findIndex(e=>c.default(e,n.prop))>-1)try{e.componentChanged&&e.componentChanged(n)}catch(e){console.error(`gameObject: ${n.gameObject&&n.gameObject.name}, ${n.componentName} is componentChanged error.`,n,e)}}}}update(e){for(const t of e.components)for(const n of this.renderers){const r=[];if(n.observerInfo[t.name]&&-1===r.indexOf(e)){r.push(e);try{n.rendererUpdate&&n.rendererUpdate(e)}catch(n){console.info(`gameObject: ${e.name}, ${t.name} is update error`,n)}}}}}class d{constructor(){this.containerMap={}}addContainer({name:e,container:t}){this.containerMap[e]=t}getContainer(e){return this.containerMap[e]}removeContainer(e){this.containerMap[e]?.destroy({children:!0}),delete this.containerMap[e]}updateTransform({name:e,transform:t,parentSize:n}){const r=this.containerMap[e];if(!r||!t)return;const{anchor:i,origin:a,position:s,rotation:o,scale:c,size:p,skew:h}=t;r.rotation=o,r.scale=c,r.pivot.x=p.width*a.x,r.pivot.y=p.height*a.y,r.skew=h;let d=s.x,l=s.y;n&&(d+=n.width*i.x,l+=n.height*i.y),r.position={x:d,y:l}}}class l extends t.Component{constructor(){super(...arguments),this.name="Transform2D",this.position={x:0,y:0},this.size={width:0,height:0},this.origin={x:0,y:0},this.anchor={x:0,y:0},this.scale={x:1,y:1},this.skew={x:0,y:0},this.rotation=0}static{this.componentName="Transform2D"}init(e={}){const t=["position","size","origin","anchor","scale","skew"];for(const n of t)Object.assign(this[n],e[n]);this.rotation=e.rotation??this.rotation}}e.__decorate([a.Field({type:"vector2",step:1,group:"Transform2D",label:"Position",description:"Position on the design canvas (x right, y down)."})],l.prototype,"position",void 0),e.__decorate([a.Field({type:"size",step:1,min:0,group:"Transform2D",label:"Size",description:"Width and height of the object in design pixels."})],l.prototype,"size",void 0),e.__decorate([a.Field({type:"vector2",step:.1,group:"Transform2D",label:"Origin",description:"Local origin used for layout math."})],l.prototype,"origin",void 0),e.__decorate([a.Field({type:"vector2",step:.1,group:"Transform2D",label:"Anchor",description:"Anchor point (0–1) used when positioning and scaling."})],l.prototype,"anchor",void 0),e.__decorate([a.Field({type:"vector2",step:.1,group:"Transform2D",label:"Scale",description:"Scale multipliers on X and Y (1 = original size)."})],l.prototype,"scale",void 0),e.__decorate([a.Field({type:"vector2",step:.1,group:"Transform2D",label:"Skew",description:"Skew amounts on X and Y."})],l.prototype,"skew",void 0),e.__decorate([a.Field({type:"number",step:.1,group:"Transform2D",label:"Rotation",description:"Rotation in radians.",editor:"number-stepper"})],l.prototype,"rotation",void 0);let m=class extends p.default{constructor({system:e,containerManager:t}){super(),this.name="PixiHierarchy",this.waitRemoveIds=[],this.waitChangeScenes=[],this.containerManager=t,this.init(e)}init(e){this.system=e,this.on("changeScene",({scene:e,mode:t,application:n})=>{this.waitChangeScenes.push({scene:e,mode:t,application:n})})}update(){for(const e of this.waitRemoveIds)this.containerManager.removeContainer(e);this.waitRemoveIds=[];for(const e of this.waitChangeScenes){this.ensureSceneContainer(e.scene);const t=this.containerManager.getContainer(e.scene.id);t&&(e.application.stage.removeChildren(),e.application.stage.addChild(t))}this.waitChangeScenes=[]}ensureSceneContainer(e){if(this.containerManager.getContainer(e.id))return;const t=new n.Container;t.label=e.name,this.containerManager.addContainer({name:e.id,container:t})}ensureContainer(e,t){if(this.containerManager.getContainer(e.id))return void(t.worldTransform=this.containerManager.getContainer(e.id).worldTransform);const r=new n.Container;r.label=e.name,this.containerManager.addContainer({name:e.id,container:r}),t.worldTransform=r.worldTransform}componentChanged(e){"GameObject"!==e.componentName?"Transform2D"===e.componentName&&(e.type===t.OBSERVER_TYPE.ADD?(this.ensureContainer(e.gameObject,e.component),this.reparent(e.gameObject)):e.type===t.OBSERVER_TYPE.REMOVE&&this.waitRemoveIds.push(e.gameObject.id)):this.reparent(e.gameObject)}reparent(e){if(!e)return;const t=this.containerManager.getContainer(e.id);if(t)if(e.parent){const n=this.containerManager.getContainer(e.parent.id);n&&t.parent!==n&&n.addChild(t);const r=e.parent.getComponent("Render");r&&(r.sortDirty=!0)}else if(t.parent){const n=e.getComponent(l);n&&delete n.worldTransform,t.parent.removeChild(t)}}destroy(){this.removeAllListeners(),this.waitRemoveIds=null,this.waitChangeScenes=null,this.system=null,this.containerManager=null}};m=e.__decorate([t.decorators.componentObserver({GameObject:["parent"],Transform2D:[]})],m);var u=m;let g;var f;exports.RENDERER_TYPE=void 0,(f=exports.RENDERER_TYPE||(exports.RENDERER_TYPE={}))[f.UNKNOWN=0]="UNKNOWN",f[f.WEBGL=1]="WEBGL",f[f.CANVAS=2]="CANVAS";let y=class extends t.System{constructor(){super(...arguments),this.application=null,this.multiApps=[],this.quality=null,this.adaptive=null,this.viewWidth=0,this.viewHeight=0}static{this.systemName="Renderer"}async init(e){this.params=e??{},this.quality=t.resolveRenderQuality(this.params,{adaptivePixelRatio:!1}),this.adaptive=new t.AdaptivePixelRatio({pixelRatio:this.quality.pixelRatio,ceiling:this.quality.pixelRatioCeiling,enabled:this.quality.adaptivePixelRatio});const n=await this.createApplication(this.params);this.rememberView(n),this.application=n,this.game.canvas=n.canvas,this.containerManager=new d,this.rendererManager=new h({game:this.game,rendererSystem:this}),this.hierarchy=new u({system:this,containerManager:this.containerManager}),this.game.on("sceneChanged",async({scene:e,mode:n,params:r})=>{let i=this.application;n===t.LOAD_SCENE_MODE.MULTI_CANVAS&&(i=await this.createApplication(r),this.multiApps.push(i)),i&&(e.canvas=i.canvas,this.hierarchy.ensureSceneContainer(e),this.hierarchy.emit("changeScene",{scene:e,mode:n,application:i}))});const r=n.renderer.gl;r&&(this.suportedCompressedTextureFormats=function(e){if(g)return g;if(!e)return console.warn("WebGL not available for compressed textures. Silently failing."),{s3tc:!1,etc:!1,etc1:!1,pvrtc:!1,atc:!1,astc:!1};g={s3tc:!!e.getExtension("WEBGL_compressed_texture_s3tc"),etc:!!e.getExtension("WEBGL_compressed_texture_etc"),etc1:!!e.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:!!e.getExtension("WEBGL_compressed_texture_pvrtc")||!!e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:!!e.getExtension("WEBGL_compressed_texture_atc"),astc:!!e.getExtension("WEBGL_compressed_texture_astc")};try{console.log("Supported compressed texture formats: "+Object.keys(g).filter(e=>g[e]).join(", "))}catch(e){}return g}(r))}registerObserver(e){const t=this.constructor;t.observerInfo||(t.observerInfo={});const n=t.observerInfo;for(const t in e)n[t]||(n[t]=[]),n[t].push(...e[t])}async createApplication(e={}){const r=t.resolveRenderQuality(e,{adaptivePixelRatio:!1}),i=e.preference,a=function(e={},t){const{maxPixelRatio:n,adaptivePixelRatio:r,pauseWhenHidden:i,pixelRatio:a,devicePixelRatio:s,...o}=e;return{...o,resolution:t.pixelRatio,autoDensity:t.autoDensity,antialias:t.antialias,..."default"===t.powerPreference?{}:{powerPreference:t.powerPreference},autoStart:!0,sharedTicker:!0}}(e,r);a.preference=i??["webgpu","webgl"];const o=new n.Application;try{await o.init(a)}catch{if(null==i)try{await o.init({...a,preference:"webgl"})}catch{await o.init({...a,preference:"canvas"})}else await o.init({...a,preference:"canvas"})}return s.Ticker.shared.stop(),s.Ticker.shared.autoStart=!1,o}update(){const e=this.componentObserver.clear();for(const t of e)"GameObject"===t.componentName&&t.gameObject&&(this.ensureTransform2D(t.gameObject),t.gameObject.parent&&this.ensureTransform2D(t.gameObject.parent)),this.hierarchy.componentChanged(t);if(this.application)for(const e of this.game.gameObjects){const t=e.getComponent(l);t&&this.containerManager.updateTransform({name:e.id,transform:t,parentSize:e.parent?.getComponent(l)?.size}),this.rendererManager.update(e)}}ensureTransform2D(e){if(!e||e.destroyed||e===e.scene)return;let t=e.getComponent(l);t||(t=e.addComponent(new l)),t&&(this.hierarchy.ensureContainer(e,t),this.hierarchy.reparent(e))}lateUpdate(e){if(!this.application)return;if(this.hierarchy.update(),t.shouldPauseRendering(!1!==this.quality?.pauseWhenHidden))return;const n=this.adaptive?.sample(e?.deltaTime??0);null!=n&&this.applyPixelRatio(n),this.application.ticker.update(e.time)}rememberView(e){const t=this.params?.width||e.renderer?.screen?.width||0,n=this.params?.height||e.renderer?.screen?.height||0;t&&(this.viewWidth=t),n&&(this.viewHeight=n)}applyPixelRatio(e){const t=this.application?.renderer;t&&e>0&&(t.resolution=e,this.viewWidth>0&&this.viewHeight>0&&t.resize(this.viewWidth,this.viewHeight))}onDestroy(){this.application?.destroy();for(const e of this.multiApps)e&&e.destroy();this.hierarchy.destroy(),this.hierarchy=null,this.params=null,this.rendererManager=null,this.containerManager=null,this.application=null,this.game=null,this.multiApps=null}resize(e,t){this.application&&(this.params={...this.params,width:e,height:t},this.viewWidth=e,this.viewHeight=t,this.application.renderer.resize(e,t))}};y=e.__decorate([t.decorators.componentObserver({GameObject:["parent"],Transform2D:[]})],y);var v=y;Object.assign(v,{packageName:"@combos-fun/plugin-renderer",packageVersion:"0.1.14-beta.0"});class w extends t.System{constructor(e){super(e),this.asyncIdMap={};const t=this.constructor;this.observerInfo=t.observerInfo}componentChanged(e){}rendererUpdate(e){}update(e){const t=this.componentObserver.clear();for(const e of t)this.componentChanged(e)}increaseAsyncId(e){return this.asyncIdMap[e]=(this.asyncIdMap[e]||0)+1,this.asyncIdMap[e]}validateAsyncId(e,t){return this.asyncIdMap[e]===t}}exports.ContainerManager=d,exports.RESOURCE_KEY_SPLIT="_s|r|c_",exports.Renderer=w,exports.RendererManager=h,exports.RendererSystem=v,exports.Transform2D=l;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Container, Application } from '@combos-fun/renderer-adapter';
|
|
2
|
-
import { Component, ComponentParams, System, Game, PureObserverInfo, ComponentChanged, GameObject, UpdateParams, Scene, LOAD_SCENE_MODE } from '@combos-fun/engine';
|
|
2
|
+
import { Component, ComponentParams, System, Game, PureObserverInfo, ComponentChanged, GameObject, UpdateParams, Scene, LOAD_SCENE_MODE, RenderQualityInput } from '@combos-fun/engine';
|
|
3
3
|
import EventEmitter from 'eventemitter3';
|
|
4
4
|
import { ApplicationOptions } from 'pixi.js';
|
|
5
5
|
|
|
@@ -152,9 +152,9 @@ declare enum RENDERER_TYPE {
|
|
|
152
152
|
WEBGL = 1,
|
|
153
153
|
CANVAS = 2
|
|
154
154
|
}
|
|
155
|
-
declare class Renderer extends System<Partial<ApplicationOptions
|
|
155
|
+
declare class Renderer extends System<Partial<ApplicationOptions> & RenderQualityInput> {
|
|
156
156
|
static systemName: string;
|
|
157
|
-
params: Partial<ApplicationOptions
|
|
157
|
+
params: Partial<ApplicationOptions> & RenderQualityInput;
|
|
158
158
|
rendererManager: RendererManager;
|
|
159
159
|
containerManager: ContainerManager;
|
|
160
160
|
application: Application | null;
|
|
@@ -162,12 +162,18 @@ declare class Renderer extends System<Partial<ApplicationOptions>> {
|
|
|
162
162
|
hierarchy: PixiHierarchy;
|
|
163
163
|
multiApps: Application[];
|
|
164
164
|
suportedCompressedTextureFormats: SuportedCompressedTexture;
|
|
165
|
-
|
|
165
|
+
private quality;
|
|
166
|
+
private adaptive;
|
|
167
|
+
private viewWidth;
|
|
168
|
+
private viewHeight;
|
|
169
|
+
init(params?: Partial<ApplicationOptions> & RenderQualityInput): Promise<void>;
|
|
166
170
|
registerObserver(observerInfo: PureObserverInfo): void;
|
|
167
171
|
private createApplication;
|
|
168
172
|
update(): void;
|
|
169
173
|
private ensureTransform2D;
|
|
170
|
-
lateUpdate(e:
|
|
174
|
+
lateUpdate(e: UpdateParams): void;
|
|
175
|
+
private rememberView;
|
|
176
|
+
private applyPixelRatio;
|
|
171
177
|
onDestroy(): void;
|
|
172
178
|
resize(width: any, height: any): void;
|
|
173
179
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __decorate } from 'tslib';
|
|
2
|
-
import { OBSERVER_TYPE, Component, decorators, System, LOAD_SCENE_MODE } from '@combos-fun/engine';
|
|
2
|
+
import { OBSERVER_TYPE, Component, decorators, System, resolveRenderQuality, AdaptivePixelRatio, LOAD_SCENE_MODE, shouldPauseRendering } from '@combos-fun/engine';
|
|
3
3
|
import { Container, Application } from '@combos-fun/renderer-adapter';
|
|
4
4
|
import isEqual from 'lodash-es/isEqual';
|
|
5
5
|
import EventEmitter from 'eventemitter3';
|
|
@@ -332,6 +332,20 @@ function getSuportCompressedTextureFormats(gl) {
|
|
|
332
332
|
return result;
|
|
333
333
|
}
|
|
334
334
|
|
|
335
|
+
/** Pixi init options with engine-only quality fields removed. */
|
|
336
|
+
function pixiRenderOptions(params = {}, quality) {
|
|
337
|
+
const { maxPixelRatio: _maxPixelRatio, adaptivePixelRatio: _adaptivePixelRatio, pauseWhenHidden: _pauseWhenHidden, pixelRatio: _pixelRatio, devicePixelRatio: _devicePixelRatio, ...rest } = params;
|
|
338
|
+
return {
|
|
339
|
+
...rest,
|
|
340
|
+
resolution: quality.pixelRatio,
|
|
341
|
+
autoDensity: quality.autoDensity,
|
|
342
|
+
antialias: quality.antialias,
|
|
343
|
+
...(quality.powerPreference === 'default' ? {} : { powerPreference: quality.powerPreference }),
|
|
344
|
+
autoStart: true,
|
|
345
|
+
sharedTicker: true,
|
|
346
|
+
};
|
|
347
|
+
}
|
|
348
|
+
|
|
335
349
|
var RENDERER_TYPE;
|
|
336
350
|
(function (RENDERER_TYPE) {
|
|
337
351
|
RENDERER_TYPE[RENDERER_TYPE["UNKNOWN"] = 0] = "UNKNOWN";
|
|
@@ -343,12 +357,23 @@ let Renderer$1 = class Renderer extends System {
|
|
|
343
357
|
super(...arguments);
|
|
344
358
|
this.application = null;
|
|
345
359
|
this.multiApps = [];
|
|
360
|
+
this.quality = null;
|
|
361
|
+
this.adaptive = null;
|
|
362
|
+
this.viewWidth = 0;
|
|
363
|
+
this.viewHeight = 0;
|
|
346
364
|
}
|
|
347
365
|
static { }
|
|
348
366
|
static { this.systemName = 'Renderer'; }
|
|
349
367
|
async init(params) {
|
|
350
368
|
this.params = params ?? {};
|
|
369
|
+
this.quality = resolveRenderQuality(this.params, { adaptivePixelRatio: false });
|
|
370
|
+
this.adaptive = new AdaptivePixelRatio({
|
|
371
|
+
pixelRatio: this.quality.pixelRatio,
|
|
372
|
+
ceiling: this.quality.pixelRatioCeiling,
|
|
373
|
+
enabled: this.quality.adaptivePixelRatio,
|
|
374
|
+
});
|
|
351
375
|
const app = await this.createApplication(this.params);
|
|
376
|
+
this.rememberView(app);
|
|
352
377
|
this.application = app;
|
|
353
378
|
this.game.canvas = app.canvas;
|
|
354
379
|
this.containerManager = new ContainerManager();
|
|
@@ -395,21 +420,27 @@ let Renderer$1 = class Renderer extends System {
|
|
|
395
420
|
thisObserverInfo[key].push(...observerInfo[key]);
|
|
396
421
|
}
|
|
397
422
|
}
|
|
398
|
-
async createApplication(params) {
|
|
399
|
-
const
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
};
|
|
423
|
+
async createApplication(params = {}) {
|
|
424
|
+
const quality = resolveRenderQuality(params, { adaptivePixelRatio: false });
|
|
425
|
+
const callerPreference = params.preference;
|
|
426
|
+
const initOptions = pixiRenderOptions(params, quality);
|
|
427
|
+
initOptions.preference = callerPreference ?? ['webgpu', 'webgl'];
|
|
404
428
|
const app = new Application();
|
|
405
429
|
try {
|
|
406
430
|
await app.init(initOptions);
|
|
407
431
|
}
|
|
408
432
|
catch {
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
433
|
+
if (callerPreference == null) {
|
|
434
|
+
try {
|
|
435
|
+
await app.init({ ...initOptions, preference: 'webgl' });
|
|
436
|
+
}
|
|
437
|
+
catch {
|
|
438
|
+
await app.init({ ...initOptions, preference: 'canvas' });
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
else {
|
|
442
|
+
await app.init({ ...initOptions, preference: 'canvas' });
|
|
443
|
+
}
|
|
413
444
|
}
|
|
414
445
|
Ticker.shared.stop();
|
|
415
446
|
Ticker.shared.autoStart = false;
|
|
@@ -457,8 +488,30 @@ let Renderer$1 = class Renderer extends System {
|
|
|
457
488
|
return;
|
|
458
489
|
}
|
|
459
490
|
this.hierarchy.update();
|
|
491
|
+
if (shouldPauseRendering(this.quality?.pauseWhenHidden !== false))
|
|
492
|
+
return;
|
|
493
|
+
const next = this.adaptive?.sample(e?.deltaTime ?? 0);
|
|
494
|
+
if (next != null)
|
|
495
|
+
this.applyPixelRatio(next);
|
|
460
496
|
this.application.ticker.update(e.time);
|
|
461
497
|
}
|
|
498
|
+
rememberView(app) {
|
|
499
|
+
const width = this.params?.width || app.renderer?.screen?.width || 0;
|
|
500
|
+
const height = this.params?.height || app.renderer?.screen?.height || 0;
|
|
501
|
+
if (width)
|
|
502
|
+
this.viewWidth = width;
|
|
503
|
+
if (height)
|
|
504
|
+
this.viewHeight = height;
|
|
505
|
+
}
|
|
506
|
+
applyPixelRatio(ratio) {
|
|
507
|
+
const renderer = this.application?.renderer;
|
|
508
|
+
if (!renderer || !(ratio > 0))
|
|
509
|
+
return;
|
|
510
|
+
renderer.resolution = ratio;
|
|
511
|
+
if (this.viewWidth > 0 && this.viewHeight > 0) {
|
|
512
|
+
renderer.resize(this.viewWidth, this.viewHeight);
|
|
513
|
+
}
|
|
514
|
+
}
|
|
462
515
|
onDestroy() {
|
|
463
516
|
this.application?.destroy();
|
|
464
517
|
for (const app of this.multiApps) {
|
|
@@ -478,6 +531,8 @@ let Renderer$1 = class Renderer extends System {
|
|
|
478
531
|
return;
|
|
479
532
|
}
|
|
480
533
|
this.params = { ...this.params, width, height };
|
|
534
|
+
this.viewWidth = width;
|
|
535
|
+
this.viewHeight = height;
|
|
481
536
|
this.application.renderer.resize(width, height);
|
|
482
537
|
}
|
|
483
538
|
};
|
|
@@ -492,7 +547,7 @@ var Renderer$2 = Renderer$1;
|
|
|
492
547
|
/** Auto-generated by scripts/build-package.mjs — do not edit. */
|
|
493
548
|
Object.assign(Renderer$2, {
|
|
494
549
|
packageName: "@combos-fun/plugin-renderer",
|
|
495
|
-
packageVersion: "0.1.
|
|
550
|
+
packageVersion: "0.1.14-beta.0",
|
|
496
551
|
});
|
|
497
552
|
|
|
498
553
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-renderer.esm.js","sources":["../lib/manager/RendererManager.ts","../lib/manager/ContainerManager.ts","../lib/Transform2D.ts","../lib/PixiHierarchy.ts","../lib/compressedTexture/ability.ts","../lib/System.ts","../lib/__combosPackageMeta.gen.ts","../lib/Renderer.ts","../lib/index.ts"],"sourcesContent":["import isEqual from 'lodash-es/isEqual';\nimport { GameObject, Game, ComponentChanged, OBSERVER_TYPE } from '@combos-fun/engine';\nimport Renderer from '../Renderer';\nimport RendererSystem from '../System';\n\nclass RendererManager {\n game: Game;\n rendererSystem: RendererSystem;\n constructor({ game, rendererSystem }) {\n this.game = game;\n this.rendererSystem = rendererSystem;\n }\n renderers: Renderer[] = [];\n register(...renderers: Renderer[]) {\n for (const renderer of renderers) {\n renderer.game = this.game;\n renderer.rendererManager = this.rendererSystem.rendererManager;\n renderer.containerManager = this.rendererSystem.containerManager;\n this.renderers.push(renderer);\n }\n }\n componentChanged(changes: ComponentChanged[]) {\n for (const changed of changes) {\n for (const renderer of this.renderers) {\n const props = renderer.observerInfo[changed.componentName];\n if (props) {\n if ([OBSERVER_TYPE.ADD, OBSERVER_TYPE.REMOVE].indexOf(changed.type) > -1) {\n try {\n renderer.componentChanged && renderer.componentChanged(changed);\n } catch (e) {\n console.error(`gameObject: ${changed.gameObject.name}, ${changed.componentName} is error.`, changed, e);\n }\n continue;\n }\n\n const index = props.findIndex(prop => {\n return isEqual(prop, changed.prop);\n });\n\n if (index > -1) {\n try {\n renderer.componentChanged && renderer.componentChanged(changed);\n } catch (e) {\n console.error(\n `gameObject: ${changed.gameObject && changed.gameObject.name}, ${\n changed.componentName\n } is componentChanged error.`,\n changed,\n e,\n );\n }\n }\n }\n }\n }\n }\n update(gameObject: GameObject) {\n for (const component of gameObject.components) {\n for (const renderer of this.renderers) {\n const cache = [];\n const props = renderer.observerInfo[component.name];\n if (props && cache.indexOf(gameObject) === -1) {\n cache.push(gameObject);\n try {\n renderer.rendererUpdate && renderer.rendererUpdate(gameObject);\n } catch (e) {\n console.info(`gameObject: ${gameObject.name}, ${component.name} is update error`, e);\n }\n }\n }\n }\n }\n}\nexport default RendererManager;\n","import { Point, ObservablePoint } from 'pixi.js';\nimport { Container } from '@combos-fun/renderer-adapter';\nimport type Transform2D from '../Transform2D';\n\nexport default class ContainerManager {\n containerMap: { [propName: number]: Container } = {};\n addContainer({ name, container }: { name: number; container: Container }) {\n this.containerMap[name] = container;\n }\n getContainer(name: number) {\n return this.containerMap[name];\n }\n removeContainer(name: number) {\n this.containerMap[name]?.destroy({ children: true });\n delete this.containerMap[name];\n }\n updateTransform({\n name,\n transform,\n parentSize,\n }: {\n name: number;\n transform: Transform2D;\n parentSize?: { width: number; height: number };\n }) {\n const container = this.containerMap[name];\n if (!container || !transform) return;\n const { anchor, origin, position, rotation, scale, size, skew } = transform;\n container.rotation = rotation;\n container.scale = scale as Point;\n container.pivot.x = size.width * origin.x;\n container.pivot.y = size.height * origin.y;\n container.skew = skew as ObservablePoint;\n let x = position.x;\n let y = position.y;\n if (parentSize) {\n x = x + parentSize.width * anchor.x;\n y = y + parentSize.height * anchor.y;\n }\n\n container.position = { x, y } as Point;\n }\n}\n","import { Component } from '@combos-fun/engine';\nimport type { ComponentParams } from '@combos-fun/engine';\nimport { Field } from '@combos-fun/inspector-decorator';\n\ninterface Vector2 {\n x: number;\n y: number;\n}\n\ninterface Size2 {\n width: number;\n height: number;\n}\n\nexport interface TransformMatrix {\n a: number;\n b: number;\n c: number;\n d: number;\n tx: number;\n ty: number;\n array?: number[];\n}\n\nexport interface Transform2DParams extends ComponentParams {\n position?: Vector2;\n size?: Size2;\n origin?: Vector2;\n anchor?: Vector2;\n scale?: Vector2;\n skew?: Vector2;\n rotation?: number;\n}\n\n/** 2D layout pose. Hierarchy lives on GameObject. */\nclass Transform2D extends Component<Transform2DParams> {\n static componentName: string = 'Transform2D';\n readonly name: string = 'Transform2D';\n\n worldTransform: TransformMatrix;\n\n init(params: Transform2DParams = {}) {\n const props = ['position', 'size', 'origin', 'anchor', 'scale', 'skew'];\n for (const key of props) {\n Object.assign(this[key], params[key]);\n }\n this.rotation = params.rotation ?? this.rotation;\n }\n\n @Field({\n type: 'vector2',\n step: 1,\n group: 'Transform2D',\n label: 'Position',\n description: 'Position on the design canvas (x right, y down).',\n })\n position: Vector2 = {x: 0, y: 0};\n\n @Field({\n type: 'size',\n step: 1,\n min: 0,\n group: 'Transform2D',\n label: 'Size',\n description: 'Width and height of the object in design pixels.',\n })\n size: Size2 = {width: 0, height: 0};\n\n @Field({\n type: 'vector2',\n step: 0.1,\n group: 'Transform2D',\n label: 'Origin',\n description: 'Local origin used for layout math.',\n })\n origin: Vector2 = {x: 0, y: 0};\n\n @Field({\n type: 'vector2',\n step: 0.1,\n group: 'Transform2D',\n label: 'Anchor',\n description: 'Anchor point (0–1) used when positioning and scaling.',\n })\n anchor: Vector2 = {x: 0, y: 0};\n\n @Field({\n type: 'vector2',\n step: 0.1,\n group: 'Transform2D',\n label: 'Scale',\n description: 'Scale multipliers on X and Y (1 = original size).',\n })\n scale: Vector2 = {x: 1, y: 1};\n\n @Field({\n type: 'vector2',\n step: 0.1,\n group: 'Transform2D',\n label: 'Skew',\n description: 'Skew amounts on X and Y.',\n })\n skew: Vector2 = {x: 0, y: 0};\n\n @Field({\n type: 'number',\n step: 0.1,\n group: 'Transform2D',\n label: 'Rotation',\n description: 'Rotation in radians.',\n editor: 'number-stepper',\n })\n rotation: number = 0;\n}\n\nexport default Transform2D;\n","import { decorators, ComponentChanged, OBSERVER_TYPE, Scene, LOAD_SCENE_MODE, GameObject } from '@combos-fun/engine';\nimport EventEmitter from 'eventemitter3';\nimport { Application, Container } from '@combos-fun/renderer-adapter';\nimport Render from './System';\nimport ContainerManager from './manager/ContainerManager';\nimport Transform2D from './Transform2D';\n\ntype RenderSortDirty = { sortDirty: boolean };\n\n@decorators.componentObserver({\n GameObject: ['parent'],\n Transform2D: [],\n})\nexport default class PixiHierarchy extends EventEmitter {\n name: string = 'PixiHierarchy';\n waitRemoveIds: number[] = [];\n system: Render;\n containerManager: ContainerManager;\n waitChangeScenes: {\n scene: Scene;\n mode: LOAD_SCENE_MODE;\n application: Application;\n }[] = [];\n constructor({ system, containerManager }) {\n super();\n this.containerManager = containerManager;\n this.init(system);\n }\n init(system: Render) {\n this.system = system;\n this.on('changeScene', ({ scene, mode, application }) => {\n this.waitChangeScenes.push({ scene, mode, application });\n });\n }\n update() {\n for (const id of this.waitRemoveIds) {\n this.containerManager.removeContainer(id);\n }\n this.waitRemoveIds = [];\n\n for (const sceneInfo of this.waitChangeScenes) {\n this.ensureSceneContainer(sceneInfo.scene);\n const container = this.containerManager.getContainer(sceneInfo.scene.id);\n if (container) {\n sceneInfo.application.stage.removeChildren();\n sceneInfo.application.stage.addChild(container);\n }\n }\n this.waitChangeScenes = [];\n }\n ensureSceneContainer(scene: Scene) {\n if (this.containerManager.getContainer(scene.id)) return;\n const container = new Container();\n container.label = scene.name;\n this.containerManager.addContainer({\n name: scene.id,\n container,\n });\n }\n ensureContainer(gameObject: GameObject, transform: Transform2D) {\n if (this.containerManager.getContainer(gameObject.id)) {\n transform.worldTransform = this.containerManager.getContainer(gameObject.id)\n .worldTransform as unknown as Transform2D['worldTransform'];\n return;\n }\n const container = new Container();\n container.label = gameObject.name;\n this.containerManager.addContainer({\n name: gameObject.id,\n container,\n });\n transform.worldTransform = container.worldTransform as unknown as Transform2D['worldTransform'];\n }\n componentChanged(changed: ComponentChanged) {\n if (changed.componentName === 'GameObject') {\n this.reparent(changed.gameObject);\n return;\n }\n if (changed.componentName !== 'Transform2D') return;\n if (changed.type === OBSERVER_TYPE.ADD) {\n this.ensureContainer(changed.gameObject, changed.component as Transform2D);\n this.reparent(changed.gameObject);\n } else if (changed.type === OBSERVER_TYPE.REMOVE) {\n this.waitRemoveIds.push(changed.gameObject.id);\n }\n }\n reparent(gameObject?: GameObject) {\n if (!gameObject) return;\n const container = this.containerManager.getContainer(gameObject.id);\n if (!container) return;\n if (gameObject.parent) {\n const parentContainer = this.containerManager.getContainer(gameObject.parent.id);\n if (parentContainer && container.parent !== parentContainer) {\n parentContainer.addChild(container);\n }\n const render = gameObject.parent.getComponent('Render') as unknown as RenderSortDirty;\n if (render) {\n render.sortDirty = true;\n }\n } else if (container.parent) {\n const transform = gameObject.getComponent(Transform2D);\n if (transform) {\n delete transform.worldTransform;\n }\n container.parent.removeChild(container);\n }\n }\n destroy() {\n this.removeAllListeners();\n this.waitRemoveIds = null;\n this.waitChangeScenes = null;\n this.system = null;\n this.containerManager = null;\n }\n}\n","/**\n * Inspired by PixiJS v6\n */\nexport type CompressedTextureExtensions = {\n s3tc?: WEBGL_compressed_texture_s3tc,\n s3tc_sRGB: WEBGL_compressed_texture_s3tc_srgb,\n etc: WEBGL_compressed_texture_etc,\n etc1: WEBGL_compressed_texture_etc1,\n pvrtc: WEBKIT_WEBGL_compressed_texture_pvrtc,\n atc: WEBGL_compressed_texture_atc,\n astc: WEBGL_compressed_texture_astc\n};\nexport type CompressedTextureExtensionRef = keyof CompressedTextureExtensions;\nlet result = undefined;\nexport interface SuportedCompressedTexture {\n s3tc: boolean,\n etc: boolean,\n etc1: boolean,\n pvrtc: boolean,\n atc: boolean,\n astc: boolean,\n}\nexport function getSuportCompressedTextureFormats(gl: WebGLRenderingContext): SuportedCompressedTexture {\n if (result) return result;\n\n if (!gl) {\n // #if _DEBUG\n console.warn('WebGL not available for compressed textures. Silently failing.');\n // #endif\n\n return {\n s3tc: false,\n etc: false,\n etc1: false,\n pvrtc: false,\n atc: false,\n astc: false,\n };\n }\n\n result = {\n s3tc: !!gl.getExtension('WEBGL_compressed_texture_s3tc'),\n etc: !!gl.getExtension('WEBGL_compressed_texture_etc'),\n etc1: !!gl.getExtension('WEBGL_compressed_texture_etc1'),\n pvrtc: !!gl.getExtension('WEBGL_compressed_texture_pvrtc')\n || !!gl.getExtension('WEBKIT_WEBGL_compressed_texture_pvrtc'),\n atc: !!gl.getExtension('WEBGL_compressed_texture_atc'),\n astc: !!gl.getExtension('WEBGL_compressed_texture_astc')\n };\n\n try {\n console.log('Supported compressed texture formats: ' + Object.keys(result).filter((type) => result[type]).join(', '))\n } catch (e) { }\n return result;\n}","import { System, decorators, Game, LOAD_SCENE_MODE, PureObserverInfo } from '@combos-fun/engine';\nimport { Application } from '@combos-fun/renderer-adapter';\nimport RendererManager from './manager/RendererManager';\nimport ContainerManager from './manager/ContainerManager';\nimport PixiHierarchy from './PixiHierarchy';\nimport Transform2D from './Transform2D';\nimport { Ticker } from 'pixi.js';\nimport type { ApplicationOptions } from 'pixi.js';\nimport type { Renderer as PixiRenderer } from 'pixi.js';\nimport type { WebGLRenderer } from 'pixi.js';\nimport { registerCompressedTexture } from './compressedTexture';\nimport { SuportedCompressedTexture, getSuportCompressedTextureFormats } from './compressedTexture/ability';\n\nexport enum RENDERER_TYPE {\n UNKNOWN = 0,\n WEBGL = 1,\n CANVAS = 2,\n}\n\n@decorators.componentObserver({\n GameObject: ['parent'],\n Transform2D: [],\n})\nexport default class Renderer extends System<Partial<ApplicationOptions>> {\n static systemName: string = 'Renderer';\n params: Partial<ApplicationOptions>;\n rendererManager: RendererManager;\n containerManager: ContainerManager;\n application: Application | null = null;\n game: Game;\n hierarchy: PixiHierarchy;\n multiApps: Application[] = [];\n suportedCompressedTextureFormats: SuportedCompressedTexture;\n\n async init(params?: Partial<ApplicationOptions>) {\n this.params = params ?? {};\n const app = await this.createApplication(this.params);\n this.application = app;\n this.game.canvas = app.canvas;\n this.containerManager = new ContainerManager();\n this.rendererManager = new RendererManager({\n game: this.game,\n rendererSystem: this,\n });\n\n this.hierarchy = new PixiHierarchy({\n system: this,\n containerManager: this.containerManager,\n });\n this.game.on('sceneChanged', async ({ scene, mode, params: sceneParams }) => {\n let application: Application | null = this.application;\n if (mode === LOAD_SCENE_MODE.MULTI_CANVAS) {\n application = await this.createApplication(sceneParams);\n this.multiApps.push(application);\n }\n if (!application) {\n return;\n }\n scene.canvas = application.canvas;\n this.hierarchy.ensureSceneContainer(scene);\n this.hierarchy.emit('changeScene', {\n scene,\n mode,\n application,\n });\n });\n\n const gl = (app.renderer as WebGLRenderer).gl;\n if (gl) {\n this.suportedCompressedTextureFormats = getSuportCompressedTextureFormats(gl);\n registerCompressedTexture(gl);\n }\n }\n\n registerObserver(observerInfo: PureObserverInfo): void {\n const Ctor = this.constructor as typeof Renderer & { observerInfo: PureObserverInfo };\n if (!Ctor.observerInfo) {\n Ctor.observerInfo = {} as PureObserverInfo;\n }\n const thisObserverInfo = Ctor.observerInfo;\n for (const key in observerInfo) {\n if (!thisObserverInfo[key]) {\n thisObserverInfo[key] = [];\n }\n thisObserverInfo[key].push(...observerInfo[key]);\n }\n }\n\n private async createApplication(params: Partial<ApplicationOptions>): Promise<Application> {\n const initOptions: Partial<ApplicationOptions> = {\n ...params,\n autoStart: true,\n sharedTicker: true,\n };\n\n const app = new Application();\n try {\n await app.init(initOptions);\n } catch {\n await app.init({\n ...initOptions,\n preference: 'canvas',\n });\n }\n\n Ticker.shared.stop();\n Ticker.shared.autoStart = false;\n\n return app;\n }\n\n update() {\n const changes = this.componentObserver.clear();\n for (const changed of changes) {\n if (changed.componentName === 'GameObject' && changed.gameObject) {\n this.ensureTransform2D(changed.gameObject);\n if (changed.gameObject.parent) this.ensureTransform2D(changed.gameObject.parent);\n }\n this.hierarchy.componentChanged(changed);\n }\n if (!this.application) {\n return;\n }\n for (const gameObject of this.game.gameObjects) {\n const transform = gameObject.getComponent(Transform2D);\n if (transform) {\n this.containerManager.updateTransform({\n name: gameObject.id,\n transform,\n parentSize: gameObject.parent?.getComponent(Transform2D)?.size,\n });\n }\n this.rendererManager.update(gameObject);\n }\n }\n\n private ensureTransform2D(gameObject: Game['gameObjects'][number]) {\n if (!gameObject || gameObject.destroyed || gameObject === gameObject.scene) return;\n let transform = gameObject.getComponent(Transform2D);\n if (!transform) {\n transform = gameObject.addComponent(new Transform2D());\n }\n if (!transform) return;\n this.hierarchy.ensureContainer(gameObject, transform);\n this.hierarchy.reparent(gameObject);\n }\n\n lateUpdate(e) {\n if (!this.application) {\n return;\n }\n this.hierarchy.update();\n this.application.ticker.update(e.time);\n }\n\n onDestroy() {\n this.application?.destroy();\n for (const app of this.multiApps) {\n app && app.destroy();\n }\n this.hierarchy.destroy();\n this.hierarchy = null;\n this.params = null;\n this.rendererManager = null;\n this.containerManager = null;\n this.application = null;\n this.game = null;\n this.multiApps = null;\n }\n\n resize(width, height) {\n if (!this.application) {\n return;\n }\n this.params = { ...this.params, width, height };\n this.application.renderer.resize(width, height);\n }\n}\n","/** Auto-generated by scripts/build-package.mjs — do not edit. */\n\nimport Renderer from './System';\n\nObject.assign(Renderer, {\n packageName: \"@combos-fun/plugin-renderer\",\n packageVersion: \"0.1.12\",\n});\n","/* eslint-disable @typescript-eslint/no-unused-vars */\n\nimport { GameObject, Game, PureObserverInfo, ComponentChanged, System, UpdateParams } from '@combos-fun/engine';\nimport ContainerManager from './manager/ContainerManager';\nimport RendererManager from './manager/RendererManager';\n\nexport default class Renderer<T extends {} = {}> extends System<T> {\n /**\n * Renderer name\n */\n name: string;\n\n /**\n * currentGame\n */\n game: Game;\n\n /**\n * observer component props info\n */\n static observerInfo: PureObserverInfo;\n\n /**\n * observer component props info\n */\n observerInfo: PureObserverInfo;\n\n /**\n * containerManager\n */\n containerManager: ContainerManager;\n rendererManager: RendererManager;\n\n constructor(params?: T) {\n super(params);\n const Ctor = this.constructor as typeof Renderer & { observerInfo: PureObserverInfo };\n this.observerInfo = Ctor.observerInfo;\n }\n\n // init(arg?: any): void;\n\n /**\n * Called when an observed component property changes.\n */\n componentChanged(_changed: ComponentChanged) { }\n\n /**\n * Called every frame.\n * @param _gameObject gameObject\n */\n rendererUpdate(_gameObject: GameObject) { }\n\n override update(e?: UpdateParams): void {\n const changes = this.componentObserver.clear();\n for (const changed of changes) {\n this.componentChanged(changed);\n }\n }\n\n protected asyncIdMap: Record<number, number> = {}\n\n protected increaseAsyncId(id: number) {\n this.asyncIdMap[id] = (this.asyncIdMap[id] || 0) + 1;\n return this.asyncIdMap[id];\n }\n\n protected validateAsyncId(id: number, asyncId: number) {\n return this.asyncIdMap[id] === asyncId;\n }\n}\n","import RendererSystem, { RENDERER_TYPE } from './System';\nimport RendererManager from './manager/RendererManager';\nimport ContainerManager from './manager/ContainerManager';\nimport Renderer from './Renderer';\nimport Transform2D from './Transform2D';\n\n/** Shared resource cache key separator used across renderer plugins */\nexport const RESOURCE_KEY_SPLIT = '_s|r|c_';\n\nexport type { Transform2DParams, TransformMatrix } from './Transform2D';\nexport { RendererManager, ContainerManager, RendererSystem, RENDERER_TYPE, Renderer, Transform2D };\n\n"],"names":["Renderer","PixiHierarchy"],"mappings":";;;;;;;;AAKA,MAAM,eAAe,CAAA;AAGnB,IAAA,WAAA,CAAY,EAAE,IAAI,EAAE,cAAc,EAAE,EAAA;QAIpC,IAAA,CAAA,SAAS,GAAe,EAAE;AAHxB,QAAA,IAAI,CAAC,IAAI,GAAG,IAAI;AAChB,QAAA,IAAI,CAAC,cAAc,GAAG,cAAc;IACtC;IAEA,QAAQ,CAAC,GAAG,SAAqB,EAAA;AAC/B,QAAA,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE;AAChC,YAAA,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI;YACzB,QAAQ,CAAC,eAAe,GAAG,IAAI,CAAC,cAAc,CAAC,eAAe;YAC9D,QAAQ,CAAC,gBAAgB,GAAG,IAAI,CAAC,cAAc,CAAC,gBAAgB;AAChE,YAAA,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC;QAC/B;IACF;AACA,IAAA,gBAAgB,CAAC,OAA2B,EAAA;AA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vB7B;AAIA,MAAM,CAAC,MAAM,CAACA,UAAQ,EAAE;AACtB,IAAA,WAAW,EAAE,6BAA6B;AAC1C,IAAA,cAAc,EAAE,QAAQ;AACzB,CAAA,CAAC;;ACPF;AAMc,MAAO,QAA4B,SAAQ,MAAS,CAAA;AA2BhE,IAAA,WAAA,CAAY,MAAU,EAAA;QACpB,KAAK,CAAC,MAAM,CAAC;QAyBL,IAAA,CAAA,UAAU,GAA2B,EAAE;AAxB/C,QAAA,MAAM,IAAI,GAAG,IAAI,CAAC,WAAmE;AACrF,QAAA,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY;IACvC;;AAIA;;AAEG;IACH,gBAAgB,CAAC,QAA0B,EAAA,EAAI;AAE/C;;;AAGG;IACH,cAAc,CAAC,WAAuB,EAAA,EAAI;AAEjC,IAAA,MAAM,CAAC,CAAgB,EAAA;QAC9B,MAAM,OAAO,GAAG,IAAI,CAAC,iBAAiB,CAAC,KAAK,EAAE;AAC9C,QAAA,KAAK,MAAM,OAAO,IAAI,OAAO,EAAE;AAC7B,YAAA,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC;QAChC;IACF;AAIU,IAAA,eAAe,CAAC,EAAU,EAAA;AAClC,QAAA,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC;AACpD,QAAA,OAAO,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC;IAC5B;IAEU,eAAe,CAAC,EAAU,EAAE,OAAe,EAAA;QACnD,OAAO,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,KAAK,OAAO;IACxC;AACD;;AC/DD;AACO,MAAM,kBAAkB,GAAG;;;;"}
|
|
1
|
+
{"version":3,"file":"plugin-renderer.esm.js","sources":["../lib/manager/RendererManager.ts","../lib/manager/ContainerManager.ts","../lib/Transform2D.ts","../lib/PixiHierarchy.ts","../lib/compressedTexture/ability.ts","../lib/renderOptions.ts","../lib/System.ts","../lib/__combosPackageMeta.gen.ts","../lib/Renderer.ts","../lib/index.ts"],"sourcesContent":["import isEqual from 'lodash-es/isEqual';\nimport { GameObject, Game, ComponentChanged, OBSERVER_TYPE } from '@combos-fun/engine';\nimport Renderer from '../Renderer';\nimport RendererSystem from '../System';\n\nclass RendererManager {\n game: Game;\n rendererSystem: RendererSystem;\n constructor({ game, rendererSystem }) {\n this.game = game;\n this.rendererSystem = rendererSystem;\n }\n renderers: Renderer[] = [];\n register(...renderers: Renderer[]) {\n for (const renderer of renderers) {\n renderer.game = this.game;\n renderer.rendererManager = this.rendererSystem.rendererManager;\n renderer.containerManager = this.rendererSystem.containerManager;\n this.renderers.push(renderer);\n }\n }\n componentChanged(changes: ComponentChanged[]) {\n for (const changed of changes) {\n for (const renderer of this.renderers) {\n const props = renderer.observerInfo[changed.componentName];\n if (props) {\n if ([OBSERVER_TYPE.ADD, OBSERVER_TYPE.REMOVE].indexOf(changed.type) > -1) {\n try {\n renderer.componentChanged && renderer.componentChanged(changed);\n } catch (e) {\n console.error(`gameObject: ${changed.gameObject.name}, ${changed.componentName} is error.`, changed, e);\n }\n continue;\n }\n\n const index = props.findIndex(prop => {\n return isEqual(prop, changed.prop);\n });\n\n if (index > -1) {\n try {\n renderer.componentChanged && renderer.componentChanged(changed);\n } catch (e) {\n console.error(\n `gameObject: ${changed.gameObject && changed.gameObject.name}, ${\n changed.componentName\n } is componentChanged error.`,\n changed,\n e,\n );\n }\n }\n }\n }\n }\n }\n update(gameObject: GameObject) {\n for (const component of gameObject.components) {\n for (const renderer of this.renderers) {\n const cache = [];\n const props = renderer.observerInfo[component.name];\n if (props && cache.indexOf(gameObject) === -1) {\n cache.push(gameObject);\n try {\n renderer.rendererUpdate && renderer.rendererUpdate(gameObject);\n } catch (e) {\n console.info(`gameObject: ${gameObject.name}, ${component.name} is update error`, e);\n }\n }\n }\n }\n }\n}\nexport default RendererManager;\n","import { Point, ObservablePoint } from 'pixi.js';\nimport { Container } from '@combos-fun/renderer-adapter';\nimport type Transform2D from '../Transform2D';\n\nexport default class ContainerManager {\n containerMap: { [propName: number]: Container } = {};\n addContainer({ name, container }: { name: number; container: Container }) {\n this.containerMap[name] = container;\n }\n getContainer(name: number) {\n return this.containerMap[name];\n }\n removeContainer(name: number) {\n this.containerMap[name]?.destroy({ children: true });\n delete this.containerMap[name];\n }\n updateTransform({\n name,\n transform,\n parentSize,\n }: {\n name: number;\n transform: Transform2D;\n parentSize?: { width: number; height: number };\n }) {\n const container = this.containerMap[name];\n if (!container || !transform) return;\n const { anchor, origin, position, rotation, scale, size, skew } = transform;\n container.rotation = rotation;\n container.scale = scale as Point;\n container.pivot.x = size.width * origin.x;\n container.pivot.y = size.height * origin.y;\n container.skew = skew as ObservablePoint;\n let x = position.x;\n let y = position.y;\n if (parentSize) {\n x = x + parentSize.width * anchor.x;\n y = y + parentSize.height * anchor.y;\n }\n\n container.position = { x, y } as Point;\n }\n}\n","import { Component } from '@combos-fun/engine';\nimport type { ComponentParams } from '@combos-fun/engine';\nimport { Field } from '@combos-fun/inspector-decorator';\n\ninterface Vector2 {\n x: number;\n y: number;\n}\n\ninterface Size2 {\n width: number;\n height: number;\n}\n\nexport interface TransformMatrix {\n a: number;\n b: number;\n c: number;\n d: number;\n tx: number;\n ty: number;\n array?: number[];\n}\n\nexport interface Transform2DParams extends ComponentParams {\n position?: Vector2;\n size?: Size2;\n origin?: Vector2;\n anchor?: Vector2;\n scale?: Vector2;\n skew?: Vector2;\n rotation?: number;\n}\n\n/** 2D layout pose. Hierarchy lives on GameObject. */\nclass Transform2D extends Component<Transform2DParams> {\n static componentName: string = 'Transform2D';\n readonly name: string = 'Transform2D';\n\n worldTransform: TransformMatrix;\n\n init(params: Transform2DParams = {}) {\n const props = ['position', 'size', 'origin', 'anchor', 'scale', 'skew'];\n for (const key of props) {\n Object.assign(this[key], params[key]);\n }\n this.rotation = params.rotation ?? this.rotation;\n }\n\n @Field({\n type: 'vector2',\n step: 1,\n group: 'Transform2D',\n label: 'Position',\n description: 'Position on the design canvas (x right, y down).',\n })\n position: Vector2 = {x: 0, y: 0};\n\n @Field({\n type: 'size',\n step: 1,\n min: 0,\n group: 'Transform2D',\n label: 'Size',\n description: 'Width and height of the object in design pixels.',\n })\n size: Size2 = {width: 0, height: 0};\n\n @Field({\n type: 'vector2',\n step: 0.1,\n group: 'Transform2D',\n label: 'Origin',\n description: 'Local origin used for layout math.',\n })\n origin: Vector2 = {x: 0, y: 0};\n\n @Field({\n type: 'vector2',\n step: 0.1,\n group: 'Transform2D',\n label: 'Anchor',\n description: 'Anchor point (0–1) used when positioning and scaling.',\n })\n anchor: Vector2 = {x: 0, y: 0};\n\n @Field({\n type: 'vector2',\n step: 0.1,\n group: 'Transform2D',\n label: 'Scale',\n description: 'Scale multipliers on X and Y (1 = original size).',\n })\n scale: Vector2 = {x: 1, y: 1};\n\n @Field({\n type: 'vector2',\n step: 0.1,\n group: 'Transform2D',\n label: 'Skew',\n description: 'Skew amounts on X and Y.',\n })\n skew: Vector2 = {x: 0, y: 0};\n\n @Field({\n type: 'number',\n step: 0.1,\n group: 'Transform2D',\n label: 'Rotation',\n description: 'Rotation in radians.',\n editor: 'number-stepper',\n })\n rotation: number = 0;\n}\n\nexport default Transform2D;\n","import { decorators, ComponentChanged, OBSERVER_TYPE, Scene, LOAD_SCENE_MODE, GameObject } from '@combos-fun/engine';\nimport EventEmitter from 'eventemitter3';\nimport { Application, Container } from '@combos-fun/renderer-adapter';\nimport Render from './System';\nimport ContainerManager from './manager/ContainerManager';\nimport Transform2D from './Transform2D';\n\ntype RenderSortDirty = { sortDirty: boolean };\n\n@decorators.componentObserver({\n GameObject: ['parent'],\n Transform2D: [],\n})\nexport default class PixiHierarchy extends EventEmitter {\n name: string = 'PixiHierarchy';\n waitRemoveIds: number[] = [];\n system: Render;\n containerManager: ContainerManager;\n waitChangeScenes: {\n scene: Scene;\n mode: LOAD_SCENE_MODE;\n application: Application;\n }[] = [];\n constructor({ system, containerManager }) {\n super();\n this.containerManager = containerManager;\n this.init(system);\n }\n init(system: Render) {\n this.system = system;\n this.on('changeScene', ({ scene, mode, application }) => {\n this.waitChangeScenes.push({ scene, mode, application });\n });\n }\n update() {\n for (const id of this.waitRemoveIds) {\n this.containerManager.removeContainer(id);\n }\n this.waitRemoveIds = [];\n\n for (const sceneInfo of this.waitChangeScenes) {\n this.ensureSceneContainer(sceneInfo.scene);\n const container = this.containerManager.getContainer(sceneInfo.scene.id);\n if (container) {\n sceneInfo.application.stage.removeChildren();\n sceneInfo.application.stage.addChild(container);\n }\n }\n this.waitChangeScenes = [];\n }\n ensureSceneContainer(scene: Scene) {\n if (this.containerManager.getContainer(scene.id)) return;\n const container = new Container();\n container.label = scene.name;\n this.containerManager.addContainer({\n name: scene.id,\n container,\n });\n }\n ensureContainer(gameObject: GameObject, transform: Transform2D) {\n if (this.containerManager.getContainer(gameObject.id)) {\n transform.worldTransform = this.containerManager.getContainer(gameObject.id)\n .worldTransform as unknown as Transform2D['worldTransform'];\n return;\n }\n const container = new Container();\n container.label = gameObject.name;\n this.containerManager.addContainer({\n name: gameObject.id,\n container,\n });\n transform.worldTransform = container.worldTransform as unknown as Transform2D['worldTransform'];\n }\n componentChanged(changed: ComponentChanged) {\n if (changed.componentName === 'GameObject') {\n this.reparent(changed.gameObject);\n return;\n }\n if (changed.componentName !== 'Transform2D') return;\n if (changed.type === OBSERVER_TYPE.ADD) {\n this.ensureContainer(changed.gameObject, changed.component as Transform2D);\n this.reparent(changed.gameObject);\n } else if (changed.type === OBSERVER_TYPE.REMOVE) {\n this.waitRemoveIds.push(changed.gameObject.id);\n }\n }\n reparent(gameObject?: GameObject) {\n if (!gameObject) return;\n const container = this.containerManager.getContainer(gameObject.id);\n if (!container) return;\n if (gameObject.parent) {\n const parentContainer = this.containerManager.getContainer(gameObject.parent.id);\n if (parentContainer && container.parent !== parentContainer) {\n parentContainer.addChild(container);\n }\n const render = gameObject.parent.getComponent('Render') as unknown as RenderSortDirty;\n if (render) {\n render.sortDirty = true;\n }\n } else if (container.parent) {\n const transform = gameObject.getComponent(Transform2D);\n if (transform) {\n delete transform.worldTransform;\n }\n container.parent.removeChild(container);\n }\n }\n destroy() {\n this.removeAllListeners();\n this.waitRemoveIds = null;\n this.waitChangeScenes = null;\n this.system = null;\n this.containerManager = null;\n }\n}\n","/**\n * Inspired by PixiJS v6\n */\nexport type CompressedTextureExtensions = {\n s3tc?: WEBGL_compressed_texture_s3tc,\n s3tc_sRGB: WEBGL_compressed_texture_s3tc_srgb,\n etc: WEBGL_compressed_texture_etc,\n etc1: WEBGL_compressed_texture_etc1,\n pvrtc: WEBKIT_WEBGL_compressed_texture_pvrtc,\n atc: WEBGL_compressed_texture_atc,\n astc: WEBGL_compressed_texture_astc\n};\nexport type CompressedTextureExtensionRef = keyof CompressedTextureExtensions;\nlet result = undefined;\nexport interface SuportedCompressedTexture {\n s3tc: boolean,\n etc: boolean,\n etc1: boolean,\n pvrtc: boolean,\n atc: boolean,\n astc: boolean,\n}\nexport function getSuportCompressedTextureFormats(gl: WebGLRenderingContext): SuportedCompressedTexture {\n if (result) return result;\n\n if (!gl) {\n // #if _DEBUG\n console.warn('WebGL not available for compressed textures. Silently failing.');\n // #endif\n\n return {\n s3tc: false,\n etc: false,\n etc1: false,\n pvrtc: false,\n atc: false,\n astc: false,\n };\n }\n\n result = {\n s3tc: !!gl.getExtension('WEBGL_compressed_texture_s3tc'),\n etc: !!gl.getExtension('WEBGL_compressed_texture_etc'),\n etc1: !!gl.getExtension('WEBGL_compressed_texture_etc1'),\n pvrtc: !!gl.getExtension('WEBGL_compressed_texture_pvrtc')\n || !!gl.getExtension('WEBKIT_WEBGL_compressed_texture_pvrtc'),\n atc: !!gl.getExtension('WEBGL_compressed_texture_atc'),\n astc: !!gl.getExtension('WEBGL_compressed_texture_astc')\n };\n\n try {\n console.log('Supported compressed texture formats: ' + Object.keys(result).filter((type) => result[type]).join(', '))\n } catch (e) { }\n return result;\n}","import type { ApplicationOptions } from 'pixi.js';\nimport type { RenderQualityInput, ResolvedRenderQuality } from '@combos-fun/engine';\n\n/** Pixi init options with engine-only quality fields removed. */\nexport function pixiRenderOptions(\n params: Partial<ApplicationOptions> & RenderQualityInput = {},\n quality: ResolvedRenderQuality,\n): Partial<ApplicationOptions> {\n const {\n maxPixelRatio: _maxPixelRatio,\n adaptivePixelRatio: _adaptivePixelRatio,\n pauseWhenHidden: _pauseWhenHidden,\n pixelRatio: _pixelRatio,\n devicePixelRatio: _devicePixelRatio,\n ...rest\n } = params;\n return {\n ...rest,\n resolution: quality.pixelRatio,\n autoDensity: quality.autoDensity,\n antialias: quality.antialias,\n ...(quality.powerPreference === 'default' ? {} : { powerPreference: quality.powerPreference }),\n autoStart: true,\n sharedTicker: true,\n };\n}\n","import { System, decorators, Game, LOAD_SCENE_MODE, PureObserverInfo, AdaptivePixelRatio, resolveRenderQuality, shouldPauseRendering } from '@combos-fun/engine';\nimport type { RenderQualityInput, ResolvedRenderQuality, UpdateParams } from '@combos-fun/engine';\nimport { Application } from '@combos-fun/renderer-adapter';\nimport RendererManager from './manager/RendererManager';\nimport ContainerManager from './manager/ContainerManager';\nimport PixiHierarchy from './PixiHierarchy';\nimport Transform2D from './Transform2D';\nimport { Ticker } from 'pixi.js';\nimport type { ApplicationOptions } from 'pixi.js';\nimport type { WebGLRenderer } from 'pixi.js';\nimport { registerCompressedTexture } from './compressedTexture';\nimport { SuportedCompressedTexture, getSuportCompressedTextureFormats } from './compressedTexture/ability';\nimport { pixiRenderOptions } from './renderOptions';\n\nexport enum RENDERER_TYPE {\n UNKNOWN = 0,\n WEBGL = 1,\n CANVAS = 2,\n}\n\n@decorators.componentObserver({\n GameObject: ['parent'],\n Transform2D: [],\n})\nexport default class Renderer extends System<Partial<ApplicationOptions> & RenderQualityInput> {\n static systemName: string = 'Renderer';\n params: Partial<ApplicationOptions> & RenderQualityInput;\n rendererManager: RendererManager;\n containerManager: ContainerManager;\n application: Application | null = null;\n game: Game;\n hierarchy: PixiHierarchy;\n multiApps: Application[] = [];\n suportedCompressedTextureFormats: SuportedCompressedTexture;\n private quality: ResolvedRenderQuality | null = null;\n private adaptive: AdaptivePixelRatio | null = null;\n private viewWidth = 0;\n private viewHeight = 0;\n\n async init(params?: Partial<ApplicationOptions> & RenderQualityInput) {\n this.params = params ?? {};\n this.quality = resolveRenderQuality(this.params, { adaptivePixelRatio: false });\n this.adaptive = new AdaptivePixelRatio({\n pixelRatio: this.quality.pixelRatio,\n ceiling: this.quality.pixelRatioCeiling,\n enabled: this.quality.adaptivePixelRatio,\n });\n const app = await this.createApplication(this.params);\n this.rememberView(app);\n this.application = app;\n this.game.canvas = app.canvas;\n this.containerManager = new ContainerManager();\n this.rendererManager = new RendererManager({\n game: this.game,\n rendererSystem: this,\n });\n\n this.hierarchy = new PixiHierarchy({\n system: this,\n containerManager: this.containerManager,\n });\n this.game.on('sceneChanged', async ({ scene, mode, params: sceneParams }) => {\n let application: Application | null = this.application;\n if (mode === LOAD_SCENE_MODE.MULTI_CANVAS) {\n application = await this.createApplication(sceneParams);\n this.multiApps.push(application);\n }\n if (!application) {\n return;\n }\n scene.canvas = application.canvas;\n this.hierarchy.ensureSceneContainer(scene);\n this.hierarchy.emit('changeScene', {\n scene,\n mode,\n application,\n });\n });\n\n const gl = (app.renderer as WebGLRenderer).gl;\n if (gl) {\n this.suportedCompressedTextureFormats = getSuportCompressedTextureFormats(gl);\n registerCompressedTexture(gl);\n }\n }\n\n registerObserver(observerInfo: PureObserverInfo): void {\n const Ctor = this.constructor as typeof Renderer & { observerInfo: PureObserverInfo };\n if (!Ctor.observerInfo) {\n Ctor.observerInfo = {} as PureObserverInfo;\n }\n const thisObserverInfo = Ctor.observerInfo;\n for (const key in observerInfo) {\n if (!thisObserverInfo[key]) {\n thisObserverInfo[key] = [];\n }\n thisObserverInfo[key].push(...observerInfo[key]);\n }\n }\n\n private async createApplication(params: Partial<ApplicationOptions> & RenderQualityInput = {}): Promise<Application> {\n const quality = resolveRenderQuality(params, { adaptivePixelRatio: false });\n const callerPreference = params.preference;\n const initOptions = pixiRenderOptions(params, quality);\n initOptions.preference = callerPreference ?? ['webgpu', 'webgl'];\n\n const app = new Application();\n try {\n await app.init(initOptions);\n } catch {\n if (callerPreference == null) {\n try {\n await app.init({ ...initOptions, preference: 'webgl' });\n } catch {\n await app.init({ ...initOptions, preference: 'canvas' });\n }\n } else {\n await app.init({ ...initOptions, preference: 'canvas' });\n }\n }\n\n Ticker.shared.stop();\n Ticker.shared.autoStart = false;\n\n return app;\n }\n\n update() {\n const changes = this.componentObserver.clear();\n for (const changed of changes) {\n if (changed.componentName === 'GameObject' && changed.gameObject) {\n this.ensureTransform2D(changed.gameObject);\n if (changed.gameObject.parent) this.ensureTransform2D(changed.gameObject.parent);\n }\n this.hierarchy.componentChanged(changed);\n }\n if (!this.application) {\n return;\n }\n for (const gameObject of this.game.gameObjects) {\n const transform = gameObject.getComponent(Transform2D);\n if (transform) {\n this.containerManager.updateTransform({\n name: gameObject.id,\n transform,\n parentSize: gameObject.parent?.getComponent(Transform2D)?.size,\n });\n }\n this.rendererManager.update(gameObject);\n }\n }\n\n private ensureTransform2D(gameObject: Game['gameObjects'][number]) {\n if (!gameObject || gameObject.destroyed || gameObject === gameObject.scene) return;\n let transform = gameObject.getComponent(Transform2D);\n if (!transform) {\n transform = gameObject.addComponent(new Transform2D());\n }\n if (!transform) return;\n this.hierarchy.ensureContainer(gameObject, transform);\n this.hierarchy.reparent(gameObject);\n }\n\n lateUpdate(e: UpdateParams) {\n if (!this.application) {\n return;\n }\n this.hierarchy.update();\n if (shouldPauseRendering(this.quality?.pauseWhenHidden !== false)) return;\n const next = this.adaptive?.sample(e?.deltaTime ?? 0);\n if (next != null) this.applyPixelRatio(next);\n this.application.ticker.update(e.time);\n }\n\n private rememberView(app: Application) {\n const width = this.params?.width || app.renderer?.screen?.width || 0;\n const height = this.params?.height || app.renderer?.screen?.height || 0;\n if (width) this.viewWidth = width;\n if (height) this.viewHeight = height;\n }\n\n private applyPixelRatio(ratio: number) {\n const renderer = this.application?.renderer;\n if (!renderer || !(ratio > 0)) return;\n renderer.resolution = ratio;\n if (this.viewWidth > 0 && this.viewHeight > 0) {\n renderer.resize(this.viewWidth, this.viewHeight);\n }\n }\n\n onDestroy() {\n this.application?.destroy();\n for (const app of this.multiApps) {\n app && app.destroy();\n }\n this.hierarchy.destroy();\n this.hierarchy = null;\n this.params = null;\n this.rendererManager = null;\n this.containerManager = null;\n this.application = null;\n this.game = null;\n this.multiApps = null;\n }\n\n resize(width, height) {\n if (!this.application) {\n return;\n }\n this.params = { ...this.params, width, height };\n this.viewWidth = width;\n this.viewHeight = height;\n this.application.renderer.resize(width, height);\n }\n}\n","/** Auto-generated by scripts/build-package.mjs — do not edit. */\n\nimport Renderer from './System';\n\nObject.assign(Renderer, {\n packageName: \"@combos-fun/plugin-renderer\",\n packageVersion: \"0.1.14-beta.0\",\n});\n","/* eslint-disable @typescript-eslint/no-unused-vars */\n\nimport { GameObject, Game, PureObserverInfo, ComponentChanged, System, UpdateParams } from '@combos-fun/engine';\nimport ContainerManager from './manager/ContainerManager';\nimport RendererManager from './manager/RendererManager';\n\nexport default class Renderer<T extends {} = {}> extends System<T> {\n /**\n * Renderer name\n */\n name: string;\n\n /**\n * currentGame\n */\n game: Game;\n\n /**\n * observer component props info\n */\n static observerInfo: PureObserverInfo;\n\n /**\n * observer component props info\n */\n observerInfo: PureObserverInfo;\n\n /**\n * containerManager\n */\n containerManager: ContainerManager;\n rendererManager: RendererManager;\n\n constructor(params?: T) {\n super(params);\n const Ctor = this.constructor as typeof Renderer & { observerInfo: PureObserverInfo };\n this.observerInfo = Ctor.observerInfo;\n }\n\n // init(arg?: any): void;\n\n /**\n * Called when an observed component property changes.\n */\n componentChanged(_changed: ComponentChanged) { }\n\n /**\n * Called every frame.\n * @param _gameObject gameObject\n */\n rendererUpdate(_gameObject: GameObject) { }\n\n override update(e?: UpdateParams): void {\n const changes = this.componentObserver.clear();\n for (const changed of changes) {\n this.componentChanged(changed);\n }\n }\n\n protected asyncIdMap: Record<number, number> = {}\n\n protected increaseAsyncId(id: number) {\n this.asyncIdMap[id] = (this.asyncIdMap[id] || 0) + 1;\n return this.asyncIdMap[id];\n }\n\n protected validateAsyncId(id: number, asyncId: number) {\n return this.asyncIdMap[id] === asyncId;\n }\n}\n","import RendererSystem, { RENDERER_TYPE } from './System';\nimport RendererManager from './manager/RendererManager';\nimport ContainerManager from './manager/ContainerManager';\nimport Renderer from './Renderer';\nimport Transform2D from './Transform2D';\n\n/** Shared resource cache key separator used across renderer plugins */\nexport const RESOURCE_KEY_SPLIT = '_s|r|c_';\n\nexport type { Transform2DParams, TransformMatrix } from './Transform2D';\nexport { RendererManager, ContainerManager, RendererSystem, RENDERER_TYPE, Renderer, Transform2D };\n\n"],"names":["Renderer","PixiHierarchy"],"mappings":";;;;;;;;AAKA,MAAM,eAAe,CAAA;AAGnB,IAAA,WAAA,CAAY,EAAE,IAAI,EAAE,cAAc,EAAE,EAAA;QAIpC,IAAA,CAAA,SAAS,GAAe,EAAE;AAHxB,QAAA,IAAI,CAAC,IAAI,GAAG,IAAI;AAChB,QAAA,IAAI,CAAC,cAAc,GAAG,cAAc;IACtC;IAEA,QAAQ,CAAC,GAAG,SAAqB,EAAA;AAC/B,QAAA,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE;AAChC,YAAA,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI;YACzB,QAAQ,CAAC,eAAe,GAAG,IAAI,CAAC,cAAc,CAAC,eAAe;YAC9D,QAAQ,CAAC,gBAAgB,GAAG,IAAI,CAAC,cAAc,CAAC,gBAAgB;AAChE,YAAA,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC;QAC/B;IACF;AACA,IAAA,gBAAgB,CAAC,OAA2B,EAAA;AAC1C,QAAA,KAAK,MAAM,OAAO,IAAI,OAAO,EAAE;AAC7B,YAAA,KAAK,MAAM,QAAQ,IAAI,IAAI,CAAC,SAA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,KAAK,OAAO;IACxC;AACD;;AC/DD;AACO,MAAM,kBAAkB,GAAG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@combos-fun/plugin-renderer",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.14-beta.0",
|
|
4
4
|
"description": "2D rendering foundation",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "dist/plugin-renderer.esm.js",
|
|
@@ -40,9 +40,9 @@
|
|
|
40
40
|
"lodash-es": "^4.17.21",
|
|
41
41
|
"pixi.js": "^8.18.1",
|
|
42
42
|
"resource-loader": "^4.0.0-rc4",
|
|
43
|
-
"@combos-fun/
|
|
44
|
-
"@combos-fun/inspector-decorator": "0.1.
|
|
45
|
-
"@combos-fun/
|
|
43
|
+
"@combos-fun/renderer-adapter": "0.1.14-beta.0",
|
|
44
|
+
"@combos-fun/inspector-decorator": "0.1.14-beta.0",
|
|
45
|
+
"@combos-fun/engine": "0.1.14-beta.0"
|
|
46
46
|
},
|
|
47
47
|
"scripts": {
|
|
48
48
|
"build": "node ../../scripts/build-package.mjs"
|