pixi.js 7.4.0 → 7.4.3

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.3
3
+ * Compiled Thu, 06 Mar 2025 14:58:55 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.3 - ${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.3";
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;
@@ -15556,7 +15556,8 @@ void main()
15556
15556
  if (keys.forEach((key2) => {
15557
15557
  this._cacheMap.set(key2, cachedAssets);
15558
15558
  }), cacheKeys.forEach((key2) => {
15559
- this._cache.has(key2) && this._cache.get(key2) !== value && console.warn("[Cache] already has key:", key2), this._cache.set(key2, cacheableAssets[key2]);
15559
+ const val = cacheableAssets ? cacheableAssets[key2] : value;
15560
+ this._cache.has(key2) && this._cache.get(key2) !== val && console.warn("[Cache] already has key:", key2), this._cache.set(key2, cacheableAssets[key2]);
15560
15561
  }), value instanceof Texture) {
15561
15562
  const texture = value;
15562
15563
  keys.forEach((key2) => {
@@ -15805,9 +15806,9 @@ ${e2}`);
15805
15806
  });
15806
15807
  })();
15807
15808
  `;
15808
- let WORKER_URL$1 = null, WorkerInstance$1 = class extends Worker {
15809
+ let WORKER_URL$1 = null, WorkerInstance$1 = class {
15809
15810
  constructor() {
15810
- WORKER_URL$1 || (WORKER_URL$1 = URL.createObjectURL(new Blob([WORKER_CODE$1], { type: "application/javascript" }))), super(WORKER_URL$1);
15811
+ WORKER_URL$1 || (WORKER_URL$1 = URL.createObjectURL(new Blob([WORKER_CODE$1], { type: "application/javascript" }))), this.worker = new Worker(WORKER_URL$1);
15811
15812
  }
15812
15813
  };
15813
15814
  WorkerInstance$1.revokeObjectURL = function() {
@@ -15841,9 +15842,9 @@ ${e2}`);
15841
15842
  })();
15842
15843
  `;
15843
15844
  let WORKER_URL = null;
15844
- class WorkerInstance extends Worker {
15845
+ class WorkerInstance {
15845
15846
  constructor() {
15846
- WORKER_URL || (WORKER_URL = URL.createObjectURL(new Blob([WORKER_CODE], { type: "application/javascript" }))), super(WORKER_URL);
15847
+ WORKER_URL || (WORKER_URL = URL.createObjectURL(new Blob([WORKER_CODE], { type: "application/javascript" }))), this.worker = new Worker(WORKER_URL);
15847
15848
  }
15848
15849
  }
15849
15850
  WorkerInstance.revokeObjectURL = function() {
@@ -15856,7 +15857,7 @@ ${e2}`);
15856
15857
  }
15857
15858
  isImageBitmapSupported() {
15858
15859
  return this._isImageBitmapSupported !== void 0 ? this._isImageBitmapSupported : (this._isImageBitmapSupported = new Promise((resolve2) => {
15859
- const worker = new WorkerInstance$1();
15860
+ const { worker } = new WorkerInstance$1();
15860
15861
  worker.addEventListener("message", (event) => {
15861
15862
  worker.terminate(), WorkerInstance$1.revokeObjectURL(), resolve2(event.data);
15862
15863
  });
@@ -15871,7 +15872,7 @@ ${e2}`);
15871
15872
  getWorker() {
15872
15873
  MAX_WORKERS === void 0 && (MAX_WORKERS = navigator.hardwareConcurrency || 4);
15873
15874
  let worker = this.workerPool.pop();
15874
- return !worker && this._createdWorkers < MAX_WORKERS && (this._createdWorkers++, worker = new WorkerInstance(), worker.addEventListener("message", (event) => {
15875
+ return !worker && this._createdWorkers < MAX_WORKERS && (this._createdWorkers++, worker = new WorkerInstance().worker, worker.addEventListener("message", (event) => {
15875
15876
  this.complete(event.data), this.returnWorker(event.target), this.next();
15876
15877
  })), worker;
15877
15878
  }
@@ -16455,9 +16456,9 @@ Please use Assets.add({ alias, src, data, format, loadParser }) instead.`), asse
16455
16456
  return `${url2}${paramConnector}${this._defaultSearchParams}`;
16456
16457
  }
16457
16458
  buildResolvedAsset(formattedAsset, data) {
16458
- var _a2;
16459
+ var _a2, _b;
16459
16460
  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;
16461
+ 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
16462
  }
16462
16463
  }
16463
16464
  class AssetsClass {
@@ -16949,15 +16950,15 @@ Please use Assets.add({ alias, src, data, format, loadParser }) instead.`), asse
16949
16950
  let storedGl, extensions;
16950
16951
  function getCompressedTextureExtensions() {
16951
16952
  extensions = {
16953
+ bptc: storedGl.getExtension("EXT_texture_compression_bptc"),
16954
+ astc: storedGl.getExtension("WEBGL_compressed_texture_astc"),
16955
+ etc: storedGl.getExtension("WEBGL_compressed_texture_etc"),
16952
16956
  s3tc: storedGl.getExtension("WEBGL_compressed_texture_s3tc"),
16953
16957
  s3tc_sRGB: storedGl.getExtension("WEBGL_compressed_texture_s3tc_srgb"),
16954
16958
  /* eslint-disable-line camelcase */
16955
- etc: storedGl.getExtension("WEBGL_compressed_texture_etc"),
16956
- etc1: storedGl.getExtension("WEBGL_compressed_texture_etc1"),
16957
16959
  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")
16960
+ etc1: storedGl.getExtension("WEBGL_compressed_texture_etc1"),
16961
+ atc: storedGl.getExtension("WEBGL_compressed_texture_atc")
16961
16962
  };
16962
16963
  }
16963
16964
  const detectCompressedTextures = {
@@ -17430,7 +17431,7 @@ Please use Assets.add({ alias, src, data, format, loadParser }) instead.`), asse
17430
17431
  }
17431
17432
  };
17432
17433
  extensions$1.add(loadKTX);
17433
- const resolveCompressedTextureUrl = {
17434
+ const knownFormats = ["s3tc", "s3tc_sRGB", "etc", "etc1", "pvrtc", "atc", "astc", "bptc"], resolveCompressedTextureUrl = {
17434
17435
  extension: ExtensionType.ResolveParser,
17435
17436
  test: (value) => {
17436
17437
  const extension = path.extname(value).slice(1);
@@ -17438,22 +17439,13 @@ Please use Assets.add({ alias, src, data, format, loadParser }) instead.`), asse
17438
17439
  },
17439
17440
  parse: (value) => {
17440
17441
  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)))
17442
+ const parts = value.split("."), extension = parts.pop();
17443
+ if (["ktx", "dds"].includes(extension)) {
17444
+ const textureFormat = parts.pop();
17445
+ if (knownFormats.includes(textureFormat))
17454
17446
  return {
17455
17447
  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)),
17448
+ format: textureFormat,
17457
17449
  src: value
17458
17450
  };
17459
17451
  }
@@ -22042,7 +22034,21 @@ void main(void)
22042
22034
  };
22043
22035
  _Spritesheet.BATCH_SIZE = 1e3;
22044
22036
  let Spritesheet = _Spritesheet;
22045
- const validImages = ["jpg", "png", "jpeg", "avif", "webp"];
22037
+ const validImages = [
22038
+ "jpg",
22039
+ "png",
22040
+ "jpeg",
22041
+ "avif",
22042
+ "webp",
22043
+ "s3tc",
22044
+ "s3tc_sRGB",
22045
+ "etc",
22046
+ "etc1",
22047
+ "pvrtc",
22048
+ "atc",
22049
+ "astc",
22050
+ "bptc"
22051
+ ];
22046
22052
  function getCacheableAssets(keys, asset, ignoreMultiPack) {
22047
22053
  const out = {};
22048
22054
  if (keys.forEach((key) => {