BOTW resource size table (RSTB) library in Rust
A quick and easy library for manipulating the resource size table (RSTB) from The Legend of Zelda: Breath of the Wild in Rust. Can edit an RSTB directly or convert to and from a JSON representation.
Basic usage to manipulate an RSTB file:
use read;
use ;
let buff: = read.unwrap;
// Read RSTB from data, automatically decompressing if yaz0 compressed
let mut table: ResourceSizeTable = from_binary.unwrap;
// Set the size for a resource
table.set_size;
// Check the size
assert_eq!;
// Dump to JSON
let json_table = table.to_text.unwrap;
// From JSON back to RSTB
let new_table = from_text.unwrap;
// Write new binary copy, and we'll yaz0 compress it
let out_buf: = table.to_binary.unwrap;
Also provides functions for calculating resource sizes:
use read;
use *;
// Calculate RSTB value for file on disk
assert_eq!;
// Or we can calculate from a buffer if we provide the file extension
let buf: = read.unwrap;
assert_eq!;