resource query instead of hold all

This commit is contained in:
Quaternions 2024-02-01 04:03:09 -08:00
parent 708c0c48ef
commit 3e737282dc

View File

@ -60,15 +60,6 @@ for model_id in 0..num_models{
//error hiding mock code //error hiding mock code
mod physics{
pub struct StyleModifiers{}
}
mod model{
pub struct IndexedModel{}
#[super::binrw]
#[brw(little)]
pub struct ModelInstance{}
}
mod image{ mod image{
pub struct Image{} pub struct Image{}
} }
@ -96,9 +87,6 @@ pub struct StreamableMap<R:BinReaderExt>{
modes:gameplay_modes::Modes, modes:gameplay_modes::Modes,
bvh:BvhNode, bvh:BvhNode,
node_id_to_block_id:Vec<crate::file::BlockId>, node_id_to_block_id:Vec<crate::file::BlockId>,
//do not need this? return only new data with load_node
resource_model:std::collections::HashMap<ModelUuid,model::IndexedModel>,
resource_image:std::collections::HashMap<ImageUuid,image::Image>,
} }
impl<R:BinReaderExt> StreamableMap<R>{ impl<R:BinReaderExt> StreamableMap<R>{
pub(crate) fn new(file:crate::file::File<R>)->Result<Self,Error>{ pub(crate) fn new(file:crate::file::File<R>)->Result<Self,Error>{
@ -114,4 +102,7 @@ impl<R:BinReaderExt> StreamableMap<R>{
let region:Region=block.read_le().map_err(|e|Error::InvalidRegion(e))?; let region:Region=block.read_le().map_err(|e|Error::InvalidRegion(e))?;
Ok(region.models) Ok(region.models)
} }
pub fn load_resource(&mut self,resource_id:ResourceId)->Resource{
//
}
} }