This commit is contained in:
2025-01-04 00:34:03 +01:00
parent 41829408dc
commit 0ca14bbc19
18111 changed files with 1871397 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
"use strict";
function createIndicesForQuads(size, outBuffer = null) {
const totalIndices = size * 6;
if (outBuffer = outBuffer || new Uint16Array(totalIndices), outBuffer.length !== totalIndices)
throw new Error(`Out buffer length is incorrect, got ${outBuffer.length} and expected ${totalIndices}`);
for (let i = 0, j = 0; i < totalIndices; i += 6, j += 4)
outBuffer[i + 0] = j + 0, outBuffer[i + 1] = j + 1, outBuffer[i + 2] = j + 2, outBuffer[i + 3] = j + 0, outBuffer[i + 4] = j + 2, outBuffer[i + 5] = j + 3;
return outBuffer;
}
exports.createIndicesForQuads = createIndicesForQuads;
//# sourceMappingURL=createIndicesForQuads.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"createIndicesForQuads.js","sources":["../../src/data/createIndicesForQuads.ts"],"sourcesContent":["/**\n * Generic Mask Stack data structure\n * @memberof PIXI.utils\n * @function createIndicesForQuads\n * @param {number} size - Number of quads\n * @param {Uint16Array|Uint32Array} [outBuffer] - Buffer for output, length has to be `6 * size`\n * @returns {Uint16Array|Uint32Array} - Resulting index buffer\n */\nexport function createIndicesForQuads(\n size: number,\n outBuffer: Uint16Array | Uint32Array | null = null\n): Uint16Array | Uint32Array\n{\n // the total number of indices in our array, there are 6 points per quad.\n const totalIndices = size * 6;\n\n outBuffer = outBuffer || new Uint16Array(totalIndices);\n\n if (outBuffer.length !== totalIndices)\n {\n throw new Error(`Out buffer length is incorrect, got ${outBuffer.length} and expected ${totalIndices}`);\n }\n\n // fill the indices with the quads to draw\n for (let i = 0, j = 0; i < totalIndices; i += 6, j += 4)\n {\n outBuffer[i + 0] = j + 0;\n outBuffer[i + 1] = j + 1;\n outBuffer[i + 2] = j + 2;\n outBuffer[i + 3] = j + 0;\n outBuffer[i + 4] = j + 2;\n outBuffer[i + 5] = j + 3;\n }\n\n return outBuffer;\n}\n"],"names":[],"mappings":";AAQgB,SAAA,sBACZ,MACA,YAA8C,MAElD;AAEI,QAAM,eAAe,OAAO;AAI5B,MAFA,YAAY,aAAa,IAAI,YAAY,YAAY,GAEjD,UAAU,WAAW;AAErB,UAAM,IAAI,MAAM,uCAAuC,UAAU,MAAM,iBAAiB,YAAY,EAAE;AAIjG,WAAA,IAAI,GAAG,IAAI,GAAG,IAAI,cAAc,KAAK,GAAG,KAAK;AAElD,cAAU,IAAI,CAAC,IAAI,IAAI,GACvB,UAAU,IAAI,CAAC,IAAI,IAAI,GACvB,UAAU,IAAI,CAAC,IAAI,IAAI,GACvB,UAAU,IAAI,CAAC,IAAI,IAAI,GACvB,UAAU,IAAI,CAAC,IAAI,IAAI,GACvB,UAAU,IAAI,CAAC,IAAI,IAAI;AAGpB,SAAA;AACX;;"}

View File

