@combos-fun/plugin-renderer 0.1.14-beta.0 → 0.1.14-beta.1
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.
|
@@ -554,7 +554,7 @@ var Renderer$1 = Renderer$2;
|
|
|
554
554
|
/** Auto-generated by scripts/build-package.mjs — do not edit. */
|
|
555
555
|
Object.assign(Renderer$1, {
|
|
556
556
|
packageName: "@combos-fun/plugin-renderer",
|
|
557
|
-
packageVersion: "0.1.14-beta.
|
|
557
|
+
packageVersion: "0.1.14-beta.1",
|
|
558
558
|
});
|
|
559
559
|
|
|
560
560
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
@@ -590,6 +590,131 @@ class Renderer extends engine.System {
|
|
|
590
590
|
}
|
|
591
591
|
}
|
|
592
592
|
|
|
593
|
+
/** Compressed targets only. RGBA is omitted so Basis is never expanded to uncompressed pixels. */
|
|
594
|
+
const COMPRESSED_TARGETS = [
|
|
595
|
+
'astc-4x4-unorm',
|
|
596
|
+
'bc7-rgba-unorm',
|
|
597
|
+
'bc3-rgba-unorm',
|
|
598
|
+
'etc2-rgba8unorm',
|
|
599
|
+
];
|
|
600
|
+
function asArrayBuffer(data) {
|
|
601
|
+
if (data instanceof ArrayBuffer)
|
|
602
|
+
return data;
|
|
603
|
+
if (ArrayBuffer.isView(data)) {
|
|
604
|
+
const view = data;
|
|
605
|
+
return view.buffer.slice(view.byteOffset, view.byteOffset + view.byteLength);
|
|
606
|
+
}
|
|
607
|
+
return null;
|
|
608
|
+
}
|
|
609
|
+
function loadHtmlImage(url) {
|
|
610
|
+
return new Promise((resolve, reject) => {
|
|
611
|
+
const image = new Image();
|
|
612
|
+
image.crossOrigin = 'anonymous';
|
|
613
|
+
image.onload = () => resolve(image);
|
|
614
|
+
image.onerror = () => reject(new Error(`Failed to load image ${url}`));
|
|
615
|
+
image.src = url;
|
|
616
|
+
});
|
|
617
|
+
}
|
|
618
|
+
async function textureFromElement(image) {
|
|
619
|
+
if (typeof createImageBitmap !== 'function')
|
|
620
|
+
return pixi_js.Texture.from(image);
|
|
621
|
+
let bitmap = null;
|
|
622
|
+
try {
|
|
623
|
+
bitmap = await createImageBitmap(image);
|
|
624
|
+
return pixi_js.Texture.from(bitmap);
|
|
625
|
+
}
|
|
626
|
+
catch {
|
|
627
|
+
try {
|
|
628
|
+
bitmap?.close();
|
|
629
|
+
}
|
|
630
|
+
catch {
|
|
631
|
+
// ImageBitmap.close throws once the bitmap is already detached.
|
|
632
|
+
}
|
|
633
|
+
return pixi_js.Texture.from(image);
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
async function loadPixiKtx2(url) {
|
|
637
|
+
try {
|
|
638
|
+
const supported = await pixi_js.getSupportedTextureFormats();
|
|
639
|
+
const compressed = COMPRESSED_TARGETS.filter((format) => supported.includes(format));
|
|
640
|
+
if (!compressed.length)
|
|
641
|
+
return null;
|
|
642
|
+
const options = await pixi_js.loadKTX2onWorker(url, compressed);
|
|
643
|
+
if (!options?.resource || !COMPRESSED_TARGETS.includes(options.format)) {
|
|
644
|
+
return null;
|
|
645
|
+
}
|
|
646
|
+
return new pixi_js.Texture({ source: new pixi_js.CompressedSource(options) });
|
|
647
|
+
}
|
|
648
|
+
catch {
|
|
649
|
+
return null;
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
async function loadCompressed(res, imageData) {
|
|
653
|
+
const buffer = asArrayBuffer(imageData);
|
|
654
|
+
if (!buffer)
|
|
655
|
+
return null;
|
|
656
|
+
const url = engine.compressedTextureUrl(res.src?.image);
|
|
657
|
+
const blobUrl = URL.createObjectURL(new Blob([buffer]));
|
|
658
|
+
try {
|
|
659
|
+
const texture = await loadPixiKtx2(blobUrl);
|
|
660
|
+
if (texture)
|
|
661
|
+
return texture;
|
|
662
|
+
}
|
|
663
|
+
finally {
|
|
664
|
+
URL.revokeObjectURL(blobUrl);
|
|
665
|
+
}
|
|
666
|
+
if (!url)
|
|
667
|
+
return null;
|
|
668
|
+
return loadPixiKtx2(url);
|
|
669
|
+
}
|
|
670
|
+
/** Build the shared 2D texture. KTX2 bytes are transcoded; a raster element is uploaded as-is. */
|
|
671
|
+
async function createImageTexture(res) {
|
|
672
|
+
const imageData = res.data?.image;
|
|
673
|
+
const compressed = await loadCompressed(res, imageData);
|
|
674
|
+
if (compressed)
|
|
675
|
+
return compressed;
|
|
676
|
+
if (typeof HTMLImageElement !== 'undefined' && imageData instanceof HTMLImageElement) {
|
|
677
|
+
return textureFromElement(imageData);
|
|
678
|
+
}
|
|
679
|
+
const fallback = engine.imageFallbackUrl(res.src?.image);
|
|
680
|
+
if (!fallback)
|
|
681
|
+
return undefined;
|
|
682
|
+
try {
|
|
683
|
+
return textureFromElement(await loadHtmlImage(fallback));
|
|
684
|
+
}
|
|
685
|
+
catch {
|
|
686
|
+
return undefined;
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
/** Texture already built for this resource. Falls back to a raster element when no instance exists. */
|
|
690
|
+
function imageResourceTexture(res) {
|
|
691
|
+
if (res?.instance instanceof pixi_js.Texture)
|
|
692
|
+
return res.instance;
|
|
693
|
+
const image = res?.data?.image;
|
|
694
|
+
if (typeof HTMLImageElement !== 'undefined' && image instanceof HTMLImageElement) {
|
|
695
|
+
return pixi_js.Texture.from(image);
|
|
696
|
+
}
|
|
697
|
+
return undefined;
|
|
698
|
+
}
|
|
699
|
+
function releaseImageTexture(texture) {
|
|
700
|
+
const source = texture.source?.resource;
|
|
701
|
+
texture.destroy(true);
|
|
702
|
+
if (typeof ImageBitmap !== 'undefined' && source instanceof ImageBitmap) {
|
|
703
|
+
try {
|
|
704
|
+
source.close();
|
|
705
|
+
}
|
|
706
|
+
catch {
|
|
707
|
+
// Already closed by the texture source.
|
|
708
|
+
}
|
|
709
|
+
}
|
|
710
|
+
}
|
|
711
|
+
engine.resource.registerInstance(engine.RESOURCE_TYPE.IMAGE, async (res) => createImageTexture(res));
|
|
712
|
+
engine.resource.registerDestroy(engine.RESOURCE_TYPE.IMAGE, ({ instance }) => {
|
|
713
|
+
if (!instance || instance === pixi_js.Texture.EMPTY)
|
|
714
|
+
return;
|
|
715
|
+
releaseImageTexture(instance);
|
|
716
|
+
});
|
|
717
|
+
|
|
593
718
|
/** Shared resource cache key separator used across renderer plugins */
|
|
594
719
|
const RESOURCE_KEY_SPLIT = '_s|r|c_';
|
|
595
720
|
|
|
@@ -599,4 +724,7 @@ exports.Renderer = Renderer;
|
|
|
599
724
|
exports.RendererManager = RendererManager;
|
|
600
725
|
exports.RendererSystem = Renderer$1;
|
|
601
726
|
exports.Transform2D = Transform2D;
|
|
727
|
+
exports.createImageTexture = createImageTexture;
|
|
728
|
+
exports.imageResourceTexture = imageResourceTexture;
|
|
729
|
+
exports.releaseImageTexture = releaseImageTexture;
|
|
602
730
|
//# sourceMappingURL=plugin-renderer.cjs.js.map
|
|
@@ -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/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,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,SAAS,EAAE;gBACrC,MAAM,KAAK,GAAG,QAAQ,CAAC,YAAY,CAAC,OAAO,CAAC,aAAa,CAAC;gBAC1D,IAAI,KAAK,EAAE;oBACT,IAAI,CAACA,oBAAa,CAAC,GAAG,EAAEA,oBAAa,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,EAAE;AACxE,wBAAA,IAAI;4BACF,QAAQ,CAAC,gBAAgB,IAAI,QAAQ,CAAC,gBAAgB,CAAC,OAAO,CAAC;wBACjE;wBAAE,OAAO,CAAC,EAAE;AACV,4BAAA,OAAO,CAAC,KAAK,CA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AE,eAAe;AAChC,CAAA,CAAC;;ACPF;AAMc,MAAO,QAA4B,SAAQC,aAAS,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.cjs.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/imageTexture.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.1\",\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 { compressedTextureUrl, imageFallbackUrl, RESOURCE_TYPE, resource } from '@combos-fun/engine';\nimport type { ResourceStruct } from '@combos-fun/engine';\nimport { CompressedSource, Texture, getSupportedTextureFormats, loadKTX2onWorker } from 'pixi.js';\nimport type { TEXTURE_FORMATS } from 'pixi.js';\n\n/** Compressed targets only. RGBA is omitted so Basis is never expanded to uncompressed pixels. */\nconst COMPRESSED_TARGETS = [\n 'astc-4x4-unorm',\n 'bc7-rgba-unorm',\n 'bc3-rgba-unorm',\n 'etc2-rgba8unorm',\n] as const satisfies readonly TEXTURE_FORMATS[];\n\nfunction asArrayBuffer(data: unknown): ArrayBuffer | null {\n if (data instanceof ArrayBuffer) return data;\n if (ArrayBuffer.isView(data)) {\n const view = data as ArrayBufferView;\n return view.buffer.slice(view.byteOffset, view.byteOffset + view.byteLength) as ArrayBuffer;\n }\n return null;\n}\n\nfunction loadHtmlImage(url: string): Promise<HTMLImageElement> {\n return new Promise((resolve, reject) => {\n const image = new Image();\n image.crossOrigin = 'anonymous';\n image.onload = () => resolve(image);\n image.onerror = () => reject(new Error(`Failed to load image ${url}`));\n image.src = url;\n });\n}\n\nasync function textureFromElement(image: HTMLImageElement): Promise<Texture> {\n if (typeof createImageBitmap !== 'function') return Texture.from(image);\n let bitmap: ImageBitmap | null = null;\n try {\n bitmap = await createImageBitmap(image);\n return Texture.from(bitmap);\n } catch {\n try {\n bitmap?.close();\n } catch {\n // ImageBitmap.close throws once the bitmap is already detached.\n }\n return Texture.from(image);\n }\n}\n\nasync function loadPixiKtx2(url: string): Promise<Texture | null> {\n try {\n const supported = await getSupportedTextureFormats();\n const compressed = COMPRESSED_TARGETS.filter((format) => supported.includes(format));\n if (!compressed.length) return null;\n const options = await loadKTX2onWorker(url, compressed);\n if (!options?.resource || !COMPRESSED_TARGETS.includes(options.format as typeof COMPRESSED_TARGETS[number])) {\n return null;\n }\n return new Texture({ source: new CompressedSource(options) });\n } catch {\n return null;\n }\n}\n\nasync function loadCompressed(res: ResourceStruct, imageData: unknown): Promise<Texture | null> {\n const buffer = asArrayBuffer(imageData);\n if (!buffer) return null;\n const url = compressedTextureUrl(res.src?.image);\n const blobUrl = URL.createObjectURL(new Blob([buffer]));\n try {\n const texture = await loadPixiKtx2(blobUrl);\n if (texture) return texture;\n } finally {\n URL.revokeObjectURL(blobUrl);\n }\n if (!url) return null;\n return loadPixiKtx2(url);\n}\n\n/** Build the shared 2D texture. KTX2 bytes are transcoded; a raster element is uploaded as-is. */\nexport async function createImageTexture(res: ResourceStruct): Promise<Texture | undefined> {\n const imageData = res.data?.image;\n const compressed = await loadCompressed(res, imageData);\n if (compressed) return compressed;\n if (typeof HTMLImageElement !== 'undefined' && imageData instanceof HTMLImageElement) {\n return textureFromElement(imageData);\n }\n const fallback = imageFallbackUrl(res.src?.image);\n if (!fallback) return undefined;\n try {\n return textureFromElement(await loadHtmlImage(fallback));\n } catch {\n return undefined;\n }\n}\n\n/** Texture already built for this resource. Falls back to a raster element when no instance exists. */\nexport function imageResourceTexture(res: ResourceStruct | null | undefined): Texture | undefined {\n if (res?.instance instanceof Texture) return res.instance;\n const image = res?.data?.image;\n if (typeof HTMLImageElement !== 'undefined' && image instanceof HTMLImageElement) {\n return Texture.from(image);\n }\n return undefined;\n}\n\nexport function releaseImageTexture(texture: Texture) {\n const source = texture.source?.resource;\n texture.destroy(true);\n if (typeof ImageBitmap !== 'undefined' && source instanceof ImageBitmap) {\n try {\n source.close();\n } catch {\n // Already closed by the texture source.\n }\n }\n}\n\nresource.registerInstance(RESOURCE_TYPE.IMAGE, async (res) => createImageTexture(res));\nresource.registerDestroy(RESOURCE_TYPE.IMAGE, ({ instance }) => {\n if (!instance || instance === Texture.EMPTY) return;\n releaseImageTexture(instance as Texture);\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';\nimport { createImageTexture, imageResourceTexture, releaseImageTexture } from './imageTexture';\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 };\nexport { createImageTexture, imageResourceTexture, releaseImageTexture };\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","Texture","getSupportedTextureFormats","loadKTX2onWorker","CompressedSource","compressedTextureUrl","imageFallbackUrl","resource","RESOURCE_TYPE"],"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,IAA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AAOA,eAAO,CAAC,IAAI,CAAC,KAAK,CAAC;IAC5B;AACA,IAAA,OAAO,SAAS;AAClB;AAEM,SAAU,mBAAmB,CAAC,OAAgB,EAAA;AAClD,IAAA,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,QAAQ;AACvC,IAAA,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC;IACrB,IAAI,OAAO,WAAW,KAAK,WAAW,IAAI,MAAM,YAAY,WAAW,EAAE;AACvE,QAAA,IAAI;YACF,MAAM,CAAC,KAAK,EAAE;QAChB;AAAE,QAAA,MAAM;;QAER;IACF;AACF;AAEAM,eAAQ,CAAC,gBAAgB,CAACC,oBAAa,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,kBAAkB,CAAC,GAAG,CAAC,CAAC;AACtFD,eAAQ,CAAC,eAAe,CAACC,oBAAa,CAAC,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,KAAI;AAC7D,IAAA,IAAI,CAAC,QAAQ,IAAI,QAAQ,KAAKP,eAAO,CAAC,KAAK;QAAE;IAC7C,mBAAmB,CAAC,QAAmB,CAAC;AAC1C,CAAC,CAAC;;AClHF;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"),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
|
+
"use strict";var e=require("tslib"),t=require("@combos-fun/engine"),r=require("@combos-fun/renderer-adapter"),n=require("lodash-es/isEqual"),i=require("eventemitter3"),a=require("@combos-fun/inspector-decorator"),o=require("pixi.js");function s(e){return e&&e.__esModule?e:{default:e}}var c=s(n),p=s(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 r of e)for(const e of this.renderers){const n=e.observerInfo[r.componentName];if(n){if([t.OBSERVER_TYPE.ADD,t.OBSERVER_TYPE.REMOVE].indexOf(r.type)>-1){try{e.componentChanged&&e.componentChanged(r)}catch(e){console.error(`gameObject: ${r.gameObject.name}, ${r.componentName} is error.`,r,e)}continue}if(n.findIndex(e=>c.default(e,r.prop))>-1)try{e.componentChanged&&e.componentChanged(r)}catch(e){console.error(`gameObject: ${r.gameObject&&r.gameObject.name}, ${r.componentName} is componentChanged error.`,r,e)}}}}update(e){for(const t of e.components)for(const r of this.renderers){const n=[];if(r.observerInfo[t.name]&&-1===n.indexOf(e)){n.push(e);try{r.rendererUpdate&&r.rendererUpdate(e)}catch(r){console.info(`gameObject: ${e.name}, ${t.name} is update error`,r)}}}}}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:r}){const n=this.containerMap[e];if(!n||!t)return;const{anchor:i,origin:a,position:o,rotation:s,scale:c,size:p,skew:h}=t;n.rotation=s,n.scale=c,n.pivot.x=p.width*a.x,n.pivot.y=p.height*a.y,n.skew=h;let d=o.x,l=o.y;r&&(d+=r.width*i.x,l+=r.height*i.y),n.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 r of t)Object.assign(this[r],e[r]);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:r})=>{this.waitChangeScenes.push({scene:e,mode:t,application:r})})}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 r.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 n=new r.Container;n.label=e.name,this.containerManager.addContainer({name:e.id,container:n}),t.worldTransform=n.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 r=this.containerManager.getContainer(e.parent.id);r&&t.parent!==r&&r.addChild(t);const n=e.parent.getComponent("Render");n&&(n.sortDirty=!0)}else if(t.parent){const r=e.getComponent(l);r&&delete r.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 r=await this.createApplication(this.params);this.rememberView(r),this.application=r,this.game.canvas=r.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:r,params:n})=>{let i=this.application;r===t.LOAD_SCENE_MODE.MULTI_CANVAS&&(i=await this.createApplication(n),this.multiApps.push(i)),i&&(e.canvas=i.canvas,this.hierarchy.ensureSceneContainer(e),this.hierarchy.emit("changeScene",{scene:e,mode:r,application:i}))});const n=r.renderer.gl;n&&(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}(n))}registerObserver(e){const t=this.constructor;t.observerInfo||(t.observerInfo={});const r=t.observerInfo;for(const t in e)r[t]||(r[t]=[]),r[t].push(...e[t])}async createApplication(e={}){const n=t.resolveRenderQuality(e,{adaptivePixelRatio:!1}),i=e.preference,a=function(e={},t){const{maxPixelRatio:r,adaptivePixelRatio:n,pauseWhenHidden:i,pixelRatio:a,devicePixelRatio:o,...s}=e;return{...s,resolution:t.pixelRatio,autoDensity:t.autoDensity,antialias:t.antialias,..."default"===t.powerPreference?{}:{powerPreference:t.powerPreference},autoStart:!0,sharedTicker:!0}}(e,n);a.preference=i??["webgpu","webgl"];const s=new r.Application;try{await s.init(a)}catch{if(null==i)try{await s.init({...a,preference:"webgl"})}catch{await s.init({...a,preference:"canvas"})}else await s.init({...a,preference:"canvas"})}return o.Ticker.shared.stop(),o.Ticker.shared.autoStart=!1,s}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 r=this.adaptive?.sample(e?.deltaTime??0);null!=r&&this.applyPixelRatio(r),this.application.ticker.update(e.time)}rememberView(e){const t=this.params?.width||e.renderer?.screen?.width||0,r=this.params?.height||e.renderer?.screen?.height||0;t&&(this.viewWidth=t),r&&(this.viewHeight=r)}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.1"});class x 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}}const w=["astc-4x4-unorm","bc7-rgba-unorm","bc3-rgba-unorm","etc2-rgba8unorm"];async function b(e){if("function"!=typeof createImageBitmap)return o.Texture.from(e);let t=null;try{return t=await createImageBitmap(e),o.Texture.from(t)}catch{try{t?.close()}catch{}return o.Texture.from(e)}}async function E(e){try{const t=await o.getSupportedTextureFormats(),r=w.filter(e=>t.includes(e));if(!r.length)return null;const n=await o.loadKTX2onWorker(e,r);return n?.resource&&w.includes(n.format)?new o.Texture({source:new o.CompressedSource(n)}):null}catch{return null}}async function R(e,r){const n=function(e){if(e instanceof ArrayBuffer)return e;if(ArrayBuffer.isView(e)){const t=e;return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}return null}(r);if(!n)return null;const i=t.compressedTextureUrl(e.src?.image),a=URL.createObjectURL(new Blob([n]));try{const e=await E(a);if(e)return e}finally{URL.revokeObjectURL(a)}return i?E(i):null}async function C(e){const r=e.data?.image,n=await R(e,r);if(n)return n;if("undefined"!=typeof HTMLImageElement&&r instanceof HTMLImageElement)return b(r);const i=t.imageFallbackUrl(e.src?.image);var a;if(i)try{return b(await(a=i,new Promise((e,t)=>{const r=new Image;r.crossOrigin="anonymous",r.onload=()=>e(r),r.onerror=()=>t(new Error(`Failed to load image ${a}`)),r.src=a})))}catch{return}}function T(e){const t=e.source?.resource;if(e.destroy(!0),"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap)try{t.close()}catch{}}t.resource.registerInstance(t.RESOURCE_TYPE.IMAGE,async e=>C(e)),t.resource.registerDestroy(t.RESOURCE_TYPE.IMAGE,({instance:e})=>{e&&e!==o.Texture.EMPTY&&T(e)});exports.ContainerManager=d,exports.RESOURCE_KEY_SPLIT="_s|r|c_",exports.Renderer=x,exports.RendererManager=h,exports.RendererSystem=v,exports.Transform2D=l,exports.createImageTexture=C,exports.imageResourceTexture=function(e){if(e?.instance instanceof o.Texture)return e.instance;const t=e?.data?.image;return"undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement?o.Texture.from(t):void 0},exports.releaseImageTexture=T;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Container, Application } from '@combos-fun/renderer-adapter';
|
|
2
|
-
import { Component, ComponentParams, System, Game, PureObserverInfo, ComponentChanged, GameObject, UpdateParams, Scene, LOAD_SCENE_MODE, RenderQualityInput } from '@combos-fun/engine';
|
|
2
|
+
import { Component, ComponentParams, System, Game, PureObserverInfo, ComponentChanged, GameObject, UpdateParams, Scene, LOAD_SCENE_MODE, RenderQualityInput, ResourceStruct } from '@combos-fun/engine';
|
|
3
3
|
import EventEmitter from 'eventemitter3';
|
|
4
|
-
import { ApplicationOptions } from 'pixi.js';
|
|
4
|
+
import { ApplicationOptions, Texture } from 'pixi.js';
|
|
5
5
|
|
|
6
6
|
interface Vector2 {
|
|
7
7
|
x: number;
|
|
@@ -178,8 +178,14 @@ declare class Renderer extends System<Partial<ApplicationOptions> & RenderQualit
|
|
|
178
178
|
resize(width: any, height: any): void;
|
|
179
179
|
}
|
|
180
180
|
|
|
181
|
+
/** Build the shared 2D texture. KTX2 bytes are transcoded; a raster element is uploaded as-is. */
|
|
182
|
+
declare function createImageTexture(res: ResourceStruct): Promise<Texture | undefined>;
|
|
183
|
+
/** Texture already built for this resource. Falls back to a raster element when no instance exists. */
|
|
184
|
+
declare function imageResourceTexture(res: ResourceStruct | null | undefined): Texture | undefined;
|
|
185
|
+
declare function releaseImageTexture(texture: Texture): void;
|
|
186
|
+
|
|
181
187
|
/** Shared resource cache key separator used across renderer plugins */
|
|
182
188
|
declare const RESOURCE_KEY_SPLIT = "_s|r|c_";
|
|
183
189
|
|
|
184
|
-
export { ContainerManager, RENDERER_TYPE, RESOURCE_KEY_SPLIT, Renderer$1 as Renderer, RendererManager, Renderer as RendererSystem, Transform2D };
|
|
190
|
+
export { ContainerManager, RENDERER_TYPE, RESOURCE_KEY_SPLIT, Renderer$1 as Renderer, RendererManager, Renderer as RendererSystem, Transform2D, createImageTexture, imageResourceTexture, releaseImageTexture };
|
|
185
191
|
export type { Transform2DParams, TransformMatrix };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { __decorate } from 'tslib';
|
|
2
|
-
import { OBSERVER_TYPE, Component, decorators, System, resolveRenderQuality, AdaptivePixelRatio, LOAD_SCENE_MODE, shouldPauseRendering } from '@combos-fun/engine';
|
|
2
|
+
import { OBSERVER_TYPE, Component, decorators, System, resolveRenderQuality, AdaptivePixelRatio, LOAD_SCENE_MODE, shouldPauseRendering, resource, RESOURCE_TYPE, imageFallbackUrl, compressedTextureUrl } 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';
|
|
6
6
|
import { Field } from '@combos-fun/inspector-decorator';
|
|
7
|
-
import { Ticker } from 'pixi.js';
|
|
7
|
+
import { Ticker, Texture, getSupportedTextureFormats, loadKTX2onWorker, CompressedSource } from 'pixi.js';
|
|
8
8
|
|
|
9
9
|
class RendererManager {
|
|
10
10
|
constructor({ game, rendererSystem }) {
|
|
@@ -547,7 +547,7 @@ var Renderer$2 = Renderer$1;
|
|
|
547
547
|
/** Auto-generated by scripts/build-package.mjs — do not edit. */
|
|
548
548
|
Object.assign(Renderer$2, {
|
|
549
549
|
packageName: "@combos-fun/plugin-renderer",
|
|
550
|
-
packageVersion: "0.1.14-beta.
|
|
550
|
+
packageVersion: "0.1.14-beta.1",
|
|
551
551
|
});
|
|
552
552
|
|
|
553
553
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
@@ -583,8 +583,133 @@ class Renderer extends System {
|
|
|
583
583
|
}
|
|
584
584
|
}
|
|
585
585
|
|
|
586
|
+
/** Compressed targets only. RGBA is omitted so Basis is never expanded to uncompressed pixels. */
|
|
587
|
+
const COMPRESSED_TARGETS = [
|
|
588
|
+
'astc-4x4-unorm',
|
|
589
|
+
'bc7-rgba-unorm',
|
|
590
|
+
'bc3-rgba-unorm',
|
|
591
|
+
'etc2-rgba8unorm',
|
|
592
|
+
];
|
|
593
|
+
function asArrayBuffer(data) {
|
|
594
|
+
if (data instanceof ArrayBuffer)
|
|
595
|
+
return data;
|
|
596
|
+
if (ArrayBuffer.isView(data)) {
|
|
597
|
+
const view = data;
|
|
598
|
+
return view.buffer.slice(view.byteOffset, view.byteOffset + view.byteLength);
|
|
599
|
+
}
|
|
600
|
+
return null;
|
|
601
|
+
}
|
|
602
|
+
function loadHtmlImage(url) {
|
|
603
|
+
return new Promise((resolve, reject) => {
|
|
604
|
+
const image = new Image();
|
|
605
|
+
image.crossOrigin = 'anonymous';
|
|
606
|
+
image.onload = () => resolve(image);
|
|
607
|
+
image.onerror = () => reject(new Error(`Failed to load image ${url}`));
|
|
608
|
+
image.src = url;
|
|
609
|
+
});
|
|
610
|
+
}
|
|
611
|
+
async function textureFromElement(image) {
|
|
612
|
+
if (typeof createImageBitmap !== 'function')
|
|
613
|
+
return Texture.from(image);
|
|
614
|
+
let bitmap = null;
|
|
615
|
+
try {
|
|
616
|
+
bitmap = await createImageBitmap(image);
|
|
617
|
+
return Texture.from(bitmap);
|
|
618
|
+
}
|
|
619
|
+
catch {
|
|
620
|
+
try {
|
|
621
|
+
bitmap?.close();
|
|
622
|
+
}
|
|
623
|
+
catch {
|
|
624
|
+
// ImageBitmap.close throws once the bitmap is already detached.
|
|
625
|
+
}
|
|
626
|
+
return Texture.from(image);
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
async function loadPixiKtx2(url) {
|
|
630
|
+
try {
|
|
631
|
+
const supported = await getSupportedTextureFormats();
|
|
632
|
+
const compressed = COMPRESSED_TARGETS.filter((format) => supported.includes(format));
|
|
633
|
+
if (!compressed.length)
|
|
634
|
+
return null;
|
|
635
|
+
const options = await loadKTX2onWorker(url, compressed);
|
|
636
|
+
if (!options?.resource || !COMPRESSED_TARGETS.includes(options.format)) {
|
|
637
|
+
return null;
|
|
638
|
+
}
|
|
639
|
+
return new Texture({ source: new CompressedSource(options) });
|
|
640
|
+
}
|
|
641
|
+
catch {
|
|
642
|
+
return null;
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
async function loadCompressed(res, imageData) {
|
|
646
|
+
const buffer = asArrayBuffer(imageData);
|
|
647
|
+
if (!buffer)
|
|
648
|
+
return null;
|
|
649
|
+
const url = compressedTextureUrl(res.src?.image);
|
|
650
|
+
const blobUrl = URL.createObjectURL(new Blob([buffer]));
|
|
651
|
+
try {
|
|
652
|
+
const texture = await loadPixiKtx2(blobUrl);
|
|
653
|
+
if (texture)
|
|
654
|
+
return texture;
|
|
655
|
+
}
|
|
656
|
+
finally {
|
|
657
|
+
URL.revokeObjectURL(blobUrl);
|
|
658
|
+
}
|
|
659
|
+
if (!url)
|
|
660
|
+
return null;
|
|
661
|
+
return loadPixiKtx2(url);
|
|
662
|
+
}
|
|
663
|
+
/** Build the shared 2D texture. KTX2 bytes are transcoded; a raster element is uploaded as-is. */
|
|
664
|
+
async function createImageTexture(res) {
|
|
665
|
+
const imageData = res.data?.image;
|
|
666
|
+
const compressed = await loadCompressed(res, imageData);
|
|
667
|
+
if (compressed)
|
|
668
|
+
return compressed;
|
|
669
|
+
if (typeof HTMLImageElement !== 'undefined' && imageData instanceof HTMLImageElement) {
|
|
670
|
+
return textureFromElement(imageData);
|
|
671
|
+
}
|
|
672
|
+
const fallback = imageFallbackUrl(res.src?.image);
|
|
673
|
+
if (!fallback)
|
|
674
|
+
return undefined;
|
|
675
|
+
try {
|
|
676
|
+
return textureFromElement(await loadHtmlImage(fallback));
|
|
677
|
+
}
|
|
678
|
+
catch {
|
|
679
|
+
return undefined;
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
/** Texture already built for this resource. Falls back to a raster element when no instance exists. */
|
|
683
|
+
function imageResourceTexture(res) {
|
|
684
|
+
if (res?.instance instanceof Texture)
|
|
685
|
+
return res.instance;
|
|
686
|
+
const image = res?.data?.image;
|
|
687
|
+
if (typeof HTMLImageElement !== 'undefined' && image instanceof HTMLImageElement) {
|
|
688
|
+
return Texture.from(image);
|
|
689
|
+
}
|
|
690
|
+
return undefined;
|
|
691
|
+
}
|
|
692
|
+
function releaseImageTexture(texture) {
|
|
693
|
+
const source = texture.source?.resource;
|
|
694
|
+
texture.destroy(true);
|
|
695
|
+
if (typeof ImageBitmap !== 'undefined' && source instanceof ImageBitmap) {
|
|
696
|
+
try {
|
|
697
|
+
source.close();
|
|
698
|
+
}
|
|
699
|
+
catch {
|
|
700
|
+
// Already closed by the texture source.
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
resource.registerInstance(RESOURCE_TYPE.IMAGE, async (res) => createImageTexture(res));
|
|
705
|
+
resource.registerDestroy(RESOURCE_TYPE.IMAGE, ({ instance }) => {
|
|
706
|
+
if (!instance || instance === Texture.EMPTY)
|
|
707
|
+
return;
|
|
708
|
+
releaseImageTexture(instance);
|
|
709
|
+
});
|
|
710
|
+
|
|
586
711
|
/** Shared resource cache key separator used across renderer plugins */
|
|
587
712
|
const RESOURCE_KEY_SPLIT = '_s|r|c_';
|
|
588
713
|
|
|
589
|
-
export { ContainerManager, RENDERER_TYPE, RESOURCE_KEY_SPLIT, Renderer, RendererManager, Renderer$2 as RendererSystem, Transform2D };
|
|
714
|
+
export { ContainerManager, RENDERER_TYPE, RESOURCE_KEY_SPLIT, Renderer, RendererManager, Renderer$2 as RendererSystem, Transform2D, createImageTexture, imageResourceTexture, releaseImageTexture };
|
|
590
715
|
//# sourceMappingURL=plugin-renderer.esm.js.map
|
|
@@ -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/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 { RendererMan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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/imageTexture.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.1\",\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 { compressedTextureUrl, imageFallbackUrl, RESOURCE_TYPE, resource } from '@combos-fun/engine';\nimport type { ResourceStruct } from '@combos-fun/engine';\nimport { CompressedSource, Texture, getSupportedTextureFormats, loadKTX2onWorker } from 'pixi.js';\nimport type { TEXTURE_FORMATS } from 'pixi.js';\n\n/** Compressed targets only. RGBA is omitted so Basis is never expanded to uncompressed pixels. */\nconst COMPRESSED_TARGETS = [\n 'astc-4x4-unorm',\n 'bc7-rgba-unorm',\n 'bc3-rgba-unorm',\n 'etc2-rgba8unorm',\n] as const satisfies readonly TEXTURE_FORMATS[];\n\nfunction asArrayBuffer(data: unknown): ArrayBuffer | null {\n if (data instanceof ArrayBuffer) return data;\n if (ArrayBuffer.isView(data)) {\n const view = data as ArrayBufferView;\n return view.buffer.slice(view.byteOffset, view.byteOffset + view.byteLength) as ArrayBuffer;\n }\n return null;\n}\n\nfunction loadHtmlImage(url: string): Promise<HTMLImageElement> {\n return new Promise((resolve, reject) => {\n const image = new Image();\n image.crossOrigin = 'anonymous';\n image.onload = () => resolve(image);\n image.onerror = () => reject(new Error(`Failed to load image ${url}`));\n image.src = url;\n });\n}\n\nasync function textureFromElement(image: HTMLImageElement): Promise<Texture> {\n if (typeof createImageBitmap !== 'function') return Texture.from(image);\n let bitmap: ImageBitmap | null = null;\n try {\n bitmap = await createImageBitmap(image);\n return Texture.from(bitmap);\n } catch {\n try {\n bitmap?.close();\n } catch {\n // ImageBitmap.close throws once the bitmap is already detached.\n }\n return Texture.from(image);\n }\n}\n\nasync function loadPixiKtx2(url: string): Promise<Texture | null> {\n try {\n const supported = await getSupportedTextureFormats();\n const compressed = COMPRESSED_TARGETS.filter((format) => supported.includes(format));\n if (!compressed.length) return null;\n const options = await loadKTX2onWorker(url, compressed);\n if (!options?.resource || !COMPRESSED_TARGETS.includes(options.format as typeof COMPRESSED_TARGETS[number])) {\n return null;\n }\n return new Texture({ source: new CompressedSource(options) });\n } catch {\n return null;\n }\n}\n\nasync function loadCompressed(res: ResourceStruct, imageData: unknown): Promise<Texture | null> {\n const buffer = asArrayBuffer(imageData);\n if (!buffer) return null;\n const url = compressedTextureUrl(res.src?.image);\n const blobUrl = URL.createObjectURL(new Blob([buffer]));\n try {\n const texture = await loadPixiKtx2(blobUrl);\n if (texture) return texture;\n } finally {\n URL.revokeObjectURL(blobUrl);\n }\n if (!url) return null;\n return loadPixiKtx2(url);\n}\n\n/** Build the shared 2D texture. KTX2 bytes are transcoded; a raster element is uploaded as-is. */\nexport async function createImageTexture(res: ResourceStruct): Promise<Texture | undefined> {\n const imageData = res.data?.image;\n const compressed = await loadCompressed(res, imageData);\n if (compressed) return compressed;\n if (typeof HTMLImageElement !== 'undefined' && imageData instanceof HTMLImageElement) {\n return textureFromElement(imageData);\n }\n const fallback = imageFallbackUrl(res.src?.image);\n if (!fallback) return undefined;\n try {\n return textureFromElement(await loadHtmlImage(fallback));\n } catch {\n return undefined;\n }\n}\n\n/** Texture already built for this resource. Falls back to a raster element when no instance exists. */\nexport function imageResourceTexture(res: ResourceStruct | null | undefined): Texture | undefined {\n if (res?.instance instanceof Texture) return res.instance;\n const image = res?.data?.image;\n if (typeof HTMLImageElement !== 'undefined' && image instanceof HTMLImageElement) {\n return Texture.from(image);\n }\n return undefined;\n}\n\nexport function releaseImageTexture(texture: Texture) {\n const source = texture.source?.resource;\n texture.destroy(true);\n if (typeof ImageBitmap !== 'undefined' && source instanceof ImageBitmap) {\n try {\n source.close();\n } catch {\n // Already closed by the texture source.\n }\n }\n}\n\nresource.registerInstance(RESOURCE_TYPE.IMAGE, async (res) => createImageTexture(res));\nresource.registerDestroy(RESOURCE_TYPE.IMAGE, ({ instance }) => {\n if (!instance || instance === Texture.EMPTY) return;\n releaseImageTexture(instance as Texture);\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';\nimport { createImageTexture, imageResourceTexture, releaseImageTexture } from './imageTexture';\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 };\nexport { createImageTexture, imageResourceTexture, releaseImageTexture };\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,SAAS,EAAE;gBACrC,MAAM,KAAK,GAAG,QAAQ,CAAC,YAAY,CAAC,OAAO,CAAC,aAAa,CAAC;gBAC1D,IAAI,KAAK,EAAE;oBACT,IAAI,CAAC,aAAa,CAAC,GAAG,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,EAAE;AACxE,wBAAA,IAAI;4BACF,QAAQ,CAAC,gBAAgB,IA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KAAK,kBAAkB,CAAC,GAAG,CAAC,CAAC;AACtF,QAAQ,CAAC,eAAe,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,KAAI;AAC7D,IAAA,IAAI,CAAC,QAAQ,IAAI,QAAQ,KAAK,OAAO,CAAC,KAAK;QAAE;IAC7C,mBAAmB,CAAC,QAAmB,CAAC;AAC1C,CAAC,CAAC;;AClHF;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.14-beta.
|
|
3
|
+
"version": "0.1.14-beta.1",
|
|
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/
|
|
45
|
-
"@combos-fun/engine": "0.1.14-beta.
|
|
43
|
+
"@combos-fun/inspector-decorator": "0.1.14-beta.1",
|
|
44
|
+
"@combos-fun/renderer-adapter": "0.1.14-beta.1",
|
|
45
|
+
"@combos-fun/engine": "0.1.14-beta.1"
|
|
46
46
|
},
|
|
47
47
|
"scripts": {
|
|
48
48
|
"build": "node ../../scripts/build-package.mjs"
|