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

21
resources/app/node_modules/@pixi/prepare/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,21 @@
The MIT License
Copyright (c) 2013-2023 Mathew Groves, Chad Engler
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

View File

@@ -0,0 +1,145 @@
"use strict";
var core = require("@pixi/core"), display = require("@pixi/display"), text = require("@pixi/text"), CountLimiter = require("./CountLimiter.js");
function findMultipleBaseTextures(item, queue) {
let result = !1;
if (item?._textures?.length) {
for (let i = 0; i < item._textures.length; i++)
if (item._textures[i] instanceof core.Texture) {
const baseTexture = item._textures[i].baseTexture;
queue.includes(baseTexture) || (queue.push(baseTexture), result = !0);
}
}
return result;
}
function findBaseTexture(item, queue) {
if (item.baseTexture instanceof core.BaseTexture) {
const texture = item.baseTexture;
return queue.includes(texture) || queue.push(texture), !0;
}
return !1;
}
function findTexture(item, queue) {
if (item._texture && item._texture instanceof core.Texture) {
const texture = item._texture.baseTexture;
return queue.includes(texture) || queue.push(texture), !0;
}
return !1;
}
function drawText(_helper, item) {
return item instanceof text.Text ? (item.updateText(!0), !0) : !1;
}
function calculateTextStyle(_helper, item) {
if (item instanceof text.TextStyle) {
const font = item.toFontString();
return text.TextMetrics.measureFont(font), !0;
}
return !1;
}
function findText(item, queue) {
if (item instanceof text.Text) {
queue.includes(item.style) || queue.push(item.style), queue.includes(item) || queue.push(item);
const texture = item._texture.baseTexture;
return queue.includes(texture) || queue.push(texture), !0;
}
return !1;
}
function findTextStyle(item, queue) {
return item instanceof text.TextStyle ? (queue.includes(item) || queue.push(item), !0) : !1;
}
const _BasePrepare = class _BasePrepare2 {
/**
* @param {PIXI.IRenderer} renderer - A reference to the current renderer
*/
constructor(renderer) {
this.limiter = new CountLimiter.CountLimiter(_BasePrepare2.uploadsPerFrame), this.renderer = renderer, this.uploadHookHelper = null, this.queue = [], this.addHooks = [], this.uploadHooks = [], this.completes = [], this.ticking = !1, this.delayedTick = () => {
this.queue && this.prepareItems();
}, this.registerFindHook(findText), this.registerFindHook(findTextStyle), this.registerFindHook(findMultipleBaseTextures), this.registerFindHook(findBaseTexture), this.registerFindHook(findTexture), this.registerUploadHook(drawText), this.registerUploadHook(calculateTextStyle);
}
/**
* Upload all the textures and graphics to the GPU.
* @method PIXI.BasePrepare#upload
* @param {PIXI.DisplayObject|PIXI.Container|PIXI.BaseTexture|PIXI.Texture|PIXI.Graphics|PIXI.Text} [item] -
* Container or display object to search for items to upload or the items to upload themselves,
* or optionally ommitted, if items have been added using {@link PIXI.BasePrepare#add `prepare.add`}.
*/
upload(item) {
return new Promise((resolve) => {
item && this.add(item), this.queue.length ? (this.completes.push(resolve), this.ticking || (this.ticking = !0, core.Ticker.system.addOnce(this.tick, this, core.UPDATE_PRIORITY.UTILITY))) : resolve();
});
}
/**
* Handle tick update
* @private
*/
tick() {
setTimeout(this.delayedTick, 0);
}
/**
* Actually prepare items. This is handled outside of the tick because it will take a while
* and we do NOT want to block the current animation frame from rendering.
* @private
*/
prepareItems() {
for (this.limiter.beginFrame(); this.queue.length && this.limiter.allowedToUpload(); ) {
const item = this.queue[0];
let uploaded = !1;
if (item && !item._destroyed) {
for (let i = 0, len = this.uploadHooks.length; i < len; i++)
if (this.uploadHooks[i](this.uploadHookHelper, item)) {
this.queue.shift(), uploaded = !0;
break;
}
}
uploaded || this.queue.shift();
}
if (this.queue.length)
core.Ticker.system.addOnce(this.tick, this, core.UPDATE_PRIORITY.UTILITY);
else {
this.ticking = !1;
const completes = this.completes.slice(0);
this.completes.length = 0;
for (let i = 0, len = completes.length; i < len; i++)
completes[i]();
}
}
/**
* Adds hooks for finding items.
* @param {Function} addHook - Function call that takes two parameters: `item:*, queue:Array`
* function must return `true` if it was able to add item to the queue.
* @returns Instance of plugin for chaining.
*/
registerFindHook(addHook) {
return addHook && this.addHooks.push(addHook), this;
}
/**
* Adds hooks for uploading items.
* @param {Function} uploadHook - Function call that takes two parameters: `prepare:CanvasPrepare, item:*` and
* function must return `true` if it was able to handle upload of item.
* @returns Instance of plugin for chaining.
*/
registerUploadHook(uploadHook) {
return uploadHook && this.uploadHooks.push(uploadHook), this;
}
/**
* Manually add an item to the uploading queue.
* @param {PIXI.DisplayObject|PIXI.Container|PIXI.BaseTexture|PIXI.Texture|PIXI.Graphics|PIXI.Text|*} item - Object to
* add to the queue
* @returns Instance of plugin for chaining.
*/
add(item) {
for (let i = 0, len = this.addHooks.length; i < len && !this.addHooks[i](item, this.queue); i++)
;
if (item instanceof display.Container)
for (let i = item.children.length - 1; i >= 0; i--)
this.add(item.children[i]);
return this;
}
/** Destroys the plugin, don't use after this. */
destroy() {
this.ticking && core.Ticker.system.remove(this.tick, this), this.ticking = !1, this.addHooks = null, this.uploadHooks = null, this.renderer = null, this.completes = null, this.queue = null, this.limiter = null, this.uploadHookHelper = null;
}
};
_BasePrepare.uploadsPerFrame = 4;
let BasePrepare = _BasePrepare;
exports.BasePrepare = BasePrepare;
//# sourceMappingURL=BasePrepare.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,149 @@
import { Texture, BaseTexture, Ticker, UPDATE_PRIORITY } from "@pixi/core";
import { Container } from "@pixi/display";
import { Text, TextStyle, TextMetrics } from "@pixi/text";
import { CountLimiter } from "./CountLimiter.mjs";
function findMultipleBaseTextures(item, queue) {
let result = !1;
if (item?._textures?.length) {
for (let i = 0; i < item._textures.length; i++)
if (item._textures[i] instanceof Texture) {
const baseTexture = item._textures[i].baseTexture;
queue.includes(baseTexture) || (queue.push(baseTexture), result = !0);
}
}
return result;
}
function findBaseTexture(item, queue) {
if (item.baseTexture instanceof BaseTexture) {
const texture = item.baseTexture;
return queue.includes(texture) || queue.push(texture), !0;
}
return !1;
}
function findTexture(item, queue) {
if (item._texture && item._texture instanceof Texture) {
const texture = item._texture.baseTexture;
return queue.includes(texture) || queue.push(texture), !0;
}
return !1;
}
function drawText(_helper, item) {
return item instanceof Text ? (item.updateText(!0), !0) : !1;
}
function calculateTextStyle(_helper, item) {
if (item instanceof TextStyle) {
const font = item.toFontString();
return TextMetrics.measureFont(font), !0;
}
return !1;
}
function findText(item, queue) {
if (item instanceof Text) {
queue.includes(item.style) || queue.push(item.style), queue.includes(item) || queue.push(item);
const texture = item._texture.baseTexture;
return queue.includes(texture) || queue.push(texture), !0;
}
return !1;
}
function findTextStyle(item, queue) {
return item instanceof TextStyle ? (queue.includes(item) || queue.push(item), !0) : !1;
}
const _BasePrepare = class _BasePrepare2 {
/**
* @param {PIXI.IRenderer} renderer - A reference to the current renderer
*/
constructor(renderer) {
this.limiter = new CountLimiter(_BasePrepare2.uploadsPerFrame), this.renderer = renderer, this.uploadHookHelper = null, this.queue = [], this.addHooks = [], this.uploadHooks = [], this.completes = [], this.ticking = !1, this.delayedTick = () => {
this.queue && this.prepareItems();
}, this.registerFindHook(findText), this.registerFindHook(findTextStyle), this.registerFindHook(findMultipleBaseTextures), this.registerFindHook(findBaseTexture), this.registerFindHook(findTexture), this.registerUploadHook(drawText), this.registerUploadHook(calculateTextStyle);
}
/**
* Upload all the textures and graphics to the GPU.
* @method PIXI.BasePrepare#upload
* @param {PIXI.DisplayObject|PIXI.Container|PIXI.BaseTexture|PIXI.Texture|PIXI.Graphics|PIXI.Text} [item] -
* Container or display object to search for items to upload or the items to upload themselves,
* or optionally ommitted, if items have been added using {@link PIXI.BasePrepare#add `prepare.add`}.
*/
upload(item) {
return new Promise((resolve) => {
item && this.add(item), this.queue.length ? (this.completes.push(resolve), this.ticking || (this.ticking = !0, Ticker.system.addOnce(this.tick, this, UPDATE_PRIORITY.UTILITY))) : resolve();
});
}
/**
* Handle tick update
* @private
*/
tick() {
setTimeout(this.delayedTick, 0);
}
/**
* Actually prepare items. This is handled outside of the tick because it will take a while
* and we do NOT want to block the current animation frame from rendering.
* @private
*/
prepareItems() {
for (this.limiter.beginFrame(); this.queue.length && this.limiter.allowedToUpload(); ) {
const item = this.queue[0];
let uploaded = !1;
if (item && !item._destroyed) {
for (let i = 0, len = this.uploadHooks.length; i < len; i++)
if (this.uploadHooks[i](this.uploadHookHelper, item)) {
this.queue.shift(), uploaded = !0;
break;
}
}
uploaded || this.queue.shift();
}
if (this.queue.length)
Ticker.system.addOnce(this.tick, this, UPDATE_PRIORITY.UTILITY);
else {
this.ticking = !1;
const completes = this.completes.slice(0);
this.completes.length = 0;
for (let i = 0, len = completes.length; i < len; i++)
completes[i]();
}
}
/**
* Adds hooks for finding items.
* @param {Function} addHook - Function call that takes two parameters: `item:*, queue:Array`
* function must return `true` if it was able to add item to the queue.
* @returns Instance of plugin for chaining.
*/
registerFindHook(addHook) {
return addHook && this.addHooks.push(addHook), this;
}
/**
* Adds hooks for uploading items.
* @param {Function} uploadHook - Function call that takes two parameters: `prepare:CanvasPrepare, item:*` and
* function must return `true` if it was able to handle upload of item.
* @returns Instance of plugin for chaining.
*/
registerUploadHook(uploadHook) {
return uploadHook && this.uploadHooks.push(uploadHook), this;
}
/**
* Manually add an item to the uploading queue.
* @param {PIXI.DisplayObject|PIXI.Container|PIXI.BaseTexture|PIXI.Texture|PIXI.Graphics|PIXI.Text|*} item - Object to
* add to the queue
* @returns Instance of plugin for chaining.
*/
add(item) {
for (let i = 0, len = this.addHooks.length; i < len && !this.addHooks[i](item, this.queue); i++)
;
if (item instanceof Container)
for (let i = item.children.length - 1; i >= 0; i--)
this.add(item.children[i]);
return this;
}
/** Destroys the plugin, don't use after this. */
destroy() {
this.ticking && Ticker.system.remove(this.tick, this), this.ticking = !1, this.addHooks = null, this.uploadHooks = null, this.renderer = null, this.completes = null, this.queue = null, this.limiter = null, this.uploadHookHelper = null;
}
};
_BasePrepare.uploadsPerFrame = 4;
let BasePrepare = _BasePrepare;
export {
BasePrepare
};
//# sourceMappingURL=BasePrepare.mjs.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,22 @@
"use strict";
class CountLimiter {
/**
* @param maxItemsPerFrame - The maximum number of items that can be prepared each frame.
*/
constructor(maxItemsPerFrame) {
this.maxItemsPerFrame = maxItemsPerFrame, this.itemsLeft = 0;
}
/** Resets any counting properties to start fresh on a new frame. */
beginFrame() {
this.itemsLeft = this.maxItemsPerFrame;
}
/**
* Checks to see if another item can be uploaded. This should only be called once per item.
* @returns If the item is allowed to be uploaded.
*/
allowedToUpload() {
return this.itemsLeft-- > 0;
}
}
exports.CountLimiter = CountLimiter;
//# sourceMappingURL=CountLimiter.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"CountLimiter.js","sources":["../src/CountLimiter.ts"],"sourcesContent":["/**\n * CountLimiter limits the number of items handled by a {@link PIXI.BasePrepare} to a specified\n * number of items per frame.\n * @memberof PIXI\n */\nexport class CountLimiter\n{\n /** The maximum number of items that can be prepared each frame. */\n public maxItemsPerFrame: number;\n\n /** The number of items that can be prepared in the current frame. */\n public itemsLeft: number;\n\n /**\n * @param maxItemsPerFrame - The maximum number of items that can be prepared each frame.\n */\n constructor(maxItemsPerFrame: number)\n {\n this.maxItemsPerFrame = maxItemsPerFrame;\n this.itemsLeft = 0;\n }\n\n /** Resets any counting properties to start fresh on a new frame. */\n beginFrame(): void\n {\n this.itemsLeft = this.maxItemsPerFrame;\n }\n\n /**\n * Checks to see if another item can be uploaded. This should only be called once per item.\n * @returns If the item is allowed to be uploaded.\n */\n allowedToUpload(): boolean\n {\n return this.itemsLeft-- > 0;\n }\n}\n"],"names":[],"mappings":";AAKO,MAAM,aACb;AAAA;AAAA;AAAA;AAAA,EAUI,YAAY,kBACZ;AACS,SAAA,mBAAmB,kBACxB,KAAK,YAAY;AAAA,EACrB;AAAA;AAAA,EAGA,aACA;AACI,SAAK,YAAY,KAAK;AAAA,EAC1B;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,kBACA;AACI,WAAO,KAAK,cAAc;AAAA,EAC9B;AACJ;;"}

View File

@@ -0,0 +1,23 @@
class CountLimiter {
/**
* @param maxItemsPerFrame - The maximum number of items that can be prepared each frame.
*/
constructor(maxItemsPerFrame) {
this.maxItemsPerFrame = maxItemsPerFrame, this.itemsLeft = 0;
}
/** Resets any counting properties to start fresh on a new frame. */
beginFrame() {
this.itemsLeft = this.maxItemsPerFrame;
}
/**
* Checks to see if another item can be uploaded. This should only be called once per item.
* @returns If the item is allowed to be uploaded.
*/
allowedToUpload() {
return this.itemsLeft-- > 0;
}
}
export {
CountLimiter
};
//# sourceMappingURL=CountLimiter.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"CountLimiter.mjs","sources":["../src/CountLimiter.ts"],"sourcesContent":["/**\n * CountLimiter limits the number of items handled by a {@link PIXI.BasePrepare} to a specified\n * number of items per frame.\n * @memberof PIXI\n */\nexport class CountLimiter\n{\n /** The maximum number of items that can be prepared each frame. */\n public maxItemsPerFrame: number;\n\n /** The number of items that can be prepared in the current frame. */\n public itemsLeft: number;\n\n /**\n * @param maxItemsPerFrame - The maximum number of items that can be prepared each frame.\n */\n constructor(maxItemsPerFrame: number)\n {\n this.maxItemsPerFrame = maxItemsPerFrame;\n this.itemsLeft = 0;\n }\n\n /** Resets any counting properties to start fresh on a new frame. */\n beginFrame(): void\n {\n this.itemsLeft = this.maxItemsPerFrame;\n }\n\n /**\n * Checks to see if another item can be uploaded. This should only be called once per item.\n * @returns If the item is allowed to be uploaded.\n */\n allowedToUpload(): boolean\n {\n return this.itemsLeft-- > 0;\n }\n}\n"],"names":[],"mappings":"AAKO,MAAM,aACb;AAAA;AAAA;AAAA;AAAA,EAUI,YAAY,kBACZ;AACS,SAAA,mBAAmB,kBACxB,KAAK,YAAY;AAAA,EACrB;AAAA;AAAA,EAGA,aACA;AACI,SAAK,YAAY,KAAK;AAAA,EAC1B;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,kBACA;AACI,WAAO,KAAK,cAAc;AAAA,EAC9B;AACJ;"}

View File

@@ -0,0 +1,35 @@
"use strict";
var core = require("@pixi/core"), graphics = require("@pixi/graphics"), BasePrepare = require("./BasePrepare.js");
function uploadBaseTextures(renderer, item) {
return item instanceof core.BaseTexture ? (item._glTextures[renderer.CONTEXT_UID] || renderer.texture.bind(item), !0) : !1;
}
function uploadGraphics(renderer, item) {
if (!(item instanceof graphics.Graphics))
return !1;
const { geometry } = item;
item.finishPoly(), geometry.updateBatches();
const { batches } = geometry;
for (let i = 0; i < batches.length; i++) {
const { texture } = batches[i].style;
texture && uploadBaseTextures(renderer, texture.baseTexture);
}
return geometry.batchable || renderer.geometry.bind(geometry, item._resolveDirectShader(renderer)), !0;
}
function findGraphics(item, queue) {
return item instanceof graphics.Graphics ? (queue.push(item), !0) : !1;
}
class Prepare extends BasePrepare.BasePrepare {
/**
* @param {PIXI.Renderer} renderer - A reference to the current renderer
*/
constructor(renderer) {
super(renderer), this.uploadHookHelper = this.renderer, this.registerFindHook(findGraphics), this.registerUploadHook(uploadBaseTextures), this.registerUploadHook(uploadGraphics);
}
}
Prepare.extension = {
name: "prepare",
type: core.ExtensionType.RendererSystem
};
core.extensions.add(Prepare);
exports.Prepare = Prepare;
//# sourceMappingURL=Prepare.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,38 @@
import { BaseTexture, ExtensionType, extensions } from "@pixi/core";
import { Graphics } from "@pixi/graphics";
import { BasePrepare } from "./BasePrepare.mjs";
function uploadBaseTextures(renderer, item) {
return item instanceof BaseTexture ? (item._glTextures[renderer.CONTEXT_UID] || renderer.texture.bind(item), !0) : !1;
}
function uploadGraphics(renderer, item) {
if (!(item instanceof Graphics))
return !1;
const { geometry } = item;
item.finishPoly(), geometry.updateBatches();
const { batches } = geometry;
for (let i = 0; i < batches.length; i++) {
const { texture } = batches[i].style;
texture && uploadBaseTextures(renderer, texture.baseTexture);
}
return geometry.batchable || renderer.geometry.bind(geometry, item._resolveDirectShader(renderer)), !0;
}
function findGraphics(item, queue) {
return item instanceof Graphics ? (queue.push(item), !0) : !1;
}
class Prepare extends BasePrepare {
/**
* @param {PIXI.Renderer} renderer - A reference to the current renderer
*/
constructor(renderer) {
super(renderer), this.uploadHookHelper = this.renderer, this.registerFindHook(findGraphics), this.registerUploadHook(uploadBaseTextures), this.registerUploadHook(uploadGraphics);
}
}
Prepare.extension = {
name: "prepare",
type: ExtensionType.RendererSystem
};
extensions.add(Prepare);
export {
Prepare
};
//# sourceMappingURL=Prepare.mjs.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,20 @@
"use strict";
class TimeLimiter {
/** @param maxMilliseconds - The maximum milliseconds that can be spent preparing items each frame. */
constructor(maxMilliseconds) {
this.maxMilliseconds = maxMilliseconds, this.frameStart = 0;
}
/** Resets any counting properties to start fresh on a new frame. */
beginFrame() {
this.frameStart = Date.now();
}
/**
* Checks to see if another item can be uploaded. This should only be called once per item.
* @returns - If the item is allowed to be uploaded.
*/
allowedToUpload() {
return Date.now() - this.frameStart < this.maxMilliseconds;
}
}
exports.TimeLimiter = TimeLimiter;
//# sourceMappingURL=TimeLimiter.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"TimeLimiter.js","sources":["../src/TimeLimiter.ts"],"sourcesContent":["/**\n * TimeLimiter limits the number of items handled by a {@link PIXI.BasePrepare} to a specified\n * number of milliseconds per frame.\n * @memberof PIXI\n */\nexport class TimeLimiter\n{\n /** The maximum milliseconds that can be spent preparing items each frame. */\n public maxMilliseconds: number;\n\n /**\n * The start time of the current frame.\n * @readonly\n */\n public frameStart: number;\n\n /** @param maxMilliseconds - The maximum milliseconds that can be spent preparing items each frame. */\n constructor(maxMilliseconds: number)\n {\n this.maxMilliseconds = maxMilliseconds;\n this.frameStart = 0;\n }\n\n /** Resets any counting properties to start fresh on a new frame. */\n beginFrame(): void\n {\n this.frameStart = Date.now();\n }\n\n /**\n * Checks to see if another item can be uploaded. This should only be called once per item.\n * @returns - If the item is allowed to be uploaded.\n */\n allowedToUpload(): boolean\n {\n return Date.now() - this.frameStart < this.maxMilliseconds;\n }\n}\n"],"names":[],"mappings":";AAKO,MAAM,YACb;AAAA;AAAA,EAWI,YAAY,iBACZ;AACS,SAAA,kBAAkB,iBACvB,KAAK,aAAa;AAAA,EACtB;AAAA;AAAA,EAGA,aACA;AACS,SAAA,aAAa,KAAK;EAC3B;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,kBACA;AACI,WAAO,KAAK,IAAQ,IAAA,KAAK,aAAa,KAAK;AAAA,EAC/C;AACJ;;"}

View File

@@ -0,0 +1,21 @@
class TimeLimiter {
/** @param maxMilliseconds - The maximum milliseconds that can be spent preparing items each frame. */
constructor(maxMilliseconds) {
this.maxMilliseconds = maxMilliseconds, this.frameStart = 0;
}
/** Resets any counting properties to start fresh on a new frame. */
beginFrame() {
this.frameStart = Date.now();
}
/**
* Checks to see if another item can be uploaded. This should only be called once per item.
* @returns - If the item is allowed to be uploaded.
*/
allowedToUpload() {
return Date.now() - this.frameStart < this.maxMilliseconds;
}
}
export {
TimeLimiter
};
//# sourceMappingURL=TimeLimiter.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"TimeLimiter.mjs","sources":["../src/TimeLimiter.ts"],"sourcesContent":["/**\n * TimeLimiter limits the number of items handled by a {@link PIXI.BasePrepare} to a specified\n * number of milliseconds per frame.\n * @memberof PIXI\n */\nexport class TimeLimiter\n{\n /** The maximum milliseconds that can be spent preparing items each frame. */\n public maxMilliseconds: number;\n\n /**\n * The start time of the current frame.\n * @readonly\n */\n public frameStart: number;\n\n /** @param maxMilliseconds - The maximum milliseconds that can be spent preparing items each frame. */\n constructor(maxMilliseconds: number)\n {\n this.maxMilliseconds = maxMilliseconds;\n this.frameStart = 0;\n }\n\n /** Resets any counting properties to start fresh on a new frame. */\n beginFrame(): void\n {\n this.frameStart = Date.now();\n }\n\n /**\n * Checks to see if another item can be uploaded. This should only be called once per item.\n * @returns - If the item is allowed to be uploaded.\n */\n allowedToUpload(): boolean\n {\n return Date.now() - this.frameStart < this.maxMilliseconds;\n }\n}\n"],"names":[],"mappings":"AAKO,MAAM,YACb;AAAA;AAAA,EAWI,YAAY,iBACZ;AACS,SAAA,kBAAkB,iBACvB,KAAK,aAAa;AAAA,EACtB;AAAA;AAAA,EAGA,aACA;AACS,SAAA,aAAa,KAAK;EAC3B;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,kBACA;AACI,WAAO,KAAK,IAAQ,IAAA,KAAK,aAAa,KAAK;AAAA,EAC/C;AACJ;"}