@@ -0,0 +1,12 @@
function createIndicesForQuads(size, outBuffer = null) {
const totalIndices = size * 6;
if (outBuffer = outBuffer || new Uint16Array(totalIndices), outBuffer.length !== totalIndices)
throw new Error(`Out buffer length is incorrect, got ${outBuffer.length} and expected ${totalIndices}`);
for (let i = 0, j = 0; i < totalIndices; i += 6, j += 4)
outBuffer[i + 0] = j + 0, outBuffer[i + 1] = j + 1, outBuffer[i + 2] = j + 2, outBuffer[i + 3] = j + 0, outBuffer[i + 4] = j + 2, outBuffer[i + 5] = j + 3;
return outBuffer;
}
export {
createIndicesForQuads
};
//# sourceMappingURL=createIndicesForQuads.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"createIndicesForQuads.mjs","sources":["../../src/data/createIndicesForQuads.ts"],"sourcesContent":["/**\n * Generic Mask Stack data structure\n * @memberof PIXI.utils\n * @function createIndicesForQuads\n * @param {number} size - Number of quads\n * @param {Uint16Array|Uint32Array} [outBuffer] - Buffer for output, length has to be `6 * size`\n * @returns {Uint16Array|Uint32Array} - Resulting index buffer\n */\nexport function createIndicesForQuads(\n size: number,\n outBuffer: Uint16Array | Uint32Array | null = null\n): Uint16Array | Uint32Array\n{\n // the total number of indices in our array, there are 6 points per quad.\n const totalIndices = size * 6;\n\n outBuffer = outBuffer || new Uint16Array(totalIndices);\n\n if (outBuffer.length !== totalIndices)\n {\n throw new Error(`Out buffer length is incorrect, got ${outBuffer.length} and expected ${totalIndices}`);\n }\n\n // fill the indices with the quads to draw\n for (let i = 0, j = 0; i < totalIndices; i += 6, j += 4)\n {\n outBuffer[i + 0] = j + 0;\n outBuffer[i + 1] = j + 1;\n outBuffer[i + 2] = j + 2;\n outBuffer[i + 3] = j + 0;\n outBuffer[i + 4] = j + 2;\n outBuffer[i + 5] = j + 3;\n }\n\n return outBuffer;\n}\n"],"names":[],"mappings":"AAQgB,SAAA,sBACZ,MACA,YAA8C,MAElD;AAEI,QAAM,eAAe,OAAO;AAI5B,MAFA,YAAY,aAAa,IAAI,YAAY,YAAY,GAEjD,UAAU,WAAW;AAErB,UAAM,IAAI,MAAM,uCAAuC,UAAU,MAAM,iBAAiB,YAAY,EAAE;AAIjG,WAAA,IAAI,GAAG,IAAI,GAAG,IAAI,cAAc,KAAK,GAAG,KAAK;AAElD,cAAU,IAAI,CAAC,IAAI,IAAI,GACvB,UAAU,IAAI,CAAC,IAAI,IAAI,GACvB,UAAU,IAAI,CAAC,IAAI,IAAI,GACvB,UAAU,IAAI,CAAC,IAAI,IAAI,GACvB,UAAU,IAAI,CAAC,IAAI,IAAI,GACvB,UAAU,IAAI,CAAC,IAAI,IAAI;AAGpB,SAAA;AACX;"}

View File

@@ -0,0 +1,13 @@
"use strict";
function getBufferType(array) {
if (array.BYTES_PER_ELEMENT === 4)
return array instanceof Float32Array ? "Float32Array" : array instanceof Uint32Array ? "Uint32Array" : "Int32Array";
if (array.BYTES_PER_ELEMENT === 2) {
if (array instanceof Uint16Array)
return "Uint16Array";
} else if (array.BYTES_PER_ELEMENT === 1 && array instanceof Uint8Array)
return "Uint8Array";
return null;
}
exports.getBufferType = getBufferType;
//# sourceMappingURL=getBufferType.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"getBufferType.js","sources":["../../src/data/getBufferType.ts"],"sourcesContent":["import type { ITypedArray } from '@pixi/core';\n\nexport function getBufferType(\n array: ITypedArray\n): 'Float32Array' | 'Uint32Array' | 'Int32Array' | 'Uint16Array' | 'Uint8Array' | null\n{\n if (array.BYTES_PER_ELEMENT === 4)\n {\n if (array instanceof Float32Array)\n {\n return 'Float32Array';\n }\n else if (array instanceof Uint32Array)\n {\n return 'Uint32Array';\n }\n\n return 'Int32Array';\n }\n else if (array.BYTES_PER_ELEMENT === 2)\n {\n if (array instanceof Uint16Array)\n {\n return 'Uint16Array';\n }\n }\n else if (array.BYTES_PER_ELEMENT === 1)\n {\n if (array instanceof Uint8Array)\n {\n return 'Uint8Array';\n }\n }\n\n // TODO map out the rest of the array elements!\n return null;\n}\n"],"names":[],"mappings":";AAEO,SAAS,cACZ,OAEJ;AACI,MAAI,MAAM,sBAAsB;AAE5B,WAAI,iBAAiB,eAEV,iBAEF,iBAAiB,cAEf,gBAGJ;AAEN,MAAI,MAAM,sBAAsB;AAEjC,QAAI,iBAAiB;AAEV,aAAA;AAAA,aAGN,MAAM,sBAAsB,KAE7B,iBAAiB;AAEV,WAAA;AAKR,SAAA;AACX;;"}

View File

@@ -0,0 +1,14 @@
function getBufferType(array) {
if (array.BYTES_PER_ELEMENT === 4)
return array instanceof Float32Array ? "Float32Array" : array instanceof Uint32Array ? "Uint32Array" : "Int32Array";
if (array.BYTES_PER_ELEMENT === 2) {
if (array instanceof Uint16Array)
return "Uint16Array";
} else if (array.BYTES_PER_ELEMENT === 1 && array instanceof Uint8Array)
return "Uint8Array";
return null;
}
export {
getBufferType
};
//# sourceMappingURL=getBufferType.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"getBufferType.mjs","sources":["../../src/data/getBufferType.ts"],"sourcesContent":["import type { ITypedArray } from '@pixi/core';\n\nexport function getBufferType(\n array: ITypedArray\n): 'Float32Array' | 'Uint32Array' | 'Int32Array' | 'Uint16Array' | 'Uint8Array' | null\n{\n if (array.BYTES_PER_ELEMENT === 4)\n {\n if (array instanceof Float32Array)\n {\n return 'Float32Array';\n }\n else if (array instanceof Uint32Array)\n {\n return 'Uint32Array';\n }\n\n return 'Int32Array';\n }\n else if (array.BYTES_PER_ELEMENT === 2)\n {\n if (array instanceof Uint16Array)\n {\n return 'Uint16Array';\n }\n }\n else if (array.BYTES_PER_ELEMENT === 1)\n {\n if (array instanceof Uint8Array)\n {\n return 'Uint8Array';\n }\n }\n\n // TODO map out the rest of the array elements!\n return null;\n}\n"],"names":[],"mappings":"AAEO,SAAS,cACZ,OAEJ;AACI,MAAI,MAAM,sBAAsB;AAE5B,WAAI,iBAAiB,eAEV,iBAEF,iBAAiB,cAEf,gBAGJ;AAEN,MAAI,MAAM,sBAAsB;AAEjC,QAAI,iBAAiB;AAEV,aAAA;AAAA,aAGN,MAAM,sBAAsB,KAE7B,iBAAiB;AAEV,WAAA;AAKR,SAAA;AACX;"}

View File

@@ -0,0 +1,23 @@
"use strict";
var getBufferType = require("./getBufferType.js");
const map = { Float32Array, Uint32Array, Int32Array, Uint8Array };
function interleaveTypedArrays(arrays, sizes) {
let outSize = 0, stride = 0;
const views = {};
for (let i = 0; i < arrays.length; i++)
stride += sizes[i], outSize += arrays[i].length;
const buffer = new ArrayBuffer(outSize * 4);
let out = null, littleOffset = 0;
for (let i = 0; i < arrays.length; i++) {
const size = sizes[i], array = arrays[i], type = getBufferType.getBufferType(array);
views[type] || (views[type] = new map[type](buffer)), out = views[type];
for (let j = 0; j < array.length; j++) {
const indexStart = (j / size | 0) * stride + littleOffset, index = j % size;
out[indexStart + index] = array[j];
}
littleOffset += size;
}
return new Float32Array(buffer);
}
exports.interleaveTypedArrays = interleaveTypedArrays;
//# sourceMappingURL=interleaveTypedArrays.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"interleaveTypedArrays.js","sources":["../../src/data/interleaveTypedArrays.ts"],"sourcesContent":["import { getBufferType } from './getBufferType';\n\n/* eslint-disable object-shorthand */\nconst map = { Float32Array: Float32Array, Uint32Array: Uint32Array, Int32Array: Int32Array, Uint8Array: Uint8Array };\n\ntype PackedArray = Float32Array | Uint32Array | Int32Array | Uint8Array;\n\nexport function interleaveTypedArrays(arrays: PackedArray[], sizes: number[]): Float32Array\n{\n let outSize = 0;\n let stride = 0;\n const views: {[key: string]: PackedArray} = {};\n\n for (let i = 0; i < arrays.length; i++)\n {\n stride += sizes[i];\n outSize += arrays[i].length;\n }\n\n const buffer = new ArrayBuffer(outSize * 4);\n\n let out = null;\n let littleOffset = 0;\n\n for (let i = 0; i < arrays.length; i++)\n {\n const size = sizes[i];\n const array = arrays[i];\n\n /*\n @todo This is unsafe casting but consistent with how the code worked previously. Should it stay this way\n or should and `getBufferTypeUnsafe` function be exposed that throws an Error if unsupported type is passed?\n */\n const type = getBufferType(array) as keyof typeof map;\n\n if (!views[type])\n {\n views[type] = new map[type](buffer);\n }\n\n out = views[type];\n\n for (let j = 0; j < array.length; j++)\n {\n const indexStart = ((j / size | 0) * stride) + littleOffset;\n const index = j % size;\n\n out[indexStart + index] = array[j];\n }\n\n littleOffset += size;\n }\n\n return new Float32Array(buffer);\n}\n"],"names":["getBufferType"],"mappings":";;AAGA,MAAM,MAAM,EAAE,cAA4B,aAA0B,YAAwB,WAAuB;AAInG,SAAA,sBAAsB,QAAuB,OAC7D;AACQ,MAAA,UAAU,GACV,SAAS;AACb,QAAM,QAAsC,CAAA;AAE5C,WAAS,IAAI,GAAG,IAAI,OAAO,QAAQ;AAE/B,cAAU,MAAM,CAAC,GACjB,WAAW,OAAO,CAAC,EAAE;AAGzB,QAAM,SAAS,IAAI,YAAY,UAAU,CAAC;AAEtC,MAAA,MAAM,MACN,eAAe;AAEnB,WAAS,IAAI,GAAG,IAAI,OAAO,QAAQ,KACnC;AACU,UAAA,OAAO,MAAM,CAAC,GACd,QAAQ,OAAO,CAAC,GAMhB,OAAOA,cAAA,cAAc,KAAK;AAE3B,UAAM,IAAI,MAEX,MAAM,IAAI,IAAI,IAAI,IAAI,IAAI,EAAE,MAAM,IAGtC,MAAM,MAAM,IAAI;AAEhB,aAAS,IAAI,GAAG,IAAI,MAAM,QAAQ,KAClC;AACI,YAAM,cAAe,IAAI,OAAO,KAAK,SAAU,cACzC,QAAQ,IAAI;AAElB,UAAI,aAAa,KAAK,IAAI,MAAM,CAAC;AAAA,IACrC;AAEgB,oBAAA;AAAA,EACpB;AAEO,SAAA,IAAI,aAAa,MAAM;AAClC;;"}

View File

@@ -0,0 +1,24 @@
import { getBufferType } from "./getBufferType.mjs";
const map = { Float32Array, Uint32Array, Int32Array, Uint8Array };
function interleaveTypedArrays(arrays, sizes) {
let outSize = 0, stride = 0;
const views = {};
for (let i = 0; i < arrays.length; i++)
stride += sizes[i], outSize += arrays[i].length;
const buffer = new ArrayBuffer(outSize * 4);
let out = null, littleOffset = 0;
for (let i = 0; i < arrays.length; i++) {
const size = sizes[i], array = arrays[i], type = getBufferType(array);
views[type] || (views[type] = new map[type](buffer)), out = views[type];
for (let j = 0; j < array.length; j++) {
const indexStart = (j / size | 0) * stride + littleOffset, index = j % size;
out[indexStart + index] = array[j];
}
littleOffset += size;
}
return new Float32Array(buffer);
}
export {
interleaveTypedArrays
};
//# sourceMappingURL=interleaveTypedArrays.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"interleaveTypedArrays.mjs","sources":["../../src/data/interleaveTypedArrays.ts"],"sourcesContent":["import { getBufferType } from './getBufferType';\n\n/* eslint-disable object-shorthand */\nconst map = { Float32Array: Float32Array, Uint32Array: Uint32Array, Int32Array: Int32Array, Uint8Array: Uint8Array };\n\ntype PackedArray = Float32Array | Uint32Array | Int32Array | Uint8Array;\n\nexport function interleaveTypedArrays(arrays: PackedArray[], sizes: number[]): Float32Array\n{\n let outSize = 0;\n let stride = 0;\n const views: {[key: string]: PackedArray} = {};\n\n for (let i = 0; i < arrays.length; i++)\n {\n stride += sizes[i];\n outSize += arrays[i].length;\n }\n\n const buffer = new ArrayBuffer(outSize * 4);\n\n let out = null;\n let littleOffset = 0;\n\n for (let i = 0; i < arrays.length; i++)\n {\n const size = sizes[i];\n const array = arrays[i];\n\n /*\n @todo This is unsafe casting but consistent with how the code worked previously. Should it stay this way\n or should and `getBufferTypeUnsafe` function be exposed that throws an Error if unsupported type is passed?\n */\n const type = getBufferType(array) as keyof typeof map;\n\n if (!views[type])\n {\n views[type] = new map[type](buffer);\n }\n\n out = views[type];\n\n for (let j = 0; j < array.length; j++)\n {\n const indexStart = ((j / size | 0) * stride) + littleOffset;\n const index = j % size;\n\n out[indexStart + index] = array[j];\n }\n\n littleOffset += size;\n }\n\n return new Float32Array(buffer);\n}\n"],"names":[],"mappings":";AAGA,MAAM,MAAM,EAAE,cAA4B,aAA0B,YAAwB,WAAuB;AAInG,SAAA,sBAAsB,QAAuB,OAC7D;AACQ,MAAA,UAAU,GACV,SAAS;AACb,QAAM,QAAsC,CAAA;AAE5C,WAAS,IAAI,GAAG,IAAI,OAAO,QAAQ;AAE/B,cAAU,MAAM,CAAC,GACjB,WAAW,OAAO,CAAC,EAAE;AAGzB,QAAM,SAAS,IAAI,YAAY,UAAU,CAAC;AAEtC,MAAA,MAAM,MACN,eAAe;AAEnB,WAAS,IAAI,GAAG,IAAI,OAAO,QAAQ,KACnC;AACU,UAAA,OAAO,MAAM,CAAC,GACd,QAAQ,OAAO,CAAC,GAMhB,OAAO,cAAc,KAAK;AAE3B,UAAM,IAAI,MAEX,MAAM,IAAI,IAAI,IAAI,IAAI,IAAI,EAAE,MAAM,IAGtC,MAAM,MAAM,IAAI;AAEhB,aAAS,IAAI,GAAG,IAAI,MAAM,QAAQ,KAClC;AACI,YAAM,cAAe,IAAI,OAAO,KAAK,SAAU,cACzC,QAAQ,IAAI;AAElB,UAAI,aAAa,KAAK,IAAI,MAAM,CAAC;AAAA,IACrC;AAEgB,oBAAA;AAAA,EACpB;AAEO,SAAA,IAAI,aAAa,MAAM;AAClC;"}

View File

@@ -0,0 +1,17 @@
"use strict";
function nextPow2(v) {
return v += v === 0 ? 1 : 0, --v, v |= v >>> 1, v |= v >>> 2, v |= v >>> 4, v |= v >>> 8, v |= v >>> 16, v + 1;
}
function isPow2(v) {
return !(v & v - 1) && !!v;
}
function log2(v) {
let r = (v > 65535 ? 1 : 0) << 4;
v >>>= r;
let shift = (v > 255 ? 1 : 0) << 3;
return v >>>= shift, r |= shift, shift = (v > 15 ? 1 : 0) << 2, v >>>= shift, r |= shift, shift = (v > 3 ? 1 : 0) << 1, v >>>= shift, r |= shift, r | v >> 1;
}
exports.isPow2 = isPow2;
exports.log2 = log2;
exports.nextPow2 = nextPow2;
//# sourceMappingURL=pow2.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"pow2.js","sources":["../../src/data/pow2.ts"],"sourcesContent":["// Taken from the bit-twiddle package\n\n/**\n * Rounds to next power of two.\n * @function nextPow2\n * @memberof PIXI.utils\n * @param {number} v - input value\n * @returns {number} - next rounded power of two\n */\nexport function nextPow2(v: number): number\n{\n v += v === 0 ? 1 : 0;\n --v;\n v |= v >>> 1;\n v |= v >>> 2;\n v |= v >>> 4;\n v |= v >>> 8;\n v |= v >>> 16;\n\n return v + 1;\n}\n\n/**\n * Checks if a number is a power of two.\n * @function isPow2\n * @memberof PIXI.utils\n * @param {number} v - input value\n * @returns {boolean} `true` if value is power of two\n */\nexport function isPow2(v: number): boolean\n{\n return !(v & (v - 1)) && (!!v);\n}\n\n/**\n * Computes ceil of log base 2\n * @function log2\n * @memberof PIXI.utils\n * @param {number} v - input value\n * @returns {number} logarithm base 2\n */\nexport function log2(v: number): number\n{\n let r = (v > 0xFFFF ? 1 : 0) << 4;\n\n v >>>= r;\n\n let shift = (v > 0xFF ? 1 : 0) << 3;\n\n v >>>= shift; r |= shift;\n shift = (v > 0xF ? 1 : 0) << 2;\n v >>>= shift; r |= shift;\n shift = (v > 0x3 ? 1 : 0) << 1;\n v >>>= shift; r |= shift;\n\n return r | (v >> 1);\n}\n"],"names":[],"mappings":";AASO,SAAS,SAAS,GACzB;AACS,SAAA,KAAA,MAAM,IAAI,IAAI,GACnB,EAAE,GACF,KAAK,MAAM,GACX,KAAK,MAAM,GACX,KAAK,MAAM,GACX,KAAK,MAAM,GACX,KAAK,MAAM,IAEJ,IAAI;AACf;AASO,SAAS,OAAO,GACvB;AACI,SAAO,EAAE,IAAK,IAAI,MAAQ,CAAC,CAAC;AAChC;AASO,SAAS,KAAK,GACrB;AACI,MAAI,KAAK,IAAI,QAAS,IAAI,MAAM;AAEzB,SAAA;AAEP,MAAI,SAAS,IAAI,MAAO,IAAI,MAAM;AAE3B,SAAA,OAAA,OAAO,KAAK,OACnB,SAAS,IAAI,KAAM,IAAI,MAAM,GAC7B,OAAO,OAAO,KAAK,OACnB,SAAS,IAAI,IAAM,IAAI,MAAM,GAC7B,OAAO,OAAO,KAAK,OAEZ,IAAK,KAAK;AACrB;;;;"}

View File

