mirror of
https://github.com/JannisX11/blockbench.git
synced 2024-11-21 01:13:37 +08:00
Fix issues with audio playback
This commit is contained in:
parent
3fd1ae7b8e
commit
dd64a9755b
@ -1007,8 +1007,8 @@ class EffectAnimator extends GeneralAnimator {
|
||||
keyframe.animator = this;
|
||||
return this;
|
||||
}
|
||||
displayFrame() {
|
||||
if (!this.muted.sound) {
|
||||
displayFrame(in_loop) {
|
||||
if (in_loop && !this.muted.sound) {
|
||||
this.sound.forEach(kf => {
|
||||
var diff = kf.time - Timeline.time;
|
||||
if (diff >= 0 && diff < (1/60) * (Timeline.playback_speed/100)) {
|
||||
@ -1355,7 +1355,7 @@ const Animator = {
|
||||
object.scale.set(scale, scale, scale)
|
||||
})
|
||||
},
|
||||
preview() {
|
||||
preview(in_loop) {
|
||||
// Bones
|
||||
Animator.showDefaultPose(true);
|
||||
Group.all.forEach(group => {
|
||||
@ -1373,7 +1373,7 @@ const Animator = {
|
||||
Animator.animations.forEach(animation => {
|
||||
if (animation.playing) {
|
||||
if (animation.animators.effects) {
|
||||
animation.animators.effects.displayFrame();
|
||||
animation.animators.effects.displayFrame(in_loop);
|
||||
}
|
||||
}
|
||||
})
|
||||
|
@ -449,7 +449,9 @@ const Timeline = {
|
||||
start() {
|
||||
if (!Animation.selected) return;
|
||||
Animation.selected.getMaxLength()
|
||||
Timeline.pause()
|
||||
if (Timeline.playing) {
|
||||
Timeline.pause()
|
||||
}
|
||||
Timeline.playing = true
|
||||
BarItems.play_animation.setIcon('pause')
|
||||
Timeline.last_frame_timecode = Date.now();
|
||||
@ -467,7 +469,7 @@ const Timeline = {
|
||||
Timeline.loop()
|
||||
},
|
||||
loop() {
|
||||
Animator.preview()
|
||||
Animator.preview(true);
|
||||
if (Animation.selected && Timeline.time < (Animation.selected.length||1e3)) {
|
||||
|
||||
var new_time;
|
||||
|
Loading…
Reference in New Issue
Block a user