From fdc5cccc6d9624a73b73efbba64732ece9742446 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Tue, 30 Jan 2024 18:48:51 -0800 Subject: [PATCH] prototype snf code --- Cargo.lock | 9 +++++++++ Cargo.toml | 3 +++ src/main.rs | 11 ++++++++++- 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 0e28c53..9577830 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -790,6 +790,7 @@ dependencies = [ "rbx_dom_weak", "rbx_reflection_database", "rbx_xml", + "strafesnet_snf", "vbsp", "vmdl", "vmt-parser", @@ -1334,6 +1335,14 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" +[[package]] +name = "strafesnet_snf" +version = "0.1.0" +source = "git+https://git.itzana.me/StrafesNET/snf?rev=dea408daeef576cff8ffa61356c89a9d03d95f6b#dea408daeef576cff8ffa61356c89a9d03d95f6b" +dependencies = [ + "binrw", +] + [[package]] name = "strsim" version = "0.10.0" diff --git a/Cargo.toml b/Cargo.toml index fb0dd6e..6066858 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,6 +16,9 @@ rbx_binary = "0.7.1" rbx_dom_weak = "2.5.0" rbx_reflection_database = "0.2.7" rbx_xml = "0.13.1" +strafesnet_bsp_loader = { git = "https://git.itzana.me/StrafesNET/bsp_loader", rev = "79b8120106e63de237b8ed59c3d3e30db51e7146" } +strafesnet_rbx_loader = { git = "https://git.itzana.me/StrafesNET/rbx_loader", rev = "0d2c27f60f4a448063edc57d9a23766775fb2cc5" } +strafesnet_snf = { git = "https://git.itzana.me/StrafesNET/snf", rev = "dea408daeef576cff8ffa61356c89a9d03d95f6b" } vbsp = "0.5.0" vmdl = "0.1.1" vmt-parser = "0.1.1" diff --git a/src/main.rs b/src/main.rs index 4a834f4..2e5f53f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -13,6 +13,7 @@ struct Cli { #[derive(Subcommand)] enum Commands { + ConvertToSNF(PathBufList), DownloadTextures(DownloadTexturesSubcommand), ExtractTextures(ExtractTexturesSubcommand), ConvertTextures(ConvertTexturesSubcommand), @@ -59,6 +60,7 @@ struct WriteAttributesSubcommand { fn main() -> AResult<()> { let cli = Cli::parse(); match cli.command { + Commands::ConvertToSNF(pathlist)=>convert_to_snf(pathlist.paths), Commands::DownloadTextures(subcommand)=>download_textures(subcommand.roblox_files), Commands::ExtractTextures(subcommand)=>extract_textures(vec![subcommand.bsp_file],subcommand.vpk_dir_files), Commands::VPKContents(subcommand)=>vpk_contents(subcommand.input_file), @@ -630,4 +632,11 @@ fn bsp_contents(path:PathBuf)->AResult<()>{ println!("file_name={:?}",file_name); } Ok(()) -} \ No newline at end of file +} + +fn convert_to_snf(pathlist:Vec)->AResult<()>{ + for path in pathlist{ + let something=strafesnet_rbx_loader::read_file(path); + } + Ok(()) +}