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

Add support for reading the color dye table from a material

This commit is contained in:
Joshua Goins 2024-04-30 19:48:32 -04:00
parent b595d48963
commit 139afb46fa

View file

@ -66,12 +66,38 @@ struct ColorTable {
data: Vec<ColorTableRow>,
}
#[binrw]
#[binread]
#[derive(Debug)]
#[allow(dead_code)]
struct ColorDyeTableRow {
#[br(temp)]
data: u16,
#[br(calc = data >> 5)]
template: u16,
#[br(calc = (data & 0x01) != 0)]
diffuse: bool,
#[br(calc = (data & 0x02) != 0)]
specular: bool,
#[br(calc = (data & 0x04) != 0)]
emissive: bool,
#[br(calc = (data & 0x08) != 0)]
gloss: bool,
#[br(calc = (data & 0x10) != 0)]
specular_strength: bool,
}
#[binread]
#[derive(Debug)]
#[allow(dead_code)]
struct ColorDyeTable {
#[br(count = 16)]
data: Vec<u16>,
data: Vec<ColorDyeTableRow>,
}
#[binrw]