Skip to content

Commit

Permalink
Merge main into '3dSkinRenderer'
Browse files Browse the repository at this point in the history
  • Loading branch information
NessieHax committed Jul 21, 2024
2 parents 70e54fe + 51487a7 commit d950611
Show file tree
Hide file tree
Showing 12 changed files with 13 additions and 64 deletions.
10 changes: 1 addition & 9 deletions PCK-Studio/Extensions/AnimationExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Drawing;
using AnimatedGif;
using Newtonsoft.Json.Linq;
using PckStudio.Internal;

namespace PckStudio.Extensions
Expand Down
3 changes: 1 addition & 2 deletions PCK-Studio/Extensions/ColorExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Drawing;
using System.Drawing;
using System.Numerics;

namespace PckStudio.Extensions
Expand Down
6 changes: 1 addition & 5 deletions PCK-Studio/Extensions/GraphicsExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Text;

namespace PckStudio.Extensions
{
Expand Down
11 changes: 4 additions & 7 deletions PCK-Studio/Extensions/ImageExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Linq;
using PckStudio.Internal;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
using PckStudio.Internal.App;
Expand Down Expand Up @@ -113,24 +112,22 @@ internal static Image Combine(this IEnumerable<Image> sources, ImageLayoutDirect
private static Size CalculateImageSize(IEnumerable<Image> sources, ImageLayoutDirection layoutDirection)
{
Size size = sources.First().Size;
int width = size.Width;
int height = size.Height;
int count = sources.Count();

if (count < 2)
return count < 1 ? Size.Empty : size;

var horizontal = layoutDirection == ImageLayoutDirection.Horizontal;

if (!sources.All(img => img.Width.Equals(width) && img.Height.Equals(height)))
if (!sources.All(img => img.Size == size))
throw new InvalidOperationException("Images must have the same width and height.");

if (horizontal)
width *= count;
size.Width *= count;
else
height *= count;
size.Height *= count;

return new Size(width, height);
return size;
}

internal static Image Resize(this Image image, Size size, GraphicsConfig graphicsConfig)
Expand Down
7 changes: 1 addition & 6 deletions PCK-Studio/Extensions/LocFileExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using OMI.Formats.Languages;
using OMI.Formats.Languages;

namespace PckStudio.Extensions
{
Expand Down
7 changes: 1 addition & 6 deletions PCK-Studio/Extensions/MaterialContainerExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using OMI.Formats.Material;
using OMI.Formats.Material;

namespace PckStudio.Extensions
{
Expand Down
4 changes: 0 additions & 4 deletions PCK-Studio/Extensions/MathExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PckStudio.Extensions
{
Expand Down
7 changes: 2 additions & 5 deletions PCK-Studio/Extensions/PckAssetExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using OMI.Formats.Languages;
using OMI.Formats.Pck;
using OMI.Workers;
using PckStudio.Internal;
using PckStudio.Interfaces;
using PckStudio.Internal.Deserializer;
using PckStudio.Internal.Serializer;
using PckStudio.Internal.Skin;
using System.Linq;
using System.Diagnostics;

namespace PckStudio.Extensions
{
Expand Down
8 changes: 1 addition & 7 deletions PCK-Studio/Extensions/PckFileExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using OMI.Formats.Pck;
using OMI.Formats.Pck;
using OMI.Workers;

namespace PckStudio.Extensions
Expand Down
4 changes: 0 additions & 4 deletions PCK-Studio/Extensions/PictureBoxExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace PckStudio.Extensions
Expand Down
6 changes: 1 addition & 5 deletions PCK-Studio/Extensions/TreeNodeExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Collections.Generic;
using System.Windows.Forms;

namespace PckStudio.Extensions
Expand Down
4 changes: 0 additions & 4 deletions PCK-Studio/Extensions/TreeViewExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using PckStudio.Internal.App;

namespace PckStudio.Extensions
{
Expand Down

0 comments on commit d950611

Please sign in to comment.