Skip to content

Commit

Permalink
split out more
Browse files Browse the repository at this point in the history
  • Loading branch information
Ragzouken committed Jun 1, 2024
1 parent e9227e4 commit c302af0
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/scripts/playback.js
Original file line number Diff line number Diff line change
Expand Up @@ -587,17 +587,21 @@ class BipsiPlayback extends EventTarget {
scene.push({ layer: 3, func: () => dest.drawImage(this.dialoguePlayback.dialogueRendering.canvas, 0, 0) });
}

addLayersToScene(scene, dest, frame) {
if (!this.ended) {
this.addRoomToScene(scene, dest, frame);
this.addDialogueToScene(scene, dest, frame);
this.addImagesToScene(scene, dest, frame);
}
}

render(frame=undefined) {
frame = frame ?? this.frameCount;

const scene = [];

// add visual layers to scene
if (!this.ended) {
this.addImagesToScene(scene, this.rendering, frame);
this.addRoomToScene(scene, this.rendering, frame);
this.addDialogueToScene(scene, this.rendering, frame);
}
this.addLayersToScene(scene, this.rendering, frame);

// sort visual layers
scene.sort((a, b) => a.layer - b.layer);
Expand Down

0 comments on commit c302af0

Please sign in to comment.