use crate::{RelPtr64, SsbhArray, SsbhString8};
use crate::{SsbhString, Version};
use binrw::BinRead;
#[cfg(feature = "serde")]
use serde::{Deserialize, Serialize};
use ssbh_write::SsbhWrite;
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[derive(Debug, BinRead, SsbhWrite, Clone, PartialEq)]
#[br(import(major_version: u16, minor_version: u16))]
pub enum Modl {
#[br(pre_assert(major_version == 1 && minor_version == 7))]
V17 {
model_name: SsbhString, skeleton_file_name: SsbhString,
material_file_names: SsbhArray<SsbhString>,
animation_file_name: RelPtr64<SsbhString>,
mesh_file_name: SsbhString8,
entries: SsbhArray<ModlEntry>,
},
}
impl Version for Modl {
fn major_minor_version(&self) -> (u16, u16) {
match self {
Modl::V17 { .. } => (1, 7),
}
}
}
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[derive(Debug, BinRead, SsbhWrite, Clone, PartialEq, Eq)]
pub struct ModlEntry {
pub mesh_object_name: SsbhString,
pub mesh_object_subindex: u64,
pub material_label: SsbhString,
}