From 2fd0a8ab3a19848aad8ce3c3c878e342b1bbcbed Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Tue, 19 Apr 2016 17:31:03 -0700 Subject: [PATCH] Add proper DAT addition and merging --- DiffDat/MergeDAT.cs | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/DiffDat/MergeDAT.cs b/DiffDat/MergeDAT.cs index 783eb36b..0a0157e7 100644 --- a/DiffDat/MergeDAT.cs +++ b/DiffDat/MergeDAT.cs @@ -34,7 +34,7 @@ namespace SabreTools Build.Start("DiffDat"); List inputs = new List(); - bool tofile = false, help = false, merge = false; ; + bool tofile = false, help = false, merge = false, diff = false; foreach (string arg in args) { switch (arg) @@ -48,6 +48,10 @@ namespace SabreTools case "--log": tofile = true; break; + case "-d": + case "--diff": + diff = true; + break; case "-m": case "--merge": merge = true; @@ -80,13 +84,20 @@ namespace SabreTools return; } - // Otherwise, read in the files, diff them, and write the result to the file type that the first one is + // Otherwise, read in the files, process them and write the result to the file type that the first one is List A = new List(); foreach (string input in inputs) { logger.Log("Adding DAT: " + input); List B = RomManipulation.Parse(input, 0, 0, logger); - A = RomManipulation.Diff(A, B); + if (diff) + { + A = RomManipulation.Diff(A, B); + } + else + { + A.AddRange(B); + } } // If we want a merged list, send it for merging before outputting