update on entity_file: successfully able to parse all entities, therefore reverse-engineering theory is complete and proved for entity_file
This commit is contained in:
parent
ea5874594f
commit
c49622e2ac
2 changed files with 22 additions and 16 deletions
10
format.txt
10
format.txt
|
|
@ -43,12 +43,12 @@ next zar = <zar> + 0x1A + unk5
|
||||||
|
|
||||||
<entity_file>
|
<entity_file>
|
||||||
uint32_t N
|
uint32_t N
|
||||||
FString[N] - entity names
|
FString[N] - entity types
|
||||||
uint16_t <esh> count
|
uint16_t <esh> count
|
||||||
count times
|
uint32_t unk1
|
||||||
uint32_t unk1
|
count times - 1 (because entity id are indexed from 1)
|
||||||
uint16_t ?
|
uint32_t flags?
|
||||||
uint16_t name_idx
|
uint16_t type_idx
|
||||||
<esh>
|
<esh>
|
||||||
|
|
||||||
<esh>
|
<esh>
|
||||||
|
|
|
||||||
|
|
@ -32,23 +32,29 @@ impl World {
|
||||||
pub fn test(&self) -> Result<()> {
|
pub fn test(&self) -> Result<()> {
|
||||||
let mut rd = ReadStream::new(&self.data, 0x1038);
|
let mut rd = ReadStream::new(&self.data, 0x1038);
|
||||||
let _: Tag = rd.read(0)?;
|
let _: Tag = rd.read(0)?;
|
||||||
|
|
||||||
let n = rd.read_u32()? as usize;
|
let n = rd.read_u32()? as usize;
|
||||||
|
let mut types: Vec<FString> = Vec::with_capacity(n);
|
||||||
for i in 0..n {
|
for i in 0..n {
|
||||||
let name: FString = rd.read(0)?;
|
let ent_type: FString = rd.read(0)?;
|
||||||
println!("{}\t{}", i, name);
|
println!("{}\t{}", i, &ent_type);
|
||||||
|
types.push(ent_type);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*let esh_count = rd.read_u16()?;
|
let esh_count = rd.read_u16()?;
|
||||||
|
let unk1 = rd.read_u32()?;
|
||||||
dbg!(esh_count);
|
dbg!(esh_count);
|
||||||
for _ in 0..esh_count {
|
for i in 1..esh_count {
|
||||||
let unk1 = rd.read_u32()?;
|
let unk2 = rd.read_u32()?;
|
||||||
let unk2 = rd.read_u16()?;
|
let type_idx = rd.read_u16()?;
|
||||||
let unk3 = rd.read_u16()?;
|
if type_idx == 0xFFFF {
|
||||||
print!("{} {} {}", unk1, unk2, unk3);
|
continue;
|
||||||
if unk3 != 0xFFFF {
|
|
||||||
let _: ESH = rd.read(0)?;
|
|
||||||
}
|
}
|
||||||
}*/
|
|
||||||
|
let name = &types[type_idx as usize];
|
||||||
|
println!("offset {:x} idx {} unk1 {} name {}", rd.offset(), i, unk2, name);
|
||||||
|
let _: ESH = rd.read(0)?;
|
||||||
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue