playmov: coloured ascii mode

This commit is contained in:
minjaesong
2026-06-07 22:38:41 +09:00
parent ce45929c4e
commit c8fc363445
7 changed files with 166 additions and 18 deletions

View File

@@ -189,6 +189,7 @@ function create(magic, sr, fileLength, opts, common) {
// Player calls blit() (which uploads currentFrameSrc) before sampleGray in
// ASCII mode, so we read the framebuffer the upload just produced.
function sampleGray(dst, w, h) { common.sampleGrayScreen(width, height, dst, w, h, 4) }
function sampleColour(dst, w, h) { common.sampleColourScreen(width, height, dst, w, h, 4) }
return {
info: info,
@@ -204,6 +205,7 @@ function create(magic, sr, fileLength, opts, common) {
blit: blit,
bias() { applyBias() },
sampleGray: sampleGray,
sampleColour: sampleColour,
pause(p) { paused = p; if (p) audioR.stop(); else { audioR.resume(); lastT = sys.nanoTime() } },
isPaused() { return paused },
setVolume(v) { audioR.setVolume(v) },