From 1c046578225041682000c92f804ed8fd0db3a34f Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Thu, 6 Mar 2025 16:20:29 -0500 Subject: [PATCH] Add SqPackFileType enum --- src/index.rs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/index.rs b/src/index.rs index bbd2337..29188d1 100755 --- a/src/index.rs +++ b/src/index.rs @@ -11,14 +11,24 @@ use crate::crc::Jamcrc; use binrw::binrw; use binrw::BinRead; +/// The type of this SqPack file. #[binrw] -#[br(magic = b"SqPack\0\0")] +#[brw(repr = u8)] +enum SqPackFileType { + /// Dat files. + Data = 0x1, + // Index/Index2 files. + Index = 0x2, +} + +#[binrw] +#[brw(magic = b"SqPack\0\0")] pub struct SqPackHeader { platform_id: Platform, - #[br(pad_before = 3)] + #[brw(pad_before = 3)] size: u32, version: u32, - file_type: u32, + file_type: SqPackFileType, } #[binrw]