View File

@@ -0,0 +1,8 @@
"use strict";
require("./settings.js");
var BasePrepare = require("./BasePrepare.js"), CountLimiter = require("./CountLimiter.js"), Prepare = require("./Prepare.js"), TimeLimiter = require("./TimeLimiter.js");
exports.BasePrepare = BasePrepare.BasePrepare;
exports.CountLimiter = CountLimiter.CountLimiter;
exports.Prepare = Prepare.Prepare;
exports.TimeLimiter = TimeLimiter.TimeLimiter;
//# sourceMappingURL=index.js.map

View File

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

12
resources/app/node_modules/@pixi/prepare/lib/index.mjs generated vendored Normal file
View File

@@ -0,0 +1,12 @@
import "./settings.mjs";
import { BasePrepare } from "./BasePrepare.mjs";
import { CountLimiter } from "./CountLimiter.mjs";
import { Prepare } from "./Prepare.mjs";
import { TimeLimiter } from "./TimeLimiter.mjs";
export {
BasePrepare,
CountLimiter,
Prepare,
TimeLimiter
};
//# sourceMappingURL=index.mjs.map

View File

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

View File

@@ -0,0 +1,28 @@
"use strict";
var core = require("@pixi/core"), BasePrepare = require("./BasePrepare.js");
Object.defineProperties(core.settings, {
/**
* Default number of uploads per frame using prepare plugin.
* @static
* @memberof PIXI.settings
* @name UPLOADS_PER_FRAME
* @deprecated since 7.1.0
* @see PIXI.BasePrepare.uploadsPerFrame
* @type {number}
*/
UPLOADS_PER_FRAME: {
get() {
return BasePrepare.BasePrepare.uploadsPerFrame;
},
set(value) {
core.utils.deprecation("7.1.0", "settings.UPLOADS_PER_FRAME is deprecated, use prepare.BasePrepare.uploadsPerFrame"), BasePrepare.BasePrepare.uploadsPerFrame = value;
}
}
});
Object.defineProperty(exports, "settings", {
enumerable: !0,
get: function() {
return core.settings;
}
});
//# sourceMappingURL=settings.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"settings.js","sources":["../src/settings.ts"],"sourcesContent":["import { settings, utils } from '@pixi/core';\nimport { BasePrepare } from './BasePrepare';\n\nObject.defineProperties(settings, {\n /**\n * Default number of uploads per frame using prepare plugin.\n * @static\n * @memberof PIXI.settings\n * @name UPLOADS_PER_FRAME\n * @deprecated since 7.1.0\n * @see PIXI.BasePrepare.uploadsPerFrame\n * @type {number}\n */\n UPLOADS_PER_FRAME:\n {\n get()\n {\n return BasePrepare.uploadsPerFrame;\n },\n set(value: number)\n {\n if (process.env.DEBUG)\n {\n // eslint-disable-next-line max-len\n utils.deprecation('7.1.0', 'settings.UPLOADS_PER_FRAME is deprecated, use prepare.BasePrepare.uploadsPerFrame');\n }\n BasePrepare.uploadsPerFrame = value;\n },\n },\n});\n\nexport { settings };\n"],"names":["settings","BasePrepare","utils"],"mappings":";;AAGA,OAAO,iBAAiBA,KAAAA,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAU9B,mBACA;AAAA,IACI,MACA;AACI,aAAOC,YAAAA,YAAY;AAAA,IACvB;AAAA,IACA,IAAI,OACJ;AAIQC,WAAA,MAAM,YAAY,SAAS,mFAAmF,GAElHD,wBAAY,kBAAkB;AAAA,IAClC;AAAA,EACJ;AACJ,CAAC;;;;;;;"}

