pixi.js 7.4.0 → 7.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/pixi.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * pixi.js - v7.4.0
3
- * Compiled Sat, 27 Jan 2024 00:20:54 UTC
2
+ * pixi.js - v7.4.2
3
+ * Compiled Wed, 20 Mar 2024 19:55:28 UTC
4
4
  *
5
5
  * pixi.js is licensed under the MIT License.
6
6
  * http://www.opensource.org/licenses/mit-license
@@ -8299,7 +8299,7 @@ void main(void)
8299
8299
  */
8300
8300
  run(options) {
8301
8301
  const { renderer } = this;
8302
- renderer.runners.init.emit(renderer.options), options.hello && console.log(`PixiJS 7.4.0 - ${renderer.rendererLogId} - https://pixijs.com`), renderer.resize(renderer.screen.width, renderer.screen.height);
8302
+ renderer.runners.init.emit(renderer.options), options.hello && console.log(`PixiJS 7.4.2 - ${renderer.rendererLogId} - https://pixijs.com`), renderer.resize(renderer.screen.width, renderer.screen.height);
8303
8303
  }
8304
8304
  destroy() {
8305
8305
  }
@@ -10789,7 +10789,7 @@ void main(void)
10789
10789
  this.disposeRunner.emit(this, !1);
10790
10790
  }
10791
10791
  }
10792
- const VERSION = "7.4.0";
10792
+ const VERSION = "7.4.2";
10793
10793
  class Bounds {
10794
10794
  constructor() {
10795
10795
  this.minX = 1 / 0, this.minY = 1 / 0, this.maxX = -1 / 0, this.maxY = -1 / 0, this.rect = null, this.updateID = -1;
@@ -15805,9 +15805,9 @@ ${e2}`);
15805
15805
  });
15806
15806
  })();
15807
15807
  `;
15808
- let WORKER_URL$1 = null, WorkerInstance$1 = class extends Worker {
15808
+ let WORKER_URL$1 = null, WorkerInstance$1 = class {
15809
15809
  constructor() {
15810
- WORKER_URL$1 || (WORKER_URL$1 = URL.createObjectURL(new Blob([WORKER_CODE$1], { type: "application/javascript" }))), super(WORKER_URL$1);
15810
+ WORKER_URL$1 || (WORKER_URL$1 = URL.createObjectURL(new Blob([WORKER_CODE$1], { type: "application/javascript" }))), this.worker = new Worker(WORKER_URL$1);
15811
15811
  }
15812
15812
  };
15813
15813
  WorkerInstance$1.revokeObjectURL = function() {
@@ -15841,9 +15841,9 @@ ${e2}`);
15841
15841
  })();
15842
15842
  `;
15843
15843
  let WORKER_URL = null;
15844
- class WorkerInstance extends Worker {
15844
+ class WorkerInstance {
15845
15845
  constructor() {
15846
- WORKER_URL || (WORKER_URL = URL.createObjectURL(new Blob([WORKER_CODE], { type: "application/javascript" }))), super(WORKER_URL);
15846
+ WORKER_URL || (WORKER_URL = URL.createObjectURL(new Blob([WORKER_CODE], { type: "application/javascript" }))), this.worker = new Worker(WORKER_URL);
15847
15847
  }
15848
15848
  }
15849
15849
  WorkerInstance.revokeObjectURL = function() {
@@ -15856,7 +15856,7 @@ ${e2}`);
15856
15856
  }
15857
15857
  isImageBitmapSupported() {
15858
15858
  return this._isImageBitmapSupported !== void 0 ? this._isImageBitmapSupported : (this._isImageBitmapSupported = new Promise((resolve2) => {
15859
- const worker = new WorkerInstance$1();
15859
+ const { worker } = new WorkerInstance$1();
15860
15860
  worker.addEventListener("message", (event) => {
15861
15861
  worker.terminate(), WorkerInstance$1.revokeObjectURL(), resolve2(event.data);
15862
15862
  });
@@ -15871,7 +15871,7 @@ ${e2}`);
15871
15871
  getWorker() {
15872
15872
  MAX_WORKERS === void 0 && (MAX_WORKERS = navigator.hardwareConcurrency || 4);
15873
15873
  let worker = this.workerPool.pop();
15874
- return !worker && this._createdWorkers < MAX_WORKERS && (this._createdWorkers++, worker = new WorkerInstance(), worker.addEventListener("message", (event) => {
15874
+ return !worker && this._createdWorkers < MAX_WORKERS && (this._createdWorkers++, worker = new WorkerInstance().worker, worker.addEventListener("message", (event) => {
15875
15875
  this.complete(event.data), this.returnWorker(event.target), this.next();
15876
15876
  })), worker;
15877
15877
  }
@@ -16455,9 +16455,9 @@ Please use Assets.add({ alias, src, data, format, loadParser }) instead.`), asse
16455
16455
  return `${url2}${paramConnector}${this._defaultSearchParams}`;
16456
16456
  }
16457
16457
  buildResolvedAsset(formattedAsset, data) {
16458
- var _a2;
16458
+ var _a2, _b;
16459
16459
  const { aliases, data: assetData, loadParser, format: format2 } = data;
16460
- return (this._basePath || this._rootPath) && (formattedAsset.src = path.toAbsolute(formattedAsset.src, this._basePath, this._rootPath)), formattedAsset.alias = (_a2 = aliases != null ? aliases : formattedAsset.alias) != null ? _a2 : [formattedAsset.src], formattedAsset.src = this._appendDefaultSearchParams(formattedAsset.src), formattedAsset.data = __spreadValues$4(__spreadValues$4({}, assetData || {}), formattedAsset.data), formattedAsset.loadParser = loadParser != null ? loadParser : formattedAsset.loadParser, formattedAsset.format = format2 != null ? format2 : path.extname(formattedAsset.src).slice(1), formattedAsset.srcs = formattedAsset.src, formattedAsset.name = formattedAsset.alias, formattedAsset;
16460
+ return (this._basePath || this._rootPath) && (formattedAsset.src = path.toAbsolute(formattedAsset.src, this._basePath, this._rootPath)), formattedAsset.alias = (_a2 = aliases != null ? aliases : formattedAsset.alias) != null ? _a2 : [formattedAsset.src], formattedAsset.src = this._appendDefaultSearchParams(formattedAsset.src), formattedAsset.data = __spreadValues$4(__spreadValues$4({}, assetData || {}), formattedAsset.data), formattedAsset.loadParser = loadParser != null ? loadParser : formattedAsset.loadParser, formattedAsset.format = (_b = format2 != null ? format2 : formattedAsset.format) != null ? _b : path.extname(formattedAsset.src).slice(1), formattedAsset.srcs = formattedAsset.src, formattedAsset.name = formattedAsset.alias, formattedAsset;
16461
16461
  }
16462
16462
  }
16463
16463
  class AssetsClass {
@@ -16949,15 +16949,15 @@ Please use Assets.add({ alias, src, data, format, loadParser }) instead.`), asse
16949
16949
  let storedGl, extensions;
16950
16950
  function getCompressedTextureExtensions() {
16951
16951
  extensions = {
16952
+ bptc: storedGl.getExtension("EXT_texture_compression_bptc"),
16953
+ astc: storedGl.getExtension("WEBGL_compressed_texture_astc"),
16954
+ etc: storedGl.getExtension("WEBGL_compressed_texture_etc"),
16952
16955
  s3tc: storedGl.getExtension("WEBGL_compressed_texture_s3tc"),
16953
16956
  s3tc_sRGB: storedGl.getExtension("WEBGL_compressed_texture_s3tc_srgb"),
16954
16957
  /* eslint-disable-line camelcase */
16955
- etc: storedGl.getExtension("WEBGL_compressed_texture_etc"),
16956
- etc1: storedGl.getExtension("WEBGL_compressed_texture_etc1"),
16957
16958
  pvrtc: storedGl.getExtension("WEBGL_compressed_texture_pvrtc") || storedGl.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),
16958
- atc: storedGl.getExtension("WEBGL_compressed_texture_atc"),
16959
- astc: storedGl.getExtension("WEBGL_compressed_texture_astc"),
16960
- bptc: storedGl.getExtension("EXT_texture_compression_bptc")
16959
+ etc1: storedGl.getExtension("WEBGL_compressed_texture_etc1"),
16960
+ atc: storedGl.getExtension("WEBGL_compressed_texture_atc")
16961
16961
  };
16962
16962
  }
16963
16963
  const detectCompressedTextures = {
@@ -17430,7 +17430,7 @@ Please use Assets.add({ alias, src, data, format, loadParser }) instead.`), asse
17430
17430
  }
17431
17431
  };
17432
17432
  extensions$1.add(loadKTX);
17433
- const resolveCompressedTextureUrl = {
17433
+ const knownFormats = ["s3tc", "s3tc_sRGB", "etc", "etc1", "pvrtc", "atc", "astc", "bptc"], resolveCompressedTextureUrl = {
17434
17434
  extension: ExtensionType.ResolveParser,
17435
17435
  test: (value) => {
17436
17436
  const extension = path.extname(value).slice(1);
@@ -17438,22 +17438,13 @@ Please use Assets.add({ alias, src, data, format, loadParser }) instead.`), asse
17438
17438
  },
17439
17439
  parse: (value) => {
17440
17440
  var _a2, _b, _c, _d;
17441
- const extension = path.extname(value).slice(1);
17442
- if (extension === "ktx") {
17443
- const extensions2 = [
17444
- ".s3tc.ktx",
17445
- ".s3tc_sRGB.ktx",
17446
- ".etc.ktx",
17447
- ".etc1.ktx",
17448
- ".pvrt.ktx",
17449
- ".atc.ktx",
17450
- ".astc.ktx",
17451
- ".bptc.ktx"
17452
- ];
17453
- if (extensions2.some((ext) => value.endsWith(ext)))
17441
+ const parts = value.split("."), extension = parts.pop();
17442
+ if (["ktx", "dds"].includes(extension)) {
17443
+ const textureFormat = parts.pop();
17444
+ if (knownFormats.includes(textureFormat))
17454
17445
  return {
17455
17446
  resolution: parseFloat((_b = (_a2 = settings.RETINA_PREFIX.exec(value)) == null ? void 0 : _a2[1]) != null ? _b : "1"),
17456
- format: extensions2.find((ext) => value.endsWith(ext)),
17447
+ format: textureFormat,
17457
17448
  src: value
17458
17449
  };
17459
17450
  }
@@ -22042,7 +22033,21 @@ void main(void)
22042
22033
  };
22043
22034
  _Spritesheet.BATCH_SIZE = 1e3;
22044
22035
  let Spritesheet = _Spritesheet;
22045
- const validImages = ["jpg", "png", "jpeg", "avif", "webp"];
22036
+ const validImages = [
22037
+ "jpg",
22038
+ "png",
22039
+ "jpeg",
22040
+ "avif",
22041
+ "webp",
22042
+ "s3tc",
22043
+ "s3tc_sRGB",
22044
+ "etc",
22045
+ "etc1",
22046
+ "pvrtc",
22047
+ "atc",
22048
+ "astc",
22049
+ "bptc"
22050
+ ];
22046
22051
  function getCacheableAssets(keys, asset, ignoreMultiPack) {
22047
22052
  const out = {};
22048
22053
  if (keys.forEach((key) => {