清理代码2

This commit is contained in:
Chenx221 2024-10-12 00:09:54 +08:00
parent 22e4ce06dd
commit 709d4f2b56
2 changed files with 12 additions and 48 deletions

View File

@ -9,6 +9,8 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="Magick.NET-Q16-AnyCPU" Version="14.0.0" /> <PackageReference Include="Magick.NET-Q16-AnyCPU" Version="14.0.0" />
<PackageReference Include="Microsoft.Data.Sqlite.Core" Version="8.0.10" />
<PackageReference Include="System.Threading.Tasks" Version="4.3.0" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -3,42 +3,8 @@ using System.Runtime.InteropServices;
namespace EscudeLSF namespace EscudeLSF
{ {
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct LSFHDR
{
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
public byte[] signature; // 4 bytes
public uint unknown1; // 4 bytes
public uint unknown2; // 4 bytes
public uint width; // 4 bytes
public uint height; // 4 bytes
public uint unknown_width; // 4 bytes
public uint unknown_height; // 4 bytes
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct LSFENTRY
{
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)]
public char[] name; // 128 bytes
public uint x; // 4 bytes
public uint y; // 4 bytes
public uint baseWidth; // 4 bytes
public uint baseHeight; // 4 bytes
public uint unknown3; // 4 bytes
public uint unknown4; // 4 bytes
public byte type; // 1 byte
public byte id; // 1 byte
public byte unknown5; // 1 byte
public byte unknown6; // 1 byte
public uint unknown7; // 4 bytes
public uint unknown8; // 4 bytes
}
internal class Program internal class Program
{ {
private static readonly byte[] Signature = [0x4C, 0x53, 0x46, 0x00];
static void Main(string[] args) static void Main(string[] args)
{ {
if (args.Length == 0 || args.Length > 2) if (args.Length == 0 || args.Length > 2)
@ -51,27 +17,23 @@ namespace EscudeLSF
switch (args[0]) switch (args[0])
{ {
case "-h": case "-h":
return;
case "-r": case "-r":
case "-d": case "-d":
case "-s": case "-s":
break;
default: default:
break; break;
} }
} }
static void DisplayHelp() //static void DisplayHelp()
{ //{
Console.WriteLine("Usage: EscudeLSF.exe [-r <filepath>] [-d <directory>] [-s <filepath>] [-h]"); // Console.WriteLine("Usage: EscudeLSF.exe [-r <filepath>] [-d <directory>] [-s <filepath>] [-h]");
Console.WriteLine("Options:"); // Console.WriteLine("Options:");
Console.WriteLine(" <filepath> Single lsf process"); // Console.WriteLine(" <filepath> Single lsf process");
Console.WriteLine(" -r <filepath> Read single lsf file"); // Console.WriteLine(" -r <filepath> Read single lsf file");
Console.WriteLine(" -d <directory> Process all lsf files in directory"); // Console.WriteLine(" -d <directory> Process all lsf files in directory");
Console.WriteLine(" -s <filepath> Same as <filepath>"); // Console.WriteLine(" -s <filepath> Same as <filepath>");
Console.WriteLine(" -h Display help info"); // Console.WriteLine(" -h Display help info");
} //}
} }
} }