aboutsummaryrefslogtreecommitdiff
path: root/parse-brlyt.py
diff options
context:
space:
mode:
authorcomex <comexk@gmail.com>2009-02-03 13:45:43 -0500
committercomex <comexk@gmail.com>2009-02-03 13:45:43 -0500
commitd43d30a57cc5bc098d4872be52dbaefe3bd38658 (patch)
tree07a85e0d268473ac533cc54bbef767be635a8e42 /parse-brlyt.py
parent43595980673a98759c8da9671bf19023d8ee9877 (diff)
horribltastic
Diffstat (limited to '')
-rw-r--r--parse-brlyt.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/parse-brlyt.py b/parse-brlyt.py
index 43020d4..694cc12 100644
--- a/parse-brlyt.py
+++ b/parse-brlyt.py
@@ -55,6 +55,8 @@ for typ, chunk in ch:
name = nullterm(chunk[offset + bpos:])
vars[things].append({'name': name, 'unk': unk})
pos += 8
+ if typ == 'txl1':
+ textures = vars['textures']
elif typ == 'mat1':
vars, pos = parse_data(chunk, 'numoffs')
vars['materials'] = []
@@ -80,6 +82,9 @@ for typ, chunk in ch:
mat['texref'], mpos = get_array(chunk, mpos, bit_extract(flags, 28, 31), 4, 'texref')
+ for a in mat['texref']:
+ a['tex'] = textures[a['tex_offs']]['name']
+
# 0x14 * flags[24-27], followed by
mat['ua2'], mpos = get_array(chunk, mpos, bit_extract(flags, 24, 27), 0x14, 'ua2')
@@ -88,6 +93,12 @@ for typ, chunk in ch:
mat['ua3'], mpos = get_array(chunk, mpos, bit_extract(flags, 20, 23), 4, '4b')
+ # Changing ua3 things
+ # 1st --> disappears.
+ # 2nd --> no visible effect.
+ # 3rd --> disappears.
+ # 4th --> no visible effect.
+
# 4 * flags[6]
mat['ua4'], mpos = get_opt(chunk, mpos, bit_extract(flags, 6), 4, '4b')
@@ -110,7 +121,7 @@ for typ, chunk in ch:
# 0x10 * flags[9-13]
- mat['ua8'], mpos = get_array(chunk, mpos, bit_extract(flags, 9, 13), 0x10, '10b')
+ mat['ua9'], mpos = get_array(chunk, mpos, bit_extract(flags, 9, 13), 0x10, '10b')
# 4 * flags[8], these are bytes btw
@@ -125,6 +136,9 @@ for typ, chunk in ch:
if next_offset - 8 != mpos:
mat['~_insane'] = next_offset - 8 - mpos # Extra shit we didn't parse :(
+ mat['unk_bit_5'] = bit_extract(flags, 5)
+ mat['unk_bits_0_3'] = bit_extract(flags, 0, 3) # Overwritten by stuff
+
vars['materials'].append(mat)
pos += 4
elif typ in ('grs1', 'pas1'):