Added allz-compressor command to compress Aqualead Files with Aqualead LZ compression algorithm (ALLZ).
This commit is contained in:
parent
9f1f9d6264
commit
ca672dfa0f
2 changed files with 42 additions and 2 deletions
|
@ -2,7 +2,7 @@
|
|||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -18,7 +18,16 @@
|
|||
</Reference>
|
||||
<Reference Include="LibDgf.Graphics">
|
||||
<HintPath>..\..\LibDgf\LibDgf.Graphics\bin\Debug\netstandard2.0\LibDgf.Graphics.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="AuroraLib.Compression" Version="1.0.6" />
|
||||
<Reference Include="AuroraLib.Compression">
|
||||
<HintPath>..\..\AuroraLib.Compression\src\AuroraLib.Compression\bin\Debug\net6.0\AuroraLib.Compression.dll </HintPath>
|
||||
</Reference>
|
||||
<PackageReference Include="Pfim" Version="0.11.2" />
|
||||
<PackageReference Include="System.Text.Encoding.CodePages" Version="7.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
|
@ -16,8 +16,10 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.IO.Pipes;
|
||||
using System.Text;
|
||||
using AuroraLib.Compression;
|
||||
using AuroraLib.Compression.Algorithms;
|
||||
|
||||
using Path = System.IO.Path;
|
||||
|
||||
namespace DgfTxmConvert
|
||||
|
@ -77,6 +79,24 @@ namespace DgfTxmConvert
|
|||
DecompressDat(datPathArg.Value, outBaseArg.Value);
|
||||
});
|
||||
});
|
||||
|
||||
app.Command("allz-compressor", config =>
|
||||
{
|
||||
config.FullName = "Compress file with ALLZ";
|
||||
config.Description = "Converts flat file to compressed.";
|
||||
|
||||
var datPathArg = config.Argument("datPath", "Path of the file to compress").IsRequired();
|
||||
datPathArg.Accepts().ExistingFile();
|
||||
var outPathArg = config.Argument("outBase", "Path of the output file");
|
||||
outPathArg.Accepts().LegalFilePath();
|
||||
|
||||
config.HelpOption();
|
||||
|
||||
config.OnExecute(() =>
|
||||
{
|
||||
AllzCompressor(datPathArg.Value, outPathArg.Value);
|
||||
});
|
||||
});
|
||||
|
||||
app.Command("convert-txm", config =>
|
||||
{
|
||||
|
@ -354,6 +374,17 @@ namespace DgfTxmConvert
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
static void AllzCompressor(string datPathArg, string outPathArg = null)
|
||||
{
|
||||
if (outPathArg == null)
|
||||
outPathArg = Path.GetFullPath(datPathArg) + $"/output.dat";
|
||||
|
||||
using Stream sourceStr = File.OpenRead(datPathArg);
|
||||
using var destStr = File.Create(outPathArg);
|
||||
new ALLZ().Compress(sourceStr, destStr);
|
||||
}
|
||||
|
||||
static void ConvertDat(string path, string outBase = null)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue