Skip to content

Commit

Permalink
BuildEvent, BuildMTN, BuiltMDL + SplitTools Cleanup (#279)
Browse files Browse the repository at this point in the history
  • Loading branch information
IsaacMarovitz authored Dec 17, 2024
1 parent dfaf51e commit 3181292
Show file tree
Hide file tree
Showing 20 changed files with 2,043 additions and 1,252 deletions.
File renamed without changes.
420 changes: 420 additions & 0 deletions CommandLine/BuildEvent/Program.cs

Large diffs are not rendered by default.

File renamed without changes.
79 changes: 79 additions & 0 deletions CommandLine/BuildMDL/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
using SplitTools.SAArc;
using System;
using System.Collections.Generic;

namespace BuildMDL
{
internal static class Program
{
private static void Main(string[] args)
{
var argQueue = new Queue<string>(args);

bool? bigEndian = null;

if (argQueue.Count > 0)
{
if (argQueue.Peek().Equals("/be", StringComparison.OrdinalIgnoreCase))
{
bigEndian = true;
argQueue.Dequeue();
}
else if (argQueue.Peek().Equals("/le", StringComparison.OrdinalIgnoreCase))
{
bigEndian = false;
argQueue.Dequeue();
}
}

string mdlFilename;
if (argQueue.Count > 0)
{
mdlFilename = argQueue.Dequeue();
Console.WriteLine("File: {0}", mdlFilename);
}
else
{
Console.WriteLine("File: ");
mdlFilename = Console.ReadLine().Trim('"');
}

SA2MDL.Build(bigEndian, mdlFilename);

/*
if (argQueue.Count > 0)
{
mdlFilename = argQueue.Dequeue();
Console.WriteLine("File: {0}", mdlFilename);
var file = File.GetAttributes(mdlFilename);
if (file.HasFlag(FileAttributes.Directory))
{
SA2MDL.Build(bigEndian, mdlFilename);
}
else
{
SA2MDL.Split(mdlFilename, Path.Combine(Environment.CurrentDirectory, Path.GetDirectoryName(mdlFilename)), argQueue.ToArray());
}
}
else
{
Console.Write("File: ");
mdlFilename = Console.ReadLine().Trim('"');
var file = File.GetAttributes(mdlFilename);
if (file.HasFlag(FileAttributes.Directory))
{
SA2MDL.Build(be, mdlFilename);
}
else
{
SA2MDL.Split(mdlFilename, Path.Combine(Environment.CurrentDirectory, Path.GetDirectoryName(mdlFilename)), argQueue.ToArray());
}
}
*/
}
}
}
File renamed without changes.
36 changes: 21 additions & 15 deletions CommandLine/buildMTN/Program.cs → CommandLine/BuildMTN/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,42 @@

namespace buildMTN
{
class Program
internal static class Program
{
static void Main(string[] args)
private static void Main(string[] args)
{
Queue<string> argq = new Queue<string>(args);
bool? be = null;
if (argq.Count > 0)
if (argq.Peek().Equals("/be", StringComparison.OrdinalIgnoreCase))
var argQueue = new Queue<string>(args);

bool? bigEndian = null;

if (argQueue.Count > 0)
{
if (argQueue.Peek().Equals("/be", StringComparison.OrdinalIgnoreCase))
{
be = true;
argq.Dequeue();
bigEndian = true;
argQueue.Dequeue();
}
else if (argq.Peek().Equals("/le", StringComparison.OrdinalIgnoreCase))
else if (argQueue.Peek().Equals("/le", StringComparison.OrdinalIgnoreCase))
{
be = false;
argq.Dequeue();
bigEndian = false;
argQueue.Dequeue();
}
}

string mtnFileName;
if (argq.Count > 0)
if (argQueue.Count > 0)
{
mtnFileName = argq.Dequeue();
mtnFileName = argQueue.Dequeue();
Console.WriteLine("File: {0}", mtnFileName);
sa2MTN.Build(be, mtnFileName);
}
else
{
Console.Write("File: ");
mtnFileName = Console.ReadLine().Trim('"');
sa2MTN.Build(be, mtnFileName);
}

SA2MTN.Build(bigEndian, mtnFileName);

/*
if (argq.Count > 0)
{
Expand Down
Loading

0 comments on commit 3181292

Please sign in to comment.