Обновление структуры проекта

This commit is contained in:
Valentin Popov 2025-02-08 01:11:02 +00:00
parent 94d2f8a512
commit 8d8653133b
Signed by: Valentin Popov
GPG Key ID: AE3CE523DAAA8401
19 changed files with 27 additions and 79 deletions

9
Cargo.lock generated
View File

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

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"

View File

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

View File

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