Skip to content

Commit

Permalink
Add physis_gamedata_find_offset function
Browse files Browse the repository at this point in the history
  • Loading branch information
redstrate committed May 25, 2024
1 parent 6669060 commit c66307b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 9 deletions.
18 changes: 9 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions src/gamedata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,20 @@ pub extern "C" fn physis_gamedata_extract_file(
}
}

#[no_mangle]
pub extern "C" fn physis_gamedata_find_offset(
game_data: &mut GameData,
path: *const c_char,
) -> u32 {
unsafe {
if let Some(d) = game_data.find_offset(CStr::from_ptr(path).to_string_lossy().as_ref()) {
d
} else {
0
}
}
}

#[no_mangle]
pub extern "C" fn physis_gamedata_free_sheet_header(_: *mut physis_EXH) {
/*unsafe {
Expand Down

0 comments on commit c66307b

Please sign in to comment.