From 719ae11cb0ddb2ecf0ff1d47da70efc5332597cc Mon Sep 17 00:00:00 2001 From: Harrison Date: Sat, 29 Feb 2020 01:53:06 -0500 Subject: [PATCH] Changed code to be compliant to .Net Framework 4.8. --- RecrownedGTK.Tools/CommandProcessor/CommandEngine.cs | 8 ++++---- RecrownedGTK.Tools/TextureAtlasTools/TexturePacker.cs | 6 +++++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/RecrownedGTK.Tools/CommandProcessor/CommandEngine.cs b/RecrownedGTK.Tools/CommandProcessor/CommandEngine.cs index 75a92ca..0852f44 100644 --- a/RecrownedGTK.Tools/CommandProcessor/CommandEngine.cs +++ b/RecrownedGTK.Tools/CommandProcessor/CommandEngine.cs @@ -40,7 +40,7 @@ namespace RecrownedGTK.Tools.CommandProcessor string command = commandAndArguments; string[] arguments = null; - if (commandAndArguments.Contains(' ')) + if (commandAndArguments.Contains(" ")) { command = command.Remove(command.IndexOf(' ')); if (!ContainsCommand(command)) throw new ArgumentException("Command not found."); @@ -49,7 +49,7 @@ namespace RecrownedGTK.Tools.CommandProcessor for (int i = 0; i < argumentsSplit.Length; i++) { - if (argumentsSplit[i].Contains('"') && !argumentsSplit[i].EndsWith('"')) + if (argumentsSplit[i].Contains("\"") && !argumentsSplit[i].EndsWith("\"")) { StringBuilder quoteBuilder = new StringBuilder(); do @@ -62,8 +62,8 @@ namespace RecrownedGTK.Tools.CommandProcessor throw new ArgumentException("Argument is missing terminating \'\"\'"); } - } while (!argumentsSplit[i].Contains('"')); - quoteBuilder.Append(' '); + } while (!argumentsSplit[i].Contains("\"")); + quoteBuilder.Append(" "); quoteBuilder.Append(argumentsSplit[i]); argumentsList.Add(quoteBuilder.ToString().Replace("\"", "").Trim()); } diff --git a/RecrownedGTK.Tools/TextureAtlasTools/TexturePacker.cs b/RecrownedGTK.Tools/TextureAtlasTools/TexturePacker.cs index 15a0948..aee3d07 100644 --- a/RecrownedGTK.Tools/TextureAtlasTools/TexturePacker.cs +++ b/RecrownedGTK.Tools/TextureAtlasTools/TexturePacker.cs @@ -86,8 +86,12 @@ namespace RecrownedGTK.Tools.TextureAtlas masterNode.region.Height = TextureLength; Queue imageHandlerQueue = new Queue(imageHandlers); ImageHandler imageHandler; - while (imageHandlerQueue.TryDequeue(out imageHandler)) + + + while (imageHandlerQueue.Count != 0) { + imageHandler = imageHandlerQueue.Dequeue(); + Node activeNode = null; activeNode = masterNode.InsertImageHandler(imageHandler); if (activeNode == null)