excalibur 0.32.0-alpha.1560 → 0.32.0-alpha.1562

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.
@@ -1,4 +1,4 @@
1
- /*! excalibur - 0.32.0-alpha.1560+24fadc4 - 2025-11-6
1
+ /*! excalibur - 0.32.0-alpha.1562+c143e37 - 2025-11-23
2
2
  https://github.com/excaliburjs/Excalibur
3
3
  Copyright (c) 2025 Excalibur.js <https://github.com/excaliburjs/Excalibur/graphs/contributors>
4
4
  Licensed BSD-2-Clause
@@ -29169,6 +29169,7 @@ class Clock {
29169
29169
  this._scheduledCbs = [];
29170
29170
  this._totalElapsed = 0;
29171
29171
  this._nextScheduleId = 0;
29172
+ this._idsToRemove = [];
29172
29173
  var _a, _b, _c;
29173
29174
  this._options = options;
29174
29175
  this.tick = options.tick;
@@ -29230,10 +29231,7 @@ class Clock {
29230
29231
  * @param id The ID of the scheduled callback to clear
29231
29232
  */
29232
29233
  clearSchedule(id) {
29233
- const index = this._scheduledCbs.findIndex(([scheduleId]) => scheduleId === id);
29234
- if (index !== -1) {
29235
- this._scheduledCbs.splice(index, 1);
29236
- }
29234
+ this._idsToRemove.push(id);
29237
29235
  }
29238
29236
  /**
29239
29237
  * Called internally to trigger scheduled callbacks in the clock
@@ -29242,12 +29240,21 @@ class Clock {
29242
29240
  */
29243
29241
  __runScheduledCbs(timing = "preframe") {
29244
29242
  for (let i = this._scheduledCbs.length - 1; i > -1; i--) {
29245
- const [_, callback, scheduledTime, callbackTiming] = this._scheduledCbs[i];
29243
+ const [scheduleId, callback, scheduledTime, callbackTiming] = this._scheduledCbs[i];
29244
+ if (this._idsToRemove.includes(scheduleId)) {
29245
+ continue;
29246
+ }
29246
29247
  if (timing === callbackTiming && scheduledTime <= this._totalElapsed) {
29247
29248
  callback(this._elapsed);
29248
29249
  this._scheduledCbs.splice(i, 1);
29249
29250
  }
29250
29251
  }
29252
+ for (const id of this._idsToRemove) {
29253
+ const index = this._scheduledCbs.findIndex(([scheduleId]) => scheduleId === id);
29254
+ if (index !== -1) {
29255
+ this._scheduledCbs.splice(index, 1);
29256
+ }
29257
+ }
29251
29258
  }
29252
29259
  update(overrideUpdateMs) {
29253
29260
  try {
@@ -33032,7 +33039,7 @@ class Semaphore {
33032
33039
  this._count += count;
33033
33040
  }
33034
33041
  }
33035
- const EX_VERSION = "0.32.0-alpha.1560+24fadc4";
33042
+ const EX_VERSION = "0.32.0-alpha.1562+c143e37";
33036
33043
  polyfill();
33037
33044
  export {
33038
33045
  ActionCompleteEvent,
@@ -1,4 +1,4 @@
1
- /*! excalibur - 0.32.0-alpha.1560+24fadc4 - 2025-11-6
1
+ /*! excalibur - 0.32.0-alpha.1562+c143e37 - 2025-11-23
2
2
  https://github.com/excaliburjs/Excalibur
3
3
  Copyright (c) 2025 Excalibur.js <https://github.com/excaliburjs/Excalibur/graphs/contributors>
4
4
  Licensed BSD-2-Clause
@@ -29169,6 +29169,7 @@ class Clock {
29169
29169
  this._scheduledCbs = [];
29170
29170
  this._totalElapsed = 0;
29171
29171
  this._nextScheduleId = 0;
29172
+ this._idsToRemove = [];
29172
29173
  var _a, _b, _c;
29173
29174
  this._options = options;
29174
29175
  this.tick = options.tick;
@@ -29230,10 +29231,7 @@ class Clock {
29230
29231
  * @param id The ID of the scheduled callback to clear
29231
29232
  */
29232
29233
  clearSchedule(id) {
29233
- const index = this._scheduledCbs.findIndex(([scheduleId]) => scheduleId === id);
29234
- if (index !== -1) {
29235
- this._scheduledCbs.splice(index, 1);
29236
- }
29234
+ this._idsToRemove.push(id);
29237
29235
  }
29238
29236
  /**
29239
29237
  * Called internally to trigger scheduled callbacks in the clock
@@ -29242,12 +29240,21 @@ class Clock {
29242
29240
  */
29243
29241
  __runScheduledCbs(timing = "preframe") {
29244
29242
  for (let i = this._scheduledCbs.length - 1; i > -1; i--) {
29245
- const [_, callback, scheduledTime, callbackTiming] = this._scheduledCbs[i];
29243
+ const [scheduleId, callback, scheduledTime, callbackTiming] = this._scheduledCbs[i];
29244
+ if (this._idsToRemove.includes(scheduleId)) {
29245
+ continue;
29246
+ }
29246
29247
  if (timing === callbackTiming && scheduledTime <= this._totalElapsed) {
29247
29248
  callback(this._elapsed);
29248
29249
  this._scheduledCbs.splice(i, 1);
29249
29250
  }
29250
29251
  }
29252
+ for (const id of this._idsToRemove) {
29253
+ const index = this._scheduledCbs.findIndex(([scheduleId]) => scheduleId === id);
29254
+ if (index !== -1) {
29255
+ this._scheduledCbs.splice(index, 1);
29256
+ }
29257
+ }
29251
29258
  }
29252
29259
  update(overrideUpdateMs) {
29253
29260
  try {
@@ -33032,7 +33039,7 @@ class Semaphore {
33032
33039
  this._count += count;
33033
33040
  }
33034
33041
  }
33035
- const EX_VERSION = "0.32.0-alpha.1560+24fadc4";
33042
+ const EX_VERSION = "0.32.0-alpha.1562+c143e37";
33036
33043
  polyfill();
33037
33044
  export {
33038
33045
  ActionCompleteEvent,
@@ -1,4 +1,4 @@
1
- /*! excalibur - 0.32.0-alpha.1560+24fadc4 - 2025-11-6
1
+ /*! excalibur - 0.32.0-alpha.1562+c143e37 - 2025-11-23
2
2
  https://github.com/excaliburjs/Excalibur
3
3
  Copyright (c) 2025 Excalibur.js <https://github.com/excaliburjs/Excalibur/graphs/contributors>
4
4
  Licensed BSD-2-Clause
@@ -19638,7 +19638,7 @@ class Sh {
19638
19638
  class Xr {
19639
19639
  constructor(t) {
19640
19640
  this._onFatalException = () => {
19641
- }, this._maxFps = 1 / 0, this._lastTime = 0, this._elapsed = 1, this._scheduledCbs = [], this._totalElapsed = 0, this._nextScheduleId = 0;
19641
+ }, this._maxFps = 1 / 0, this._lastTime = 0, this._elapsed = 1, this._scheduledCbs = [], this._totalElapsed = 0, this._nextScheduleId = 0, this._idsToRemove = [];
19642
19642
  var e, i, s;
19643
19643
  this._options = t, this.tick = t.tick, this._lastTime = (e = this.now()) != null ? e : 0, this._maxFps = (i = t.maxFps) != null ? i : this._maxFps, this._onFatalException = (s = t.onFatalException) != null ? s : this._onFatalException, this.fpsSampler = new Sh({
19644
19644
  initialFps: 60,
@@ -19691,8 +19691,7 @@ class Xr {
19691
19691
  * @param id The ID of the scheduled callback to clear
19692
19692
  */
19693
19693
  clearSchedule(t) {
19694
- const e = this._scheduledCbs.findIndex(([i]) => i === t);
19695
- e !== -1 && this._scheduledCbs.splice(e, 1);
19694
+ this._idsToRemove.push(t);
19696
19695
  }
19697
19696
  /**
19698
19697
  * Called internally to trigger scheduled callbacks in the clock
@@ -19702,7 +19701,11 @@ class Xr {
19702
19701
  __runScheduledCbs(t = "preframe") {
19703
19702
  for (let e = this._scheduledCbs.length - 1; e > -1; e--) {
19704
19703
  const [i, s, n, o] = this._scheduledCbs[e];
19705
- t === o && n <= this._totalElapsed && (s(this._elapsed), this._scheduledCbs.splice(e, 1));
19704
+ this._idsToRemove.includes(i) || t === o && n <= this._totalElapsed && (s(this._elapsed), this._scheduledCbs.splice(e, 1));
19705
+ }
19706
+ for (const e of this._idsToRemove) {
19707
+ const i = this._scheduledCbs.findIndex(([s]) => s === e);
19708
+ i !== -1 && this._scheduledCbs.splice(i, 1);
19706
19709
  }
19707
19710
  }
19708
19711
  update(t) {
@@ -22177,7 +22180,7 @@ class mc {
22177
22180
  }
22178
22181
  }
22179
22182
  }
22180
- const rn = "0.32.0-alpha.1560+24fadc4";
22183
+ const rn = "0.32.0-alpha.1562+c143e37";
22181
22184
  on();
22182
22185
  export {
22183
22186
  Hn as ActionCompleteEvent,
@@ -1,4 +1,4 @@
1
- /*! excalibur - 0.32.0-alpha.1560+24fadc4 - 2025-11-6
1
+ /*! excalibur - 0.32.0-alpha.1562+c143e37 - 2025-11-23
2
2
  https://github.com/excaliburjs/Excalibur
3
3
  Copyright (c) 2025 Excalibur.js <https://github.com/excaliburjs/Excalibur/graphs/contributors>
4
4
  Licensed BSD-2-Clause
@@ -19638,7 +19638,7 @@ class Sh {
19638
19638
  class Xr {
19639
19639
  constructor(t) {
19640
19640
  this._onFatalException = () => {
19641
- }, this._maxFps = 1 / 0, this._lastTime = 0, this._elapsed = 1, this._scheduledCbs = [], this._totalElapsed = 0, this._nextScheduleId = 0;
19641
+ }, this._maxFps = 1 / 0, this._lastTime = 0, this._elapsed = 1, this._scheduledCbs = [], this._totalElapsed = 0, this._nextScheduleId = 0, this._idsToRemove = [];
19642
19642
  var e, i, s;
19643
19643
  this._options = t, this.tick = t.tick, this._lastTime = (e = this.now()) != null ? e : 0, this._maxFps = (i = t.maxFps) != null ? i : this._maxFps, this._onFatalException = (s = t.onFatalException) != null ? s : this._onFatalException, this.fpsSampler = new Sh({
19644
19644
  initialFps: 60,
@@ -19691,8 +19691,7 @@ class Xr {
19691
19691
  * @param id The ID of the scheduled callback to clear
19692
19692
  */
19693
19693
  clearSchedule(t) {
19694
- const e = this._scheduledCbs.findIndex(([i]) => i === t);
19695
- e !== -1 && this._scheduledCbs.splice(e, 1);
19694
+ this._idsToRemove.push(t);
19696
19695
  }
19697
19696
  /**
19698
19697
  * Called internally to trigger scheduled callbacks in the clock
@@ -19702,7 +19701,11 @@ class Xr {
19702
19701
  __runScheduledCbs(t = "preframe") {
19703
19702
  for (let e = this._scheduledCbs.length - 1; e > -1; e--) {
19704
19703
  const [i, s, n, o] = this._scheduledCbs[e];
19705
- t === o && n <= this._totalElapsed && (s(this._elapsed), this._scheduledCbs.splice(e, 1));
19704
+ this._idsToRemove.includes(i) || t === o && n <= this._totalElapsed && (s(this._elapsed), this._scheduledCbs.splice(e, 1));
19705
+ }
19706
+ for (const e of this._idsToRemove) {
19707
+ const i = this._scheduledCbs.findIndex(([s]) => s === e);
19708
+ i !== -1 && this._scheduledCbs.splice(i, 1);
19706
19709
  }
19707
19710
  }
19708
19711
  update(t) {
@@ -22177,7 +22180,7 @@ class mc {
22177
22180
  }
22178
22181
  }
22179
22182
  }
22180
- const rn = "0.32.0-alpha.1560+24fadc4";
22183
+ const rn = "0.32.0-alpha.1562+c143e37";
22181
22184
  on();
22182
22185
  export {
22183
22186
  Hn as ActionCompleteEvent,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "excalibur",
3
3
  "sideEffects": false,
4
- "version": "0.32.0-alpha.1560",
4
+ "version": "0.32.0-alpha.1562",
5
5
  "exNextVersion": "0.32.0",
6
6
  "publishConfig": {
7
7
  "provenance": true