This commit is contained in:
Akko
2025-08-04 18:57:35 +02:00
parent 8cf6e78a79
commit 9495868c2e
5030 changed files with 518594 additions and 17609 deletions

View File

@@ -0,0 +1,15 @@
import type { ALPHA_MODES } from '../../rendering/renderers/shared/texture/const';
/**
* Helper for detecting the correct alpha mode for video textures.
* For some reason, some browsers/devices/WebGL implementations premultiply the alpha
* of a video before and then a second time if `UNPACK_PREMULTIPLY_ALPHA_WEBGL`
* is true. So the video is premultiplied twice if the alpha mode is `UNPACK`.
* In this case we need the alpha mode to be `PMA`. This function detects
* the upload behavior by uploading a white 2x2 webm with 50% alpha
* without `UNPACK_PREMULTIPLY_ALPHA_WEBGL` and then checking whether
* the uploaded pixels are premultiplied.
* @memberof utils
* @function detectVideoAlphaMode
* @returns {Promise<ALPHA_MODES>} The correct alpha mode for video textures.
*/
export declare function detectVideoAlphaMode(): Promise<ALPHA_MODES>;

View File

@@ -0,0 +1,50 @@
'use strict';
"use strict";
let promise;
async function detectVideoAlphaMode() {
promise ?? (promise = (async () => {
const canvas = document.createElement("canvas");
const gl = canvas.getContext("webgl");
if (!gl) {
return "premultiply-alpha-on-upload";
}
const video = await new Promise((resolve) => {
const video2 = document.createElement("video");
video2.onloadeddata = () => resolve(video2);
video2.onerror = () => resolve(null);
video2.autoplay = false;
video2.crossOrigin = "anonymous";
video2.preload = "auto";
video2.src = "data:video/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQJChYECGFOAZwEAAAAAAAHTEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHGTbuMU6uEElTDZ1OsggEXTbuMU6uEHFO7a1OsggG97AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmoCrXsYMPQkBNgIRMYXZmV0GETGF2ZkSJiEBEAAAAAAAAFlSua8yuAQAAAAAAAEPXgQFzxYgAAAAAAAAAAZyBACK1nIN1bmSIgQCGhVZfVlA5g4EBI+ODhAJiWgDglLCBArqBApqBAlPAgQFVsIRVuYEBElTDZ9Vzc9JjwItjxYgAAAAAAAAAAWfInEWjh0VOQ09ERVJEh49MYXZjIGxpYnZweC12cDlnyKJFo4hEVVJBVElPTkSHlDAwOjAwOjAwLjA0MDAwMDAwMAAAH0O2dcfngQCgwqGggQAAAIJJg0IAABAAFgA4JBwYSgAAICAAEb///4r+AAB1oZ2mm+6BAaWWgkmDQgAAEAAWADgkHBhKAAAgIABIQBxTu2uRu4+zgQC3iveBAfGCAXHwgQM=";
video2.load();
});
if (!video) {
return "premultiply-alpha-on-upload";
}
const texture = gl.createTexture();
gl.bindTexture(gl.TEXTURE_2D, texture);
const framebuffer = gl.createFramebuffer();
gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);
gl.framebufferTexture2D(
gl.FRAMEBUFFER,
gl.COLOR_ATTACHMENT0,
gl.TEXTURE_2D,
texture,
0
);
gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);
gl.pixelStorei(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, gl.NONE);
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, video);
const pixel = new Uint8Array(4);
gl.readPixels(0, 0, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, pixel);
gl.deleteFramebuffer(framebuffer);
gl.deleteTexture(texture);
gl.getExtension("WEBGL_lose_context")?.loseContext();
return pixel[0] <= pixel[3] ? "premultiplied-alpha" : "premultiply-alpha-on-upload";
})());
return promise;
}
exports.detectVideoAlphaMode = detectVideoAlphaMode;
//# sourceMappingURL=detectVideoAlphaMode.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,48 @@
"use strict";
let promise;
async function detectVideoAlphaMode() {
promise ?? (promise = (async () => {
const canvas = document.createElement("canvas");
const gl = canvas.getContext("webgl");
if (!gl) {
return "premultiply-alpha-on-upload";
}
const video = await new Promise((resolve) => {
const video2 = document.createElement("video");
video2.onloadeddata = () => resolve(video2);
video2.onerror = () => resolve(null);
video2.autoplay = false;
video2.crossOrigin = "anonymous";
video2.preload = "auto";
video2.src = "data:video/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQJChYECGFOAZwEAAAAAAAHTEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHGTbuMU6uEElTDZ1OsggEXTbuMU6uEHFO7a1OsggG97AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmoCrXsYMPQkBNgIRMYXZmV0GETGF2ZkSJiEBEAAAAAAAAFlSua8yuAQAAAAAAAEPXgQFzxYgAAAAAAAAAAZyBACK1nIN1bmSIgQCGhVZfVlA5g4EBI+ODhAJiWgDglLCBArqBApqBAlPAgQFVsIRVuYEBElTDZ9Vzc9JjwItjxYgAAAAAAAAAAWfInEWjh0VOQ09ERVJEh49MYXZjIGxpYnZweC12cDlnyKJFo4hEVVJBVElPTkSHlDAwOjAwOjAwLjA0MDAwMDAwMAAAH0O2dcfngQCgwqGggQAAAIJJg0IAABAAFgA4JBwYSgAAICAAEb///4r+AAB1oZ2mm+6BAaWWgkmDQgAAEAAWADgkHBhKAAAgIABIQBxTu2uRu4+zgQC3iveBAfGCAXHwgQM=";
video2.load();
});
if (!video) {
return "premultiply-alpha-on-upload";
}
const texture = gl.createTexture();
gl.bindTexture(gl.TEXTURE_2D, texture);
const framebuffer = gl.createFramebuffer();
gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);
gl.framebufferTexture2D(
gl.FRAMEBUFFER,
gl.COLOR_ATTACHMENT0,
gl.TEXTURE_2D,
texture,
0
);
gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);
gl.pixelStorei(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, gl.NONE);
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, video);
const pixel = new Uint8Array(4);
gl.readPixels(0, 0, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, pixel);
gl.deleteFramebuffer(framebuffer);
gl.deleteTexture(texture);
gl.getExtension("WEBGL_lose_context")?.loseContext();
return pixel[0] <= pixel[3] ? "premultiplied-alpha" : "premultiply-alpha-on-upload";
})());
return promise;
}
export { detectVideoAlphaMode };
//# sourceMappingURL=detectVideoAlphaMode.mjs.map

File diff suppressed because one or more lines are too long

84
node_modules/pixi.js/lib/utils/browser/isMobile.d.ts generated vendored Normal file
View File

@@ -0,0 +1,84 @@
/**
* The result of the {@link utils.isMobile} function.
* @ignore
* @memberof utils
*/
export type isMobileResult = {
/**
* Whether the device is an Apple device.
* @memberof utils.isMobile
*/
apple: {
phone: boolean;
ipod: boolean;
tablet: boolean;
universal: boolean;
device: boolean;
};
/**
* Whether the device is an Amazon device.
* @memberof utils.isMobile
*/
amazon: {
phone: boolean;
tablet: boolean;
device: boolean;
};
/**
* Whether the device is an Android device.
* @memberof utils.isMobile
*/
android: {
phone: boolean;
tablet: boolean;
device: boolean;
};
/**
* Whether the device is a Windows device.
* @memberof utils.isMobile
*/
windows: {
phone: boolean;
tablet: boolean;
device: boolean;
};
/**
* Whether the device is a specific device.
* @memberof utils.isMobile
*/
other: {
blackberry: boolean;
blackberry10: boolean;
opera: boolean;
firefox: boolean;
chrome: boolean;
device: boolean;
};
/**
* Whether the device is a phone device.
* @memberof utils.isMobile
*/
phone: boolean;
/**
* Whether the device is a tablet device.
* @memberof utils.isMobile
*/
tablet: boolean;
/**
* Whether the device is any kind of device.
* @memberof utils.isMobile
*/
any: boolean;
};
/**
* Detects whether the device is mobile and what type of mobile device it is.
* ```js
* import { isMobile } from 'pixi.js';
*
* if (isMobile.apple.tablet) {
* // The device is an Apple tablet device.
* }
* ```
* @memberof utils
*/
export declare const isMobile: isMobileResult;

10
node_modules/pixi.js/lib/utils/browser/isMobile.js generated vendored Normal file
View File

@@ -0,0 +1,10 @@
'use strict';
var isMobileJs = require('ismobilejs');
"use strict";
const isMobileCall = isMobileJs.default ?? isMobileJs;
const isMobile = isMobileCall(globalThis.navigator);
exports.isMobile = isMobile;
//# sourceMappingURL=isMobile.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"isMobile.js","sources":["../../../src/utils/browser/isMobile.ts"],"sourcesContent":["import isMobileJs from 'ismobilejs';\n\n// ismobilejs have different import behavior for CJS and ESM, so here is the hack\ntype isMobileJsType = typeof isMobileJs & { default?: typeof isMobileJs };\nconst isMobileCall = (isMobileJs as isMobileJsType).default ?? isMobileJs;\n\n/**\n * The result of the {@link utils.isMobile} function.\n * @ignore\n * @memberof utils\n */\nexport type isMobileResult = {\n /**\n * Whether the device is an Apple device.\n * @memberof utils.isMobile\n */\n apple: {\n phone: boolean;\n ipod: boolean;\n tablet: boolean;\n universal: boolean;\n device: boolean;\n };\n /**\n * Whether the device is an Amazon device.\n * @memberof utils.isMobile\n */\n amazon: {\n phone: boolean;\n tablet: boolean;\n device: boolean;\n };\n /**\n * Whether the device is an Android device.\n * @memberof utils.isMobile\n */\n android: {\n phone: boolean;\n tablet: boolean;\n device: boolean;\n };\n /**\n * Whether the device is a Windows device.\n * @memberof utils.isMobile\n */\n windows: {\n phone: boolean;\n tablet: boolean;\n device: boolean;\n };\n /**\n * Whether the device is a specific device.\n * @memberof utils.isMobile\n */\n other: {\n blackberry: boolean;\n blackberry10: boolean;\n opera: boolean;\n firefox: boolean;\n chrome: boolean;\n device: boolean;\n };\n /**\n * Whether the device is a phone device.\n * @memberof utils.isMobile\n */\n phone: boolean;\n /**\n * Whether the device is a tablet device.\n * @memberof utils.isMobile\n */\n tablet: boolean;\n /**\n * Whether the device is any kind of device.\n * @memberof utils.isMobile\n */\n any: boolean;\n};\n\n/**\n * Detects whether the device is mobile and what type of mobile device it is.\n * ```js\n * import { isMobile } from 'pixi.js';\n *\n * if (isMobile.apple.tablet) {\n * // The device is an Apple tablet device.\n * }\n * ```\n * @memberof utils\n */\nexport const isMobile: isMobileResult = isMobileCall(globalThis.navigator);\n"],"names":[],"mappings":";;;;;AAIA,MAAM,YAAA,GAAgB,WAA8B,OAAW,IAAA,UAAA,CAAA;AAsFlD,MAAA,QAAA,GAA2B,YAAa,CAAA,UAAA,CAAW,SAAS;;;;"}

8
node_modules/pixi.js/lib/utils/browser/isMobile.mjs generated vendored Normal file
View File

@@ -0,0 +1,8 @@
import isMobileJs from 'ismobilejs';
"use strict";
const isMobileCall = isMobileJs.default ?? isMobileJs;
const isMobile = isMobileCall(globalThis.navigator);
export { isMobile };
//# sourceMappingURL=isMobile.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"isMobile.mjs","sources":["../../../src/utils/browser/isMobile.ts"],"sourcesContent":["import isMobileJs from 'ismobilejs';\n\n// ismobilejs have different import behavior for CJS and ESM, so here is the hack\ntype isMobileJsType = typeof isMobileJs & { default?: typeof isMobileJs };\nconst isMobileCall = (isMobileJs as isMobileJsType).default ?? isMobileJs;\n\n/**\n * The result of the {@link utils.isMobile} function.\n * @ignore\n * @memberof utils\n */\nexport type isMobileResult = {\n /**\n * Whether the device is an Apple device.\n * @memberof utils.isMobile\n */\n apple: {\n phone: boolean;\n ipod: boolean;\n tablet: boolean;\n universal: boolean;\n device: boolean;\n };\n /**\n * Whether the device is an Amazon device.\n * @memberof utils.isMobile\n */\n amazon: {\n phone: boolean;\n tablet: boolean;\n device: boolean;\n };\n /**\n * Whether the device is an Android device.\n * @memberof utils.isMobile\n */\n android: {\n phone: boolean;\n tablet: boolean;\n device: boolean;\n };\n /**\n * Whether the device is a Windows device.\n * @memberof utils.isMobile\n */\n windows: {\n phone: boolean;\n tablet: boolean;\n device: boolean;\n };\n /**\n * Whether the device is a specific device.\n * @memberof utils.isMobile\n */\n other: {\n blackberry: boolean;\n blackberry10: boolean;\n opera: boolean;\n firefox: boolean;\n chrome: boolean;\n device: boolean;\n };\n /**\n * Whether the device is a phone device.\n * @memberof utils.isMobile\n */\n phone: boolean;\n /**\n * Whether the device is a tablet device.\n * @memberof utils.isMobile\n */\n tablet: boolean;\n /**\n * Whether the device is any kind of device.\n * @memberof utils.isMobile\n */\n any: boolean;\n};\n\n/**\n * Detects whether the device is mobile and what type of mobile device it is.\n * ```js\n * import { isMobile } from 'pixi.js';\n *\n * if (isMobile.apple.tablet) {\n * // The device is an Apple tablet device.\n * }\n * ```\n * @memberof utils\n */\nexport const isMobile: isMobileResult = isMobileCall(globalThis.navigator);\n"],"names":[],"mappings":";;;AAIA,MAAM,YAAA,GAAgB,WAA8B,OAAW,IAAA,UAAA,CAAA;AAsFlD,MAAA,QAAA,GAA2B,YAAa,CAAA,UAAA,CAAW,SAAS;;;;"}

1
node_modules/pixi.js/lib/utils/browser/isSafari.d.ts generated vendored Normal file
View File

@@ -0,0 +1 @@
export declare function isSafari(): boolean;

12
node_modules/pixi.js/lib/utils/browser/isSafari.js generated vendored Normal file
View File

@@ -0,0 +1,12 @@
'use strict';
var adapter = require('../../environment/adapter.js');
"use strict";
function isSafari() {
const { userAgent } = adapter.DOMAdapter.get().getNavigator();
return /^((?!chrome|android).)*safari/i.test(userAgent);
}
exports.isSafari = isSafari;
//# sourceMappingURL=isSafari.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"isSafari.js","sources":["../../../src/utils/browser/isSafari.ts"],"sourcesContent":["import { DOMAdapter } from '../../environment/adapter';\n\nexport function isSafari(): boolean\n{\n const { userAgent } = DOMAdapter.get().getNavigator();\n\n return (/^((?!chrome|android).)*safari/i).test(userAgent);\n}\n"],"names":["DOMAdapter"],"mappings":";;;;;AAEO,SAAS,QAChB,GAAA;AACI,EAAA,MAAM,EAAE,SAAU,EAAA,GAAIA,kBAAW,CAAA,GAAA,GAAM,YAAa,EAAA,CAAA;AAEpD,EAAQ,OAAA,gCAAA,CAAkC,KAAK,SAAS,CAAA,CAAA;AAC5D;;;;"}

10
node_modules/pixi.js/lib/utils/browser/isSafari.mjs generated vendored Normal file
View File

@@ -0,0 +1,10 @@
import { DOMAdapter } from '../../environment/adapter.mjs';
"use strict";
function isSafari() {
const { userAgent } = DOMAdapter.get().getNavigator();
return /^((?!chrome|android).)*safari/i.test(userAgent);
}
export { isSafari };
//# sourceMappingURL=isSafari.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"isSafari.mjs","sources":["../../../src/utils/browser/isSafari.ts"],"sourcesContent":["import { DOMAdapter } from '../../environment/adapter';\n\nexport function isSafari(): boolean\n{\n const { userAgent } = DOMAdapter.get().getNavigator();\n\n return (/^((?!chrome|android).)*safari/i).test(userAgent);\n}\n"],"names":[],"mappings":";;;AAEO,SAAS,QAChB,GAAA;AACI,EAAA,MAAM,EAAE,SAAU,EAAA,GAAI,UAAW,CAAA,GAAA,GAAM,YAAa,EAAA,CAAA;AAEpD,EAAQ,OAAA,gCAAA,CAAkC,KAAK,SAAS,CAAA,CAAA;AAC5D;;;;"}

View File

@@ -0,0 +1,8 @@
/**
* Helper for checking for WebGL support.
* @param failIfMajorPerformanceCaveat - whether to fail if there is a major performance caveat, defaults to false
* @memberof utils
* @function isWebGLSupported
* @returns {boolean} Is WebGL supported.
*/
export declare function isWebGLSupported(failIfMajorPerformanceCaveat?: boolean): boolean;

View File

@@ -0,0 +1,39 @@
'use strict';
var adapter = require('../../environment/adapter.js');
var AbstractRenderer = require('../../rendering/renderers/shared/system/AbstractRenderer.js');
"use strict";
let _isWebGLSupported;
function isWebGLSupported(failIfMajorPerformanceCaveat) {
if (_isWebGLSupported !== void 0)
return _isWebGLSupported;
_isWebGLSupported = (() => {
const contextOptions = {
stencil: true,
failIfMajorPerformanceCaveat: failIfMajorPerformanceCaveat ?? AbstractRenderer.AbstractRenderer.defaultOptions.failIfMajorPerformanceCaveat
};
try {
if (!adapter.DOMAdapter.get().getWebGLRenderingContext()) {
return false;
}
const canvas = adapter.DOMAdapter.get().createCanvas();
let gl = canvas.getContext("webgl", contextOptions);
const success = !!gl?.getContextAttributes()?.stencil;
if (gl) {
const loseContext = gl.getExtension("WEBGL_lose_context");
if (loseContext) {
loseContext.loseContext();
}
}
gl = null;
return success;
} catch (e) {
return false;
}
})();
return _isWebGLSupported;
}
exports.isWebGLSupported = isWebGLSupported;
//# sourceMappingURL=isWebGLSupported.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"isWebGLSupported.js","sources":["../../../src/utils/browser/isWebGLSupported.ts"],"sourcesContent":["import { DOMAdapter } from '../../environment/adapter';\nimport { AbstractRenderer } from '../../rendering/renderers/shared/system/AbstractRenderer';\n\nlet _isWebGLSupported: boolean | undefined;\n\n/**\n * Helper for checking for WebGL support.\n * @param failIfMajorPerformanceCaveat - whether to fail if there is a major performance caveat, defaults to false\n * @memberof utils\n * @function isWebGLSupported\n * @returns {boolean} Is WebGL supported.\n */\nexport function isWebGLSupported(\n failIfMajorPerformanceCaveat?: boolean\n): boolean\n{\n if (_isWebGLSupported !== undefined) return _isWebGLSupported;\n\n _isWebGLSupported = ((): boolean =>\n {\n const contextOptions = {\n stencil: true,\n failIfMajorPerformanceCaveat:\n failIfMajorPerformanceCaveat\n ?? AbstractRenderer.defaultOptions.failIfMajorPerformanceCaveat,\n };\n\n try\n {\n if (!DOMAdapter.get().getWebGLRenderingContext())\n {\n return false;\n }\n\n const canvas = DOMAdapter.get().createCanvas();\n let gl = canvas.getContext('webgl', contextOptions);\n\n const success = !!gl?.getContextAttributes()?.stencil;\n\n if (gl)\n {\n const loseContext = gl.getExtension('WEBGL_lose_context');\n\n if (loseContext)\n {\n loseContext.loseContext();\n }\n }\n\n gl = null;\n\n return success;\n }\n catch (e)\n {\n return false;\n }\n })();\n\n return _isWebGLSupported;\n}\n"],"names":["AbstractRenderer","DOMAdapter"],"mappings":";;;;;;AAGA,IAAI,iBAAA,CAAA;AASG,SAAS,iBACZ,4BAEJ,EAAA;AACI,EAAA,IAAI,iBAAsB,KAAA,KAAA,CAAA;AAAW,IAAO,OAAA,iBAAA,CAAA;AAE5C,EAAA,iBAAA,GAAA,CAAqB,MACrB;AACI,IAAA,MAAM,cAAiB,GAAA;AAAA,MACnB,OAAS,EAAA,IAAA;AAAA,MACT,4BAAA,EACI,4BACG,IAAAA,iCAAA,CAAiB,cAAe,CAAA,4BAAA;AAAA,KAC3C,CAAA;AAEA,IACA,IAAA;AACI,MAAA,IAAI,CAACC,kBAAA,CAAW,GAAI,EAAA,CAAE,0BACtB,EAAA;AACI,QAAO,OAAA,KAAA,CAAA;AAAA,OACX;AAEA,MAAA,MAAM,MAAS,GAAAA,kBAAA,CAAW,GAAI,EAAA,CAAE,YAAa,EAAA,CAAA;AAC7C,MAAA,IAAI,EAAK,GAAA,MAAA,CAAO,UAAW,CAAA,OAAA,EAAS,cAAc,CAAA,CAAA;AAElD,MAAA,MAAM,OAAU,GAAA,CAAC,CAAC,EAAA,EAAI,sBAAwB,EAAA,OAAA,CAAA;AAE9C,MAAA,IAAI,EACJ,EAAA;AACI,QAAM,MAAA,WAAA,GAAc,EAAG,CAAA,YAAA,CAAa,oBAAoB,CAAA,CAAA;AAExD,QAAA,IAAI,WACJ,EAAA;AACI,UAAA,WAAA,CAAY,WAAY,EAAA,CAAA;AAAA,SAC5B;AAAA,OACJ;AAEA,MAAK,EAAA,GAAA,IAAA,CAAA;AAEL,MAAO,OAAA,OAAA,CAAA;AAAA,aAEJ,CACP,EAAA;AACI,MAAO,OAAA,KAAA,CAAA;AAAA,KACX;AAAA,GACD,GAAA,CAAA;AAEH,EAAO,OAAA,iBAAA,CAAA;AACX;;;;"}

