1
Fork 0
mirror of https://github.com/redstrate/Physis.git synced 2025-04-25 13:57:45 +00:00
physis/src/tmb.rs

31 lines
603 B
Rust
Raw Normal View History

2024-04-29 20:26:13 -04:00
// SPDX-FileCopyrightText: 2024 Joshua Goins <josh@redstrate.com>
// SPDX-License-Identifier: GPL-3.0-or-later
use std::io::Cursor;
use crate::ByteSpan;
use binrw::BinRead;
use binrw::binrw;
2024-04-29 20:26:13 -04:00
#[binrw]
#[derive(Debug)]
#[brw(little)]
struct TmbHeader {
magic: i32, // TODO: figure out what this
size: i32,
entry_count: i32,
2024-04-29 20:26:13 -04:00
}
#[derive(Debug)]
pub struct Tmb {}
2024-04-29 20:26:13 -04:00
impl Tmb {
/// Reads an existing ULD file
pub fn from_existing(buffer: ByteSpan) -> Option<Self> {
let mut cursor = Cursor::new(buffer);
TmbHeader::read(&mut cursor).ok()?;
2024-04-29 20:26:13 -04:00
Some(Tmb {})
2024-04-29 20:26:13 -04:00
}
}