physis/tmb.rs
1// SPDX-FileCopyrightText: 2024 Joshua Goins <josh@redstrate.com>
2// SPDX-License-Identifier: GPL-3.0-or-later
3
4use std::io::Cursor;
5
6use crate::ByteSpan;
7use binrw::BinRead;
8use binrw::binrw;
9
10#[binrw]
11#[derive(Debug)]
12#[brw(little)]
13struct TmbHeader {
14 magic: i32, // TODO: figure out what this
15 size: i32,
16 entry_count: i32,
17}
18
19#[derive(Debug)]
20pub struct Tmb {}
21
22impl Tmb {
23 /// Reads an existing ULD file
24 pub fn from_existing(buffer: ByteSpan) -> Option<Self> {
25 let mut cursor = Cursor::new(buffer);
26 TmbHeader::read(&mut cursor).ok()?;
27
28 Some(Tmb {})
29 }
30}