aboutsummaryrefslogtreecommitdiff
path: root/parse-brlan.py
diff options
context:
space:
mode:
authorcomex <comexk@gmail.com>2009-01-29 18:11:52 -0500
committercomex <comexk@gmail.com>2009-01-29 18:11:52 -0500
commit8edaf638429568b8f2dc1b0f2a806ba7847dbd53 (patch)
treebf99cebaba4a25d832857e25c5f7689aaf571815 /parse-brlan.py
parentf173c743d3d435fb96a6e12c83b45726c1beeae9 (diff)
Support for stuff. A brlan writer that can only write an empty file. (Genius.)
Diffstat (limited to '')
-rw-r--r--parse-brlan.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/parse-brlan.py b/parse-brlan.py
index 72152bb..8004d3d 100644
--- a/parse-brlan.py
+++ b/parse-brlan.py
@@ -22,19 +22,20 @@ for typ, chunk in ch:
for n in xrange(num_anims):
pos = anim_offset - 8 + 4*n
offs = struct.unpack('>I', chunk[pos:pos+4])[0] - 8
- name = chunk[offs:offs + 20].rstrip('\0') # ignored by code
- aoffs = offs + struct.unpack('>I', chunk[offs + 0x18:offs + 0x1c])[0]
+ name = chunk[offs:offs + 20].rstrip('\0')
+ aunk, aoffs = struct.unpack('>II', chunk[offs + 0x14:offs + 0x1c])
+ aoffs += offs
atyp = chunk[aoffs:aoffs+4]
num_aents = ord(chunk[aoffs + 4])
- print atyp
+ print atyp, name, hex(aunk)
for m in xrange(num_aents):
boffs = aoffs + 8 + 4*m
coffs, = struct.unpack('>I', chunk[boffs:boffs + 4])
coffs += aoffs
- if atyp == 'RLMC':
- alpha_maybe = ord(chunk[coffs])
+ if atyp in ('RLMC', 'RLVC', 'RLPA', 'RLTP', 'RLIM'): # doesn't cover RLTS, RLVI
+ alpha_maybe = ord(chunk[coffs+1])
num_cookies, pad, cookies_offs = struct.unpack('>HHI', chunk[coffs+4:coffs+0xc])
- print num_cookies
+ print hex(alpha_maybe), num_cookies
for o in xrange(num_cookies):
cookie_offs = coffs + cookies_offs + 0xc*o
coords = struct.unpack('>fff', chunk[cookie_offs:cookie_offs + 0xc])