View File

@@ -0,0 +1,37 @@
import { DOMAdapter } from '../../environment/adapter.mjs';
import { AbstractRenderer } from '../../rendering/renderers/shared/system/AbstractRenderer.mjs';
"use strict";
let _isWebGLSupported;
function isWebGLSupported(failIfMajorPerformanceCaveat) {
if (_isWebGLSupported !== void 0)
return _isWebGLSupported;
_isWebGLSupported = (() => {
const contextOptions = {
stencil: true,
failIfMajorPerformanceCaveat: failIfMajorPerformanceCaveat ?? AbstractRenderer.defaultOptions.failIfMajorPerformanceCaveat
};
try {
if (!DOMAdapter.get().getWebGLRenderingContext()) {
return false;
}
const canvas = DOMAdapter.get().createCanvas();
let gl = canvas.getContext("webgl", contextOptions);
const success = !!gl?.getContextAttributes()?.stencil;
if (gl) {
const loseContext = gl.getExtension("WEBGL_lose_context");
if (loseContext) {
loseContext.loseContext();
}
}
gl = null;
return success;
} catch (e) {
return false;
}
})();
return _isWebGLSupported;
}
export { isWebGLSupported };
//# sourceMappingURL=isWebGLSupported.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"isWebGLSupported.mjs","sources":["../../../src/utils/browser/isWebGLSupported.ts"],"sourcesContent":["import { DOMAdapter } from '../../environment/adapter';\nimport { AbstractRenderer } from '../../rendering/renderers/shared/system/AbstractRenderer';\n\nlet _isWebGLSupported: boolean | undefined;\n\n/**\n * Helper for checking for WebGL support.\n * @param failIfMajorPerformanceCaveat - whether to fail if there is a major performance caveat, defaults to false\n * @memberof utils\n * @function isWebGLSupported\n * @returns {boolean} Is WebGL supported.\n */\nexport function isWebGLSupported(\n failIfMajorPerformanceCaveat?: boolean\n): boolean\n{\n if (_isWebGLSupported !== undefined) return _isWebGLSupported;\n\n _isWebGLSupported = ((): boolean =>\n {\n const contextOptions = {\n stencil: true,\n failIfMajorPerformanceCaveat:\n failIfMajorPerformanceCaveat\n ?? AbstractRenderer.defaultOptions.failIfMajorPerformanceCaveat,\n };\n\n try\n {\n if (!DOMAdapter.get().getWebGLRenderingContext())\n {\n return false;\n }\n\n const canvas = DOMAdapter.get().createCanvas();\n let gl = canvas.getContext('webgl', contextOptions);\n\n const success = !!gl?.getContextAttributes()?.stencil;\n\n if (gl)\n {\n const loseContext = gl.getExtension('WEBGL_lose_context');\n\n if (loseContext)\n {\n loseContext.loseContext();\n }\n }\n\n gl = null;\n\n return success;\n }\n catch (e)\n {\n return false;\n }\n })();\n\n return _isWebGLSupported;\n}\n"],"names":[],"mappings":";;;;AAGA,IAAI,iBAAA,CAAA;AASG,SAAS,iBACZ,4BAEJ,EAAA;AACI,EAAA,IAAI,iBAAsB,KAAA,KAAA,CAAA;AAAW,IAAO,OAAA,iBAAA,CAAA;AAE5C,EAAA,iBAAA,GAAA,CAAqB,MACrB;AACI,IAAA,MAAM,cAAiB,GAAA;AAAA,MACnB,OAAS,EAAA,IAAA;AAAA,MACT,4BAAA,EACI,4BACG,IAAA,gBAAA,CAAiB,cAAe,CAAA,4BAAA;AAAA,KAC3C,CAAA;AAEA,IACA,IAAA;AACI,MAAA,IAAI,CAAC,UAAA,CAAW,GAAI,EAAA,CAAE,0BACtB,EAAA;AACI,QAAO,OAAA,KAAA,CAAA;AAAA,OACX;AAEA,MAAA,MAAM,MAAS,GAAA,UAAA,CAAW,GAAI,EAAA,CAAE,YAAa,EAAA,CAAA;AAC7C,MAAA,IAAI,EAAK,GAAA,MAAA,CAAO,UAAW,CAAA,OAAA,EAAS,cAAc,CAAA,CAAA;AAElD,MAAA,MAAM,OAAU,GAAA,CAAC,CAAC,EAAA,EAAI,sBAAwB,EAAA,OAAA,CAAA;AAE9C,MAAA,IAAI,EACJ,EAAA;AACI,QAAM,MAAA,WAAA,GAAc,EAAG,CAAA,YAAA,CAAa,oBAAoB,CAAA,CAAA;AAExD,QAAA,IAAI,WACJ,EAAA;AACI,UAAA,WAAA,CAAY,WAAY,EAAA,CAAA;AAAA,SAC5B;AAAA,OACJ;AAEA,MAAK,EAAA,GAAA,IAAA,CAAA;AAEL,MAAO,OAAA,OAAA,CAAA;AAAA,aAEJ,CACP,EAAA;AACI,MAAO,OAAA,KAAA,CAAA;AAAA,KACX;AAAA,GACD,GAAA,CAAA;AAEH,EAAO,OAAA,iBAAA,CAAA;AACX;;;;"}

View File

@@ -0,0 +1,9 @@
/// <reference types="@webgpu/types" />
/**
* Helper for checking for WebGPU support.
* @param options - The options for requesting a GPU adapter.
* @memberof utils
* @function isWebGPUSupported
* @returns Is WebGPU supported.
*/
export declare function isWebGPUSupported(options?: GPURequestAdapterOptions): Promise<boolean>;

View File

@@ -0,0 +1,27 @@
'use strict';
var adapter = require('../../environment/adapter.js');
"use strict";
let _isWebGPUSupported;
async function isWebGPUSupported(options = {}) {
if (_isWebGPUSupported !== void 0)
return _isWebGPUSupported;
_isWebGPUSupported = await (async () => {
const gpu = adapter.DOMAdapter.get().getNavigator().gpu;
if (!gpu) {
return false;
}
try {
const adapter = await gpu.requestAdapter(options);
await adapter.requestDevice();
return true;
} catch (e) {
return false;
}
})();
return _isWebGPUSupported;
}
exports.isWebGPUSupported = isWebGPUSupported;
//# sourceMappingURL=isWebGPUSupported.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"isWebGPUSupported.js","sources":["../../../src/utils/browser/isWebGPUSupported.ts"],"sourcesContent":["import { DOMAdapter } from '../../environment/adapter';\n\nlet _isWebGPUSupported: boolean | undefined;\n\n/**\n * Helper for checking for WebGPU support.\n * @param options - The options for requesting a GPU adapter.\n * @memberof utils\n * @function isWebGPUSupported\n * @returns Is WebGPU supported.\n */\nexport async function isWebGPUSupported(options: GPURequestAdapterOptions = {}): Promise<boolean>\n{\n if (_isWebGPUSupported !== undefined) return _isWebGPUSupported;\n\n _isWebGPUSupported = await (async (): Promise<boolean> =>\n {\n const gpu = DOMAdapter.get().getNavigator().gpu;\n\n if (!gpu)\n {\n return false;\n }\n\n try\n {\n const adapter = await gpu.requestAdapter(options) as GPUAdapter;\n\n // TODO and one of these!\n await adapter.requestDevice();\n\n return true;\n }\n catch (e)\n {\n return false;\n }\n })();\n\n return _isWebGPUSupported;\n}\n"],"names":["DOMAdapter"],"mappings":";;;;;AAEA,IAAI,kBAAA,CAAA;AASkB,eAAA,iBAAA,CAAkB,OAAoC,GAAA,EAC5E,EAAA;AACI,EAAA,IAAI,kBAAuB,KAAA,KAAA,CAAA;AAAW,IAAO,OAAA,kBAAA,CAAA;AAE7C,EAAA,kBAAA,GAAqB,OAAO,YAC5B;AACI,IAAA,MAAM,GAAM,GAAAA,kBAAA,CAAW,GAAI,EAAA,CAAE,cAAe,CAAA,GAAA,CAAA;AAE5C,IAAA,IAAI,CAAC,GACL,EAAA;AACI,MAAO,OAAA,KAAA,CAAA;AAAA,KACX;AAEA,IACA,IAAA;AACI,MAAA,MAAM,OAAU,GAAA,MAAM,GAAI,CAAA,cAAA,CAAe,OAAO,CAAA,CAAA;AAGhD,MAAA,MAAM,QAAQ,aAAc,EAAA,CAAA;AAE5B,MAAO,OAAA,IAAA,CAAA;AAAA,aAEJ,CACP,EAAA;AACI,MAAO,OAAA,KAAA,CAAA;AAAA,KACX;AAAA,GACD,GAAA,CAAA;AAEH,EAAO,OAAA,kBAAA,CAAA;AACX;;;;"}

View File

@@ -0,0 +1,25 @@
import { DOMAdapter } from '../../environment/adapter.mjs';
"use strict";
let _isWebGPUSupported;
async function isWebGPUSupported(options = {}) {
if (_isWebGPUSupported !== void 0)
return _isWebGPUSupported;
_isWebGPUSupported = await (async () => {
const gpu = DOMAdapter.get().getNavigator().gpu;
if (!gpu) {
return false;
}
try {
const adapter = await gpu.requestAdapter(options);
await adapter.requestDevice();
return true;
} catch (e) {
return false;
}
})();
return _isWebGPUSupported;
}
export { isWebGPUSupported };
//# sourceMappingURL=isWebGPUSupported.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"isWebGPUSupported.mjs","sources":["../../../src/utils/browser/isWebGPUSupported.ts"],"sourcesContent":["import { DOMAdapter } from '../../environment/adapter';\n\nlet _isWebGPUSupported: boolean | undefined;\n\n/**\n * Helper for checking for WebGPU support.\n * @param options - The options for requesting a GPU adapter.\n * @memberof utils\n * @function isWebGPUSupported\n * @returns Is WebGPU supported.\n */\nexport async function isWebGPUSupported(options: GPURequestAdapterOptions = {}): Promise<boolean>\n{\n if (_isWebGPUSupported !== undefined) return _isWebGPUSupported;\n\n _isWebGPUSupported = await (async (): Promise<boolean> =>\n {\n const gpu = DOMAdapter.get().getNavigator().gpu;\n\n if (!gpu)\n {\n return false;\n }\n\n try\n {\n const adapter = await gpu.requestAdapter(options) as GPUAdapter;\n\n // TODO and one of these!\n await adapter.requestDevice();\n\n return true;\n }\n catch (e)\n {\n return false;\n }\n })();\n\n return _isWebGPUSupported;\n}\n"],"names":[],"mappings":";;;AAEA,IAAI,kBAAA,CAAA;AASkB,eAAA,iBAAA,CAAkB,OAAoC,GAAA,EAC5E,EAAA;AACI,EAAA,IAAI,kBAAuB,KAAA,KAAA,CAAA;AAAW,IAAO,OAAA,kBAAA,CAAA;AAE7C,EAAA,kBAAA,GAAqB,OAAO,YAC5B;AACI,IAAA,MAAM,GAAM,GAAA,UAAA,CAAW,GAAI,EAAA,CAAE,cAAe,CAAA,GAAA,CAAA;AAE5C,IAAA,IAAI,CAAC,GACL,EAAA;AACI,MAAO,OAAA,KAAA,CAAA;AAAA,KACX;AAEA,IACA,IAAA;AACI,MAAA,MAAM,OAAU,GAAA,MAAM,GAAI,CAAA,cAAA,CAAe,OAAO,CAAA,CAAA;AAGhD,MAAA,MAAM,QAAQ,aAAc,EAAA,CAAA;AAE5B,MAAO,OAAA,IAAA,CAAA;AAAA,aAEJ,CACP,EAAA;AACI,MAAO,OAAA,KAAA,CAAA;AAAA,KACX;AAAA,GACD,GAAA,CAAA;AAEH,EAAO,OAAA,kBAAA,CAAA;AACX;;;;"}

View File

@@ -0,0 +1,7 @@
/**
* Not all platforms allow to generate function code (e.g., `new Function`).
* this provides the platform-level detection.
* @private
* @returns {boolean} `true` if `new Function` is supported.
*/
export declare function unsafeEvalSupported(): boolean;

View File

@@ -0,0 +1,19 @@
'use strict';
"use strict";
let unsafeEval;
function unsafeEvalSupported() {
if (typeof unsafeEval === "boolean") {
return unsafeEval;
}
try {
const func = new Function("param1", "param2", "param3", "return param1[param2] === param3;");
unsafeEval = func({ a: "b" }, "a", "b") === true;
} catch (e) {
unsafeEval = false;
}
return unsafeEval;
}
exports.unsafeEvalSupported = unsafeEvalSupported;
//# sourceMappingURL=unsafeEvalSupported.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"unsafeEvalSupported.js","sources":["../../../src/utils/browser/unsafeEvalSupported.ts"],"sourcesContent":["// Cache the result to prevent running this over and over\nlet unsafeEval: boolean;\n\n/**\n * Not all platforms allow to generate function code (e.g., `new Function`).\n * this provides the platform-level detection.\n * @private\n * @returns {boolean} `true` if `new Function` is supported.\n */\nexport function unsafeEvalSupported(): boolean\n{\n if (typeof unsafeEval === 'boolean')\n {\n return unsafeEval;\n }\n\n try\n {\n /* eslint-disable no-new-func */\n const func = new Function('param1', 'param2', 'param3', 'return param1[param2] === param3;');\n /* eslint-enable no-new-func */\n\n unsafeEval = func({ a: 'b' }, 'a', 'b') === true;\n }\n catch (e)\n {\n unsafeEval = false;\n }\n\n return unsafeEval;\n}\n"],"names":[],"mappings":";;;AACA,IAAI,UAAA,CAAA;AAQG,SAAS,mBAChB,GAAA;AACI,EAAI,IAAA,OAAO,eAAe,SAC1B,EAAA;AACI,IAAO,OAAA,UAAA,CAAA;AAAA,GACX;AAEA,EACA,IAAA;AAEI,IAAA,MAAM,OAAO,IAAI,QAAA,CAAS,QAAU,EAAA,QAAA,EAAU,UAAU,mCAAmC,CAAA,CAAA;AAG3F,IAAA,UAAA,GAAa,KAAK,EAAE,CAAA,EAAG,KAAO,EAAA,GAAA,EAAK,GAAG,CAAM,KAAA,IAAA,CAAA;AAAA,WAEzC,CACP,EAAA;AACI,IAAa,UAAA,GAAA,KAAA,CAAA;AAAA,GACjB;AAEA,EAAO,OAAA,UAAA,CAAA;AACX;;;;"}

View File

@@ -0,0 +1,17 @@
"use strict";
let unsafeEval;
function unsafeEvalSupported() {
if (typeof unsafeEval === "boolean") {
return unsafeEval;
}
try {
const func = new Function("param1", "param2", "param3", "return param1[param2] === param3;");
unsafeEval = func({ a: "b" }, "a", "b") === true;
} catch (e) {
unsafeEval = false;
}
return unsafeEval;
}
export { unsafeEvalSupported };
//# sourceMappingURL=unsafeEvalSupported.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"unsafeEvalSupported.mjs","sources":["../../../src/utils/browser/unsafeEvalSupported.ts"],"sourcesContent":["// Cache the result to prevent running this over and over\nlet unsafeEval: boolean;\n\n/**\n * Not all platforms allow to generate function code (e.g., `new Function`).\n * this provides the platform-level detection.\n * @private\n * @returns {boolean} `true` if `new Function` is supported.\n */\nexport function unsafeEvalSupported(): boolean\n{\n if (typeof unsafeEval === 'boolean')\n {\n return unsafeEval;\n }\n\n try\n {\n /* eslint-disable no-new-func */\n const func = new Function('param1', 'param2', 'param3', 'return param1[param2] === param3;');\n /* eslint-enable no-new-func */\n\n unsafeEval = func({ a: 'b' }, 'a', 'b') === true;\n }\n catch (e)\n {\n unsafeEval = false;\n }\n\n return unsafeEval;\n}\n"],"names":[],"mappings":";AACA,IAAI,UAAA,CAAA;AAQG,SAAS,mBAChB,GAAA;AACI,EAAI,IAAA,OAAO,eAAe,SAC1B,EAAA;AACI,IAAO,OAAA,UAAA,CAAA;AAAA,GACX;AAEA,EACA,IAAA;AAEI,IAAA,MAAM,OAAO,IAAI,QAAA,CAAS,QAAU,EAAA,QAAA,EAAU,UAAU,mCAAmC,CAAA,CAAA;AAG3F,IAAA,UAAA,GAAa,KAAK,EAAE,CAAA,EAAG,KAAO,EAAA,GAAA,EAAK,GAAG,CAAM,KAAA,IAAA,CAAA;AAAA,WAEzC,CACP,EAAA;AACI,IAAa,UAAA,GAAA,KAAA,CAAA;AAAA,GACjB;AAEA,EAAO,OAAA,UAAA,CAAA;AACX;;;;"}

View File

@@ -0,0 +1,11 @@
import { Rectangle } from '../../maths/shapes/Rectangle';
import type { ICanvas } from '../../environment/canvas/ICanvas';
/**
* Measuring the bounds of a canvas' visible (non-transparent) pixels.
* @param canvas - The canvas to measure.
* @param resolution - The resolution of the canvas.
* @returns The bounding box of the canvas' visible pixels.
* @since 7.1.0
* @memberof utils
*/
export declare function getCanvasBoundingBox(canvas: ICanvas, resolution?: number): Rectangle;

View File

@@ -0,0 +1,51 @@
'use strict';
var Rectangle = require('../../maths/shapes/Rectangle.js');
"use strict";
function checkRow(data, width, y) {
for (let x = 0, index = 4 * y * width; x < width; ++x, index += 4) {
if (data[index + 3] !== 0)
return false;
}
return true;
}
function checkColumn(data, width, x, top, bottom) {
const stride = 4 * width;
for (let y = top, index = top * stride + 4 * x; y <= bottom; ++y, index += stride) {
if (data[index + 3] !== 0)
return false;
}
return true;
}
function getCanvasBoundingBox(canvas, resolution = 1) {
const { width, height } = canvas;
const context = canvas.getContext("2d", {
willReadFrequently: true
});
if (context === null) {
throw new TypeError("Failed to get canvas 2D context");
}
const imageData = context.getImageData(0, 0, width, height);
const data = imageData.data;
let left = 0;
let top = 0;
let right = width - 1;
let bottom = height - 1;
while (top < height && checkRow(data, width, top))
++top;
if (top === height)
return Rectangle.Rectangle.EMPTY;
while (checkRow(data, width, bottom))
--bottom;
while (checkColumn(data, width, left, top, bottom))
++left;
while (checkColumn(data, width, right, top, bottom))
--right;
++right;
++bottom;
return new Rectangle.Rectangle(left / resolution, top / resolution, (right - left) / resolution, (bottom - top) / resolution);
}
exports.getCanvasBoundingBox = getCanvasBoundingBox;
//# sourceMappingURL=getCanvasBoundingBox.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"getCanvasBoundingBox.js","sources":["../../../src/utils/canvas/getCanvasBoundingBox.ts"],"sourcesContent":["import { Rectangle } from '../../maths/shapes/Rectangle';\n\nimport type { ICanvas } from '../../environment/canvas/ICanvas';\n\nfunction checkRow(data: Uint8ClampedArray, width: number, y: number)\n{\n for (let x = 0, index = 4 * y * width; x < width; ++x, index += 4)\n {\n if (data[index + 3] !== 0) return false;\n }\n\n return true;\n}\n\nfunction checkColumn(data: Uint8ClampedArray, width: number, x: number, top: number, bottom: number)\n{\n const stride = 4 * width;\n\n for (let y = top, index = (top * stride) + (4 * x); y <= bottom; ++y, index += stride)\n {\n if (data[index + 3] !== 0) return false;\n }\n\n return true;\n}\n\n/**\n * Measuring the bounds of a canvas' visible (non-transparent) pixels.\n * @param canvas - The canvas to measure.\n * @param resolution - The resolution of the canvas.\n * @returns The bounding box of the canvas' visible pixels.\n * @since 7.1.0\n * @memberof utils\n */\nexport function getCanvasBoundingBox(canvas: ICanvas, resolution = 1): Rectangle\n{\n // https://gist.github.com/timdown/021d9c8f2aabc7092df564996f5afbbf\n\n const { width, height } = canvas;\n\n const context = canvas.getContext('2d', {\n willReadFrequently: true,\n });\n\n if (context === null)\n {\n throw new TypeError('Failed to get canvas 2D context');\n }\n\n const imageData = context.getImageData(0, 0, width, height);\n const data = imageData.data;\n\n let left = 0;\n let top = 0;\n let right = width - 1;\n let bottom = height - 1;\n\n while (top < height && checkRow(data, width, top)) ++top;\n if (top === height) return Rectangle.EMPTY;\n while (checkRow(data, width, bottom)) --bottom;\n while (checkColumn(data, width, left, top, bottom)) ++left;\n while (checkColumn(data, width, right, top, bottom)) --right;\n\n ++right;\n ++bottom;\n\n return new Rectangle(left / resolution, top / resolution, (right - left) / resolution, (bottom - top) / resolution);\n}\n"],"names":["Rectangle"],"mappings":";;;;;AAIA,SAAS,QAAA,CAAS,IAAyB,EAAA,KAAA,EAAe,CAC1D,EAAA;AACI,EAAS,KAAA,IAAA,CAAA,GAAI,CAAG,EAAA,KAAA,GAAQ,CAAI,GAAA,CAAA,GAAI,KAAO,EAAA,CAAA,GAAI,KAAO,EAAA,EAAE,CAAG,EAAA,KAAA,IAAS,CAChE,EAAA;AACI,IAAI,IAAA,IAAA,CAAK,KAAQ,GAAA,CAAC,CAAM,KAAA,CAAA;AAAG,MAAO,OAAA,KAAA,CAAA;AAAA,GACtC;AAEA,EAAO,OAAA,IAAA,CAAA;AACX,CAAA;AAEA,SAAS,WAAY,CAAA,IAAA,EAAyB,KAAe,EAAA,CAAA,EAAW,KAAa,MACrF,EAAA;AACI,EAAA,MAAM,SAAS,CAAI,GAAA,KAAA,CAAA;AAEnB,EAAA,KAAA,IAAS,CAAI,GAAA,GAAA,EAAK,KAAS,GAAA,GAAA,GAAM,MAAW,GAAA,CAAA,GAAI,CAAI,EAAA,CAAA,IAAK,MAAQ,EAAA,EAAE,CAAG,EAAA,KAAA,IAAS,MAC/E,EAAA;AACI,IAAI,IAAA,IAAA,CAAK,KAAQ,GAAA,CAAC,CAAM,KAAA,CAAA;AAAG,MAAO,OAAA,KAAA,CAAA;AAAA,GACtC;AAEA,EAAO,OAAA,IAAA,CAAA;AACX,CAAA;AAUgB,SAAA,oBAAA,CAAqB,MAAiB,EAAA,UAAA,GAAa,CACnE,EAAA;AAGI,EAAM,MAAA,EAAE,KAAO,EAAA,MAAA,EAAW,GAAA,MAAA,CAAA;AAE1B,EAAM,MAAA,OAAA,GAAU,MAAO,CAAA,UAAA,CAAW,IAAM,EAAA;AAAA,IACpC,kBAAoB,EAAA,IAAA;AAAA,GACvB,CAAA,CAAA;AAED,EAAA,IAAI,YAAY,IAChB,EAAA;AACI,IAAM,MAAA,IAAI,UAAU,iCAAiC,CAAA,CAAA;AAAA,GACzD;AAEA,EAAA,MAAM,YAAY,OAAQ,CAAA,YAAA,CAAa,CAAG,EAAA,CAAA,EAAG,OAAO,MAAM,CAAA,CAAA;AAC1D,EAAA,MAAM,OAAO,SAAU,CAAA,IAAA,CAAA;AAEvB,EAAA,IAAI,IAAO,GAAA,CAAA,CAAA;AACX,EAAA,IAAI,GAAM,GAAA,CAAA,CAAA;AACV,EAAA,IAAI,QAAQ,KAAQ,GAAA,CAAA,CAAA;AACpB,EAAA,IAAI,SAAS,MAAS,GAAA,CAAA,CAAA;AAEtB,EAAA,OAAO,GAAM,GAAA,MAAA,IAAU,QAAS,CAAA,IAAA,EAAM,OAAO,GAAG,CAAA;AAAG,IAAE,EAAA,GAAA,CAAA;AACrD,EAAA,IAAI,GAAQ,KAAA,MAAA;AAAQ,IAAA,OAAOA,mBAAU,CAAA,KAAA,CAAA;AACrC,EAAO,OAAA,QAAA,CAAS,IAAM,EAAA,KAAA,EAAO,MAAM,CAAA;AAAG,IAAE,EAAA,MAAA,CAAA;AACxC,EAAA,OAAO,WAAY,CAAA,IAAA,EAAM,KAAO,EAAA,IAAA,EAAM,KAAK,MAAM,CAAA;AAAG,IAAE,EAAA,IAAA,CAAA;AACtD,EAAA,OAAO,WAAY,CAAA,IAAA,EAAM,KAAO,EAAA,KAAA,EAAO,KAAK,MAAM,CAAA;AAAG,IAAE,EAAA,KAAA,CAAA;AAEvD,EAAE,EAAA,KAAA,CAAA;AACF,EAAE,EAAA,MAAA,CAAA;AAEF,EAAO,OAAA,IAAIA,mBAAU,CAAA,IAAA,GAAO,UAAY,EAAA,GAAA,GAAM,UAAa,EAAA,CAAA,KAAA,GAAQ,IAAQ,IAAA,UAAA,EAAA,CAAa,MAAS,GAAA,GAAA,IAAO,UAAU,CAAA,CAAA;AACtH;;;;"}

View File

@@ -0,0 +1,49 @@
import { Rectangle } from '../../maths/shapes/Rectangle.mjs';
"use strict";
function checkRow(data, width, y) {
for (let x = 0, index = 4 * y * width; x < width; ++x, index += 4) {
if (data[index + 3] !== 0)
return false;
}
return true;
}
function checkColumn(data, width, x, top, bottom) {
const stride = 4 * width;
for (let y = top, index = top * stride + 4 * x; y <= bottom; ++y, index += stride) {
if (data[index + 3] !== 0)
return false;
}
return true;
}
function getCanvasBoundingBox(canvas, resolution = 1) {
const { width, height } = canvas;
const context = canvas.getContext("2d", {
willReadFrequently: true
});
if (context === null) {
throw new TypeError("Failed to get canvas 2D context");
}
const imageData = context.getImageData(0, 0, width, height);
const data = imageData.data;
let left = 0;
let top = 0;
let right = width - 1;
let bottom = height - 1;
while (top < height && checkRow(data, width, top))
++top;
if (top === height)
return Rectangle.EMPTY;
while (checkRow(data, width, bottom))
--bottom;
while (checkColumn(data, width, left, top, bottom))
++left;
while (checkColumn(data, width, right, top, bottom))
--right;
++right;
++bottom;
return new Rectangle(left / resolution, top / resolution, (right - left) / resolution, (bottom - top) / resolution);
}
export { getCanvasBoundingBox };
//# sourceMappingURL=getCanvasBoundingBox.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"getCanvasBoundingBox.mjs","sources":["../../../src/utils/canvas/getCanvasBoundingBox.ts"],"sourcesContent":["import { Rectangle } from '../../maths/shapes/Rectangle';\n\nimport type { ICanvas } from '../../environment/canvas/ICanvas';\n\nfunction checkRow(data: Uint8ClampedArray, width: number, y: number)\n{\n for (let x = 0, index = 4 * y * width; x < width; ++x, index += 4)\n {\n if (data[index + 3] !== 0) return false;\n }\n\n return true;\n}\n\nfunction checkColumn(data: Uint8ClampedArray, width: number, x: number, top: number, bottom: number)\n{\n const stride = 4 * width;\n\n for (let y = top, index = (top * stride) + (4 * x); y <= bottom; ++y, index += stride)\n {\n if (data[index + 3] !== 0) return false;\n }\n\n return true;\n}\n\n/**\n * Measuring the bounds of a canvas' visible (non-transparent) pixels.\n * @param canvas - The canvas to measure.\n * @param resolution - The resolution of the canvas.\n * @returns The bounding box of the canvas' visible pixels.\n * @since 7.1.0\n * @memberof utils\n */\nexport function getCanvasBoundingBox(canvas: ICanvas, resolution = 1): Rectangle\n{\n // https://gist.github.com/timdown/021d9c8f2aabc7092df564996f5afbbf\n\n const { width, height } = canvas;\n\n const context = canvas.getContext('2d', {\n willReadFrequently: true,\n });\n\n if (context === null)\n {\n throw new TypeError('Failed to get canvas 2D context');\n }\n\n const imageData = context.getImageData(0, 0, width, height);\n const data = imageData.data;\n\n let left = 0;\n let top = 0;\n let right = width - 1;\n let bottom = height - 1;\n\n while (top < height && checkRow(data, width, top)) ++top;\n if (top === height) return Rectangle.EMPTY;\n while (checkRow(data, width, bottom)) --bottom;\n while (checkColumn(data, width, left, top, bottom)) ++left;\n while (checkColumn(data, width, right, top, bottom)) --right;\n\n ++right;\n ++bottom;\n\n return new Rectangle(left / resolution, top / resolution, (right - left) / resolution, (bottom - top) / resolution);\n}\n"],"names":[],"mappings":";;;AAIA,SAAS,QAAA,CAAS,IAAyB,EAAA,KAAA,EAAe,CAC1D,EAAA;AACI,EAAS,KAAA,IAAA,CAAA,GAAI,CAAG,EAAA,KAAA,GAAQ,CAAI,GAAA,CAAA,GAAI,KAAO,EAAA,CAAA,GAAI,KAAO,EAAA,EAAE,CAAG,EAAA,KAAA,IAAS,CAChE,EAAA;AACI,IAAI,IAAA,IAAA,CAAK,KAAQ,GAAA,CAAC,CAAM,KAAA,CAAA;AAAG,MAAO,OAAA,KAAA,CAAA;AAAA,GACtC;AAEA,EAAO,OAAA,IAAA,CAAA;AACX,CAAA;AAEA,SAAS,WAAY,CAAA,IAAA,EAAyB,KAAe,EAAA,CAAA,EAAW,KAAa,MACrF,EAAA;AACI,EAAA,MAAM,SAAS,CAAI,GAAA,KAAA,CAAA;AAEnB,EAAA,KAAA,IAAS,CAAI,GAAA,GAAA,EAAK,KAAS,GAAA,GAAA,GAAM,MAAW,GAAA,CAAA,GAAI,CAAI,EAAA,CAAA,IAAK,MAAQ,EAAA,EAAE,CAAG,EAAA,KAAA,IAAS,MAC/E,EAAA;AACI,IAAI,IAAA,IAAA,CAAK,KAAQ,GAAA,CAAC,CAAM,KAAA,CAAA;AAAG,MAAO,OAAA,KAAA,CAAA;AAAA,GACtC;AAEA,EAAO,OAAA,IAAA,CAAA;AACX,CAAA;AAUgB,SAAA,oBAAA,CAAqB,MAAiB,EAAA,UAAA,GAAa,CACnE,EAAA;AAGI,EAAM,MAAA,EAAE,KAAO,EAAA,MAAA,EAAW,GAAA,MAAA,CAAA;AAE1B,EAAM,MAAA,OAAA,GAAU,MAAO,CAAA,UAAA,CAAW,IAAM,EAAA;AAAA,IACpC,kBAAoB,EAAA,IAAA;AAAA,GACvB,CAAA,CAAA;AAED,EAAA,IAAI,YAAY,IAChB,EAAA;AACI,IAAM,MAAA,IAAI,UAAU,iCAAiC,CAAA,CAAA;AAAA,GACzD;AAEA,EAAA,MAAM,YAAY,OAAQ,CAAA,YAAA,CAAa,CAAG,EAAA,CAAA,EAAG,OAAO,MAAM,CAAA,CAAA;AAC1D,EAAA,MAAM,OAAO,SAAU,CAAA,IAAA,CAAA;AAEvB,EAAA,IAAI,IAAO,GAAA,CAAA,CAAA;AACX,EAAA,IAAI,GAAM,GAAA,CAAA,CAAA;AACV,EAAA,IAAI,QAAQ,KAAQ,GAAA,CAAA,CAAA;AACpB,EAAA,IAAI,SAAS,MAAS,GAAA,CAAA,CAAA;AAEtB,EAAA,OAAO,GAAM,GAAA,MAAA,IAAU,QAAS,CAAA,IAAA,EAAM,OAAO,GAAG,CAAA;AAAG,IAAE,EAAA,GAAA,CAAA;AACrD,EAAA,IAAI,GAAQ,KAAA,MAAA;AAAQ,IAAA,OAAO,SAAU,CAAA,KAAA,CAAA;AACrC,EAAO,OAAA,QAAA,CAAS,IAAM,EAAA,KAAA,EAAO,MAAM,CAAA;AAAG,IAAE,EAAA,MAAA,CAAA;AACxC,EAAA,OAAO,WAAY,CAAA,IAAA,EAAM,KAAO,EAAA,IAAA,EAAM,KAAK,MAAM,CAAA;AAAG,IAAE,EAAA,IAAA,CAAA;AACtD,EAAA,OAAO,WAAY,CAAA,IAAA,EAAM,KAAO,EAAA,KAAA,EAAO,KAAK,MAAM,CAAA;AAAG,IAAE,EAAA,KAAA,CAAA;AAEvD,EAAE,EAAA,KAAA,CAAA;AACF,EAAE,EAAA,MAAA,CAAA;AAEF,EAAO,OAAA,IAAI,SAAU,CAAA,IAAA,GAAO,UAAY,EAAA,GAAA,GAAM,UAAa,EAAA,CAAA,KAAA,GAAQ,IAAQ,IAAA,UAAA,EAAA,CAAa,MAAS,GAAA,GAAA,IAAO,UAAU,CAAA,CAAA;AACtH;;;;"}

17
node_modules/pixi.js/lib/utils/const.d.ts generated vendored Normal file
View File

@@ -0,0 +1,17 @@
import EventEmitter from 'eventemitter3';
/**
* Regexp for data URI.
* Based on: {@link https://github.com/ragingwind/data-uri-regex}
* @static
* @type {RegExp}
* @default /(?:^data:image\/([\w+]+);(?:[\w=]+|charset=[\w-]+)?(?:;base64)?,)/i
* @example
* import { DATA_URI } from 'pixi.js';
*
* DATA_URI.test('data:image/png;base64,foobar'); // => true
* @memberof utils
*/
export declare const DATA_URI: RegExp;
export { EventEmitter };
/** The current version of PixiJS. This is automatically replaced by the build process. */
export declare const VERSION = "$_VERSION";

12
node_modules/pixi.js/lib/utils/const.js generated vendored Normal file
View File

@@ -0,0 +1,12 @@
'use strict';
var EventEmitter = require('eventemitter3');
"use strict";
const DATA_URI = /^\s*data:(?:([\w-]+)\/([\w+.-]+))?(?:;charset=([\w-]+))?(?:;(base64))?,(.*)/i;
const VERSION = "8.4.1";
exports.EventEmitter = EventEmitter;
exports.DATA_URI = DATA_URI;
exports.VERSION = VERSION;
//# sourceMappingURL=const.js.map

1
node_modules/pixi.js/lib/utils/const.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"const.js","sources":["../../src/utils/const.ts"],"sourcesContent":["import EventEmitter from 'eventemitter3';\n\n/**\n * Regexp for data URI.\n * Based on: {@link https://github.com/ragingwind/data-uri-regex}\n * @static\n * @type {RegExp}\n * @default /(?:^data:image\\/([\\w+]+);(?:[\\w=]+|charset=[\\w-]+)?(?:;base64)?,)/i\n * @example\n * import { DATA_URI } from 'pixi.js';\n *\n * DATA_URI.test('data:image/png;base64,foobar'); // => true\n * @memberof utils\n */\nexport const DATA_URI = /^\\s*data:(?:([\\w-]+)\\/([\\w+.-]+))?(?:;charset=([\\w-]+))?(?:;(base64))?,(.*)/i;\n\n// export the event emitter so we can use it in external modules\nexport { EventEmitter };\n\n/** The current version of PixiJS. This is automatically replaced by the build process. */\nexport const VERSION = '$_VERSION';\n"],"names":[],"mappings":";;;;;AAcO,MAAM,QAAW,GAAA,+EAAA;AAMjB,MAAM,OAAU,GAAA;;;;;;"}

8
node_modules/pixi.js/lib/utils/const.mjs generated vendored Normal file
View File

@@ -0,0 +1,8 @@
export { default as EventEmitter } from 'eventemitter3';
"use strict";
const DATA_URI = /^\s*data:(?:([\w-]+)\/([\w+.-]+))?(?:;charset=([\w-]+))?(?:;(base64))?,(.*)/i;
const VERSION = "8.4.1";
export { DATA_URI, VERSION };
//# sourceMappingURL=const.mjs.map

1
node_modules/pixi.js/lib/utils/const.mjs.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"const.mjs","sources":["../../src/utils/const.ts"],"sourcesContent":["import EventEmitter from 'eventemitter3';\n\n/**\n * Regexp for data URI.\n * Based on: {@link https://github.com/ragingwind/data-uri-regex}\n * @static\n * @type {RegExp}\n * @default /(?:^data:image\\/([\\w+]+);(?:[\\w=]+|charset=[\\w-]+)?(?:;base64)?,)/i\n * @example\n * import { DATA_URI } from 'pixi.js';\n *\n * DATA_URI.test('data:image/png;base64,foobar'); // => true\n * @memberof utils\n */\nexport const DATA_URI = /^\\s*data:(?:([\\w-]+)\\/([\\w+.-]+))?(?:;charset=([\\w-]+))?(?:;(base64))?,(.*)/i;\n\n// export the event emitter so we can use it in external modules\nexport { EventEmitter };\n\n/** The current version of PixiJS. This is automatically replaced by the build process. */\nexport const VERSION = '$_VERSION';\n"],"names":[],"mappings":";;;AAcO,MAAM,QAAW,GAAA,+EAAA;AAMjB,MAAM,OAAU,GAAA;;;;"}

View File

@@ -0,0 +1,59 @@
type TypedArray = Float32Array | Uint32Array | Int32Array | Uint8Array;
/**
* Flexible wrapper around `ArrayBuffer` that also provides typed array views on demand.
* @memberof utils
*/
export declare class ViewableBuffer {
/** The size of the buffer in bytes. */
size: number;
/** Underlying `ArrayBuffer` that holds all the data and is of capacity `this.size`. */
rawBinaryData: ArrayBuffer;
/** View on the raw binary data as a `Uint32Array`. */
uint32View: Uint32Array;
/** View on the raw binary data as a `Float32Array`. */
float32View: Float32Array;
uint16View: Uint16Array;
private _int8View;
private _uint8View;
private _int16View;
private _int32View;
private _float64Array;
private _bigUint64Array;
/**
* @param length - The size of the buffer in bytes.
*/
constructor(length: number);
/**
* @param arrayBuffer - The source array buffer.
*/
constructor(arrayBuffer: ArrayBuffer);
/** View on the raw binary data as a `Int8Array`. */
get int8View(): Int8Array;
/** View on the raw binary data as a `Uint8Array`. */
get uint8View(): Uint8Array;
/** View on the raw binary data as a `Int16Array`. */
get int16View(): Int16Array;
/** View on the raw binary data as a `Int32Array`. */
get int32View(): Int32Array;
/** View on the raw binary data as a `Float64Array`. */
get float64View(): Float64Array;
/** View on the raw binary data as a `BigUint64Array`. */
get bigUint64View(): BigUint64Array;
/**
* Returns the view of the given type.
* @param type - One of `int8`, `uint8`, `int16`,
* `uint16`, `int32`, `uint32`, and `float32`.
* @returns - typed array of given type
*/
view(type: string): TypedArray;
/** Destroys all buffer references. Do not use after calling this. */
destroy(): void;
/**
* Returns the size of the given type in bytes.
* @param type - One of `int8`, `uint8`, `int16`,
* `uint16`, `int32`, `uint32`, and `float32`.
* @returns - size of the type in bytes
*/
static sizeOf(type: string): number;
}
export {};

104
node_modules/pixi.js/lib/utils/data/ViewableBuffer.js generated vendored Normal file
View File

@@ -0,0 +1,104 @@
'use strict';
"use strict";
class ViewableBuffer {
constructor(sizeOrBuffer) {
if (typeof sizeOrBuffer === "number") {
this.rawBinaryData = new ArrayBuffer(sizeOrBuffer);
} else if (sizeOrBuffer instanceof Uint8Array) {
this.rawBinaryData = sizeOrBuffer.buffer;
} else {
this.rawBinaryData = sizeOrBuffer;
}
this.uint32View = new Uint32Array(this.rawBinaryData);
this.float32View = new Float32Array(this.rawBinaryData);
this.size = this.rawBinaryData.byteLength;
}
/** View on the raw binary data as a `Int8Array`. */
get int8View() {
if (!this._int8View) {
this._int8View = new Int8Array(this.rawBinaryData);
}
return this._int8View;
}
/** View on the raw binary data as a `Uint8Array`. */
get uint8View() {
if (!this._uint8View) {
this._uint8View = new Uint8Array(this.rawBinaryData);
}
return this._uint8View;
}
/** View on the raw binary data as a `Int16Array`. */
get int16View() {
if (!this._int16View) {
this._int16View = new Int16Array(this.rawBinaryData);
}
return this._int16View;
}
/** View on the raw binary data as a `Int32Array`. */
get int32View() {
if (!this._int32View) {
this._int32View = new Int32Array(this.rawBinaryData);
}
return this._int32View;
}
/** View on the raw binary data as a `Float64Array`. */
get float64View() {
if (!this._float64Array) {
this._float64Array = new Float64Array(this.rawBinaryData);
}
return this._float64Array;
}
/** View on the raw binary data as a `BigUint64Array`. */
get bigUint64View() {
if (!this._bigUint64Array) {
this._bigUint64Array = new BigUint64Array(this.rawBinaryData);
}
return this._bigUint64Array;
}
/**
* Returns the view of the given type.
* @param type - One of `int8`, `uint8`, `int16`,
* `uint16`, `int32`, `uint32`, and `float32`.
* @returns - typed array of given type
*/
view(type) {
return this[`${type}View`];
}
/** Destroys all buffer references. Do not use after calling this. */
destroy() {
this.rawBinaryData = null;
this._int8View = null;
this._uint8View = null;
this._int16View = null;
this.uint16View = null;
this._int32View = null;
this.uint32View = null;
this.float32View = null;
}
/**
* Returns the size of the given type in bytes.
* @param type - One of `int8`, `uint8`, `int16`,
* `uint16`, `int32`, `uint32`, and `float32`.
* @returns - size of the type in bytes
*/
static sizeOf(type) {
switch (type) {
case "int8":
case "uint8":
return 1;
case "int16":
case "uint16":
return 2;
case "int32":
case "uint32":
case "float32":
return 4;
default:
throw new Error(`${type} isn't a valid view type`);
}
}
}
exports.ViewableBuffer = ViewableBuffer;
//# sourceMappingURL=ViewableBuffer.js.map

File diff suppressed because one or more lines are too long

102
node_modules/pixi.js/lib/utils/data/ViewableBuffer.mjs generated vendored Normal file
View File

@@ -0,0 +1,102 @@
"use strict";
class ViewableBuffer {
constructor(sizeOrBuffer) {
if (typeof sizeOrBuffer === "number") {
this.rawBinaryData = new ArrayBuffer(sizeOrBuffer);
} else if (sizeOrBuffer instanceof Uint8Array) {
this.rawBinaryData = sizeOrBuffer.buffer;
} else {
this.rawBinaryData = sizeOrBuffer;
}
this.uint32View = new Uint32Array(this.rawBinaryData);
this.float32View = new Float32Array(this.rawBinaryData);
this.size = this.rawBinaryData.byteLength;
}
/** View on the raw binary data as a `Int8Array`. */
get int8View() {
if (!this._int8View) {
this._int8View = new Int8Array(this.rawBinaryData);
}
return this._int8View;
}
/** View on the raw binary data as a `Uint8Array`. */
get uint8View() {
if (!this._uint8View) {
this._uint8View = new Uint8Array(this.rawBinaryData);
}
return this._uint8View;
}
/** View on the raw binary data as a `Int16Array`. */
get int16View() {
if (!this._int16View) {
this._int16View = new Int16Array(this.rawBinaryData);
}
return this._int16View;
}
/** View on the raw binary data as a `Int32Array`. */
get int32View() {
if (!this._int32View) {
this._int32View = new Int32Array(this.rawBinaryData);
}
return this._int32View;
}
/** View on the raw binary data as a `Float64Array`. */
get float64View() {
if (!this._float64Array) {
this._float64Array = new Float64Array(this.rawBinaryData);
}
return this._float64Array;
}
/** View on the raw binary data as a `BigUint64Array`. */
get bigUint64View() {
if (!this._bigUint64Array) {
this._bigUint64Array = new BigUint64Array(this.rawBinaryData);
}
return this._bigUint64Array;
}
/**
* Returns the view of the given type.
* @param type - One of `int8`, `uint8`, `int16`,
* `uint16`, `int32`, `uint32`, and `float32`.
* @returns - typed array of given type
*/
view(type) {
return this[`${type}View`];
}
/** Destroys all buffer references. Do not use after calling this. */
destroy() {
this.rawBinaryData = null;
this._int8View = null;
this._uint8View = null;
this._int16View = null;
this.uint16View = null;
this._int32View = null;
this.uint32View = null;
this.float32View = null;
}
/**
* Returns the size of the given type in bytes.
* @param type - One of `int8`, `uint8`, `int16`,
* `uint16`, `int32`, `uint32`, and `float32`.
* @returns - size of the type in bytes
*/
static sizeOf(type) {
switch (type) {
case "int8":
case "uint8":
return 1;
case "int16":
case "uint16":
return 2;
case "int32":
case "uint32":
case "float32":
return 4;
default:
throw new Error(`${type} isn't a valid view type`);
}
}
}
export { ViewableBuffer };
//# sourceMappingURL=ViewableBuffer.mjs.map

File diff suppressed because one or more lines are too long

9
node_modules/pixi.js/lib/utils/data/removeItems.d.ts generated vendored Normal file
View File

@@ -0,0 +1,9 @@
/**
* Remove items from a javascript array without generating garbage
* @function removeItems
* @memberof utils
* @param {Array<any>} arr - Array to remove elements from
* @param {number} startIdx - starting index
* @param {number} removeCount - how many to remove
*/
export declare function removeItems(arr: any[], startIdx: number, removeCount: number): void;

19
node_modules/pixi.js/lib/utils/data/removeItems.js generated vendored Normal file
View File

@@ -0,0 +1,19 @@
'use strict';
"use strict";
function removeItems(arr, startIdx, removeCount) {
const length = arr.length;
let i;
if (startIdx >= length || removeCount === 0) {
return;
}
removeCount = startIdx + removeCount > length ? length - startIdx : removeCount;
const len = length - removeCount;
for (i = startIdx; i < len; ++i) {
arr[i] = arr[i + removeCount];
}
arr.length = len;
}
exports.removeItems = removeItems;
//# sourceMappingURL=removeItems.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"removeItems.js","sources":["../../../src/utils/data/removeItems.ts"],"sourcesContent":["/**\n * Remove items from a javascript array without generating garbage\n * @function removeItems\n * @memberof utils\n * @param {Array<any>} arr - Array to remove elements from\n * @param {number} startIdx - starting index\n * @param {number} removeCount - how many to remove\n */\nexport function removeItems(arr: any[], startIdx: number, removeCount: number): void\n{\n const length = arr.length;\n let i;\n\n if (startIdx >= length || removeCount === 0)\n {\n return;\n }\n\n removeCount = (startIdx + removeCount > length ? length - startIdx : removeCount);\n\n const len = length - removeCount;\n\n for (i = startIdx; i < len; ++i)\n {\n arr[i] = arr[i + removeCount];\n }\n\n arr.length = len;\n}\n"],"names":[],"mappings":";;;AAQgB,SAAA,WAAA,CAAY,GAAY,EAAA,QAAA,EAAkB,WAC1D,EAAA;AACI,EAAA,MAAM,SAAS,GAAI,CAAA,MAAA,CAAA;AACnB,EAAI,IAAA,CAAA,CAAA;AAEJ,EAAI,IAAA,QAAA,IAAY,MAAU,IAAA,WAAA,KAAgB,CAC1C,EAAA;AACI,IAAA,OAAA;AAAA,GACJ;AAEA,EAAA,WAAA,GAAe,QAAW,GAAA,WAAA,GAAc,MAAS,GAAA,MAAA,GAAS,QAAW,GAAA,WAAA,CAAA;AAErE,EAAA,MAAM,MAAM,MAAS,GAAA,WAAA,CAAA;AAErB,EAAA,KAAK,CAAI,GAAA,QAAA,EAAU,CAAI,GAAA,GAAA,EAAK,EAAE,CAC9B,EAAA;AACI,IAAA,GAAA,CAAI,CAAC,CAAA,GAAI,GAAI,CAAA,CAAA,GAAI,WAAW,CAAA,CAAA;AAAA,GAChC;AAEA,EAAA,GAAA,CAAI,MAAS,GAAA,GAAA,CAAA;AACjB;;;;"}

17
node_modules/pixi.js/lib/utils/data/removeItems.mjs generated vendored Normal file
View File

@@ -0,0 +1,17 @@
"use strict";
function removeItems(arr, startIdx, removeCount) {
const length = arr.length;
let i;
if (startIdx >= length || removeCount === 0) {
return;
}
removeCount = startIdx + removeCount > length ? length - startIdx : removeCount;
const len = length - removeCount;
for (i = startIdx; i < len; ++i) {
arr[i] = arr[i + removeCount];
}
arr.length = len;
}
export { removeItems };
//# sourceMappingURL=removeItems.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"removeItems.mjs","sources":["../../../src/utils/data/removeItems.ts"],"sourcesContent":["/**\n * Remove items from a javascript array without generating garbage\n * @function removeItems\n * @memberof utils\n * @param {Array<any>} arr - Array to remove elements from\n * @param {number} startIdx - starting index\n * @param {number} removeCount - how many to remove\n */\nexport function removeItems(arr: any[], startIdx: number, removeCount: number): void\n{\n const length = arr.length;\n let i;\n\n if (startIdx >= length || removeCount === 0)\n {\n return;\n }\n\n removeCount = (startIdx + removeCount > length ? length - startIdx : removeCount);\n\n const len = length - removeCount;\n\n for (i = startIdx; i < len; ++i)\n {\n arr[i] = arr[i + removeCount];\n }\n\n arr.length = len;\n}\n"],"names":[],"mappings":";AAQgB,SAAA,WAAA,CAAY,GAAY,EAAA,QAAA,EAAkB,WAC1D,EAAA;AACI,EAAA,MAAM,SAAS,GAAI,CAAA,MAAA,CAAA;AACnB,EAAI,IAAA,CAAA,CAAA;AAEJ,EAAI,IAAA,QAAA,IAAY,MAAU,IAAA,WAAA,KAAgB,CAC1C,EAAA;AACI,IAAA,OAAA;AAAA,GACJ;AAEA,EAAA,WAAA,GAAe,QAAW,GAAA,WAAA,GAAc,MAAS,GAAA,MAAA,GAAS,QAAW,GAAA,WAAA,CAAA;AAErE,EAAA,MAAM,MAAM,MAAS,GAAA,WAAA,CAAA;AAErB,EAAA,KAAK,CAAI,GAAA,QAAA,EAAU,CAAI,GAAA,GAAA,EAAK,EAAE,CAC9B,EAAA;AACI,IAAA,GAAA,CAAI,CAAC,CAAA,GAAI,GAAI,CAAA,CAAA,GAAI,WAAW,CAAA,CAAA;AAAA,GAChC;AAEA,EAAA,GAAA,CAAI,MAAS,GAAA,GAAA,CAAA;AACjB;;;;"}

12
node_modules/pixi.js/lib/utils/data/uid.d.ts generated vendored Normal file
View File

@@ -0,0 +1,12 @@
type UIDNames = 'default' | 'resource' | 'texture' | 'textureSource' | 'textureResource' | 'batcher' | 'graphicsContext' | 'graphicsView' | 'graphicsPath' | 'fillGradient' | 'fillPattern' | 'meshView' | 'renderable' | 'buffer' | 'bufferResource' | 'geometry' | 'instructionSet' | 'renderTarget' | 'uniform' | 'spriteView' | 'textView' | 'tilingSpriteView';
/**
* Gets the next unique identifier
* @param name - The name of the identifier.
* @function uid
* @returns {number} The next unique identifier to use.
* @memberof utils
*/
export declare function uid(name?: UIDNames): number;
/** Resets the next unique identifier to 0. This is used for some tests, dont touch or things WILL explode :) */
export declare function resetUids(): void;
export {};

21
node_modules/pixi.js/lib/utils/data/uid.js generated vendored Normal file
View File

@@ -0,0 +1,21 @@
'use strict';
"use strict";
const uidCache = {
default: -1
};
function uid(name = "default") {
if (uidCache[name] === void 0) {
uidCache[name] = -1;
}
return ++uidCache[name];
}
function resetUids() {
for (const key in uidCache) {
delete uidCache[key];
}
}
exports.resetUids = resetUids;
exports.uid = uid;
//# sourceMappingURL=uid.js.map

1
node_modules/pixi.js/lib/utils/data/uid.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"uid.js","sources":["../../../src/utils/data/uid.ts"],"sourcesContent":["const uidCache: Record<string, number> = {\n default: -1,\n};\n\ntype UIDNames =\n | 'default'\n | 'resource'\n | 'texture'\n | 'textureSource'\n | 'textureResource'\n | 'batcher' //\n | 'graphicsContext' //\n | 'graphicsView' //\n | 'graphicsPath' //\n | 'fillGradient' //\n | 'fillPattern' //\n | 'meshView' //\n | 'renderable' //\n | 'buffer' //\n | 'bufferResource' //\n | 'geometry'\n | 'instructionSet' //\n | 'renderTarget' //\n | 'uniform' //\n | 'spriteView' //\n | 'textView' //\n | 'tilingSpriteView'; // ;\n\n/**\n * Gets the next unique identifier\n * @param name - The name of the identifier.\n * @function uid\n * @returns {number} The next unique identifier to use.\n * @memberof utils\n */\nexport function uid(name: UIDNames = 'default'): number\n{\n if (uidCache[name] === undefined)\n {\n uidCache[name] = -1;\n }\n\n return ++uidCache[name];\n}\n\n/** Resets the next unique identifier to 0. This is used for some tests, dont touch or things WILL explode :) */\nexport function resetUids(): void\n{\n for (const key in uidCache)\n {\n delete uidCache[key];\n }\n}\n"],"names":[],"mappings":";;;AAAA,MAAM,QAAmC,GAAA;AAAA,EACrC,OAAS,EAAA,CAAA,CAAA;AACb,CAAA,CAAA;AAiCgB,SAAA,GAAA,CAAI,OAAiB,SACrC,EAAA;AACI,EAAI,IAAA,QAAA,CAAS,IAAI,CAAA,KAAM,KACvB,CAAA,EAAA;AACI,IAAA,QAAA,CAAS,IAAI,CAAI,GAAA,CAAA,CAAA,CAAA;AAAA,GACrB;AAEA,EAAO,OAAA,EAAE,SAAS,IAAI,CAAA,CAAA;AAC1B,CAAA;AAGO,SAAS,SAChB,GAAA;AACI,EAAA,KAAA,MAAW,OAAO,QAClB,EAAA;AACI,IAAA,OAAO,SAAS,GAAG,CAAA,CAAA;AAAA,GACvB;AACJ;;;;;"}

18
node_modules/pixi.js/lib/utils/data/uid.mjs generated vendored Normal file
View File

@@ -0,0 +1,18 @@
"use strict";
const uidCache = {
default: -1
};
function uid(name = "default") {
if (uidCache[name] === void 0) {
uidCache[name] = -1;
}
return ++uidCache[name];
}
function resetUids() {
for (const key in uidCache) {
delete uidCache[key];
}
}
export { resetUids, uid };
//# sourceMappingURL=uid.mjs.map

1
node_modules/pixi.js/lib/utils/data/uid.mjs.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"uid.mjs","sources":["../../../src/utils/data/uid.ts"],"sourcesContent":["const uidCache: Record<string, number> = {\n default: -1,\n};\n\ntype UIDNames =\n | 'default'\n | 'resource'\n | 'texture'\n | 'textureSource'\n | 'textureResource'\n | 'batcher' //\n | 'graphicsContext' //\n | 'graphicsView' //\n | 'graphicsPath' //\n | 'fillGradient' //\n | 'fillPattern' //\n | 'meshView' //\n | 'renderable' //\n | 'buffer' //\n | 'bufferResource' //\n | 'geometry'\n | 'instructionSet' //\n | 'renderTarget' //\n | 'uniform' //\n | 'spriteView' //\n | 'textView' //\n | 'tilingSpriteView'; // ;\n\n/**\n * Gets the next unique identifier\n * @param name - The name of the identifier.\n * @function uid\n * @returns {number} The next unique identifier to use.\n * @memberof utils\n */\nexport function uid(name: UIDNames = 'default'): number\n{\n if (uidCache[name] === undefined)\n {\n uidCache[name] = -1;\n }\n\n return ++uidCache[name];\n}\n\n/** Resets the next unique identifier to 0. This is used for some tests, dont touch or things WILL explode :) */\nexport function resetUids(): void\n{\n for (const key in uidCache)\n {\n delete uidCache[key];\n }\n}\n"],"names":[],"mappings":";AAAA,MAAM,QAAmC,GAAA;AAAA,EACrC,OAAS,EAAA,CAAA,CAAA;AACb,CAAA,CAAA;AAiCgB,SAAA,GAAA,CAAI,OAAiB,SACrC,EAAA;AACI,EAAI,IAAA,QAAA,CAAS,IAAI,CAAA,KAAM,KACvB,CAAA,EAAA;AACI,IAAA,QAAA,CAAS,IAAI,CAAI,GAAA,CAAA,CAAA,CAAA;AAAA,GACrB;AAEA,EAAO,OAAA,EAAE,SAAS,IAAI,CAAA,CAAA;AAC1B,CAAA;AAGO,SAAS,SAChB,GAAA;AACI,EAAA,KAAA,MAAW,OAAO,QAClB,EAAA;AACI,IAAA,OAAO,SAAS,GAAG,CAAA,CAAA;AAAA,GACvB;AACJ;;;;"}

View File

@@ -0,0 +1,4 @@
import type { ObservablePoint } from '../../maths/point/ObservablePoint';
import type { Texture } from '../../rendering/renderers/shared/texture/Texture';
import type { BoundsData } from '../../scene/container/bounds/Bounds';
export declare function updateQuadBounds(bounds: BoundsData, anchor: ObservablePoint, texture: Texture, padding: number): void;

View File

@@ -0,0 +1,24 @@
'use strict';
"use strict";
function updateQuadBounds(bounds, anchor, texture, padding) {
const { width, height } = texture.orig;
const trim = texture.trim;
if (trim) {
const sourceWidth = trim.width;
const sourceHeight = trim.height;
bounds.minX = trim.x - anchor._x * width - padding;
bounds.maxX = bounds.minX + sourceWidth;
bounds.minY = trim.y - anchor._y * height - padding;
bounds.maxY = bounds.minY + sourceHeight;
} else {
bounds.minX = -anchor._x * width - padding;
bounds.maxX = bounds.minX + width;
bounds.minY = -anchor._y * height - padding;
bounds.maxY = bounds.minY + height;
}
return;
}
exports.updateQuadBounds = updateQuadBounds;
//# sourceMappingURL=updateQuadBounds.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"updateQuadBounds.js","sources":["../../../src/utils/data/updateQuadBounds.ts"],"sourcesContent":["import type { ObservablePoint } from '../../maths/point/ObservablePoint';\nimport type { Texture } from '../../rendering/renderers/shared/texture/Texture';\nimport type { BoundsData } from '../../scene/container/bounds/Bounds';\n\nexport function updateQuadBounds(\n bounds: BoundsData,\n anchor: ObservablePoint,\n texture: Texture,\n padding: number\n)\n{\n const { width, height } = texture.orig;\n const trim = texture.trim;\n\n if (trim)\n {\n const sourceWidth = trim.width;\n const sourceHeight = trim.height;\n\n bounds.minX = (trim.x) - (anchor._x * width) - padding;\n bounds.maxX = bounds.minX + sourceWidth;\n\n bounds.minY = (trim.y) - (anchor._y * height) - padding;\n bounds.maxY = bounds.minY + sourceHeight;\n }\n\n else\n {\n bounds.minX = (-anchor._x * width) - padding;\n bounds.maxX = bounds.minX + width;\n\n bounds.minY = (-anchor._y * height) - padding;\n bounds.maxY = bounds.minY + height;\n }\n\n return;\n}\n"],"names":[],"mappings":";;;AAIO,SAAS,gBACZ,CAAA,MAAA,EACA,MACA,EAAA,OAAA,EACA,OAEJ,EAAA;AACI,EAAA,MAAM,EAAE,KAAA,EAAO,MAAO,EAAA,GAAI,OAAQ,CAAA,IAAA,CAAA;AAClC,EAAA,MAAM,OAAO,OAAQ,CAAA,IAAA,CAAA;AAErB,EAAA,IAAI,IACJ,EAAA;AACI,IAAA,MAAM,cAAc,IAAK,CAAA,KAAA,CAAA;AACzB,IAAA,MAAM,eAAe,IAAK,CAAA,MAAA,CAAA;AAE1B,IAAA,MAAA,CAAO,IAAQ,GAAA,IAAA,CAAK,CAAM,GAAA,MAAA,CAAO,KAAK,KAAS,GAAA,OAAA,CAAA;AAC/C,IAAO,MAAA,CAAA,IAAA,GAAO,OAAO,IAAO,GAAA,WAAA,CAAA;AAE5B,IAAA,MAAA,CAAO,IAAQ,GAAA,IAAA,CAAK,CAAM,GAAA,MAAA,CAAO,KAAK,MAAU,GAAA,OAAA,CAAA;AAChD,IAAO,MAAA,CAAA,IAAA,GAAO,OAAO,IAAO,GAAA,YAAA,CAAA;AAAA,GAIhC,MAAA;AACI,IAAA,MAAA,CAAO,IAAQ,GAAA,CAAC,MAAO,CAAA,EAAA,GAAK,KAAS,GAAA,OAAA,CAAA;AACrC,IAAO,MAAA,CAAA,IAAA,GAAO,OAAO,IAAO,GAAA,KAAA,CAAA;AAE5B,IAAA,MAAA,CAAO,IAAQ,GAAA,CAAC,MAAO,CAAA,EAAA,GAAK,MAAU,GAAA,OAAA,CAAA;AACtC,IAAO,MAAA,CAAA,IAAA,GAAO,OAAO,IAAO,GAAA,MAAA,CAAA;AAAA,GAChC;AAEA,EAAA,OAAA;AACJ;;;;"}

View File

@@ -0,0 +1,22 @@
"use strict";
function updateQuadBounds(bounds, anchor, texture, padding) {
const { width, height } = texture.orig;
const trim = texture.trim;
if (trim) {
const sourceWidth = trim.width;
const sourceHeight = trim.height;
bounds.minX = trim.x - anchor._x * width - padding;
bounds.maxX = bounds.minX + sourceWidth;
bounds.minY = trim.y - anchor._y * height - padding;
bounds.maxY = bounds.minY + sourceHeight;
} else {
bounds.minX = -anchor._x * width - padding;
bounds.maxX = bounds.minX + width;
bounds.minY = -anchor._y * height - padding;
bounds.maxY = bounds.minY + height;
}
return;
}
export { updateQuadBounds };
//# sourceMappingURL=updateQuadBounds.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"updateQuadBounds.mjs","sources":["../../../src/utils/data/updateQuadBounds.ts"],"sourcesContent":["import type { ObservablePoint } from '../../maths/point/ObservablePoint';\nimport type { Texture } from '../../rendering/renderers/shared/texture/Texture';\nimport type { BoundsData } from '../../scene/container/bounds/Bounds';\n\nexport function updateQuadBounds(\n bounds: BoundsData,\n anchor: ObservablePoint,\n texture: Texture,\n padding: number\n)\n{\n const { width, height } = texture.orig;\n const trim = texture.trim;\n\n if (trim)\n {\n const sourceWidth = trim.width;\n const sourceHeight = trim.height;\n\n bounds.minX = (trim.x) - (anchor._x * width) - padding;\n bounds.maxX = bounds.minX + sourceWidth;\n\n bounds.minY = (trim.y) - (anchor._y * height) - padding;\n bounds.maxY = bounds.minY + sourceHeight;\n }\n\n else\n {\n bounds.minX = (-anchor._x * width) - padding;\n bounds.maxX = bounds.minX + width;\n\n bounds.minY = (-anchor._y * height) - padding;\n bounds.maxY = bounds.minY + height;\n }\n\n return;\n}\n"],"names":[],"mappings":";AAIO,SAAS,gBACZ,CAAA,MAAA,EACA,MACA,EAAA,OAAA,EACA,OAEJ,EAAA;AACI,EAAA,MAAM,EAAE,KAAA,EAAO,MAAO,EAAA,GAAI,OAAQ,CAAA,IAAA,CAAA;AAClC,EAAA,MAAM,OAAO,OAAQ,CAAA,IAAA,CAAA;AAErB,EAAA,IAAI,IACJ,EAAA;AACI,IAAA,MAAM,cAAc,IAAK,CAAA,KAAA,CAAA;AACzB,IAAA,MAAM,eAAe,IAAK,CAAA,MAAA,CAAA;AAE1B,IAAA,MAAA,CAAO,IAAQ,GAAA,IAAA,CAAK,CAAM,GAAA,MAAA,CAAO,KAAK,KAAS,GAAA,OAAA,CAAA;AAC/C,IAAO,MAAA,CAAA,IAAA,GAAO,OAAO,IAAO,GAAA,WAAA,CAAA;AAE5B,IAAA,MAAA,CAAO,IAAQ,GAAA,IAAA,CAAK,CAAM,GAAA,MAAA,CAAO,KAAK,MAAU,GAAA,OAAA,CAAA;AAChD,IAAO,MAAA,CAAA,IAAA,GAAO,OAAO,IAAO,GAAA,YAAA,CAAA;AAAA,GAIhC,MAAA;AACI,IAAA,MAAA,CAAO,IAAQ,GAAA,CAAC,MAAO,CAAA,EAAA,GAAK,KAAS,GAAA,OAAA,CAAA;AACrC,IAAO,MAAA,CAAA,IAAA,GAAO,OAAO,IAAO,GAAA,KAAA,CAAA;AAE5B,IAAA,MAAA,CAAO,IAAQ,GAAA,CAAC,MAAO,CAAA,EAAA,GAAK,MAAU,GAAA,OAAA,CAAA;AACtC,IAAO,MAAA,CAAA,IAAA,GAAO,OAAO,IAAO,GAAA,MAAA,CAAA;AAAA,GAChC;AAEA,EAAA,OAAA;AACJ;;;;"}

34
node_modules/pixi.js/lib/utils/global/globalHooks.d.ts generated vendored Normal file
View File

@@ -0,0 +1,34 @@
import { type ExtensionMetadata, ExtensionType } from '../../extensions/Extensions';
import type { Application } from '../../app/Application';
import type { System } from '../../rendering/renderers/shared/system/System';
import type { Renderer } from '../../rendering/renderers/types';
declare global {
var __PIXI_APP_INIT__: undefined | ((arg: Application | Renderer, version: string) => void);
var __PIXI_RENDERER_INIT__: undefined | ((arg: Application | Renderer, version: string) => void);
}
/**
* Calls global __PIXI_APP_INIT__ hook with the application instance, after the application is initialized.
* @memberof app
*/
export declare class ApplicationInitHook {
/** @ignore */
static extension: ExtensionMetadata;
static init(): void;
static destroy(): void;
}
/**
* Calls global __PIXI_RENDERER_INIT__ hook with the renderer instance, after the renderer is initialized.
* @memberof rendering
*/
export declare class RendererInitHook implements System {
/** @ignore */
static extension: {
readonly type: readonly [ExtensionType.WebGLSystem, ExtensionType.WebGPUSystem];
readonly name: "initHook";
readonly priority: -10;
};
private _renderer;
constructor(renderer: Renderer);
init(): void;
destroy(): void;
}

39
node_modules/pixi.js/lib/utils/global/globalHooks.js generated vendored Normal file
View File

@@ -0,0 +1,39 @@
'use strict';
var Extensions = require('../../extensions/Extensions.js');
var _const = require('../const.js');
"use strict";
class ApplicationInitHook {
static init() {
globalThis.__PIXI_APP_INIT__?.(this, _const.VERSION);
}
static destroy() {
}
}
/** @ignore */
ApplicationInitHook.extension = Extensions.ExtensionType.Application;
class RendererInitHook {
constructor(renderer) {
this._renderer = renderer;
}
init() {
globalThis.__PIXI_RENDERER_INIT__?.(this._renderer, _const.VERSION);
}
destroy() {
this._renderer = null;
}
}
/** @ignore */
RendererInitHook.extension = {
type: [
Extensions.ExtensionType.WebGLSystem,
Extensions.ExtensionType.WebGPUSystem
],
name: "initHook",
priority: -10
};
exports.ApplicationInitHook = ApplicationInitHook;
exports.RendererInitHook = RendererInitHook;
//# sourceMappingURL=globalHooks.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"globalHooks.js","sources":["../../../src/utils/global/globalHooks.ts"],"sourcesContent":["import { type ExtensionMetadata, ExtensionType } from '../../extensions/Extensions';\nimport { VERSION } from '../const';\n\nimport type { Application } from '../../app/Application';\nimport type { System } from '../../rendering/renderers/shared/system/System';\nimport type { Renderer } from '../../rendering/renderers/types';\n\ndeclare global\n{\n /* eslint-disable no-var */\n var __PIXI_APP_INIT__: undefined | ((arg: Application | Renderer, version: string) => void);\n var __PIXI_RENDERER_INIT__: undefined | ((arg: Application | Renderer, version: string) => void);\n /* eslint-enable no-var */\n}\n\n/**\n * Calls global __PIXI_APP_INIT__ hook with the application instance, after the application is initialized.\n * @memberof app\n */\nexport class ApplicationInitHook\n{\n /** @ignore */\n public static extension: ExtensionMetadata = ExtensionType.Application;\n public static init(): void\n {\n globalThis.__PIXI_APP_INIT__?.(this as unknown as Application, VERSION);\n }\n public static destroy(): void\n {\n // nothing to do\n }\n}\n\n/**\n * Calls global __PIXI_RENDERER_INIT__ hook with the renderer instance, after the renderer is initialized.\n * @memberof rendering\n */\nexport class RendererInitHook implements System\n{\n /** @ignore */\n public static extension = {\n type: [\n ExtensionType.WebGLSystem,\n ExtensionType.WebGPUSystem,\n ],\n name: 'initHook',\n priority: -10,\n } as const;\n\n private _renderer: Renderer;\n\n constructor(renderer: Renderer)\n {\n this._renderer = renderer;\n }\n public init(): void\n {\n globalThis.__PIXI_RENDERER_INIT__?.(this._renderer, VERSION);\n }\n public destroy(): void\n {\n this._renderer = null;\n }\n}\n"],"names":["VERSION","ExtensionType"],"mappings":";;;;;;AAmBO,MAAM,mBACb,CAAA;AAAA,EAGI,OAAc,IACd,GAAA;AACI,IAAW,UAAA,CAAA,iBAAA,GAAoB,MAAgCA,cAAO,CAAA,CAAA;AAAA,GAC1E;AAAA,EACA,OAAc,OACd,GAAA;AAAA,GAEA;AACJ,CAAA;AAAA;AAZa,mBAAA,CAGK,YAA+BC,wBAAc,CAAA,WAAA,CAAA;AAexD,MAAM,gBACb,CAAA;AAAA,EAaI,YAAY,QACZ,EAAA;AACI,IAAA,IAAA,CAAK,SAAY,GAAA,QAAA,CAAA;AAAA,GACrB;AAAA,EACO,IACP,GAAA;AACI,IAAW,UAAA,CAAA,sBAAA,GAAyB,IAAK,CAAA,SAAA,EAAWD,cAAO,CAAA,CAAA;AAAA,GAC/D;AAAA,EACO,OACP,GAAA;AACI,IAAA,IAAA,CAAK,SAAY,GAAA,IAAA,CAAA;AAAA,GACrB;AACJ,CAAA;AAAA;AA1Ba,gBAAA,CAGK,SAAY,GAAA;AAAA,EACtB,IAAM,EAAA;AAAA,IACFC,wBAAc,CAAA,WAAA;AAAA,IACdA,wBAAc,CAAA,YAAA;AAAA,GAClB;AAAA,EACA,IAAM,EAAA,UAAA;AAAA,EACN,QAAU,EAAA,CAAA,EAAA;AACd,CAAA;;;;;"}

36
node_modules/pixi.js/lib/utils/global/globalHooks.mjs generated vendored Normal file
View File

@@ -0,0 +1,36 @@
import { ExtensionType } from '../../extensions/Extensions.mjs';
import { VERSION } from '../const.mjs';
"use strict";
class ApplicationInitHook {
static init() {
globalThis.__PIXI_APP_INIT__?.(this, VERSION);
}
static destroy() {
}
}
/** @ignore */
ApplicationInitHook.extension = ExtensionType.Application;
class RendererInitHook {
constructor(renderer) {
this._renderer = renderer;
}
init() {
globalThis.__PIXI_RENDERER_INIT__?.(this._renderer, VERSION);
}
destroy() {
this._renderer = null;
}
}
/** @ignore */
RendererInitHook.extension = {
type: [
ExtensionType.WebGLSystem,
ExtensionType.WebGPUSystem
],
name: "initHook",
priority: -10
};
export { ApplicationInitHook, RendererInitHook };
//# sourceMappingURL=globalHooks.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"globalHooks.mjs","sources":["../../../src/utils/global/globalHooks.ts"],"sourcesContent":["import { type ExtensionMetadata, ExtensionType } from '../../extensions/Extensions';\nimport { VERSION } from '../const';\n\nimport type { Application } from '../../app/Application';\nimport type { System } from '../../rendering/renderers/shared/system/System';\nimport type { Renderer } from '../../rendering/renderers/types';\n\ndeclare global\n{\n /* eslint-disable no-var */\n var __PIXI_APP_INIT__: undefined | ((arg: Application | Renderer, version: string) => void);\n var __PIXI_RENDERER_INIT__: undefined | ((arg: Application | Renderer, version: string) => void);\n /* eslint-enable no-var */\n}\n\n/**\n * Calls global __PIXI_APP_INIT__ hook with the application instance, after the application is initialized.\n * @memberof app\n */\nexport class ApplicationInitHook\n{\n /** @ignore */\n public static extension: ExtensionMetadata = ExtensionType.Application;\n public static init(): void\n {\n globalThis.__PIXI_APP_INIT__?.(this as unknown as Application, VERSION);\n }\n public static destroy(): void\n {\n // nothing to do\n }\n}\n\n/**\n * Calls global __PIXI_RENDERER_INIT__ hook with the renderer instance, after the renderer is initialized.\n * @memberof rendering\n */\nexport class RendererInitHook implements System\n{\n /** @ignore */\n public static extension = {\n type: [\n ExtensionType.WebGLSystem,\n ExtensionType.WebGPUSystem,\n ],\n name: 'initHook',\n priority: -10,\n } as const;\n\n private _renderer: Renderer;\n\n constructor(renderer: Renderer)\n {\n this._renderer = renderer;\n }\n public init(): void\n {\n globalThis.__PIXI_RENDERER_INIT__?.(this._renderer, VERSION);\n }\n public destroy(): void\n {\n this._renderer = null;\n }\n}\n"],"names":[],"mappings":";;;;AAmBO,MAAM,mBACb,CAAA;AAAA,EAGI,OAAc,IACd,GAAA;AACI,IAAW,UAAA,CAAA,iBAAA,GAAoB,MAAgC,OAAO,CAAA,CAAA;AAAA,GAC1E;AAAA,EACA,OAAc,OACd,GAAA;AAAA,GAEA;AACJ,CAAA;AAAA;AAZa,mBAAA,CAGK,YAA+B,aAAc,CAAA,WAAA,CAAA;AAexD,MAAM,gBACb,CAAA;AAAA,EAaI,YAAY,QACZ,EAAA;AACI,IAAA,IAAA,CAAK,SAAY,GAAA,QAAA,CAAA;AAAA,GACrB;AAAA,EACO,IACP,GAAA;AACI,IAAW,UAAA,CAAA,sBAAA,GAAyB,IAAK,CAAA,SAAA,EAAW,OAAO,CAAA,CAAA;AAAA,GAC/D;AAAA,EACO,OACP,GAAA;AACI,IAAA,IAAA,CAAK,SAAY,GAAA,IAAA,CAAA;AAAA,GACrB;AACJ,CAAA;AAAA;AA1Ba,gBAAA,CAGK,SAAY,GAAA;AAAA,EACtB,IAAM,EAAA;AAAA,IACF,aAAc,CAAA,WAAA;AAAA,IACd,aAAc,CAAA,YAAA;AAAA,GAClB;AAAA,EACA,IAAM,EAAA,UAAA;AAAA,EACN,QAAU,EAAA,CAAA,EAAA;AACd,CAAA;;;;"}

26
node_modules/pixi.js/lib/utils/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,26 @@
export * from './browser/detectVideoAlphaMode';
export * from './browser/isMobile';
export * from './browser/isSafari';
export * from './browser/isWebGLSupported';
export * from './browser/isWebGPUSupported';
export * from './browser/unsafeEvalSupported';
export * from './canvas/getCanvasBoundingBox';
export * from './const';
export * from './data/removeItems';
export * from './data/uid';
export * from './data/updateQuadBounds';
export * from './data/ViewableBuffer';
export * from './global/globalHooks';
export * from './logging/deprecation';
export * from './logging/logDebugTexture';
export * from './logging/logScene';
export * from './logging/warn';
export * from './misc/NOOP';
export * from './misc/Transform';
export * from './network/getResolutionOfUrl';
export * from './path';
export * from './pool/Pool';
export * from './pool/PoolGroup';
export * from './sayHello';
export * from './types';
export * from './utils';

