mirror of
https://github.com/Theaninova/mhlib.git
synced 2025-12-12 20:46:20 +00:00
Cleanup
This commit is contained in:
@@ -3,21 +3,24 @@ use crate::iff::SubChunk;
|
|||||||
use crate::lwo2::sub_tags::surface_block_image_texture::SurfaceBlockImageTextureSubChunk;
|
use crate::lwo2::sub_tags::surface_block_image_texture::SurfaceBlockImageTextureSubChunk;
|
||||||
use crate::lwo2::sub_tags::EnableState;
|
use crate::lwo2::sub_tags::EnableState;
|
||||||
use crate::lwo2::vx;
|
use crate::lwo2::vx;
|
||||||
use binrw::{binread, PosValue};
|
use binrw::binread;
|
||||||
|
|
||||||
#[binread]
|
#[binread]
|
||||||
#[br(import(length: u32))]
|
#[br(import(length: u32))]
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct SurfaceBlocks {
|
pub enum SurfaceBlocks {
|
||||||
#[br(temp)]
|
#[br(magic(b"IMAP"))]
|
||||||
start_pos: PosValue<()>,
|
ImageMapTexture {
|
||||||
pub ordinal: OrdinalString,
|
header: SubChunk<SurfaceBlockHeader>,
|
||||||
pub header: SubChunk<SurfaceBlockHeader>,
|
#[br(parse_with = until_size_limit(length as u64 - (header.length as u64 + 2 + 4)))]
|
||||||
#[br(temp)]
|
attributes: Vec<SurfaceBlockImageTextureSubChunk>,
|
||||||
end_pos: PosValue<()>,
|
},
|
||||||
#[br(if(matches!(ordinal, OrdinalString::ImageMapTexture)))]
|
#[br(magic(b"PROC"))]
|
||||||
#[br(parse_with = until_size_limit(length as u64 - (end_pos.pos - start_pos.pos)))]
|
ProceduralTexture,
|
||||||
pub attributes: Vec<SurfaceBlockImageTextureSubChunk>,
|
#[br(magic(b"GRAD"))]
|
||||||
|
GradientTexture,
|
||||||
|
#[br(magic(b"SHDR"))]
|
||||||
|
ShaderPlugin,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[binread]
|
#[binread]
|
||||||
@@ -44,20 +47,6 @@ pub enum SurfaceBlockHeaderSubChunk {
|
|||||||
Negative(SubChunk<EnableState>),
|
Negative(SubChunk<EnableState>),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[binread]
|
|
||||||
#[br(import(_length: u32))]
|
|
||||||
#[derive(Debug)]
|
|
||||||
pub enum OrdinalString {
|
|
||||||
#[br(magic(b"IMAP"))]
|
|
||||||
ImageMapTexture,
|
|
||||||
#[br(magic(b"PROC"))]
|
|
||||||
ProceduralTexture,
|
|
||||||
#[br(magic(b"GRAD"))]
|
|
||||||
GradientTexture,
|
|
||||||
#[br(magic(b"SHDR"))]
|
|
||||||
ShaderPlugin,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[binread]
|
#[binread]
|
||||||
#[br(import(_length: u32))]
|
#[br(import(_length: u32))]
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
|
|||||||
Reference in New Issue
Block a user