aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_max/imp_max_chunks.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/others/mimesh/libg3d-0.0.8/plugins/import/imp_max/imp_max_chunks.h')
-rw-r--r--src/others/mimesh/libg3d-0.0.8/plugins/import/imp_max/imp_max_chunks.h289
1 files changed, 289 insertions, 0 deletions
diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_max/imp_max_chunks.h b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_max/imp_max_chunks.h
new file mode 100644
index 0000000..96691bc
--- /dev/null
+++ b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_max/imp_max_chunks.h
@@ -0,0 +1,289 @@
1/* $Id$ */
2
3/*
4 libg3d - 3D object loading library
5
6 Copyright (C) 2005-2009 Markus Dahms <mad@automagically.de>
7
8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Lesser General Public
10 License as published by the Free Software Foundation; either
11 version 2.1 of the License, or (at your option) any later version.
12
13 This library is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Lesser General Public License for more details.
17
18 You should have received a copy of the GNU Lesser General Public
19 License along with this library; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21*/
22#ifndef _IMP_MAX_CHUNKS_H
23#define _IMP_MAX_CHUNKS_H
24
25#include <glib.h>
26
27#include "imp_max_callbacks.h"
28
29#define IDNONE -1
30#define IDSOME -2
31#define IDROOT -3
32#define IDGEOM -4
33#define IDMATG -5
34#define IDFILE -6
35
36#define ID_IS_ROOT(pid) \
37 (((pid) == 0x2001) || ((pid) == 0x2003) || ((pid) == 0x2004) || \
38 ((pid) == 0x2006) || ((pid) == 0x2008) || ((pid) == 0x2009) || \
39 ((pid) == 0x200A) || ((pid) == 0x200B))
40#define ID_IS_GEOM(pid) \
41 ((((pid) >= 0x0010) && ((pid) <= 0x0011)) || \
42 (((pid) >= 0x0013) && ((pid) <= 0x0014)) || \
43 (((pid) >= 0x0016) && ((pid) <= 0x001C)) || \
44 ((pid) == 0x0023) || ((pid) == 0x0026))
45#define ID_IS_MATG(pid) \
46 (((pid) == 0x0002) || \
47 (((pid) >= 0x0004) && ((pid) <= 0x000F)))
48#define ID_IS_FILE(pid) \
49 (((pid) == 0x0003) || ((pid) == 0x0400))
50
51typedef struct {
52 gint32 id;
53 gint32 parentid;
54 char *desc;
55 MaxCallback callback;
56} MaxChunk;
57
58/* container chunks */
59static MaxChunk max_cnt_chunks[] = {
60 { 0x0118, 0x08FE, "face", NULL },
61
62 { 0x08FE, IDGEOM, "mesh", max_cb_IDGEOM_0x08FE },
63 { 0x0901, IDGEOM, "matrix or not", NULL },
64 { 0x0906, IDGEOM, "matrix or not", NULL },
65
66 { 0x092C, 0x08FE, "mesh bit map group", NULL },
67 { 0x092D, 0x08FE, "mesh bit map group", NULL },
68 { 0x092E, 0x08FE, "mesh bit map group", NULL },
69
70 { 0x2001, IDNONE, "3ds MAX x.x root node", NULL },
71 { 0x2003, IDNONE, "3ds MAX x.x root node", NULL },
72 { 0x2004, IDNONE, "3ds MAX 3.x root node", NULL },
73 { 0x2006, IDNONE, "3ds MAX 4.x root node", NULL },
74 { 0x2008, IDNONE, "3ds MAX 5.x root node", NULL },
75 { 0x2009, IDNONE, "3ds MAX 6.x root node", NULL },
76 { 0x200A, IDNONE, "3ds MAX 7.x root node", NULL },
77 { 0x200B, IDNONE, "3ds MAX 8.x root node", NULL },
78 { 0x2038, IDNONE, "DLL directory entry", NULL },
79 { 0x2040, IDNONE, "class directory entry", NULL },
80 { 0x2100, IDNONE, "class data entry", NULL },
81
82 { 0x4000, IDMATG, "material group", max_cb_IDMATG_0x4000 },
83
84 { IDNONE, IDSOME, NULL, NULL }
85};
86
87/* data chunks */
88static MaxChunk max_chunks[] = {
89 /* IDGEOM */
90 { 0x08FF, IDGEOM, "mesh something", max_cb_debug_int32 },
91 { 0x0900, IDGEOM, "object something", max_cb_debug_int32 },
92 { 0x0902, IDGEOM, "object something", max_cb_debug_int32 },
93 { 0x0903, IDGEOM, "object something", max_cb_debug_int32 },
94 { 0x0904, IDGEOM, "object something", max_cb_debug_int32 },
95 { 0x0960, IDGEOM, "object something", max_cb_debug_int32 },
96 { 0x0962, IDGEOM, "object name", max_cb_IDGEOM_0x0962 },
97 { 0x0963, IDGEOM, "object something", max_cb_debug_int32 },
98 { 0x096A, IDGEOM, "object something", max_cb_debug_int32 },
99 { 0x096B, IDGEOM, "object something", max_cb_debug_int32 },
100 { 0x096C, IDGEOM, "object something", max_cb_debug_int32 },
101 { 0x0974, IDGEOM, "object something", max_cb_debug_int32 },
102 { 0x0975, IDGEOM, "object flag", NULL },
103 { 0x0978, IDGEOM, "object flag", NULL },
104 { 0x099C, IDGEOM, "object something", max_cb_debug_int32 },
105 { 0x09BA, IDGEOM, "object flag", NULL },
106 { 0x09CE, IDGEOM, "object something", max_cb_debug_int32 },
107 { 0x0A28, IDGEOM, "object something", max_cb_debug_int32 },
108 { 0x0A32, IDGEOM, "object something", max_cb_debug_int32 },
109 { 0x0ABE, IDGEOM, "object something", max_cb_debug_int32 },
110 { 0x2500, IDGEOM, "object something", max_cb_debug_int32 },
111 { 0x2501, IDGEOM, "object something", max_cb_debug_int32 },
112 { 0x2505, IDGEOM, "object something", max_cb_debug_int32 },
113 { 0x2532, IDGEOM, "object something", max_cb_debug_int32 },
114 { 0x3002, IDGEOM, "object something", max_cb_debug_int32 },
115 { 0x3003, IDGEOM, "object something", max_cb_debug_int32 },
116 { 0x3005, IDGEOM, "object something", max_cb_debug_int32 },
117 { 0x4020, IDGEOM, "object something", max_cb_debug_int32 },
118 { 0x4024, IDGEOM, "object something", max_cb_debug_int32 },
119 { 0x4025, IDGEOM, "object something", max_cb_debug_int32 },
120 { 0x4026, IDGEOM, "object something", max_cb_debug_int32 },
121 { 0x402C, IDGEOM, "object something", max_cb_debug_int32 },
122 { 0x402D, IDGEOM, "object something", max_cb_debug_int32 },
123 { 0x4030, IDGEOM, "object something", max_cb_debug_int32 },
124 { 0x4034, IDGEOM, "object something", max_cb_debug_int32 },
125 { 0x4038, IDGEOM, "object something", max_cb_debug_int32 },
126 { 0x403B, IDGEOM, "object something", max_cb_debug_int32 },
127 { 0x7230, IDGEOM, "object something", max_cb_debug_int32 },
128 { 0x7231, IDGEOM, "object something", max_cb_debug_int32 },
129 /* IDMATG */
130 { 0x5300, IDMATG, "material something", max_cb_debug_int32 },
131 /* IDFILE */
132 { 0x1201, IDFILE, "file dimensions + unknown", max_cb_IDFILE_0x1201 },
133 { 0x1230, IDFILE, "file name", max_cb_debug_wchars },
134 { 0x1240, IDFILE, "file type", max_cb_debug_wchars },
135 /* 0x0000 */
136 { 0x0005, 0x0000, "[DEBUG] big chunk", NULL },
137 { 0x0009, 0x0000, "[DEBUG] 16", max_cb_debug_int32 },
138 { 0x000A, 0x0000, "[DEBUG] 3n, 11", NULL },
139 { 0x000B, 0x0000, "[DEBUG] 24", max_cb_debug_int32 },
140 { 0x000C, 0x0000, "[DEBUG] 10", NULL },
141 { 0x2035, 0x0000, "[DEBUG] n * 4", max_cb_debug_int32 },
142 /* 0x0001 */
143 { 0x0005, 0x0001, "properties", max_cb_0x0001_0x0005 },
144 { 0x1000, 0x0003, "[DEBUG] 4", max_cb_debug_int32 },
145 { 0x2045, 0x0001, "[DEBUG] 4", max_cb_debug_int32 },
146 /* 0x0002 */
147 { 0x2045, 0x0002, "[DEBUG] 4", max_cb_debug_int32 },
148 /* 0x0003 */
149 { 0x2045, 0x0003, "[DEBUG] 4", max_cb_debug_int32 },
150 { 0x1030, 0x0003, "[DEBUG] 4", max_cb_debug_int32 },
151 { 0x1040, 0x0003, "[DEBUG] 4", max_cb_debug_int32 },
152 /* 0x0004 */
153 { 0x2035, 0x0004, "[DEBUG] n * 4", max_cb_debug_int32 },
154 { 0x2500, 0x0004, "[DEBUG] 8", max_cb_debug_int32 },
155 { 0x2501, 0x0004, "[DEBUG] 4", max_cb_debug_int32 },
156 { 0x2532, 0x0004, "[DEBUG] flag", NULL },
157 { 0x2533, 0x0004, "[DEBUG] flag", NULL },
158 { 0x2534, 0x0004, "[DEBUG] flag", NULL },
159 { 0x3002, 0x0004, "[DEBUG] 4", max_cb_debug_int32 },
160 { 0x3003, 0x0004, "[DEBUG] 8", max_cb_debug_int32 },
161 { 0x3005, 0x0004, "[DEBUG] 4", max_cb_debug_int32 },
162 /* 0x0010 */
163 { 0x0962, 0x0010, "name", max_cb_debug_wchars },
164 /* 0x0013 */
165 { 0x1000, 0x0013, "text", max_cb_debug_string },
166 /* 0x0019 */
167 { 0x0110, 0x0019, "name", max_cb_debug_wchars },
168 { 0x0120, 0x0019, "name", max_cb_debug_wchars },
169 /* 0x0022 */
170 { 0x0110, 0x0022, "text", max_cb_debug_wchars },
171 { 0x0120, 0x0022, "type data", max_cb_debug_int32 },
172 { 0x0130, 0x0022, "type data", max_cb_debug_int32 },
173 /* 0x0027 */
174 { 0x0110, 0x0027, "text", max_cb_debug_wchars },
175 /* 0x002C */
176 { 0x0110, 0x002C, "text", max_cb_debug_wchars },
177 /* 0x002E */
178 { 0x0110, 0x002E, "text", max_cb_debug_wchars },
179 { 0x0120, 0x002E, "type data", max_cb_debug_int32 },
180 { 0x0130, 0x002E, "type data", max_cb_debug_int32 },
181 { 0x0140, 0x002E, "type data", max_cb_debug_int32 },
182 /* 0x0110 */
183 { 0x0120, 0x0110, "something", max_cb_debug_int32 },
184 { 0x0130, 0x0110, "something", max_cb_debug_int32 },
185 /* 0x0118 */
186 { 0x0100, 0x0118, "face data", max_cb_debug_int32 },
187 { 0x0110, 0x0118, "face indices", max_cb_0x0118_0x0110 },
188
189 /* 0x08FE */
190 { 0x0100, 0x08FE, "vertices", max_cb_0x08FE_0x0100 },
191 { 0x0108, 0x08FE, "mesh data", max_cb_debug_int32 },
192 { 0x010A, 0x08FE, "lines", max_cb_0x08FE_0x010A },
193 { 0x0110, 0x08FE, "[DEBUG] 4", max_cb_debug_int32 },
194 { 0x0114, 0x08FE, "[DEBUG] 4", max_cb_debug_int32 },
195 { 0x011A, 0x08FE, "polygons", max_cb_0x08FE_0x011A },
196 { 0x0120, 0x08FE, "[DEBUG] 4", max_cb_debug_int32 },
197 { 0x0124, 0x08FE, "[DEBUG] 4", max_cb_debug_int32 },
198 { 0x0128, 0x08FE, "texture vertices", max_cb_0x08FE_0x0128 },
199 { 0x012B, 0x08FE, "texture indices", max_cb_0x08FE_0x012B },
200 { 0x0130, 0x08FE, "[DEBUG] 4", max_cb_debug_int32 },
201 { 0x0140, 0x08FE, "[DEBUG] 4", max_cb_debug_int32 },
202 { 0x0150, 0x08FE, "[DEBUG] 4", max_cb_debug_int32 },
203 { 0x0906, 0x08FE, "mesh something", max_cb_debug_int32 },
204 { 0x0908, 0x08FE, "mesh something", max_cb_debug_int32 },
205 { 0x0912, 0x08FE, "triangles", max_cb_0x08FE_0x0912 },
206 { 0x0914, 0x08FE, "vertices", max_cb_0x08FE_0x0914 },
207 { 0x0916, 0x08FE, "texture vertices", max_cb_0x08FE_0x0916 },
208 { 0x0918, 0x08FE, "texture indices (tris)", max_cb_0x08FE_0x0918 },
209 { 0x0924, 0x08FE, "mesh something", max_cb_debug_int32 },
210 { 0x0928, 0x08FE, "mesh something", max_cb_debug_int32 },
211 { 0x092A, 0x08FE, "mesh something", max_cb_debug_int32 },
212 { 0x0959, 0x08FE, "mesh something", max_cb_debug_int32 },
213 { 0x2394, 0x08FE, "vertices", max_cb_0x08FE_0x2394 },
214 { 0x2396, 0x08FE, "triangles", max_cb_0x08FE_0x2396 },
215 { 0x2398, 0x08FE, "mesh something", max_cb_debug_int32 },
216 /* 0x0901 */
217 { 0x300D, 0x0901, "x32", max_cb_debug_int32 },
218 { 0x300E, 0x0901, "x32", max_cb_debug_int32 },
219 { 0x300F, 0x0901, "x32", max_cb_debug_int32 },
220 { 0x3010, 0x0901, "x32", max_cb_debug_int32 },
221 { 0x3012, 0x0901, "x32", max_cb_debug_int32 },
222 { 0x3013, 0x0901, "x32", max_cb_debug_int32 },
223 { 0x3014, 0x0901, "x32", max_cb_debug_int32 },
224 { 0x3015, 0x0901, "x32", max_cb_debug_int32 },
225 { 0x3016, 0x0901, "x32", max_cb_debug_int32 },
226 { 0x3017, 0x0901, "x32", max_cb_debug_int32 },
227 { 0x3019, 0x0901, "x32", max_cb_debug_int32 },
228 { 0x301A, 0x0901, "x32", max_cb_debug_int32 },
229 { 0x301B, 0x0901, "x32", max_cb_debug_int32 },
230 { 0x301C, 0x0901, "x32", max_cb_debug_int32 },
231 { 0x301D, 0x0901, "x32", max_cb_debug_int32 },
232 { 0x301E, 0x0901, "x32", max_cb_debug_int32 },
233 /* 0x0906 */
234 { 0x300D, 0x0906, "x32", max_cb_debug_int32 },
235 { 0x300E, 0x0906, "x32", max_cb_debug_int32 },
236 { 0x300F, 0x0906, "x32", max_cb_debug_int32 },
237 { 0x3010, 0x0906, "x32", max_cb_debug_int32 },
238 { 0x3012, 0x0906, "x32", max_cb_debug_int32 },
239 { 0x3013, 0x0906, "x32", max_cb_debug_int32 },
240 { 0x3014, 0x0906, "x32", max_cb_debug_int32 },
241 { 0x3015, 0x0906, "x32", max_cb_debug_int32 },
242 { 0x3016, 0x0906, "x32", max_cb_debug_int32 },
243 { 0x3017, 0x0906, "x32", max_cb_debug_int32 },
244 { 0x3019, 0x0906, "x32", max_cb_debug_int32 },
245 { 0x301A, 0x0906, "x32", max_cb_debug_int32 },
246 { 0x301B, 0x0906, "x32", max_cb_debug_int32 },
247 { 0x301C, 0x0906, "x32", max_cb_debug_int32 },
248 { 0x301D, 0x0906, "x32", max_cb_debug_int32 },
249 { 0x301E, 0x0906, "x32", max_cb_debug_int32 },
250 /* 0x092C */
251 { 0x2700, 0x092C, "bit map", NULL },
252 /* 0x092D */
253 { 0x2700, 0x092D, "bit map", NULL },
254 /* 0x092E */
255 { 0x2700, 0x092E, "bit map", NULL },
256 /* 0x0AF0 */
257 { 0x0001, 0x0AF0, "something", max_cb_debug_int32 },
258 { 0x0002, 0x0AF0, "something", max_cb_debug_int32 },
259 { 0x0003, 0x0AF0, "something", max_cb_debug_int32 },
260 { 0x0004, 0x0AF0, "something", max_cb_debug_int32 },
261 { 0x0005, 0x0AF0, "something", max_cb_debug_int32 },
262 { 0x0006, 0x0AF0, "something", max_cb_debug_int32 },
263 { 0x0007, 0x0AF0, "something", max_cb_debug_int32 },
264 { 0x0008, 0x0AF0, "something", max_cb_debug_int32 },
265 /* 2500 */
266 { 0x2510, 0x2500, "something", max_cb_debug_int32 },
267 { 0x2511, 0x2500, "something", max_cb_debug_int32 },
268 { 0x2513, 0x2500, "something", max_cb_debug_int32 },
269 /* 2512 */
270 { 0x0530, 0x2512, "something", max_cb_debug_int32 },
271 { 0x0540, 0x2512, "something", max_cb_debug_int32 },
272 { 0x0550, 0x2512, "something", max_cb_debug_int32 },
273 { 0x0560, 0x2512, "something", max_cb_debug_int32 },
274 /* 0x39BF */
275 { 0x0100, 0x39BF, "text", max_cb_debug_wchars },
276 /* 0x4000 */
277 { 0x4001, 0x4000, "material name", max_cb_0x4000_0x4001 },
278 { 0x4003, 0x4000, "material something (4)", max_cb_debug_int32 },
279 { 0x4020, 0x4000, "material something (4)", max_cb_debug_int32 },
280 { 0x4030, 0x4000, "material color", max_cb_0x4000_0x4030 },
281
282 /* IDSOME */
283 { 0x2034, IDSOME, "init something", max_cb_debug_int32 },
284 { 0x2035, IDSOME, "init something", max_cb_debug_int32 },
285
286 { IDNONE, IDSOME, NULL, NULL }
287};
288
289#endif /* _IMP_MAX_CHUNKS_H */