it works
This commit is contained in:
@ -42,11 +42,15 @@ pub fn read<R:Read+std::io::Seek>(input:R)->Result<Format,ReadError>{
|
||||
#[cfg(feature="source")]
|
||||
b"VBSP"=>Ok(Format::Source(strafesnet_bsp_loader::read(buf).map_err(ReadError::Source)?)),
|
||||
#[cfg(feature="snf")]
|
||||
b"SNFM"=>Ok(match strafesnet_snf::read_snf(buf).map_err(ReadError::StrafesNET)?{
|
||||
strafesnet_snf::SNF::Map(streamable_map)=>Format::SNFM(streamable_map.into_complete_map().map_err(ReadError::StrafesNETMap)?),
|
||||
strafesnet_snf::SNF::Bot(mut streamable_bot)=>Format::SNFB(streamable_bot.read_all().map_err(ReadError::StrafesNETBot)?),
|
||||
strafesnet_snf::SNF::Demo(_streamable_demo)=>Err(ReadError::UnknownFileFormat)?,
|
||||
}),
|
||||
b"SNFM"=>Ok(Format::SNFM(
|
||||
strafesnet_snf::read_map(buf).map_err(ReadError::StrafesNET)?
|
||||
.into_complete_map().map_err(ReadError::StrafesNETMap)?
|
||||
)),
|
||||
#[cfg(feature="snf")]
|
||||
b"SNFB"=>Ok(Format::SNFB(
|
||||
strafesnet_snf::read_bot(buf).map_err(ReadError::StrafesNET)?
|
||||
.read_all().map_err(ReadError::StrafesNETBot)?
|
||||
)),
|
||||
_=>Err(ReadError::UnknownFileFormat),
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user