diff --git a/build-all.bat b/build-all.bat new file mode 100644 index 0000000..7bb085a --- /dev/null +++ b/build-all.bat @@ -0,0 +1,46 @@ +echo on + +:: Move to project folder +pushd . +cd src/gfz-cli + +:: Build all targets +dotnet publish -r linux-x64 +dotnet publish -r osx.10.10-x64 +dotnet publish -r osx.11.0-x64 +dotnet publish -r osx.12-x64 +dotnet publish -r rhel-x64 +dotnet publish -r win-x86 +dotnet publish -r win-x64 + +:: Go back to root folder +popd + +:: Copy the publish folder to the root of the git repo +:: https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/xcopy +:: /s Copies subdirectories. This option automatically excludes empty directories. + +robocopy .\src\gfz-cli\bin\Debug\net6.0\linux-x64\publish\ .\builds\linux-x64\ /s +robocopy .\src\gfz-cli\bin\Debug\net6.0\osx.10.10-x64\publish\ .\builds\osx.10.10-x64\ /s +robocopy .\src\gfz-cli\bin\Debug\net6.0\osx.11.0-x64\publish\ .\builds\osx.11.0-x64\ /s +robocopy .\src\gfz-cli\bin\Debug\net6.0\osx.12-x64\publish\ .\builds\osx.12-x64\ /s +robocopy .\src\gfz-cli\bin\Debug\net6.0\rhel-x64\publish\ .\builds\rhel-x64\ /s +robocopy .\src\gfz-cli\bin\Debug\net6.0\win-x86\publish\ .\builds\win-x86\ /s +robocopy .\src\gfz-cli\bin\Debug\net6.0\win-x64\publish\ .\builds\win-x64\ /s + +:: Compress folders as ZIP +pushd . +cd builds\ + +tar.exe -a -c -f linux-x64.zip linux-x64 +tar.exe -a -c -f osx10.10-x64.zip osx10.10-x64 +tar.exe -a -c -f osx.11.0-x64.zip osx.11.0-x64 +tar.exe -a -c -f osx.12-x64.zip osx.12-x64 +tar.exe -a -c -f rhel-x64.zip rhel-x64 +tar.exe -a -c -f win-x86.zip win-x86 +tar.exe -a -c -f win-x64.zip win-x64 + +popd + +:: For debugging +:: PAUSE \ No newline at end of file diff --git a/docs/cardata-sample.md b/docs/cardata-sample.md index e69de29..e26aba5 100644 --- a/docs/cardata-sample.md +++ b/docs/cardata-sample.md @@ -0,0 +1,6 @@ +Convert cardata.lz + +```shell +gfz-cli.exe --cardata-tsv-to-bin D:\gfzj01\game\cardata.tsv +``` + diff --git a/docs/sample-actions.bat b/docs/sample-actions.bat new file mode 100644 index 0000000..8f07b2b --- /dev/null +++ b/docs/sample-actions.bat @@ -0,0 +1,22 @@ +:: CARDATA +:: Create spreadsheet to edit vehicle parameters +:: ./win-x64 gfz-cli.exe --cardata-bin-to-tsv D:\gfzj01\game\cardata.lz +:: Convert spreadsheet into `cardata.tsv.bin` +:: ./win-x64 gfz-cli.exe --cardata-tsv-to-bin D:\gfzj01\game\cardata.tsv + + +:: DECOMPRESS +:: Decompress specific file +:: ./win-x64 gfz-cli.exe --lzd D:\gfzj01\stage\st01.gma.lz +:: Decompress all lz files in folder +:: ./win-x64 gfz-cli.exe --lzd D:\gfzj01\stage\ +:: Decompress all lz files in folder and subfolders +:: ./win-x64 gfz-cli.exe --lzd D:\gfzj01\ --searchSubdirs + +:: COMPRESS +:: Compress specific file +:: ./win-x64 gfz-cli.exe --lzc D:\gfzj01\stage\st01.gma +:: Compress all gma files in folder +:: ./win-x64 gfz-cli.exe --lzc D:\gfzj01\stage\ --searchPattern *.gma +:: Compress all gma files in folder and subfolders +:: ./win-x64 gfz-cli.exe --lzc D:\gfzj01\ --searchPattern *.gma --searchSubdirs \ No newline at end of file diff --git a/src/gfz-cli/Program.cs b/src/gfz-cli/Program.cs index 02df4af..b20c09b 100644 --- a/src/gfz-cli/Program.cs +++ b/src/gfz-cli/Program.cs @@ -84,14 +84,19 @@ public static void CarDataToBIN(Options options) var carData = new CarData(); carData.Deserialize(reader); + // Update path to decompressed file + string fileName = Path.GetFileNameWithoutExtension(filePath); + string fileDir = Path.GetDirectoryName(filePath); + filePath = Path.Combine(fileDir, fileName); + // Save out - string outputPath = filePath + ".bin"; + string outputPath = filePath + ".lz"; using (var writer = new EndianBinaryWriter(File.Create(outputPath), CarData.endianness)) { carData.Serialize(writer); Console.WriteLine($"Created file: {outputPath}"); } - LzUtility.CompressAvLz(outputPath, GameCube.AmusementVision.GxGame.FZeroGX); + LzUtility.CompressAvLzToDisk(outputPath, GameCube.AmusementVision.GxGame.FZeroGX, true); } }