add some ESH types to enum
This commit is contained in:
parent
71de729437
commit
344ec241e7
1 changed files with 33 additions and 4 deletions
|
|
@ -7,9 +7,38 @@ use anyhow::Result;
|
||||||
use indexmap::IndexMap;
|
use indexmap::IndexMap;
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct ESHValue {
|
pub struct ESHEntityFlags {
|
||||||
pub data_type: u32,
|
pub entity_id: u16,
|
||||||
pub data: Vec<u8>
|
pub flags: u16
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug)]
|
||||||
|
pub struct ESHFrame {
|
||||||
|
pub unk1: Vec<u8>,
|
||||||
|
pub a: f32,
|
||||||
|
pub b: f32,
|
||||||
|
pub c: f32
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug)]
|
||||||
|
pub struct ESHRect {
|
||||||
|
pub top: i32,
|
||||||
|
pub left: i32,
|
||||||
|
pub right: i32,
|
||||||
|
pub bottom: i32
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug)]
|
||||||
|
pub enum ESHValue {
|
||||||
|
Bool(bool),
|
||||||
|
Float(f32),
|
||||||
|
Int(i32),
|
||||||
|
String(FString),
|
||||||
|
Sprite(FString),
|
||||||
|
Binary(Vec<u8>),
|
||||||
|
EntityFlags(ESHEntityFlags),
|
||||||
|
Frame(ESHFrame),
|
||||||
|
Rect(ESHRect)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
|
|
@ -31,7 +60,7 @@ impl Decoder for ESH {
|
||||||
let data_type = rd.read_u32()?;
|
let data_type = rd.read_u32()?;
|
||||||
let data_size = rd.read_u32()? as usize;
|
let data_size = rd.read_u32()? as usize;
|
||||||
let data = rd.read_bytes(data_size)?;
|
let data = rd.read_bytes(data_size)?;
|
||||||
props.insert(name, ESHValue { data_type, data });
|
//props.insert(name, ESHValue { data_type, data });
|
||||||
}
|
}
|
||||||
|
|
||||||
let enc_size = rd.offset() - offset;
|
let enc_size = rd.offset() - offset;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue