Skip to content

Commit

Permalink
update TODOs and remove some debug logs
Browse files Browse the repository at this point in the history
  • Loading branch information
spearwolf committed Mar 25, 2024
1 parent 9bc209e commit 1a7309e
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 24 deletions.
16 changes: 7 additions & 9 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -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.

Expand All @@ -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 ? |


Expand All @@ -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 |
Expand Down
2 changes: 0 additions & 2 deletions packages/shadow-ents/src/entities/Kernel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
6 changes: 1 addition & 5 deletions packages/vfx/src/elements/VfxCtxElement.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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`);
};
}
}
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/vfx/src/shadow-objects/ThreeMultiViewRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
8 changes: 1 addition & 7 deletions packages/vfx/src/shadow-objects/VfxDisplay.js
Original file line number Diff line number Diff line change
Expand Up @@ -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], {
Expand Down

0 comments on commit 1a7309e

Please sign in to comment.