@@ -0,0 +1,18 @@
function nextPow2(v) {
return v += v === 0 ? 1 : 0, --v, v |= v >>> 1, v |= v >>> 2, v |= v >>> 4, v |= v >>> 8, v |= v >>> 16, v + 1;
}
function isPow2(v) {
return !(v & v - 1) && !!v;
}
function log2(v) {
let r = (v > 65535 ? 1 : 0) << 4;
v >>>= r;
let shift = (v > 255 ? 1 : 0) << 3;
return v >>>= shift, r |= shift, shift = (v > 15 ? 1 : 0) << 2, v >>>= shift, r |= shift, shift = (v > 3 ? 1 : 0) << 1, v >>>= shift, r |= shift, r | v >> 1;
}
export {
isPow2,
log2,
nextPow2
};
//# sourceMappingURL=pow2.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"pow2.mjs","sources":["../../src/data/pow2.ts"],"sourcesContent":["// Taken from the bit-twiddle package\n\n/**\n * Rounds to next power of two.\n * @function nextPow2\n * @memberof PIXI.utils\n * @param {number} v - input value\n * @returns {number} - next rounded power of two\n */\nexport function nextPow2(v: number): number\n{\n v += v === 0 ? 1 : 0;\n --v;\n v |= v >>> 1;\n v |= v >>> 2;\n v |= v >>> 4;\n v |= v >>> 8;\n v |= v >>> 16;\n\n return v + 1;\n}\n\n/**\n * Checks if a number is a power of two.\n * @function isPow2\n * @memberof PIXI.utils\n * @param {number} v - input value\n * @returns {boolean} `true` if value is power of two\n */\nexport function isPow2(v: number): boolean\n{\n return !(v & (v - 1)) && (!!v);\n}\n\n/**\n * Computes ceil of log base 2\n * @function log2\n * @memberof PIXI.utils\n * @param {number} v - input value\n * @returns {number} logarithm base 2\n */\nexport function log2(v: number): number\n{\n let r = (v > 0xFFFF ? 1 : 0) << 4;\n\n v >>>= r;\n\n let shift = (v > 0xFF ? 1 : 0) << 3;\n\n v >>>= shift; r |= shift;\n shift = (v > 0xF ? 1 : 0) << 2;\n v >>>= shift; r |= shift;\n shift = (v > 0x3 ? 1 : 0) << 1;\n v >>>= shift; r |= shift;\n\n return r | (v >> 1);\n}\n"],"names":[],"mappings":"AASO,SAAS,SAAS,GACzB;AACS,SAAA,KAAA,MAAM,IAAI,IAAI,GACnB,EAAE,GACF,KAAK,MAAM,GACX,KAAK,MAAM,GACX,KAAK,MAAM,GACX,KAAK,MAAM,GACX,KAAK,MAAM,IAEJ,IAAI;AACf;AASO,SAAS,OAAO,GACvB;AACI,SAAO,EAAE,IAAK,IAAI,MAAQ,CAAC,CAAC;AAChC;AASO,SAAS,KAAK,GACrB;AACI,MAAI,KAAK,IAAI,QAAS,IAAI,MAAM;AAEzB,SAAA;AAEP,MAAI,SAAS,IAAI,MAAO,IAAI,MAAM;AAE3B,SAAA,OAAA,OAAO,KAAK,OACnB,SAAS,IAAI,KAAM,IAAI,MAAM,GAC7B,OAAO,OAAO,KAAK,OACnB,SAAS,IAAI,IAAM,IAAI,MAAM,GAC7B,OAAO,OAAO,KAAK,OAEZ,IAAK,KAAK;AACrB;"}

View File

@@ -0,0 +1,14 @@
"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/data/removeItems.ts"],"sourcesContent":["/**\n * Remove items from a javascript array without generating garbage\n * @function removeItems\n * @memberof PIXI.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,YAAY,KAAY,UAAkB,aAC1D;AACI,QAAM,SAAS,IAAI;AACf,MAAA;AAEA,MAAA,YAAY,UAAU,gBAAgB;AAEtC;AAGJ,gBAAe,WAAW,cAAc,SAAS,SAAS,WAAW;AAErE,QAAM,MAAM,SAAS;AAErB,OAAK,IAAI,UAAU,IAAI,KAAK,EAAE;AAE1B,QAAI,CAAC,IAAI,IAAI,IAAI,WAAW;AAGhC,MAAI,SAAS;AACjB;;"}

