1
Fork 0
mirror of https://github.com/redstrate/Physis.git synced 2025-04-26 22:27:44 +00:00

Begin write support for EXH

This commit is contained in:
Joshua Goins 2023-08-02 16:27:28 -04:00
parent 30d5cd5996
commit 1fd7cdf07d

View file

@ -1,17 +1,17 @@
use crate::common::Language; use crate::common::Language;
use crate::gamedata::MemoryBuffer; use crate::gamedata::MemoryBuffer;
use binrw::binread; use binrw::binrw;
use binrw::BinRead; use binrw::BinRead;
use std::io::Cursor; use std::io::Cursor;
#[binread] #[binrw]
#[br(magic = b"EXHF")] #[brw(magic = b"EXHF")]
#[br(big)] #[brw(big)]
#[allow(dead_code)] #[allow(dead_code)]
pub struct EXHHeader { pub struct EXHHeader {
version: u16, version: u16,
pub(crate) data_offset: u16, pub data_offset: u16,
column_count: u16, column_count: u16,
page_count: u16, page_count: u16,
language_count: u16, language_count: u16,
@ -21,8 +21,8 @@ pub struct EXHHeader {
pub row_count: u32, pub row_count: u32,
} }
#[binread] #[binrw]
#[br(repr(u16))] #[brw(repr(u16))]
pub enum ColumnDataType { pub enum ColumnDataType {
String = 0x0, String = 0x0,
Bool = 0x1, Bool = 0x1,
@ -46,23 +46,23 @@ pub enum ColumnDataType {
PackedBool7 = 0x20, PackedBool7 = 0x20,
} }
#[binread] #[binrw]
#[br(big)] #[brw(big)]
pub struct ExcelColumnDefinition { pub struct ExcelColumnDefinition {
pub data_type: ColumnDataType, pub data_type: ColumnDataType,
pub offset: u16, pub offset: u16,
} }
#[binread] #[binrw]
#[br(big)] #[brw(big)]
#[allow(dead_code)] #[allow(dead_code)]
pub struct ExcelDataPagination { pub struct ExcelDataPagination {
pub start_id: u32, pub start_id: u32,
pub row_count: u32, pub row_count: u32,
} }
#[binread] #[binrw]
#[br(big)] #[brw(big)]
#[allow(dead_code)] #[allow(dead_code)]
pub struct EXH { pub struct EXH {
pub header: EXHHeader, pub header: EXHHeader,