remove silly size param from read_ctx because Decoder doesn't require it anymore
This commit is contained in:
parent
1fdcad3548
commit
74f70c5171
3 changed files with 4 additions and 8 deletions
|
|
@ -105,7 +105,7 @@ impl DecoderCtx<EntityEncoding, EntityEncoding> for EntityList {
|
||||||
first = false;
|
first = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
let ent: Entity = rd.read_ctx(0, &mut ent_list)?;
|
let ent: Entity = rd.read_ctx(&mut ent_list)?;
|
||||||
ent_list.ents.push(ent);
|
ent_list.ents.push(ent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -123,7 +123,7 @@ impl DecoderCtx<EntityEncoding, EntityEncoding> for EntityList {
|
||||||
let ent_count = rd.read_u16()?;
|
let ent_count = rd.read_u16()?;
|
||||||
ent_list.unk1 = rd.read_u32()?;
|
ent_list.unk1 = rd.read_u32()?;
|
||||||
for _ in 1..ent_count {
|
for _ in 1..ent_count {
|
||||||
let ent: Entity = rd.read_ctx(0, &mut ent_list)?;
|
let ent: Entity = rd.read_ctx(&mut ent_list)?;
|
||||||
ent_list.ents.push(ent);
|
ent_list.ents.push(ent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -58,11 +58,7 @@ impl<'a> ReadStream<'a> {
|
||||||
|
|
||||||
// read_opt - decode with optional paramters. required for complex structure
|
// read_opt - decode with optional paramters. required for complex structure
|
||||||
// with different origins (save / entfile) like entities
|
// with different origins (save / entfile) like entities
|
||||||
pub fn read_ctx<T: DecoderCtx<DCtx, ECtx>, DCtx, ECtx>(
|
pub fn read_ctx<T: DecoderCtx<DCtx, ECtx>, DCtx, ECtx>(&mut self, ctx: DCtx) -> Result<T> {
|
||||||
&mut self,
|
|
||||||
size: usize,
|
|
||||||
ctx: DCtx,
|
|
||||||
) -> Result<T> {
|
|
||||||
Ok(T::decode(self, ctx)?)
|
Ok(T::decode(self, ctx)?)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -85,7 +85,7 @@ impl DecoderCtx<WorldOffsetSize, ()> for World {
|
||||||
let sgd: SGD = rd.read()?;
|
let sgd: SGD = rd.read()?;
|
||||||
let ssg: SSG = rd.read()?;
|
let ssg: SSG = rd.read()?;
|
||||||
|
|
||||||
let entlist: EntityList = rd.read_ctx(0, EntityEncoding::World)?;
|
let entlist: EntityList = rd.read_ctx(EntityEncoding::World)?;
|
||||||
|
|
||||||
let unparsed = rd.read_bytes(data.len() - rd.offset())?;
|
let unparsed = rd.read_bytes(data.len() - rd.offset())?;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue