diff --git a/Cargo.lock b/Cargo.lock index d41f17b..24a0bfc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -843,15 +843,6 @@ version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fb37767f6569cd834a413442455e0f066d0d522de8630436e2a1761d9726ba56" -[[package]] -name = "packer" -version = "0.1.0" -dependencies = [ - "byteorder", - "serde", - "serde_json", -] - [[package]] name = "paste" version = "1.0.15" diff --git a/Cargo.toml b/Cargo.toml index dce8213..d7bb610 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,12 +1,6 @@ [workspace] resolver = "2" -members = [ - "libnres", - "nres-cli", - "packer", - "texture-decoder", - "unpacker", -] +members = ["libs/*", "tools/*"] [profile.release] codegen-units = 1 diff --git a/libnres/Cargo.toml b/libnres/Cargo.toml deleted file mode 100644 index 99539e7..0000000 --- a/libnres/Cargo.toml +++ /dev/null @@ -1,16 +0,0 @@ -[package] -name = "libnres" -version = "0.1.4" -description = "Library for NRes files" -authors = ["Valentin Popov "] -homepage = "https://git.popov.link/valentineus/fparkan" -repository = "https://git.popov.link/valentineus/fparkan.git" -license = "GPL-2.0" -edition = "2021" -keywords = ["gamedev", "library", "nres"] - -[dependencies] -byteorder = "1.4" -log = "0.4" -miette = "7.0" -thiserror = "2.0" diff --git a/libnres/README.md b/libnres/README.md deleted file mode 100644 index 065bd40..0000000 --- a/libnres/README.md +++ /dev/null @@ -1,25 +0,0 @@ -# Library for NRes files (Deprecated) - -Library for viewing and retrieving game resources of the game **"Parkan: Iron Strategy"**. -All versions of the game are supported: Demo, IS, IS: Part 1, IS: Part 2. -Supports files with `lib`, `trf`, `rlb` extensions. - -The files `gamefont.rlb` and `sprites.lib` are not supported. -This files have an unknown signature. - -## Example - -Example of extracting game resources: - -```rust -fn main() { - let file = std::fs::File::open("./voices.lib").unwrap(); - // Extracting the list of files - let list = libnres::reader::get_list(&file).unwrap(); - - for element in list { - // Extracting the contents of the file - let data = libnres::reader::get_file(&file, &element).unwrap(); - } -} -``` diff --git a/libs/nres/Cargo.toml b/libs/nres/Cargo.toml new file mode 100644 index 0000000..804f5c0 --- /dev/null +++ b/libs/nres/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "libnres" +version = "0.1.4" +edition = "2021" + +[dependencies] +byteorder = "1.4" +log = "0.4" +miette = "7.0" +thiserror = "2.0" diff --git a/libnres/src/converter.rs b/libs/nres/src/converter.rs similarity index 100% rename from libnres/src/converter.rs rename to libs/nres/src/converter.rs diff --git a/libnres/src/error.rs b/libs/nres/src/error.rs similarity index 100% rename from libnres/src/error.rs rename to libs/nres/src/error.rs diff --git a/libnres/src/lib.rs b/libs/nres/src/lib.rs similarity index 100% rename from libnres/src/lib.rs rename to libs/nres/src/lib.rs diff --git a/libnres/src/reader.rs b/libs/nres/src/reader.rs similarity index 100% rename from libnres/src/reader.rs rename to libs/nres/src/reader.rs diff --git a/nres-cli/Cargo.toml b/nres-cli/Cargo.toml deleted file mode 100644 index a6d863c..0000000 --- a/nres-cli/Cargo.toml +++ /dev/null @@ -1,20 +0,0 @@ -[package] -name = "nres-cli" -version = "0.2.3" -description = "Console tool for NRes files" -authors = ["Valentin Popov "] -homepage = "https://git.popov.link/valentineus/fparkan" -repository = "https://git.popov.link/valentineus/fparkan.git" -license = "GPL-2.0" -edition = "2021" -keywords = ["cli", "gamedev", "nres"] - -[dependencies] -byteorder = "1.4" -clap = { version = "4.2", features = ["derive"] } -console = "0.15" -dialoguer = { version = "0.11", features = ["completion"] } -indicatif = "0.17" -libnres = { version = "0.1", path = "../libnres" } -miette = { version = "7.0", features = ["fancy"] } -tempdir = "0.3" diff --git a/tools/nres-cli/Cargo.toml b/tools/nres-cli/Cargo.toml new file mode 100644 index 0000000..dd0ced6 --- /dev/null +++ b/tools/nres-cli/Cargo.toml @@ -0,0 +1,14 @@ +[package] +name = "nres-cli" +version = "0.2.3" +edition = "2021" + +[dependencies] +byteorder = "1.4" +clap = { version = "4.2", features = ["derive"] } +console = "0.15" +dialoguer = { version = "0.11", features = ["completion"] } +indicatif = "0.17" +libnres = { version = "0.1", path = "../../libs/nres" } +miette = { version = "7.0", features = ["fancy"] } +tempdir = "0.3" diff --git a/nres-cli/README.md b/tools/nres-cli/README.md similarity index 70% rename from nres-cli/README.md rename to tools/nres-cli/README.md index 65a6602..fee1420 100644 --- a/nres-cli/README.md +++ b/tools/nres-cli/README.md @@ -3,4 +3,4 @@ ## Commands - `extract` - Extract game resources from a "NRes" file. -- `ls` - Get a list of files in a "NRes" file. +- `ls` - Get a list of files in a "NRes" file. \ No newline at end of file diff --git a/nres-cli/src/main.rs b/tools/nres-cli/src/main.rs similarity index 100% rename from nres-cli/src/main.rs rename to tools/nres-cli/src/main.rs diff --git a/texture-decoder/Cargo.toml b/tools/texture-decoder/Cargo.toml similarity index 100% rename from texture-decoder/Cargo.toml rename to tools/texture-decoder/Cargo.toml diff --git a/texture-decoder/README.md b/tools/texture-decoder/README.md similarity index 100% rename from texture-decoder/README.md rename to tools/texture-decoder/README.md diff --git a/texture-decoder/src/main.rs b/tools/texture-decoder/src/main.rs similarity index 100% rename from texture-decoder/src/main.rs rename to tools/texture-decoder/src/main.rs diff --git a/unpacker/Cargo.toml b/tools/unpacker/Cargo.toml similarity index 100% rename from unpacker/Cargo.toml rename to tools/unpacker/Cargo.toml diff --git a/unpacker/README.md b/tools/unpacker/README.md similarity index 98% rename from unpacker/README.md rename to tools/unpacker/README.md index 2c6be02..311e0eb 100644 --- a/unpacker/README.md +++ b/tools/unpacker/README.md @@ -38,4 +38,4 @@ It is essential to preserve the file index for the game to function correctly, a Files can be replaced and packed back using the [packer](../packer). The newly obtained game resource files are correctly processed by the game engine. -For example, sounds and 3D models of warbots' weapons were successfully replaced. +For example, sounds and 3D models of warbots' weapons were successfully replaced. \ No newline at end of file diff --git a/unpacker/src/main.rs b/tools/unpacker/src/main.rs similarity index 100% rename from unpacker/src/main.rs rename to tools/unpacker/src/main.rs