63
node_modules/pixi.js/lib/utils/index.js generated vendored Normal file
View File

@@ -0,0 +1,63 @@
'use strict';
var detectVideoAlphaMode = require('./browser/detectVideoAlphaMode.js');
var isMobile = require('./browser/isMobile.js');
var isSafari = require('./browser/isSafari.js');
var isWebGLSupported = require('./browser/isWebGLSupported.js');
var isWebGPUSupported = require('./browser/isWebGPUSupported.js');
var unsafeEvalSupported = require('./browser/unsafeEvalSupported.js');
var getCanvasBoundingBox = require('./canvas/getCanvasBoundingBox.js');
var _const = require('./const.js');
var removeItems = require('./data/removeItems.js');
var uid = require('./data/uid.js');
var updateQuadBounds = require('./data/updateQuadBounds.js');
var ViewableBuffer = require('./data/ViewableBuffer.js');
var globalHooks = require('./global/globalHooks.js');
var deprecation = require('./logging/deprecation.js');
var logDebugTexture = require('./logging/logDebugTexture.js');
var logScene = require('./logging/logScene.js');
var warn = require('./logging/warn.js');
var NOOP = require('./misc/NOOP.js');
var Transform = require('./misc/Transform.js');
var getResolutionOfUrl = require('./network/getResolutionOfUrl.js');
var path = require('./path.js');
var Pool = require('./pool/Pool.js');
var PoolGroup = require('./pool/PoolGroup.js');
var sayHello = require('./sayHello.js');
require('./types.js');
require('./utils.js');
"use strict";
exports.detectVideoAlphaMode = detectVideoAlphaMode.detectVideoAlphaMode;
exports.isMobile = isMobile.isMobile;
exports.isSafari = isSafari.isSafari;
exports.isWebGLSupported = isWebGLSupported.isWebGLSupported;
exports.isWebGPUSupported = isWebGPUSupported.isWebGPUSupported;
exports.unsafeEvalSupported = unsafeEvalSupported.unsafeEvalSupported;
exports.getCanvasBoundingBox = getCanvasBoundingBox.getCanvasBoundingBox;
exports.DATA_URI = _const.DATA_URI;
exports.VERSION = _const.VERSION;
exports.removeItems = removeItems.removeItems;
exports.resetUids = uid.resetUids;
exports.uid = uid.uid;
exports.updateQuadBounds = updateQuadBounds.updateQuadBounds;
exports.ViewableBuffer = ViewableBuffer.ViewableBuffer;
exports.ApplicationInitHook = globalHooks.ApplicationInitHook;
exports.RendererInitHook = globalHooks.RendererInitHook;
exports.deprecation = deprecation.deprecation;
exports.v8_0_0 = deprecation.v8_0_0;
exports.v8_3_4 = deprecation.v8_3_4;
exports.logDebugTexture = logDebugTexture.logDebugTexture;
exports.logRenderGroupScene = logScene.logRenderGroupScene;
exports.logScene = logScene.logScene;
exports.warn = warn.warn;
exports.NOOP = NOOP.NOOP;
exports.Transform = Transform.Transform;
exports.getResolutionOfUrl = getResolutionOfUrl.getResolutionOfUrl;
exports.path = path.path;
exports.Pool = Pool.Pool;
exports.BigPool = PoolGroup.BigPool;
exports.PoolGroupClass = PoolGroup.PoolGroupClass;
exports.sayHello = sayHello.sayHello;
//# sourceMappingURL=index.js.map

1
node_modules/pixi.js/lib/utils/index.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}

29
node_modules/pixi.js/lib/utils/index.mjs generated vendored Normal file
View File

@@ -0,0 +1,29 @@
export { detectVideoAlphaMode } from './browser/detectVideoAlphaMode.mjs';
export { isMobile } from './browser/isMobile.mjs';
export { isSafari } from './browser/isSafari.mjs';
export { isWebGLSupported } from './browser/isWebGLSupported.mjs';
export { isWebGPUSupported } from './browser/isWebGPUSupported.mjs';
export { unsafeEvalSupported } from './browser/unsafeEvalSupported.mjs';
export { getCanvasBoundingBox } from './canvas/getCanvasBoundingBox.mjs';
export { DATA_URI, VERSION } from './const.mjs';
export { removeItems } from './data/removeItems.mjs';
export { resetUids, uid } from './data/uid.mjs';
export { updateQuadBounds } from './data/updateQuadBounds.mjs';
export { ViewableBuffer } from './data/ViewableBuffer.mjs';
export { ApplicationInitHook, RendererInitHook } from './global/globalHooks.mjs';
export { deprecation, v8_0_0, v8_3_4 } from './logging/deprecation.mjs';
export { logDebugTexture } from './logging/logDebugTexture.mjs';
export { logRenderGroupScene, logScene } from './logging/logScene.mjs';
export { warn } from './logging/warn.mjs';
export { NOOP } from './misc/NOOP.mjs';
export { Transform } from './misc/Transform.mjs';
export { getResolutionOfUrl } from './network/getResolutionOfUrl.mjs';
export { path } from './path.mjs';
export { Pool } from './pool/Pool.mjs';
export { BigPool, PoolGroupClass } from './pool/PoolGroup.mjs';
export { sayHello } from './sayHello.mjs';
import './types.mjs';
import './utils.mjs';
"use strict";
//# sourceMappingURL=index.mjs.map

1
node_modules/pixi.js/lib/utils/index.mjs.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;"}

View File

@@ -0,0 +1,19 @@
/**
* deprecation name for version 8.0.0
* @ignore
*/
export declare const v8_0_0 = "8.0.0";
export declare const v8_3_4 = "8.3.4";
/**
* Helper for warning developers about deprecated features & settings.
* A stack track for warnings is given; useful for tracking-down where
* deprecated methods/properties/classes are being used within the code.
* @memberof utils
* @ignore
* @function deprecation
* @param {string} version - The version where the feature became deprecated
* @param {string} message - Message should include what is deprecated, where, and the new solution
* @param {number} [ignoreDepth=3] - The number of steps to ignore at the top of the error stack
* this is mostly to ignore internal deprecation calls.
*/
export declare function deprecation(version: string, message: string, ignoreDepth?: number): void;

39
node_modules/pixi.js/lib/utils/logging/deprecation.js generated vendored Normal file
View File

@@ -0,0 +1,39 @@
'use strict';
"use strict";
const warnings = {};
const v8_0_0 = "8.0.0";
const v8_3_4 = "8.3.4";
function deprecation(version, message, ignoreDepth = 3) {
if (warnings[message]) {
return;
}
let stack = new Error().stack;
if (typeof stack === "undefined") {
console.warn("PixiJS Deprecation Warning: ", `${message}
Deprecated since v${version}`);
} else {
stack = stack.split("\n").splice(ignoreDepth).join("\n");
if (console.groupCollapsed) {
console.groupCollapsed(
"%cPixiJS Deprecation Warning: %c%s",
"color:#614108;background:#fffbe6",
"font-weight:normal;color:#614108;background:#fffbe6",
`${message}
Deprecated since v${version}`
);
console.warn(stack);
console.groupEnd();
} else {
console.warn("PixiJS Deprecation Warning: ", `${message}
Deprecated since v${version}`);
console.warn(stack);
}
}
warnings[message] = true;
}
exports.deprecation = deprecation;
exports.v8_0_0 = v8_0_0;
exports.v8_3_4 = v8_3_4;
//# sourceMappingURL=deprecation.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"deprecation.js","sources":["../../../src/utils/logging/deprecation.ts"],"sourcesContent":["import type { Dict } from '../types';\n\n// A map of warning messages already fired\nconst warnings: Dict<boolean> = {};\n\n/**\n * deprecation name for version 8.0.0\n * @ignore\n */\nexport const v8_0_0 = '8.0.0';\nexport const v8_3_4 = '8.3.4';\n\n/**\n * Helper for warning developers about deprecated features & settings.\n * A stack track for warnings is given; useful for tracking-down where\n * deprecated methods/properties/classes are being used within the code.\n * @memberof utils\n * @ignore\n * @function deprecation\n * @param {string} version - The version where the feature became deprecated\n * @param {string} message - Message should include what is deprecated, where, and the new solution\n * @param {number} [ignoreDepth=3] - The number of steps to ignore at the top of the error stack\n * this is mostly to ignore internal deprecation calls.\n */\nexport function deprecation(version: string, message: string, ignoreDepth = 3): void\n{\n // Ignore duplicate\n if (warnings[message])\n {\n return;\n }\n\n /* eslint-disable no-console */\n let stack = new Error().stack;\n\n // Handle IE < 10 and Safari < 6\n if (typeof stack === 'undefined')\n {\n console.warn('PixiJS Deprecation Warning: ', `${message}\\nDeprecated since v${version}`);\n }\n else\n {\n // chop off the stack trace which includes PixiJS internal calls\n stack = stack.split('\\n').splice(ignoreDepth).join('\\n');\n\n if (console.groupCollapsed)\n {\n console.groupCollapsed(\n '%cPixiJS Deprecation Warning: %c%s',\n 'color:#614108;background:#fffbe6',\n 'font-weight:normal;color:#614108;background:#fffbe6',\n `${message}\\nDeprecated since v${version}`\n );\n console.warn(stack);\n console.groupEnd();\n }\n else\n {\n console.warn('PixiJS Deprecation Warning: ', `${message}\\nDeprecated since v${version}`);\n console.warn(stack);\n }\n }\n /* eslint-enable no-console */\n\n warnings[message] = true;\n}\n"],"names":[],"mappings":";;;AAGA,MAAM,WAA0B,EAAC,CAAA;AAM1B,MAAM,MAAS,GAAA,QAAA;AACf,MAAM,MAAS,GAAA,QAAA;AAcf,SAAS,WAAY,CAAA,OAAA,EAAiB,OAAiB,EAAA,WAAA,GAAc,CAC5E,EAAA;AAEI,EAAI,IAAA,QAAA,CAAS,OAAO,CACpB,EAAA;AACI,IAAA,OAAA;AAAA,GACJ;AAGA,EAAI,IAAA,KAAA,GAAQ,IAAI,KAAA,EAAQ,CAAA,KAAA,CAAA;AAGxB,EAAI,IAAA,OAAO,UAAU,WACrB,EAAA;AACI,IAAQ,OAAA,CAAA,IAAA,CAAK,8BAAgC,EAAA,CAAA,EAAG,OAAO,CAAA;AAAA,kBAAA,EAAuB,OAAO,CAAE,CAAA,CAAA,CAAA;AAAA,GAG3F,MAAA;AAEI,IAAQ,KAAA,GAAA,KAAA,CAAM,MAAM,IAAI,CAAA,CAAE,OAAO,WAAW,CAAA,CAAE,KAAK,IAAI,CAAA,CAAA;AAEvD,IAAA,IAAI,QAAQ,cACZ,EAAA;AACI,MAAQ,OAAA,CAAA,cAAA;AAAA,QACJ,oCAAA;AAAA,QACA,kCAAA;AAAA,QACA,qDAAA;AAAA,QACA,GAAG,OAAO,CAAA;AAAA,kBAAA,EAAuB,OAAO,CAAA,CAAA;AAAA,OAC5C,CAAA;AACA,MAAA,OAAA,CAAQ,KAAK,KAAK,CAAA,CAAA;AAClB,MAAA,OAAA,CAAQ,QAAS,EAAA,CAAA;AAAA,KAGrB,MAAA;AACI,MAAQ,OAAA,CAAA,IAAA,CAAK,8BAAgC,EAAA,CAAA,EAAG,OAAO,CAAA;AAAA,kBAAA,EAAuB,OAAO,CAAE,CAAA,CAAA,CAAA;AACvF,MAAA,OAAA,CAAQ,KAAK,KAAK,CAAA,CAAA;AAAA,KACtB;AAAA,GACJ;AAGA,EAAA,QAAA,CAAS,OAAO,CAAI,GAAA,IAAA,CAAA;AACxB;;;;;;"}

35
node_modules/pixi.js/lib/utils/logging/deprecation.mjs generated vendored Normal file
View File

@@ -0,0 +1,35 @@
"use strict";
const warnings = {};
const v8_0_0 = "8.0.0";
const v8_3_4 = "8.3.4";
function deprecation(version, message, ignoreDepth = 3) {
if (warnings[message]) {
return;
}
let stack = new Error().stack;
if (typeof stack === "undefined") {
console.warn("PixiJS Deprecation Warning: ", `${message}
Deprecated since v${version}`);
} else {
stack = stack.split("\n").splice(ignoreDepth).join("\n");
if (console.groupCollapsed) {
console.groupCollapsed(
"%cPixiJS Deprecation Warning: %c%s",
"color:#614108;background:#fffbe6",
"font-weight:normal;color:#614108;background:#fffbe6",
`${message}
Deprecated since v${version}`
);
console.warn(stack);
console.groupEnd();
} else {
console.warn("PixiJS Deprecation Warning: ", `${message}
Deprecated since v${version}`);
console.warn(stack);
}
}
warnings[message] = true;
}
export { deprecation, v8_0_0, v8_3_4 };
//# sourceMappingURL=deprecation.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"deprecation.mjs","sources":["../../../src/utils/logging/deprecation.ts"],"sourcesContent":["import type { Dict } from '../types';\n\n// A map of warning messages already fired\nconst warnings: Dict<boolean> = {};\n\n/**\n * deprecation name for version 8.0.0\n * @ignore\n */\nexport const v8_0_0 = '8.0.0';\nexport const v8_3_4 = '8.3.4';\n\n/**\n * Helper for warning developers about deprecated features & settings.\n * A stack track for warnings is given; useful for tracking-down where\n * deprecated methods/properties/classes are being used within the code.\n * @memberof utils\n * @ignore\n * @function deprecation\n * @param {string} version - The version where the feature became deprecated\n * @param {string} message - Message should include what is deprecated, where, and the new solution\n * @param {number} [ignoreDepth=3] - The number of steps to ignore at the top of the error stack\n * this is mostly to ignore internal deprecation calls.\n */\nexport function deprecation(version: string, message: string, ignoreDepth = 3): void\n{\n // Ignore duplicate\n if (warnings[message])\n {\n return;\n }\n\n /* eslint-disable no-console */\n let stack = new Error().stack;\n\n // Handle IE < 10 and Safari < 6\n if (typeof stack === 'undefined')\n {\n console.warn('PixiJS Deprecation Warning: ', `${message}\\nDeprecated since v${version}`);\n }\n else\n {\n // chop off the stack trace which includes PixiJS internal calls\n stack = stack.split('\\n').splice(ignoreDepth).join('\\n');\n\n if (console.groupCollapsed)\n {\n console.groupCollapsed(\n '%cPixiJS Deprecation Warning: %c%s',\n 'color:#614108;background:#fffbe6',\n 'font-weight:normal;color:#614108;background:#fffbe6',\n `${message}\\nDeprecated since v${version}`\n );\n console.warn(stack);\n console.groupEnd();\n }\n else\n {\n console.warn('PixiJS Deprecation Warning: ', `${message}\\nDeprecated since v${version}`);\n console.warn(stack);\n }\n }\n /* eslint-enable no-console */\n\n warnings[message] = true;\n}\n"],"names":[],"mappings":";AAGA,MAAM,WAA0B,EAAC,CAAA;AAM1B,MAAM,MAAS,GAAA,QAAA;AACf,MAAM,MAAS,GAAA,QAAA;AAcf,SAAS,WAAY,CAAA,OAAA,EAAiB,OAAiB,EAAA,WAAA,GAAc,CAC5E,EAAA;AAEI,EAAI,IAAA,QAAA,CAAS,OAAO,CACpB,EAAA;AACI,IAAA,OAAA;AAAA,GACJ;AAGA,EAAI,IAAA,KAAA,GAAQ,IAAI,KAAA,EAAQ,CAAA,KAAA,CAAA;AAGxB,EAAI,IAAA,OAAO,UAAU,WACrB,EAAA;AACI,IAAQ,OAAA,CAAA,IAAA,CAAK,8BAAgC,EAAA,CAAA,EAAG,OAAO,CAAA;AAAA,kBAAA,EAAuB,OAAO,CAAE,CAAA,CAAA,CAAA;AAAA,GAG3F,MAAA;AAEI,IAAQ,KAAA,GAAA,KAAA,CAAM,MAAM,IAAI,CAAA,CAAE,OAAO,WAAW,CAAA,CAAE,KAAK,IAAI,CAAA,CAAA;AAEvD,IAAA,IAAI,QAAQ,cACZ,EAAA;AACI,MAAQ,OAAA,CAAA,cAAA;AAAA,QACJ,oCAAA;AAAA,QACA,kCAAA;AAAA,QACA,qDAAA;AAAA,QACA,GAAG,OAAO,CAAA;AAAA,kBAAA,EAAuB,OAAO,CAAA,CAAA;AAAA,OAC5C,CAAA;AACA,MAAA,OAAA,CAAQ,KAAK,KAAK,CAAA,CAAA;AAClB,MAAA,OAAA,CAAQ,QAAS,EAAA,CAAA;AAAA,KAGrB,MAAA;AACI,MAAQ,OAAA,CAAA,IAAA,CAAK,8BAAgC,EAAA,CAAA,EAAG,OAAO,CAAA;AAAA,kBAAA,EAAuB,OAAO,CAAE,CAAA,CAAA,CAAA;AACvF,MAAA,OAAA,CAAQ,KAAK,KAAK,CAAA,CAAA;AAAA,KACtB;AAAA,GACJ;AAGA,EAAA,QAAA,CAAS,OAAO,CAAI,GAAA,IAAA,CAAA;AACxB;;;;"}

View File

@@ -0,0 +1,11 @@
import type { Texture } from '../../rendering/renderers/shared/texture/Texture';
import type { Renderer } from '../../rendering/renderers/types';
/**
* Logs a texture to the console as a base64 image.
* This can be very useful for debugging issues with rendering.
* @param texture - The texture to log
* @param renderer - The renderer to use
* @param size - The size of the texture to log in the console
* @ignore
*/
export declare function logDebugTexture(texture: Texture, renderer: Renderer, size?: number): Promise<void>;

View File

@@ -0,0 +1,19 @@
'use strict';
"use strict";
async function logDebugTexture(texture, renderer, size = 200) {
const base64 = await renderer.extract.base64(texture);
await renderer.encoder.commandFinished;
const width = size;
console.log(`logging texture ${texture.source.width}px ${texture.source.height}px`);
const style = [
"font-size: 1px;",
`padding: ${width}px ${300}px;`,
`background: url(${base64}) no-repeat;`,
"background-size: contain;"
].join(" ");
console.log("%c ", style);
}
exports.logDebugTexture = logDebugTexture;
//# sourceMappingURL=logDebugTexture.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"logDebugTexture.js","sources":["../../../src/utils/logging/logDebugTexture.ts"],"sourcesContent":["import type { Texture } from '../../rendering/renderers/shared/texture/Texture';\nimport type { Renderer } from '../../rendering/renderers/types';\n\n/**\n * Logs a texture to the console as a base64 image.\n * This can be very useful for debugging issues with rendering.\n * @param texture - The texture to log\n * @param renderer - The renderer to use\n * @param size - The size of the texture to log in the console\n * @ignore\n */\nexport async function logDebugTexture(texture: Texture, renderer: Renderer, size = 200)\n{\n const base64 = await renderer.extract.base64(texture);\n\n await renderer.encoder.commandFinished;\n\n const width = size;\n\n // eslint-disable-next-line no-console\n console.log(`logging texture ${texture.source.width}px ${texture.source.height}px`);\n\n const style = [\n 'font-size: 1px;',\n `padding: ${width}px ${300}px;`,\n `background: url(${base64}) no-repeat;`,\n 'background-size: contain;',\n ].join(' ');\n\n // eslint-disable-next-line no-console\n console.log('%c ', style);\n}\n"],"names":[],"mappings":";;;AAWA,eAAsB,eAAgB,CAAA,OAAA,EAAkB,QAAoB,EAAA,IAAA,GAAO,GACnF,EAAA;AACI,EAAA,MAAM,MAAS,GAAA,MAAM,QAAS,CAAA,OAAA,CAAQ,OAAO,OAAO,CAAA,CAAA;AAEpD,EAAA,MAAM,SAAS,OAAQ,CAAA,eAAA,CAAA;AAEvB,EAAA,MAAM,KAAQ,GAAA,IAAA,CAAA;AAGd,EAAQ,OAAA,CAAA,GAAA,CAAI,mBAAmB,OAAQ,CAAA,MAAA,CAAO,KAAK,CAAM,GAAA,EAAA,OAAA,CAAQ,MAAO,CAAA,MAAM,CAAI,EAAA,CAAA,CAAA,CAAA;AAElF,EAAA,MAAM,KAAQ,GAAA;AAAA,IACV,iBAAA;AAAA,IACA,CAAA,SAAA,EAAY,KAAK,CAAA,GAAA,EAAM,GAAG,CAAA,GAAA,CAAA;AAAA,IAC1B,mBAAmB,MAAM,CAAA,YAAA,CAAA;AAAA,IACzB,2BAAA;AAAA,GACJ,CAAE,KAAK,GAAG,CAAA,CAAA;AAGV,EAAQ,OAAA,CAAA,GAAA,CAAI,OAAO,KAAK,CAAA,CAAA;AAC5B;;;;"}

