@woosh/meep-engine 2.33.50 → 2.33.51

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.
@@ -715,7 +715,7 @@ EntityManager.prototype.startup = function (readyCallback, errorCallback) {
715
715
  let firstFailure = true;
716
716
 
717
717
  function systemError(system, error) {
718
- console.error("Failed to start system", system);
718
+ console.error("Failed to start system", system, 'Error:', error);
719
719
 
720
720
  if (firstFailure) {
721
721
  firstFailure = false;
@@ -1,6 +1,7 @@
1
1
  import { ParticleEmitter } from "./particular/engine/emitter/ParticleEmitter.js";
2
2
  import { GameAssetType } from "../../asset/GameAssetType.js";
3
3
  import { assert } from "../../../core/assert.js";
4
+ import { JsonAssetLoader } from "../../asset/loaders/JsonAssetLoader.js";
4
5
 
5
6
  /**
6
7
  * @deprecated Use "Effect" API to achieve the same results
@@ -20,6 +21,26 @@ export class ParticleEmitterLibrary {
20
21
  this.data = {};
21
22
  }
22
23
 
24
+ /**
25
+ *
26
+ * @param {string} path
27
+ * @returns {Promise<void>}
28
+ */
29
+ async load_from_registry_file(path) {
30
+
31
+ const am = this.assetManager;
32
+
33
+ if (am.getLoaderByType(GameAssetType.JSON) === undefined) {
34
+ // add missing loader
35
+ await am.registerLoader(GameAssetType.JSON, new JsonAssetLoader());
36
+ }
37
+
38
+ const asset = await am.promise(path, GameAssetType.JSON)
39
+ const particleSet = asset.create();
40
+
41
+ await this.load(particleSet);
42
+ }
43
+
23
44
  /**
24
45
  * @param {Object} listing
25
46
  * @returns {Promise}
@@ -5,7 +5,6 @@ import { Transform } from "../../../ecs/transform/Transform.js";
5
5
  import { ParticleEmitterFlag } from "../particular/engine/emitter/ParticleEmitterFlag.js";
6
6
  import { RenderPassType } from "../../render/RenderPassType.js";
7
7
  import { ParticleEmitterLibrary } from "../ParticleEmitterLibrary.js";
8
- import { GameAssetType } from "../../../asset/GameAssetType.js";
9
8
  import { ImageRGBADataLoader } from "../../../asset/loaders/image/ImageRGBADataLoader.js";
10
9
  import { StandardFrameBuffers } from "../../StandardFrameBuffers.js";
11
10
  import { assert } from "../../../../core/assert.js";
@@ -209,15 +208,7 @@ export class ParticleEmitterSystem extends System {
209
208
 
210
209
  graphicsEngine.on.preRender.add(preRenderHook);
211
210
 
212
- const library = this.library;
213
-
214
- am.promise('data/database/particles/data.json', GameAssetType.JSON)
215
- .then(asset => {
216
- const particleSet = asset.create();
217
-
218
- return library.load(particleSet);
219
- })
220
- .then(readyCallback, errorCallback);
211
+ this.library.load_from_registry_file('data/database/particles/data.json').then(readyCallback, errorCallback);
221
212
  }
222
213
 
223
214
  shutdown(entityManager, readyCallback, errorCallback) {
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "productName": "Meep",
6
6
  "description": "production-ready JavaScript game engine based on Entity Component System Architecture",
7
7
  "author": "Alexander Goldring",
8
- "version": "2.33.50",
8
+ "version": "2.33.51",
9
9
  "dependencies": {
10
10
  "gl-matrix": "3.4.3",
11
11
  "fast-levenshtein": "2.0.6",