Use Rc<RefCell<T>>> for content_records so that they sync in a Title

When using a Title, the content_records value stored in the TMD and ContentRegion instances will now point to the same data, meaning that they stay in sync. Previously, you had to manually sync the content records between them as they were modified, and not doing so would cause problems when editing a WAD.
This commit is contained in:
2025-04-27 21:30:31 -04:00
parent 277c5d6439
commit 481594345d
8 changed files with 80 additions and 89 deletions

View File

@@ -11,8 +11,8 @@ fn main() {
let wad = wad::WAD::from_bytes(&data).unwrap();
println!("size of tmd: {:?}", wad.tmd().len());
println!("num content records: {:?}", title.tmd.content_records.len());
println!("first record data: {:?}", title.tmd.content_records.first().unwrap());
println!("num content records: {:?}", title.tmd.content_records.borrow().len());
println!("first record data: {:?}", title.tmd.content_records.borrow().first().unwrap());
println!("TMD is fakesigned: {:?}",title.tmd.is_fakesigned());
println!("title version from ticket is: {:?}", title.ticket.title_version);