3 Commits

19 changed files with 39 additions and 91 deletions

33
Cargo.lock generated
View File

@ -238,9 +238,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "clap"
version = "4.5.31"
version = "4.5.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "027bb0d98429ae334a8698531da7077bdf906419543a35a55c2cb1b66437d767"
checksum = "92b7b18d71fad5313a1e320fa9897994228ce274b60faa4d694fe0ea89cd9e6d"
dependencies = [
"clap_builder",
"clap_derive",
@ -248,9 +248,9 @@ dependencies = [
[[package]]
name = "clap_builder"
version = "4.5.31"
version = "4.5.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5589e0cba072e0f3d23791efac0fd8627b49c829c196a492e88168e6a669d863"
checksum = "a35db2071778a7344791a4fb4f95308b5673d219dee3ae348b86642574ecc90c"
dependencies = [
"anstream",
"anstyle",
@ -290,9 +290,9 @@ checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990"
[[package]]
name = "console"
version = "0.15.11"
version = "0.15.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "054ccb5b10f9f2cbf51eb355ca1d05c2d279ce1804688d0db74b4733a5aeafd8"
checksum = "ea3c6ecd8059b57859df5c69830340ed3c41d30e3da0c1cbed90a96ac853041b"
dependencies = [
"encode_unicode",
"libc",
@ -643,7 +643,7 @@ dependencies = [
"byteorder",
"log",
"miette",
"thiserror 2.0.12",
"thiserror 2.0.11",
]
[[package]]
@ -843,15 +843,6 @@ version = "4.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1036865bb9422d3300cf723f657c2851d0e9ab12567854b1f4eba3d77decf564"
[[package]]
name = "packer"
version = "0.1.0"
dependencies = [
"byteorder",
"serde",
"serde_json",
]
[[package]]
name = "paste"
version = "1.0.15"
@ -1321,11 +1312,11 @@ dependencies = [
[[package]]
name = "thiserror"
version = "2.0.12"
version = "2.0.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708"
checksum = "d452f284b73e6d76dd36758a0c8684b1d5be31f92b89d07fd5822175732206fc"
dependencies = [
"thiserror-impl 2.0.12",
"thiserror-impl 2.0.11",
]
[[package]]
@ -1341,9 +1332,9 @@ dependencies = [
[[package]]
name = "thiserror-impl"
version = "2.0.12"
version = "2.0.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d"
checksum = "26afc1baea8a989337eeb52b6e72a039780ce45c3edfcc9c5b9d112feeb173c2"
dependencies = [
"proc-macro2",
"quote",

View File

@ -1,12 +1,6 @@
[workspace]
resolver = "2"
members = [
"libnres",
"nres-cli",
"packer",
"texture-decoder",
"unpacker",
]
members = ["libs/*", "tools/*"]
[profile.release]
codegen-units = 1

View File

@ -1,16 +0,0 @@
[package]
name = "libnres"
version = "0.1.4"
description = "Library for NRes files"
authors = ["Valentin Popov <valentin@popov.link>"]
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"

View File

@ -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();
}
}
```

10
libs/nres/Cargo.toml Normal file
View File

@ -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"

View File

@ -1,20 +0,0 @@
[package]
name = "nres-cli"
version = "0.2.3"
description = "Console tool for NRes files"
authors = ["Valentin Popov <valentin@popov.link>"]
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"

14
tools/nres-cli/Cargo.toml Normal file
View File

@ -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"