From 64efe984b04b0c8a7c92b968f03cae3cb9c1b96a Mon Sep 17 00:00:00 2001 From: candle Date: Tue, 2 Jul 2024 21:26:17 +0100 Subject: [PATCH] restore 2x scaling of images for non-hd --- src/scripts/playback.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/scripts/playback.js b/src/scripts/playback.js index 36f8a44..451e1b3 100644 --- a/src/scripts/playback.js +++ b/src/scripts/playback.js @@ -569,9 +569,19 @@ class BipsiPlayback extends EventTarget { scene.push({ layer: 2, func: upscaler(() => drawEventLayer(TEMP_ROOM, tileset, tileToFrame, palette, room.events)) }); } + /** + * + * @param {*} scene + * @param {CanvasRenderingContext2D} dest + * @param {number} frame + */ addImagesToScene(scene, dest, frame) { + // 2x scale for images for non-hd + const scale = BIPSI_HD ? 1 : 2; + function drawImage({ image, x, y }) { - dest.drawImage(image[frame % image.length], x, y); + const source = image[frame % image.length] + dest.drawImage(source, x, y, source.width * scale, source.height * scale); } const images = [...this.images.values()];