@woosh/meep-engine 2.131.12 → 2.131.14

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/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "description": "Pure JavaScript game engine. Fully featured and production ready.",
6
6
  "type": "module",
7
7
  "author": "Alexander Goldring",
8
- "version": "2.131.12",
8
+ "version": "2.131.14",
9
9
  "main": "build/meep.module.js",
10
10
  "module": "build/meep.module.js",
11
11
  "exports": {
@@ -36,10 +36,17 @@ export class AssetPreloader {
36
36
  */
37
37
  added: Signal<AssetLoadSpec, number>;
38
38
  /**
39
- * Progress event
40
- * @type {Signal<?>}
39
+ * Progress event.
40
+ * Note that the numbers are arbitrary and just signify overall progress and not specific quantifies such as bytes or asset counts.
41
+ * @type {Signal<{global:{current:number, total:number, progress: number}}>}
41
42
  */
42
- progress: Signal<unknown>;
43
+ progress: Signal<{
44
+ global: {
45
+ current: number;
46
+ total: number;
47
+ progress: number;
48
+ };
49
+ }>;
43
50
  /**
44
51
  * Single priority has finished loading
45
52
  * @type {Signal}
@@ -121,7 +128,7 @@ declare class AssetLoadSpec {
121
128
  * Priority within the level group (see {@link level})
122
129
  * @type {number}
123
130
  */
124
- priotity: number;
131
+ priority: number;
125
132
  fromJSON({ uri, type, level, priority }: {
126
133
  uri: any;
127
134
  type: any;
@@ -1 +1 @@
1
- {"version":3,"file":"AssetPreloader.d.ts","sourceRoot":"","sources":["../../../../../src/engine/asset/preloader/AssetPreloader.js"],"names":[],"mappings":"AAsDA;;;;;;;;;;;;;;;;;GAiBG;AACH;IACI;;;OAGG;IACH,iBAFU,MAAM,CAEI;IAEpB;;;OAGG;IACH,iBAFU,aAAa,EAAE,EAAE,CAEf;IAEZ;;OAEG;IACH;QACI;;WAEG;eADO,OAAO,aAAa,EAAC,MAAM,CAAC;QAGtC;;;WAGG;kBADO,eAAS;QAGnB;;;WAGG;uBADO,MAAM;QAGhB;;WAEG;;;QAGH;;;WAGG;mBADO,OAAO,MAAM,CAAC;QAGxB;;;;WAIG;kBADO,OAAO,MAAM,EAAC,MAAM,CAAC;MAGjC;IAaF;;;;;;;OAOG;IACH,SANW,MAAM,QACN,MAAM,UACN,MAAM,aACN,MAAM,GACL,cAAc,CAqCzB;IAED;;;OAGG;IACH,aAFW;QAAC,GAAG,EAAC,MAAM,CAAC;QAAC,IAAI,EAAC,MAAM,CAAC;QAAC,KAAK,CAAC,EAAC,MAAM,CAAA;KAAC,EAAE,QAQpD;IAED;;;;OAIG;IACH,kCAFY,cAAc,CAkKzB;CACJ;AAED;;;GAGG;AACH,wBAFU,cAAc,CAEgB;AAnWxC;;GAEG;AACH;IA+BI;;;;OAIG;IACH,4BAFY,aAAa,CAQxB;IAxCG;;;OAGG;IACH,YAAe;IACf;;;OAGG;IACH,aAAgB;IAChB;;;OAGG;IACH,OAFU,MAAM,GAAC,UAAU,CAEK;IAChC;;;OAGG;IACH,UAFU,MAAM,CAEC;IAGrB;;;;;aAKC;CAcJ;mBAlDkB,uCAAuC;uBAEnC,iBAAiB"}
1
+ {"version":3,"file":"AssetPreloader.d.ts","sourceRoot":"","sources":["../../../../../src/engine/asset/preloader/AssetPreloader.js"],"names":[],"mappings":"AAoDA;;;;;;;;;;;;;;;;;GAiBG;AACH;IACI;;;OAGG;IACH,iBAFU,MAAM,CAEI;IAEpB;;;OAGG;IACH,iBAFU,aAAa,EAAE,EAAE,CAEf;IAEZ;;OAEG;IACH;QACI;;WAEG;eADO,OAAO,aAAa,EAAC,MAAM,CAAC;QAGtC;;;;WAIG;kBADO,OAAO;YAAC,QAAO;gBAAC,OAAO,EAAC,MAAM,CAAC;gBAAC,KAAK,EAAC,MAAM,CAAC;gBAAC,QAAQ,EAAE,MAAM,CAAA;aAAC,CAAA;SAAC,CAAC;QAG3E;;;WAGG;uBADO,MAAM;QAGhB;;WAEG;;;QAGH;;;WAGG;mBADO,OAAO,MAAM,CAAC;QAGxB;;;;WAIG;kBADO,OAAO,MAAM,EAAC,MAAM,CAAC;MAGjC;IAaF;;;;;;;OAOG;IACH,SANW,MAAM,QACN,MAAM,UACN,MAAM,aACN,MAAM,GACL,cAAc,CAqCzB;IAED;;;OAGG;IACH,aAFW;QAAC,GAAG,EAAC,MAAM,CAAC;QAAC,IAAI,EAAC,MAAM,CAAC;QAAC,KAAK,CAAC,EAAC,MAAM,CAAA;KAAC,EAAE,QAQpD;IAED;;;;OAIG;IACH,kCAFY,cAAc,CAkKzB;CACJ;AAED;;;GAGG;AACH,wBAFU,cAAc,CAEgB;AAlWxC;;GAEG;AACH;IA6BI;;;;OAIG;IACH,4BAFY,aAAa,CAQxB;IAvCD;;;OAGG;IACH,YAAW;IACX;;;OAGG;IACH,aAAY;IACZ;;;OAGG;IACH,OAFU,MAAM,GAAC,UAAU,CAEC;IAC5B;;;OAGG;IACH,UAFU,MAAM,CAEH;IAEb;;;;;aAKC;CAcJ;mBAhDkB,uCAAuC;uBAEnC,iBAAiB"}
@@ -8,34 +8,32 @@ import AssetLevel from "./AssetLevel.js";
8
8
  * Definition of a single asset to be loaded
9
9
  */
10
10
  class AssetLoadSpec {
11
- constructor() {
12
- /**
13
- * Path to the asset
14
- * @type {String}
15
- */
16
- this.uri = null;
17
- /**
18
- * Type of the asset
19
- * @type {String}
20
- */
21
- this.type = null;
22
- /**
23
- *
24
- * @type {number|AssetLevel}
25
- */
26
- this.level = AssetLevel.OPTIONAL;
27
- /**
28
- * Priority within the level group (see {@link level})
29
- * @type {number}
30
- */
31
- this.priotity = 0;
32
- }
11
+ /**
12
+ * Path to the asset
13
+ * @type {String}
14
+ */
15
+ uri = null;
16
+ /**
17
+ * Type of the asset
18
+ * @type {String}
19
+ */
20
+ type = null;
21
+ /**
22
+ *
23
+ * @type {number|AssetLevel}
24
+ */
25
+ level = AssetLevel.OPTIONAL;
26
+ /**
27
+ * Priority within the level group (see {@link level})
28
+ * @type {number}
29
+ */
30
+ priority = 0;
33
31
 
34
32
  fromJSON({ uri, type, level = AssetLevel.OPTIONAL, priority = 0 }) {
35
33
  this.uri = uri;
36
34
  this.type = type;
37
35
  this.level = level;
38
- this.priotity = priority;
36
+ this.priority = priority;
39
37
  }
40
38
 
41
39
  /**
@@ -92,8 +90,9 @@ export class AssetPreloader {
92
90
  */
93
91
  added: new Signal(),
94
92
  /**
95
- * Progress event
96
- * @type {Signal<?>}
93
+ * Progress event.
94
+ * Note that the numbers are arbitrary and just signify overall progress and not specific quantifies such as bytes or asset counts.
95
+ * @type {Signal<{global:{current:number, total:number, progress: number}}>}
97
96
  */
98
97
  progress: new Signal(),
99
98
  /**
@@ -225,7 +224,7 @@ export class AssetPreloader {
225
224
 
226
225
  const totalProcessed = numAssetsLoaded + numAssetsFailed;
227
226
 
228
- if (totalProcessed <= numAssets) {
227
+ if (totalProcessed < numAssets) {
229
228
  // not done yet
230
229
  return;
231
230
  }
@@ -302,7 +301,7 @@ export class AssetPreloader {
302
301
 
303
302
  //sort batch by priority
304
303
  batch.sort((a, b) => {
305
- return b.priotity - a.priotity;
304
+ return b.priority - a.priority;
306
305
  });
307
306
 
308
307
  for (const def of batch) {