SourceForge has been redesigned. Learn more.
Close

[bc874f]: / ie_shell / formats / vvc.py  Maximize  Restore  History

Download this file

272 lines (223 with data), 8.2 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
# -*-python-*-
# ie_shell.py - Simple shell for Infinity Engine-based game files
# Copyright (C) 2004 by Jaroslav Benkovsky, <edheldil@users.sf.net>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# RCS: $Id: vvc.py,v 1.1 2006/07/08 14:29:27 edheldil Exp $
from ie_shell.formats.format import Format, register_format, core
class VVC_Format (Format):
def __init__ (self, filename):
Format.__init__ (self, filename)
self.expect_signature = 'VVC'
self.header_desc = (
{ 'key': 'signature',
'type': 'STR4',
'off': 0x0000,
'label': 'Signature' },
{ 'key': 'version',
'type': 'STR4',
'off':0x0004,
'label': 'Version'},
{ 'key': 'animation',
'type': 'RESREF',
'off': 0x0008,
'label': 'Animation' },
{ 'key': 'unknown_10',
'type': 'RESREF',
'off': 0x0010,
'label': 'Unknown 10' },
{ 'key': 'misc_flags',
'type': 'WORD',
'off': 0x0018,
'mask': {
0x0001: 'unknown 0',
0x0002: 'translucent',
0x0004: 'unknown 2',
0x0008: 'transparent',
0x0010: 'mirror Y axis',
0x0020: 'mirror X axis',
0x0040: 'unknown 6',
0x0080: 'unknown 7',
0x0100: 'unknown 8',
0x0200: 'blend',
0x0400: 'unknown 10',
0x0800: 'unknown 11',
0x1000: 'unknown 12',
0x2000: 'unknown 13',
0x4000: 'unknown 14',
0x8000: 'unknown 15',
},
'label': 'Misc. flags'},
{ 'key': 'tint',
'type': 'WORD',
'off': 0x001A,
'mask': {
0x0001: 'unknown 0',
0x0002: 'unknown 1',
0x0004: 'unknown 2',
0x0008: 'greyscale',
0x0010: 'unknown 4',
0x0020: 'glowing',
0x0040: 'unknown 6',
0x0080: 'unknown 7',
0x0100: 'unknown 8',
0x0200: 'red',
0x0400: 'unknown 10',
0x0800: 'unknown 11',
0x1000: 'unknown 12',
0x2000: 'unknown 13',
0x4000: 'unknown 14',
0x8000: 'unknown 15',
},
'label': 'Tint'},
{ 'key': 'unknown_1C',
'type': 'DWORD',
'off': 0x001C,
'label': 'Unknown 1C'},
{ 'key': 'flags',
'type': 'DWORD',
'off': 0x0020,
'mask': {
0x0001: 'looping',
0x0002: 'sequence 2',
0x0004: 'sequence 4',
0x0008: 'greyscale',
0x0010: 'unknown 4',
0x0020: 'unknown 5',
0x0040: 'wallgrps do not cover',
0x0080: 'unknown 7',
0x0100: 'use bam',
0x0200: 'unknown 9',
0x0400: 'unknown 10',
0x0800: 'unknown 11',
0x1000: 'unknown 12',
0x2000: 'unknown 13',
0x4000: 'unknown 14',
0x8000: 'unknown 15',
},
'label': 'Flags'},
{ 'key': 'unknown_24',
'type': 'DWORD',
'off': 0x0024,
'label': 'Unknown 24'},
{ 'key': 'x_pos',
'type': 'DWORD',
'off': 0x0028,
'label': 'X position'},
{ 'key': 'y_pos',
'type': 'DWORD',
'off': 0x002C,
'label': 'Y position'},
{ 'key': 'unknown_30',
'type': 'DWORD',
'off': 0x0030,
'label': 'Unknown 30'},
{ 'key': 'frame_rate',
'type': 'DWORD',
'off': 0x0034,
'label': 'Frame rate'},
{ 'key': 'face_target',
'type': 'DWORD',
'off': 0x0038,
'label': 'Face target'},
{ 'key': 'unknown_3C',
'type': 'DWORD',
'off': 0x003C,
'label': 'Unknown 3C'},
{ 'key': 'position',
'type': 'DWORD',
'off': 0x0040,
'mask': { 0x1: 'orbit target', 0x2: 'rel. to target' },
'label': 'Position'},
{ 'key': 'unknown_44',
'type': 'DWORD',
'off': 0x0044,
'label': 'Unknown 44'},
{ 'key': 'unknown_48',
'type': 'DWORD',
'off': 0x0048,
'label': 'Unknown 48'},
{ 'key': 'z_pos',
'type': 'DWORD',
'off': 0x004C,
'label': 'Z position'},
{ 'key': 'unknown_50',
'type': 'DWORD',
'off': 0x0050,
'label': 'Unknown 50'},
{ 'key': 'unknown_54',
'type': 'RESREF',
'off': 0x0054,
'label': 'Unknown 54'},
{ 'key': 'duration',
'type': 'DWORD',
'off': 0x005C,
'label': 'Duration'},
{ 'key': 'unknown_60',
'type': 'RESREF',
'off': 0x0060,
'label': 'Unknown 60'},
{ 'key': 'introduction_bam_cycle',
'type': 'DWORD',
'off': 0x0068,
'label': 'Introduction BAM cycle'},
{ 'key': 'duration_bam_cycle',
'type': 'DWORD',
'off': 0x006C,
'label': 'Duration BAM cycle'},
{ 'key': 'unknown_70',
'type': 'RESREF',
'off': 0x0070,
'label': 'Unknown 70'},
{ 'key': 'introduction_wavc',
'type': 'RESREF',
'off': 0x0078,
'label': 'Introduction WAVC'},
{ 'key': 'duration_wavc',
'type': 'RESREF',
'off': 0x0080,
'label': 'Duration WAVC'},
{ 'key': 'unknown_88',
'type': 'DWORD',
'off': 0x0088,
'label': 'Unknown 88'},
{ 'key': 'unknown_8C',
'type': 'DWORD',
'off': 0x008C,
'label': 'Unknown 8C'},
{ 'key': 'ending_bam_cycle',
'type': 'DWORD',
'off': 0x0090,
'label': 'Ending BAM cycle'},
{ 'key': 'ending_wavc',
'type': 'RESREF',
'off': 0x0094,
'label': 'Ending WAVC?'},
{ 'key': 'unknown_9C',
'type': 'BYTES',
'off': 0x009C,
'size': 336,
'label': 'Unknown 9C'},
)
def decode_file (self):
self.decode_header ()
def print_file (self):
self.print_header ()
def decode_header (self):
self.header = {}
self.decode_by_desc (0x0000, self.header_desc, self.header)
def print_header (self):
self.print_by_desc (self.header, self.header_desc)
register_format ('VVC', 'V1.0', VVC_Format)