diff options
Diffstat (limited to '')
11 files changed, 2740 insertions, 0 deletions
diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dae/Makefile b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dae/Makefile new file mode 100644 index 0000000..258d4dd --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dae/Makefile | |||
@@ -0,0 +1,518 @@ | |||
1 | # Makefile.in generated by automake 1.10.1 from Makefile.am. | ||
2 | # plugins/import/imp_dae/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 | |||
18 | pkgdatadir = $(datadir)/libg3d | ||
19 | pkglibdir = $(libdir)/libg3d | ||
20 | pkgincludedir = $(includedir)/libg3d | ||
21 | am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd | ||
22 | install_sh_DATA = $(install_sh) -c -m 644 | ||
23 | install_sh_PROGRAM = $(install_sh) -c | ||
24 | install_sh_SCRIPT = $(install_sh) -c | ||
25 | INSTALL_HEADER = $(INSTALL_DATA) | ||
26 | transform = $(program_transform_name) | ||
27 | NORMAL_INSTALL = : | ||
28 | PRE_INSTALL = : | ||
29 | POST_INSTALL = : | ||
30 | NORMAL_UNINSTALL = : | ||
31 | PRE_UNINSTALL = : | ||
32 | POST_UNINSTALL = : | ||
33 | build_triplet = x86_64-unknown-linux-gnu | ||
34 | host_triplet = x86_64-unknown-linux-gnu | ||
35 | subdir = plugins/import/imp_dae | ||
36 | DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in | ||
37 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 | ||
38 | am__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 | ||
43 | am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ | ||
44 | $(ACLOCAL_M4) | ||
45 | mkinstalldirs = $(install_sh) -d | ||
46 | CONFIG_HEADER = $(top_builddir)/include/g3d/config.h | ||
47 | CONFIG_CLEAN_FILES = | ||
48 | am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; | ||
49 | am__vpath_adj = case $$p in \ | ||
50 | $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ | ||
51 | *) f=$$p;; \ | ||
52 | esac; | ||
53 | am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; | ||
54 | am__installdirs = "$(DESTDIR)$(pluginimpdir)" | ||
55 | pluginimpLTLIBRARIES_INSTALL = $(INSTALL) | ||
56 | LTLIBRARIES = $(pluginimp_LTLIBRARIES) | ||
57 | imp_dae_la_DEPENDENCIES = $(top_builddir)/src/libg3d.la | ||
58 | am_imp_dae_la_OBJECTS = imp_dae.lo imp_dae_xml.lo imp_dae_library.lo \ | ||
59 | imp_dae_cb.lo | ||
60 | imp_dae_la_OBJECTS = $(am_imp_dae_la_OBJECTS) | ||
61 | am_imp_dae_la_rpath = -rpath $(pluginimpdir) | ||
62 | DEFAULT_INCLUDES = -I. -I$(top_builddir)/include/g3d | ||
63 | depcomp = $(SHELL) $(top_srcdir)/config/depcomp | ||
64 | am__depfiles_maybe = depfiles | ||
65 | COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ | ||
66 | $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) | ||
67 | LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ | ||
68 | --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ | ||
69 | $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) | ||
70 | CCLD = $(CC) | ||
71 | LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ | ||
72 | --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ | ||
73 | $(LDFLAGS) -o $@ | ||
74 | SOURCES = $(imp_dae_la_SOURCES) | ||
75 | DIST_SOURCES = $(imp_dae_la_SOURCES) | ||
76 | ETAGS = etags | ||
77 | CTAGS = ctags | ||
78 | DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) | ||
79 | ACLOCAL = ${SHELL} /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/config/missing --run aclocal-1.10 | ||
80 | AMTAR = ${SHELL} /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/config/missing --run tar | ||
81 | AR = ar | ||
82 | AS = as | ||
83 | AUTOCONF = ${SHELL} /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/config/missing --run autoconf | ||
84 | AUTOHEADER = ${SHELL} /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/config/missing --run autoheader | ||
85 | AUTOMAKE = ${SHELL} /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/config/missing --run automake-1.10 | ||
86 | AWK = gawk | ||
87 | CC = gcc | ||
88 | CCDEPMODE = depmode=gcc3 | ||
89 | CFLAGS = -g -O2 | ||
90 | CPP = gcc -E | ||
91 | CPPFLAGS = | ||
92 | CXX = g++ | ||
93 | CXXCPP = g++ -E | ||
94 | CXXDEPMODE = depmode=gcc3 | ||
95 | CXXFLAGS = -g -O2 | ||
96 | CYGPATH_W = echo | ||
97 | DBG_CFLAGS = -O2 | ||
98 | DEBUG = 0 | ||
99 | DEFS = -DHAVE_CONFIG_H | ||
100 | DEPDIR = .deps | ||
101 | DLLTOOL = dlltool | ||
102 | ECHO = echo | ||
103 | ECHO_C = | ||
104 | ECHO_N = -n | ||
105 | ECHO_T = | ||
106 | EGREP = /bin/grep -E | ||
107 | EXEEXT = | ||
108 | F77 = | ||
109 | FFLAGS = | ||
110 | GDKPIXBUF_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 | ||
111 | GDKPIXBUF_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 | ||
112 | GLIB_CFLAGS = -pthread -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include | ||
113 | GLIB_GENMARSHAL = glib-genmarshal | ||
114 | GLIB_LIBS = -Wl,--export-dynamic -pthread -lgmodule-2.0 -lrt -lgobject-2.0 -lglib-2.0 | ||
115 | GLIB_MKENUMS = glib-mkenums | ||
116 | GOBJECT_QUERY = gobject-query | ||
117 | GREP = /bin/grep | ||
118 | GTKDOC_CHECK = /usr/bin/gtkdoc-check | ||
119 | GTK_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 | ||
120 | GTK_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 | ||
121 | HTML_DIR = ${datadir}/gtk-doc/html | ||
122 | INSTALL = /usr/bin/install -c | ||
123 | INSTALL_DATA = ${INSTALL} -m 644 | ||
124 | INSTALL_PROGRAM = ${INSTALL} | ||
125 | INSTALL_SCRIPT = ${INSTALL} | ||
126 | INSTALL_STRIP_PROGRAM = $(install_sh) -c -s | ||
127 | LDFLAGS = | ||
128 | LEX = flex | ||
129 | LEXLIB = -lfl | ||
130 | LEX_OUTPUT_ROOT = lex.yy | ||
131 | LIBGSF_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 | ||
132 | LIBGSF_LIBS = -lgsf-1 -lgobject-2.0 -lxml2 -lglib-2.0 | ||
133 | LIBOBJS = | ||
134 | LIBS = -lm | ||
135 | LIBTOOL = $(SHELL) $(top_builddir)/libtool --quiet | ||
136 | LIBXML2_CFLAGS = -I/usr/include/libxml2 | ||
137 | LIBXML2_LIBS = -L/usr/lib/x86_64-linux-gnu -lxml2 | ||
138 | LN_S = ln -s | ||
139 | LTLIBOBJS = | ||
140 | LTVERSION = 0:8:0 | ||
141 | MAGIC_LIBS = -lmagic | ||
142 | MAKEINFO = ${SHELL} /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/config/missing --run makeinfo | ||
143 | MATH_LIBS = -lm | ||
144 | MKDIR_P = /bin/mkdir -p | ||
145 | OBJDUMP = objdump | ||
146 | OBJEXT = o | ||
147 | PACKAGE = libg3d | ||
148 | PACKAGE_BUGREPORT = | ||
149 | PACKAGE_NAME = | ||
150 | PACKAGE_STRING = | ||
151 | PACKAGE_TARNAME = | ||
152 | PACKAGE_VERSION = | ||
153 | PATH_SEPARATOR = : | ||
154 | PKG_CONFIG = /usr/bin/pkg-config | ||
155 | PLUGINS_LDFLAGS = -avoid-version -export-dynamic | ||
156 | RANLIB = ranlib | ||
157 | SET_MAKE = | ||
158 | SHELL = /bin/bash | ||
159 | STRIP = strip | ||
160 | VERSION = 0.0.8 | ||
161 | XML2_CONFIG = /usr/bin/xml2-config | ||
162 | XML_CPPFLAGS = -I/usr/include/libxml2 | ||
163 | XML_LIBS = -L/usr/lib/x86_64-linux-gnu -lxml2 | ||
164 | Z_CFLAGS = | ||
165 | Z_LIBS = -lz | ||
166 | abs_builddir = /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dae | ||
167 | abs_srcdir = /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dae | ||
168 | abs_top_builddir = /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8 | ||
169 | abs_top_srcdir = /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8 | ||
170 | ac_ct_CC = gcc | ||
171 | ac_ct_CXX = g++ | ||
172 | ac_ct_F77 = | ||
173 | am__include = include | ||
174 | am__leading_dot = . | ||
175 | am__quote = | ||
176 | am__tar = ${AMTAR} chof - "$$tardir" | ||
177 | am__untar = ${AMTAR} xf - | ||
178 | bindir = ${exec_prefix}/bin | ||
179 | build = x86_64-unknown-linux-gnu | ||
180 | build_alias = | ||
181 | build_cpu = x86_64 | ||
182 | build_os = linux-gnu | ||
183 | build_vendor = unknown | ||
184 | builddir = . | ||
185 | datadir = ${datarootdir} | ||
186 | datarootdir = ${prefix}/share | ||
187 | docdir = ${datarootdir}/doc/${PACKAGE} | ||
188 | dvidir = ${docdir} | ||
189 | exec_prefix = ${prefix} | ||
190 | host = x86_64-unknown-linux-gnu | ||
191 | host_alias = | ||
192 | host_cpu = x86_64 | ||
193 | host_os = linux-gnu | ||
194 | host_vendor = unknown | ||
195 | htmldir = ${docdir} | ||
196 | includedir = ${prefix}/include | ||
197 | infodir = ${datarootdir}/info | ||
198 | install_sh = $(SHELL) /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/config/install-sh | ||
199 | libdir = ${exec_prefix}/lib | ||
200 | libexecdir = ${exec_prefix}/libexec | ||
201 | localedir = ${datarootdir}/locale | ||
202 | localstatedir = ${prefix}/var | ||
203 | mandir = ${datarootdir}/man | ||
204 | mkdir_p = /bin/mkdir -p | ||
205 | oldincludedir = /usr/include | ||
206 | pdfdir = ${docdir} | ||
207 | prefix = /usr/local | ||
208 | program_transform_name = s,x,x, | ||
209 | psdir = ${docdir} | ||
210 | sbindir = ${exec_prefix}/sbin | ||
211 | sharedstatedir = ${prefix}/com | ||
212 | srcdir = . | ||
213 | sysconfdir = ${prefix}/etc | ||
214 | target_alias = | ||
215 | top_builddir = ../../.. | ||
216 | top_srcdir = ../../.. | ||
217 | pluginimpdir = $(pkglibdir)/plugins/import | ||
218 | pluginimp_LTLIBRARIES = imp_dae.la | ||
219 | AM_CFLAGS = \ | ||
220 | -Wall -ansi -pedantic \ | ||
221 | -DG_LOG_DOMAIN=\"LibG3D\" \ | ||
222 | -O2 -DDEBUG=0 \ | ||
223 | -pthread -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/libxml2 | ||
224 | |||
225 | INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include | ||
226 | AM_LDFLAGS = \ | ||
227 | -no-undefined -module \ | ||
228 | -avoid-version -export-dynamic | ||
229 | |||
230 | imp_dae_la_SOURCES = imp_dae.c \ | ||
231 | imp_dae_xml.h imp_dae_xml.c \ | ||
232 | imp_dae_library.h imp_dae_library.c \ | ||
233 | imp_dae_cb.h imp_dae_cb.c imp_dae_chunks.h | ||
234 | |||
235 | imp_dae_la_LIBADD = $(top_builddir)/src/libg3d.la -Wl,--export-dynamic -pthread -lgmodule-2.0 -lrt -lgobject-2.0 -lglib-2.0 -L/usr/lib/x86_64-linux-gnu -lxml2 | ||
236 | all: all-am | ||
237 | |||
238 | .SUFFIXES: | ||
239 | .SUFFIXES: .c .lo .o .obj | ||
240 | $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) | ||
241 | @for dep in $?; do \ | ||
242 | case '$(am__configure_deps)' in \ | ||
243 | *$$dep*) \ | ||
244 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ | ||
245 | && exit 0; \ | ||
246 | exit 1;; \ | ||
247 | esac; \ | ||
248 | done; \ | ||
249 | echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/import/imp_dae/Makefile'; \ | ||
250 | cd $(top_srcdir) && \ | ||
251 | $(AUTOMAKE) --gnu plugins/import/imp_dae/Makefile | ||
252 | .PRECIOUS: Makefile | ||
253 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status | ||
254 | @case '$?' in \ | ||
255 | *config.status*) \ | ||
256 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ | ||
257 | *) \ | ||
258 | echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ | ||
259 | cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ | ||
260 | esac; | ||
261 | |||
262 | $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) | ||
263 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh | ||
264 | |||
265 | $(top_srcdir)/configure: $(am__configure_deps) | ||
266 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh | ||
267 | $(ACLOCAL_M4): $(am__aclocal_m4_deps) | ||
268 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh | ||
269 | install-pluginimpLTLIBRARIES: $(pluginimp_LTLIBRARIES) | ||
270 | @$(NORMAL_INSTALL) | ||
271 | test -z "$(pluginimpdir)" || $(MKDIR_P) "$(DESTDIR)$(pluginimpdir)" | ||
272 | @list='$(pluginimp_LTLIBRARIES)'; for p in $$list; do \ | ||
273 | if test -f $$p; then \ | ||
274 | f=$(am__strip_dir) \ | ||
275 | echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(pluginimpLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(pluginimpdir)/$$f'"; \ | ||
276 | $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(pluginimpLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(pluginimpdir)/$$f"; \ | ||
277 | else :; fi; \ | ||
278 | done | ||
279 | |||
280 | uninstall-pluginimpLTLIBRARIES: | ||
281 | @$(NORMAL_UNINSTALL) | ||
282 | @list='$(pluginimp_LTLIBRARIES)'; for p in $$list; do \ | ||
283 | p=$(am__strip_dir) \ | ||
284 | echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pluginimpdir)/$$p'"; \ | ||
285 | $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pluginimpdir)/$$p"; \ | ||
286 | done | ||
287 | |||
288 | clean-pluginimpLTLIBRARIES: | ||
289 | -test -z "$(pluginimp_LTLIBRARIES)" || rm -f $(pluginimp_LTLIBRARIES) | ||
290 | @list='$(pluginimp_LTLIBRARIES)'; for p in $$list; do \ | ||
291 | dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ | ||
292 | test "$$dir" != "$$p" || dir=.; \ | ||
293 | echo "rm -f \"$${dir}/so_locations\""; \ | ||
294 | rm -f "$${dir}/so_locations"; \ | ||
295 | done | ||
296 | imp_dae.la: $(imp_dae_la_OBJECTS) $(imp_dae_la_DEPENDENCIES) | ||
297 | $(LINK) $(am_imp_dae_la_rpath) $(imp_dae_la_OBJECTS) $(imp_dae_la_LIBADD) $(LIBS) | ||
298 | |||
299 | mostlyclean-compile: | ||
300 | -rm -f *.$(OBJEXT) | ||
301 | |||
302 | distclean-compile: | ||
303 | -rm -f *.tab.c | ||
304 | |||
305 | include ./$(DEPDIR)/imp_dae.Plo | ||
306 | include ./$(DEPDIR)/imp_dae_cb.Plo | ||
307 | include ./$(DEPDIR)/imp_dae_library.Plo | ||
308 | include ./$(DEPDIR)/imp_dae_xml.Plo | ||
309 | |||
310 | .c.o: | ||
311 | $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< | ||
312 | mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po | ||
313 | # source='$<' object='$@' libtool=no \ | ||
314 | # DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ | ||
315 | # $(COMPILE) -c $< | ||
316 | |||
317 | .c.obj: | ||
318 | $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` | ||
319 | mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po | ||
320 | # source='$<' object='$@' libtool=no \ | ||
321 | # DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ | ||
322 | # $(COMPILE) -c `$(CYGPATH_W) '$<'` | ||
323 | |||
324 | .c.lo: | ||
325 | $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< | ||
326 | mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo | ||
327 | # source='$<' object='$@' libtool=yes \ | ||
328 | # DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ | ||
329 | # $(LTCOMPILE) -c -o $@ $< | ||
330 | |||
331 | mostlyclean-libtool: | ||
332 | -rm -f *.lo | ||
333 | |||
334 | clean-libtool: | ||
335 | -rm -rf .libs _libs | ||
336 | |||
337 | ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) | ||
338 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ | ||
339 | unique=`for i in $$list; do \ | ||
340 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ | ||
341 | done | \ | ||
342 | $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ | ||
343 | END { if (nonempty) { for (i in files) print i; }; }'`; \ | ||
344 | mkid -fID $$unique | ||
345 | tags: TAGS | ||
346 | |||
347 | TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ | ||
348 | $(TAGS_FILES) $(LISP) | ||
349 | tags=; \ | ||
350 | here=`pwd`; \ | ||
351 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ | ||
352 | unique=`for i in $$list; do \ | ||
353 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ | ||
354 | done | \ | ||
355 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ | ||
356 | END { if (nonempty) { for (i in files) print i; }; }'`; \ | ||
357 | if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ | ||
358 | test -n "$$unique" || unique=$$empty_fix; \ | ||
359 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ | ||
360 | $$tags $$unique; \ | ||
361 | fi | ||
362 | ctags: CTAGS | ||
363 | CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ | ||
364 | $(TAGS_FILES) $(LISP) | ||
365 | tags=; \ | ||
366 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ | ||
367 | unique=`for i in $$list; do \ | ||
368 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ | ||
369 | done | \ | ||
370 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ | ||
371 | END { if (nonempty) { for (i in files) print i; }; }'`; \ | ||
372 | test -z "$(CTAGS_ARGS)$$tags$$unique" \ | ||
373 | || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ | ||
374 | $$tags $$unique | ||
375 | |||
376 | GTAGS: | ||
377 | here=`$(am__cd) $(top_builddir) && pwd` \ | ||
378 | && cd $(top_srcdir) \ | ||
379 | && gtags -i $(GTAGS_ARGS) $$here | ||
380 | |||
381 | distclean-tags: | ||
382 | -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags | ||
383 | |||
384 | distdir: $(DISTFILES) | ||
385 | @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ | ||
386 | topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ | ||
387 | list='$(DISTFILES)'; \ | ||
388 | dist_files=`for file in $$list; do echo $$file; done | \ | ||
389 | sed -e "s|^$$srcdirstrip/||;t" \ | ||
390 | -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ | ||
391 | case $$dist_files in \ | ||
392 | */*) $(MKDIR_P) `echo "$$dist_files" | \ | ||
393 | sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ | ||
394 | sort -u` ;; \ | ||
395 | esac; \ | ||
396 | for file in $$dist_files; do \ | ||
397 | if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ | ||
398 | if test -d $$d/$$file; then \ | ||
399 | dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ | ||
400 | if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ | ||
401 | cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ | ||
402 | fi; \ | ||
403 | cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ | ||
404 | else \ | ||
405 | test -f $(distdir)/$$file \ | ||
406 | || cp -p $$d/$$file $(distdir)/$$file \ | ||
407 | || exit 1; \ | ||
408 | fi; \ | ||
409 | done | ||
410 | check-am: all-am | ||
411 | check: check-am | ||
412 | all-am: Makefile $(LTLIBRARIES) | ||
413 | installdirs: | ||
414 | for dir in "$(DESTDIR)$(pluginimpdir)"; do \ | ||
415 | test -z "$$dir" || $(MKDIR_P) "$$dir"; \ | ||
416 | done | ||
417 | install: install-am | ||
418 | install-exec: install-exec-am | ||
419 | install-data: install-data-am | ||
420 | uninstall: uninstall-am | ||
421 | |||
422 | install-am: all-am | ||
423 | @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am | ||
424 | |||
425 | installcheck: installcheck-am | ||
426 | install-strip: | ||
427 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ | ||
428 | install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ | ||
429 | `test -z '$(STRIP)' || \ | ||
430 | echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install | ||
431 | mostlyclean-generic: | ||
432 | |||
433 | clean-generic: | ||
434 | |||
435 | distclean-generic: | ||
436 | -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) | ||
437 | |||
438 | maintainer-clean-generic: | ||
439 | @echo "This command is intended for maintainers to use" | ||
440 | @echo "it deletes files that may require special tools to rebuild." | ||
441 | clean: clean-am | ||
442 | |||
443 | clean-am: clean-generic clean-libtool clean-pluginimpLTLIBRARIES \ | ||
444 | mostlyclean-am | ||
445 | |||
446 | distclean: distclean-am | ||
447 | -rm -rf ./$(DEPDIR) | ||
448 | -rm -f Makefile | ||
449 | distclean-am: clean-am distclean-compile distclean-generic \ | ||
450 | distclean-tags | ||
451 | |||
452 | dvi: dvi-am | ||
453 | |||
454 | dvi-am: | ||
455 | |||
456 | html: html-am | ||
457 | |||
458 | info: info-am | ||
459 | |||
460 | info-am: | ||
461 | |||
462 | install-data-am: install-pluginimpLTLIBRARIES | ||
463 | |||
464 | install-dvi: install-dvi-am | ||
465 | |||
466 | install-exec-am: | ||
467 | |||
468 | install-html: install-html-am | ||
469 | |||
470 | install-info: install-info-am | ||
471 | |||
472 | install-man: | ||
473 | |||
474 | install-pdf: install-pdf-am | ||
475 | |||
476 | install-ps: install-ps-am | ||
477 | |||
478 | installcheck-am: | ||
479 | |||
480 | maintainer-clean: maintainer-clean-am | ||
481 | -rm -rf ./$(DEPDIR) | ||
482 | -rm -f Makefile | ||
483 | maintainer-clean-am: distclean-am maintainer-clean-generic | ||
484 | |||
485 | mostlyclean: mostlyclean-am | ||
486 | |||
487 | mostlyclean-am: mostlyclean-compile mostlyclean-generic \ | ||
488 | mostlyclean-libtool | ||
489 | |||
490 | pdf: pdf-am | ||
491 | |||
492 | pdf-am: | ||
493 | |||
494 | ps: ps-am | ||
495 | |||
496 | ps-am: | ||
497 | |||
498 | uninstall-am: uninstall-pluginimpLTLIBRARIES | ||
499 | |||
500 | .MAKE: install-am install-strip | ||
501 | |||
502 | .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ | ||
503 | clean-libtool clean-pluginimpLTLIBRARIES ctags distclean \ | ||
504 | distclean-compile distclean-generic distclean-libtool \ | ||
505 | distclean-tags distdir dvi dvi-am html html-am info info-am \ | ||
506 | install install-am install-data install-data-am install-dvi \ | ||
507 | install-dvi-am install-exec install-exec-am install-html \ | ||
508 | install-html-am install-info install-info-am install-man \ | ||
509 | install-pdf install-pdf-am install-pluginimpLTLIBRARIES \ | ||
510 | install-ps install-ps-am install-strip installcheck \ | ||
511 | installcheck-am installdirs maintainer-clean \ | ||
512 | maintainer-clean-generic mostlyclean mostlyclean-compile \ | ||
513 | mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ | ||
514 | tags uninstall uninstall-am uninstall-pluginimpLTLIBRARIES | ||
515 | |||
516 | # Tell versions [3.59,3.63) of GNU make to not export all variables. | ||
517 | # Otherwise a system limit (for SysV at least) may be exceeded. | ||
518 | .NOEXPORT: | ||
diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dae/Makefile.am b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dae/Makefile.am new file mode 100644 index 0000000..27cd426 --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dae/Makefile.am | |||
@@ -0,0 +1,25 @@ | |||
1 | pluginimpdir = $(pkglibdir)/plugins/import | ||
2 | |||
3 | if HAVE_LIBXML2 | ||
4 | pluginimp_LTLIBRARIES = imp_dae.la | ||
5 | endif | ||
6 | |||
7 | AM_CFLAGS = \ | ||
8 | -Wall -ansi -pedantic \ | ||
9 | -DG_LOG_DOMAIN=\"LibG3D\" \ | ||
10 | @DBG_CFLAGS@ -DDEBUG=@DEBUG@ \ | ||
11 | @GLIB_CFLAGS@ @LIBXML2_CFLAGS@ | ||
12 | |||
13 | INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include | ||
14 | |||
15 | AM_LDFLAGS = \ | ||
16 | -no-undefined -module \ | ||
17 | @PLUGINS_LDFLAGS@ | ||
18 | |||
19 | LIBTOOL += --quiet | ||
20 | |||
21 | imp_dae_la_SOURCES = imp_dae.c \ | ||
22 | imp_dae_xml.h imp_dae_xml.c \ | ||
23 | imp_dae_library.h imp_dae_library.c \ | ||
24 | imp_dae_cb.h imp_dae_cb.c imp_dae_chunks.h | ||
25 | imp_dae_la_LIBADD = $(top_builddir)/src/libg3d.la @GLIB_LIBS@ @LIBXML2_LIBS@ | ||
diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dae/Makefile.in b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dae/Makefile.in new file mode 100644 index 0000000..68bb8a3 --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dae/Makefile.in | |||
@@ -0,0 +1,518 @@ | |||
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 | |||
17 | VPATH = @srcdir@ | ||
18 | pkgdatadir = $(datadir)/@PACKAGE@ | ||
19 | pkglibdir = $(libdir)/@PACKAGE@ | ||
20 | pkgincludedir = $(includedir)/@PACKAGE@ | ||
21 | am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd | ||
22 | install_sh_DATA = $(install_sh) -c -m 644 | ||
23 | install_sh_PROGRAM = $(install_sh) -c | ||
24 | install_sh_SCRIPT = $(install_sh) -c | ||
25 | INSTALL_HEADER = $(INSTALL_DATA) | ||
26 | transform = $(program_transform_name) | ||
27 | NORMAL_INSTALL = : | ||
28 | PRE_INSTALL = : | ||
29 | POST_INSTALL = : | ||
30 | NORMAL_UNINSTALL = : | ||
31 | PRE_UNINSTALL = : | ||
32 | POST_UNINSTALL = : | ||
33 | build_triplet = @build@ | ||
34 | host_triplet = @host@ | ||
35 | subdir = plugins/import/imp_dae | ||
36 | DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in | ||
37 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 | ||
38 | am__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 | ||
43 | am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ | ||
44 | $(ACLOCAL_M4) | ||
45 | mkinstalldirs = $(install_sh) -d | ||
46 | CONFIG_HEADER = $(top_builddir)/include/g3d/config.h | ||
47 | CONFIG_CLEAN_FILES = | ||
48 | am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; | ||
49 | am__vpath_adj = case $$p in \ | ||
50 | $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ | ||
51 | *) f=$$p;; \ | ||
52 | esac; | ||
53 | am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; | ||
54 | am__installdirs = "$(DESTDIR)$(pluginimpdir)" | ||
55 | pluginimpLTLIBRARIES_INSTALL = $(INSTALL) | ||
56 | LTLIBRARIES = $(pluginimp_LTLIBRARIES) | ||
57 | imp_dae_la_DEPENDENCIES = $(top_builddir)/src/libg3d.la | ||
58 | am_imp_dae_la_OBJECTS = imp_dae.lo imp_dae_xml.lo imp_dae_library.lo \ | ||
59 | imp_dae_cb.lo | ||
60 | imp_dae_la_OBJECTS = $(am_imp_dae_la_OBJECTS) | ||
61 | @HAVE_LIBXML2_TRUE@am_imp_dae_la_rpath = -rpath $(pluginimpdir) | ||
62 | DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include/g3d | ||
63 | depcomp = $(SHELL) $(top_srcdir)/config/depcomp | ||
64 | am__depfiles_maybe = depfiles | ||
65 | COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ | ||
66 | $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) | ||
67 | LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ | ||
68 | --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ | ||
69 | $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) | ||
70 | CCLD = $(CC) | ||
71 | LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ | ||
72 | --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ | ||
73 | $(LDFLAGS) -o $@ | ||
74 | SOURCES = $(imp_dae_la_SOURCES) | ||
75 | DIST_SOURCES = $(imp_dae_la_SOURCES) | ||
76 | ETAGS = etags | ||
77 | CTAGS = ctags | ||
78 | DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) | ||
79 | ACLOCAL = @ACLOCAL@ | ||
80 | AMTAR = @AMTAR@ | ||
81 | AR = @AR@ | ||
82 | AS = @AS@ | ||
83 | AUTOCONF = @AUTOCONF@ | ||
84 | AUTOHEADER = @AUTOHEADER@ | ||
85 | AUTOMAKE = @AUTOMAKE@ | ||
86 | AWK = @AWK@ | ||
87 | CC = @CC@ | ||
88 | CCDEPMODE = @CCDEPMODE@ | ||
89 | CFLAGS = @CFLAGS@ | ||
90 | CPP = @CPP@ | ||
91 | CPPFLAGS = @CPPFLAGS@ | ||
92 | CXX = @CXX@ | ||
93 | CXXCPP = @CXXCPP@ | ||
94 | CXXDEPMODE = @CXXDEPMODE@ | ||
95 | CXXFLAGS = @CXXFLAGS@ | ||
96 | CYGPATH_W = @CYGPATH_W@ | ||
97 | DBG_CFLAGS = @DBG_CFLAGS@ | ||
98 | DEBUG = @DEBUG@ | ||
99 | DEFS = @DEFS@ | ||
100 | DEPDIR = @DEPDIR@ | ||
101 | DLLTOOL = @DLLTOOL@ | ||
102 | ECHO = @ECHO@ | ||
103 | ECHO_C = @ECHO_C@ | ||
104 | ECHO_N = @ECHO_N@ | ||
105 | ECHO_T = @ECHO_T@ | ||
106 | EGREP = @EGREP@ | ||
107 | EXEEXT = @EXEEXT@ | ||
108 | F77 = @F77@ | ||
109 | FFLAGS = @FFLAGS@ | ||
110 | GDKPIXBUF_CFLAGS = @GDKPIXBUF_CFLAGS@ | ||
111 | GDKPIXBUF_LIBS = @GDKPIXBUF_LIBS@ | ||
112 | GLIB_CFLAGS = @GLIB_CFLAGS@ | ||
113 | GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ | ||
114 | GLIB_LIBS = @GLIB_LIBS@ | ||
115 | GLIB_MKENUMS = @GLIB_MKENUMS@ | ||
116 | GOBJECT_QUERY = @GOBJECT_QUERY@ | ||
117 | GREP = @GREP@ | ||
118 | GTKDOC_CHECK = @GTKDOC_CHECK@ | ||
119 | GTK_CFLAGS = @GTK_CFLAGS@ | ||
120 | GTK_LIBS = @GTK_LIBS@ | ||
121 | HTML_DIR = @HTML_DIR@ | ||
122 | INSTALL = @INSTALL@ | ||
123 | INSTALL_DATA = @INSTALL_DATA@ | ||
124 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ | ||
125 | INSTALL_SCRIPT = @INSTALL_SCRIPT@ | ||
126 | INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ | ||
127 | LDFLAGS = @LDFLAGS@ | ||
128 | LEX = @LEX@ | ||
129 | LEXLIB = @LEXLIB@ | ||
130 | LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ | ||
131 | LIBGSF_CFLAGS = @LIBGSF_CFLAGS@ | ||
132 | LIBGSF_LIBS = @LIBGSF_LIBS@ | ||
133 | LIBOBJS = @LIBOBJS@ | ||
134 | LIBS = @LIBS@ | ||
135 | LIBTOOL = @LIBTOOL@ --quiet | ||
136 | LIBXML2_CFLAGS = @LIBXML2_CFLAGS@ | ||
137 | LIBXML2_LIBS = @LIBXML2_LIBS@ | ||
138 | LN_S = @LN_S@ | ||
139 | LTLIBOBJS = @LTLIBOBJS@ | ||
140 | LTVERSION = @LTVERSION@ | ||
141 | MAGIC_LIBS = @MAGIC_LIBS@ | ||
142 | MAKEINFO = @MAKEINFO@ | ||
143 | MATH_LIBS = @MATH_LIBS@ | ||
144 | MKDIR_P = @MKDIR_P@ | ||
145 | OBJDUMP = @OBJDUMP@ | ||
146 | OBJEXT = @OBJEXT@ | ||
147 | PACKAGE = @PACKAGE@ | ||
148 | PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ | ||
149 | PACKAGE_NAME = @PACKAGE_NAME@ | ||
150 | PACKAGE_STRING = @PACKAGE_STRING@ | ||
151 | PACKAGE_TARNAME = @PACKAGE_TARNAME@ | ||
152 | PACKAGE_VERSION = @PACKAGE_VERSION@ | ||
153 | PATH_SEPARATOR = @PATH_SEPARATOR@ | ||
154 | PKG_CONFIG = @PKG_CONFIG@ | ||
155 | PLUGINS_LDFLAGS = @PLUGINS_LDFLAGS@ | ||
156 | RANLIB = @RANLIB@ | ||
157 | SET_MAKE = @SET_MAKE@ | ||
158 | SHELL = @SHELL@ | ||
159 | STRIP = @STRIP@ | ||
160 | VERSION = @VERSION@ | ||
161 | XML2_CONFIG = @XML2_CONFIG@ | ||
162 | XML_CPPFLAGS = @XML_CPPFLAGS@ | ||
163 | XML_LIBS = @XML_LIBS@ | ||
164 | Z_CFLAGS = @Z_CFLAGS@ | ||
165 | Z_LIBS = @Z_LIBS@ | ||
166 | abs_builddir = @abs_builddir@ | ||
167 | abs_srcdir = @abs_srcdir@ | ||
168 | abs_top_builddir = @abs_top_builddir@ | ||
169 | abs_top_srcdir = @abs_top_srcdir@ | ||
170 | ac_ct_CC = @ac_ct_CC@ | ||
171 | ac_ct_CXX = @ac_ct_CXX@ | ||
172 | ac_ct_F77 = @ac_ct_F77@ | ||
173 | am__include = @am__include@ | ||
174 | am__leading_dot = @am__leading_dot@ | ||
175 | am__quote = @am__quote@ | ||
176 | am__tar = @am__tar@ | ||
177 | am__untar = @am__untar@ | ||
178 | bindir = @bindir@ | ||
179 | build = @build@ | ||
180 | build_alias = @build_alias@ | ||
181 | build_cpu = @build_cpu@ | ||
182 | build_os = @build_os@ | ||
183 | build_vendor = @build_vendor@ | ||
184 | builddir = @builddir@ | ||
185 | datadir = @datadir@ | ||
186 | datarootdir = @datarootdir@ | ||
187 | docdir = @docdir@ | ||
188 | dvidir = @dvidir@ | ||
189 | exec_prefix = @exec_prefix@ | ||
190 | host = @host@ | ||
191 | host_alias = @host_alias@ | ||
192 | host_cpu = @host_cpu@ | ||
193 | host_os = @host_os@ | ||
194 | host_vendor = @host_vendor@ | ||
195 | htmldir = @htmldir@ | ||
196 | includedir = @includedir@ | ||
197 | infodir = @infodir@ | ||
198 | install_sh = @install_sh@ | ||
199 | libdir = @libdir@ | ||
200 | libexecdir = @libexecdir@ | ||
201 | localedir = @localedir@ | ||
202 | localstatedir = @localstatedir@ | ||
203 | mandir = @mandir@ | ||
204 | mkdir_p = @mkdir_p@ | ||
205 | oldincludedir = @oldincludedir@ | ||
206 | pdfdir = @pdfdir@ | ||
207 | prefix = @prefix@ | ||
208 | program_transform_name = @program_transform_name@ | ||
209 | psdir = @psdir@ | ||
210 | sbindir = @sbindir@ | ||
211 | sharedstatedir = @sharedstatedir@ | ||
212 | srcdir = @srcdir@ | ||
213 | sysconfdir = @sysconfdir@ | ||
214 | target_alias = @target_alias@ | ||
215 | top_builddir = @top_builddir@ | ||
216 | top_srcdir = @top_srcdir@ | ||
217 | pluginimpdir = $(pkglibdir)/plugins/import | ||
218 | @HAVE_LIBXML2_TRUE@pluginimp_LTLIBRARIES = imp_dae.la | ||
219 | AM_CFLAGS = \ | ||
220 | -Wall -ansi -pedantic \ | ||
221 | -DG_LOG_DOMAIN=\"LibG3D\" \ | ||
222 | @DBG_CFLAGS@ -DDEBUG=@DEBUG@ \ | ||
223 | @GLIB_CFLAGS@ @LIBXML2_CFLAGS@ | ||
224 | |||
225 | INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include | ||
226 | AM_LDFLAGS = \ | ||
227 | -no-undefined -module \ | ||
228 | @PLUGINS_LDFLAGS@ | ||
229 | |||
230 | imp_dae_la_SOURCES = imp_dae.c \ | ||
231 | imp_dae_xml.h imp_dae_xml.c \ | ||
232 | imp_dae_library.h imp_dae_library.c \ | ||
233 | imp_dae_cb.h imp_dae_cb.c imp_dae_chunks.h | ||
234 | |||
235 | imp_dae_la_LIBADD = $(top_builddir)/src/libg3d.la @GLIB_LIBS@ @LIBXML2_LIBS@ | ||
236 | all: all-am | ||
237 | |||
238 | .SUFFIXES: | ||
239 | .SUFFIXES: .c .lo .o .obj | ||
240 | $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) | ||
241 | @for dep in $?; do \ | ||
242 | case '$(am__configure_deps)' in \ | ||
243 | *$$dep*) \ | ||
244 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ | ||
245 | && exit 0; \ | ||
246 | exit 1;; \ | ||
247 | esac; \ | ||
248 | done; \ | ||
249 | echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/import/imp_dae/Makefile'; \ | ||
250 | cd $(top_srcdir) && \ | ||
251 | $(AUTOMAKE) --gnu plugins/import/imp_dae/Makefile | ||
252 | .PRECIOUS: Makefile | ||
253 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status | ||
254 | @case '$?' in \ | ||
255 | *config.status*) \ | ||
256 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ | ||
257 | *) \ | ||
258 | echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ | ||
259 | cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ | ||
260 | esac; | ||
261 | |||
262 | $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) | ||
263 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh | ||
264 | |||
265 | $(top_srcdir)/configure: $(am__configure_deps) | ||
266 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh | ||
267 | $(ACLOCAL_M4): $(am__aclocal_m4_deps) | ||
268 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh | ||
269 | install-pluginimpLTLIBRARIES: $(pluginimp_LTLIBRARIES) | ||
270 | @$(NORMAL_INSTALL) | ||
271 | test -z "$(pluginimpdir)" || $(MKDIR_P) "$(DESTDIR)$(pluginimpdir)" | ||
272 | @list='$(pluginimp_LTLIBRARIES)'; for p in $$list; do \ | ||
273 | if test -f $$p; then \ | ||
274 | f=$(am__strip_dir) \ | ||
275 | echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(pluginimpLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(pluginimpdir)/$$f'"; \ | ||
276 | $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(pluginimpLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(pluginimpdir)/$$f"; \ | ||
277 | else :; fi; \ | ||
278 | done | ||
279 | |||
280 | uninstall-pluginimpLTLIBRARIES: | ||
281 | @$(NORMAL_UNINSTALL) | ||
282 | @list='$(pluginimp_LTLIBRARIES)'; for p in $$list; do \ | ||
283 | p=$(am__strip_dir) \ | ||
284 | echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pluginimpdir)/$$p'"; \ | ||
285 | $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pluginimpdir)/$$p"; \ | ||
286 | done | ||
287 | |||
288 | clean-pluginimpLTLIBRARIES: | ||
289 | -test -z "$(pluginimp_LTLIBRARIES)" || rm -f $(pluginimp_LTLIBRARIES) | ||
290 | @list='$(pluginimp_LTLIBRARIES)'; for p in $$list; do \ | ||
291 | dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ | ||
292 | test "$$dir" != "$$p" || dir=.; \ | ||
293 | echo "rm -f \"$${dir}/so_locations\""; \ | ||
294 | rm -f "$${dir}/so_locations"; \ | ||
295 | done | ||
296 | imp_dae.la: $(imp_dae_la_OBJECTS) $(imp_dae_la_DEPENDENCIES) | ||
297 | $(LINK) $(am_imp_dae_la_rpath) $(imp_dae_la_OBJECTS) $(imp_dae_la_LIBADD) $(LIBS) | ||
298 | |||
299 | mostlyclean-compile: | ||
300 | -rm -f *.$(OBJEXT) | ||
301 | |||
302 | distclean-compile: | ||
303 | -rm -f *.tab.c | ||
304 | |||
305 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imp_dae.Plo@am__quote@ | ||
306 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imp_dae_cb.Plo@am__quote@ | ||
307 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imp_dae_library.Plo@am__quote@ | ||
308 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imp_dae_xml.Plo@am__quote@ | ||
309 | |||
310 | .c.o: | ||
311 | @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< | ||
312 | @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po | ||
313 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ | ||
314 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | ||
315 | @am__fastdepCC_FALSE@ $(COMPILE) -c $< | ||
316 | |||
317 | .c.obj: | ||
318 | @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` | ||
319 | @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po | ||
320 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ | ||
321 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | ||
322 | @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` | ||
323 | |||
324 | .c.lo: | ||
325 | @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< | ||
326 | @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo | ||
327 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ | ||
328 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | ||
329 | @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< | ||
330 | |||
331 | mostlyclean-libtool: | ||
332 | -rm -f *.lo | ||
333 | |||
334 | clean-libtool: | ||
335 | -rm -rf .libs _libs | ||
336 | |||
337 | ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) | ||
338 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ | ||
339 | unique=`for i in $$list; do \ | ||
340 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ | ||
341 | done | \ | ||
342 | $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ | ||
343 | END { if (nonempty) { for (i in files) print i; }; }'`; \ | ||
344 | mkid -fID $$unique | ||
345 | tags: TAGS | ||
346 | |||
347 | TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ | ||
348 | $(TAGS_FILES) $(LISP) | ||
349 | tags=; \ | ||
350 | here=`pwd`; \ | ||
351 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ | ||
352 | unique=`for i in $$list; do \ | ||
353 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ | ||
354 | done | \ | ||
355 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ | ||
356 | END { if (nonempty) { for (i in files) print i; }; }'`; \ | ||
357 | if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ | ||
358 | test -n "$$unique" || unique=$$empty_fix; \ | ||
359 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ | ||
360 | $$tags $$unique; \ | ||
361 | fi | ||
362 | ctags: CTAGS | ||
363 | CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ | ||
364 | $(TAGS_FILES) $(LISP) | ||
365 | tags=; \ | ||
366 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ | ||
367 | unique=`for i in $$list; do \ | ||
368 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ | ||
369 | done | \ | ||
370 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ | ||
371 | END { if (nonempty) { for (i in files) print i; }; }'`; \ | ||
372 | test -z "$(CTAGS_ARGS)$$tags$$unique" \ | ||
373 | || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ | ||
374 | $$tags $$unique | ||
375 | |||
376 | GTAGS: | ||
377 | here=`$(am__cd) $(top_builddir) && pwd` \ | ||
378 | && cd $(top_srcdir) \ | ||
379 | && gtags -i $(GTAGS_ARGS) $$here | ||
380 | |||
381 | distclean-tags: | ||
382 | -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags | ||
383 | |||
384 | distdir: $(DISTFILES) | ||
385 | @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ | ||
386 | topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ | ||
387 | list='$(DISTFILES)'; \ | ||
388 | dist_files=`for file in $$list; do echo $$file; done | \ | ||
389 | sed -e "s|^$$srcdirstrip/||;t" \ | ||
390 | -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ | ||
391 | case $$dist_files in \ | ||
392 | */*) $(MKDIR_P) `echo "$$dist_files" | \ | ||
393 | sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ | ||
394 | sort -u` ;; \ | ||
395 | esac; \ | ||
396 | for file in $$dist_files; do \ | ||
397 | if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ | ||
398 | if test -d $$d/$$file; then \ | ||
399 | dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ | ||
400 | if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ | ||
401 | cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ | ||
402 | fi; \ | ||
403 | cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ | ||
404 | else \ | ||
405 | test -f $(distdir)/$$file \ | ||
406 | || cp -p $$d/$$file $(distdir)/$$file \ | ||
407 | || exit 1; \ | ||
408 | fi; \ | ||
409 | done | ||
410 | check-am: all-am | ||
411 | check: check-am | ||
412 | all-am: Makefile $(LTLIBRARIES) | ||
413 | installdirs: | ||
414 | for dir in "$(DESTDIR)$(pluginimpdir)"; do \ | ||
415 | test -z "$$dir" || $(MKDIR_P) "$$dir"; \ | ||
416 | done | ||
417 | install: install-am | ||
418 | install-exec: install-exec-am | ||
419 | install-data: install-data-am | ||
420 | uninstall: uninstall-am | ||
421 | |||
422 | install-am: all-am | ||
423 | @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am | ||
424 | |||
425 | installcheck: installcheck-am | ||
426 | install-strip: | ||
427 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ | ||
428 | install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ | ||
429 | `test -z '$(STRIP)' || \ | ||
430 | echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install | ||
431 | mostlyclean-generic: | ||
432 | |||
433 | clean-generic: | ||
434 | |||
435 | distclean-generic: | ||
436 | -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) | ||
437 | |||
438 | maintainer-clean-generic: | ||
439 | @echo "This command is intended for maintainers to use" | ||
440 | @echo "it deletes files that may require special tools to rebuild." | ||
441 | clean: clean-am | ||
442 | |||
443 | clean-am: clean-generic clean-libtool clean-pluginimpLTLIBRARIES \ | ||
444 | mostlyclean-am | ||
445 | |||
446 | distclean: distclean-am | ||
447 | -rm -rf ./$(DEPDIR) | ||
448 | -rm -f Makefile | ||
449 | distclean-am: clean-am distclean-compile distclean-generic \ | ||
450 | distclean-tags | ||
451 | |||
452 | dvi: dvi-am | ||
453 | |||
454 | dvi-am: | ||
455 | |||
456 | html: html-am | ||
457 | |||
458 | info: info-am | ||
459 | |||
460 | info-am: | ||
461 | |||
462 | install-data-am: install-pluginimpLTLIBRARIES | ||
463 | |||
464 | install-dvi: install-dvi-am | ||
465 | |||
466 | install-exec-am: | ||
467 | |||
468 | install-html: install-html-am | ||
469 | |||
470 | install-info: install-info-am | ||
471 | |||
472 | install-man: | ||
473 | |||
474 | install-pdf: install-pdf-am | ||
475 | |||
476 | install-ps: install-ps-am | ||
477 | |||
478 | installcheck-am: | ||
479 | |||
480 | maintainer-clean: maintainer-clean-am | ||
481 | -rm -rf ./$(DEPDIR) | ||
482 | -rm -f Makefile | ||
483 | maintainer-clean-am: distclean-am maintainer-clean-generic | ||
484 | |||
485 | mostlyclean: mostlyclean-am | ||
486 | |||
487 | mostlyclean-am: mostlyclean-compile mostlyclean-generic \ | ||
488 | mostlyclean-libtool | ||
489 | |||
490 | pdf: pdf-am | ||
491 | |||
492 | pdf-am: | ||
493 | |||
494 | ps: ps-am | ||
495 | |||
496 | ps-am: | ||
497 | |||
498 | uninstall-am: uninstall-pluginimpLTLIBRARIES | ||
499 | |||
500 | .MAKE: install-am install-strip | ||
501 | |||
502 | .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ | ||
503 | clean-libtool clean-pluginimpLTLIBRARIES ctags distclean \ | ||
504 | distclean-compile distclean-generic distclean-libtool \ | ||
505 | distclean-tags distdir dvi dvi-am html html-am info info-am \ | ||
506 | install install-am install-data install-data-am install-dvi \ | ||
507 | install-dvi-am install-exec install-exec-am install-html \ | ||
508 | install-html-am install-info install-info-am install-man \ | ||
509 | install-pdf install-pdf-am install-pluginimpLTLIBRARIES \ | ||
510 | install-ps install-ps-am install-strip installcheck \ | ||
511 | installcheck-am installdirs maintainer-clean \ | ||
512 | maintainer-clean-generic mostlyclean mostlyclean-compile \ | ||
513 | mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ | ||
514 | tags uninstall uninstall-am uninstall-pluginimpLTLIBRARIES | ||
515 | |||
516 | # Tell versions [3.59,3.63) of GNU make to not export all variables. | ||
517 | # Otherwise a system limit (for SysV at least) may be exceeded. | ||
518 | .NOEXPORT: | ||
diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dae/imp_dae.c b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dae/imp_dae.c new file mode 100644 index 0000000..c478d6e --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dae/imp_dae.c | |||
@@ -0,0 +1,126 @@ | |||
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 <string.h> | ||
24 | #include <locale.h> | ||
25 | |||
26 | #include <libxml/parser.h> | ||
27 | #include <libxml/tree.h> | ||
28 | |||
29 | #include <g3d/stream.h> | ||
30 | #include <g3d/types.h> | ||
31 | |||
32 | #include "imp_dae_xml.h" | ||
33 | #include "imp_dae_library.h" | ||
34 | #include "imp_dae_cb.h" | ||
35 | |||
36 | static int dae_input_read_cb(gpointer ctx, gchar *buffer, gint len) | ||
37 | { | ||
38 | return g3d_stream_read((G3DStream *)ctx, buffer, len); | ||
39 | } | ||
40 | |||
41 | static gboolean dae_load_scene(G3DContext *context, G3DStream *stream, | ||
42 | G3DModel *model, DaeLibrary *lib, xmlDocPtr xmldoc); | ||
43 | |||
44 | /*****************************************************************************/ | ||
45 | |||
46 | EAPI | ||
47 | gboolean plugin_load_model_from_stream(G3DContext *context, G3DStream *stream, | ||
48 | G3DModel *model, gpointer user_data) | ||
49 | { | ||
50 | xmlDocPtr xmldoc; | ||
51 | DaeLibrary *lib; | ||
52 | gboolean retval = FALSE; | ||
53 | |||
54 | setlocale(LC_NUMERIC, "C"); | ||
55 | xmlInitParser(); | ||
56 | |||
57 | xmldoc = xmlReadIO(dae_input_read_cb, NULL, stream, stream->uri, NULL, 0); | ||
58 | if(xmldoc) { | ||
59 | lib = dae_library_load(xmldoc); | ||
60 | retval = dae_load_scene(context, stream, model, lib, xmldoc); | ||
61 | |||
62 | dae_library_cleanup(lib); | ||
63 | xmlFreeDoc(xmldoc); | ||
64 | } | ||
65 | |||
66 | xmlCleanupParser(); | ||
67 | return retval; | ||
68 | } | ||
69 | |||
70 | EAPI | ||
71 | gchar *plugin_description(void) | ||
72 | { | ||
73 | return g_strdup("COLLADA models."); | ||
74 | } | ||
75 | |||
76 | EAPI | ||
77 | gchar **plugin_extensions(void) | ||
78 | { | ||
79 | return g_strsplit("dae", ":", 0); | ||
80 | } | ||
81 | |||
82 | /*****************************************************************************/ | ||
83 | /* COLLADA specific stuff */ | ||
84 | |||
85 | static gboolean dae_load_scene(G3DContext *context, G3DStream *stream, | ||
86 | G3DModel *model, DaeLibrary *lib, xmlDocPtr xmldoc) | ||
87 | { | ||
88 | DaeGlobalData *global; | ||
89 | DaeLocalData *local; | ||
90 | xmlNodePtr scenenode, node = NULL, instance = NULL; | ||
91 | gchar *name; | ||
92 | |||
93 | scenenode = dae_xml_get_child_by_tagname( | ||
94 | xmlDocGetRootElement(xmldoc), "scene"); | ||
95 | |||
96 | if(scenenode == NULL) { | ||
97 | g_warning("DAE: could not get scene node"); | ||
98 | return FALSE; | ||
99 | } | ||
100 | |||
101 | global = g_new0(DaeGlobalData, 1); | ||
102 | global->context = context; | ||
103 | global->stream = stream; | ||
104 | global->model = model; | ||
105 | global->xmldoc = xmldoc; | ||
106 | global->lib = lib; | ||
107 | |||
108 | while(dae_xml_next_child(lib, scenenode, &node, &instance, &name)) { | ||
109 | #if DEBUG > 2 | ||
110 | g_debug("DAE: got node %s", name); | ||
111 | #endif | ||
112 | if(strcmp(name, "visual_scene") == 0) { | ||
113 | local = g_new0(DaeLocalData, 1); | ||
114 | local->node = node; | ||
115 | local->instance = instance; | ||
116 | local->parent = scenenode; | ||
117 | dae_cb_visual_scene(global, local); | ||
118 | g_free(local); | ||
119 | } | ||
120 | g_free(name); | ||
121 | } | ||
122 | |||
123 | g_free(global); | ||
124 | |||
125 | return TRUE; | ||
126 | } | ||
diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dae/imp_dae_cb.c b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dae/imp_dae_cb.c new file mode 100644 index 0000000..d6aea7d --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dae/imp_dae_cb.c | |||
@@ -0,0 +1,877 @@ | |||
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 <string.h> | ||
24 | |||
25 | #include <g3d/config.h> | ||
26 | |||
27 | #include <g3d/types.h> | ||
28 | #include <g3d/material.h> | ||
29 | #include <g3d/matrix.h> | ||
30 | #include <g3d/object.h> | ||
31 | #include <g3d/texture.h> | ||
32 | #include <g3d/stream.h> | ||
33 | |||
34 | #include "imp_dae_cb.h" | ||
35 | #include "imp_dae_chunks.h" | ||
36 | #include "imp_dae_xml.h" | ||
37 | |||
38 | typedef struct { | ||
39 | guint32 offset; | ||
40 | enum { | ||
41 | SEM_UNKNOWN, | ||
42 | SEM_VERTEX, | ||
43 | SEM_NORMAL, | ||
44 | SEM_TEXCOORD | ||
45 | } semantic; | ||
46 | gchar *source; | ||
47 | } DaeInput; | ||
48 | |||
49 | /*****************************************************************************/ | ||
50 | |||
51 | static G3DMaterial *dae_get_material_by_name(DaeGlobalData *global, | ||
52 | const gchar *id, guint32 level) | ||
53 | { | ||
54 | G3DMaterial *material; | ||
55 | GSList *mitem; | ||
56 | xmlNodePtr matnode; | ||
57 | |||
58 | /* try to find material */ | ||
59 | for(mitem = global->model->materials; mitem != NULL; mitem = mitem->next) { | ||
60 | material = (G3DMaterial *)mitem->data; | ||
61 | if(strcmp(material->name, id) == 0) | ||
62 | return material; | ||
63 | } | ||
64 | |||
65 | material = g3d_material_new(); | ||
66 | material->name = g_strdup(id); | ||
67 | global->model->materials = g_slist_append(global->model->materials, | ||
68 | material); | ||
69 | |||
70 | /* find material in library */ | ||
71 | matnode = dae_library_lookup(global->lib, "symbol", id); | ||
72 | |||
73 | if(matnode) { | ||
74 | dae_xml_parse(global, matnode, dae_chunks_material, | ||
75 | level, material); | ||
76 | } | ||
77 | return material; | ||
78 | } | ||
79 | |||
80 | static GSList *dae_get_inputs(xmlNodePtr node) | ||
81 | { | ||
82 | xmlNodePtr inode = NULL; | ||
83 | gchar *soff, *ssem; | ||
84 | DaeInput *input; | ||
85 | GSList *inputs = NULL; | ||
86 | |||
87 | while(dae_xml_next_child_by_tagname(node, &inode, "input")) { | ||
88 | input = g_new0(DaeInput, 1); | ||
89 | soff = dae_xml_get_attr(inode, "offset"); | ||
90 | if(soff) { | ||
91 | input->offset = atoi(soff); | ||
92 | g_free(soff); | ||
93 | } | ||
94 | ssem = dae_xml_get_attr(inode, "semantic"); | ||
95 | if(ssem) { | ||
96 | if(strcmp(ssem, "VERTEX") == 0) | ||
97 | input->semantic = SEM_VERTEX; | ||
98 | else if(strcmp(ssem, "NORMAL") == 0) | ||
99 | input->semantic = SEM_NORMAL; | ||
100 | else if(strcmp(ssem, "TEXCOORD") == 0) | ||
101 | input->semantic = SEM_TEXCOORD; | ||
102 | else { | ||
103 | g_warning("DAE: unknown input semantic '%s'", ssem); | ||
104 | input->semantic = SEM_UNKNOWN; | ||
105 | } | ||
106 | g_free(ssem); | ||
107 | } | ||
108 | input->source = dae_xml_get_attr(inode, "source"); | ||
109 | inputs = g_slist_append(inputs, input); | ||
110 | } | ||
111 | return inputs; | ||
112 | } | ||
113 | |||
114 | static void dae_inputs_free(GSList *inputs) | ||
115 | { | ||
116 | GSList *item; | ||
117 | DaeInput *input; | ||
118 | |||
119 | for(item = inputs; item != NULL; item = item->next) { | ||
120 | input = (DaeInput *)item->data; | ||
121 | if(input->source) | ||
122 | g_free(input->source); | ||
123 | g_free(input); | ||
124 | item->data = NULL; | ||
125 | } | ||
126 | g_slist_free(inputs); | ||
127 | } | ||
128 | |||
129 | static gboolean dae_load_source(DaeLibrary *lib, gchar *id, | ||
130 | G3DFloat **asrc, guint32 *nsrc) | ||
131 | { | ||
132 | xmlNodePtr snode, fnode; | ||
133 | gchar *scnt, *next = NULL; | ||
134 | gint i; | ||
135 | |||
136 | snode = dae_library_lookup(lib, "source", id + 1); | ||
137 | #if DEBUG > 0 | ||
138 | g_debug("DAE: source '%s': %p", id + 1, (void *)snode); | ||
139 | #endif | ||
140 | if(snode == NULL) | ||
141 | return FALSE; | ||
142 | |||
143 | fnode = dae_xml_get_child_by_tagname(snode, "float_array"); | ||
144 | if(fnode == NULL) | ||
145 | return FALSE; | ||
146 | |||
147 | scnt = dae_xml_get_attr(fnode, "count"); | ||
148 | #if DEBUG > 0 | ||
149 | g_debug("DAE: float_array count=\"%s\"", scnt); | ||
150 | #endif | ||
151 | if(scnt == NULL) | ||
152 | return FALSE; | ||
153 | *nsrc = atoi(scnt); | ||
154 | g_free(scnt); | ||
155 | if(*nsrc == 0) | ||
156 | return FALSE; | ||
157 | |||
158 | *asrc = g_new0(G3DFloat, *nsrc); | ||
159 | for(i = 0; i < *nsrc; i ++) | ||
160 | #if G3D_FLOAT_IS_DOUBLE | ||
161 | if(!dae_xml_next_double(fnode, &next, &((*asrc)[i]))) | ||
162 | #else | ||
163 | if(!dae_xml_next_float(fnode, &next, &((*asrc)[i]))) | ||
164 | #endif | ||
165 | return FALSE; | ||
166 | |||
167 | return TRUE; | ||
168 | } | ||
169 | |||
170 | /*****************************************************************************/ | ||
171 | |||
172 | gboolean dae_cb_bind_material(DaeGlobalData *global, DaeLocalData *local) | ||
173 | { | ||
174 | return dae_xml_parse(global, local->node, dae_chunks_bind_material, | ||
175 | local->level, local->user_data); | ||
176 | } | ||
177 | |||
178 | gboolean dae_cb_effect(DaeGlobalData *global, DaeLocalData *local) | ||
179 | { | ||
180 | return dae_xml_parse(global, local->node, dae_chunks_effect, | ||
181 | local->level, local->user_data); | ||
182 | } | ||
183 | |||
184 | gboolean dae_cb_geometry(DaeGlobalData *global, DaeLocalData *local) | ||
185 | { | ||
186 | G3DObject *object; | ||
187 | G3DMaterial *material; | ||
188 | |||
189 | object = (G3DObject *)local->user_data; | ||
190 | g_return_val_if_fail(object != NULL, FALSE); | ||
191 | |||
192 | material = g3d_material_new(); | ||
193 | material->name = g_strdup("(default material)"); | ||
194 | object->materials = g_slist_append(object->materials, material); | ||
195 | |||
196 | if(local->instance) { | ||
197 | /* parse original node */ | ||
198 | dae_xml_parse(global, local->instance, | ||
199 | dae_chunks_geometry, local->level, object); | ||
200 | } | ||
201 | |||
202 | /* parse instanced stuff */ | ||
203 | return dae_xml_parse(global, local->node, dae_chunks_geometry, | ||
204 | local->level, object); | ||
205 | } | ||
206 | |||
207 | gboolean dae_cb_matrix(DaeGlobalData *global, DaeLocalData *local) | ||
208 | { | ||
209 | G3DObject *object = local->user_data; | ||
210 | G3DTransformation *transform; | ||
211 | gchar *next = NULL; | ||
212 | gint i; | ||
213 | |||
214 | g_return_val_if_fail(object != NULL, FALSE); | ||
215 | |||
216 | transform = object->transformation; | ||
217 | if(transform == NULL) { | ||
218 | transform = g_new0(G3DTransformation, 1); | ||
219 | g3d_matrix_identity(transform->matrix); | ||
220 | object->transformation = transform; | ||
221 | } | ||
222 | |||
223 | for(i = 0; i < 16; i ++) | ||
224 | #if G3D_FLOAT_IS_DOUBLE | ||
225 | dae_xml_next_double(local->node, &next, transform->matrix + i); | ||
226 | #else | ||
227 | dae_xml_next_float(local->node, &next, transform->matrix + i); | ||
228 | #endif | ||
229 | g3d_matrix_transpose(transform->matrix); | ||
230 | #if DEBUG > 3 | ||
231 | g_debug("DAE: matrix for '%s':", object->name); | ||
232 | g3d_matrix_dump(transform->matrix); | ||
233 | #endif | ||
234 | return TRUE; | ||
235 | } | ||
236 | |||
237 | gboolean dae_cb_mesh(DaeGlobalData *global, DaeLocalData *local) | ||
238 | { | ||
239 | return dae_xml_parse(global, local->node, dae_chunks_mesh, | ||
240 | local->level, local->user_data); | ||
241 | } | ||
242 | |||
243 | gboolean dae_cb_newparam(DaeGlobalData *global, DaeLocalData *local) | ||
244 | { | ||
245 | G3DMaterial *material = (G3DMaterial *)local->user_data; | ||
246 | G3DStream *imgstream = NULL; | ||
247 | xmlNodePtr n1, n2; | ||
248 | gchar *siid = NULL, *filename, *subfile; | ||
249 | #ifdef HAVE_LIBGSF | ||
250 | gchar *container, *pipe; | ||
251 | #endif | ||
252 | |||
253 | g_return_val_if_fail(material != NULL, FALSE); | ||
254 | |||
255 | n1 = dae_xml_get_child_by_tagname(local->node, "surface"); | ||
256 | if(n1 != NULL) { | ||
257 | n2 = dae_xml_get_child_by_tagname(n1, "init_from"); | ||
258 | if(n2 != NULL) | ||
259 | siid = g_strdup((gchar *)n2->children->content); | ||
260 | } | ||
261 | if(siid == NULL) | ||
262 | return FALSE; | ||
263 | |||
264 | n1 = dae_library_lookup(global->lib, "image", siid); | ||
265 | g_free(siid); | ||
266 | if(n1 == NULL) | ||
267 | return FALSE; | ||
268 | |||
269 | n2 = dae_xml_get_child_by_tagname(n1, "init_from"); | ||
270 | if(n2 == NULL) | ||
271 | return FALSE; | ||
272 | |||
273 | filename = (gchar *)n2->children->content; | ||
274 | |||
275 | if(strncmp(global->stream->uri, "zip://", 6) == 0) { | ||
276 | #ifdef HAVE_LIBGSF | ||
277 | /* .dae was loaded from .kmz, get texture from .kmz, too */ | ||
278 | pipe = strchr(global->stream->uri, '|'); | ||
279 | if(pipe != NULL) { | ||
280 | container = g_strndup(global->stream->uri + 6, | ||
281 | (pipe - global->stream->uri) - 6); | ||
282 | subfile = filename; | ||
283 | while(strncmp(subfile, "../", 3) == 0) | ||
284 | subfile += 3; | ||
285 | g_debug("DAE: loading '%s' from: '%s'", subfile, container); | ||
286 | imgstream = g3d_stream_open_zip_from_stream(global->stream->zip_container, subfile); | ||
287 | } | ||
288 | #endif | ||
289 | } else { | ||
290 | imgstream = g3d_stream_open_file(filename, "rb"); | ||
291 | if(imgstream == NULL) { | ||
292 | /* if opened from unpacked doc.kml, textures are found in | ||
293 | * ../images/, so strip leading ../ */ | ||
294 | subfile = filename; | ||
295 | while(strncmp(subfile, "../", 3) == 0) | ||
296 | subfile += 3; | ||
297 | imgstream = g3d_stream_open_file(subfile, "rb"); | ||
298 | } | ||
299 | } | ||
300 | |||
301 | if(imgstream != NULL) { | ||
302 | material->tex_image = g3d_texture_load_from_stream(global->context, | ||
303 | global->model, imgstream); | ||
304 | if(material->tex_image) { | ||
305 | material->tex_image->tex_env = G3D_TEXENV_DECAL; | ||
306 | } | ||
307 | g3d_stream_close(imgstream); | ||
308 | return TRUE; | ||
309 | } | ||
310 | |||
311 | return FALSE; | ||
312 | } | ||
313 | |||
314 | gboolean dae_cb_node(DaeGlobalData *global, DaeLocalData *local) | ||
315 | { | ||
316 | G3DObject *object, *pobject; | ||
317 | G3DMatrix matrix[16]; | ||
318 | gchar *name; | ||
319 | |||
320 | name = dae_xml_get_attr(local->node, "name"); | ||
321 | if(name == NULL) | ||
322 | name = dae_xml_get_attr(local->node, "id"); | ||
323 | if(name == NULL) | ||
324 | return FALSE; | ||
325 | |||
326 | pobject = (G3DObject *)local->user_data; | ||
327 | object = g_new0(G3DObject, 1); | ||
328 | object->name = name; | ||
329 | if(pobject) | ||
330 | pobject->objects = g_slist_append(pobject->objects, object); | ||
331 | else | ||
332 | global->model->objects = g_slist_append(global->model->objects, | ||
333 | object); | ||
334 | |||
335 | if(dae_xml_parse(global, local->node, dae_chunks_node, local->level, | ||
336 | object)) { | ||
337 | if(object->transformation) { | ||
338 | g3d_object_transform(object, object->transformation->matrix); | ||
339 | #if DEBUG > 3 | ||
340 | g_debug("DAE: transforming object '%s'", object->name); | ||
341 | g3d_matrix_dump(object->transformation->matrix); | ||
342 | #endif | ||
343 | g_free(object->transformation); | ||
344 | object->transformation = NULL; | ||
345 | } | ||
346 | |||
347 | if(!pobject) { | ||
348 | g3d_matrix_identity(matrix); | ||
349 | g3d_matrix_rotate(-90.0 * G_PI / 180.0, 1.0, 0.0, 0.0, matrix); | ||
350 | g3d_object_transform(object, matrix); | ||
351 | } | ||
352 | return TRUE; | ||
353 | } | ||
354 | return FALSE; | ||
355 | } | ||
356 | |||
357 | gboolean dae_cb_phong(DaeGlobalData *global, DaeLocalData *local) | ||
358 | { | ||
359 | G3DMaterial *material = (G3DMaterial *)local->user_data; | ||
360 | xmlNodePtr n1, n2; | ||
361 | gchar *next; | ||
362 | |||
363 | g_return_val_if_fail(material != NULL, FALSE); | ||
364 | |||
365 | /* diffuse */ | ||
366 | n1 = dae_xml_get_child_by_tagname(local->node, "diffuse"); | ||
367 | if(n1 != NULL) { | ||
368 | n2 = dae_xml_get_child_by_tagname(n1, "color"); | ||
369 | if(n2 != NULL) { | ||
370 | next = NULL; | ||
371 | #if G3D_FLOAT_IS_DOUBLE | ||
372 | dae_xml_next_double(n2, &next, &(material->r)); | ||
373 | dae_xml_next_double(n2, &next, &(material->g)); | ||
374 | dae_xml_next_double(n2, &next, &(material->b)); | ||
375 | dae_xml_next_double(n2, &next, &(material->a)); | ||
376 | #else | ||
377 | dae_xml_next_float(n2, &next, &(material->r)); | ||
378 | dae_xml_next_float(n2, &next, &(material->g)); | ||
379 | dae_xml_next_float(n2, &next, &(material->b)); | ||
380 | dae_xml_next_float(n2, &next, &(material->a)); | ||
381 | #endif | ||
382 | } | ||
383 | } | ||
384 | |||
385 | /* specular */ | ||
386 | n1 = dae_xml_get_child_by_tagname(local->node, "specular"); | ||
387 | if(n1 != NULL) { | ||
388 | n2 = dae_xml_get_child_by_tagname(n1, "color"); | ||
389 | if(n2 != NULL) { | ||
390 | next = NULL; | ||
391 | /* These are floats either way. */ | ||
392 | dae_xml_next_float(n2, &next, &(material->specular[0])); | ||
393 | dae_xml_next_float(n2, &next, &(material->specular[1])); | ||
394 | dae_xml_next_float(n2, &next, &(material->specular[2])); | ||
395 | dae_xml_next_float(n2, &next, &(material->specular[3])); | ||
396 | } | ||
397 | } | ||
398 | |||
399 | return TRUE; | ||
400 | } | ||
401 | |||
402 | gboolean dae_cb_polylist(DaeGlobalData *global, DaeLocalData *local) | ||
403 | { | ||
404 | G3DObject *object = local->user_data; | ||
405 | G3DFace *face; | ||
406 | G3DMaterial *material; | ||
407 | xmlNodePtr pnode, vnode; | ||
408 | gchar *scnt, *smat, *nextp = NULL, *nextv = NULL; | ||
409 | guint32 count, normal_count, tex_count, flags = 0; | ||
410 | gint i, j, nv, tmp; | ||
411 | GSList *inputs, *item; | ||
412 | DaeInput *input; | ||
413 | G3DFloat *normal_data = NULL, *tex_data = NULL; | ||
414 | |||
415 | g_return_val_if_fail(object != NULL, FALSE); | ||
416 | |||
417 | scnt = dae_xml_get_attr(local->node, "count"); | ||
418 | g_return_val_if_fail(scnt != NULL, FALSE); | ||
419 | count = atoi(scnt); | ||
420 | g_free(scnt); | ||
421 | g_return_val_if_fail(count != 0, FALSE); | ||
422 | |||
423 | pnode = dae_xml_get_child_by_tagname(local->node, "p"); | ||
424 | vnode = dae_xml_get_child_by_tagname(local->node, "vcount"); | ||
425 | g_return_val_if_fail((pnode != NULL) && (vnode != NULL), FALSE); | ||
426 | |||
427 | /* material */ | ||
428 | material = g_slist_nth_data(object->materials, 0); | ||
429 | smat = dae_xml_get_attr(local->node, "material"); | ||
430 | if(smat != NULL) { | ||
431 | material = dae_get_material_by_name(global, smat, local->level); | ||
432 | g_free(smat); | ||
433 | } | ||
434 | |||
435 | /* get all inputs */ | ||
436 | inputs = dae_get_inputs(local->node); | ||
437 | for(item = inputs; item != NULL; item = item->next) { | ||
438 | input = (DaeInput *)item->data; | ||
439 | if(input->semantic == SEM_NORMAL) | ||
440 | if(dae_load_source(global->lib, input->source, | ||
441 | &normal_data, &normal_count)) | ||
442 | flags |= G3D_FLAG_FAC_NORMALS; | ||
443 | if(input->semantic == SEM_TEXCOORD) | ||
444 | if(dae_load_source(global->lib, input->source, | ||
445 | &tex_data, &tex_count) && (material->tex_image != NULL)) | ||
446 | flags |= G3D_FLAG_FAC_TEXMAP; | ||
447 | } | ||
448 | |||
449 | for(i = 0; i < count; i ++) { | ||
450 | if(dae_xml_next_int(vnode, &nextv, &nv) && (nv > 0)) { | ||
451 | face = g_new0(G3DFace, 1); | ||
452 | face->vertex_count = nv; | ||
453 | face->vertex_indices = g_new0(guint32, nv); | ||
454 | face->material = material; | ||
455 | face->flags = flags; | ||
456 | object->faces = g_slist_append(object->faces, face); | ||
457 | |||
458 | if(face->flags & G3D_FLAG_FAC_NORMALS) { | ||
459 | face->normals = g_new0(G3DFloat, nv * 3); | ||
460 | } | ||
461 | if(face->flags & G3D_FLAG_FAC_TEXMAP) { | ||
462 | face->tex_image = material->tex_image; | ||
463 | face->tex_vertex_count = nv; | ||
464 | face->tex_vertex_data = g_new0(G3DFloat, nv * 2); | ||
465 | } | ||
466 | |||
467 | for(j = 0; j < nv; j ++) { | ||
468 | for(item = inputs; item != NULL; item = item->next) { | ||
469 | input = (DaeInput *)item->data; | ||
470 | dae_xml_next_int(pnode, &nextp, &tmp); | ||
471 | switch(input->semantic) { | ||
472 | case SEM_VERTEX: | ||
473 | face->vertex_indices[j] = tmp; | ||
474 | if(face->vertex_indices[j] >= object->vertex_count) | ||
475 | { | ||
476 | g_warning("polylist: [%s] face[%d] (%d) >= %d", | ||
477 | object->name, j, face->vertex_indices[j], | ||
478 | object->vertex_count); | ||
479 | face->vertex_indices[j] = 0; | ||
480 | } | ||
481 | break; | ||
482 | case SEM_NORMAL: | ||
483 | if(flags & G3D_FLAG_FAC_NORMALS) { | ||
484 | face->normals[j * 3 + 0] = | ||
485 | normal_data[tmp * 3 + 0]; | ||
486 | face->normals[j * 3 + 1] = | ||
487 | normal_data[tmp * 3 + 1]; | ||
488 | face->normals[j * 3 + 2] = | ||
489 | normal_data[tmp * 3 + 2]; | ||
490 | } | ||
491 | break; | ||
492 | case SEM_TEXCOORD: | ||
493 | if(flags & G3D_FLAG_FAC_TEXMAP) { | ||
494 | face->tex_vertex_data[j * 2 + 0] = | ||
495 | tex_data[tmp * 2 + 0]; | ||
496 | face->tex_vertex_data[j * 2 + 1] = 1.0 - | ||
497 | tex_data[tmp * 2 + 1]; | ||
498 | } | ||
499 | break; | ||
500 | case SEM_UNKNOWN: | ||
501 | break; | ||
502 | } | ||
503 | } /* inputs */ | ||
504 | } | ||
505 | #if DEBUG > 3 | ||
506 | g_debug("DAE: %-2i, %-2i, %-2i, (%-2i)", | ||
507 | face->vertex_indices[0], | ||
508 | face->vertex_indices[1], | ||
509 | face->vertex_indices[2], | ||
510 | ((nv > 3) ? face->vertex_indices[3] : -1)); | ||
511 | #endif | ||
512 | } | ||
513 | } | ||
514 | |||
515 | if(tex_data) | ||
516 | g_free(tex_data); | ||
517 | if(normal_data) | ||
518 | g_free(normal_data); | ||
519 | dae_inputs_free(inputs); | ||
520 | |||
521 | return TRUE; | ||
522 | } | ||
523 | |||
524 | gboolean dae_cb_profile_COMMON(DaeGlobalData *global, DaeLocalData *local) | ||
525 | { | ||
526 | return dae_xml_parse(global, local->node, dae_chunks_profile_COMMON, | ||
527 | local->level, local->user_data); | ||
528 | } | ||
529 | |||
530 | gboolean dae_cb_rotate(DaeGlobalData *global, DaeLocalData *local) | ||
531 | { | ||
532 | G3DObject *object = local->user_data; | ||
533 | G3DTransformation *transform; | ||
534 | G3DFloat x = 0.0, y = 0.0, z = 0.0, a = 0.0, m[16]; | ||
535 | gchar *next = NULL; | ||
536 | |||
537 | g_return_val_if_fail(object != NULL, FALSE); | ||
538 | |||
539 | transform = object->transformation; | ||
540 | if(transform == NULL) { | ||
541 | transform = g_new0(G3DTransformation, 1); | ||
542 | g3d_matrix_identity(transform->matrix); | ||
543 | object->transformation = transform; | ||
544 | } | ||
545 | |||
546 | #if G3D_FLOAT_IS_DOUBLE | ||
547 | dae_xml_next_double(local->node, &next, &x); | ||
548 | dae_xml_next_double(local->node, &next, &y); | ||
549 | dae_xml_next_double(local->node, &next, &z); | ||
550 | dae_xml_next_double(local->node, &next, &a); | ||
551 | #else | ||
552 | dae_xml_next_float(local->node, &next, &x); | ||
553 | dae_xml_next_float(local->node, &next, &y); | ||
554 | dae_xml_next_float(local->node, &next, &z); | ||
555 | dae_xml_next_float(local->node, &next, &a); | ||
556 | #endif | ||
557 | g_return_val_if_fail((x != 0.0) || (y != 0.0) || (z != 0.0), FALSE); | ||
558 | g3d_matrix_rotate(a, x, y, z, m); | ||
559 | g3d_matrix_multiply(transform->matrix, m, transform->matrix); | ||
560 | #if DEBUG > 3 | ||
561 | g_debug("DAE: rotation for '%s': %.2f, %.2f, %.2f - %.2f", object->name, | ||
562 | x, y, z, a); | ||
563 | g3d_matrix_dump(transform->matrix); | ||
564 | #endif | ||
565 | return TRUE; | ||
566 | } | ||
567 | |||
568 | gboolean dae_cb_scale(DaeGlobalData *global, DaeLocalData *local) | ||
569 | { | ||
570 | G3DObject *object = local->user_data; | ||
571 | G3DTransformation *transform; | ||
572 | G3DFloat x = 0.0, y = 0.0, z = 0.0; | ||
573 | gchar *next = NULL; | ||
574 | |||
575 | g_return_val_if_fail(object != NULL, FALSE); | ||
576 | |||
577 | transform = object->transformation; | ||
578 | if(transform == NULL) { | ||
579 | transform = g_new0(G3DTransformation, 1); | ||
580 | g3d_matrix_identity(transform->matrix); | ||
581 | object->transformation = transform; | ||
582 | } | ||
583 | |||
584 | #if G3D_FLOAT_IS_DOUBLE | ||
585 | dae_xml_next_double(local->node, &next, &x); | ||
586 | dae_xml_next_double(local->node, &next, &y); | ||
587 | dae_xml_next_double(local->node, &next, &z); | ||
588 | #else | ||
589 | dae_xml_next_float(local->node, &next, &x); | ||
590 | dae_xml_next_float(local->node, &next, &y); | ||
591 | dae_xml_next_float(local->node, &next, &z); | ||
592 | #endif | ||
593 | g3d_matrix_scale(x, y, z, transform->matrix); | ||
594 | #if DEBUG > 3 | ||
595 | g_debug("DAE: scale for '%s': %.2f, %.2f, %.2f", object->name, | ||
596 | x, y, z); | ||
597 | g3d_matrix_dump(transform->matrix); | ||
598 | #endif | ||
599 | return TRUE; | ||
600 | } | ||
601 | |||
602 | gboolean dae_cb_source(DaeGlobalData *global, DaeLocalData *local) | ||
603 | { | ||
604 | gchar *id; | ||
605 | |||
606 | id = dae_xml_get_attr(local->node, "id"); | ||
607 | if(id) { | ||
608 | dae_library_add(global->lib, "source", id, local->node); | ||
609 | g_free(id); | ||
610 | return TRUE; | ||
611 | } | ||
612 | return FALSE; | ||
613 | } | ||
614 | |||
615 | gboolean dae_cb_technique(DaeGlobalData *global, DaeLocalData *local) | ||
616 | { | ||
617 | return dae_xml_parse(global, local->node, dae_chunks_technique, | ||
618 | local->level, local->user_data); | ||
619 | } | ||
620 | |||
621 | /* instance_geometry::bind_material::technique_common */ | ||
622 | gboolean dae_cb_technique_common(DaeGlobalData *global, DaeLocalData *local) | ||
623 | { | ||
624 | xmlNodePtr node = NULL, tnode; | ||
625 | gchar *symbol, *target; | ||
626 | |||
627 | while(dae_xml_next_child_by_tagname(local->node, &node, | ||
628 | "instance_material")) { | ||
629 | symbol = dae_xml_get_attr(node, "symbol"); | ||
630 | if(symbol == NULL) | ||
631 | continue; | ||
632 | target = dae_xml_get_attr(node, "target"); | ||
633 | if(target == NULL) { | ||
634 | g_free(symbol); | ||
635 | continue; | ||
636 | } | ||
637 | tnode = dae_library_lookup(global->lib, "material", target + 1); | ||
638 | if(tnode) | ||
639 | dae_library_add(global->lib, "symbol", symbol, tnode); | ||
640 | g_free(symbol); | ||
641 | g_free(target); | ||
642 | } | ||
643 | return TRUE; | ||
644 | } | ||
645 | |||
646 | gboolean dae_cb_translate(DaeGlobalData *global, DaeLocalData *local) | ||
647 | { | ||
648 | G3DObject *object = local->user_data; | ||
649 | G3DTransformation *transform; | ||
650 | G3DFloat x = 0.0, y = 0.0, z = 0.0; | ||
651 | gchar *next = NULL; | ||
652 | |||
653 | g_return_val_if_fail(object != NULL, FALSE); | ||
654 | |||
655 | transform = object->transformation; | ||
656 | if(transform == NULL) { | ||
657 | transform = g_new0(G3DTransformation, 1); | ||
658 | g3d_matrix_identity(transform->matrix); | ||
659 | object->transformation = transform; | ||
660 | } | ||
661 | |||
662 | #if G3D_FLOAT_IS_DOUBLE | ||
663 | dae_xml_next_double(local->node, &next, &x); | ||
664 | dae_xml_next_double(local->node, &next, &y); | ||
665 | dae_xml_next_double(local->node, &next, &z); | ||
666 | #else | ||
667 | dae_xml_next_float(local->node, &next, &x); | ||
668 | dae_xml_next_float(local->node, &next, &y); | ||
669 | dae_xml_next_float(local->node, &next, &z); | ||
670 | #endif | ||
671 | g3d_matrix_translate(x, y, z, transform->matrix); | ||
672 | #if DEBUG > 3 | ||
673 | g_debug("DAE: translation for '%s': %.2f, %.2f, %.2f", object->name, | ||
674 | x, y, z); | ||
675 | g3d_matrix_dump(transform->matrix); | ||
676 | #endif | ||
677 | return TRUE; | ||
678 | } | ||
679 | |||
680 | gboolean dae_cb_triangles(DaeGlobalData *global, DaeLocalData *local) | ||
681 | { | ||
682 | G3DObject *object = local->user_data; | ||
683 | G3DFace *face; | ||
684 | G3DMaterial *material; | ||
685 | xmlNodePtr pnode; | ||
686 | gchar *scnt, *smat, *nextp = NULL; | ||
687 | guint32 count, normal_count, tex_count, flags = 0; | ||
688 | G3DFloat *normal_data = NULL, *tex_data = NULL; | ||
689 | gint i, j, tmp; | ||
690 | GSList *inputs, *item; | ||
691 | DaeInput *input; | ||
692 | |||
693 | g_return_val_if_fail(object != NULL, FALSE); | ||
694 | |||
695 | scnt = dae_xml_get_attr(local->node, "count"); | ||
696 | g_return_val_if_fail(scnt != NULL, FALSE); | ||
697 | count = atoi(scnt); | ||
698 | g_return_val_if_fail(count != 0, FALSE); | ||
699 | g_free(scnt); | ||
700 | |||
701 | pnode = dae_xml_get_child_by_tagname(local->node, "p"); | ||
702 | g_return_val_if_fail(pnode != NULL, FALSE); | ||
703 | |||
704 | /* material */ | ||
705 | material = g_slist_nth_data(object->materials, 0); | ||
706 | smat = dae_xml_get_attr(local->node, "material"); | ||
707 | if(smat != NULL) { | ||
708 | material = dae_get_material_by_name(global, smat, local->level); | ||
709 | g_free(smat); | ||
710 | } | ||
711 | |||
712 | /* get all inputs */ | ||
713 | inputs = dae_get_inputs(local->node); | ||
714 | for(item = inputs; item != NULL; item = item->next) { | ||
715 | input = (DaeInput *)item->data; | ||
716 | if(input->semantic == SEM_NORMAL) | ||
717 | if(dae_load_source(global->lib, input->source, | ||
718 | &normal_data, &normal_count)) { | ||
719 | flags |= G3D_FLAG_FAC_NORMALS; | ||
720 | } | ||
721 | if(input->semantic == SEM_TEXCOORD) | ||
722 | if(dae_load_source(global->lib, input->source, | ||
723 | &tex_data, &tex_count) && (material->tex_image != NULL)) { | ||
724 | flags |= G3D_FLAG_FAC_TEXMAP; | ||
725 | } | ||
726 | } | ||
727 | |||
728 | for(i = 0; i < count; i ++) { | ||
729 | face = g_new0(G3DFace, 1); | ||
730 | face->vertex_count = 3; | ||
731 | face->vertex_indices = g_new0(guint32, 3); | ||
732 | face->material = material; | ||
733 | face->flags = flags; | ||
734 | object->faces = g_slist_append(object->faces, face); | ||
735 | |||
736 | if(face->flags & G3D_FLAG_FAC_NORMALS) { | ||
737 | face->normals = g_new0(G3DFloat, 3 * 3); | ||
738 | } | ||
739 | if(face->flags & G3D_FLAG_FAC_TEXMAP) { | ||
740 | face->tex_image = material->tex_image; | ||
741 | face->tex_vertex_count = 3; | ||
742 | face->tex_vertex_data = g_new0(G3DFloat, 3 * 2); | ||
743 | } | ||
744 | |||
745 | for(j = 0; j < 3; j ++) { | ||
746 | for(item = inputs; item != NULL; item = item->next) { | ||
747 | input = (DaeInput *)item->data; | ||
748 | dae_xml_next_int(pnode, &nextp, &tmp); | ||
749 | switch(input->semantic) { | ||
750 | case SEM_VERTEX: | ||
751 | face->vertex_indices[j] = tmp; | ||
752 | if(face->vertex_indices[j] >= object->vertex_count) { | ||
753 | g_warning("triangles: [%s] face[%d] (%d) >= %d", | ||
754 | object->name, j, face->vertex_indices[j], | ||
755 | object->vertex_count); | ||
756 | face->vertex_indices[j] = 0; | ||
757 | } | ||
758 | break; | ||
759 | case SEM_NORMAL: | ||
760 | if(flags & G3D_FLAG_FAC_NORMALS) { | ||
761 | face->normals[j * 3 + 0] = | ||
762 | normal_data[tmp * 3 + 0]; | ||
763 | face->normals[j * 3 + 1] = | ||
764 | normal_data[tmp * 3 + 1]; | ||
765 | face->normals[j * 3 + 2] = | ||
766 | normal_data[tmp * 3 + 2]; | ||
767 | } | ||
768 | break; | ||
769 | case SEM_TEXCOORD: | ||
770 | if(flags & G3D_FLAG_FAC_TEXMAP) { | ||
771 | face->tex_vertex_data[j * 2 + 0] = | ||
772 | tex_data[tmp * 2 + 0]; | ||
773 | face->tex_vertex_data[j * 2 + 1] = 1.0 - | ||
774 | tex_data[tmp * 2 + 1]; | ||
775 | } | ||
776 | break; | ||
777 | case SEM_UNKNOWN: | ||
778 | break; | ||
779 | } | ||
780 | } /* inputs */ | ||
781 | #if DEBUG > 3 | ||
782 | g_debug("DAE: %-2i, %-2i, %-2i", | ||
783 | face->vertex_indices[0], | ||
784 | face->vertex_indices[1], | ||
785 | face->vertex_indices[2]); | ||
786 | #endif | ||
787 | } | ||
788 | } | ||
789 | if(tex_data) | ||
790 | g_free(tex_data); | ||
791 | if(normal_data) | ||
792 | g_free(normal_data); | ||
793 | dae_inputs_free(inputs); | ||
794 | |||
795 | return TRUE; | ||
796 | } | ||
797 | |||
798 | gboolean dae_cb_vertices(DaeGlobalData *global, DaeLocalData *local) | ||
799 | { | ||
800 | return dae_xml_parse(global, local->node, dae_chunks_vertices, | ||
801 | local->level, local->user_data); | ||
802 | } | ||
803 | |||
804 | gboolean dae_cb_vertices__input(DaeGlobalData *global, DaeLocalData *local) | ||
805 | { | ||
806 | G3DObject *object = (G3DObject *)(local->user_data); | ||
807 | gchar *sid, *sem, *cnt, *next = NULL; | ||
808 | gboolean skip = FALSE; | ||
809 | xmlNodePtr snode, fanode; | ||
810 | gint i, j; | ||
811 | |||
812 | g_return_val_if_fail(object != NULL, FALSE); | ||
813 | |||
814 | sem = dae_xml_get_attr(local->node, "semantic"); | ||
815 | sid = dae_xml_get_attr(local->node, "source"); | ||
816 | g_return_val_if_fail((sem != NULL) && (sid != NULL), FALSE); | ||
817 | |||
818 | /* get 'source' node, skip leading '#' from 'source' attribute */ | ||
819 | snode = dae_library_lookup(global->lib, "source", sid + 1); | ||
820 | #if DEBUG > 0 | ||
821 | g_debug("DAE: looking up source '%s' from library: %p", sid + 1, | ||
822 | (void *)snode); | ||
823 | #endif | ||
824 | g_return_val_if_fail(snode != NULL, FALSE); | ||
825 | |||
826 | if(sem) | ||
827 | g_free(sem); | ||
828 | if(sid) | ||
829 | g_free(sid); | ||
830 | |||
831 | /* TODO: check technique_common/accessor */ | ||
832 | |||
833 | fanode = dae_xml_get_child_by_tagname(snode, "float_array"); | ||
834 | if(fanode) { | ||
835 | cnt = dae_xml_get_attr(fanode, "count"); | ||
836 | #if DEBUG > 0 | ||
837 | g_debug("DAE: float_array count=\"%s\"", cnt); | ||
838 | #endif | ||
839 | g_return_val_if_fail(cnt != NULL, FALSE); | ||
840 | |||
841 | object->vertex_count = atoi(cnt); | ||
842 | g_return_val_if_fail(object->vertex_count != 0, FALSE); | ||
843 | |||
844 | object->vertex_data = g_new0(G3DFloat, 3 * object->vertex_count); | ||
845 | for(i = 0; i < object->vertex_count / 3; i ++) | ||
846 | { | ||
847 | for(j = 0; j < 3; j ++) | ||
848 | { | ||
849 | #if G3D_FLOAT_IS_DOUBLE | ||
850 | if(!dae_xml_next_double(fanode, &next, &(object->vertex_data[i * 3 + j]))) | ||
851 | #else | ||
852 | if(!dae_xml_next_float(fanode, &next, &(object->vertex_data[i * 3 + j]))) | ||
853 | #endif | ||
854 | { | ||
855 | skip = TRUE; | ||
856 | break; | ||
857 | } | ||
858 | } | ||
859 | #if DEBUG > 3 | ||
860 | g_debug("DAE: %-3.2f, %-3.2f, %-3.2f", | ||
861 | object->vertex_data[i * 3 + 0], | ||
862 | object->vertex_data[i * 3 + 1], | ||
863 | object->vertex_data[i * 3 + 2]); | ||
864 | #endif | ||
865 | if(skip) | ||
866 | break; | ||
867 | } | ||
868 | } | ||
869 | |||
870 | return TRUE; | ||
871 | } | ||
872 | |||
873 | gboolean dae_cb_visual_scene(DaeGlobalData *global, DaeLocalData *local) | ||
874 | { | ||
875 | return dae_xml_parse(global, local->node, dae_chunks_visual_scene, | ||
876 | local->level, NULL); | ||
877 | } | ||
diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dae/imp_dae_cb.h b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dae/imp_dae_cb.h new file mode 100644 index 0000000..ecf1138 --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dae/imp_dae_cb.h | |||
@@ -0,0 +1,75 @@ | |||
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 | #ifndef _IMP_DAE_CB_H | ||
24 | #define _IMP_DAE_CB_H | ||
25 | |||
26 | #include <g3d/types.h> | ||
27 | #include <libxml/tree.h> | ||
28 | |||
29 | #include "imp_dae_library.h" | ||
30 | |||
31 | typedef struct { | ||
32 | G3DContext *context; | ||
33 | G3DStream *stream; | ||
34 | G3DModel *model; | ||
35 | DaeLibrary *lib; | ||
36 | xmlDocPtr xmldoc; | ||
37 | } DaeGlobalData; | ||
38 | |||
39 | typedef struct { | ||
40 | xmlNodePtr parent; | ||
41 | xmlNodePtr node; | ||
42 | xmlNodePtr instance; | ||
43 | guint32 level; | ||
44 | gpointer user_data; | ||
45 | } DaeLocalData; | ||
46 | |||
47 | typedef gboolean (* DaeCallback)(DaeGlobalData *global, DaeLocalData *local); | ||
48 | |||
49 | typedef struct { | ||
50 | const gchar *name; | ||
51 | DaeCallback callback; | ||
52 | } DaeChunkDesc; | ||
53 | |||
54 | gboolean dae_cb_bind_material(DaeGlobalData *global, DaeLocalData *local); | ||
55 | gboolean dae_cb_effect(DaeGlobalData *global, DaeLocalData *local); | ||
56 | gboolean dae_cb_geometry(DaeGlobalData *global, DaeLocalData *local); | ||
57 | gboolean dae_cb_matrix(DaeGlobalData *global, DaeLocalData *local); | ||
58 | gboolean dae_cb_mesh(DaeGlobalData *global, DaeLocalData *local); | ||
59 | gboolean dae_cb_newparam(DaeGlobalData *global, DaeLocalData *local); | ||
60 | gboolean dae_cb_node(DaeGlobalData *global, DaeLocalData *local); | ||
61 | gboolean dae_cb_phong(DaeGlobalData *global, DaeLocalData *local); | ||
62 | gboolean dae_cb_polylist(DaeGlobalData *global, DaeLocalData *local); | ||
63 | gboolean dae_cb_profile_COMMON(DaeGlobalData *global, DaeLocalData *local); | ||
64 | gboolean dae_cb_rotate(DaeGlobalData *global, DaeLocalData *local); | ||
65 | gboolean dae_cb_scale(DaeGlobalData *global, DaeLocalData *local); | ||
66 | gboolean dae_cb_source(DaeGlobalData *global, DaeLocalData *local); | ||
67 | gboolean dae_cb_technique(DaeGlobalData *global, DaeLocalData *local); | ||
68 | gboolean dae_cb_technique_common(DaeGlobalData *global, DaeLocalData *local); | ||
69 | gboolean dae_cb_translate(DaeGlobalData *global, DaeLocalData *local); | ||
70 | gboolean dae_cb_triangles(DaeGlobalData *global, DaeLocalData *local); | ||
71 | gboolean dae_cb_vertices(DaeGlobalData *global, DaeLocalData *local); | ||
72 | gboolean dae_cb_vertices__input(DaeGlobalData *global, DaeLocalData *local); | ||
73 | gboolean dae_cb_visual_scene(DaeGlobalData *global, DaeLocalData *local); | ||
74 | |||
75 | #endif /* _IMP_DAE_CB_H */ | ||
diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dae/imp_dae_chunks.h b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dae/imp_dae_chunks.h new file mode 100644 index 0000000..ac9e3fc --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dae/imp_dae_chunks.h | |||
@@ -0,0 +1,95 @@ | |||
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 | #ifndef _IMP_DAE_CHUNKS_H | ||
24 | #define _IMP_DAE_CHUNKS_H | ||
25 | |||
26 | #include "imp_dae_cb.h" | ||
27 | |||
28 | static DaeChunkDesc dae_chunks_bind_material[] = { | ||
29 | { "technique_common", dae_cb_technique_common }, | ||
30 | { NULL, NULL } | ||
31 | }; | ||
32 | |||
33 | static DaeChunkDesc dae_chunks_effect[] = { | ||
34 | { "profile_COMMON", dae_cb_profile_COMMON }, | ||
35 | { NULL, NULL } | ||
36 | }; | ||
37 | |||
38 | static DaeChunkDesc dae_chunks_geometry[] = { | ||
39 | { "bind_material", dae_cb_bind_material }, | ||
40 | { "mesh", dae_cb_mesh }, | ||
41 | { NULL, NULL } | ||
42 | }; | ||
43 | |||
44 | static DaeChunkDesc dae_chunks_material[] = { | ||
45 | { "effect", dae_cb_effect }, | ||
46 | { NULL, NULL } | ||
47 | }; | ||
48 | |||
49 | static DaeChunkDesc dae_chunks_mesh[] = { | ||
50 | { "lines", NULL }, | ||
51 | { "polylist", dae_cb_polylist }, | ||
52 | { "source", dae_cb_source }, | ||
53 | { "triangles", dae_cb_triangles }, | ||
54 | { "vertices", dae_cb_vertices }, | ||
55 | { NULL, NULL } | ||
56 | }; | ||
57 | |||
58 | static DaeChunkDesc dae_chunks_node[] = { | ||
59 | { "camera", NULL }, | ||
60 | { "controller", NULL }, | ||
61 | { "geometry", dae_cb_geometry }, | ||
62 | { "light", NULL }, | ||
63 | { "matrix", dae_cb_matrix }, | ||
64 | { "node", dae_cb_node }, | ||
65 | { "scale", dae_cb_scale }, | ||
66 | { "rotate", dae_cb_rotate }, | ||
67 | { "translate", dae_cb_translate }, | ||
68 | { NULL, NULL } | ||
69 | }; | ||
70 | |||
71 | static DaeChunkDesc dae_chunks_profile_COMMON[] = { | ||
72 | { "extra", NULL }, | ||
73 | { "newparam", dae_cb_newparam }, | ||
74 | { "technique", dae_cb_technique }, | ||
75 | { NULL, NULL } | ||
76 | }; | ||
77 | |||
78 | static DaeChunkDesc dae_chunks_technique[] = { | ||
79 | { "blinn", dae_cb_phong }, | ||
80 | { "lambert", dae_cb_phong }, | ||
81 | { "phong", dae_cb_phong }, | ||
82 | { NULL, NULL } | ||
83 | }; | ||
84 | |||
85 | static DaeChunkDesc dae_chunks_vertices[] = { | ||
86 | { "input", dae_cb_vertices__input }, | ||
87 | { NULL, NULL } | ||
88 | }; | ||
89 | |||
90 | static DaeChunkDesc dae_chunks_visual_scene[] = { | ||
91 | { "node", dae_cb_node }, | ||
92 | { NULL, NULL } | ||
93 | }; | ||
94 | |||
95 | #endif /* _IMP_DAE_CHUNKS_H */ | ||
diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dae/imp_dae_library.c b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dae/imp_dae_library.c new file mode 100644 index 0000000..dd10351 --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dae/imp_dae_library.c | |||
@@ -0,0 +1,167 @@ | |||
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 <glib.h> | ||
24 | #include <libxml/tree.h> | ||
25 | |||
26 | #include "imp_dae_xml.h" | ||
27 | #include "imp_dae_library.h" | ||
28 | |||
29 | struct _DaeLibrary { | ||
30 | GHashTable *ids; | ||
31 | GSList *libs; | ||
32 | }; | ||
33 | |||
34 | typedef struct { | ||
35 | GHashTable *ids; | ||
36 | GSList *nodes; | ||
37 | } DaeLibraryNodes; | ||
38 | |||
39 | static gchar *dae_library_names[][2] = { | ||
40 | { "library_animations", "animation" }, | ||
41 | { "library_cameras", "camera" }, | ||
42 | { "library_controllers", "controller" }, | ||
43 | { "library_effects", "effect" }, | ||
44 | { "library_geometries", "geometry" }, | ||
45 | { "library_images", "image" }, | ||
46 | { "library_lights", "light" }, | ||
47 | { "library_materials", "material" }, | ||
48 | { "library_nodes", "node" }, | ||
49 | { "library_physics_scenes", "physics_scene" }, | ||
50 | { "library_visual_scenes", "visual_scene" }, | ||
51 | { NULL, NULL } | ||
52 | }; | ||
53 | |||
54 | static gboolean dae_add_library(DaeLibrary *lib, xmlNodePtr libnode, | ||
55 | guint32 entryid) | ||
56 | { | ||
57 | xmlNodePtr node; | ||
58 | DaeLibraryNodes *nodelib; | ||
59 | gchar *id; | ||
60 | |||
61 | nodelib = g_new0(DaeLibraryNodes, 1); | ||
62 | nodelib->ids = g_hash_table_new_full( | ||
63 | g_str_hash, g_str_equal, g_free, NULL); | ||
64 | g_hash_table_insert(lib->ids, g_strdup(dae_library_names[entryid][1]), | ||
65 | nodelib); | ||
66 | lib->libs = g_slist_append(lib->libs, nodelib); | ||
67 | |||
68 | node = libnode->children; | ||
69 | while(node != NULL) { | ||
70 | if((node->type == XML_ELEMENT_NODE) && | ||
71 | (xmlStrcmp(node->name, | ||
72 | (const xmlChar *)dae_library_names[entryid][1]) == 0)) { | ||
73 | /* found library entry */ | ||
74 | id = dae_xml_get_attr(node, "id"); | ||
75 | if(id != NULL) { | ||
76 | #if DEBUG > 2 | ||
77 | g_debug("\t%s id=\"%s\"", dae_library_names[entryid][1], id); | ||
78 | #endif | ||
79 | g_hash_table_insert(nodelib->ids, id, node); | ||
80 | nodelib->nodes = g_slist_append(nodelib->nodes, node); | ||
81 | } | ||
82 | } | ||
83 | node = node->next; | ||
84 | } | ||
85 | return TRUE; | ||
86 | } | ||
87 | |||
88 | gboolean dae_library_add(DaeLibrary *lib, const gchar *libname, | ||
89 | const gchar *id, xmlNodePtr node) | ||
90 | { | ||
91 | DaeLibraryNodes *nodelib; | ||
92 | |||
93 | g_return_val_if_fail(lib != NULL, FALSE); | ||
94 | |||
95 | nodelib = g_hash_table_lookup(lib->ids, libname); | ||
96 | if(nodelib == NULL) { | ||
97 | nodelib = g_new0(DaeLibraryNodes, 1); | ||
98 | nodelib->ids = g_hash_table_new_full( | ||
99 | g_str_hash, g_str_equal, g_free, NULL); | ||
100 | g_hash_table_insert(lib->ids, g_strdup(libname), nodelib); | ||
101 | lib->libs = g_slist_append(lib->libs, nodelib); | ||
102 | } | ||
103 | g_hash_table_insert(nodelib->ids, g_strdup(id), node); | ||
104 | nodelib->nodes = g_slist_append(nodelib->nodes, node); | ||
105 | return TRUE; | ||
106 | } | ||
107 | |||
108 | DaeLibrary *dae_library_load(xmlDocPtr xmldoc) | ||
109 | { | ||
110 | DaeLibrary *lib; | ||
111 | gint i = 0; | ||
112 | xmlNodePtr rootnode, node; | ||
113 | |||
114 | lib = g_new0(DaeLibrary, 1); | ||
115 | lib->ids = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL); | ||
116 | |||
117 | rootnode = xmlDocGetRootElement(xmldoc); | ||
118 | g_return_val_if_fail(rootnode != NULL, NULL); | ||
119 | |||
120 | while(dae_library_names[i][0] != NULL) { | ||
121 | #if DEBUG > 2 | ||
122 | g_debug("loading library %s", dae_library_names[i][0]); | ||
123 | #endif | ||
124 | node = rootnode->children; | ||
125 | while(node != NULL) { | ||
126 | if((node->type == XML_ELEMENT_NODE) && | ||
127 | (xmlStrcmp(node->name, | ||
128 | (const xmlChar *)dae_library_names[i][0]) == 0)) { | ||
129 | dae_add_library(lib, node, i); | ||
130 | break; | ||
131 | } | ||
132 | node = node->next; | ||
133 | } | ||
134 | i ++; | ||
135 | } | ||
136 | return lib; | ||
137 | } | ||
138 | |||
139 | xmlNodePtr dae_library_lookup(DaeLibrary *library, const gchar *tagname, | ||
140 | const gchar *id) | ||
141 | { | ||
142 | DaeLibraryNodes *nodelib; | ||
143 | |||
144 | nodelib = g_hash_table_lookup(library->ids, tagname); | ||
145 | if(nodelib == NULL) { | ||
146 | g_warning("DAE: failed to lookup library for '%s'", tagname); | ||
147 | return NULL; | ||
148 | } | ||
149 | return (xmlNodePtr)g_hash_table_lookup(nodelib->ids, id); | ||
150 | } | ||
151 | |||
152 | void dae_library_cleanup(DaeLibrary *library) | ||
153 | { | ||
154 | DaeLibraryNodes *nodelib; | ||
155 | GSList *item; | ||
156 | |||
157 | for(item = library->libs; item != NULL; item = item->next) { | ||
158 | nodelib = (DaeLibraryNodes *)item->data; | ||
159 | g_hash_table_destroy(nodelib->ids); | ||
160 | g_slist_free(nodelib->nodes); | ||
161 | } | ||
162 | |||
163 | g_hash_table_destroy(library->ids); | ||
164 | g_slist_free(library->libs); | ||
165 | g_free(library); | ||
166 | } | ||
167 | |||
diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dae/imp_dae_library.h b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dae/imp_dae_library.h new file mode 100644 index 0000000..c7bb767 --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dae/imp_dae_library.h | |||
@@ -0,0 +1,38 @@ | |||
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 | #ifndef _IMP_DAE_LIBRARY_H | ||
24 | #define _IMP_DAE_LIBRARY_H | ||
25 | |||
26 | #include <glib.h> | ||
27 | #include <libxml/tree.h> | ||
28 | |||
29 | typedef struct _DaeLibrary DaeLibrary; | ||
30 | |||
31 | DaeLibrary *dae_library_load(xmlDocPtr xmldoc); | ||
32 | gboolean dae_library_add(DaeLibrary *lib, const gchar *libname, | ||
33 | const gchar *id, xmlNodePtr node); | ||
34 | xmlNodePtr dae_library_lookup(DaeLibrary *library, const gchar *tagname, | ||
35 | const gchar *id); | ||
36 | void dae_library_cleanup(DaeLibrary *library); | ||
37 | |||
38 | #endif /* _IMP_DAE_LIBRARY_H */ | ||
diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dae/imp_dae_xml.c b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dae/imp_dae_xml.c new file mode 100644 index 0000000..a67be0d --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dae/imp_dae_xml.c | |||
@@ -0,0 +1,257 @@ | |||
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 <string.h> | ||
24 | #include <ctype.h> | ||
25 | |||
26 | #include <g3d/context.h> | ||
27 | #include <g3d/debug.h> | ||
28 | |||
29 | #include <glib.h> | ||
30 | #include <libxml/tree.h> | ||
31 | |||
32 | #include "imp_dae_library.h" | ||
33 | #include "imp_dae_xml.h" | ||
34 | #include "imp_dae_cb.h" | ||
35 | |||
36 | gchar *dae_xml_get_attr(xmlNodePtr node, const gchar *attrname) | ||
37 | { | ||
38 | xmlAttrPtr attr; | ||
39 | gchar *val = NULL; | ||
40 | |||
41 | g_return_val_if_fail(node != NULL, NULL); | ||
42 | g_return_val_if_fail(attrname != NULL, NULL); | ||
43 | |||
44 | attr = node->properties; | ||
45 | while(attr != NULL) { | ||
46 | if(xmlStrcmp(attr->name, (xmlChar *)attrname) == 0) { | ||
47 | val = g_strdup((gchar *)attr->children->content); | ||
48 | break; | ||
49 | } | ||
50 | attr = attr->next; | ||
51 | } | ||
52 | |||
53 | return val; | ||
54 | } | ||
55 | |||
56 | xmlNodePtr dae_xml_get_child_by_tagname(xmlNodePtr parent, const gchar *tag) | ||
57 | { | ||
58 | xmlNodePtr node; | ||
59 | |||
60 | g_return_val_if_fail(parent != NULL, NULL); | ||
61 | |||
62 | node = parent->children; | ||
63 | while(node != NULL) { | ||
64 | if((node->type == XML_ELEMENT_NODE) && | ||
65 | (xmlStrcmp(node->name, (const xmlChar *)tag) == 0)) { | ||
66 | return node; | ||
67 | } | ||
68 | node = node->next; | ||
69 | } | ||
70 | return NULL; | ||
71 | } | ||
72 | |||
73 | xmlNodePtr dae_xml_next_child_by_tagname(xmlNodePtr parent, xmlNodePtr *node, | ||
74 | gchar *nodename) | ||
75 | { | ||
76 | xmlNodePtr tmpnode; | ||
77 | gchar *name; | ||
78 | |||
79 | do { | ||
80 | tmpnode = dae_xml_next_child(NULL, parent, node, NULL, &name); | ||
81 | if(tmpnode == NULL) | ||
82 | return NULL; | ||
83 | if(strcmp(name, nodename) == 0) { | ||
84 | g_free(name); | ||
85 | return tmpnode; | ||
86 | } | ||
87 | g_free(name); | ||
88 | } while(1); | ||
89 | } | ||
90 | |||
91 | xmlNodePtr dae_xml_next_child(DaeLibrary *lib, xmlNodePtr parent, | ||
92 | xmlNodePtr *node, xmlNodePtr *instance, gchar **nodename) | ||
93 | { | ||
94 | gchar *url, *name; | ||
95 | |||
96 | g_return_val_if_fail(node != NULL, NULL); | ||
97 | g_return_val_if_fail(nodename != NULL, NULL); | ||
98 | *nodename = NULL; | ||
99 | |||
100 | if(*node == NULL) | ||
101 | *node = parent->children; | ||
102 | else if(instance && *instance) | ||
103 | *node = (*instance)->next; | ||
104 | else | ||
105 | *node = (*node)->next; | ||
106 | |||
107 | if(instance) | ||
108 | *instance = NULL; | ||
109 | |||
110 | /* skip TEXT nodes */ | ||
111 | while(*node && ((*node)->type != XML_ELEMENT_NODE)) | ||
112 | *node = (*node)->next; | ||
113 | |||
114 | if(*node == NULL) | ||
115 | return NULL; | ||
116 | |||
117 | if(lib && instance && | ||
118 | (xmlStrncmp((*node)->name, (xmlChar *)"instance_", 9) == 0)) { | ||
119 | url = dae_xml_get_attr(*node, "url"); | ||
120 | if(url) { | ||
121 | /* skip 'instance_' part of node name */ | ||
122 | name = g_strdup((gchar *)((*node)->name + 9)); | ||
123 | #if DEBUG > 1 | ||
124 | g_debug("DAE: looking up '%s' in '%s'", url + 1, name); | ||
125 | #endif | ||
126 | *instance = *node; | ||
127 | *node = dae_library_lookup(lib, name, url + 1 /* skip '#' */); | ||
128 | g_free(url); | ||
129 | g_free(name); | ||
130 | } | ||
131 | } | ||
132 | if(*node == NULL) | ||
133 | return NULL; | ||
134 | |||
135 | *nodename = g_strdup((gchar *)(*node)->name); | ||
136 | |||
137 | return *node; | ||
138 | } | ||
139 | |||
140 | gboolean dae_xml_parse(DaeGlobalData *global, xmlNodePtr parent, | ||
141 | DaeChunkDesc *chunks, guint32 level, gpointer user_data) | ||
142 | { | ||
143 | DaeLocalData *local; | ||
144 | xmlNodePtr node = NULL, instance = NULL; | ||
145 | gchar *name; | ||
146 | gint i; | ||
147 | |||
148 | g_return_val_if_fail(parent != NULL, FALSE); | ||
149 | |||
150 | while(dae_xml_next_child(global->lib, parent, &node, &instance, &name)) { | ||
151 | #if DEBUG > 0 | ||
152 | g_debug("\\%s<%s>", debug_pad(level), name); | ||
153 | #endif | ||
154 | if(chunks) { | ||
155 | local = g_new0(DaeLocalData, 1); | ||
156 | local->parent = parent; | ||
157 | local->node = node; | ||
158 | local->instance = instance; | ||
159 | local->level = level + 1; | ||
160 | local->user_data = user_data; | ||
161 | |||
162 | /* find callback */ | ||
163 | for(i = 0; chunks[i].name != NULL; i ++) { | ||
164 | if(strcmp(chunks[i].name, name) == 0) { | ||
165 | /* found chunk */ | ||
166 | #if DEBUG > 3 | ||
167 | g_debug("DAE: found chunk description for '%s'", name); | ||
168 | #endif | ||
169 | if(chunks[i].callback) | ||
170 | chunks[i].callback(global, local); | ||
171 | break; | ||
172 | } | ||
173 | } | ||
174 | |||
175 | g_free(local); | ||
176 | |||
177 | if(chunks[i].name == NULL) | ||
178 | g_debug("DAE: unhandled chunk '%s' in '%s'", name, | ||
179 | (gchar *)parent->name); | ||
180 | } | ||
181 | |||
182 | g_free(name); | ||
183 | g3d_context_update_interface(global->context); | ||
184 | } | ||
185 | |||
186 | return TRUE; | ||
187 | } | ||
188 | |||
189 | gboolean dae_xml_next_int(xmlNodePtr node, gchar **nextp, gint *i) | ||
190 | { | ||
191 | gchar *s, *err = NULL; | ||
192 | |||
193 | s = *nextp; | ||
194 | |||
195 | if(s == NULL) | ||
196 | s = (gchar *)node->children->content; | ||
197 | |||
198 | /* skip leading whitespace */ | ||
199 | while(isspace(*s)) | ||
200 | s ++; | ||
201 | |||
202 | *i = strtol(s, &err, 0); | ||
203 | if(s == err) { | ||
204 | g_debug("DAE: imp_xml_next_int: error at '%.*s...'", 5, s); | ||
205 | return FALSE; | ||
206 | } | ||
207 | |||
208 | *nextp = err; | ||
209 | return TRUE; | ||
210 | } | ||
211 | |||
212 | gboolean dae_xml_next_double(xmlNodePtr node, gchar **nextp, GLdouble *d) | ||
213 | { | ||
214 | gchar *s, *err = NULL; | ||
215 | |||
216 | s = *nextp; | ||
217 | |||
218 | if(s == NULL) | ||
219 | s = (gchar *)node->children->content; | ||
220 | |||
221 | /* skip leading whitespace */ | ||
222 | while(isspace(*s)) | ||
223 | s ++; | ||
224 | |||
225 | *d = strtod(s, &err); | ||
226 | if(s == err) { | ||
227 | g_debug("DAE: imp_xml_next_float: error at '%.*s...'", 5, s); | ||
228 | return FALSE; | ||
229 | } | ||
230 | |||
231 | *nextp = err; | ||
232 | return TRUE; | ||
233 | } | ||
234 | |||
235 | gboolean dae_xml_next_float(xmlNodePtr node, gchar **nextp, GLfloat *f) | ||
236 | { | ||
237 | gchar *s, *err = NULL; | ||
238 | |||
239 | s = *nextp; | ||
240 | |||
241 | if(s == NULL) | ||
242 | s = (gchar *)node->children->content; | ||
243 | |||
244 | /* skip leading whitespace */ | ||
245 | while(isspace(*s)) | ||
246 | s ++; | ||
247 | |||
248 | *f = strtof(s, &err); | ||
249 | if(s == err) { | ||
250 | g_debug("DAE: imp_xml_next_float: error at '%.*s...'", 5, s); | ||
251 | return FALSE; | ||
252 | } | ||
253 | |||
254 | *nextp = err; | ||
255 | return TRUE; | ||
256 | } | ||
257 | |||
diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dae/imp_dae_xml.h b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dae/imp_dae_xml.h new file mode 100644 index 0000000..949437e --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dae/imp_dae_xml.h | |||
@@ -0,0 +1,44 @@ | |||
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 | #ifndef _IMP_DAE_XML_H | ||
24 | #define _IMP_DAE_XML_H | ||
25 | |||
26 | #include <glib.h> | ||
27 | #include <libxml/tree.h> | ||
28 | |||
29 | #include "imp_dae_library.h" | ||
30 | #include "imp_dae_cb.h" | ||
31 | |||
32 | gchar *dae_xml_get_attr(xmlNodePtr node, const gchar *attrname); | ||
33 | xmlNodePtr dae_xml_get_child_by_tagname(xmlNodePtr parent, const gchar *tag); | ||
34 | xmlNodePtr dae_xml_next_child_by_tagname(xmlNodePtr parent, xmlNodePtr *node, | ||
35 | gchar *nodename); | ||
36 | xmlNodePtr dae_xml_next_child(DaeLibrary *lib, xmlNodePtr parent, | ||
37 | xmlNodePtr *node, xmlNodePtr *instance, gchar **nodename); | ||
38 | gboolean dae_xml_parse(DaeGlobalData *global, xmlNodePtr parent, | ||
39 | DaeChunkDesc *chunks, guint32 level, gpointer user_data); | ||
40 | gboolean dae_xml_next_int(xmlNodePtr node, gchar **nextp, gint *i); | ||
41 | gboolean dae_xml_next_double(xmlNodePtr node, gchar **nextp, GLdouble *d); | ||
42 | gboolean dae_xml_next_float(xmlNodePtr node, gchar **nextp, GLfloat *f); | ||
43 | |||
44 | #endif /* _IMP_DAE_XML_H */ | ||