Skip to content

Commit

Permalink
restore 2x scaling of images for non-hd
Browse files Browse the repository at this point in the history
  • Loading branch information
Ragzouken committed Jul 2, 2024
1 parent 29d8e6a commit 64efe98
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/scripts/playback.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()];
Expand Down

0 comments on commit 64efe98

Please sign in to comment.