diff options
author | Treeki <treeki@gmail.com> | 2011-06-18 02:45:40 +0200 |
---|---|---|
committer | Treeki <treeki@gmail.com> | 2011-06-18 02:45:40 +0200 |
commit | 7269f2c9ea7c817ce4975f3a8972e73884e9aaf7 (patch) | |
tree | 264c9753ac6ff6c7ba8194ec51767ab45df15a6c /scenegen_.py | |
parent | 45fede365a5664dd428d4dc47b8ac2fed8119f2a (diff) | |
download | kamek-7269f2c9ea7c817ce4975f3a8972e73884e9aaf7.tar.gz kamek-7269f2c9ea7c817ce4975f3a8972e73884e9aaf7.zip |
removed the old scene stuff
Diffstat (limited to 'scenegen_.py')
-rw-r--r-- | scenegen_.py | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/scenegen_.py b/scenegen_.py deleted file mode 100644 index 418d1b9..0000000 --- a/scenegen_.py +++ /dev/null @@ -1,48 +0,0 @@ -import struct - -from collections import OrderedDict - -from gameobjects.matrix44 import * -from gameobjects.vector3 import * - - -class Node: - pass - -nodes = OrderedDict() - -BaseNode = Node() -BaseNode.mtx = Matrix44() -BaseNode.brres_key = '3D00' -BaseNode.model_name = 'WorldBase' -BaseNode.lm_type = 0 -nodes['Base'] = BaseNode - - - -# todo: string table optimisation - -header = struct.pack('>4sI', b'MScn', len(nodes)) -entrydata = b'' -stringtable = b'' -stringoffsets = {} -currentoffset = 8 + (0x40 * len(nodes)) - -for key,node in nodes.items(): - #nodekey, brreskey, lmtype, nameoffset, matrix - enc_name = node.model_name.encode('Shift-JIS') - if enc_name not in stringoffsets: - stringoffsets[enc_name] = currentoffset - stringtable += enc_name + b'\0' - currentoffset += len(enc_name) + 1 - - nameoffs = stringoffsets[enc_name] - - - entrydata += struct.pack('>4s4sII', key.encode('Shift-JIS'), node.brres_key.encode('Shift-JIS'), node.lm_type, stringoffsets[enc_name]) - for f in list(node.mtx.transposed_components())[0:12]: - entrydata += struct.pack('>f', f) - - -open('scenedata.bin', 'wb').write(header + entrydata + stringtable) - |