littlejsengine 1.18.28 → 1.19.3

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.
@@ -43,12 +43,15 @@ const enginePluginFiles =
43
43
  `${PLUGIN_FOLDER}/postProcess.js`,
44
44
  `${PLUGIN_FOLDER}/lightSystem.js`,
45
45
  `${PLUGIN_FOLDER}/zzfxm.js`,
46
+ `${PLUGIN_FOLDER}/audioEffects.js`,
46
47
  `${PLUGIN_FOLDER}/uiSystem.js`,
47
48
  `${PLUGIN_FOLDER}/box2d.js`,
48
49
  `${PLUGIN_FOLDER}/drawUtilities.js`,
49
50
  `${PLUGIN_FOLDER}/textureSheet.js`,
50
51
  `${PLUGIN_FOLDER}/tweenSystem.js`,
51
52
  `${PLUGIN_FOLDER}/pathFinder.js`,
53
+ `${PLUGIN_FOLDER}/math3d.js`,
54
+ `${PLUGIN_FOLDER}/render3d.js`,
52
55
  `${PLUGIN_FOLDER}/threejs.js`,
53
56
  ];
54
57
  const engineExtraFiles =
@@ -574,9 +574,9 @@ function debugRender()
574
574
  + savedDrawCount + ' / ' + savedPrimitiveCount + ' / '
575
575
  + engineObjects.length + ' / ' + averageFPS.toFixed(1)
576
576
  + (glEnable ? ' GL' : ' 2D') ;
577
- mainContext.fillText(text, mainCanvas.width-3, 3);
577
+ mainContext.fillText(text, mainCanvasSize.x-3, 3);
578
578
  mainContext.fillStyle = '#fff';
579
- mainContext.fillText(text, mainCanvas.width-2, 2);
579
+ mainContext.fillText(text, mainCanvasSize.x-2, 2);
580
580
  }
581
581
  }
582
582
 
@@ -637,7 +637,7 @@ function debugVideoCaptureStart()
637
637
  saveDataURL(url, 'capture.webm', 1e3);
638
638
  };
639
639
 
640
- let audioStreamDestination, silentAudioSource;
640
+ let audioStreamDestination, silentAudioSource, audioTapNode;
641
641
  if (soundEnable)
642
642
  {
643
643
  // create silent audio source
@@ -646,9 +646,11 @@ function debugVideoCaptureStart()
646
646
  silentAudioSource.connect(audioMasterGain);
647
647
  silentAudioSource.start();
648
648
 
649
- // connect to audio master gain node
649
+ // tap the end of the master chain so a master effect is in the recording
650
+ // (a master effect swapped mid-capture drops the tap, the rest records silent)
650
651
  audioStreamDestination = audioContext.createMediaStreamDestination();
651
- audioMasterGain.connect(audioStreamDestination);
652
+ audioTapNode = audioMasterEffectOutput || audioMasterGain;
653
+ audioTapNode.connect(audioStreamDestination);
652
654
  for (const track of audioStreamDestination.stream.getAudioTracks())
653
655
  stream.addTrack(track); // add audio tracks to capture stream
654
656
  }
@@ -659,7 +661,7 @@ function debugVideoCaptureStart()
659
661
  {
660
662
  LOG('Video capture not supported in this browser!');
661
663
  silentAudioSource?.stop();
662
- audioStreamDestination && audioMasterGain.disconnect(audioStreamDestination);
664
+ audioStreamDestination && audioTapNode.disconnect(audioStreamDestination);
663
665
  return;
664
666
  }
665
667
 
@@ -672,7 +674,8 @@ function debugVideoCaptureStart()
672
674
  captureTimer,
673
675
  videoTrack,
674
676
  silentAudioSource,
675
- audioStreamDestination
677
+ audioStreamDestination,
678
+ audioTapNode
676
679
  };
677
680
  }
678
681
 
@@ -689,7 +692,11 @@ function debugVideoCaptureStop()
689
692
  debugVideoCapture.mediaRecorder?.stop();
690
693
  debugVideoCapture.videoTrack?.stop();
691
694
  if (debugVideoCapture.audioStreamDestination)
692
- audioMasterGain.disconnect(debugVideoCapture.audioStreamDestination);
695
+ {
696
+ // the tap is already gone if the master effect changed during the capture
697
+ try { debugVideoCapture.audioTapNode.disconnect(debugVideoCapture.audioStreamDestination); }
698
+ catch { }
699
+ }
693
700
  debugVideoCapture = undefined;
694
701
  }
695
702