@woosh/meep-engine 2.131.13 → 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.
|
|
8
|
+
"version": "2.131.14",
|
|
9
9
|
"main": "build/meep.module.js",
|
|
10
10
|
"module": "build/meep.module.js",
|
|
11
11
|
"exports": {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssetPreloader.d.ts","sourceRoot":"","sources":["../../../../../src/engine/asset/preloader/AssetPreloader.js"],"names":[],"mappings":"
|
|
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
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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.
|
|
36
|
+
this.priority = priority;
|
|
39
37
|
}
|
|
40
38
|
|
|
41
39
|
/**
|
|
@@ -303,7 +301,7 @@ export class AssetPreloader {
|
|
|
303
301
|
|
|
304
302
|
//sort batch by priority
|
|
305
303
|
batch.sort((a, b) => {
|
|
306
|
-
return b.
|
|
304
|
+
return b.priority - a.priority;
|
|
307
305
|
});
|
|
308
306
|
|
|
309
307
|
for (const def of batch) {
|