aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_3ds
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/others/mimesh/libg3d-0.0.8/plugins/import/imp_3ds/Makefile512
-rw-r--r--src/others/mimesh/libg3d-0.0.8/plugins/import/imp_3ds/Makefile.am21
-rw-r--r--src/others/mimesh/libg3d-0.0.8/plugins/import/imp_3ds/Makefile.in512
-rw-r--r--src/others/mimesh/libg3d-0.0.8/plugins/import/imp_3ds/imp_3ds.c206
-rw-r--r--src/others/mimesh/libg3d-0.0.8/plugins/import/imp_3ds/imp_3ds.h55
-rw-r--r--src/others/mimesh/libg3d-0.0.8/plugins/import/imp_3ds/imp_3ds_callbacks.c992
-rw-r--r--src/others/mimesh/libg3d-0.0.8/plugins/import/imp_3ds/imp_3ds_callbacks.h56
-rw-r--r--src/others/mimesh/libg3d-0.0.8/plugins/import/imp_3ds/imp_3ds_chunks.h210
8 files changed, 2564 insertions, 0 deletions
diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_3ds/Makefile b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_3ds/Makefile
new file mode 100644
index 0000000..5fba831
--- /dev/null
+++ b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_3ds/Makefile
@@ -0,0 +1,512 @@
1# Makefile.in generated by automake 1.10.1 from Makefile.am.
2# plugins/import/imp_3ds/Makefile. Generated from Makefile.in by configure.
3
4# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
5# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
6# This Makefile.in is free software; the Free Software Foundation
7# gives unlimited permission to copy and/or distribute it,
8# with or without modifications, as long as this notice is preserved.
9
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
12# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13# PARTICULAR PURPOSE.
14
15
16
17
18pkgdatadir = $(datadir)/libg3d
19pkglibdir = $(libdir)/libg3d
20pkgincludedir = $(includedir)/libg3d
21am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
22install_sh_DATA = $(install_sh) -c -m 644
23install_sh_PROGRAM = $(install_sh) -c
24install_sh_SCRIPT = $(install_sh) -c
25INSTALL_HEADER = $(INSTALL_DATA)
26transform = $(program_transform_name)
27NORMAL_INSTALL = :
28PRE_INSTALL = :
29POST_INSTALL = :
30NORMAL_UNINSTALL = :
31PRE_UNINSTALL = :
32POST_UNINSTALL = :
33build_triplet = x86_64-unknown-linux-gnu
34host_triplet = x86_64-unknown-linux-gnu
35subdir = plugins/import/imp_3ds
36DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
37ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
38am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
39 $(top_srcdir)/m4/glib-2.0.m4 $(top_srcdir)/m4/gtk-2.0.m4 \
40 $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/libtool.m4 \
41 $(top_srcdir)/m4/libxml2.m4 $(top_srcdir)/m4/win32.m4 \
42 $(top_srcdir)/configure.in
43am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
44 $(ACLOCAL_M4)
45mkinstalldirs = $(install_sh) -d
46CONFIG_HEADER = $(top_builddir)/include/g3d/config.h
47CONFIG_CLEAN_FILES =
48am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
49am__vpath_adj = case $$p in \
50 $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
51 *) f=$$p;; \
52 esac;
53am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
54am__installdirs = "$(DESTDIR)$(pluginimpdir)"
55pluginimpLTLIBRARIES_INSTALL = $(INSTALL)
56LTLIBRARIES = $(pluginimp_LTLIBRARIES)
57imp_3ds_la_DEPENDENCIES = $(top_builddir)/src/libg3d.la
58am_imp_3ds_la_OBJECTS = imp_3ds.lo imp_3ds_callbacks.lo
59imp_3ds_la_OBJECTS = $(am_imp_3ds_la_OBJECTS)
60DEFAULT_INCLUDES = -I. -I$(top_builddir)/include/g3d
61depcomp = $(SHELL) $(top_srcdir)/config/depcomp
62am__depfiles_maybe = depfiles
63COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
64 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
65LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
66 --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
67 $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
68CCLD = $(CC)
69LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
70 --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
71 $(LDFLAGS) -o $@
72SOURCES = $(imp_3ds_la_SOURCES)
73DIST_SOURCES = $(imp_3ds_la_SOURCES)
74ETAGS = etags
75CTAGS = ctags
76DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
77ACLOCAL = ${SHELL} /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/config/missing --run aclocal-1.10
78AMTAR = ${SHELL} /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/config/missing --run tar
79AR = ar
80AS = as
81AUTOCONF = ${SHELL} /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/config/missing --run autoconf
82AUTOHEADER = ${SHELL} /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/config/missing --run autoheader
83AUTOMAKE = ${SHELL} /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/config/missing --run automake-1.10
84AWK = gawk
85CC = gcc
86CCDEPMODE = depmode=gcc3
87CFLAGS = -g -O2
88CPP = gcc -E
89CPPFLAGS =
90CXX = g++
91CXXCPP = g++ -E
92CXXDEPMODE = depmode=gcc3
93CXXFLAGS = -g -O2
94CYGPATH_W = echo
95DBG_CFLAGS = -O2
96DEBUG = 0
97DEFS = -DHAVE_CONFIG_H
98DEPDIR = .deps
99DLLTOOL = dlltool
100ECHO = echo
101ECHO_C =
102ECHO_N = -n
103ECHO_T =
104EGREP = /bin/grep -E
105EXEEXT =
106F77 =
107FFLAGS =
108GDKPIXBUF_CFLAGS = -pthread -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12
109GDKPIXBUF_LIBS = -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lglib-2.0
110GLIB_CFLAGS = -pthread -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include
111GLIB_GENMARSHAL = glib-genmarshal
112GLIB_LIBS = -Wl,--export-dynamic -pthread -lgmodule-2.0 -lrt -lgobject-2.0 -lglib-2.0
113GLIB_MKENUMS = glib-mkenums
114GOBJECT_QUERY = gobject-query
115GREP = /bin/grep
116GTKDOC_CHECK = /usr/bin/gtkdoc-check
117GTK_CFLAGS = -pthread -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12
118GTK_LIBS = -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lglib-2.0
119HTML_DIR = ${datadir}/gtk-doc/html
120INSTALL = /usr/bin/install -c
121INSTALL_DATA = ${INSTALL} -m 644
122INSTALL_PROGRAM = ${INSTALL}
123INSTALL_SCRIPT = ${INSTALL}
124INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
125LDFLAGS =
126LEX = flex
127LEXLIB = -lfl
128LEX_OUTPUT_ROOT = lex.yy
129LIBGSF_CFLAGS = -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/libxml2 -I/usr/include/libgsf-1
130LIBGSF_LIBS = -lgsf-1 -lgobject-2.0 -lxml2 -lglib-2.0
131LIBOBJS =
132LIBS = -lm
133LIBTOOL = $(SHELL) $(top_builddir)/libtool --quiet
134LIBXML2_CFLAGS = -I/usr/include/libxml2
135LIBXML2_LIBS = -L/usr/lib/x86_64-linux-gnu -lxml2
136LN_S = ln -s
137LTLIBOBJS =
138LTVERSION = 0:8:0
139MAGIC_LIBS = -lmagic
140MAKEINFO = ${SHELL} /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/config/missing --run makeinfo
141MATH_LIBS = -lm
142MKDIR_P = /bin/mkdir -p
143OBJDUMP = objdump
144OBJEXT = o
145PACKAGE = libg3d
146PACKAGE_BUGREPORT =
147PACKAGE_NAME =
148PACKAGE_STRING =
149PACKAGE_TARNAME =
150PACKAGE_VERSION =
151PATH_SEPARATOR = :
152PKG_CONFIG = /usr/bin/pkg-config
153PLUGINS_LDFLAGS = -avoid-version -export-dynamic
154RANLIB = ranlib
155SET_MAKE =
156SHELL = /bin/bash
157STRIP = strip
158VERSION = 0.0.8
159XML2_CONFIG = /usr/bin/xml2-config
160XML_CPPFLAGS = -I/usr/include/libxml2
161XML_LIBS = -L/usr/lib/x86_64-linux-gnu -lxml2
162Z_CFLAGS =
163Z_LIBS = -lz
164abs_builddir = /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_3ds
165abs_srcdir = /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_3ds
166abs_top_builddir = /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8
167abs_top_srcdir = /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8
168ac_ct_CC = gcc
169ac_ct_CXX = g++
170ac_ct_F77 =
171am__include = include
172am__leading_dot = .
173am__quote =
174am__tar = ${AMTAR} chof - "$$tardir"
175am__untar = ${AMTAR} xf -
176bindir = ${exec_prefix}/bin
177build = x86_64-unknown-linux-gnu
178build_alias =
179build_cpu = x86_64
180build_os = linux-gnu
181build_vendor = unknown
182builddir = .
183datadir = ${datarootdir}
184datarootdir = ${prefix}/share
185docdir = ${datarootdir}/doc/${PACKAGE}
186dvidir = ${docdir}
187exec_prefix = ${prefix}
188host = x86_64-unknown-linux-gnu
189host_alias =
190host_cpu = x86_64
191host_os = linux-gnu
192host_vendor = unknown
193htmldir = ${docdir}
194includedir = ${prefix}/include
195infodir = ${datarootdir}/info
196install_sh = $(SHELL) /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/config/install-sh
197libdir = ${exec_prefix}/lib
198libexecdir = ${exec_prefix}/libexec
199localedir = ${datarootdir}/locale
200localstatedir = ${prefix}/var
201mandir = ${datarootdir}/man
202mkdir_p = /bin/mkdir -p
203oldincludedir = /usr/include
204pdfdir = ${docdir}
205prefix = /usr/local
206program_transform_name = s,x,x,
207psdir = ${docdir}
208sbindir = ${exec_prefix}/sbin
209sharedstatedir = ${prefix}/com
210srcdir = .
211sysconfdir = ${prefix}/etc
212target_alias =
213top_builddir = ../../..
214top_srcdir = ../../..
215pluginimpdir = $(pkglibdir)/plugins/import
216pluginimp_LTLIBRARIES = imp_3ds.la
217AM_CFLAGS = \
218 -Wall -ansi -pedantic \
219 -DG_LOG_DOMAIN=\"LibG3D\" \
220 -O2 -DDEBUG=0 \
221 -pthread -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include
222
223INCLUDES = -I$(top_srcdir)/include
224AM_LDFLAGS = \
225 -no-undefined -module \
226 -avoid-version -export-dynamic
227
228imp_3ds_la_SOURCES = imp_3ds.c imp_3ds.h imp_3ds_chunks.h \
229 imp_3ds_callbacks.c imp_3ds_callbacks.h
230
231imp_3ds_la_LIBADD = $(top_builddir)/src/libg3d.la -Wl,--export-dynamic -pthread -lgmodule-2.0 -lrt -lgobject-2.0 -lglib-2.0
232all: all-am
233
234.SUFFIXES:
235.SUFFIXES: .c .lo .o .obj
236$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
237 @for dep in $?; do \
238 case '$(am__configure_deps)' in \
239 *$$dep*) \
240 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
241 && exit 0; \
242 exit 1;; \
243 esac; \
244 done; \
245 echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/import/imp_3ds/Makefile'; \
246 cd $(top_srcdir) && \
247 $(AUTOMAKE) --gnu plugins/import/imp_3ds/Makefile
248.PRECIOUS: Makefile
249Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
250 @case '$?' in \
251 *config.status*) \
252 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
253 *) \
254 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
255 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
256 esac;
257
258$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
259 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
260
261$(top_srcdir)/configure: $(am__configure_deps)
262 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
263$(ACLOCAL_M4): $(am__aclocal_m4_deps)
264 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
265install-pluginimpLTLIBRARIES: $(pluginimp_LTLIBRARIES)
266 @$(NORMAL_INSTALL)
267 test -z "$(pluginimpdir)" || $(MKDIR_P) "$(DESTDIR)$(pluginimpdir)"
268 @list='$(pluginimp_LTLIBRARIES)'; for p in $$list; do \
269 if test -f $$p; then \
270 f=$(am__strip_dir) \
271 echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(pluginimpLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(pluginimpdir)/$$f'"; \
272 $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(pluginimpLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(pluginimpdir)/$$f"; \
273 else :; fi; \
274 done
275
276uninstall-pluginimpLTLIBRARIES:
277 @$(NORMAL_UNINSTALL)
278 @list='$(pluginimp_LTLIBRARIES)'; for p in $$list; do \
279 p=$(am__strip_dir) \
280 echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pluginimpdir)/$$p'"; \
281 $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pluginimpdir)/$$p"; \
282 done
283
284clean-pluginimpLTLIBRARIES:
285 -test -z "$(pluginimp_LTLIBRARIES)" || rm -f $(pluginimp_LTLIBRARIES)
286 @list='$(pluginimp_LTLIBRARIES)'; for p in $$list; do \
287 dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
288 test "$$dir" != "$$p" || dir=.; \
289 echo "rm -f \"$${dir}/so_locations\""; \
290 rm -f "$${dir}/so_locations"; \
291 done
292imp_3ds.la: $(imp_3ds_la_OBJECTS) $(imp_3ds_la_DEPENDENCIES)
293 $(LINK) -rpath $(pluginimpdir) $(imp_3ds_la_OBJECTS) $(imp_3ds_la_LIBADD) $(LIBS)
294
295mostlyclean-compile:
296 -rm -f *.$(OBJEXT)
297
298distclean-compile:
299 -rm -f *.tab.c
300
301include ./$(DEPDIR)/imp_3ds.Plo
302include ./$(DEPDIR)/imp_3ds_callbacks.Plo
303
304.c.o:
305 $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
306 mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
307# source='$<' object='$@' libtool=no \
308# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
309# $(COMPILE) -c $<
310
311.c.obj:
312 $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
313 mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
314# source='$<' object='$@' libtool=no \
315# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
316# $(COMPILE) -c `$(CYGPATH_W) '$<'`
317
318.c.lo:
319 $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
320 mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
321# source='$<' object='$@' libtool=yes \
322# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
323# $(LTCOMPILE) -c -o $@ $<
324
325mostlyclean-libtool:
326 -rm -f *.lo
327
328clean-libtool:
329 -rm -rf .libs _libs
330
331ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
332 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
333 unique=`for i in $$list; do \
334 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
335 done | \
336 $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
337 END { if (nonempty) { for (i in files) print i; }; }'`; \
338 mkid -fID $$unique
339tags: TAGS
340
341TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
342 $(TAGS_FILES) $(LISP)
343 tags=; \
344 here=`pwd`; \
345 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
346 unique=`for i in $$list; do \
347 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
348 done | \
349 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
350 END { if (nonempty) { for (i in files) print i; }; }'`; \
351 if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
352 test -n "$$unique" || unique=$$empty_fix; \
353 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
354 $$tags $$unique; \
355 fi
356ctags: CTAGS
357CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
358 $(TAGS_FILES) $(LISP)
359 tags=; \
360 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
361 unique=`for i in $$list; do \
362 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
363 done | \
364 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
365 END { if (nonempty) { for (i in files) print i; }; }'`; \
366 test -z "$(CTAGS_ARGS)$$tags$$unique" \
367 || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
368 $$tags $$unique
369
370GTAGS:
371 here=`$(am__cd) $(top_builddir) && pwd` \
372 && cd $(top_srcdir) \
373 && gtags -i $(GTAGS_ARGS) $$here
374
375distclean-tags:
376 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
377
378distdir: $(DISTFILES)
379 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
380 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
381 list='$(DISTFILES)'; \
382 dist_files=`for file in $$list; do echo $$file; done | \
383 sed -e "s|^$$srcdirstrip/||;t" \
384 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
385 case $$dist_files in \
386 */*) $(MKDIR_P) `echo "$$dist_files" | \
387 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
388 sort -u` ;; \
389 esac; \
390 for file in $$dist_files; do \
391 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
392 if test -d $$d/$$file; then \
393 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
394 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
395 cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
396 fi; \
397 cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
398 else \
399 test -f $(distdir)/$$file \
400 || cp -p $$d/$$file $(distdir)/$$file \
401 || exit 1; \
402 fi; \
403 done
404check-am: all-am
405check: check-am
406all-am: Makefile $(LTLIBRARIES)
407installdirs:
408 for dir in "$(DESTDIR)$(pluginimpdir)"; do \
409 test -z "$$dir" || $(MKDIR_P) "$$dir"; \
410 done
411install: install-am
412install-exec: install-exec-am
413install-data: install-data-am
414uninstall: uninstall-am
415
416install-am: all-am
417 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
418
419installcheck: installcheck-am
420install-strip:
421 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
422 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
423 `test -z '$(STRIP)' || \
424 echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
425mostlyclean-generic:
426
427clean-generic:
428
429distclean-generic:
430 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
431
432maintainer-clean-generic:
433 @echo "This command is intended for maintainers to use"
434 @echo "it deletes files that may require special tools to rebuild."
435clean: clean-am
436
437clean-am: clean-generic clean-libtool clean-pluginimpLTLIBRARIES \
438 mostlyclean-am
439
440distclean: distclean-am
441 -rm -rf ./$(DEPDIR)
442 -rm -f Makefile
443distclean-am: clean-am distclean-compile distclean-generic \
444 distclean-tags
445
446dvi: dvi-am
447
448dvi-am:
449
450html: html-am
451
452info: info-am
453
454info-am:
455
456install-data-am: install-pluginimpLTLIBRARIES
457
458install-dvi: install-dvi-am
459
460install-exec-am:
461
462install-html: install-html-am
463
464install-info: install-info-am
465
466install-man:
467
468install-pdf: install-pdf-am
469
470install-ps: install-ps-am
471
472installcheck-am:
473
474maintainer-clean: maintainer-clean-am
475 -rm -rf ./$(DEPDIR)
476 -rm -f Makefile
477maintainer-clean-am: distclean-am maintainer-clean-generic
478
479mostlyclean: mostlyclean-am
480
481mostlyclean-am: mostlyclean-compile mostlyclean-generic \
482 mostlyclean-libtool
483
484pdf: pdf-am
485
486pdf-am:
487
488ps: ps-am
489
490ps-am:
491
492uninstall-am: uninstall-pluginimpLTLIBRARIES
493
494.MAKE: install-am install-strip
495
496.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
497 clean-libtool clean-pluginimpLTLIBRARIES ctags distclean \
498 distclean-compile distclean-generic distclean-libtool \
499 distclean-tags distdir dvi dvi-am html html-am info info-am \
500 install install-am install-data install-data-am install-dvi \
501 install-dvi-am install-exec install-exec-am install-html \
502 install-html-am install-info install-info-am install-man \
503 install-pdf install-pdf-am install-pluginimpLTLIBRARIES \
504 install-ps install-ps-am install-strip installcheck \
505 installcheck-am installdirs maintainer-clean \
506 maintainer-clean-generic mostlyclean mostlyclean-compile \
507 mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
508 tags uninstall uninstall-am uninstall-pluginimpLTLIBRARIES
509
510# Tell versions [3.59,3.63) of GNU make to not export all variables.
511# Otherwise a system limit (for SysV at least) may be exceeded.
512.NOEXPORT:
diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_3ds/Makefile.am b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_3ds/Makefile.am
new file mode 100644
index 0000000..b18ad09
--- /dev/null
+++ b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_3ds/Makefile.am
@@ -0,0 +1,21 @@
1pluginimpdir = $(pkglibdir)/plugins/import
2
3pluginimp_LTLIBRARIES = imp_3ds.la
4
5AM_CFLAGS = \
6 -Wall -ansi -pedantic \
7 -DG_LOG_DOMAIN=\"LibG3D\" \
8 @DBG_CFLAGS@ -DDEBUG=@DEBUG@ \
9 @GLIB_CFLAGS@
10
11INCLUDES = -I$(top_srcdir)/include
12
13AM_LDFLAGS = \
14 -no-undefined -module \
15 @PLUGINS_LDFLAGS@
16
17LIBTOOL += --quiet
18
19imp_3ds_la_SOURCES = imp_3ds.c imp_3ds.h imp_3ds_chunks.h \
20 imp_3ds_callbacks.c imp_3ds_callbacks.h
21imp_3ds_la_LIBADD = $(top_builddir)/src/libg3d.la @GLIB_LIBS@
diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_3ds/Makefile.in b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_3ds/Makefile.in
new file mode 100644
index 0000000..a48d289
--- /dev/null
+++ b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_3ds/Makefile.in
@@ -0,0 +1,512 @@
1# Makefile.in generated by automake 1.10.1 from Makefile.am.
2# @configure_input@
3
4# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
5# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
6# This Makefile.in is free software; the Free Software Foundation
7# gives unlimited permission to copy and/or distribute it,
8# with or without modifications, as long as this notice is preserved.
9
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
12# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13# PARTICULAR PURPOSE.
14
15@SET_MAKE@
16
17VPATH = @srcdir@
18pkgdatadir = $(datadir)/@PACKAGE@
19pkglibdir = $(libdir)/@PACKAGE@
20pkgincludedir = $(includedir)/@PACKAGE@
21am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
22install_sh_DATA = $(install_sh) -c -m 644
23install_sh_PROGRAM = $(install_sh) -c
24install_sh_SCRIPT = $(install_sh) -c
25INSTALL_HEADER = $(INSTALL_DATA)
26transform = $(program_transform_name)
27NORMAL_INSTALL = :
28PRE_INSTALL = :
29POST_INSTALL = :
30NORMAL_UNINSTALL = :
31PRE_UNINSTALL = :
32POST_UNINSTALL = :
33build_triplet = @build@
34host_triplet = @host@
35subdir = plugins/import/imp_3ds
36DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
37ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
38am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
39 $(top_srcdir)/m4/glib-2.0.m4 $(top_srcdir)/m4/gtk-2.0.m4 \
40 $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/libtool.m4 \
41 $(top_srcdir)/m4/libxml2.m4 $(top_srcdir)/m4/win32.m4 \
42 $(top_srcdir)/configure.in
43am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
44 $(ACLOCAL_M4)
45mkinstalldirs = $(install_sh) -d
46CONFIG_HEADER = $(top_builddir)/include/g3d/config.h
47CONFIG_CLEAN_FILES =
48am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
49am__vpath_adj = case $$p in \
50 $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
51 *) f=$$p;; \
52 esac;
53am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
54am__installdirs = "$(DESTDIR)$(pluginimpdir)"
55pluginimpLTLIBRARIES_INSTALL = $(INSTALL)
56LTLIBRARIES = $(pluginimp_LTLIBRARIES)
57imp_3ds_la_DEPENDENCIES = $(top_builddir)/src/libg3d.la
58am_imp_3ds_la_OBJECTS = imp_3ds.lo imp_3ds_callbacks.lo
59imp_3ds_la_OBJECTS = $(am_imp_3ds_la_OBJECTS)
60DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include/g3d
61depcomp = $(SHELL) $(top_srcdir)/config/depcomp
62am__depfiles_maybe = depfiles
63COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
64 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
65LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
66 --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
67 $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
68CCLD = $(CC)
69LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
70 --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
71 $(LDFLAGS) -o $@
72SOURCES = $(imp_3ds_la_SOURCES)
73DIST_SOURCES = $(imp_3ds_la_SOURCES)
74ETAGS = etags
75CTAGS = ctags
76DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
77ACLOCAL = @ACLOCAL@
78AMTAR = @AMTAR@
79AR = @AR@
80AS = @AS@
81AUTOCONF = @AUTOCONF@
82AUTOHEADER = @AUTOHEADER@
83AUTOMAKE = @AUTOMAKE@
84AWK = @AWK@
85CC = @CC@
86CCDEPMODE = @CCDEPMODE@
87CFLAGS = @CFLAGS@
88CPP = @CPP@
89CPPFLAGS = @CPPFLAGS@
90CXX = @CXX@
91CXXCPP = @CXXCPP@
92CXXDEPMODE = @CXXDEPMODE@
93CXXFLAGS = @CXXFLAGS@
94CYGPATH_W = @CYGPATH_W@
95DBG_CFLAGS = @DBG_CFLAGS@
96DEBUG = @DEBUG@
97DEFS = @DEFS@
98DEPDIR = @DEPDIR@
99DLLTOOL = @DLLTOOL@
100ECHO = @ECHO@
101ECHO_C = @ECHO_C@
102ECHO_N = @ECHO_N@
103ECHO_T = @ECHO_T@
104EGREP = @EGREP@
105EXEEXT = @EXEEXT@
106F77 = @F77@
107FFLAGS = @FFLAGS@
108GDKPIXBUF_CFLAGS = @GDKPIXBUF_CFLAGS@
109GDKPIXBUF_LIBS = @GDKPIXBUF_LIBS@
110GLIB_CFLAGS = @GLIB_CFLAGS@
111GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
112GLIB_LIBS = @GLIB_LIBS@
113GLIB_MKENUMS = @GLIB_MKENUMS@
114GOBJECT_QUERY = @GOBJECT_QUERY@
115GREP = @GREP@
116GTKDOC_CHECK = @GTKDOC_CHECK@
117GTK_CFLAGS = @GTK_CFLAGS@
118GTK_LIBS = @GTK_LIBS@
119HTML_DIR = @HTML_DIR@
120INSTALL = @INSTALL@
121INSTALL_DATA = @INSTALL_DATA@
122INSTALL_PROGRAM = @INSTALL_PROGRAM@
123INSTALL_SCRIPT = @INSTALL_SCRIPT@
124INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
125LDFLAGS = @LDFLAGS@
126LEX = @LEX@
127LEXLIB = @LEXLIB@
128LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
129LIBGSF_CFLAGS = @LIBGSF_CFLAGS@
130LIBGSF_LIBS = @LIBGSF_LIBS@
131LIBOBJS = @LIBOBJS@
132LIBS = @LIBS@
133LIBTOOL = @LIBTOOL@ --quiet
134LIBXML2_CFLAGS = @LIBXML2_CFLAGS@
135LIBXML2_LIBS = @LIBXML2_LIBS@
136LN_S = @LN_S@
137LTLIBOBJS = @LTLIBOBJS@
138LTVERSION = @LTVERSION@
139MAGIC_LIBS = @MAGIC_LIBS@
140MAKEINFO = @MAKEINFO@
141MATH_LIBS = @MATH_LIBS@
142MKDIR_P = @MKDIR_P@
143OBJDUMP = @OBJDUMP@
144OBJEXT = @OBJEXT@
145PACKAGE = @PACKAGE@
146PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
147PACKAGE_NAME = @PACKAGE_NAME@
148PACKAGE_STRING = @PACKAGE_STRING@
149PACKAGE_TARNAME = @PACKAGE_TARNAME@
150PACKAGE_VERSION = @PACKAGE_VERSION@
151PATH_SEPARATOR = @PATH_SEPARATOR@
152PKG_CONFIG = @PKG_CONFIG@
153PLUGINS_LDFLAGS = @PLUGINS_LDFLAGS@
154RANLIB = @RANLIB@
155SET_MAKE = @SET_MAKE@
156SHELL = @SHELL@
157STRIP = @STRIP@
158VERSION = @VERSION@
159XML2_CONFIG = @XML2_CONFIG@
160XML_CPPFLAGS = @XML_CPPFLAGS@
161XML_LIBS = @XML_LIBS@
162Z_CFLAGS = @Z_CFLAGS@
163Z_LIBS = @Z_LIBS@
164abs_builddir = @abs_builddir@
165abs_srcdir = @abs_srcdir@
166abs_top_builddir = @abs_top_builddir@
167abs_top_srcdir = @abs_top_srcdir@
168ac_ct_CC = @ac_ct_CC@
169ac_ct_CXX = @ac_ct_CXX@
170ac_ct_F77 = @ac_ct_F77@
171am__include = @am__include@
172am__leading_dot = @am__leading_dot@
173am__quote = @am__quote@
174am__tar = @am__tar@
175am__untar = @am__untar@
176bindir = @bindir@
177build = @build@
178build_alias = @build_alias@
179build_cpu = @build_cpu@
180build_os = @build_os@
181build_vendor = @build_vendor@
182builddir = @builddir@
183datadir = @datadir@
184datarootdir = @datarootdir@
185docdir = @docdir@
186dvidir = @dvidir@
187exec_prefix = @exec_prefix@
188host = @host@
189host_alias = @host_alias@
190host_cpu = @host_cpu@
191host_os = @host_os@
192host_vendor = @host_vendor@
193htmldir = @htmldir@
194includedir = @includedir@
195infodir = @infodir@
196install_sh = @install_sh@
197libdir = @libdir@
198libexecdir = @libexecdir@
199localedir = @localedir@
200localstatedir = @localstatedir@
201mandir = @mandir@
202mkdir_p = @mkdir_p@
203oldincludedir = @oldincludedir@
204pdfdir = @pdfdir@
205prefix = @prefix@
206program_transform_name = @program_transform_name@
207psdir = @psdir@
208sbindir = @sbindir@
209sharedstatedir = @sharedstatedir@
210srcdir = @srcdir@
211sysconfdir = @sysconfdir@
212target_alias = @target_alias@
213top_builddir = @top_builddir@
214top_srcdir = @top_srcdir@
215pluginimpdir = $(pkglibdir)/plugins/import
216pluginimp_LTLIBRARIES = imp_3ds.la
217AM_CFLAGS = \
218 -Wall -ansi -pedantic \
219 -DG_LOG_DOMAIN=\"LibG3D\" \
220 @DBG_CFLAGS@ -DDEBUG=@DEBUG@ \
221 @GLIB_CFLAGS@
222
223INCLUDES = -I$(top_srcdir)/include
224AM_LDFLAGS = \
225 -no-undefined -module \
226 @PLUGINS_LDFLAGS@
227
228imp_3ds_la_SOURCES = imp_3ds.c imp_3ds.h imp_3ds_chunks.h \
229 imp_3ds_callbacks.c imp_3ds_callbacks.h
230
231imp_3ds_la_LIBADD = $(top_builddir)/src/libg3d.la @GLIB_LIBS@
232all: all-am
233
234.SUFFIXES:
235.SUFFIXES: .c .lo .o .obj
236$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
237 @for dep in $?; do \
238 case '$(am__configure_deps)' in \
239 *$$dep*) \
240 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
241 && exit 0; \
242 exit 1;; \
243 esac; \
244 done; \
245 echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/import/imp_3ds/Makefile'; \
246 cd $(top_srcdir) && \
247 $(AUTOMAKE) --gnu plugins/import/imp_3ds/Makefile
248.PRECIOUS: Makefile
249Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
250 @case '$?' in \
251 *config.status*) \
252 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
253 *) \
254 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
255 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
256 esac;
257
258$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
259 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
260
261$(top_srcdir)/configure: $(am__configure_deps)
262 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
263$(ACLOCAL_M4): $(am__aclocal_m4_deps)
264 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
265install-pluginimpLTLIBRARIES: $(pluginimp_LTLIBRARIES)
266 @$(NORMAL_INSTALL)
267 test -z "$(pluginimpdir)" || $(MKDIR_P) "$(DESTDIR)$(pluginimpdir)"
268 @list='$(pluginimp_LTLIBRARIES)'; for p in $$list; do \
269 if test -f $$p; then \
270 f=$(am__strip_dir) \
271 echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(pluginimpLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(pluginimpdir)/$$f'"; \
272 $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(pluginimpLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(pluginimpdir)/$$f"; \
273 else :; fi; \
274 done
275
276uninstall-pluginimpLTLIBRARIES:
277 @$(NORMAL_UNINSTALL)
278 @list='$(pluginimp_LTLIBRARIES)'; for p in $$list; do \
279 p=$(am__strip_dir) \
280 echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pluginimpdir)/$$p'"; \
281 $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pluginimpdir)/$$p"; \
282 done
283
284clean-pluginimpLTLIBRARIES:
285 -test -z "$(pluginimp_LTLIBRARIES)" || rm -f $(pluginimp_LTLIBRARIES)
286 @list='$(pluginimp_LTLIBRARIES)'; for p in $$list; do \
287 dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
288 test "$$dir" != "$$p" || dir=.; \
289 echo "rm -f \"$${dir}/so_locations\""; \
290 rm -f "$${dir}/so_locations"; \
291 done
292imp_3ds.la: $(imp_3ds_la_OBJECTS) $(imp_3ds_la_DEPENDENCIES)
293 $(LINK) -rpath $(pluginimpdir) $(imp_3ds_la_OBJECTS) $(imp_3ds_la_LIBADD) $(LIBS)
294
295mostlyclean-compile:
296 -rm -f *.$(OBJEXT)
297
298distclean-compile:
299 -rm -f *.tab.c
300
301@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imp_3ds.Plo@am__quote@
302@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imp_3ds_callbacks.Plo@am__quote@
303
304.c.o:
305@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
306@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
307@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
308@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
309@am__fastdepCC_FALSE@ $(COMPILE) -c $<
310
311.c.obj:
312@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
313@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
314@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
315@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
316@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
317
318.c.lo:
319@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
320@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
321@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
322@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
323@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
324
325mostlyclean-libtool:
326 -rm -f *.lo
327
328clean-libtool:
329 -rm -rf .libs _libs
330
331ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
332 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
333 unique=`for i in $$list; do \
334 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
335 done | \
336 $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
337 END { if (nonempty) { for (i in files) print i; }; }'`; \
338 mkid -fID $$unique
339tags: TAGS
340
341TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
342 $(TAGS_FILES) $(LISP)
343 tags=; \
344 here=`pwd`; \
345 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
346 unique=`for i in $$list; do \
347 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
348 done | \
349 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
350 END { if (nonempty) { for (i in files) print i; }; }'`; \
351 if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
352 test -n "$$unique" || unique=$$empty_fix; \
353 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
354 $$tags $$unique; \
355 fi
356ctags: CTAGS
357CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
358 $(TAGS_FILES) $(LISP)
359 tags=; \
360 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
361 unique=`for i in $$list; do \
362 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
363 done | \
364 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
365 END { if (nonempty) { for (i in files) print i; }; }'`; \
366 test -z "$(CTAGS_ARGS)$$tags$$unique" \
367 || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
368 $$tags $$unique
369
370GTAGS:
371 here=`$(am__cd) $(top_builddir) && pwd` \
372 && cd $(top_srcdir) \
373 && gtags -i $(GTAGS_ARGS) $$here
374
375distclean-tags:
376 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
377
378distdir: $(DISTFILES)
379 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
380 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
381 list='$(DISTFILES)'; \
382 dist_files=`for file in $$list; do echo $$file; done | \
383 sed -e "s|^$$srcdirstrip/||;t" \
384 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
385 case $$dist_files in \
386 */*) $(MKDIR_P) `echo "$$dist_files" | \
387 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
388 sort -u` ;; \
389 esac; \
390 for file in $$dist_files; do \
391 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
392 if test -d $$d/$$file; then \
393 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
394 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
395 cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
396 fi; \
397 cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
398 else \
399 test -f $(distdir)/$$file \
400 || cp -p $$d/$$file $(distdir)/$$file \
401 || exit 1; \
402 fi; \
403 done
404check-am: all-am
405check: check-am
406all-am: Makefile $(LTLIBRARIES)
407installdirs:
408 for dir in "$(DESTDIR)$(pluginimpdir)"; do \
409 test -z "$$dir" || $(MKDIR_P) "$$dir"; \
410 done
411install: install-am
412install-exec: install-exec-am
413install-data: install-data-am
414uninstall: uninstall-am
415
416install-am: all-am
417 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
418
419installcheck: installcheck-am
420install-strip:
421 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
422 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
423 `test -z '$(STRIP)' || \
424 echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
425mostlyclean-generic:
426
427clean-generic:
428
429distclean-generic:
430 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
431
432maintainer-clean-generic:
433 @echo "This command is intended for maintainers to use"
434 @echo "it deletes files that may require special tools to rebuild."
435clean: clean-am
436
437clean-am: clean-generic clean-libtool clean-pluginimpLTLIBRARIES \
438 mostlyclean-am
439
440distclean: distclean-am
441 -rm -rf ./$(DEPDIR)
442 -rm -f Makefile
443distclean-am: clean-am distclean-compile distclean-generic \
444 distclean-tags
445
446dvi: dvi-am
447
448dvi-am:
449
450html: html-am
451
452info: info-am
453
454info-am:
455
456install-data-am: install-pluginimpLTLIBRARIES
457
458install-dvi: install-dvi-am
459
460install-exec-am:
461
462install-html: install-html-am
463
464install-info: install-info-am
465
466install-man:
467
468install-pdf: install-pdf-am
469
470install-ps: install-ps-am
471
472installcheck-am:
473
474maintainer-clean: maintainer-clean-am
475 -rm -rf ./$(DEPDIR)
476 -rm -f Makefile
477maintainer-clean-am: distclean-am maintainer-clean-generic
478
479mostlyclean: mostlyclean-am
480
481mostlyclean-am: mostlyclean-compile mostlyclean-generic \
482 mostlyclean-libtool
483
484pdf: pdf-am
485
486pdf-am:
487
488ps: ps-am
489
490ps-am:
491
492uninstall-am: uninstall-pluginimpLTLIBRARIES
493
494.MAKE: install-am install-strip
495
496.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
497 clean-libtool clean-pluginimpLTLIBRARIES ctags distclean \
498 distclean-compile distclean-generic distclean-libtool \
499 distclean-tags distdir dvi dvi-am html html-am info info-am \
500 install install-am install-data install-data-am install-dvi \
501 install-dvi-am install-exec install-exec-am install-html \
502 install-html-am install-info install-info-am install-man \
503 install-pdf install-pdf-am install-pluginimpLTLIBRARIES \
504 install-ps install-ps-am install-strip installcheck \
505 installcheck-am installdirs maintainer-clean \
506 maintainer-clean-generic mostlyclean mostlyclean-compile \
507 mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
508 tags uninstall uninstall-am uninstall-pluginimpLTLIBRARIES
509
510# Tell versions [3.59,3.63) of GNU make to not export all variables.
511# Otherwise a system limit (for SysV at least) may be exceeded.
512.NOEXPORT:
diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_3ds/imp_3ds.c b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_3ds/imp_3ds.c
new file mode 100644
index 0000000..6125984
--- /dev/null
+++ b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_3ds/imp_3ds.c
@@ -0,0 +1,206 @@
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
23#include <stdio.h>
24#include <string.h>
25#include <stdarg.h>
26
27#include <g3d/types.h>
28#include <g3d/stream.h>
29#include <g3d/material.h>
30#include <g3d/texture.h>
31#include <g3d/matrix.h>
32
33#include "imp_3ds.h"
34#include "imp_3ds_chunks.h"
35
36/*****************************************************************************/
37/* plugin interface */
38/*****************************************************************************/
39
40EAPI
41gboolean plugin_load_model_from_stream(G3DContext *context, G3DStream *stream,
42 G3DModel *model, gpointer plugin_data)
43{
44 G3DMatrix rmatrix[16];
45 gint32 nbytes, magic;
46 gboolean retval;
47 x3ds_global_data global;
48 x3ds_parent_data *parent;
49
50 magic = g3d_stream_read_int16_le(stream);
51 if((magic != 0x4D4D) && (magic != 0xC23D))
52 {
53 g_warning("file %s is not a 3ds file", stream->uri);
54 return FALSE;
55 }
56 nbytes = g3d_stream_read_int32_le(stream);
57 nbytes -= 6;
58#if DEBUG > 0
59 g_debug("\\[%4.4X] 3DS file: main length: %d", magic, nbytes);
60#endif
61
62 global.context = context;
63 global.model = model;
64 global.stream = stream;
65 global.scale = 1.0;
66 global.max_tex_id = 0;
67
68 parent = g_new0(x3ds_parent_data, 1);
69 parent->id = magic;
70 parent->nb = nbytes;
71
72 retval = x3ds_read_ctnr(&global, parent);
73
74 g3d_matrix_identity(rmatrix);
75 g3d_matrix_rotate_xyz(G_PI * -90.0 / 180, 0.0, 0.0, rmatrix);
76 g3d_model_transform(model, rmatrix);
77
78 g_free(parent);
79
80 return retval;
81}
82
83EAPI
84gchar *plugin_description(void)
85{
86 return g_strdup("AutoCAD 3D Studio models.");
87}
88
89EAPI
90gchar **plugin_extensions(void)
91{
92 return g_strsplit("3ds:prj", ":", 0);
93}
94
95/*****************************************************************************/
96
97gboolean x3ds_read_ctnr(x3ds_global_data *global, x3ds_parent_data *parent)
98{
99 gint32 chunk_id, chunk_len, i;
100 x3ds_parent_data *subparent;
101 gpointer level_object;
102 gchar *padding = " ";
103
104 level_object = NULL;
105
106 while(parent->nb > 0) {
107 chunk_id = g3d_stream_read_int16_le(global->stream);
108 chunk_len = g3d_stream_read_int32_le(global->stream);
109 parent->nb -= 6;
110 chunk_len -= 6;
111
112 i = 0;
113 while((x3ds_chunks[i].id != 0) && (x3ds_chunks[i].id != chunk_id))
114 i ++;
115
116 if(x3ds_chunks[i].id == chunk_id) {
117 g_debug("\\%s(%d)[0x%04X][%c%c] %s (%d bytes)",
118 padding + (strlen(padding) - parent->level), parent->level,
119 chunk_id,
120 x3ds_chunks[i].container ? 'c' : ' ',
121 x3ds_chunks[i].callback ? 'f' : ' ',
122 x3ds_chunks[i].desc, chunk_len);
123 if (chunk_id==0) {
124 g_warning("error: bad chunk id");
125 return FALSE;
126 }
127
128 subparent = g_new0(x3ds_parent_data, 1);
129 subparent->id = parent->id;
130 subparent->object = parent->object;
131 subparent->level = parent->level + 1;
132 subparent->level_object = level_object;
133 subparent->nb = chunk_len;
134
135 if(x3ds_chunks[i].callback) {
136 /* callback may change "nb" and "object" of
137 * "subparent" structure for following container run */
138
139 x3ds_chunks[i].callback(global, subparent);
140 }
141
142 subparent->id = chunk_id;
143
144 if(x3ds_chunks[i].container) {
145 if(x3ds_read_ctnr(global, subparent) == FALSE) {
146 /* abort on error */
147 return FALSE;
148 }
149 }
150
151 if(subparent->nb)
152 g3d_stream_skip(global->stream, subparent->nb);
153
154 level_object = subparent->level_object;
155
156 g_free(subparent);
157 } else {
158 g_warning("[3DS] unknown chunk type 0x%04X", chunk_id);
159 g3d_stream_skip(global->stream, chunk_len);
160 }
161 parent->nb -= chunk_len;
162
163 /* update progress bar */
164 x3ds_update_progress(global, parent->level);
165 }
166
167 return TRUE;
168}
169
170void x3ds_update_progress(x3ds_global_data *global, guint32 level)
171{
172 goffset fpos;
173
174 /* update progress bar */
175 if(level < 4) {
176 fpos = g3d_stream_tell(global->stream);
177 g3d_context_update_progress_bar(global->context,
178 ((G3DFloat)fpos / (G3DFloat)g3d_stream_size(global->stream)), TRUE);
179 }
180}
181
182gint32 x3ds_read_cstr(G3DStream *stream, gchar *string)
183{
184 gint32 n = 0;
185 char c;
186 do {
187 c = g3d_stream_read_int8(stream);
188 string[n] = c;
189 n++;
190 } while(c != 0);
191 return n;
192}
193
194G3DObject *x3ds_newobject(G3DModel *model, const gchar *name)
195{
196 G3DObject *object = g_malloc0(sizeof(G3DObject));
197 G3DMaterial *material = g3d_material_new();
198
199 object->name = g_strdup(name);
200 object->faces = NULL;
201 model->objects = g_slist_append(model->objects, object);
202 object->materials = g_slist_append(object->materials, material);
203
204 return object;
205}
206
diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_3ds/imp_3ds.h b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_3ds/imp_3ds.h
new file mode 100644
index 0000000..80a2c8c
--- /dev/null
+++ b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_3ds/imp_3ds.h
@@ -0,0 +1,55 @@
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_3DS_H
23#define _IMP_3DS_H
24
25#include <stdio.h>
26#include <glib.h>
27#include <g3d/g3d.h>
28#include <g3d/stream.h>
29
30typedef struct {
31 G3DContext *context;
32 G3DModel *model;
33 G3DStream *stream;
34 G3DFloat scale;
35 gint32 max_tex_id;
36} x3ds_global_data;
37
38typedef struct {
39 gint32 id;
40 gpointer object;
41 gpointer misc_object;
42 gint32 level;
43 gpointer level_object;
44 guint32 nb;
45} x3ds_parent_data;
46
47typedef gboolean (* x3ds_callback)(x3ds_global_data *global,
48 x3ds_parent_data *parent);
49
50gboolean x3ds_read_ctnr(x3ds_global_data *global, x3ds_parent_data *parent);
51void x3ds_update_progress(x3ds_global_data *global, guint32 level);
52gint32 x3ds_read_cstr(G3DStream *stream, gchar *string);
53G3DObject *x3ds_newobject(G3DModel *model, const gchar *name);
54
55#endif /* _IMP_3DS_H */
diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_3ds/imp_3ds_callbacks.c b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_3ds/imp_3ds_callbacks.c
new file mode 100644
index 0000000..fdd9823
--- /dev/null
+++ b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_3ds/imp_3ds_callbacks.c
@@ -0,0 +1,992 @@
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#include <string.h>
23#include <math.h>
24
25#include <g3d/stream.h>
26#include <g3d/texture.h>
27#include <g3d/vector.h>
28#include <g3d/matrix.h>
29
30#include "imp_3ds_callbacks.h"
31
32#define X3DS_FLAG_TENSION 0x01
33#define X3DS_FLAG_CONTINUITY 0x02
34#define X3DS_FLAG_BIAS 0x04
35#define X3DS_FLAG_EASE_TO 0x08
36#define X3DS_FLAG_EASE_FROM 0x10
37
38gboolean x3ds_cb_0x0002(x3ds_global_data *global, x3ds_parent_data *parent)
39{
40 gint32 version;
41
42 version = g3d_stream_read_int32_le(global->stream);
43 parent->nb -= 4;
44#if DEBUG > 0
45 g_debug("[3DS] M3D version %d", version);
46#endif
47 return TRUE;
48}
49
50/* color float */
51gboolean x3ds_cb_0x0010(x3ds_global_data *global, x3ds_parent_data *parent)
52{
53 G3DMaterial *material;
54 G3DFloat r, g, b;
55
56 r = g3d_stream_read_float_le(global->stream);
57 g = g3d_stream_read_float_le(global->stream);
58 b = g3d_stream_read_float_le(global->stream);
59 parent->nb -= 12;
60
61 switch(parent->id)
62 {
63 case 0x1200: /* SOLID_BGND */
64 g3d_context_set_bgcolor(global->context, r, g, b, 1.0);
65 break;
66
67 case 0xA010: /* ambient color */
68 break;
69
70 case 0xA020: /* diffuse color */
71 material = (G3DMaterial *)parent->object;
72 g_return_val_if_fail(material, FALSE);
73
74 material->r = r;
75 material->g = g;
76 material->b = b;
77 break;
78
79 case 0xA030: /* specular color */
80 material = (G3DMaterial *)parent->object;
81 g_return_val_if_fail(material, FALSE);
82
83 material->specular[0] = r;
84 material->specular[1] = g;
85 material->specular[2] = b;
86 material->specular[3] = 0.25;
87 break;
88
89 default:
90#if DEBUG > 0
91 g_warning("[3DS] unhandled COLOR_F in 0x%04X", parent->id);
92#endif
93 break;
94 }
95
96 return TRUE;
97}
98
99/* color 24 */
100gboolean x3ds_cb_0x0011(x3ds_global_data *global, x3ds_parent_data *parent)
101{
102 G3DMaterial *material;
103 gint32 r, g, b;
104
105 material = (G3DMaterial *)parent->object;
106 g_return_val_if_fail(material, FALSE);
107
108 r = g3d_stream_read_int8(global->stream);
109 g = g3d_stream_read_int8(global->stream);
110 b = g3d_stream_read_int8(global->stream);
111 parent->nb -= 3;
112
113 switch(parent->id)
114 {
115
116 case 0xA010: /* ambient color */
117 break;
118
119 case 0xA020: /* diffuse color */
120 material->r = (G3DFloat)r / 255.0;
121 material->g = (G3DFloat)g / 255.0;
122 material->b = (G3DFloat)b / 255.0;
123 break;
124
125 case 0xA030: /* specular color */
126 material->specular[0] = (GLfloat)r / 255.0;
127 material->specular[1] = (GLfloat)g / 255.0;
128 material->specular[2] = (GLfloat)b / 255.0;
129 material->specular[3] = 0.25;
130 break;
131
132 default:
133#if DEBUG > 0
134 g_warning("[3DS] unhandled COLOR_24 in 0x%04X", parent->id);
135#endif
136 break;
137 }
138
139 return TRUE;
140}
141
142/* short percentage */
143gboolean x3ds_cb_0x0030(x3ds_global_data *global, x3ds_parent_data *parent)
144{
145 G3DMaterial *material;
146 gint32 percent;
147
148 material = (G3DMaterial *)parent->object;
149 g_return_val_if_fail(material, FALSE);
150
151 percent = g3d_stream_read_int16_le(global->stream);
152 parent->nb -= 2;
153
154 switch(parent->id)
155 {
156 case 0xA040: /* shininess */
157 material->shininess = (G3DFloat)percent / 100.0;
158 break;
159
160 case 0xA041: /* shininess (2) */
161 /* TODO: do something here? */
162 break;
163
164 case 0xA050: /* transparency */
165 material->a = 1.0 - ((G3DFloat)percent / 100.0);
166 break;
167
168 case 0xA052: /* fallthrough */
169 /* TODO: do something here? */
170 break;
171
172 case 0xA053: /* blur */
173 /* TODO: do something here? */
174 break;
175
176 case 0xA084: /* self illumination */
177 /* TODO: do something here? */
178 break;
179
180 case 0xA200: /* texture map */
181 /* TODO: do something here? */
182 break;
183
184 case 0xA210: /* opacity map */
185 /* TODO: do something here? */
186 g_debug("[3DS] opacity percentage: %d%%\n", percent);
187 break;
188
189 case 0xA220: /* reflection map */
190 /* TODO: do something here? */
191 break;
192
193 case 0xA230: /* bump map */
194 /* TODO: do something here? */
195 break;
196
197 default:
198#if DEBUG > 0
199 g_warning("[3DS] unhandled INT_PERCENTAGE in 0x%04X",
200 parent->id);
201#endif
202 break;
203 }
204
205 return TRUE;
206}
207
208/* float percentage */
209gboolean x3ds_cb_0x0031(x3ds_global_data *global, x3ds_parent_data *parent)
210{
211 G3DMaterial *material;
212 G3DFloat percent;
213
214 material = (G3DMaterial *)parent->object;
215 g_return_val_if_fail(material, FALSE);
216
217 percent = g3d_stream_read_float_le(global->stream);
218 parent->nb -= 4;
219
220 switch(parent->id)
221 {
222 case 0xA040: /* shininess */
223 material->shininess = percent;
224 break;
225
226 case 0xA050: /* transparency */
227 material->a = 1.0 - percent;
228 break;
229
230 default:
231#if DEBUG > 0
232 g_warning("[3DS] unhandled FLOAT_PERCENTAGE in 0x%04X",
233 parent->id);
234#endif
235 break;
236 }
237
238 return TRUE;
239}
240
241/* master scale */
242gboolean x3ds_cb_0x0100(x3ds_global_data *global, x3ds_parent_data *parent)
243{
244 global->scale = g3d_stream_read_float_le(global->stream);
245 parent->nb -= 4;
246
247 return TRUE;
248}
249
250/* named object */
251gboolean x3ds_cb_0x4000(x3ds_global_data *global, x3ds_parent_data *parent)
252{
253 gchar buffer[1024];
254
255 parent->nb -= x3ds_read_cstr(global->stream, buffer);
256 parent->object = x3ds_newobject(global->model, buffer);
257
258 return TRUE;
259}
260
261/* point array */
262gboolean x3ds_cb_0x4110(x3ds_global_data *global, x3ds_parent_data *parent)
263{
264 G3DObject *object;
265 gint32 i;
266
267 object = (G3DObject *)parent->object;
268 g_return_val_if_fail(object, FALSE);
269
270 object->vertex_count = g3d_stream_read_int16_le(global->stream);
271 parent->nb -= 2;
272
273 object->vertex_data = g_new0(G3DFloat, object->vertex_count * 3);
274 for(i = 0; i < object->vertex_count; i ++)
275 {
276 object->vertex_data[i * 3 + 0] = g3d_stream_read_float_le(global->stream);
277 object->vertex_data[i * 3 + 1] = g3d_stream_read_float_le(global->stream);
278 object->vertex_data[i * 3 + 2] = g3d_stream_read_float_le(global->stream);
279
280 parent->nb -= 12;
281
282 if((i % 1000) == 0) x3ds_update_progress(global, parent->level);
283 }
284 return TRUE;
285}
286
287/* face array */
288gboolean x3ds_cb_0x4120(x3ds_global_data *global, x3ds_parent_data *parent)
289{
290 gint32 i, flags, nfaces;
291#define X3DS_REORDER_FACES
292#ifdef X3DS_REORDER_FACES
293 gint32 p1 = -1, p2 = -1, bottle;
294#endif
295 G3DFace *face;
296 G3DObject *object;
297
298 object = (G3DObject *)parent->object;
299 g_return_val_if_fail(object, FALSE);
300
301 nfaces = g3d_stream_read_int16_le(global->stream);
302 parent->nb -= 2;
303
304 for(i = 0; i < nfaces; i ++)
305 {
306 face = g_new0(G3DFace, 1);
307
308 face->vertex_count = 3;
309 face->vertex_indices = g_malloc(3 * sizeof(guint32));
310
311 face->vertex_indices[0] = g3d_stream_read_int16_le(global->stream);
312 face->vertex_indices[1] = g3d_stream_read_int16_le(global->stream);
313 face->vertex_indices[2] = g3d_stream_read_int16_le(global->stream);
314 flags = g3d_stream_read_int16_le(global->stream);
315 parent->nb -= 8;
316
317#ifdef X3DS_REORDER_FACES
318 /* try to put all faces in the same direction */
319 if((p1 == face->vertex_indices[0]) && (p2 == face->vertex_indices[1]))
320 {
321 bottle = face->vertex_indices[0];
322 face->vertex_indices[0] = face->vertex_indices[2];
323 face->vertex_indices[2] = bottle;
324 }
325
326 p1 = face->vertex_indices[0];
327 p2 = face->vertex_indices[1];
328#endif
329
330 face->material = g_slist_nth_data(object->materials, 0);
331
332 object->faces = g_slist_append(object->faces, face);
333
334 if((i % 1000) == 0) x3ds_update_progress(global, parent->level);
335 }
336
337 return TRUE;
338}
339
340/* mesh mat group */
341gboolean x3ds_cb_0x4130(x3ds_global_data *global, x3ds_parent_data *parent)
342{
343 G3DObject *object;
344 gint32 i, j, facenum, nfaces;
345 gchar buffer[512];
346 G3DMaterial *material = NULL, *mat;
347 G3DFace *face;
348 GSList *mlist;
349
350 object = (G3DObject *)parent->object;
351 g_return_val_if_fail(object, FALSE);
352
353 /* name of material */
354 parent->nb -= x3ds_read_cstr(global->stream, buffer);
355
356 /* find material in list */
357 mlist = global->model->materials;
358 while(mlist != NULL)
359 {
360 mat = (G3DMaterial*)mlist->data;
361 if(strcmp(mat->name, buffer) == 0)
362 {
363 material = mat;
364 break;
365 }
366 mlist = mlist->next;
367 }
368
369 nfaces = g3d_stream_read_int16_le(global->stream);
370 parent->nb -= 2;
371
372 for(i = 0; i < nfaces; i ++)
373 {
374 facenum = g3d_stream_read_int16_le(global->stream);
375 parent->nb -= 2;
376
377 if(material != NULL)
378 {
379 face = (G3DFace*)g_slist_nth_data(object->faces, facenum);
380 if(face == NULL) continue;
381
382 face->material = material;
383
384 if(face->material->tex_image && object->tex_vertex_data)
385 {
386 face->flags |= G3D_FLAG_FAC_TEXMAP;
387 face->tex_image = face->material->tex_image;
388 face->tex_vertex_count = 3;
389 face->tex_vertex_data = g_new0(G3DFloat, 6);
390 for(j = 0; j < 3; j ++)
391 {
392 face->tex_vertex_data[j * 2 + 0] = object->tex_vertex_data[
393 face->vertex_indices[j] * 2 + 0];
394 face->tex_vertex_data[j * 2 + 1] = object->tex_vertex_data[
395 face->vertex_indices[j] * 2 + 1];
396 }
397 } /* textured face */
398 } /* material != NULL */
399
400 if((i % 1000) == 0) x3ds_update_progress(global, parent->level);
401 } /* 0..nfaces */
402
403 return TRUE;
404}
405
406/* texture vertices */
407gboolean x3ds_cb_0x4140(x3ds_global_data *global, x3ds_parent_data *parent)
408{
409 G3DObject *object;
410 gint32 i;
411
412 object = (G3DObject *)parent->object;
413 g_return_val_if_fail(object, FALSE);
414
415 object->tex_vertex_count = g3d_stream_read_int16_le(global->stream);
416 parent->nb -= 2;
417
418 object->tex_vertex_data = g_new0(G3DFloat, object->tex_vertex_count * 2);
419
420 for(i = 0; i < object->tex_vertex_count; i ++)
421 {
422 object->tex_vertex_data[i * 2 + 0] = g3d_stream_read_float_le(global->stream);
423 object->tex_vertex_data[i * 2 + 1] = g3d_stream_read_float_le(global->stream);
424 parent->nb -= 8;
425
426 if((i % 1000) == 0) x3ds_update_progress(global, parent->level);
427 }
428
429 return TRUE;
430}
431
432/* smoothing groups */
433gboolean x3ds_cb_0x4150(x3ds_global_data *global, x3ds_parent_data *parent)
434{
435 G3DObject *object;
436 G3DFace *face;
437 GSList *oface;
438 gint32 i, j, k, n=0, polynum, group;
439 guint32 *smooth_list;
440 G3DFloat *pnormal_list, *vertex_normal_buf;
441 G3DFloat a[3],b[3], *p0,*p1,*p2,*r;
442
443 /* read data */
444 object = (G3DObject *)parent->object;
445 g_return_val_if_fail(object, FALSE);
446
447 oface=object->faces;
448 polynum=0;
449 for(oface = object->faces; oface != NULL ; oface = oface->next)
450 polynum++; /* count polygons */
451
452 /* polygon normal list */
453 pnormal_list = g_new(float, 3 * polynum);
454 /* normals per vertice */
455 vertex_normal_buf = g_new0(float, 3 * object->vertex_count);
456
457 smooth_list = g_new(guint32, polynum);
458
459 for(i = 0 ; i < polynum ; i ++)
460 smooth_list[i] = g3d_stream_read_int32_le(global->stream);
461
462 parent->nb -= polynum * 4;
463 /* first, we calculate the normal by the polygon vertices (just vector
464 * product) */
465 i = 0;
466 for(oface = object->faces; oface != NULL ; oface=oface->next)
467 {
468 face = (G3DFace *)oface->data;
469 r = &(pnormal_list[i*3]);
470 p0 = &(object->vertex_data[3 * face->vertex_indices[0]]);
471 p1 = &(object->vertex_data[3 * face->vertex_indices[1]]);
472 p2 = &(object->vertex_data[3 * face->vertex_indices[2]]);
473
474 a[0]=p1[0] - p0[0];
475 a[1]=p1[1] - p0[1];
476 a[2]=p1[2] - p0[2];
477 b[0]=p2[0] - p0[0];
478 b[1]=p2[1] - p0[1];
479 b[2]=p2[2] - p0[2];
480
481 g3d_vector_normal(a[0], a[1], a[2], b[0], b[1], b[2],
482 &r[0], &r[1], &r[2]);
483
484 g3d_vector_unify(&r[0], &r[1], &r[2]);
485
486 face->flags |= G3D_FLAG_FAC_NORMALS;
487 i ++;
488 }
489
490 do {
491 /* find a suitable group. -1 means we've already taken care */
492 group = -1;
493 for(i = 0; i < polynum; i ++)
494 if((group = smooth_list[i]) != -1) /* found a group */
495 break;
496 /* handle this group */
497 if(group != -1)
498 {
499 /* SMOOTH
500 * we add normals of the polygons's vertices so each vertex will
501 * finally have
502 * the sum of the polygons normals where the vertex is part of.
503 *
504 * run0: clear the vertex_normal_buf for this group */
505 for(i = 0; i < object->vertex_count * 3; i ++)
506 vertex_normal_buf[i] = 0.0;
507 /* run1: add normals on themselves into the vertex_normal_buf */
508 i = 0;
509 for(oface = object->faces; oface != NULL ; oface = oface->next)
510 {
511 face = (G3DFace *) oface->data;
512 if(smooth_list[i] == group)
513 {
514 /* for all 3 vertices of the polygon */
515 for(j = 0; j < 3; j ++)
516 {
517 k = face->vertex_indices[j];
518 for(n = 0; n < 3; n ++)
519 vertex_normal_buf[k * 3 + n] +=
520 pnormal_list[i * 3 + n];
521 }
522 }
523 i ++;
524 }
525 i = 0;
526 /* run2: apply to the final vertex buffer */
527 for(oface = object->faces; oface != NULL ; oface = oface->next)
528 {
529 face = (G3DFace *)oface->data;
530 if(smooth_list[i] == group)
531 {
532 face->normals = g_new(G3DFloat, 9);
533 for(j = 0; j < 3; j ++)
534 {
535 k = face->vertex_indices[j];
536
537 g3d_vector_unify(
538 &(vertex_normal_buf[k * 3 + 0]),
539 &(vertex_normal_buf[k * 3 + 1]),
540 &(vertex_normal_buf[k * 3 + 2]));
541
542 if(vertex_normal_buf[k * 3 + 0] != 0.0F)
543 /* finally, we save the normal in our normal
544 * buffer */
545 memcpy(face->normals + j * 3,
546 vertex_normal_buf + k * 3,
547 sizeof(G3DFloat) * 3);
548 else
549 /* use the pbuf normal */
550 memcpy(face->normals + j * 3,
551 pnormal_list + i * 3,
552 sizeof(G3DFloat) * 3);
553
554 }
555 smooth_list[i] = -1; /* finished this polygon */
556 }
557 i++;
558 }
559 /* SMOOTH END */
560 }
561 } while (group != -1);
562
563 g_free(pnormal_list);
564 g_free(vertex_normal_buf);
565 g_free(smooth_list);
566 return TRUE;
567}
568
569/* mesh matrix */
570gboolean x3ds_cb_0x4160(x3ds_global_data *global, x3ds_parent_data *parent)
571{
572 G3DFloat matrix[16];
573 gint32 i;
574 G3DFloat det;
575
576 g3d_matrix_identity(matrix);
577 for(i = 0; i < 12; i ++)
578 matrix[(i / 3) * 4 + (i % 3)] = g3d_stream_read_float_le(global->stream);
579 parent->nb -= 48;
580
581 det = g3d_matrix_determinant(matrix);
582
583 g3d_matrix_dump(matrix);
584 g_debug("det: %f", det);
585
586
587 if(det < 0.0) {
588#if 0
589 G3DFloat scale[16];
590 g3d_matrix_identity(scale);
591 g3d_matrix_scale(-1.0, 1.0, 1.0, scale);
592 g3d_matrix_multiply(scale, matrix, matrix);
593 g3d_matrix_dump(matrix);
594#endif
595#define X3DS_MESH_TRANSFORM 0
596#if X3DS_MESH_TRANSFORM
597 object = parent->object;
598 if(object) {
599 object->transformation = g_new0(G3DTransformation, 1);
600 memcpy(object->transformation->matrix, matrix, 16 * sizeof(G3DFloat));
601 }
602
603#if 0
604 if(parent->object) {
605 g3d_object_transform(parent->object, matrix);
606 }
607#endif
608#endif
609 }
610 return TRUE;
611}
612
613/* material name */
614gboolean x3ds_cb_0xA000(x3ds_global_data *global, x3ds_parent_data *parent)
615{
616 G3DMaterial *material;
617 gchar buffer[1024];
618
619 g_return_val_if_fail(parent->object, FALSE);
620
621 parent->nb -= x3ds_read_cstr(global->stream, buffer);
622 material = (G3DMaterial *)(parent->object);
623
624 material->name = g_strdup(buffer);
625
626 return TRUE;
627}
628
629/* two sided material */
630gboolean x3ds_cb_0xA081(x3ds_global_data *global, x3ds_parent_data *parent)
631{
632 G3DMaterial *material;
633
634 material = (G3DMaterial *)parent->object;
635 g_return_val_if_fail(material, FALSE);
636
637 material->flags |= G3D_FLAG_MAT_TWOSIDE;
638
639 return TRUE;
640}
641
642/* texture map name */
643gboolean x3ds_cb_0xA300(x3ds_global_data *global, x3ds_parent_data *parent)
644{
645 G3DMaterial *material;
646 G3DImage *image;
647 gchar buffer[512];
648
649 material = (G3DMaterial *)parent->object;
650 g_return_val_if_fail(material, FALSE);
651
652 parent->nb -= x3ds_read_cstr(global->stream, buffer);
653
654 switch(parent->id)
655 {
656 case 0xA200: /* texture map */
657 material->tex_image = g3d_texture_load_cached(global->context,
658 global->model, buffer);
659 if(material->tex_image)
660 {
661 g3d_texture_flip_y(material->tex_image);
662 material->tex_image->tex_id = ++ global->max_tex_id;
663 }
664 break;
665
666 case 0xA210: /* opacity map */
667 image = g3d_texture_load(global->context, buffer);
668 if(image != NULL)
669 {
670 g3d_texture_flip_y(image);
671 material->tex_image = g3d_texture_merge_alpha(
672 material->tex_image, image);
673 g3d_texture_free(image);
674 }
675 break;
676
677 case 0xA220: /* reflection map */
678 /* TODO: implement */
679 break;
680
681 case 0xA230: /* bump map */
682 /* TODO: implement */
683 break;
684
685 default:
686#if DEBUG > 0
687 g_warning("[3DS] unhandled texture name in 0x%04X", parent->id);
688#endif
689
690 break;
691 }
692
693 return TRUE;
694}
695
696/* texture map scale u */
697gboolean x3ds_cb_0xA354(x3ds_global_data *global, x3ds_parent_data *parent)
698{
699 G3DMaterial *material;
700 G3DImage *image;
701 G3DFloat scale;
702
703 material = (G3DMaterial *)parent->object;
704 g_return_val_if_fail(material, FALSE);
705
706 image = material->tex_image;
707 g_return_val_if_fail(image, FALSE);
708
709 scale = g3d_stream_read_float_le(global->stream);
710 parent->nb -= 4;
711
712 image->tex_scale_u = scale;
713#if DEBUG > 3
714 g_debug("[3DS] scale_u: %f", image->tex_scale_u);
715#endif
716
717 return TRUE;
718}
719
720/* texture map scale v */
721gboolean x3ds_cb_0xA356(x3ds_global_data *global, x3ds_parent_data *parent)
722{
723 G3DMaterial *material;
724 G3DImage *image;
725 G3DFloat scale;
726
727 material = (G3DMaterial *)parent->object;
728 g_return_val_if_fail(material, FALSE);
729
730 image = material->tex_image;
731 g_return_val_if_fail(image, FALSE);
732
733 scale = g3d_stream_read_float_le(global->stream);
734 parent->nb -= 4;
735
736 image->tex_scale_v = scale;
737#if DEBUG > 3
738 g_debug("[3DS] scale_v: %f", image->tex_scale_v);
739#endif
740
741 return TRUE;
742}
743
744/* material */
745gboolean x3ds_cb_0xAFFF(x3ds_global_data *global, x3ds_parent_data *parent)
746{
747 G3DMaterial *material;
748 G3DObject *object;
749
750 material = g3d_material_new();
751
752 if(parent->object)
753 {
754 object = (G3DObject *)parent->object;
755 object->materials = g_slist_append(object->materials, material);
756 }
757 else
758 {
759 global->model->materials = g_slist_append(global->model->materials,
760 material);
761 }
762
763 parent->object = material;
764
765 return TRUE;
766}
767
768/* keyframe data header */
769gboolean x3ds_cb_0xB00A(x3ds_global_data *global, x3ds_parent_data *parent)
770{
771 gint32 rev, len;
772 gchar buffer[512];
773
774 rev = g3d_stream_read_int16_le(global->stream);
775 parent->nb -= 2;
776 parent->nb -= x3ds_read_cstr(global->stream, buffer);
777 len = g3d_stream_read_int16_le(global->stream);
778 parent->nb -= 2;
779
780#if DEBUG > 0
781 g_debug("[3DS] keyframe data: r%d, %d frames, \"%s\"",
782 rev, len, buffer);
783#endif
784 return TRUE;
785}
786
787/* node header */
788gboolean x3ds_cb_0xB010(x3ds_global_data *global, x3ds_parent_data *parent)
789{
790 GSList *olist;
791 G3DObject *object;
792 gchar buffer[512];
793
794 parent->nb -= x3ds_read_cstr(global->stream, buffer);
795#if DEBUG > 3
796 g_debug("[3DS] NODE_HDR: %s", buffer);
797#endif
798
799 /* find object by name */
800 olist = global->model->objects;
801 while(olist)
802 {
803 object = (G3DObject *)olist->data;
804 if(strcmp(object->name, buffer) == 0)
805 {
806 parent->level_object = object;
807 break;
808 }
809 olist = olist->next;
810 }
811
812 g3d_stream_read_int16_le(global->stream); /* flags 1 */
813 g3d_stream_read_int16_le(global->stream); /* flags 2 */
814 g3d_stream_read_int16_le(global->stream); /* ? */
815 parent->nb -= 6;
816
817 return TRUE;
818}
819
820/* pivot */
821gboolean x3ds_cb_0xB013(x3ds_global_data *global, x3ds_parent_data *parent)
822{
823 G3DObject *object;
824#if 0
825 gint32 i;
826#endif
827 G3DFloat x, y, z;
828
829 object = parent->level_object;
830 if(object == NULL) return FALSE;
831
832 x = g3d_stream_read_float_le(global->stream);
833 y = g3d_stream_read_float_le(global->stream);
834 z = g3d_stream_read_float_le(global->stream);
835 parent->nb -= 12;
836
837#if DEBUG > 3
838 g_debug("[3DS]: PIVOT: (%.2f,%.2f,%.2f)", x, y, z);
839#endif
840
841 return TRUE;
842}
843
844#define X3DS_ENABLE_POS_TRACK_TAG 0
845
846/* position tracking tag */
847gboolean x3ds_cb_0xB020(x3ds_global_data *global, x3ds_parent_data *parent)
848{
849 G3DObject *object;
850 gint32 i, flags, fflags, nkeys, fnum;
851#if X3DS_ENABLE_POS_TRACK_TAG
852 gint32 j;
853#endif
854 G3DFloat x, y, z;
855
856 object = parent->level_object;
857 if(object == NULL) return FALSE;
858
859 flags = g3d_stream_read_int16_le(global->stream);
860 g3d_stream_skip(global->stream, 8);
861 nkeys = g3d_stream_read_int32_le(global->stream);
862
863 parent->nb -= 14;
864
865 for(i = 0; i < nkeys; i ++)
866 {
867 fnum = g3d_stream_read_int32_le(global->stream);
868 fflags = g3d_stream_read_int16_le(global->stream);
869 parent->nb -= 6;
870
871 if(fflags & X3DS_FLAG_TENSION)
872 {
873 g3d_stream_read_float_le(global->stream);
874 parent->nb -= 4;
875 }
876 if(fflags & X3DS_FLAG_CONTINUITY)
877 {
878 g3d_stream_read_float_le(global->stream);
879 parent->nb -= 4;
880 }
881 if(fflags & X3DS_FLAG_BIAS)
882 {
883 g3d_stream_read_float_le(global->stream);
884 parent->nb -= 4;
885 }
886 if(fflags & X3DS_FLAG_EASE_TO)
887 {
888 g3d_stream_read_float_le(global->stream);
889 parent->nb -= 4;
890 }
891 if(fflags & X3DS_FLAG_EASE_FROM)
892 {
893 g3d_stream_read_float_le(global->stream);
894 parent->nb -= 4;
895 }
896
897 x = g3d_stream_read_float_le(global->stream);
898 y = g3d_stream_read_float_le(global->stream);
899 z = g3d_stream_read_float_le(global->stream);
900 parent->nb -= 12;
901#if DEBUG > 3
902 g_debug("[3DS]: POS_TRACK_TAG: frame %d: (%.2f,%.2f,%.2f) (0x%X) "
903 "object: %s",
904 fnum, x, y, z, fflags, object->name);
905#endif
906
907#if X3DS_ENABLE_POS_TRACK_TAG
908 if(fnum == 0)
909 {
910#if 1
911 for(j = 0; j < object->vertex_count; j ++)
912 {
913 object->vertex_data[j * 3 + 0] -= x;
914 object->vertex_data[j * 3 + 1] -= y;
915 object->vertex_data[j * 3 + 2] -= z;
916 }
917#endif
918 }
919#endif
920 }
921
922 return TRUE;
923}
924
925/* rotation tracking tag */
926gboolean x3ds_cb_0xB021(x3ds_global_data *global, x3ds_parent_data *parent)
927{
928 G3DObject *object;
929 gint32 i, j, flags, nkeys, fnum;
930 G3DFloat x, y, z, rot;
931 G3DFloat matrix[16];
932
933 object = parent->level_object;
934 if(object == NULL) return FALSE;
935
936 flags = g3d_stream_read_int16_le(global->stream);
937 g3d_stream_skip(global->stream, 8);
938 nkeys = g3d_stream_read_int16_le(global->stream);
939 g3d_stream_read_int16_le(global->stream);
940 parent->nb -= 14;
941
942 for(i = 0; i < nkeys; i ++)
943 {
944 fnum = g3d_stream_read_int16_le(global->stream);
945 g3d_stream_read_int32_le(global->stream);
946 parent->nb -= 6;
947
948 rot = g3d_stream_read_float_le(global->stream);
949 x = g3d_stream_read_float_le(global->stream);
950 y = g3d_stream_read_float_le(global->stream);
951 z = g3d_stream_read_float_le(global->stream);
952 parent->nb -= 16;
953#if DEBUG > 3
954 g_debug(
955 "[3DS]: ROT_TRACK_TAG: frame %d: (%.2f,%.2f,%.2f), %.2f rad",
956 fnum, x, y, z, rot);
957#endif
958 if(fnum == -1)
959 {
960#if 1
961 g3d_matrix_identity(matrix);
962 g3d_matrix_rotate(rot, x, y, z, matrix);
963
964 for(j = 0; j < object->vertex_count; j ++)
965 {
966 g3d_vector_transform(
967 &(object->vertex_data[j * 3 + 0]),
968 &(object->vertex_data[j * 3 + 1]),
969 &(object->vertex_data[j * 3 + 2]),
970 matrix);
971 }
972#endif
973 }
974 }
975
976 return TRUE;
977
978}
979
980/* node id */
981gboolean x3ds_cb_0xB030(x3ds_global_data *global, x3ds_parent_data *parent)
982{
983 gint32 id;
984
985 id = g3d_stream_read_int16_le(global->stream);
986 parent->nb -= 2;
987#if DEBUG > 3
988 g_debug("[3DS] NODE_ID: %d", id);
989#endif
990
991 return TRUE;
992}
diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_3ds/imp_3ds_callbacks.h b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_3ds/imp_3ds_callbacks.h
new file mode 100644
index 0000000..f548bea
--- /dev/null
+++ b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_3ds/imp_3ds_callbacks.h
@@ -0,0 +1,56 @@
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_3DS_CALLBACKS_H
23#define _IMP_3DS_CALLBACKS_H
24
25#include "imp_3ds.h"
26
27gboolean x3ds_cb_0x0002(x3ds_global_data *global, x3ds_parent_data *parent);
28gboolean x3ds_cb_0x0010(x3ds_global_data *global, x3ds_parent_data *parent);
29gboolean x3ds_cb_0x0011(x3ds_global_data *global, x3ds_parent_data *parent);
30gboolean x3ds_cb_0x0030(x3ds_global_data *global, x3ds_parent_data *parent);
31gboolean x3ds_cb_0x0031(x3ds_global_data *global, x3ds_parent_data *parent);
32gboolean x3ds_cb_0x0100(x3ds_global_data *global, x3ds_parent_data *parent);
33
34gboolean x3ds_cb_0x4000(x3ds_global_data *global, x3ds_parent_data *parent);
35gboolean x3ds_cb_0x4110(x3ds_global_data *global, x3ds_parent_data *parent);
36gboolean x3ds_cb_0x4120(x3ds_global_data *global, x3ds_parent_data *parent);
37gboolean x3ds_cb_0x4130(x3ds_global_data *global, x3ds_parent_data *parent);
38gboolean x3ds_cb_0x4140(x3ds_global_data *global, x3ds_parent_data *parent);
39gboolean x3ds_cb_0x4150(x3ds_global_data *global, x3ds_parent_data *parent);
40gboolean x3ds_cb_0x4160(x3ds_global_data *global, x3ds_parent_data *parent);
41
42gboolean x3ds_cb_0xA000(x3ds_global_data *global, x3ds_parent_data *parent);
43gboolean x3ds_cb_0xA081(x3ds_global_data *global, x3ds_parent_data *parent);
44gboolean x3ds_cb_0xA300(x3ds_global_data *global, x3ds_parent_data *parent);
45gboolean x3ds_cb_0xA354(x3ds_global_data *global, x3ds_parent_data *parent);
46gboolean x3ds_cb_0xA356(x3ds_global_data *global, x3ds_parent_data *parent);
47gboolean x3ds_cb_0xAFFF(x3ds_global_data *global, x3ds_parent_data *parent);
48
49gboolean x3ds_cb_0xB00A(x3ds_global_data *global, x3ds_parent_data *parent);
50gboolean x3ds_cb_0xB010(x3ds_global_data *global, x3ds_parent_data *parent);
51gboolean x3ds_cb_0xB013(x3ds_global_data *global, x3ds_parent_data *parent);
52gboolean x3ds_cb_0xB020(x3ds_global_data *global, x3ds_parent_data *parent);
53gboolean x3ds_cb_0xB021(x3ds_global_data *global, x3ds_parent_data *parent);
54gboolean x3ds_cb_0xB030(x3ds_global_data *global, x3ds_parent_data *parent);
55
56#endif /* _IMP_3DS_CALLBACKS_H */
diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_3ds/imp_3ds_chunks.h b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_3ds/imp_3ds_chunks.h
new file mode 100644
index 0000000..0c4cd54
--- /dev/null
+++ b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_3ds/imp_3ds_chunks.h
@@ -0,0 +1,210 @@
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_3DS_CHUNKS_H
23#define _IMP_3DS_CHUNKS_H
24
25#include <glib.h>
26
27#include "imp_3ds_callbacks.h"
28
29typedef struct {
30 guint32 id;
31 char *desc;
32 gboolean container;
33 x3ds_callback callback;
34} x3ds_chunk_desc;
35
36static x3ds_chunk_desc x3ds_chunks[] = {
37 { 0x0002, "M3D version", 0, x3ds_cb_0x0002 },
38 { 0x0001, "(unknown)", 0, NULL },
39 { 0x0010, "color (float)", 0, x3ds_cb_0x0010 },
40 { 0x0011, "color (24 bit)", 0, x3ds_cb_0x0011 },
41 { 0x0012, "line color (24 bit)", 0, NULL },
42 { 0x0013, "line color (float)", 0, NULL },
43 { 0x0030, "percentage (short)", 0, x3ds_cb_0x0030 },
44 { 0x0031, "percentage (float)", 0, x3ds_cb_0x0031 },
45 { 0x0100, "global scale", 0, NULL },
46
47 { 0x1100, "BIT_MAP", 0, NULL },
48 { 0x1101, "USE_BIT_MAP", 0, NULL },
49 { 0x1200, "SOLID_BGND", 1, NULL },
50 { 0x1201, "USE_SOLID_BGND", 0, NULL },
51 { 0x1300, "V_GRADIENT", 0, NULL },
52 { 0x1301, "USE_V_GRADIENT", 0, NULL },
53 { 0x1400, "LO_SHADOW_BIAS", 0, NULL },
54 { 0x1410, "HI_SHADOW_BIAS", 0, NULL },
55 { 0x1420, "SHADOW_MAP_SIZE", 0, NULL },
56 { 0x1430, "SHADOW_SAMPLES", 0, NULL },
57 { 0x1440, "SHADOW_RANGE", 0, NULL },
58 { 0x1450, "SHADOW_FILTER", 0, NULL },
59 { 0x1460, "RAY_BIAS", 0, NULL },
60 { 0x1500, "O_CONSTS", 0, NULL },
61
62 { 0x2100, "AMBIENT_LIGHT", 0, NULL },
63 { 0x2200, "FOG", 0, NULL },
64 { 0x2300, "DISTANCE_CUE", 0, NULL },
65 { 0x2301, "USE_DISTANCE_CUE", 0, NULL },
66 { 0x2302, "LAYER_FOG", 0, NULL },
67 { 0x2D2D, "SMAGIC", 0, NULL },
68 { 0x2D3D, "LMAGIC", 0, NULL },
69
70 { 0x3000, "default view", 1, NULL },
71 { 0x3010, "VIEW_TOP", 0, NULL },
72 { 0x3020, "VIEW_BOTTOM", 0, NULL },
73 { 0x3030, "VIEW_LEFT", 0, NULL },
74 { 0x3040, "VIEW_RIGHT", 0, NULL },
75 { 0x3050, "VIEW_FRONT", 0, NULL },
76 { 0x3060, "VIEW_BACK", 0, NULL },
77 { 0x3070, "VIEW_USER", 0, NULL },
78 { 0x3080, "VIEW_CAMERA", 0, NULL },
79 { 0x3090, "VIEW_WINDOW", 0, NULL },
80 { 0x3D3D, "mesh", 1, NULL },
81 { 0x3D3E, "mesh version", 0, NULL },
82
83 { 0x4000, "named object", 1, x3ds_cb_0x4000 },
84 { 0x4010, "object hidden", 0, NULL },
85 { 0x4011, "object vis lofter", 0, NULL },
86 { 0x4012, "object doesnt cast", 0, NULL },
87 { 0x4013, "object matte", 0, NULL },
88 { 0x4014, "object fast", 0, NULL },
89 { 0x4015, "object procedural", 0, NULL },
90 { 0x4016, "object frozen", 0, NULL },
91 { 0x4017, "object dont recv shadow", 0, NULL },
92 { 0x4100, "triangle object", 1, NULL },
93 { 0x4110, "point array", 0, x3ds_cb_0x4110 },
94 { 0x4111, "point flag array", 0, NULL },
95 { 0x4120, "face array", 1, x3ds_cb_0x4120 },
96 { 0x4130, "mesh mat group", 0, x3ds_cb_0x4130 },
97 { 0x4140, "texture vertices", 0, x3ds_cb_0x4140 },
98 { 0x4150, "smooth group", 0, x3ds_cb_0x4150 },
99 { 0x4160, "mesh matrix", 0, x3ds_cb_0x4160 },
100 { 0x4165, "mesh color", 0, NULL },
101 { 0x4170, "texture info", 0, NULL },
102 { 0x4600, "N_DIRECT_LIGHT", 0, NULL },
103 { 0x4700, "N_CAMERA", 0, NULL },
104
105 { 0x7001, "VIEWPORT_LAYOUT", 0, NULL },
106
107 { 0x8000, "XDATA_SECTION", 0, NULL },
108
109 { 0xA000, "material name", 0, x3ds_cb_0xA000 },
110 { 0xA010, "ambient color", 1, NULL },
111 { 0xA020, "diffuse color", 1, NULL },
112 { 0xA030, "specular color", 1, NULL },
113 { 0xA040, "shininess", 1, NULL },
114 { 0xA041, "shininess (2)", 1, NULL },
115 { 0xA042, "shininess (3)", 1, NULL },
116 { 0xA050, "transparency", 1, NULL },
117 { 0xA052, "fallthrough", 1, NULL },
118 { 0xA053, "blur", 1, NULL },
119 { 0xA081, "two-sided", 0, x3ds_cb_0xA081 },
120 { 0xA082, "decal", 0, NULL },
121 { 0xA083, "additive", 0, NULL },
122 { 0xA084, "self illumination", 1, NULL },
123 { 0xA085, "wire", 0, NULL },
124 { 0xA086, "super-sampling", 0, NULL },
125 { 0xA087, "wire size", 0, NULL },
126 { 0xA088, "MAT_FACEMAP", 0, NULL },
127 { 0xA08A, "MAT_XPFALLIN", 0, NULL },
128 { 0xA08C, "MAT_PHONGSOFT", 0, NULL },
129 { 0xA08E, "MAT_WIREABS", 0, NULL },
130 { 0xA100, "shading", 0, NULL },
131 { 0xA200, "texture map", 1, NULL },
132 { 0xA204, "spec map", 1, NULL },
133 { 0xA210, "opacity map", 1, NULL },
134 { 0xA220, "reflection map", 1, NULL },
135 { 0xA230, "bump map", 1, NULL },
136 { 0xA240, "mat use xpfall", 0, NULL },
137 { 0xA250, "mat use refblur", 0, NULL },
138 { 0xA252, "bump percentage", 0, NULL },
139 { 0xA300, "texture map name", 0, x3ds_cb_0xA300 },
140 { 0xA310, "MAT_ACUBIC", 0, NULL },
141 { 0xA320, "MAT_SXP_TEXT_DATA", 0, NULL },
142 { 0xA324, "MAT_SXP_BUMP_DATA", 0, NULL },
143 { 0xA33A, "MAT_TEX2MAP", 0, NULL },
144 { 0xA351, "texture map tiling", 0, NULL },
145 { 0xA352, "texture map blurring (old)", 0, NULL },
146 { 0xA353, "texture map blurring", 0, NULL },
147 { 0xA354, "texture map scale u", 0, x3ds_cb_0xA354 },
148 { 0xA356, "texture map scale v", 0, x3ds_cb_0xA356 },
149 { 0xA358, "texture map offset u", 0, NULL },
150 { 0xA35A, "texture map offset v", 0, NULL },
151 { 0xAFFF, "material", 1, x3ds_cb_0xAFFF },
152
153 { 0xB000, "keyframe data", 1, NULL },
154 { 0xB001, "ambient data node", 1, NULL },
155 { 0xB002, "object node", 1, NULL },
156 { 0xB003, "camera node", 1, NULL },
157 { 0xB004, "target node", 1, NULL },
158 { 0xB005, "light node", 1, NULL },
159 { 0xB006, "L_TARGET_NODE_TAG", 1, NULL },
160 { 0xB007, "spotlight node", 1, NULL },
161 { 0xB008, "KFSEG", 0, NULL },
162 { 0xB009, "KFCURTIME", 0, NULL },
163 { 0xB00A, "keyframe data header", 0, x3ds_cb_0xB00A },
164 { 0xB010, "node header", 0, x3ds_cb_0xB010 },
165 { 0xB011, "instance name", 0, NULL },
166 { 0xB012, "PRESCALE", 0, NULL },
167 { 0xB013, "pivot", 0, x3ds_cb_0xB013 },
168 { 0xB014, "bounding box", 0, NULL },
169 { 0xB015, "MORPH_SMOOTH", 0, NULL },
170 { 0xB020, "position tracking tag", 0, x3ds_cb_0xB020 },
171 { 0xB021, "rotation tracking tag", 0, x3ds_cb_0xB021 },
172 { 0xB022, "scale tracking tag", 0, NULL },
173 { 0xB023, "FOV_TRACK_TAG", 0, NULL },
174 { 0xB024, "ROLL_TRACK_TAG", 0, NULL },
175 { 0xB025, "COL_TRACK_TAG", 0, NULL },
176 { 0xB026, "MORPH_TRACK_TAG", 0, NULL },
177 { 0xB027, "HOT_TRACK_TAG", 0, NULL },
178 { 0xB028, "FALL_TRACK_TAG", 0, NULL },
179 { 0xB029, "HIDE_TRACK_TAG", 0, NULL },
180 { 0xB030, "node identification", 0, x3ds_cb_0xB030 },
181
182 { 0xC010, "C_MDRAWER", 0, NULL },
183 { 0xC030, "C_SHPDRAWER", 0, NULL },
184 { 0xC040, "C_MODDRAWER", 0, NULL },
185 { 0xC060, "C_TXDRAWER", 0, NULL },
186 { 0xC064, "C_MTLDRAWER", 0, NULL },
187 { 0xC066, "C_FLIDRAWER", 0, NULL },
188 { 0xC067, "C_CUBDRAWER", 0, NULL },
189 { 0xC070, "C_MFILE", 0, NULL },
190 { 0xC080, "C_SHPFILE", 0, NULL },
191 { 0xC090, "C_MODFILE", 0, NULL },
192 { 0xC0B0, "C_TXFILE", 0, NULL },
193 { 0xC0B4, "C_MTLFILE", 0, NULL },
194 { 0xC0B6, "C_FLIFILE", 0, NULL },
195 { 0xC0B8, "C_PALFILE", 0, NULL },
196 { 0xC0C0, "C_TX_STRING", 0, NULL },
197 { 0xC0D0, "C_CONSTS", 0, NULL },
198 { 0xC0E0, "C_SNAPS", 0, NULL },
199 { 0xC0F0, "C_GRIDS", 0, NULL },
200 { 0xC100, "C_ASNAPS", 0, NULL },
201 { 0xC25B, "C_BITMAP_DRAWER", 0, NULL },
202 { 0xC525, "C_CUR_MNAME", 0, NULL },
203 { 0xCA00, "C_MAPDRAWER", 0, NULL },
204
205 { 0xD000, "VPDATA", 0, NULL },
206
207 { 0x0000, NULL, 0, NULL }
208};
209
210#endif