debug header offsets
This commit is contained in:
parent
e0725cba8a
commit
c7999d08af
@ -321,9 +321,12 @@ pub struct StreamableMap<R:BinReaderExt>{
|
|||||||
impl<R:BinReaderExt> StreamableMap<R>{
|
impl<R:BinReaderExt> StreamableMap<R>{
|
||||||
pub(crate) fn new(mut file:crate::file::File<R>)->Result<Self,Error>{
|
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
|
//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)?;
|
//let mut f=file.block_reader(BlockId::new(0)).map_err(Error::File)?;
|
||||||
//println!("position={}",f.stream_position().unwrap());
|
println!("file header end position={}",f.stream_position().unwrap());
|
||||||
let header:MapHeader=file.as_mut().read_le().map_err(Error::InvalidHeader)?;
|
//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 modes=header.modes.into_iter().map(Into::into).collect();
|
||||||
let attributes=header.attributes.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();
|
let render_configs=header.render_configs.into_iter().map(Into::into).collect();
|
||||||
|
Loading…
Reference in New Issue
Block a user