From 171d516f38173f5f6d099ec9d7ca1076318f8784 Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Mon, 29 Apr 2024 20:59:30 -0400 Subject: [PATCH] Add AVFX module --- src/avfx.rs | 31 +++++++++++++++++++++++++++++++ src/lib.rs | 3 +++ 2 files changed, 34 insertions(+) create mode 100644 src/avfx.rs 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;