A rust implementation of a PKNX4 format reader.
- Tree-like iteration on nodes
- String Nodes
- Long and Double
- Vectors node
- Audio Nodes (Without data, just the info)
- Bitmap nodes (Without data, just the info)
For the meantime, i have no intention of implementing the Audio and Bitmap nodes, since there's no use for them when developing a server. Maybe ill add them.... who knows.
To use on your project, you must include it as such, inside your Cargo.toml
[dependencies]
rust_nx = { git = "https://github.com/not-ebx/rust-nx", tag = "v0.1.4" }
The tag can change and I may forget to update the readme with the latest version. You can always check the latest tag by clicking on the releases.
Using this is pretty simple. There's an example on src/lib.rs. But essentially it's:
// First, open your desired NXFile
let map_nx = NXFile::new("./nx_files/Map.nx").unwrap();
// Then open a node inside of it
let map0 = map_nx.resolve("Map/Map0").unwrap();
Once you resolve to a node, you can iterate like so:
for nodes in map_nx.get_node_children(map0).iter() {
//.. Do whatever you want xd
}
Or you can get a single child by doing
map_nx.get_node_child(map0, "child_name");
This returns an Option<&NXNode>
- Fix and clean borrows, what a pain
- Make a Better Test
- Make a benchmark test
- Optimize and clean code
- Audio Nodes (With data)
- Bitmap nodes (With Data)
- PKNX4 Format specification, found at https://nxformat.github.io/
- aatxe's pkgnx's implementation, helped me understand some stuff i didnt quite get from the format definition. Found https://github.com/aatxe/pkgnx