View File

@@ -0,0 +1,15 @@
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/data/removeItems.ts"],"sourcesContent":["/**\n * Remove items from a javascript array without generating garbage\n * @function removeItems\n * @memberof PIXI.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,YAAY,KAAY,UAAkB,aAC1D;AACI,QAAM,SAAS,IAAI;AACf,MAAA;AAEA,MAAA,YAAY,UAAU,gBAAgB;AAEtC;AAGJ,gBAAe,WAAW,cAAc,SAAS,SAAS,WAAW;AAErE,QAAM,MAAM,SAAS;AAErB,OAAK,IAAI,UAAU,IAAI,KAAK,EAAE;AAE1B,QAAI,CAAC,IAAI,IAAI,IAAI,WAAW;AAGhC,MAAI,SAAS;AACjB;"}

View File

@@ -0,0 +1,6 @@
"use strict";
function sign(n) {
return n === 0 ? 0 : n < 0 ? -1 : 1;
}
exports.sign = sign;
//# sourceMappingURL=sign.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"sign.js","sources":["../../src/data/sign.ts"],"sourcesContent":["/**\n * Returns sign of number\n * @memberof PIXI.utils\n * @function sign\n * @param {number} n - the number to check the sign of\n * @returns {number} 0 if `n` is 0, -1 if `n` is negative, 1 if `n` is positive\n */\nexport function sign(n: number): -1 | 0 | 1\n{\n if (n === 0) return 0;\n\n return n < 0 ? -1 : 1;\n}\n"],"names":[],"mappings":";AAOO,SAAS,KAAK,GACrB;AACI,SAAI,MAAM,IAAU,IAEb,IAAI,IAAI,KAAK;AACxB;;"}

View File

@@ -0,0 +1,7 @@
function sign(n) {
return n === 0 ? 0 : n < 0 ? -1 : 1;
}
export {
sign
};
//# sourceMappingURL=sign.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"sign.mjs","sources":["../../src/data/sign.ts"],"sourcesContent":["/**\n * Returns sign of number\n * @memberof PIXI.utils\n * @function sign\n * @param {number} n - the number to check the sign of\n * @returns {number} 0 if `n` is 0, -1 if `n` is negative, 1 if `n` is positive\n */\nexport function sign(n: number): -1 | 0 | 1\n{\n if (n === 0) return 0;\n\n return n < 0 ? -1 : 1;\n}\n"],"names":[],"mappings":"AAOO,SAAS,KAAK,GACrB;AACI,SAAI,MAAM,IAAU,IAEb,IAAI,IAAI,KAAK;AACxB;"}

View File

@@ -0,0 +1,7 @@
"use strict";
let nextUid = 0;
function uid() {
return ++nextUid;
}
exports.uid = uid;
//# sourceMappingURL=uid.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"uid.js","sources":["../../src/data/uid.ts"],"sourcesContent":["let nextUid = 0;\n\n/**\n * Gets the next unique identifier\n * @memberof PIXI.utils\n * @function uid\n * @returns {number} The next unique identifier to use.\n */\nexport function uid(): number\n{\n return ++nextUid;\n}\n"],"names":[],"mappings":";AAAA,IAAI,UAAU;AAQP,SAAS,MAChB;AACI,SAAO,EAAE;AACb;;"}

View File

@@ -0,0 +1,8 @@
let nextUid = 0;
function uid() {
return ++nextUid;
}
export {
uid
};
//# sourceMappingURL=uid.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"uid.mjs","sources":["../../src/data/uid.ts"],"sourcesContent":["let nextUid = 0;\n\n/**\n * Gets the next unique identifier\n * @memberof PIXI.utils\n * @function uid\n * @returns {number} The next unique identifier to use.\n */\nexport function uid(): number\n{\n return ++nextUid;\n}\n"],"names":[],"mappings":"AAAA,IAAI,UAAU;AAQP,SAAS,MAChB;AACI,SAAO,EAAE;AACb;"}