debug header offsets

This commit is contained in:
Quaternions 2024-07-26 16:57:15 -07:00
parent e0725cba8a
commit c7999d08af

View File

@ -321,9 +321,12 @@ pub struct StreamableMap<R:BinReaderExt>{
impl<R:BinReaderExt> StreamableMap<R>{
pub(crate) fn new(mut file:crate::file::File<R>)->Result<Self,Error>{
//assume the file seek is in the right place to start reading a map header
let mut f=file.as_mut();
//let mut f=file.block_reader(BlockId::new(0)).map_err(Error::File)?;
//println!("position={}",f.stream_position().unwrap());
let header:MapHeader=file.as_mut().read_le().map_err(Error::InvalidHeader)?;
println!("file header end position={}",f.stream_position().unwrap());
//let header:MapHeader=f.read_le().map_err(Error::InvalidHeader)?;
let header=read_map_header(&mut f).map_err(Error::InvalidHeader)?;
println!("map header end position={}",f.stream_position().unwrap());
let modes=header.modes.into_iter().map(Into::into).collect();
let attributes=header.attributes.into_iter().map(Into::into).collect();
let render_configs=header.render_configs.into_iter().map(Into::into).collect();