sdfsdfs
This commit is contained in:
1
node_modules/pixi.js/lib/rendering/renderers/shared/texture/utils/generateUID.d.ts
generated
vendored
Normal file
1
node_modules/pixi.js/lib/rendering/renderers/shared/texture/utils/generateUID.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export declare function generateUID(): number;
|
10
node_modules/pixi.js/lib/rendering/renderers/shared/texture/utils/generateUID.js
generated
vendored
Normal file
10
node_modules/pixi.js/lib/rendering/renderers/shared/texture/utils/generateUID.js
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
'use strict';
|
||||
|
||||
"use strict";
|
||||
let uidCount = 0;
|
||||
function generateUID() {
|
||||
return uidCount++;
|
||||
}
|
||||
|
||||
exports.generateUID = generateUID;
|
||||
//# sourceMappingURL=generateUID.js.map
|
1
node_modules/pixi.js/lib/rendering/renderers/shared/texture/utils/generateUID.js.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/rendering/renderers/shared/texture/utils/generateUID.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"generateUID.js","sources":["../../../../../../src/rendering/renderers/shared/texture/utils/generateUID.ts"],"sourcesContent":["let uidCount = 0;\n\nexport function generateUID(): number\n{\n return uidCount++;\n}\n"],"names":[],"mappings":";;;AAAA,IAAI,QAAW,GAAA,CAAA,CAAA;AAER,SAAS,WAChB,GAAA;AACI,EAAO,OAAA,QAAA,EAAA,CAAA;AACX;;;;"}
|
8
node_modules/pixi.js/lib/rendering/renderers/shared/texture/utils/generateUID.mjs
generated
vendored
Normal file
8
node_modules/pixi.js/lib/rendering/renderers/shared/texture/utils/generateUID.mjs
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
"use strict";
|
||||
let uidCount = 0;
|
||||
function generateUID() {
|
||||
return uidCount++;
|
||||
}
|
||||
|
||||
export { generateUID };
|
||||
//# sourceMappingURL=generateUID.mjs.map
|
1
node_modules/pixi.js/lib/rendering/renderers/shared/texture/utils/generateUID.mjs.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/rendering/renderers/shared/texture/utils/generateUID.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"generateUID.mjs","sources":["../../../../../../src/rendering/renderers/shared/texture/utils/generateUID.ts"],"sourcesContent":["let uidCount = 0;\n\nexport function generateUID(): number\n{\n return uidCount++;\n}\n"],"names":[],"mappings":";AAAA,IAAI,QAAW,GAAA,CAAA,CAAA;AAER,SAAS,WAChB,GAAA;AACI,EAAO,OAAA,QAAA,EAAA,CAAA;AACX;;;;"}
|
6
node_modules/pixi.js/lib/rendering/renderers/shared/texture/utils/getCanvasTexture.d.ts
generated
vendored
Normal file
6
node_modules/pixi.js/lib/rendering/renderers/shared/texture/utils/getCanvasTexture.d.ts
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
import { CanvasSource } from '../sources/CanvasSource';
|
||||
import { Texture } from '../Texture';
|
||||
import type { ICanvas } from '../../../../../environment/canvas/ICanvas';
|
||||
import type { CanvasSourceOptions } from '../sources/CanvasSource';
|
||||
export declare function getCanvasTexture(canvas: ICanvas, options?: CanvasSourceOptions): Texture<CanvasSource>;
|
||||
export declare function hasCachedCanvasTexture(canvas: ICanvas): boolean;
|
33
node_modules/pixi.js/lib/rendering/renderers/shared/texture/utils/getCanvasTexture.js
generated
vendored
Normal file
33
node_modules/pixi.js/lib/rendering/renderers/shared/texture/utils/getCanvasTexture.js
generated
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
'use strict';
|
||||
|
||||
var CanvasSource = require('../sources/CanvasSource.js');
|
||||
var Texture = require('../Texture.js');
|
||||
|
||||
"use strict";
|
||||
const canvasCache = /* @__PURE__ */ new Map();
|
||||
function getCanvasTexture(canvas, options) {
|
||||
if (!canvasCache.has(canvas)) {
|
||||
const texture = new Texture.Texture({
|
||||
source: new CanvasSource.CanvasSource({
|
||||
resource: canvas,
|
||||
...options
|
||||
})
|
||||
});
|
||||
const onDestroy = () => {
|
||||
if (canvasCache.get(canvas) === texture) {
|
||||
canvasCache.delete(canvas);
|
||||
}
|
||||
};
|
||||
texture.once("destroy", onDestroy);
|
||||
texture.source.once("destroy", onDestroy);
|
||||
canvasCache.set(canvas, texture);
|
||||
}
|
||||
return canvasCache.get(canvas);
|
||||
}
|
||||
function hasCachedCanvasTexture(canvas) {
|
||||
return canvasCache.has(canvas);
|
||||
}
|
||||
|
||||
exports.getCanvasTexture = getCanvasTexture;
|
||||
exports.hasCachedCanvasTexture = hasCachedCanvasTexture;
|
||||
//# sourceMappingURL=getCanvasTexture.js.map
|
1
node_modules/pixi.js/lib/rendering/renderers/shared/texture/utils/getCanvasTexture.js.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/rendering/renderers/shared/texture/utils/getCanvasTexture.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"getCanvasTexture.js","sources":["../../../../../../src/rendering/renderers/shared/texture/utils/getCanvasTexture.ts"],"sourcesContent":["import { CanvasSource } from '../sources/CanvasSource';\nimport { Texture } from '../Texture';\n\nimport type { ICanvas } from '../../../../../environment/canvas/ICanvas';\nimport type { CanvasSourceOptions } from '../sources/CanvasSource';\n\nconst canvasCache: Map<ICanvas, Texture<CanvasSource>> = new Map();\n\nexport function getCanvasTexture(canvas: ICanvas, options?: CanvasSourceOptions): Texture<CanvasSource>\n{\n if (!canvasCache.has(canvas))\n {\n const texture = new Texture({\n source: new CanvasSource({\n resource: canvas,\n ...options,\n })\n });\n\n const onDestroy = () =>\n {\n if (canvasCache.get(canvas) === texture)\n {\n canvasCache.delete(canvas);\n }\n };\n\n texture.once('destroy', onDestroy);\n texture.source.once('destroy', onDestroy);\n\n canvasCache.set(canvas, texture);\n }\n\n return canvasCache.get(canvas);\n}\n\nexport function hasCachedCanvasTexture(canvas: ICanvas): boolean\n{\n return canvasCache.has(canvas);\n}\n"],"names":["Texture","CanvasSource"],"mappings":";;;;;;AAMA,MAAM,WAAA,uBAAuD,GAAI,EAAA,CAAA;AAEjD,SAAA,gBAAA,CAAiB,QAAiB,OAClD,EAAA;AACI,EAAA,IAAI,CAAC,WAAA,CAAY,GAAI,CAAA,MAAM,CAC3B,EAAA;AACI,IAAM,MAAA,OAAA,GAAU,IAAIA,eAAQ,CAAA;AAAA,MACxB,MAAA,EAAQ,IAAIC,yBAAa,CAAA;AAAA,QACrB,QAAU,EAAA,MAAA;AAAA,QACV,GAAG,OAAA;AAAA,OACN,CAAA;AAAA,KACJ,CAAA,CAAA;AAED,IAAA,MAAM,YAAY,MAClB;AACI,MAAA,IAAI,WAAY,CAAA,GAAA,CAAI,MAAM,CAAA,KAAM,OAChC,EAAA;AACI,QAAA,WAAA,CAAY,OAAO,MAAM,CAAA,CAAA;AAAA,OAC7B;AAAA,KACJ,CAAA;AAEA,IAAQ,OAAA,CAAA,IAAA,CAAK,WAAW,SAAS,CAAA,CAAA;AACjC,IAAQ,OAAA,CAAA,MAAA,CAAO,IAAK,CAAA,SAAA,EAAW,SAAS,CAAA,CAAA;AAExC,IAAY,WAAA,CAAA,GAAA,CAAI,QAAQ,OAAO,CAAA,CAAA;AAAA,GACnC;AAEA,EAAO,OAAA,WAAA,CAAY,IAAI,MAAM,CAAA,CAAA;AACjC,CAAA;AAEO,SAAS,uBAAuB,MACvC,EAAA;AACI,EAAO,OAAA,WAAA,CAAY,IAAI,MAAM,CAAA,CAAA;AACjC;;;;;"}
|
30
node_modules/pixi.js/lib/rendering/renderers/shared/texture/utils/getCanvasTexture.mjs
generated
vendored
Normal file
30
node_modules/pixi.js/lib/rendering/renderers/shared/texture/utils/getCanvasTexture.mjs
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
import { CanvasSource } from '../sources/CanvasSource.mjs';
|
||||
import { Texture } from '../Texture.mjs';
|
||||
|
||||
"use strict";
|
||||
const canvasCache = /* @__PURE__ */ new Map();
|
||||
function getCanvasTexture(canvas, options) {
|
||||
if (!canvasCache.has(canvas)) {
|
||||
const texture = new Texture({
|
||||
source: new CanvasSource({
|
||||
resource: canvas,
|
||||
...options
|
||||
})
|
||||
});
|
||||
const onDestroy = () => {
|
||||
if (canvasCache.get(canvas) === texture) {
|
||||
canvasCache.delete(canvas);
|
||||
}
|
||||
};
|
||||
texture.once("destroy", onDestroy);
|
||||
texture.source.once("destroy", onDestroy);
|
||||
canvasCache.set(canvas, texture);
|
||||
}
|
||||
return canvasCache.get(canvas);
|
||||
}
|
||||
function hasCachedCanvasTexture(canvas) {
|
||||
return canvasCache.has(canvas);
|
||||
}
|
||||
|
||||
export { getCanvasTexture, hasCachedCanvasTexture };
|
||||
//# sourceMappingURL=getCanvasTexture.mjs.map
|
1
node_modules/pixi.js/lib/rendering/renderers/shared/texture/utils/getCanvasTexture.mjs.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/rendering/renderers/shared/texture/utils/getCanvasTexture.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"getCanvasTexture.mjs","sources":["../../../../../../src/rendering/renderers/shared/texture/utils/getCanvasTexture.ts"],"sourcesContent":["import { CanvasSource } from '../sources/CanvasSource';\nimport { Texture } from '../Texture';\n\nimport type { ICanvas } from '../../../../../environment/canvas/ICanvas';\nimport type { CanvasSourceOptions } from '../sources/CanvasSource';\n\nconst canvasCache: Map<ICanvas, Texture<CanvasSource>> = new Map();\n\nexport function getCanvasTexture(canvas: ICanvas, options?: CanvasSourceOptions): Texture<CanvasSource>\n{\n if (!canvasCache.has(canvas))\n {\n const texture = new Texture({\n source: new CanvasSource({\n resource: canvas,\n ...options,\n })\n });\n\n const onDestroy = () =>\n {\n if (canvasCache.get(canvas) === texture)\n {\n canvasCache.delete(canvas);\n }\n };\n\n texture.once('destroy', onDestroy);\n texture.source.once('destroy', onDestroy);\n\n canvasCache.set(canvas, texture);\n }\n\n return canvasCache.get(canvas);\n}\n\nexport function hasCachedCanvasTexture(canvas: ICanvas): boolean\n{\n return canvasCache.has(canvas);\n}\n"],"names":[],"mappings":";;;;AAMA,MAAM,WAAA,uBAAuD,GAAI,EAAA,CAAA;AAEjD,SAAA,gBAAA,CAAiB,QAAiB,OAClD,EAAA;AACI,EAAA,IAAI,CAAC,WAAA,CAAY,GAAI,CAAA,MAAM,CAC3B,EAAA;AACI,IAAM,MAAA,OAAA,GAAU,IAAI,OAAQ,CAAA;AAAA,MACxB,MAAA,EAAQ,IAAI,YAAa,CAAA;AAAA,QACrB,QAAU,EAAA,MAAA;AAAA,QACV,GAAG,OAAA;AAAA,OACN,CAAA;AAAA,KACJ,CAAA,CAAA;AAED,IAAA,MAAM,YAAY,MAClB;AACI,MAAA,IAAI,WAAY,CAAA,GAAA,CAAI,MAAM,CAAA,KAAM,OAChC,EAAA;AACI,QAAA,WAAA,CAAY,OAAO,MAAM,CAAA,CAAA;AAAA,OAC7B;AAAA,KACJ,CAAA;AAEA,IAAQ,OAAA,CAAA,IAAA,CAAK,WAAW,SAAS,CAAA,CAAA;AACjC,IAAQ,OAAA,CAAA,MAAA,CAAO,IAAK,CAAA,SAAA,EAAW,SAAS,CAAA,CAAA;AAExC,IAAY,WAAA,CAAA,GAAA,CAAI,QAAQ,OAAO,CAAA,CAAA;AAAA,GACnC;AAEA,EAAO,OAAA,WAAA,CAAY,IAAI,MAAM,CAAA,CAAA;AACjC,CAAA;AAEO,SAAS,uBAAuB,MACvC,EAAA;AACI,EAAO,OAAA,WAAA,CAAY,IAAI,MAAM,CAAA,CAAA;AACjC;;;;"}
|
2
node_modules/pixi.js/lib/rendering/renderers/shared/texture/utils/getSupportedCompressedTextureFormats.d.ts
generated
vendored
Normal file
2
node_modules/pixi.js/lib/rendering/renderers/shared/texture/utils/getSupportedCompressedTextureFormats.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
import type { TEXTURE_FORMATS } from '../const';
|
||||
export declare function getSupportedCompressedTextureFormats(): Promise<TEXTURE_FORMATS[]>;
|
31
node_modules/pixi.js/lib/rendering/renderers/shared/texture/utils/getSupportedCompressedTextureFormats.js
generated
vendored
Normal file
31
node_modules/pixi.js/lib/rendering/renderers/shared/texture/utils/getSupportedCompressedTextureFormats.js
generated
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
'use strict';
|
||||
|
||||
var isWebGLSupported = require('../../../../../utils/browser/isWebGLSupported.js');
|
||||
var isWebGPUSupported = require('../../../../../utils/browser/isWebGPUSupported.js');
|
||||
var getSupportedGlCompressedTextureFormats = require('../../../gl/texture/utils/getSupportedGlCompressedTextureFormats.js');
|
||||
var getSupportedGPUCompressedTextureFormats = require('../../../gpu/texture/utils/getSupportedGPUCompressedTextureFormats.js');
|
||||
|
||||
"use strict";
|
||||
let supportedCompressedTextureFormats;
|
||||
async function getSupportedCompressedTextureFormats() {
|
||||
if (supportedCompressedTextureFormats !== void 0)
|
||||
return supportedCompressedTextureFormats;
|
||||
supportedCompressedTextureFormats = await (async () => {
|
||||
const _isWebGPUSupported = await isWebGPUSupported.isWebGPUSupported();
|
||||
const _isWebGLSupported = isWebGLSupported.isWebGLSupported();
|
||||
if (_isWebGPUSupported && _isWebGLSupported) {
|
||||
const gpuTextureFormats = await getSupportedGPUCompressedTextureFormats.getSupportedGPUCompressedTextureFormats();
|
||||
const glTextureFormats = getSupportedGlCompressedTextureFormats.getSupportedGlCompressedTextureFormats();
|
||||
return gpuTextureFormats.filter((format) => glTextureFormats.includes(format));
|
||||
} else if (_isWebGPUSupported) {
|
||||
return await getSupportedGPUCompressedTextureFormats.getSupportedGPUCompressedTextureFormats();
|
||||
} else if (_isWebGLSupported) {
|
||||
return getSupportedGlCompressedTextureFormats.getSupportedGlCompressedTextureFormats();
|
||||
}
|
||||
return [];
|
||||
})();
|
||||
return supportedCompressedTextureFormats;
|
||||
}
|
||||
|
||||
exports.getSupportedCompressedTextureFormats = getSupportedCompressedTextureFormats;
|
||||
//# sourceMappingURL=getSupportedCompressedTextureFormats.js.map
|
1
node_modules/pixi.js/lib/rendering/renderers/shared/texture/utils/getSupportedCompressedTextureFormats.js.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/rendering/renderers/shared/texture/utils/getSupportedCompressedTextureFormats.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"getSupportedCompressedTextureFormats.js","sources":["../../../../../../src/rendering/renderers/shared/texture/utils/getSupportedCompressedTextureFormats.ts"],"sourcesContent":["import { isWebGLSupported } from '../../../../../utils/browser/isWebGLSupported';\nimport { isWebGPUSupported } from '../../../../../utils/browser/isWebGPUSupported';\nimport { getSupportedGlCompressedTextureFormats } from '../../../gl/texture/utils/getSupportedGlCompressedTextureFormats';\nimport { getSupportedGPUCompressedTextureFormats } from '../../../gpu/texture/utils/getSupportedGPUCompressedTextureFormats';\n\nimport type { TEXTURE_FORMATS } from '../const';\n\nlet supportedCompressedTextureFormats: TEXTURE_FORMATS[];\n\nexport async function getSupportedCompressedTextureFormats(): Promise<TEXTURE_FORMATS[]>\n{\n if (supportedCompressedTextureFormats !== undefined) return supportedCompressedTextureFormats;\n\n supportedCompressedTextureFormats = await (async (): Promise<TEXTURE_FORMATS[]> =>\n {\n // find only overlapping ones..\n const _isWebGPUSupported = await isWebGPUSupported();\n const _isWebGLSupported = isWebGLSupported();\n\n if (_isWebGPUSupported && _isWebGLSupported)\n {\n const gpuTextureFormats = await getSupportedGPUCompressedTextureFormats();\n const glTextureFormats = getSupportedGlCompressedTextureFormats();\n\n return gpuTextureFormats.filter((format) => glTextureFormats.includes(format));\n }\n else if (_isWebGPUSupported)\n {\n return await getSupportedGPUCompressedTextureFormats();\n }\n else if (_isWebGLSupported)\n {\n return getSupportedGlCompressedTextureFormats();\n }\n\n return [];\n })();\n\n return supportedCompressedTextureFormats;\n}\n"],"names":["isWebGPUSupported","isWebGLSupported","getSupportedGPUCompressedTextureFormats","getSupportedGlCompressedTextureFormats"],"mappings":";;;;;;;;AAOA,IAAI,iCAAA,CAAA;AAEJ,eAAsB,oCACtB,GAAA;AACI,EAAA,IAAI,iCAAsC,KAAA,KAAA,CAAA;AAAW,IAAO,OAAA,iCAAA,CAAA;AAE5D,EAAA,iCAAA,GAAoC,OAAO,YAC3C;AAEI,IAAM,MAAA,kBAAA,GAAqB,MAAMA,mCAAkB,EAAA,CAAA;AACnD,IAAA,MAAM,oBAAoBC,iCAAiB,EAAA,CAAA;AAE3C,IAAA,IAAI,sBAAsB,iBAC1B,EAAA;AACI,MAAM,MAAA,iBAAA,GAAoB,MAAMC,+EAAwC,EAAA,CAAA;AACxE,MAAA,MAAM,mBAAmBC,6EAAuC,EAAA,CAAA;AAEhE,MAAA,OAAO,kBAAkB,MAAO,CAAA,CAAC,WAAW,gBAAiB,CAAA,QAAA,CAAS,MAAM,CAAC,CAAA,CAAA;AAAA,eAExE,kBACT,EAAA;AACI,MAAA,OAAO,MAAMD,+EAAwC,EAAA,CAAA;AAAA,eAEhD,iBACT,EAAA;AACI,MAAA,OAAOC,6EAAuC,EAAA,CAAA;AAAA,KAClD;AAEA,IAAA,OAAO,EAAC,CAAA;AAAA,GACT,GAAA,CAAA;AAEH,EAAO,OAAA,iCAAA,CAAA;AACX;;;;"}
|
29
node_modules/pixi.js/lib/rendering/renderers/shared/texture/utils/getSupportedCompressedTextureFormats.mjs
generated
vendored
Normal file
29
node_modules/pixi.js/lib/rendering/renderers/shared/texture/utils/getSupportedCompressedTextureFormats.mjs
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
import { isWebGLSupported } from '../../../../../utils/browser/isWebGLSupported.mjs';
|
||||
import { isWebGPUSupported } from '../../../../../utils/browser/isWebGPUSupported.mjs';
|
||||
import { getSupportedGlCompressedTextureFormats } from '../../../gl/texture/utils/getSupportedGlCompressedTextureFormats.mjs';
|
||||
import { getSupportedGPUCompressedTextureFormats } from '../../../gpu/texture/utils/getSupportedGPUCompressedTextureFormats.mjs';
|
||||
|
||||
"use strict";
|
||||
let supportedCompressedTextureFormats;
|
||||
async function getSupportedCompressedTextureFormats() {
|
||||
if (supportedCompressedTextureFormats !== void 0)
|
||||
return supportedCompressedTextureFormats;
|
||||
supportedCompressedTextureFormats = await (async () => {
|
||||
const _isWebGPUSupported = await isWebGPUSupported();
|
||||
const _isWebGLSupported = isWebGLSupported();
|
||||
if (_isWebGPUSupported && _isWebGLSupported) {
|
||||
const gpuTextureFormats = await getSupportedGPUCompressedTextureFormats();
|
||||
const glTextureFormats = getSupportedGlCompressedTextureFormats();
|
||||
return gpuTextureFormats.filter((format) => glTextureFormats.includes(format));
|
||||
} else if (_isWebGPUSupported) {
|
||||
return await getSupportedGPUCompressedTextureFormats();
|
||||
} else if (_isWebGLSupported) {
|
||||
return getSupportedGlCompressedTextureFormats();
|
||||
}
|
||||
return [];
|
||||
})();
|
||||
return supportedCompressedTextureFormats;
|
||||
}
|
||||
|
||||
export { getSupportedCompressedTextureFormats };
|
||||
//# sourceMappingURL=getSupportedCompressedTextureFormats.mjs.map
|
1
node_modules/pixi.js/lib/rendering/renderers/shared/texture/utils/getSupportedCompressedTextureFormats.mjs.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/rendering/renderers/shared/texture/utils/getSupportedCompressedTextureFormats.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"getSupportedCompressedTextureFormats.mjs","sources":["../../../../../../src/rendering/renderers/shared/texture/utils/getSupportedCompressedTextureFormats.ts"],"sourcesContent":["import { isWebGLSupported } from '../../../../../utils/browser/isWebGLSupported';\nimport { isWebGPUSupported } from '../../../../../utils/browser/isWebGPUSupported';\nimport { getSupportedGlCompressedTextureFormats } from '../../../gl/texture/utils/getSupportedGlCompressedTextureFormats';\nimport { getSupportedGPUCompressedTextureFormats } from '../../../gpu/texture/utils/getSupportedGPUCompressedTextureFormats';\n\nimport type { TEXTURE_FORMATS } from '../const';\n\nlet supportedCompressedTextureFormats: TEXTURE_FORMATS[];\n\nexport async function getSupportedCompressedTextureFormats(): Promise<TEXTURE_FORMATS[]>\n{\n if (supportedCompressedTextureFormats !== undefined) return supportedCompressedTextureFormats;\n\n supportedCompressedTextureFormats = await (async (): Promise<TEXTURE_FORMATS[]> =>\n {\n // find only overlapping ones..\n const _isWebGPUSupported = await isWebGPUSupported();\n const _isWebGLSupported = isWebGLSupported();\n\n if (_isWebGPUSupported && _isWebGLSupported)\n {\n const gpuTextureFormats = await getSupportedGPUCompressedTextureFormats();\n const glTextureFormats = getSupportedGlCompressedTextureFormats();\n\n return gpuTextureFormats.filter((format) => glTextureFormats.includes(format));\n }\n else if (_isWebGPUSupported)\n {\n return await getSupportedGPUCompressedTextureFormats();\n }\n else if (_isWebGLSupported)\n {\n return getSupportedGlCompressedTextureFormats();\n }\n\n return [];\n })();\n\n return supportedCompressedTextureFormats;\n}\n"],"names":[],"mappings":";;;;;;AAOA,IAAI,iCAAA,CAAA;AAEJ,eAAsB,oCACtB,GAAA;AACI,EAAA,IAAI,iCAAsC,KAAA,KAAA,CAAA;AAAW,IAAO,OAAA,iCAAA,CAAA;AAE5D,EAAA,iCAAA,GAAoC,OAAO,YAC3C;AAEI,IAAM,MAAA,kBAAA,GAAqB,MAAM,iBAAkB,EAAA,CAAA;AACnD,IAAA,MAAM,oBAAoB,gBAAiB,EAAA,CAAA;AAE3C,IAAA,IAAI,sBAAsB,iBAC1B,EAAA;AACI,MAAM,MAAA,iBAAA,GAAoB,MAAM,uCAAwC,EAAA,CAAA;AACxE,MAAA,MAAM,mBAAmB,sCAAuC,EAAA,CAAA;AAEhE,MAAA,OAAO,kBAAkB,MAAO,CAAA,CAAC,WAAW,gBAAiB,CAAA,QAAA,CAAS,MAAM,CAAC,CAAA,CAAA;AAAA,eAExE,kBACT,EAAA;AACI,MAAA,OAAO,MAAM,uCAAwC,EAAA,CAAA;AAAA,eAEhD,iBACT,EAAA;AACI,MAAA,OAAO,sCAAuC,EAAA,CAAA;AAAA,KAClD;AAEA,IAAA,OAAO,EAAC,CAAA;AAAA,GACT,GAAA,CAAA;AAEH,EAAO,OAAA,iCAAA,CAAA;AACX;;;;"}
|
3
node_modules/pixi.js/lib/rendering/renderers/shared/texture/utils/getSupportedTextureFormats.d.ts
generated
vendored
Normal file
3
node_modules/pixi.js/lib/rendering/renderers/shared/texture/utils/getSupportedTextureFormats.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import type { TEXTURE_FORMATS } from '../const';
|
||||
export declare const nonCompressedFormats: TEXTURE_FORMATS[];
|
||||
export declare function getSupportedTextureFormats(): Promise<TEXTURE_FORMATS[]>;
|
72
node_modules/pixi.js/lib/rendering/renderers/shared/texture/utils/getSupportedTextureFormats.js
generated
vendored
Normal file
72
node_modules/pixi.js/lib/rendering/renderers/shared/texture/utils/getSupportedTextureFormats.js
generated
vendored
Normal file
@@ -0,0 +1,72 @@
|
||||
'use strict';
|
||||
|
||||
var getSupportedCompressedTextureFormats = require('./getSupportedCompressedTextureFormats.js');
|
||||
|
||||
"use strict";
|
||||
const nonCompressedFormats = [
|
||||
// 8-bit formats
|
||||
"r8unorm",
|
||||
"r8snorm",
|
||||
"r8uint",
|
||||
"r8sint",
|
||||
// 16-bit formats
|
||||
"r16uint",
|
||||
"r16sint",
|
||||
"r16float",
|
||||
"rg8unorm",
|
||||
"rg8snorm",
|
||||
"rg8uint",
|
||||
"rg8sint",
|
||||
// 32-bit formats
|
||||
"r32uint",
|
||||
"r32sint",
|
||||
"r32float",
|
||||
"rg16uint",
|
||||
"rg16sint",
|
||||
"rg16float",
|
||||
"rgba8unorm",
|
||||
"rgba8unorm-srgb",
|
||||
"rgba8snorm",
|
||||
"rgba8uint",
|
||||
"rgba8sint",
|
||||
"bgra8unorm",
|
||||
"bgra8unorm-srgb",
|
||||
// Packed 32-bit formats
|
||||
"rgb9e5ufloat",
|
||||
"rgb10a2unorm",
|
||||
"rg11b10ufloat",
|
||||
// 64-bit formats
|
||||
"rg32uint",
|
||||
"rg32sint",
|
||||
"rg32float",
|
||||
"rgba16uint",
|
||||
"rgba16sint",
|
||||
"rgba16float",
|
||||
// 128-bit formats
|
||||
"rgba32uint",
|
||||
"rgba32sint",
|
||||
"rgba32float",
|
||||
// Depth/stencil formats
|
||||
"stencil8",
|
||||
"depth16unorm",
|
||||
"depth24plus",
|
||||
"depth24plus-stencil8",
|
||||
"depth32float",
|
||||
// "depth32float-stencil8" feature
|
||||
"depth32float-stencil8"
|
||||
];
|
||||
let supportedTextureFormats;
|
||||
async function getSupportedTextureFormats() {
|
||||
if (supportedTextureFormats !== void 0)
|
||||
return supportedTextureFormats;
|
||||
const compressedTextureFormats = await getSupportedCompressedTextureFormats.getSupportedCompressedTextureFormats();
|
||||
supportedTextureFormats = [
|
||||
...nonCompressedFormats,
|
||||
...compressedTextureFormats
|
||||
];
|
||||
return supportedTextureFormats;
|
||||
}
|
||||
|
||||
exports.getSupportedTextureFormats = getSupportedTextureFormats;
|
||||
exports.nonCompressedFormats = nonCompressedFormats;
|
||||
//# sourceMappingURL=getSupportedTextureFormats.js.map
|
1
node_modules/pixi.js/lib/rendering/renderers/shared/texture/utils/getSupportedTextureFormats.js.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/rendering/renderers/shared/texture/utils/getSupportedTextureFormats.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"getSupportedTextureFormats.js","sources":["../../../../../../src/rendering/renderers/shared/texture/utils/getSupportedTextureFormats.ts"],"sourcesContent":["import { getSupportedCompressedTextureFormats } from './getSupportedCompressedTextureFormats';\n\nimport type { TEXTURE_FORMATS } from '../const';\n\nexport const nonCompressedFormats: TEXTURE_FORMATS[] = [\n // 8-bit formats\n 'r8unorm',\n 'r8snorm',\n 'r8uint',\n 'r8sint',\n\n // 16-bit formats\n 'r16uint',\n 'r16sint',\n 'r16float',\n 'rg8unorm',\n 'rg8snorm',\n 'rg8uint',\n 'rg8sint',\n\n // 32-bit formats\n 'r32uint',\n 'r32sint',\n 'r32float',\n 'rg16uint',\n 'rg16sint',\n 'rg16float',\n 'rgba8unorm',\n 'rgba8unorm-srgb',\n 'rgba8snorm',\n 'rgba8uint',\n 'rgba8sint',\n 'bgra8unorm',\n 'bgra8unorm-srgb',\n // Packed 32-bit formats\n 'rgb9e5ufloat',\n 'rgb10a2unorm',\n 'rg11b10ufloat',\n\n // 64-bit formats\n 'rg32uint',\n 'rg32sint',\n 'rg32float',\n 'rgba16uint',\n 'rgba16sint',\n 'rgba16float',\n\n // 128-bit formats\n 'rgba32uint',\n 'rgba32sint',\n 'rgba32float',\n\n // Depth/stencil formats\n 'stencil8',\n 'depth16unorm',\n 'depth24plus',\n 'depth24plus-stencil8',\n 'depth32float',\n\n // \"depth32float-stencil8\" feature\n 'depth32float-stencil8',\n];\n\nlet supportedTextureFormats: TEXTURE_FORMATS[];\n\nexport async function getSupportedTextureFormats(): Promise<TEXTURE_FORMATS[]>\n{\n if (supportedTextureFormats !== undefined) return supportedTextureFormats;\n\n const compressedTextureFormats = await getSupportedCompressedTextureFormats();\n\n supportedTextureFormats = [\n ...nonCompressedFormats,\n ...compressedTextureFormats,\n ];\n\n return supportedTextureFormats;\n}\n\n"],"names":["getSupportedCompressedTextureFormats"],"mappings":";;;;;AAIO,MAAM,oBAA0C,GAAA;AAAA;AAAA,EAEnD,SAAA;AAAA,EACA,SAAA;AAAA,EACA,QAAA;AAAA,EACA,QAAA;AAAA;AAAA,EAGA,SAAA;AAAA,EACA,SAAA;AAAA,EACA,UAAA;AAAA,EACA,UAAA;AAAA,EACA,UAAA;AAAA,EACA,SAAA;AAAA,EACA,SAAA;AAAA;AAAA,EAGA,SAAA;AAAA,EACA,SAAA;AAAA,EACA,UAAA;AAAA,EACA,UAAA;AAAA,EACA,UAAA;AAAA,EACA,WAAA;AAAA,EACA,YAAA;AAAA,EACA,iBAAA;AAAA,EACA,YAAA;AAAA,EACA,WAAA;AAAA,EACA,WAAA;AAAA,EACA,YAAA;AAAA,EACA,iBAAA;AAAA;AAAA,EAEA,cAAA;AAAA,EACA,cAAA;AAAA,EACA,eAAA;AAAA;AAAA,EAGA,UAAA;AAAA,EACA,UAAA;AAAA,EACA,WAAA;AAAA,EACA,YAAA;AAAA,EACA,YAAA;AAAA,EACA,aAAA;AAAA;AAAA,EAGA,YAAA;AAAA,EACA,YAAA;AAAA,EACA,aAAA;AAAA;AAAA,EAGA,UAAA;AAAA,EACA,cAAA;AAAA,EACA,aAAA;AAAA,EACA,sBAAA;AAAA,EACA,cAAA;AAAA;AAAA,EAGA,uBAAA;AACJ,EAAA;AAEA,IAAI,uBAAA,CAAA;AAEJ,eAAsB,0BACtB,GAAA;AACI,EAAA,IAAI,uBAA4B,KAAA,KAAA,CAAA;AAAW,IAAO,OAAA,uBAAA,CAAA;AAElD,EAAM,MAAA,wBAAA,GAA2B,MAAMA,yEAAqC,EAAA,CAAA;AAE5E,EAA0B,uBAAA,GAAA;AAAA,IACtB,GAAG,oBAAA;AAAA,IACH,GAAG,wBAAA;AAAA,GACP,CAAA;AAEA,EAAO,OAAA,uBAAA,CAAA;AACX;;;;;"}
|
69
node_modules/pixi.js/lib/rendering/renderers/shared/texture/utils/getSupportedTextureFormats.mjs
generated
vendored
Normal file
69
node_modules/pixi.js/lib/rendering/renderers/shared/texture/utils/getSupportedTextureFormats.mjs
generated
vendored
Normal file
@@ -0,0 +1,69 @@
|
||||
import { getSupportedCompressedTextureFormats } from './getSupportedCompressedTextureFormats.mjs';
|
||||
|
||||
"use strict";
|
||||
const nonCompressedFormats = [
|
||||
// 8-bit formats
|
||||
"r8unorm",
|
||||
"r8snorm",
|
||||
"r8uint",
|
||||
"r8sint",
|
||||
// 16-bit formats
|
||||
"r16uint",
|
||||
"r16sint",
|
||||
"r16float",
|
||||
"rg8unorm",
|
||||
"rg8snorm",
|
||||
"rg8uint",
|
||||
"rg8sint",
|
||||
// 32-bit formats
|
||||
"r32uint",
|
||||
"r32sint",
|
||||
"r32float",
|
||||
"rg16uint",
|
||||
"rg16sint",
|
||||
"rg16float",
|
||||
"rgba8unorm",
|
||||
"rgba8unorm-srgb",
|
||||
"rgba8snorm",
|
||||
"rgba8uint",
|
||||
"rgba8sint",
|
||||
"bgra8unorm",
|
||||
"bgra8unorm-srgb",
|
||||
// Packed 32-bit formats
|
||||
"rgb9e5ufloat",
|
||||
"rgb10a2unorm",
|
||||
"rg11b10ufloat",
|
||||
// 64-bit formats
|
||||
"rg32uint",
|
||||
"rg32sint",
|
||||
"rg32float",
|
||||
"rgba16uint",
|
||||
"rgba16sint",
|
||||
"rgba16float",
|
||||
// 128-bit formats
|
||||
"rgba32uint",
|
||||
"rgba32sint",
|
||||
"rgba32float",
|
||||
// Depth/stencil formats
|
||||
"stencil8",
|
||||
"depth16unorm",
|
||||
"depth24plus",
|
||||
"depth24plus-stencil8",
|
||||
"depth32float",
|
||||
// "depth32float-stencil8" feature
|
||||
"depth32float-stencil8"
|
||||
];
|
||||
let supportedTextureFormats;
|
||||
async function getSupportedTextureFormats() {
|
||||
if (supportedTextureFormats !== void 0)
|
||||
return supportedTextureFormats;
|
||||
const compressedTextureFormats = await getSupportedCompressedTextureFormats();
|
||||
supportedTextureFormats = [
|
||||
...nonCompressedFormats,
|
||||
...compressedTextureFormats
|
||||
];
|
||||
return supportedTextureFormats;
|
||||
}
|
||||
|
||||
export { getSupportedTextureFormats, nonCompressedFormats };
|
||||
//# sourceMappingURL=getSupportedTextureFormats.mjs.map
|
1
node_modules/pixi.js/lib/rendering/renderers/shared/texture/utils/getSupportedTextureFormats.mjs.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/rendering/renderers/shared/texture/utils/getSupportedTextureFormats.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"getSupportedTextureFormats.mjs","sources":["../../../../../../src/rendering/renderers/shared/texture/utils/getSupportedTextureFormats.ts"],"sourcesContent":["import { getSupportedCompressedTextureFormats } from './getSupportedCompressedTextureFormats';\n\nimport type { TEXTURE_FORMATS } from '../const';\n\nexport const nonCompressedFormats: TEXTURE_FORMATS[] = [\n // 8-bit formats\n 'r8unorm',\n 'r8snorm',\n 'r8uint',\n 'r8sint',\n\n // 16-bit formats\n 'r16uint',\n 'r16sint',\n 'r16float',\n 'rg8unorm',\n 'rg8snorm',\n 'rg8uint',\n 'rg8sint',\n\n // 32-bit formats\n 'r32uint',\n 'r32sint',\n 'r32float',\n 'rg16uint',\n 'rg16sint',\n 'rg16float',\n 'rgba8unorm',\n 'rgba8unorm-srgb',\n 'rgba8snorm',\n 'rgba8uint',\n 'rgba8sint',\n 'bgra8unorm',\n 'bgra8unorm-srgb',\n // Packed 32-bit formats\n 'rgb9e5ufloat',\n 'rgb10a2unorm',\n 'rg11b10ufloat',\n\n // 64-bit formats\n 'rg32uint',\n 'rg32sint',\n 'rg32float',\n 'rgba16uint',\n 'rgba16sint',\n 'rgba16float',\n\n // 128-bit formats\n 'rgba32uint',\n 'rgba32sint',\n 'rgba32float',\n\n // Depth/stencil formats\n 'stencil8',\n 'depth16unorm',\n 'depth24plus',\n 'depth24plus-stencil8',\n 'depth32float',\n\n // \"depth32float-stencil8\" feature\n 'depth32float-stencil8',\n];\n\nlet supportedTextureFormats: TEXTURE_FORMATS[];\n\nexport async function getSupportedTextureFormats(): Promise<TEXTURE_FORMATS[]>\n{\n if (supportedTextureFormats !== undefined) return supportedTextureFormats;\n\n const compressedTextureFormats = await getSupportedCompressedTextureFormats();\n\n supportedTextureFormats = [\n ...nonCompressedFormats,\n ...compressedTextureFormats,\n ];\n\n return supportedTextureFormats;\n}\n\n"],"names":[],"mappings":";;;AAIO,MAAM,oBAA0C,GAAA;AAAA;AAAA,EAEnD,SAAA;AAAA,EACA,SAAA;AAAA,EACA,QAAA;AAAA,EACA,QAAA;AAAA;AAAA,EAGA,SAAA;AAAA,EACA,SAAA;AAAA,EACA,UAAA;AAAA,EACA,UAAA;AAAA,EACA,UAAA;AAAA,EACA,SAAA;AAAA,EACA,SAAA;AAAA;AAAA,EAGA,SAAA;AAAA,EACA,SAAA;AAAA,EACA,UAAA;AAAA,EACA,UAAA;AAAA,EACA,UAAA;AAAA,EACA,WAAA;AAAA,EACA,YAAA;AAAA,EACA,iBAAA;AAAA,EACA,YAAA;AAAA,EACA,WAAA;AAAA,EACA,WAAA;AAAA,EACA,YAAA;AAAA,EACA,iBAAA;AAAA;AAAA,EAEA,cAAA;AAAA,EACA,cAAA;AAAA,EACA,eAAA;AAAA;AAAA,EAGA,UAAA;AAAA,EACA,UAAA;AAAA,EACA,WAAA;AAAA,EACA,YAAA;AAAA,EACA,YAAA;AAAA,EACA,aAAA;AAAA;AAAA,EAGA,YAAA;AAAA,EACA,YAAA;AAAA,EACA,aAAA;AAAA;AAAA,EAGA,UAAA;AAAA,EACA,cAAA;AAAA,EACA,aAAA;AAAA,EACA,sBAAA;AAAA,EACA,cAAA;AAAA;AAAA,EAGA,uBAAA;AACJ,EAAA;AAEA,IAAI,uBAAA,CAAA;AAEJ,eAAsB,0BACtB,GAAA;AACI,EAAA,IAAI,uBAA4B,KAAA,KAAA,CAAA;AAAW,IAAO,OAAA,uBAAA,CAAA;AAElD,EAAM,MAAA,wBAAA,GAA2B,MAAM,oCAAqC,EAAA,CAAA;AAE5E,EAA0B,uBAAA,GAAA;AAAA,IACtB,GAAG,oBAAA;AAAA,IACH,GAAG,wBAAA;AAAA,GACP,CAAA;AAEA,EAAO,OAAA,uBAAA,CAAA;AACX;;;;"}
|
23
node_modules/pixi.js/lib/rendering/renderers/shared/texture/utils/textureFrom.d.ts
generated
vendored
Normal file
23
node_modules/pixi.js/lib/rendering/renderers/shared/texture/utils/textureFrom.d.ts
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
import { TextureSource } from '../sources/TextureSource';
|
||||
import { Texture } from '../Texture';
|
||||
import type { BufferSourceOptions } from '../sources/BufferImageSource';
|
||||
import type { CanvasSourceOptions } from '../sources/CanvasSource';
|
||||
import type { ImageResource } from '../sources/ImageSource';
|
||||
import type { TextureSourceOptions } from '../sources/TextureSource';
|
||||
import type { TextureSourceLike } from '../Texture';
|
||||
export type TextureResourceOrOptions = ImageResource | TextureSourceOptions<ImageResource> | BufferSourceOptions | CanvasSourceOptions;
|
||||
/**
|
||||
* @param options
|
||||
* @deprecated since v8.2.0
|
||||
* @see TextureSource.from
|
||||
*/
|
||||
export declare function autoDetectSource(options?: TextureResourceOrOptions): TextureSource;
|
||||
export declare function resourceToTexture(options?: TextureResourceOrOptions, skipCache?: boolean): Texture;
|
||||
/**
|
||||
* Helper function that creates a returns Texture based on the source you provide.
|
||||
* The source should be loaded and ready to go. If not its best to grab the asset using Assets.
|
||||
* @param id - String or Source to create texture from
|
||||
* @param skipCache - Skip adding the texture to the cache
|
||||
* @returns The texture based on the Id provided
|
||||
*/
|
||||
export declare function textureFrom(id: TextureSourceLike, skipCache?: boolean): Texture;
|
58
node_modules/pixi.js/lib/rendering/renderers/shared/texture/utils/textureFrom.js
generated
vendored
Normal file
58
node_modules/pixi.js/lib/rendering/renderers/shared/texture/utils/textureFrom.js
generated
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
'use strict';
|
||||
|
||||
var Cache = require('../../../../../assets/cache/Cache.js');
|
||||
var Extensions = require('../../../../../extensions/Extensions.js');
|
||||
var TextureSource = require('../sources/TextureSource.js');
|
||||
var Texture = require('../Texture.js');
|
||||
|
||||
"use strict";
|
||||
const sources = [];
|
||||
Extensions.extensions.handleByList(Extensions.ExtensionType.TextureSource, sources);
|
||||
function autoDetectSource(options = {}) {
|
||||
return textureSourceFrom(options);
|
||||
}
|
||||
function textureSourceFrom(options = {}) {
|
||||
const hasResource = options && options.resource;
|
||||
const res = hasResource ? options.resource : options;
|
||||
const opts = hasResource ? options : { resource: options };
|
||||
for (let i = 0; i < sources.length; i++) {
|
||||
const Source = sources[i];
|
||||
if (Source.test(res)) {
|
||||
return new Source(opts);
|
||||
}
|
||||
}
|
||||
throw new Error(`Could not find a source type for resource: ${opts.resource}`);
|
||||
}
|
||||
function resourceToTexture(options = {}, skipCache = false) {
|
||||
const hasResource = options && options.resource;
|
||||
const resource = hasResource ? options.resource : options;
|
||||
const opts = hasResource ? options : { resource: options };
|
||||
if (!skipCache && Cache.Cache.has(resource)) {
|
||||
return Cache.Cache.get(resource);
|
||||
}
|
||||
const texture = new Texture.Texture({ source: textureSourceFrom(opts) });
|
||||
texture.on("destroy", () => {
|
||||
if (Cache.Cache.has(resource)) {
|
||||
Cache.Cache.remove(resource);
|
||||
}
|
||||
});
|
||||
if (!skipCache) {
|
||||
Cache.Cache.set(resource, texture);
|
||||
}
|
||||
return texture;
|
||||
}
|
||||
function textureFrom(id, skipCache = false) {
|
||||
if (typeof id === "string") {
|
||||
return Cache.Cache.get(id);
|
||||
} else if (id instanceof TextureSource.TextureSource) {
|
||||
return new Texture.Texture({ source: id });
|
||||
}
|
||||
return resourceToTexture(id, skipCache);
|
||||
}
|
||||
Texture.Texture.from = textureFrom;
|
||||
TextureSource.TextureSource.from = textureSourceFrom;
|
||||
|
||||
exports.autoDetectSource = autoDetectSource;
|
||||
exports.resourceToTexture = resourceToTexture;
|
||||
exports.textureFrom = textureFrom;
|
||||
//# sourceMappingURL=textureFrom.js.map
|
1
node_modules/pixi.js/lib/rendering/renderers/shared/texture/utils/textureFrom.js.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/rendering/renderers/shared/texture/utils/textureFrom.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
54
node_modules/pixi.js/lib/rendering/renderers/shared/texture/utils/textureFrom.mjs
generated
vendored
Normal file
54
node_modules/pixi.js/lib/rendering/renderers/shared/texture/utils/textureFrom.mjs
generated
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
import { Cache } from '../../../../../assets/cache/Cache.mjs';
|
||||
import { extensions, ExtensionType } from '../../../../../extensions/Extensions.mjs';
|
||||
import { TextureSource } from '../sources/TextureSource.mjs';
|
||||
import { Texture } from '../Texture.mjs';
|
||||
|
||||
"use strict";
|
||||
const sources = [];
|
||||
extensions.handleByList(ExtensionType.TextureSource, sources);
|
||||
function autoDetectSource(options = {}) {
|
||||
return textureSourceFrom(options);
|
||||
}
|
||||
function textureSourceFrom(options = {}) {
|
||||
const hasResource = options && options.resource;
|
||||
const res = hasResource ? options.resource : options;
|
||||
const opts = hasResource ? options : { resource: options };
|
||||
for (let i = 0; i < sources.length; i++) {
|
||||
const Source = sources[i];
|
||||
if (Source.test(res)) {
|
||||
return new Source(opts);
|
||||
}
|
||||
}
|
||||
throw new Error(`Could not find a source type for resource: ${opts.resource}`);
|
||||
}
|
||||
function resourceToTexture(options = {}, skipCache = false) {
|
||||
const hasResource = options && options.resource;
|
||||
const resource = hasResource ? options.resource : options;
|
||||
const opts = hasResource ? options : { resource: options };
|
||||
if (!skipCache && Cache.has(resource)) {
|
||||
return Cache.get(resource);
|
||||
}
|
||||
const texture = new Texture({ source: textureSourceFrom(opts) });
|
||||
texture.on("destroy", () => {
|
||||
if (Cache.has(resource)) {
|
||||
Cache.remove(resource);
|
||||
}
|
||||
});
|
||||
if (!skipCache) {
|
||||
Cache.set(resource, texture);
|
||||
}
|
||||
return texture;
|
||||
}
|
||||
function textureFrom(id, skipCache = false) {
|
||||
if (typeof id === "string") {
|
||||
return Cache.get(id);
|
||||
} else if (id instanceof TextureSource) {
|
||||
return new Texture({ source: id });
|
||||
}
|
||||
return resourceToTexture(id, skipCache);
|
||||
}
|
||||
Texture.from = textureFrom;
|
||||
TextureSource.from = textureSourceFrom;
|
||||
|
||||
export { autoDetectSource, resourceToTexture, textureFrom };
|
||||
//# sourceMappingURL=textureFrom.mjs.map
|
1
node_modules/pixi.js/lib/rendering/renderers/shared/texture/utils/textureFrom.mjs.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/rendering/renderers/shared/texture/utils/textureFrom.mjs.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user