mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/PCK-Studio.git
synced 2026-06-20 01:25:33 +00:00
Merge branch 'main' into 3dSkinRenderer
This commit is contained in:
@@ -20,10 +20,10 @@ namespace PckStudio.Extensions
|
||||
return null;
|
||||
}
|
||||
var ms = new System.IO.MemoryStream();
|
||||
var generateor = new AnimatedGifCreator(ms, Animation.GameTickInMilliseconds, 0);
|
||||
var generateor = new AnimatedGifCreator(ms, GameConstants.GameTickInMilliseconds, 0);
|
||||
foreach (var frame in animation.GetInterpolatedFrames())
|
||||
{
|
||||
generateor.AddFrame(frame.Texture, frame.Ticks * Animation.GameTickInMilliseconds, GifQuality.Bit8);
|
||||
generateor.AddFrame(frame.Texture, frame.Ticks * GameConstants.GameTickInMilliseconds, GifQuality.Bit8);
|
||||
}
|
||||
ms.Position = 0;
|
||||
return Image.FromStream(ms);
|
||||
|
||||
@@ -465,14 +465,7 @@ namespace PckStudio.Forms.Editor
|
||||
};
|
||||
if (fileDialog.ShowDialog(this) != DialogResult.OK)
|
||||
return;
|
||||
|
||||
using (var gifWriter = AnimatedGif.AnimatedGif.Create(fileDialog.FileName, Animation.GameTickInMilliseconds, repeat: 0))
|
||||
{
|
||||
foreach (var frame in _animation.GetInterpolatedFrames())
|
||||
{
|
||||
gifWriter.AddFrame(frame.Texture, frame.Ticks * Animation.GameTickInMilliseconds, GifQuality.Bit8);
|
||||
}
|
||||
}
|
||||
_animation.CreateAnimationImage().Save(fileDialog.FileName);
|
||||
}
|
||||
|
||||
private void frameTimeandTicksToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
|
||||
@@ -29,8 +29,6 @@ namespace PckStudio.Internal
|
||||
{
|
||||
public const int MinimumFrameTime = 1;
|
||||
|
||||
public const int GameTickInMilliseconds = 50;
|
||||
|
||||
public int FrameCount => frames.Count;
|
||||
|
||||
public int TextureCount => textures.Count;
|
||||
|
||||
@@ -9,6 +9,9 @@ namespace PckStudio.Internal
|
||||
{
|
||||
internal static class GameConstants
|
||||
{
|
||||
|
||||
public const int GameTickInMilliseconds = 50;
|
||||
|
||||
// See: https://minecraft.fandom.com/wiki/Dye#Color_values for more information.
|
||||
public static readonly Color[] DyeColors = [
|
||||
Color.FromArgb(0xf9fffe), // White
|
||||
|
||||
Reference in New Issue
Block a user