View File

@@ -0,0 +1,26 @@
import { settings, utils } from "@pixi/core";
import { settings as settings2 } from "@pixi/core";
import { BasePrepare } from "./BasePrepare.mjs";
Object.defineProperties(settings, {
/**
* Default number of uploads per frame using prepare plugin.
* @static
* @memberof PIXI.settings
* @name UPLOADS_PER_FRAME
* @deprecated since 7.1.0
* @see PIXI.BasePrepare.uploadsPerFrame
* @type {number}
*/
UPLOADS_PER_FRAME: {
get() {
return BasePrepare.uploadsPerFrame;
},
set(value) {
utils.deprecation("7.1.0", "settings.UPLOADS_PER_FRAME is deprecated, use prepare.BasePrepare.uploadsPerFrame"), BasePrepare.uploadsPerFrame = value;
}
}
});
export {
settings2 as settings
};
//# sourceMappingURL=settings.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"settings.mjs","sources":["../src/settings.ts"],"sourcesContent":["import { settings, utils } from '@pixi/core';\nimport { BasePrepare } from './BasePrepare';\n\nObject.defineProperties(settings, {\n /**\n * Default number of uploads per frame using prepare plugin.\n * @static\n * @memberof PIXI.settings\n * @name UPLOADS_PER_FRAME\n * @deprecated since 7.1.0\n * @see PIXI.BasePrepare.uploadsPerFrame\n * @type {number}\n */\n UPLOADS_PER_FRAME:\n {\n get()\n {\n return BasePrepare.uploadsPerFrame;\n },\n set(value: number)\n {\n if (process.env.DEBUG)\n {\n // eslint-disable-next-line max-len\n utils.deprecation('7.1.0', 'settings.UPLOADS_PER_FRAME is deprecated, use prepare.BasePrepare.uploadsPerFrame');\n }\n BasePrepare.uploadsPerFrame = value;\n },\n },\n});\n\nexport { settings };\n"],"names":[],"mappings":";;;AAGA,OAAO,iBAAiB,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAU9B,mBACA;AAAA,IACI,MACA;AACI,aAAO,YAAY;AAAA,IACvB;AAAA,IACA,IAAI,OACJ;AAIQ,YAAM,YAAY,SAAS,mFAAmF,GAElH,YAAY,kBAAkB;AAAA,IAClC;AAAA,EACJ;AACJ,CAAC;"}

40
resources/app/node_modules/@pixi/prepare/package.json generated vendored Normal file
View File

@@ -0,0 +1,40 @@
{
"name": "@pixi/prepare",
"version": "7.4.2",
"main": "lib/index.js",
"module": "lib/index.mjs",
"types": "lib/index.d.ts",
"exports": {
".": {
"import": {
"types": "./lib/index.d.ts",
"default": "./lib/index.mjs"
},
"require": {
"types": "./lib/index.d.ts",
"default": "./lib/index.js"
}
}
},
"description": "Plugin to allow uploading textures to the GPU",
"author": "Mat Groves",
"homepage": "http://pixijs.com/",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/pixijs/pixijs.git"
},
"publishConfig": {
"access": "public"
},
"files": [
"lib",
"*.d.ts"
],
"peerDependencies": {
"@pixi/core": "7.4.2",
"@pixi/display": "7.4.2",
"@pixi/graphics": "7.4.2",
"@pixi/text": "7.4.2"
}
}