no external resources

This commit is contained in:
Quaternions 2024-07-26 16:15:36 -07:00
parent 943d78a9fb
commit 5ec99a75dc

View File

@ -233,26 +233,26 @@ fn read_modes<R:BinReaderExt>(len:usize,input:&mut R)->Result<Vec<newtypes::game
fn read_map_header<R:BinReaderExt>(input:&mut R)->Result<MapHeader,binrw::Error>{
let num_spacial_blocks:u32=input.read_le()?;
let num_resource_blocks:u32=input.read_le()?;
let num_resources_external:u32=input.read_le()?;
//let num_resources_external:u32=input.read_le()?;
let num_modes:u32=input.read_le()?;
let num_attributes:u32=input.read_le()?;
let num_render_configs:u32=input.read_le()?;
let spacial_blocks:Vec<SpacialBlockHeader>=read_vec(num_spacial_blocks as usize,input)?;
let resource_blocks:Vec<ResourceBlockHeader>=read_vec(num_resource_blocks as usize,input)?;
let external_resources:Vec<ResourceExternalHeader>=read_vec(num_resources_external as usize,input)?;
//let external_resources:Vec<ResourceExternalHeader>=read_vec(num_resources_external as usize,input)?;
let modes:Vec<newtypes::gameplay_modes::Mode>=read_modes(num_modes as usize,input)?;
let attributes:Vec<newtypes::gameplay_attributes::CollisionAttributes>=read_vec(num_attributes as usize,input)?;
let render_configs:Vec<newtypes::model::RenderConfig>=read_vec(num_render_configs as usize,input)?;
Ok(MapHeader{
num_spacial_blocks,
num_resource_blocks,
num_resources_external,
//num_resources_external,
num_modes,
num_attributes,
num_render_configs,
spacial_blocks,
resource_blocks,
external_resources,
//external_resources,
modes,
attributes,
render_configs,
@ -431,13 +431,13 @@ fn write_modes<W:std::io::Seek+std::io::Write>(modes:&Vec<newtypes::gameplay_mod
fn write_map_header<W:std::io::Seek+std::io::Write>(map_header:&MapHeader,output:&mut W)->Result<(),binrw::Error>{
map_header.num_spacial_blocks.write_le(output)?;
map_header.num_resource_blocks.write_le(output)?;
map_header.num_resources_external.write_le(output)?;
//map_header.num_resources_external.write_le(output)?;
map_header.num_modes.write_le(output)?;
map_header.num_attributes.write_le(output)?;
map_header.num_render_configs.write_le(output)?;
map_header.spacial_blocks.write_le(output)?;
map_header.resource_blocks.write_le(output)?;
map_header.external_resources.write_le(output)?;
//map_header.external_resources.write_le(output)?;
write_modes(&map_header.modes,output)?;
map_header.attributes.write_le(output)?;
map_header.render_configs.write_le(output)?;
@ -583,7 +583,7 @@ pub fn write_map<W:BinWriterExt>(mut writer:W,map:strafesnet_common::map::Comple
println!("map header len={}",map_header_data.len());
println!("num_spacial_blocks={}",map_header.num_spacial_blocks);
println!("num_resource_blocks={}",map_header.num_resource_blocks);
println!("num_resources_external={}",map_header.num_resources_external);
//println!("num_resources_external={}",map_header.num_resources_external);
println!("num_modes={}",map_header.num_modes);
println!("num_attributes={}",map_header.num_attributes);
println!("num_render_configs={}",map_header.num_render_configs);