From 8976f791687bfeaea196bbe945333f43cd17a630 Mon Sep 17 00:00:00 2001 From: comex Date: Fri, 30 Jan 2009 19:42:57 -0500 Subject: temp stuff --- ethyl.py | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'ethyl.py') diff --git a/ethyl.py b/ethyl.py index e968d69..3c6c755 100644 --- a/ethyl.py +++ b/ethyl.py @@ -59,6 +59,20 @@ formats = { float width float height ''', + 'material': ''' + char name[0x14] // 0 + s16 tev_color[4] // 14 + s16 unkx // 1c + s16 unk5 // 20 + s16 unk6 // 22 + s16 unk7 // 24 + s16 unk8 // 26 + s16 unk9 // 28 + s16 unka // 2a + u32 tev_kcolor[4] // 2c + u32 flags // 3c - 814fee68 - see doc + etc! + ''', } @@ -228,4 +242,10 @@ def iff_to_chunks(z): data = z[pos+8:pos+length] pos += length chunks.append((cc, data)) - return chunks \ No newline at end of file + return chunks +def bit_extract(num, start, end): + mask = (2**(31 - start + 1) - 1) - (2**(31 - end) - 1) + ret = (num & mask) >> (31 - end) + + return ret + -- cgit v1.3.1