1
Fork 0
mirror of https://github.com/redstrate/Physis.git synced 2025-04-24 13:37:44 +00:00

Fix oversight with u32 offsets used in index files API

This breaks on Dawntrail's gigantic files, but this also breaks API...
This commit is contained in:
Joshua Goins 2024-06-28 05:53:42 -04:00
parent acb5c6a7a3
commit c41c160338
2 changed files with 6 additions and 6 deletions

View file

@ -194,7 +194,7 @@ impl GameData {
}
/// Finds the offset inside of the DAT file for `path`.
pub fn find_offset(&mut self, path: &str) -> Option<u32> {
pub fn find_offset(&mut self, path: &str) -> Option<u64> {
let slice = self.find_entry(path);
match slice {
Some((entry, chunk)) => {

View file

@ -62,9 +62,9 @@ pub struct IndexHashTableEntry {
#[bw(ignore)]
pub data_file_id: u8,
#[br(calc = (data & !0xF) * 0x08)]
#[br(calc = (data & !0xF) as u64 * 0x08)]
#[bw(ignore)]
pub offset: u32,
pub offset: u64,
}
// The only difference between index and index2 is how the path hash is stored.
@ -87,16 +87,16 @@ pub struct Index2HashTableEntry {
#[bw(ignore)]
pub data_file_id: u8,
#[br(calc = (data & !0xF) * 0x08)]
#[br(calc = (data & !0xF) as u64 * 0x08)]
#[bw(ignore)]
pub offset: u32,
pub offset: u64,
}
#[derive(Debug)]
pub struct IndexEntry {
pub hash: u64,
pub data_file_id: u8,
pub offset: u32,
pub offset: u64,
}
#[binrw]