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.mjs 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
@@ -8280,7 +8280,7 @@ class StartupSystem {
8280
8280
  */
8281
8281
  run(options) {
8282
8282
  const { renderer } = this;
8283
- 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);
8283
+ 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);
8284
8284
  }
8285
8285
  destroy() {
8286
8286
  }
@@ -10783,7 +10783,7 @@ class TransformFeedback {
10783
10783
  this.disposeRunner.emit(this, !1);
10784
10784
  }
10785
10785
  }
10786
- const VERSION = "7.4.0";
10786
+ const VERSION = "7.4.2";
10787
10787
  class Bounds {
10788
10788
  constructor() {
10789
10789
  this.minX = 1 / 0, this.minY = 1 / 0, this.maxX = -1 / 0, this.maxY = -1 / 0, this.rect = null, this.updateID = -1;
@@ -15816,9 +15816,9 @@ const WORKER_CODE$1 = `(function() {
15816
15816
  });
15817
15817
  })();
15818
15818
  `;
15819
- let WORKER_URL$1 = null, WorkerInstance$1 = class extends Worker {
15819
+ let WORKER_URL$1 = null, WorkerInstance$1 = class {
15820
15820
  constructor() {
15821
- WORKER_URL$1 || (WORKER_URL$1 = URL.createObjectURL(new Blob([WORKER_CODE$1], { type: "application/javascript" }))), super(WORKER_URL$1);
15821
+ WORKER_URL$1 || (WORKER_URL$1 = URL.createObjectURL(new Blob([WORKER_CODE$1], { type: "application/javascript" }))), this.worker = new Worker(WORKER_URL$1);
15822
15822
  }
15823
15823
  };
15824
15824
  WorkerInstance$1.revokeObjectURL = function() {
@@ -15852,9 +15852,9 @@ const WORKER_CODE = `(function() {
15852
15852
  })();
15853
15853
  `;
15854
15854
  let WORKER_URL = null;
15855
- class WorkerInstance2 extends Worker {
15855
+ class WorkerInstance2 {
15856
15856
  constructor() {
15857
- WORKER_URL || (WORKER_URL = URL.createObjectURL(new Blob([WORKER_CODE], { type: "application/javascript" }))), super(WORKER_URL);
15857
+ WORKER_URL || (WORKER_URL = URL.createObjectURL(new Blob([WORKER_CODE], { type: "application/javascript" }))), this.worker = new Worker(WORKER_URL);
15858
15858
  }
15859
15859
  }
15860
15860
  WorkerInstance2.revokeObjectURL = function() {
@@ -15867,7 +15867,7 @@ class WorkerManagerClass {
15867
15867
  }
15868
15868
  isImageBitmapSupported() {
15869
15869
  return this._isImageBitmapSupported !== void 0 ? this._isImageBitmapSupported : (this._isImageBitmapSupported = new Promise((resolve2) => {
15870
- const worker = new WorkerInstance$1();
15870
+ const { worker } = new WorkerInstance$1();
15871
15871
  worker.addEventListener("message", (event) => {
15872
15872
  worker.terminate(), WorkerInstance$1.revokeObjectURL(), resolve2(event.data);
15873
15873
  });
@@ -15882,7 +15882,7 @@ class WorkerManagerClass {
15882
15882
  getWorker() {
15883
15883
  MAX_WORKERS === void 0 && (MAX_WORKERS = navigator.hardwareConcurrency || 4);
15884
15884
  let worker = this.workerPool.pop();
15885
- return !worker && this._createdWorkers < MAX_WORKERS && (this._createdWorkers++, worker = new WorkerInstance2(), worker.addEventListener("message", (event) => {
15885
+ return !worker && this._createdWorkers < MAX_WORKERS && (this._createdWorkers++, worker = new WorkerInstance2().worker, worker.addEventListener("message", (event) => {
15886
15886
  this.complete(event.data), this.returnWorker(event.target), this.next();
15887
15887
  })), worker;
15888
15888
  }
@@ -16466,9 +16466,9 @@ Please use Assets.add({ alias, src, data, format, loadParser }) instead.`), asse
16466
16466
  return `${url2}${paramConnector}${this._defaultSearchParams}`;
16467
16467
  }
16468
16468
  buildResolvedAsset(formattedAsset, data) {
16469
- var _a2;
16469
+ var _a2, _b;
16470
16470
  const { aliases, data: assetData, loadParser, format: format2 } = data;
16471
- 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;
16471
+ 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;
16472
16472
  }
16473
16473
  }
16474
16474
  class AssetsClass {
@@ -16960,15 +16960,15 @@ const INTERNAL_FORMAT_TO_BYTES_PER_PIXEL = {
16960
16960
  let storedGl, extensions;
16961
16961
  function getCompressedTextureExtensions() {
16962
16962
  extensions = {
16963
+ bptc: storedGl.getExtension("EXT_texture_compression_bptc"),
16964
+ astc: storedGl.getExtension("WEBGL_compressed_texture_astc"),
16965
+ etc: storedGl.getExtension("WEBGL_compressed_texture_etc"),
16963
16966
  s3tc: storedGl.getExtension("WEBGL_compressed_texture_s3tc"),
16964
16967
  s3tc_sRGB: storedGl.getExtension("WEBGL_compressed_texture_s3tc_srgb"),
16965
16968
  /* eslint-disable-line camelcase */
16966
- etc: storedGl.getExtension("WEBGL_compressed_texture_etc"),
16967
- etc1: storedGl.getExtension("WEBGL_compressed_texture_etc1"),
16968
16969
  pvrtc: storedGl.getExtension("WEBGL_compressed_texture_pvrtc") || storedGl.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),
16969
- atc: storedGl.getExtension("WEBGL_compressed_texture_atc"),
16970
- astc: storedGl.getExtension("WEBGL_compressed_texture_astc"),
16971
- bptc: storedGl.getExtension("EXT_texture_compression_bptc")
16970
+ etc1: storedGl.getExtension("WEBGL_compressed_texture_etc1"),
16971
+ atc: storedGl.getExtension("WEBGL_compressed_texture_atc")
16972
16972
  };
16973
16973
  }
16974
16974
  const detectCompressedTextures = {
@@ -17441,7 +17441,7 @@ const loadKTX = {
17441
17441
  }
17442
17442
  };
17443
17443
  extensions$1.add(loadKTX);
17444
- const resolveCompressedTextureUrl = {
17444
+ const knownFormats = ["s3tc", "s3tc_sRGB", "etc", "etc1", "pvrtc", "atc", "astc", "bptc"], resolveCompressedTextureUrl = {
17445
17445
  extension: ExtensionType.ResolveParser,
17446
17446
  test: (value) => {
17447
17447
  const extension = path.extname(value).slice(1);
@@ -17449,22 +17449,13 @@ const resolveCompressedTextureUrl = {
17449
17449
  },
17450
17450
  parse: (value) => {
17451
17451
  var _a2, _b, _c, _d;
17452
- const extension = path.extname(value).slice(1);
17453
- if (extension === "ktx") {
17454
- const extensions2 = [
17455
- ".s3tc.ktx",
17456
- ".s3tc_sRGB.ktx",
17457
- ".etc.ktx",
17458
- ".etc1.ktx",
17459
- ".pvrt.ktx",
17460
- ".atc.ktx",
17461
- ".astc.ktx",
17462
- ".bptc.ktx"
17463
- ];
17464
- if (extensions2.some((ext) => value.endsWith(ext)))
17452
+ const parts = value.split("."), extension = parts.pop();
17453
+ if (["ktx", "dds"].includes(extension)) {
17454
+ const textureFormat = parts.pop();
17455
+ if (knownFormats.includes(textureFormat))
17465
17456
  return {
17466
17457
  resolution: parseFloat((_b = (_a2 = settings.RETINA_PREFIX.exec(value)) == null ? void 0 : _a2[1]) != null ? _b : "1"),
17467
- format: extensions2.find((ext) => value.endsWith(ext)),
17458
+ format: textureFormat,
17468
17459
  src: value
17469
17460
  };
17470
17461
  }
@@ -22056,7 +22047,21 @@ const _Spritesheet = class _Spritesheet2 {
22056
22047
  };
22057
22048
  _Spritesheet.BATCH_SIZE = 1e3;
22058
22049
  let Spritesheet = _Spritesheet;
22059
- const validImages = ["jpg", "png", "jpeg", "avif", "webp"];
22050
+ const validImages = [
22051
+ "jpg",
22052
+ "png",
22053
+ "jpeg",
22054
+ "avif",
22055
+ "webp",
22056
+ "s3tc",
22057
+ "s3tc_sRGB",
22058
+ "etc",
22059
+ "etc1",
22060
+ "pvrtc",
22061
+ "atc",
22062
+ "astc",
22063
+ "bptc"
22064
+ ];
22060
22065
  function getCacheableAssets(keys, asset, ignoreMultiPack) {
22061
22066
  const out = {};
22062
22067
  if (keys.forEach((key) => {