diff --git a/src/avfx.rs b/src/avfx.rs new file mode 100644 index 0000000..21961d4 --- /dev/null +++ b/src/avfx.rs @@ -0,0 +1,31 @@ +// SPDX-FileCopyrightText: 2024 Joshua Goins +// SPDX-License-Identifier: GPL-3.0-or-later + +use std::io::Cursor; + +use crate::ByteSpan; +use binrw::binrw; +use binrw::BinRead; + +#[binrw] +#[derive(Debug)] +#[brw(little)] +struct AvfxHeader { + name: u32, + size: u32 +} + +#[derive(Debug)] +pub struct Avfx { + +} + +impl Avfx { + /// Reads an existing ULD file + pub fn from_existing(buffer: ByteSpan) -> Option { + let mut cursor = Cursor::new(buffer); + let header = AvfxHeader::read(&mut cursor).ok()?; + + Some(Avfx{}) + } +} diff --git a/src/lib.rs b/src/lib.rs index 2b5cc9f..d8200d8 100755 --- a/src/lib.rs +++ b/src/lib.rs @@ -156,3 +156,6 @@ pub mod phyb; /// Reading PAP files pub mod pap; + +/// Reading AVFX files +pub mod avfx;