View File

@@ -0,0 +1,17 @@
"use strict";
async function logDebugTexture(texture, renderer, size = 200) {
const base64 = await renderer.extract.base64(texture);
await renderer.encoder.commandFinished;
const width = size;
console.log(`logging texture ${texture.source.width}px ${texture.source.height}px`);
const style = [
"font-size: 1px;",
`padding: ${width}px ${300}px;`,
`background: url(${base64}) no-repeat;`,
"background-size: contain;"
].join(" ");
console.log("%c ", style);
}
export { logDebugTexture };
//# sourceMappingURL=logDebugTexture.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"logDebugTexture.mjs","sources":["../../../src/utils/logging/logDebugTexture.ts"],"sourcesContent":["import type { Texture } from '../../rendering/renderers/shared/texture/Texture';\nimport type { Renderer } from '../../rendering/renderers/types';\n\n/**\n * Logs a texture to the console as a base64 image.\n * This can be very useful for debugging issues with rendering.\n * @param texture - The texture to log\n * @param renderer - The renderer to use\n * @param size - The size of the texture to log in the console\n * @ignore\n */\nexport async function logDebugTexture(texture: Texture, renderer: Renderer, size = 200)\n{\n const base64 = await renderer.extract.base64(texture);\n\n await renderer.encoder.commandFinished;\n\n const width = size;\n\n // eslint-disable-next-line no-console\n console.log(`logging texture ${texture.source.width}px ${texture.source.height}px`);\n\n const style = [\n 'font-size: 1px;',\n `padding: ${width}px ${300}px;`,\n `background: url(${base64}) no-repeat;`,\n 'background-size: contain;',\n ].join(' ');\n\n // eslint-disable-next-line no-console\n console.log('%c ', style);\n}\n"],"names":[],"mappings":";AAWA,eAAsB,eAAgB,CAAA,OAAA,EAAkB,QAAoB,EAAA,IAAA,GAAO,GACnF,EAAA;AACI,EAAA,MAAM,MAAS,GAAA,MAAM,QAAS,CAAA,OAAA,CAAQ,OAAO,OAAO,CAAA,CAAA;AAEpD,EAAA,MAAM,SAAS,OAAQ,CAAA,eAAA,CAAA;AAEvB,EAAA,MAAM,KAAQ,GAAA,IAAA,CAAA;AAGd,EAAQ,OAAA,CAAA,GAAA,CAAI,mBAAmB,OAAQ,CAAA,MAAA,CAAO,KAAK,CAAM,GAAA,EAAA,OAAA,CAAQ,MAAO,CAAA,MAAM,CAAI,EAAA,CAAA,CAAA,CAAA;AAElF,EAAA,MAAM,KAAQ,GAAA;AAAA,IACV,iBAAA;AAAA,IACA,CAAA,SAAA,EAAY,KAAK,CAAA,GAAA,EAAM,GAAG,CAAA,GAAA,CAAA;AAAA,IAC1B,mBAAmB,MAAM,CAAA,YAAA,CAAA;AAAA,IACzB,2BAAA;AAAA,GACJ,CAAE,KAAK,GAAG,CAAA,CAAA;AAGV,EAAQ,OAAA,CAAA,GAAA,CAAI,OAAO,KAAK,CAAA,CAAA;AAC5B;;;;"}

9
node_modules/pixi.js/lib/utils/logging/logScene.d.ts generated vendored Normal file
View File

@@ -0,0 +1,9 @@
import type { Container } from '../../scene/container/Container';
import type { RenderGroup } from '../../scene/container/RenderGroup';
export declare function logScene(container: Container, depth?: number, data?: {
color?: string;
}): void;
export declare function logRenderGroupScene(renderGroup: RenderGroup, depth?: number, data?: {
index: number;
color?: string;
}): void;

71
node_modules/pixi.js/lib/utils/logging/logScene.js generated vendored Normal file
View File

@@ -0,0 +1,71 @@
'use strict';
var Sprite = require('../../scene/sprite/Sprite.js');
"use strict";
const colors = [
"#000080",
// Navy Blue
"#228B22",
// Forest Green
"#8B0000",
// Dark Red
"#4169E1",
// Royal Blue
"#008080",
// Teal
"#800000",
// Maroon
"#9400D3",
// Dark Violet
"#FF8C00",
// Dark Orange
"#556B2F",
// Olive Green
"#8B008B"
// Dark Magenta
];
let colorTick = 0;
function logScene(container, depth = 0, data = { color: "#000000" }) {
if (container.renderGroup) {
data.color = colors[colorTick++];
}
let spaces = "";
for (let i = 0; i < depth; i++) {
spaces += " ";
}
let label = container.label;
if (!label && container instanceof Sprite.Sprite) {
label = `sprite:${container.texture.label}`;
}
let output = `%c ${spaces}|- ${label} (worldX:${container.worldTransform.tx}, relativeRenderX:${container.relativeGroupTransform.tx}, renderX:${container.groupTransform.tx}, localX:${container.x})`;
if (container.renderGroup) {
output += " (RenderGroup)";
}
if (container.filters) {
output += "(*filters)";
}
console.log(output, `color:${data.color}; font-weight:bold;`);
depth++;
for (let i = 0; i < container.children.length; i++) {
const child = container.children[i];
logScene(child, depth, { ...data });
}
}
function logRenderGroupScene(renderGroup, depth = 0, data = { index: 0, color: "#000000" }) {
let spaces = "";
for (let i = 0; i < depth; i++) {
spaces += " ";
}
const output = `%c ${spaces}- ${data.index}: ${renderGroup.root.label} worldX:${renderGroup.worldTransform.tx}`;
console.log(output, `color:${data.color}; font-weight:bold;`);
depth++;
for (let i = 0; i < renderGroup.renderGroupChildren.length; i++) {
const child = renderGroup.renderGroupChildren[i];
logRenderGroupScene(child, depth, { ...data, index: i });
}
}
exports.logRenderGroupScene = logRenderGroupScene;
exports.logScene = logScene;
//# sourceMappingURL=logScene.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"logScene.js","sources":["../../../src/utils/logging/logScene.ts"],"sourcesContent":["/* eslint-disable no-console */\n\nimport { Sprite } from '../../scene/sprite/Sprite';\n\nimport type { Container } from '../../scene/container/Container';\nimport type { RenderGroup } from '../../scene/container/RenderGroup';\n\nconst colors = [\n '#000080', // Navy Blue\n '#228B22', // Forest Green\n '#8B0000', // Dark Red\n '#4169E1', // Royal Blue\n '#008080', // Teal\n '#800000', // Maroon\n '#9400D3', // Dark Violet\n '#FF8C00', // Dark Orange\n '#556B2F', // Olive Green\n '#8B008B' // Dark Magenta\n];\n\nlet colorTick = 0;\n\nexport function logScene(container: Container, depth = 0, data: {color?: string} = { color: '#000000' })\n{\n if (container.renderGroup)\n {\n data.color = colors[colorTick++];\n }\n\n // turn depth into number of spaces:\n let spaces = '';\n\n for (let i = 0; i < depth; i++)\n {\n spaces += ' ';\n }\n\n let label = container.label;\n\n if (!label && container instanceof Sprite)\n {\n label = `sprite:${container.texture.label}`;\n }\n\n // eslint-disable-next-line max-len\n let output = `%c ${spaces}|- ${label} (worldX:${container.worldTransform.tx}, relativeRenderX:${container.relativeGroupTransform.tx}, renderX:${container.groupTransform.tx}, localX:${container.x})`;\n\n if (container.renderGroup)\n {\n output += ' (RenderGroup)';\n }\n\n if (container.filters)\n {\n output += '(*filters)';\n }\n\n console.log(output, `color:${data.color}; font-weight:bold;`);\n\n depth++;\n\n for (let i = 0; i < container.children.length; i++)\n {\n const child = container.children[i];\n\n logScene(child, depth, { ...data });\n }\n}\n\nexport function logRenderGroupScene(\n renderGroup: RenderGroup, depth = 0,\n data: {index: number, color?: string} = { index: 0, color: '#000000' }\n)\n{\n // turn depth into number of spaces:\n let spaces = '';\n\n for (let i = 0; i < depth; i++)\n {\n spaces += ' ';\n }\n\n const output = `%c ${spaces}- ${data.index}: ${renderGroup.root.label} worldX:${renderGroup.worldTransform.tx}`;\n\n console.log(output, `color:${data.color}; font-weight:bold;`);\n\n depth++;\n\n for (let i = 0; i < renderGroup.renderGroupChildren.length; i++)\n {\n const child = renderGroup.renderGroupChildren[i];\n\n logRenderGroupScene(child, depth, { ...data, index: i });\n }\n}\n"],"names":["Sprite"],"mappings":";;;;;AAOA,MAAM,MAAS,GAAA;AAAA,EACX,SAAA;AAAA;AAAA,EACA,SAAA;AAAA;AAAA,EACA,SAAA;AAAA;AAAA,EACA,SAAA;AAAA;AAAA,EACA,SAAA;AAAA;AAAA,EACA,SAAA;AAAA;AAAA,EACA,SAAA;AAAA;AAAA,EACA,SAAA;AAAA;AAAA,EACA,SAAA;AAAA;AAAA,EACA,SAAA;AAAA;AACJ,CAAA,CAAA;AAEA,IAAI,SAAY,GAAA,CAAA,CAAA;AAEA,SAAA,QAAA,CAAS,WAAsB,KAAQ,GAAA,CAAA,EAAG,OAAyB,EAAE,KAAA,EAAO,WAC5F,EAAA;AACI,EAAA,IAAI,UAAU,WACd,EAAA;AACI,IAAK,IAAA,CAAA,KAAA,GAAQ,OAAO,SAAW,EAAA,CAAA,CAAA;AAAA,GACnC;AAGA,EAAA,IAAI,MAAS,GAAA,EAAA,CAAA;AAEb,EAAA,KAAA,IAAS,CAAI,GAAA,CAAA,EAAG,CAAI,GAAA,KAAA,EAAO,CAC3B,EAAA,EAAA;AACI,IAAU,MAAA,IAAA,MAAA,CAAA;AAAA,GACd;AAEA,EAAA,IAAI,QAAQ,SAAU,CAAA,KAAA,CAAA;AAEtB,EAAI,IAAA,CAAC,KAAS,IAAA,SAAA,YAAqBA,aACnC,EAAA;AACI,IAAQ,KAAA,GAAA,CAAA,OAAA,EAAU,SAAU,CAAA,OAAA,CAAQ,KAAK,CAAA,CAAA,CAAA;AAAA,GAC7C;AAGA,EAAA,IAAI,SAAS,CAAM,GAAA,EAAA,MAAM,MAAM,KAAK,CAAA,SAAA,EAAY,UAAU,cAAe,CAAA,EAAE,qBAAqB,SAAU,CAAA,sBAAA,CAAuB,EAAE,CAAa,UAAA,EAAA,SAAA,CAAU,eAAe,EAAE,CAAA,SAAA,EAAY,UAAU,CAAC,CAAA,CAAA,CAAA,CAAA;AAElM,EAAA,IAAI,UAAU,WACd,EAAA;AACI,IAAU,MAAA,IAAA,gBAAA,CAAA;AAAA,GACd;AAEA,EAAA,IAAI,UAAU,OACd,EAAA;AACI,IAAU,MAAA,IAAA,YAAA,CAAA;AAAA,GACd;AAEA,EAAA,OAAA,CAAQ,GAAI,CAAA,MAAA,EAAQ,CAAS,MAAA,EAAA,IAAA,CAAK,KAAK,CAAqB,mBAAA,CAAA,CAAA,CAAA;AAE5D,EAAA,KAAA,EAAA,CAAA;AAEA,EAAA,KAAA,IAAS,IAAI,CAAG,EAAA,CAAA,GAAI,SAAU,CAAA,QAAA,CAAS,QAAQ,CAC/C,EAAA,EAAA;AACI,IAAM,MAAA,KAAA,GAAQ,SAAU,CAAA,QAAA,CAAS,CAAC,CAAA,CAAA;AAElC,IAAA,QAAA,CAAS,KAAO,EAAA,KAAA,EAAO,EAAE,GAAG,MAAM,CAAA,CAAA;AAAA,GACtC;AACJ,CAAA;AAEgB,SAAA,mBAAA,CACZ,WAA0B,EAAA,KAAA,GAAQ,CAClC,EAAA,IAAA,GAAwC,EAAE,KAAO,EAAA,CAAA,EAAG,KAAO,EAAA,SAAA,EAE/D,EAAA;AAEI,EAAA,IAAI,MAAS,GAAA,EAAA,CAAA;AAEb,EAAA,KAAA,IAAS,CAAI,GAAA,CAAA,EAAG,CAAI,GAAA,KAAA,EAAO,CAC3B,EAAA,EAAA;AACI,IAAU,MAAA,IAAA,MAAA,CAAA;AAAA,GACd;AAEA,EAAA,MAAM,MAAS,GAAA,CAAA,GAAA,EAAM,MAAM,CAAA,EAAA,EAAK,IAAK,CAAA,KAAK,CAAK,EAAA,EAAA,WAAA,CAAY,IAAK,CAAA,KAAK,CAAW,QAAA,EAAA,WAAA,CAAY,eAAe,EAAE,CAAA,CAAA,CAAA;AAE7G,EAAA,OAAA,CAAQ,GAAI,CAAA,MAAA,EAAQ,CAAS,MAAA,EAAA,IAAA,CAAK,KAAK,CAAqB,mBAAA,CAAA,CAAA,CAAA;AAE5D,EAAA,KAAA,EAAA,CAAA;AAEA,EAAA,KAAA,IAAS,IAAI,CAAG,EAAA,CAAA,GAAI,WAAY,CAAA,mBAAA,CAAoB,QAAQ,CAC5D,EAAA,EAAA;AACI,IAAM,MAAA,KAAA,GAAQ,WAAY,CAAA,mBAAA,CAAoB,CAAC,CAAA,CAAA;AAE/C,IAAA,mBAAA,CAAoB,OAAO,KAAO,EAAA,EAAE,GAAG,IAAM,EAAA,KAAA,EAAO,GAAG,CAAA,CAAA;AAAA,GAC3D;AACJ;;;;;"}

68
node_modules/pixi.js/lib/utils/logging/logScene.mjs generated vendored Normal file
View File

@@ -0,0 +1,68 @@
import { Sprite } from '../../scene/sprite/Sprite.mjs';
"use strict";
const colors = [
"#000080",
// Navy Blue
"#228B22",
// Forest Green
"#8B0000",
// Dark Red
"#4169E1",
// Royal Blue
"#008080",
// Teal
"#800000",
// Maroon
"#9400D3",
// Dark Violet
"#FF8C00",
// Dark Orange
"#556B2F",
// Olive Green
"#8B008B"
// Dark Magenta
];
let colorTick = 0;
function logScene(container, depth = 0, data = { color: "#000000" }) {
if (container.renderGroup) {
data.color = colors[colorTick++];
}
let spaces = "";
for (let i = 0; i < depth; i++) {
spaces += " ";
}
let label = container.label;
if (!label && container instanceof Sprite) {
label = `sprite:${container.texture.label}`;
}
let output = `%c ${spaces}|- ${label} (worldX:${container.worldTransform.tx}, relativeRenderX:${container.relativeGroupTransform.tx}, renderX:${container.groupTransform.tx}, localX:${container.x})`;
if (container.renderGroup) {
output += " (RenderGroup)";
}
if (container.filters) {
output += "(*filters)";
}
console.log(output, `color:${data.color}; font-weight:bold;`);
depth++;
for (let i = 0; i < container.children.length; i++) {
const child = container.children[i];
logScene(child, depth, { ...data });
}
}
function logRenderGroupScene(renderGroup, depth = 0, data = { index: 0, color: "#000000" }) {
let spaces = "";
for (let i = 0; i < depth; i++) {
spaces += " ";
}
const output = `%c ${spaces}- ${data.index}: ${renderGroup.root.label} worldX:${renderGroup.worldTransform.tx}`;
console.log(output, `color:${data.color}; font-weight:bold;`);
depth++;
for (let i = 0; i < renderGroup.renderGroupChildren.length; i++) {
const child = renderGroup.renderGroupChildren[i];
logRenderGroupScene(child, depth, { ...data, index: i });
}
}
export { logRenderGroupScene, logScene };
//# sourceMappingURL=logScene.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"logScene.mjs","sources":["../../../src/utils/logging/logScene.ts"],"sourcesContent":["/* eslint-disable no-console */\n\nimport { Sprite } from '../../scene/sprite/Sprite';\n\nimport type { Container } from '../../scene/container/Container';\nimport type { RenderGroup } from '../../scene/container/RenderGroup';\n\nconst colors = [\n '#000080', // Navy Blue\n '#228B22', // Forest Green\n '#8B0000', // Dark Red\n '#4169E1', // Royal Blue\n '#008080', // Teal\n '#800000', // Maroon\n '#9400D3', // Dark Violet\n '#FF8C00', // Dark Orange\n '#556B2F', // Olive Green\n '#8B008B' // Dark Magenta\n];\n\nlet colorTick = 0;\n\nexport function logScene(container: Container, depth = 0, data: {color?: string} = { color: '#000000' })\n{\n if (container.renderGroup)\n {\n data.color = colors[colorTick++];\n }\n\n // turn depth into number of spaces:\n let spaces = '';\n\n for (let i = 0; i < depth; i++)\n {\n spaces += ' ';\n }\n\n let label = container.label;\n\n if (!label && container instanceof Sprite)\n {\n label = `sprite:${container.texture.label}`;\n }\n\n // eslint-disable-next-line max-len\n let output = `%c ${spaces}|- ${label} (worldX:${container.worldTransform.tx}, relativeRenderX:${container.relativeGroupTransform.tx}, renderX:${container.groupTransform.tx}, localX:${container.x})`;\n\n if (container.renderGroup)\n {\n output += ' (RenderGroup)';\n }\n\n if (container.filters)\n {\n output += '(*filters)';\n }\n\n console.log(output, `color:${data.color}; font-weight:bold;`);\n\n depth++;\n\n for (let i = 0; i < container.children.length; i++)\n {\n const child = container.children[i];\n\n logScene(child, depth, { ...data });\n }\n}\n\nexport function logRenderGroupScene(\n renderGroup: RenderGroup, depth = 0,\n data: {index: number, color?: string} = { index: 0, color: '#000000' }\n)\n{\n // turn depth into number of spaces:\n let spaces = '';\n\n for (let i = 0; i < depth; i++)\n {\n spaces += ' ';\n }\n\n const output = `%c ${spaces}- ${data.index}: ${renderGroup.root.label} worldX:${renderGroup.worldTransform.tx}`;\n\n console.log(output, `color:${data.color}; font-weight:bold;`);\n\n depth++;\n\n for (let i = 0; i < renderGroup.renderGroupChildren.length; i++)\n {\n const child = renderGroup.renderGroupChildren[i];\n\n logRenderGroupScene(child, depth, { ...data, index: i });\n }\n}\n"],"names":[],"mappings":";;;AAOA,MAAM,MAAS,GAAA;AAAA,EACX,SAAA;AAAA;AAAA,EACA,SAAA;AAAA;AAAA,EACA,SAAA;AAAA;AAAA,EACA,SAAA;AAAA;AAAA,EACA,SAAA;AAAA;AAAA,EACA,SAAA;AAAA;AAAA,EACA,SAAA;AAAA;AAAA,EACA,SAAA;AAAA;AAAA,EACA,SAAA;AAAA;AAAA,EACA,SAAA;AAAA;AACJ,CAAA,CAAA;AAEA,IAAI,SAAY,GAAA,CAAA,CAAA;AAEA,SAAA,QAAA,CAAS,WAAsB,KAAQ,GAAA,CAAA,EAAG,OAAyB,EAAE,KAAA,EAAO,WAC5F,EAAA;AACI,EAAA,IAAI,UAAU,WACd,EAAA;AACI,IAAK,IAAA,CAAA,KAAA,GAAQ,OAAO,SAAW,EAAA,CAAA,CAAA;AAAA,GACnC;AAGA,EAAA,IAAI,MAAS,GAAA,EAAA,CAAA;AAEb,EAAA,KAAA,IAAS,CAAI,GAAA,CAAA,EAAG,CAAI,GAAA,KAAA,EAAO,CAC3B,EAAA,EAAA;AACI,IAAU,MAAA,IAAA,MAAA,CAAA;AAAA,GACd;AAEA,EAAA,IAAI,QAAQ,SAAU,CAAA,KAAA,CAAA;AAEtB,EAAI,IAAA,CAAC,KAAS,IAAA,SAAA,YAAqB,MACnC,EAAA;AACI,IAAQ,KAAA,GAAA,CAAA,OAAA,EAAU,SAAU,CAAA,OAAA,CAAQ,KAAK,CAAA,CAAA,CAAA;AAAA,GAC7C;AAGA,EAAA,IAAI,SAAS,CAAM,GAAA,EAAA,MAAM,MAAM,KAAK,CAAA,SAAA,EAAY,UAAU,cAAe,CAAA,EAAE,qBAAqB,SAAU,CAAA,sBAAA,CAAuB,EAAE,CAAa,UAAA,EAAA,SAAA,CAAU,eAAe,EAAE,CAAA,SAAA,EAAY,UAAU,CAAC,CAAA,CAAA,CAAA,CAAA;AAElM,EAAA,IAAI,UAAU,WACd,EAAA;AACI,IAAU,MAAA,IAAA,gBAAA,CAAA;AAAA,GACd;AAEA,EAAA,IAAI,UAAU,OACd,EAAA;AACI,IAAU,MAAA,IAAA,YAAA,CAAA;AAAA,GACd;AAEA,EAAA,OAAA,CAAQ,GAAI,CAAA,MAAA,EAAQ,CAAS,MAAA,EAAA,IAAA,CAAK,KAAK,CAAqB,mBAAA,CAAA,CAAA,CAAA;AAE5D,EAAA,KAAA,EAAA,CAAA;AAEA,EAAA,KAAA,IAAS,IAAI,CAAG,EAAA,CAAA,GAAI,SAAU,CAAA,QAAA,CAAS,QAAQ,CAC/C,EAAA,EAAA;AACI,IAAM,MAAA,KAAA,GAAQ,SAAU,CAAA,QAAA,CAAS,CAAC,CAAA,CAAA;AAElC,IAAA,QAAA,CAAS,KAAO,EAAA,KAAA,EAAO,EAAE,GAAG,MAAM,CAAA,CAAA;AAAA,GACtC;AACJ,CAAA;AAEgB,SAAA,mBAAA,CACZ,WAA0B,EAAA,KAAA,GAAQ,CAClC,EAAA,IAAA,GAAwC,EAAE,KAAO,EAAA,CAAA,EAAG,KAAO,EAAA,SAAA,EAE/D,EAAA;AAEI,EAAA,IAAI,MAAS,GAAA,EAAA,CAAA;AAEb,EAAA,KAAA,IAAS,CAAI,GAAA,CAAA,EAAG,CAAI,GAAA,KAAA,EAAO,CAC3B,EAAA,EAAA;AACI,IAAU,MAAA,IAAA,MAAA,CAAA;AAAA,GACd;AAEA,EAAA,MAAM,MAAS,GAAA,CAAA,GAAA,EAAM,MAAM,CAAA,EAAA,EAAK,IAAK,CAAA,KAAK,CAAK,EAAA,EAAA,WAAA,CAAY,IAAK,CAAA,KAAK,CAAW,QAAA,EAAA,WAAA,CAAY,eAAe,EAAE,CAAA,CAAA,CAAA;AAE7G,EAAA,OAAA,CAAQ,GAAI,CAAA,MAAA,EAAQ,CAAS,MAAA,EAAA,IAAA,CAAK,KAAK,CAAqB,mBAAA,CAAA,CAAA,CAAA;AAE5D,EAAA,KAAA,EAAA,CAAA;AAEA,EAAA,KAAA,IAAS,IAAI,CAAG,EAAA,CAAA,GAAI,WAAY,CAAA,mBAAA,CAAoB,QAAQ,CAC5D,EAAA,EAAA;AACI,IAAM,MAAA,KAAA,GAAQ,WAAY,CAAA,mBAAA,CAAoB,CAAC,CAAA,CAAA;AAE/C,IAAA,mBAAA,CAAoB,OAAO,KAAO,EAAA,EAAE,GAAG,IAAM,EAAA,KAAA,EAAO,GAAG,CAAA,CAAA;AAAA,GAC3D;AACJ;;;;"}

8
node_modules/pixi.js/lib/utils/logging/warn.d.ts generated vendored Normal file
View File

@@ -0,0 +1,8 @@
/**
* Logs a PixiJS warning message to the console. Stops logging after 500 warnings have been logged.
* @param args - The warning message(s) to log
* @returns {void}
* @memberof utils
* @ignore
*/
export declare function warn(...args: any[]): void;

18
node_modules/pixi.js/lib/utils/logging/warn.js generated vendored Normal file
View File

@@ -0,0 +1,18 @@
'use strict';
"use strict";
let warnCount = 0;
const maxWarnings = 500;
function warn(...args) {
if (warnCount === maxWarnings)
return;
warnCount++;
if (warnCount === maxWarnings) {
console.warn("PixiJS Warning: too many warnings, no more warnings will be reported to the console by PixiJS.");
} else {
console.warn("PixiJS Warning: ", ...args);
}
}
exports.warn = warn;
//# sourceMappingURL=warn.js.map

1
node_modules/pixi.js/lib/utils/logging/warn.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"warn.js","sources":["../../../src/utils/logging/warn.ts"],"sourcesContent":["let warnCount = 0;\nconst maxWarnings = 500;\n\n/**\n * Logs a PixiJS warning message to the console. Stops logging after 500 warnings have been logged.\n * @param args - The warning message(s) to log\n * @returns {void}\n * @memberof utils\n * @ignore\n */\nexport function warn(...args: any[])\n{\n if (warnCount === maxWarnings) return;\n\n warnCount++;\n\n if (warnCount === maxWarnings)\n {\n console.warn('PixiJS Warning: too many warnings, no more warnings will be reported to the console by PixiJS.');\n }\n else\n {\n console.warn('PixiJS Warning: ', ...args);\n }\n}\n"],"names":[],"mappings":";;;AAAA,IAAI,SAAY,GAAA,CAAA,CAAA;AAChB,MAAM,WAAc,GAAA,GAAA,CAAA;AASb,SAAS,QAAQ,IACxB,EAAA;AACI,EAAA,IAAI,SAAc,KAAA,WAAA;AAAa,IAAA,OAAA;AAE/B,EAAA,SAAA,EAAA,CAAA;AAEA,EAAA,IAAI,cAAc,WAClB,EAAA;AACI,IAAA,OAAA,CAAQ,KAAK,gGAAgG,CAAA,CAAA;AAAA,GAGjH,MAAA;AACI,IAAQ,OAAA,CAAA,IAAA,CAAK,kBAAoB,EAAA,GAAG,IAAI,CAAA,CAAA;AAAA,GAC5C;AACJ;;;;"}

16
node_modules/pixi.js/lib/utils/logging/warn.mjs generated vendored Normal file
View File

@@ -0,0 +1,16 @@
"use strict";
let warnCount = 0;
const maxWarnings = 500;
function warn(...args) {
if (warnCount === maxWarnings)
return;
warnCount++;
if (warnCount === maxWarnings) {
console.warn("PixiJS Warning: too many warnings, no more warnings will be reported to the console by PixiJS.");
} else {
console.warn("PixiJS Warning: ", ...args);
}
}
export { warn };
//# sourceMappingURL=warn.mjs.map

1
node_modules/pixi.js/lib/utils/logging/warn.mjs.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"warn.mjs","sources":["../../../src/utils/logging/warn.ts"],"sourcesContent":["let warnCount = 0;\nconst maxWarnings = 500;\n\n/**\n * Logs a PixiJS warning message to the console. Stops logging after 500 warnings have been logged.\n * @param args - The warning message(s) to log\n * @returns {void}\n * @memberof utils\n * @ignore\n */\nexport function warn(...args: any[])\n{\n if (warnCount === maxWarnings) return;\n\n warnCount++;\n\n if (warnCount === maxWarnings)\n {\n console.warn('PixiJS Warning: too many warnings, no more warnings will be reported to the console by PixiJS.');\n }\n else\n {\n console.warn('PixiJS Warning: ', ...args);\n }\n}\n"],"names":[],"mappings":";AAAA,IAAI,SAAY,GAAA,CAAA,CAAA;AAChB,MAAM,WAAc,GAAA,GAAA,CAAA;AASb,SAAS,QAAQ,IACxB,EAAA;AACI,EAAA,IAAI,SAAc,KAAA,WAAA;AAAa,IAAA,OAAA;AAE/B,EAAA,SAAA,EAAA,CAAA;AAEA,EAAA,IAAI,cAAc,WAClB,EAAA;AACI,IAAA,OAAA,CAAQ,KAAK,gGAAgG,CAAA,CAAA;AAAA,GAGjH,MAAA;AACI,IAAQ,OAAA,CAAA,IAAA,CAAK,kBAAoB,EAAA,GAAG,IAAI,CAAA,CAAA;AAAA,GAC5C;AACJ;;;;"}

1
node_modules/pixi.js/lib/utils/misc/NOOP.d.ts generated vendored Normal file
View File

@@ -0,0 +1 @@
export declare const NOOP: () => void;

8
node_modules/pixi.js/lib/utils/misc/NOOP.js generated vendored Normal file
View File

@@ -0,0 +1,8 @@
'use strict';
"use strict";
const NOOP = () => {
};
exports.NOOP = NOOP;
//# sourceMappingURL=NOOP.js.map

1
node_modules/pixi.js/lib/utils/misc/NOOP.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"NOOP.js","sources":["../../../src/utils/misc/NOOP.ts"],"sourcesContent":["export const NOOP = () =>\n{\n // empty!\n};\n"],"names":[],"mappings":";;;AAAO,MAAM,OAAO,MACpB;AAEA;;;;"}

6
node_modules/pixi.js/lib/utils/misc/NOOP.mjs generated vendored Normal file
View File

@@ -0,0 +1,6 @@
"use strict";
const NOOP = () => {
};
export { NOOP };
//# sourceMappingURL=NOOP.mjs.map

1
node_modules/pixi.js/lib/utils/misc/NOOP.mjs.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"NOOP.mjs","sources":["../../../src/utils/misc/NOOP.ts"],"sourcesContent":["export const NOOP = () =>\n{\n // empty!\n};\n"],"names":[],"mappings":";AAAO,MAAM,OAAO,MACpB;AAEA;;;;"}

90
node_modules/pixi.js/lib/utils/misc/Transform.d.ts generated vendored Normal file
View File

@@ -0,0 +1,90 @@
import { Matrix } from '../../maths/matrix/Matrix';
import { ObservablePoint } from '../../maths/point/ObservablePoint';
import type { Observer } from '../../maths/point/ObservablePoint';
/**
* Options for the {@link utils.Transform} constructor.
* @memberof utils.Transform
*/
export interface TransformOptions {
/** The matrix to use. */
matrix?: Matrix;
/** The observer to use. */
observer?: {
_onUpdate: (transform: Transform) => void;
};
}
/**
* The Transform class facilitates the manipulation of a 2D transformation matrix through
* user-friendly properties: position, scale, rotation, skew, and pivot.
* @memberof utils
*/
export declare class Transform {
/**
* The local transformation matrix.
* @internal
* @private
*/
_matrix: Matrix;
/** The coordinate of the object relative to the local coordinates of the parent. */
position: ObservablePoint;
/** The scale factor of the object. */
scale: ObservablePoint;
/** The pivot point of the container that it rotates around. */
pivot: ObservablePoint;
/** The skew amount, on the x and y axis. */
skew: ObservablePoint;
/** The rotation amount. */
protected _rotation: number;
/**
* The X-coordinate value of the normalized local X axis,
* the first column of the local transformation matrix without a scale.
*/
protected _cx: number;
/**
* The Y-coordinate value of the normalized local X axis,
* the first column of the local transformation matrix without a scale.
*/
protected _sx: number;
/**
* The X-coordinate value of the normalized local Y axis,
* the second column of the local transformation matrix without a scale.
*/
protected _cy: number;
/**
* The Y-coordinate value of the normalized local Y axis,
* the second column of the local transformation matrix without a scale.
*/
protected _sy: number;
protected dirty: boolean;
protected observer: Observer<Transform>;
/**
* @param options - Options for the transform.
* @param options.matrix - The matrix to use.
* @param options.observer - The observer to use.
*/
constructor({ matrix, observer }?: TransformOptions);
/**
* This matrix is computed by combining this Transforms position, scale, rotation, skew, and pivot
* properties into a single matrix.
* @readonly
*/
get matrix(): Matrix;
/**
* Called when a value changes.
* @param point
* @internal
* @private
*/
_onUpdate(point?: ObservablePoint): void;
/** Called when the skew or the rotation changes. */
protected updateSkew(): void;
toString(): string;
/**
* Decomposes a matrix and sets the transforms properties based on it.
* @param matrix - The matrix to decompose
*/
setFromMatrix(matrix: Matrix): void;
/** The rotation of the object in radians. */
get rotation(): number;
set rotation(value: number);
}

90
node_modules/pixi.js/lib/utils/misc/Transform.js generated vendored Normal file
View File

@@ -0,0 +1,90 @@
'use strict';
var Matrix = require('../../maths/matrix/Matrix.js');
var ObservablePoint = require('../../maths/point/ObservablePoint.js');
"use strict";
class Transform {
/**
* @param options - Options for the transform.
* @param options.matrix - The matrix to use.
* @param options.observer - The observer to use.
*/
constructor({ matrix, observer } = {}) {
this.dirty = true;
this._matrix = matrix ?? new Matrix.Matrix();
this.observer = observer;
this.position = new ObservablePoint.ObservablePoint(this, 0, 0);
this.scale = new ObservablePoint.ObservablePoint(this, 1, 1);
this.pivot = new ObservablePoint.ObservablePoint(this, 0, 0);
this.skew = new ObservablePoint.ObservablePoint(this, 0, 0);
this._rotation = 0;
this._cx = 1;
this._sx = 0;
this._cy = 0;
this._sy = 1;
}
/**
* This matrix is computed by combining this Transforms position, scale, rotation, skew, and pivot
* properties into a single matrix.
* @readonly
*/
get matrix() {
const lt = this._matrix;
if (!this.dirty)
return lt;
lt.a = this._cx * this.scale.x;
lt.b = this._sx * this.scale.x;
lt.c = this._cy * this.scale.y;
lt.d = this._sy * this.scale.y;
lt.tx = this.position.x - (this.pivot.x * lt.a + this.pivot.y * lt.c);
lt.ty = this.position.y - (this.pivot.x * lt.b + this.pivot.y * lt.d);
this.dirty = false;
return lt;
}
/**
* Called when a value changes.
* @param point
* @internal
* @private
*/
_onUpdate(point) {
this.dirty = true;
if (point === this.skew) {
this.updateSkew();
}
this.observer?._onUpdate(this);
}
/** Called when the skew or the rotation changes. */
updateSkew() {
this._cx = Math.cos(this._rotation + this.skew.y);
this._sx = Math.sin(this._rotation + this.skew.y);
this._cy = -Math.sin(this._rotation - this.skew.x);
this._sy = Math.cos(this._rotation - this.skew.x);
this.dirty = true;
}
toString() {
return `[pixi.js/math:Transform position=(${this.position.x}, ${this.position.y}) rotation=${this.rotation} scale=(${this.scale.x}, ${this.scale.y}) skew=(${this.skew.x}, ${this.skew.y}) ]`;
}
/**
* Decomposes a matrix and sets the transforms properties based on it.
* @param matrix - The matrix to decompose
*/
setFromMatrix(matrix) {
matrix.decompose(this);
this.dirty = true;
}
/** The rotation of the object in radians. */
get rotation() {
return this._rotation;
}
set rotation(value) {
if (this._rotation !== value) {
this._rotation = value;
this._onUpdate(this.skew);
}
}
}
exports.Transform = Transform;
//# sourceMappingURL=Transform.js.map

1
node_modules/pixi.js/lib/utils/misc/Transform.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

88
node_modules/pixi.js/lib/utils/misc/Transform.mjs generated vendored Normal file
View File

@@ -0,0 +1,88 @@
import { Matrix } from '../../maths/matrix/Matrix.mjs';
import { ObservablePoint } from '../../maths/point/ObservablePoint.mjs';
"use strict";
class Transform {
/**
* @param options - Options for the transform.
* @param options.matrix - The matrix to use.
* @param options.observer - The observer to use.
*/
constructor({ matrix, observer } = {}) {
this.dirty = true;
this._matrix = matrix ?? new Matrix();
this.observer = observer;
this.position = new ObservablePoint(this, 0, 0);
this.scale = new ObservablePoint(this, 1, 1);
this.pivot = new ObservablePoint(this, 0, 0);
this.skew = new ObservablePoint(this, 0, 0);
this._rotation = 0;
this._cx = 1;
this._sx = 0;
this._cy = 0;
this._sy = 1;
}
/**
* This matrix is computed by combining this Transforms position, scale, rotation, skew, and pivot
* properties into a single matrix.
* @readonly
*/
get matrix() {
const lt = this._matrix;
if (!this.dirty)
return lt;
lt.a = this._cx * this.scale.x;
lt.b = this._sx * this.scale.x;
lt.c = this._cy * this.scale.y;
lt.d = this._sy * this.scale.y;
lt.tx = this.position.x - (this.pivot.x * lt.a + this.pivot.y * lt.c);
lt.ty = this.position.y - (this.pivot.x * lt.b + this.pivot.y * lt.d);
this.dirty = false;
return lt;
}
/**
* Called when a value changes.
* @param point
* @internal
* @private
*/
_onUpdate(point) {
this.dirty = true;
if (point === this.skew) {
this.updateSkew();
}
this.observer?._onUpdate(this);
}
/** Called when the skew or the rotation changes. */
updateSkew() {
this._cx = Math.cos(this._rotation + this.skew.y);
this._sx = Math.sin(this._rotation + this.skew.y);
this._cy = -Math.sin(this._rotation - this.skew.x);
this._sy = Math.cos(this._rotation - this.skew.x);
this.dirty = true;
}
toString() {
return `[pixi.js/math:Transform position=(${this.position.x}, ${this.position.y}) rotation=${this.rotation} scale=(${this.scale.x}, ${this.scale.y}) skew=(${this.skew.x}, ${this.skew.y}) ]`;
}
/**
* Decomposes a matrix and sets the transforms properties based on it.
* @param matrix - The matrix to decompose
*/
setFromMatrix(matrix) {
matrix.decompose(this);
this.dirty = true;
}
/** The rotation of the object in radians. */
get rotation() {
return this._rotation;
}
set rotation(value) {
if (this._rotation !== value) {
this._rotation = value;
this._onUpdate(this.skew);
}
}
}
export { Transform };
//# sourceMappingURL=Transform.mjs.map

File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show More