From 1a7309e6e1357c911b638b480a51adace6fbde14 Mon Sep 17 00:00:00 2001 From: Wolfger Schramm Date: Mon, 25 Mar 2024 13:18:45 +0100 Subject: [PATCH] update TODOs and remove some debug logs --- TODO.md | 16 +++++++--------- packages/shadow-ents/src/entities/Kernel.ts | 2 -- packages/vfx/src/elements/VfxCtxElement.js | 6 +----- .../src/shadow-objects/ThreeMultiViewRenderer.js | 2 +- packages/vfx/src/shadow-objects/VfxDisplay.js | 8 +------- 5 files changed, 10 insertions(+), 24 deletions(-) diff --git a/TODO.md b/TODO.md index aa9c21b..641fa8d 100644 --- a/TODO.md +++ b/TODO.md @@ -1,7 +1,7 @@ # @spearwolf/visual-fx-web-components -> _Generated by [scripts/makeTODO.mjs](scripts/makeTODO.mjs) at 2024-03-23T17:11:46.494Z_ +> _Generated by [scripts/makeTODO.mjs](scripts/makeTODO.mjs) at 2024-03-25T12:18:41.080Z_ This file contains an overview of all TODO, FIXME or XXX comments extracted from the source files of the packages. @@ -19,20 +19,19 @@ This file contains an overview of all TODO, FIXME or XXX comments extracted from | Filename | line # | TODO | |:------|:------:|:------| | [packages/vfx/src/worker-sample.js](packages/vfx/src/worker-sample.js#L9) | 9 | create and export types for onload function | -| [packages/vfx/src/elements/VfxCtxElement.js](packages/vfx/src/elements/VfxCtxElement.js#L279) | 279 | initialize worker ? | -| [packages/vfx/src/elements/VfxCtxElement.js](packages/vfx/src/elements/VfxCtxElement.js#L285) | 285 | this.actor.send({type: 'workerFailed'}) ? | -| [packages/vfx/src/elements/VfxCtxElement.js](packages/vfx/src/elements/VfxCtxElement.js#L299) | 299 | what should happen with the events ? | -| [packages/vfx/src/elements/VfxCtxElement.js](packages/vfx/src/elements/VfxCtxElement.js#L312) | 312 | find a more friendly way to destroy the worker before termination | +| [packages/vfx/src/elements/VfxCtxElement.js](packages/vfx/src/elements/VfxCtxElement.js#L275) | 275 | initialize worker ? | +| [packages/vfx/src/elements/VfxCtxElement.js](packages/vfx/src/elements/VfxCtxElement.js#L281) | 281 | this.actor.send({type: 'workerFailed'}) ? | +| [packages/vfx/src/elements/VfxCtxElement.js](packages/vfx/src/elements/VfxCtxElement.js#L295) | 295 | what should happen with the events ? | +| [packages/vfx/src/elements/VfxCtxElement.js](packages/vfx/src/elements/VfxCtxElement.js#L308) | 308 | find a more friendly way to destroy the worker before termination | | [packages/vfx/src/shadow-objects/ThreeRenderView.js](packages/vfx/src/shadow-objects/ThreeRenderView.js#L2) | 2 | implement ThreeRenderView | -| [packages/vfx/src/shadow-objects/VfxDisplay.js](packages/vfx/src/shadow-objects/VfxDisplay.js#L26) | 26 | use shared vfx.canvas|multiViewRenderer -------- | | [packages/vfx/src/worker/MessageRouter.js](packages/vfx/src/worker/MessageRouter.js#L16) | 16 | subscribe to kernel "message" events | | [packages/vfx/src/worker/MessageRouter.js](packages/vfx/src/worker/MessageRouter.js#L73) | 73 | remember constructors from define() for later cleanup (src changed, maybe we should support hotswap here?) | ### XXXs | Filename | line # | XXX | |:------|:------:|:------| -| [packages/vfx/src/elements/VfxCtxElement.js](packages/vfx/src/elements/VfxCtxElement.js#L206) | 206 | do we need to set additional properties on view component ? | -| [packages/vfx/src/shadow-objects/ThreeMultiViewRenderer.js](packages/vfx/src/shadow-objects/ThreeMultiViewRenderer.js#L19) | 19 | how we can set webgl-renderer parameters? | +| [packages/vfx/src/elements/VfxCtxElement.js](packages/vfx/src/elements/VfxCtxElement.js#L202) | 202 | do we really need to set additional properties on view component ? | +| [packages/vfx/src/shadow-objects/ThreeMultiViewRenderer.js](packages/vfx/src/shadow-objects/ThreeMultiViewRenderer.js#L19) | 19 | how we can configure webgl-renderer parameters? | | [packages/vfx/src/worker/MessageRouter.js](packages/vfx/src/worker/MessageRouter.js#L58) | 58 | do we need cleanup here ? | @@ -53,7 +52,6 @@ This file contains an overview of all TODO, FIXME or XXX comments extracted from | [packages/shadow-ents/src/entities/events.ts](packages/shadow-ents/src/entities/events.ts#L7) | 7 | @test test if OnCreate is called when an entity token is changed | | [packages/shadow-ents/src/entities/events.ts](packages/shadow-ents/src/entities/events.ts#L25) | 25 | @test test if OnDestroy is called when an entity is destroyed | | [packages/shadow-ents/src/entities/events.ts](packages/shadow-ents/src/entities/events.ts#L26) | 26 | @test test if OnDestroy is called when a shadow-object is removed from an entity (token-change) | -| [packages/shadow-ents/src/entities/Kernel.ts](packages/shadow-ents/src/entities/Kernel.ts#L292) | 292 | inform the entity that the shadow-object has been destroyed | ### XXXs | Filename | line # | XXX | diff --git a/packages/shadow-ents/src/entities/Kernel.ts b/packages/shadow-ents/src/entities/Kernel.ts index 2bf9b1f..ccc3990 100644 --- a/packages/shadow-ents/src/entities/Kernel.ts +++ b/packages/shadow-ents/src/entities/Kernel.ts @@ -289,8 +289,6 @@ export class Kernel extends Eventize { (shadowObject as OnDestroy)[onDestroy](entity); } - // TODO inform the entity that the shadow-object has been destroyed - entity.off(shadowObject); } } diff --git a/packages/vfx/src/elements/VfxCtxElement.js b/packages/vfx/src/elements/VfxCtxElement.js index e4692a2..8a555a0 100644 --- a/packages/vfx/src/elements/VfxCtxElement.js +++ b/packages/vfx/src/elements/VfxCtxElement.js @@ -111,11 +111,9 @@ export class VfxCtxElement extends VfxElement { let delay = undefined; if (['true', 'yes', 'on', 'frame', 'auto-sync'].includes(autoSync)) { - console.debug(`[vfx-ctx] start auto-sync on frame [${autoSync}]`); this.frameLoop.start(this); return () => { this.frameLoop.stop(this); - console.debug(`[vfx-ctx] stop auto-sync on frame`); }; } else if (autoSync.toLowerCase().endsWith('fps')) { const fps = parseInt(autoSync, 10); @@ -135,13 +133,11 @@ export class VfxCtxElement extends VfxElement { } if (delay !== undefined && delay > 0) { - console.debug(`[vfx-ctx] start auto-sync on interval: ${delay} ms (${autoSync})`); const id = setInterval(() => { this.syncShadowObjects(); }, delay); return () => { clearInterval(id); - console.debug(`[vfx-ctx] stop auto-sync on interval`); }; } } @@ -203,7 +199,7 @@ export class VfxCtxElement extends VfxElement { vc.setProperty('bar', 666); // TODO remove me! - // XXX do we need to set additional properties on view component ? + // XXX do we really need to set additional properties on view component ? // or can we just throw away this method? this.syncShadowObjects(); // initial sync diff --git a/packages/vfx/src/shadow-objects/ThreeMultiViewRenderer.js b/packages/vfx/src/shadow-objects/ThreeMultiViewRenderer.js index b0918e1..de67812 100644 --- a/packages/vfx/src/shadow-objects/ThreeMultiViewRenderer.js +++ b/packages/vfx/src/shadow-objects/ThreeMultiViewRenderer.js @@ -16,7 +16,7 @@ export class ThreeMultiViewRenderer { this.canvas = new OffscreenCanvas(DEFAULT_WIDTH, DEFAULT_HEIGHT); - // XXX how we can set webgl-renderer parameters? + // XXX how we can configure webgl-renderer parameters? this.renderer = new WebGLRenderer({canvas: this.canvas}); this.renderer.setScissorTest(true); diff --git a/packages/vfx/src/shadow-objects/VfxDisplay.js b/packages/vfx/src/shadow-objects/VfxDisplay.js index c5d531c..f2911c2 100644 --- a/packages/vfx/src/shadow-objects/VfxDisplay.js +++ b/packages/vfx/src/shadow-objects/VfxDisplay.js @@ -20,15 +20,9 @@ export class VfxDisplay { return this.isRunning && this.canvas != null && this.canvas.width > 0 && this.canvas.height > 0; } - constructor({entity, useContext, useProperty, provideContext, onDestroy}) { + constructor({entity, useProperty, provideContext, onDestroy}) { this.entity = entity; - // TODO use shared vfx.canvas|multiViewRenderer -------- - useContext('multiViewRenderer')((val) => { - console.debug('[VfxDisplay] multiViewRenderer changed to', val); - }); - // ----------------------------------------------------- - const [getCanvas, setCanvas] = provideContext('canvas'); const [getCanvasSize, setCanvasSize] = createSignal([0, 0, 0], {