update on entity_file
This commit is contained in:
parent
d8f1ef6dbd
commit
ea5874594f
3 changed files with 21 additions and 7 deletions
|
|
@ -43,12 +43,12 @@ next zar = <zar> + 0x1A + unk5
|
||||||
|
|
||||||
<entity_file>
|
<entity_file>
|
||||||
uint32_t N
|
uint32_t N
|
||||||
FString[N]
|
FString[N] - entity names
|
||||||
uint16_t <esh> count
|
uint16_t <esh> count
|
||||||
count times
|
count times
|
||||||
uint32_t unk1
|
uint32_t unk1
|
||||||
uint16_t ?
|
uint16_t ?
|
||||||
uint16_t ? (0xFFFF = no <esh>)
|
uint16_t name_idx
|
||||||
<esh>
|
<esh>
|
||||||
|
|
||||||
<esh>
|
<esh>
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@ impl<'a> ReadStream<'a> {
|
||||||
|
|
||||||
pub fn as_bytes(&mut self, size: usize) -> Result<&[u8]> {
|
pub fn as_bytes(&mut self, size: usize) -> Result<&[u8]> {
|
||||||
if self.offset() + size > self.raw.mem.len() {
|
if self.offset() + size > self.raw.mem.len() {
|
||||||
|
dbg!(self.offset(), size, self.raw.mem.len());
|
||||||
Err(anyhow!("as_bytes/read_bytes size is bigger than buffer"))
|
Err(anyhow!("as_bytes/read_bytes size is bigger than buffer"))
|
||||||
} else {
|
} else {
|
||||||
let buf = &self.raw.mem[self.offset()..self.offset() + size];
|
let buf = &self.raw.mem[self.offset()..self.offset() + size];
|
||||||
|
|
|
||||||
|
|
@ -30,12 +30,25 @@ impl World {
|
||||||
const WORLD_HDR_LEN: usize = 0x13;
|
const WORLD_HDR_LEN: usize = 0x13;
|
||||||
|
|
||||||
pub fn test(&self) -> Result<()> {
|
pub fn test(&self) -> Result<()> {
|
||||||
let mut rd = ReadStream::new(&self.data, 0x14AC);
|
let mut rd = ReadStream::new(&self.data, 0x1038);
|
||||||
let esh: ESH = rd.read(0)?;
|
let _: Tag = rd.read(0)?;
|
||||||
for (name, value) in esh.props.iter() {
|
let n = rd.read_u32()? as usize;
|
||||||
println!("{}\t{}", name, value);
|
for i in 0..n {
|
||||||
|
let name: FString = rd.read(0)?;
|
||||||
|
println!("{}\t{}", i, name);
|
||||||
}
|
}
|
||||||
dbg!(&esh.props["Display Name"]);
|
|
||||||
|
/*let esh_count = rd.read_u16()?;
|
||||||
|
dbg!(esh_count);
|
||||||
|
for _ in 0..esh_count {
|
||||||
|
let unk1 = rd.read_u32()?;
|
||||||
|
let unk2 = rd.read_u16()?;
|
||||||
|
let unk3 = rd.read_u16()?;
|
||||||
|
print!("{} {} {}", unk1, unk2, unk3);
|
||||||
|
if unk3 != 0xFFFF {
|
||||||
|
let _: ESH = rd.read(0)?;
|
||||||
|
}
|
||||||
|
}*/
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue