@woosh/meep-engine 2.111.12 → 2.111.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.
@@ -97886,7 +97886,7 @@ class LabelView extends View {
97886
97886
  */
97887
97887
  class ImmutableObjectPool {
97888
97888
  /**
97889
- *
97889
+ * @readonly
97890
97890
  * @type {Signal<Key,Value>}
97891
97891
  */
97892
97892
  onRemoved = new Signal()
@@ -97955,6 +97955,16 @@ class ImmutableObjectPool {
97955
97955
  return element.value;
97956
97956
  }
97957
97957
 
97958
+ /**
97959
+ * Removed all elements from cache
97960
+ * NOTE: {@link onRemoved} signal *does* get triggered for each element
97961
+ */
97962
+ clear() {
97963
+ while (this.__first !== null) {
97964
+ this.__removeElement(this.__first);
97965
+ }
97966
+ }
97967
+
97958
97968
  /**
97959
97969
  *
97960
97970
  * @param {CacheElement<Key,Value>} el
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "description": "Fully featured ECS game engine written in JavaScript",
6
6
  "type": "module",
7
7
  "author": "Alexander Goldring",
8
- "version": "2.111.12",
8
+ "version": "2.111.14",
9
9
  "main": "build/meep.module.js",
10
10
  "module": "build/meep.module.js",
11
11
  "exports": {
@@ -7,10 +7,10 @@ export class ImmutableObjectPool<Key, Value> {
7
7
  perKeyCapacity?: number;
8
8
  });
9
9
  /**
10
- *
10
+ * @readonly
11
11
  * @type {Signal<Key,Value>}
12
12
  */
13
- onRemoved: Signal<Key, Value>;
13
+ readonly onRemoved: Signal<Key, Value>;
14
14
  /**
15
15
  *
16
16
  * @type {HashMap<Key, CacheElement<Key,Value>[]>}
@@ -44,6 +44,11 @@ export class ImmutableObjectPool<Key, Value> {
44
44
  */
45
45
  size: number;
46
46
  get(key: any): Value_1;
47
+ /**
48
+ * Removed all elements from cache
49
+ * NOTE: {@link onRemoved} signal *does* get triggered for each element
50
+ */
51
+ clear(): void;
47
52
  /**
48
53
  *
49
54
  * @param {CacheElement<Key,Value>} el
@@ -1 +1 @@
1
- {"version":3,"file":"ImmutableObjectPool.d.ts","sourceRoot":"","sources":["../../../../../src/core/model/object/ImmutableObjectPool.js"],"names":[],"mappings":"AAIA;;GAEG;AACH;IAOI;;;OAqCC;IA3CD;;;OAGG;IACH,WAFU,OAAO,GAAG,EAAC,KAAK,CAAC,CAEH;IAGpB;;;OAGG;IACH,MAFU,QAAQ,GAAG,EAAE,aAAa,GAAG,EAAC,KAAK,CAAC,EAAE,CAAC,CAExB;IAEzB;;;;OAIG;IACH,gBAAmB;IACnB;;;;OAIG;IACH,eAAkB;IAElB;;;OAGG;IACH,UAFU,MAAM,CAEQ;IAExB;;;OAGG;IACH,gBAFU,MAAM,CAEoB;IAEpC;;;OAGG;IACH,MAFU,MAAM,CAEH;IAGjB,uBAuBC;IAED;;;;OAIG;IACH,wBA0BC;IAED,mCA2CC;CACJ;mBAzJkB,+BAA+B;wBAD1B,iCAAiC;6BAD5B,6BAA6B"}
1
+ {"version":3,"file":"ImmutableObjectPool.d.ts","sourceRoot":"","sources":["../../../../../src/core/model/object/ImmutableObjectPool.js"],"names":[],"mappings":"AAIA;;GAEG;AACH;IAOI;;;OAqCC;IA3CD;;;OAGG;IACH,oBAFU,OAAO,GAAG,EAAC,KAAK,CAAC,CAEH;IAGpB;;;OAGG;IACH,MAFU,QAAQ,GAAG,EAAE,aAAa,GAAG,EAAC,KAAK,CAAC,EAAE,CAAC,CAExB;IAEzB;;;;OAIG;IACH,gBAAmB;IACnB;;;;OAIG;IACH,eAAkB;IAElB;;;OAGG;IACH,UAFU,MAAM,CAEQ;IAExB;;;OAGG;IACH,gBAFU,MAAM,CAEoB;IAEpC;;;OAGG;IACH,MAFU,MAAM,CAEH;IAGjB,uBAuBC;IAED;;;OAGG;IACH,cAIC;IAED;;;;OAIG;IACH,wBA0BC;IAED,mCA2CC;CACJ;mBAnKkB,+BAA+B;wBAD1B,iCAAiC;6BAD5B,6BAA6B"}
@@ -7,7 +7,7 @@ import Signal from "../../events/signal/Signal.js";
7
7
  */
8
8
  export class ImmutableObjectPool {
9
9
  /**
10
- *
10
+ * @readonly
11
11
  * @type {Signal<Key,Value>}
12
12
  */
13
13
  onRemoved = new Signal()
@@ -76,6 +76,16 @@ export class ImmutableObjectPool {
76
76
  return element.value;
77
77
  }
78
78
 
79
+ /**
80
+ * Removed all elements from cache
81
+ * NOTE: {@link onRemoved} signal *does* get triggered for each element
82
+ */
83
+ clear() {
84
+ while (this.__first !== null) {
85
+ this.__removeElement(this.__first);
86
+ }
87
+ }
88
+
79
89
  /**
80
90
  *
81
91
  * @param {CacheElement<Key,Value>} el
@@ -1 +1 @@
1
- export function objectDeepEquals<A extends object, B extends object>(a: A, b: B, value_equals: (a: A, b: B) => boolean, value_equals_context?: any): boolean
1
+ export function objectDeepEquals<A extends object, B extends object>(a: A, b: B, value_equals?: (a: A, b: B) => boolean, value_equals_context?: any): boolean
@@ -33,6 +33,6 @@ export class IRenderContext {
33
33
  }
34
34
 
35
35
  destroy() {
36
- // override as necessary
36
+ this.resource_manager.destroy();
37
37
  }
38
38
  }
@@ -11,6 +11,11 @@ export class RenderResourceManager {
11
11
  * @param {T} resource
12
12
  */
13
13
  release<T_1>(resource: T_1): void;
14
+ /**
15
+ * Release all held resources including ones issues in cache and held externally
16
+ * All resources issues by the manager are affected
17
+ */
18
+ destroy(): void;
14
19
  #private;
15
20
  }
16
21
  //# sourceMappingURL=RenderResourceManager.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"RenderResourceManager.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/graphics/render/frame_graph/resource/RenderResourceManager.js"],"names":[],"mappings":"AAGA;IAqBI,uBAEC;IAUD;;;;OAIG;IACH,6CAiBC;IAED;;;OAGG;IACH,kCAYC;;CACJ"}
1
+ {"version":3,"file":"RenderResourceManager.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/graphics/render/frame_graph/resource/RenderResourceManager.js"],"names":[],"mappings":"AAGA;IAqBI,uBAEC;IAUD;;;;OAIG;IACH,6CAiBC;IAED;;;OAGG;IACH,kCAYC;IAED;;;OAGG;IACH,gBAaC;;CACJ"}
@@ -75,4 +75,23 @@ export class RenderResourceManager {
75
75
  this.#cache.add(descriptor, resource);
76
76
 
77
77
  }
78
+
79
+ /**
80
+ * Release all held resources including ones issues in cache and held externally
81
+ * All resources issues by the manager are affected
82
+ */
83
+ destroy() {
84
+ this.#cache.clear()
85
+
86
+ // release all held resources
87
+ for (const resource of this.#resource_descriptors.keys()) {
88
+
89
+ const descriptor = this.#resource_descriptors.get(resource);
90
+
91
+ this.#ctx.destroyResource(resource, descriptor);
92
+
93
+ }
94
+
95
+ this.#resource_descriptors.clear();
96
+ }
78
97
  }