From d8d046c1102c0f30e62c702f159bbacc0341194c Mon Sep 17 00:00:00 2001 From: miku-666 <74728189+NessieHax@users.noreply.github.com> Date: Wed, 30 Aug 2023 18:43:55 +0200 Subject: [PATCH] AnimationPictureBox - Removed 'TickInMillisecond' constant and use 'Animation.GameTickInMilliseconds' --- PCK-Studio/ToolboxItems/AnimationPictureBox.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/PCK-Studio/ToolboxItems/AnimationPictureBox.cs b/PCK-Studio/ToolboxItems/AnimationPictureBox.cs index 9a50fbd3..666650f6 100644 --- a/PCK-Studio/ToolboxItems/AnimationPictureBox.cs +++ b/PCK-Studio/ToolboxItems/AnimationPictureBox.cs @@ -49,8 +49,6 @@ namespace PckStudio.ToolboxItems } } - private const int TickInMillisecond = 50; // 1 InGame tick - private bool _isPlaying = false; private int currentAnimationFrameIndex = 0; private Animation.Frame currentFrame; @@ -111,7 +109,7 @@ namespace PckStudio.ToolboxItems continue; } SetAnimationFrame(currentFrame); - if (cts.Token.WaitHandle.WaitOne(TickInMillisecond * currentFrame.Ticks)) + if (cts.Token.WaitHandle.WaitOne(Animation.GameTickInMilliseconds * currentFrame.Ticks)) { IsPlaying = false; break; @@ -125,7 +123,7 @@ namespace PckStudio.ToolboxItems { double delta = 1.0f - tick / (double)currentFrame.Ticks; SetTexture(currentFrame.Texture.Interpolate(nextFrame.Texture, delta)); - if (cts.Token.WaitHandle.WaitOne(TickInMillisecond)) + if (cts.Token.WaitHandle.WaitOne(Animation.GameTickInMilliseconds)) break; } }