diff options
Diffstat (limited to 'src/others/mimesh/libg3d-0.0.8/plugins/import/imp_flt')
8 files changed, 2487 insertions, 0 deletions
diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_flt/Makefile b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_flt/Makefile new file mode 100644 index 0000000..a9fb9fa --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_flt/Makefile | |||
@@ -0,0 +1,514 @@ | |||
1 | # Makefile.in generated by automake 1.10.1 from Makefile.am. | ||
2 | # plugins/import/imp_flt/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_flt | ||
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_flt_la_DEPENDENCIES = $(top_builddir)/src/libg3d.la | ||
58 | am_imp_flt_la_OBJECTS = imp_flt.lo imp_flt_callbacks.lo | ||
59 | imp_flt_la_OBJECTS = $(am_imp_flt_la_OBJECTS) | ||
60 | #am_imp_flt_la_rpath = -rpath $(pluginimpdir) | ||
61 | DEFAULT_INCLUDES = -I. -I$(top_builddir)/include/g3d | ||
62 | depcomp = $(SHELL) $(top_srcdir)/config/depcomp | ||
63 | am__depfiles_maybe = depfiles | ||
64 | COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ | ||
65 | $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) | ||
66 | LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ | ||
67 | --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ | ||
68 | $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) | ||
69 | CCLD = $(CC) | ||
70 | LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ | ||
71 | --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ | ||
72 | $(LDFLAGS) -o $@ | ||
73 | SOURCES = $(imp_flt_la_SOURCES) | ||
74 | DIST_SOURCES = $(imp_flt_la_SOURCES) | ||
75 | ETAGS = etags | ||
76 | CTAGS = ctags | ||
77 | DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) | ||
78 | ACLOCAL = ${SHELL} /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/config/missing --run aclocal-1.10 | ||
79 | AMTAR = ${SHELL} /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/config/missing --run tar | ||
80 | AR = ar | ||
81 | AS = as | ||
82 | AUTOCONF = ${SHELL} /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/config/missing --run autoconf | ||
83 | AUTOHEADER = ${SHELL} /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/config/missing --run autoheader | ||
84 | AUTOMAKE = ${SHELL} /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/config/missing --run automake-1.10 | ||
85 | AWK = gawk | ||
86 | CC = gcc | ||
87 | CCDEPMODE = depmode=gcc3 | ||
88 | CFLAGS = -g -O2 | ||
89 | CPP = gcc -E | ||
90 | CPPFLAGS = | ||
91 | CXX = g++ | ||
92 | CXXCPP = g++ -E | ||
93 | CXXDEPMODE = depmode=gcc3 | ||
94 | CXXFLAGS = -g -O2 | ||
95 | CYGPATH_W = echo | ||
96 | DBG_CFLAGS = -O2 | ||
97 | DEBUG = 0 | ||
98 | DEFS = -DHAVE_CONFIG_H | ||
99 | DEPDIR = .deps | ||
100 | DLLTOOL = dlltool | ||
101 | ECHO = echo | ||
102 | ECHO_C = | ||
103 | ECHO_N = -n | ||
104 | ECHO_T = | ||
105 | EGREP = /bin/grep -E | ||
106 | EXEEXT = | ||
107 | F77 = | ||
108 | FFLAGS = | ||
109 | 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 | ||
110 | 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 | ||
111 | GLIB_CFLAGS = -pthread -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include | ||
112 | GLIB_GENMARSHAL = glib-genmarshal | ||
113 | GLIB_LIBS = -Wl,--export-dynamic -pthread -lgmodule-2.0 -lrt -lgobject-2.0 -lglib-2.0 | ||
114 | GLIB_MKENUMS = glib-mkenums | ||
115 | GOBJECT_QUERY = gobject-query | ||
116 | GREP = /bin/grep | ||
117 | GTKDOC_CHECK = /usr/bin/gtkdoc-check | ||
118 | 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 | ||
119 | 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 | ||
120 | HTML_DIR = ${datadir}/gtk-doc/html | ||
121 | INSTALL = /usr/bin/install -c | ||
122 | INSTALL_DATA = ${INSTALL} -m 644 | ||
123 | INSTALL_PROGRAM = ${INSTALL} | ||
124 | INSTALL_SCRIPT = ${INSTALL} | ||
125 | INSTALL_STRIP_PROGRAM = $(install_sh) -c -s | ||
126 | LDFLAGS = | ||
127 | LEX = flex | ||
128 | LEXLIB = -lfl | ||
129 | LEX_OUTPUT_ROOT = lex.yy | ||
130 | 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 | ||
131 | LIBGSF_LIBS = -lgsf-1 -lgobject-2.0 -lxml2 -lglib-2.0 | ||
132 | LIBOBJS = | ||
133 | LIBS = -lm | ||
134 | LIBTOOL = $(SHELL) $(top_builddir)/libtool --quiet | ||
135 | LIBXML2_CFLAGS = -I/usr/include/libxml2 | ||
136 | LIBXML2_LIBS = -L/usr/lib/x86_64-linux-gnu -lxml2 | ||
137 | LN_S = ln -s | ||
138 | LTLIBOBJS = | ||
139 | LTVERSION = 0:8:0 | ||
140 | MAGIC_LIBS = -lmagic | ||
141 | MAKEINFO = ${SHELL} /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/config/missing --run makeinfo | ||
142 | MATH_LIBS = -lm | ||
143 | MKDIR_P = /bin/mkdir -p | ||
144 | OBJDUMP = objdump | ||
145 | OBJEXT = o | ||
146 | PACKAGE = libg3d | ||
147 | PACKAGE_BUGREPORT = | ||
148 | PACKAGE_NAME = | ||
149 | PACKAGE_STRING = | ||
150 | PACKAGE_TARNAME = | ||
151 | PACKAGE_VERSION = | ||
152 | PATH_SEPARATOR = : | ||
153 | PKG_CONFIG = /usr/bin/pkg-config | ||
154 | PLUGINS_LDFLAGS = -avoid-version -export-dynamic | ||
155 | RANLIB = ranlib | ||
156 | SET_MAKE = | ||
157 | SHELL = /bin/bash | ||
158 | STRIP = strip | ||
159 | VERSION = 0.0.8 | ||
160 | XML2_CONFIG = /usr/bin/xml2-config | ||
161 | XML_CPPFLAGS = -I/usr/include/libxml2 | ||
162 | XML_LIBS = -L/usr/lib/x86_64-linux-gnu -lxml2 | ||
163 | Z_CFLAGS = | ||
164 | Z_LIBS = -lz | ||
165 | abs_builddir = /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_flt | ||
166 | abs_srcdir = /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_flt | ||
167 | abs_top_builddir = /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8 | ||
168 | abs_top_srcdir = /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8 | ||
169 | ac_ct_CC = gcc | ||
170 | ac_ct_CXX = g++ | ||
171 | ac_ct_F77 = | ||
172 | am__include = include | ||
173 | am__leading_dot = . | ||
174 | am__quote = | ||
175 | am__tar = ${AMTAR} chof - "$$tardir" | ||
176 | am__untar = ${AMTAR} xf - | ||
177 | bindir = ${exec_prefix}/bin | ||
178 | build = x86_64-unknown-linux-gnu | ||
179 | build_alias = | ||
180 | build_cpu = x86_64 | ||
181 | build_os = linux-gnu | ||
182 | build_vendor = unknown | ||
183 | builddir = . | ||
184 | datadir = ${datarootdir} | ||
185 | datarootdir = ${prefix}/share | ||
186 | docdir = ${datarootdir}/doc/${PACKAGE} | ||
187 | dvidir = ${docdir} | ||
188 | exec_prefix = ${prefix} | ||
189 | host = x86_64-unknown-linux-gnu | ||
190 | host_alias = | ||
191 | host_cpu = x86_64 | ||
192 | host_os = linux-gnu | ||
193 | host_vendor = unknown | ||
194 | htmldir = ${docdir} | ||
195 | includedir = ${prefix}/include | ||
196 | infodir = ${datarootdir}/info | ||
197 | install_sh = $(SHELL) /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/config/install-sh | ||
198 | libdir = ${exec_prefix}/lib | ||
199 | libexecdir = ${exec_prefix}/libexec | ||
200 | localedir = ${datarootdir}/locale | ||
201 | localstatedir = ${prefix}/var | ||
202 | mandir = ${datarootdir}/man | ||
203 | mkdir_p = /bin/mkdir -p | ||
204 | oldincludedir = /usr/include | ||
205 | pdfdir = ${docdir} | ||
206 | prefix = /usr/local | ||
207 | program_transform_name = s,x,x, | ||
208 | psdir = ${docdir} | ||
209 | sbindir = ${exec_prefix}/sbin | ||
210 | sharedstatedir = ${prefix}/com | ||
211 | srcdir = . | ||
212 | sysconfdir = ${prefix}/etc | ||
213 | target_alias = | ||
214 | top_builddir = ../../.. | ||
215 | top_srcdir = ../../.. | ||
216 | pluginimpdir = $(pkglibdir)/plugins/import | ||
217 | #pluginimp_LTLIBRARIES = imp_flt.la | ||
218 | AM_CFLAGS = \ | ||
219 | -Wall -ansi -pedantic \ | ||
220 | -DG_LOG_DOMAIN=\"LibG3D\" \ | ||
221 | -O2 -DDEBUG=0 \ | ||
222 | -pthread -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include | ||
223 | |||
224 | INCLUDES = -I$(top_srcdir)/include | ||
225 | AM_LDFLAGS = \ | ||
226 | -no-undefined -module \ | ||
227 | -avoid-version -export-dynamic | ||
228 | |||
229 | imp_flt_la_SOURCES = imp_flt.c imp_flt.h \ | ||
230 | imp_flt_opcodes.h \ | ||
231 | imp_flt_callbacks.c imp_flt_callbacks.h | ||
232 | |||
233 | imp_flt_la_LIBADD = $(top_builddir)/src/libg3d.la -Wl,--export-dynamic -pthread -lgmodule-2.0 -lrt -lgobject-2.0 -lglib-2.0 | ||
234 | all: all-am | ||
235 | |||
236 | .SUFFIXES: | ||
237 | .SUFFIXES: .c .lo .o .obj | ||
238 | $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) | ||
239 | @for dep in $?; do \ | ||
240 | case '$(am__configure_deps)' in \ | ||
241 | *$$dep*) \ | ||
242 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ | ||
243 | && exit 0; \ | ||
244 | exit 1;; \ | ||
245 | esac; \ | ||
246 | done; \ | ||
247 | echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/import/imp_flt/Makefile'; \ | ||
248 | cd $(top_srcdir) && \ | ||
249 | $(AUTOMAKE) --gnu plugins/import/imp_flt/Makefile | ||
250 | .PRECIOUS: Makefile | ||
251 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status | ||
252 | @case '$?' in \ | ||
253 | *config.status*) \ | ||
254 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ | ||
255 | *) \ | ||
256 | echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ | ||
257 | cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ | ||
258 | esac; | ||
259 | |||
260 | $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) | ||
261 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh | ||
262 | |||
263 | $(top_srcdir)/configure: $(am__configure_deps) | ||
264 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh | ||
265 | $(ACLOCAL_M4): $(am__aclocal_m4_deps) | ||
266 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh | ||
267 | install-pluginimpLTLIBRARIES: $(pluginimp_LTLIBRARIES) | ||
268 | @$(NORMAL_INSTALL) | ||
269 | test -z "$(pluginimpdir)" || $(MKDIR_P) "$(DESTDIR)$(pluginimpdir)" | ||
270 | @list='$(pluginimp_LTLIBRARIES)'; for p in $$list; do \ | ||
271 | if test -f $$p; then \ | ||
272 | f=$(am__strip_dir) \ | ||
273 | echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(pluginimpLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(pluginimpdir)/$$f'"; \ | ||
274 | $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(pluginimpLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(pluginimpdir)/$$f"; \ | ||
275 | else :; fi; \ | ||
276 | done | ||
277 | |||
278 | uninstall-pluginimpLTLIBRARIES: | ||
279 | @$(NORMAL_UNINSTALL) | ||
280 | @list='$(pluginimp_LTLIBRARIES)'; for p in $$list; do \ | ||
281 | p=$(am__strip_dir) \ | ||
282 | echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pluginimpdir)/$$p'"; \ | ||
283 | $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pluginimpdir)/$$p"; \ | ||
284 | done | ||
285 | |||
286 | clean-pluginimpLTLIBRARIES: | ||
287 | -test -z "$(pluginimp_LTLIBRARIES)" || rm -f $(pluginimp_LTLIBRARIES) | ||
288 | @list='$(pluginimp_LTLIBRARIES)'; for p in $$list; do \ | ||
289 | dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ | ||
290 | test "$$dir" != "$$p" || dir=.; \ | ||
291 | echo "rm -f \"$${dir}/so_locations\""; \ | ||
292 | rm -f "$${dir}/so_locations"; \ | ||
293 | done | ||
294 | imp_flt.la: $(imp_flt_la_OBJECTS) $(imp_flt_la_DEPENDENCIES) | ||
295 | $(LINK) $(am_imp_flt_la_rpath) $(imp_flt_la_OBJECTS) $(imp_flt_la_LIBADD) $(LIBS) | ||
296 | |||
297 | mostlyclean-compile: | ||
298 | -rm -f *.$(OBJEXT) | ||
299 | |||
300 | distclean-compile: | ||
301 | -rm -f *.tab.c | ||
302 | |||
303 | include ./$(DEPDIR)/imp_flt.Plo | ||
304 | include ./$(DEPDIR)/imp_flt_callbacks.Plo | ||
305 | |||
306 | .c.o: | ||
307 | $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< | ||
308 | mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po | ||
309 | # source='$<' object='$@' libtool=no \ | ||
310 | # DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ | ||
311 | # $(COMPILE) -c $< | ||
312 | |||
313 | .c.obj: | ||
314 | $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` | ||
315 | mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po | ||
316 | # source='$<' object='$@' libtool=no \ | ||
317 | # DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ | ||
318 | # $(COMPILE) -c `$(CYGPATH_W) '$<'` | ||
319 | |||
320 | .c.lo: | ||
321 | $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< | ||
322 | mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo | ||
323 | # source='$<' object='$@' libtool=yes \ | ||
324 | # DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ | ||
325 | # $(LTCOMPILE) -c -o $@ $< | ||
326 | |||
327 | mostlyclean-libtool: | ||
328 | -rm -f *.lo | ||
329 | |||
330 | clean-libtool: | ||
331 | -rm -rf .libs _libs | ||
332 | |||
333 | ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) | ||
334 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ | ||
335 | unique=`for i in $$list; do \ | ||
336 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ | ||
337 | done | \ | ||
338 | $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ | ||
339 | END { if (nonempty) { for (i in files) print i; }; }'`; \ | ||
340 | mkid -fID $$unique | ||
341 | tags: TAGS | ||
342 | |||
343 | TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ | ||
344 | $(TAGS_FILES) $(LISP) | ||
345 | tags=; \ | ||
346 | here=`pwd`; \ | ||
347 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ | ||
348 | unique=`for i in $$list; do \ | ||
349 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ | ||
350 | done | \ | ||
351 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ | ||
352 | END { if (nonempty) { for (i in files) print i; }; }'`; \ | ||
353 | if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ | ||
354 | test -n "$$unique" || unique=$$empty_fix; \ | ||
355 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ | ||
356 | $$tags $$unique; \ | ||
357 | fi | ||
358 | ctags: CTAGS | ||
359 | CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ | ||
360 | $(TAGS_FILES) $(LISP) | ||
361 | tags=; \ | ||
362 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ | ||
363 | unique=`for i in $$list; do \ | ||
364 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ | ||
365 | done | \ | ||
366 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ | ||
367 | END { if (nonempty) { for (i in files) print i; }; }'`; \ | ||
368 | test -z "$(CTAGS_ARGS)$$tags$$unique" \ | ||
369 | || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ | ||
370 | $$tags $$unique | ||
371 | |||
372 | GTAGS: | ||
373 | here=`$(am__cd) $(top_builddir) && pwd` \ | ||
374 | && cd $(top_srcdir) \ | ||
375 | && gtags -i $(GTAGS_ARGS) $$here | ||
376 | |||
377 | distclean-tags: | ||
378 | -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags | ||
379 | |||
380 | distdir: $(DISTFILES) | ||
381 | @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ | ||
382 | topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ | ||
383 | list='$(DISTFILES)'; \ | ||
384 | dist_files=`for file in $$list; do echo $$file; done | \ | ||
385 | sed -e "s|^$$srcdirstrip/||;t" \ | ||
386 | -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ | ||
387 | case $$dist_files in \ | ||
388 | */*) $(MKDIR_P) `echo "$$dist_files" | \ | ||
389 | sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ | ||
390 | sort -u` ;; \ | ||
391 | esac; \ | ||
392 | for file in $$dist_files; do \ | ||
393 | if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ | ||
394 | if test -d $$d/$$file; then \ | ||
395 | dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ | ||
396 | if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ | ||
397 | cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ | ||
398 | fi; \ | ||
399 | cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ | ||
400 | else \ | ||
401 | test -f $(distdir)/$$file \ | ||
402 | || cp -p $$d/$$file $(distdir)/$$file \ | ||
403 | || exit 1; \ | ||
404 | fi; \ | ||
405 | done | ||
406 | check-am: all-am | ||
407 | check: check-am | ||
408 | all-am: Makefile $(LTLIBRARIES) | ||
409 | installdirs: | ||
410 | for dir in "$(DESTDIR)$(pluginimpdir)"; do \ | ||
411 | test -z "$$dir" || $(MKDIR_P) "$$dir"; \ | ||
412 | done | ||
413 | install: install-am | ||
414 | install-exec: install-exec-am | ||
415 | install-data: install-data-am | ||
416 | uninstall: uninstall-am | ||
417 | |||
418 | install-am: all-am | ||
419 | @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am | ||
420 | |||
421 | installcheck: installcheck-am | ||
422 | install-strip: | ||
423 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ | ||
424 | install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ | ||
425 | `test -z '$(STRIP)' || \ | ||
426 | echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install | ||
427 | mostlyclean-generic: | ||
428 | |||
429 | clean-generic: | ||
430 | |||
431 | distclean-generic: | ||
432 | -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) | ||
433 | |||
434 | maintainer-clean-generic: | ||
435 | @echo "This command is intended for maintainers to use" | ||
436 | @echo "it deletes files that may require special tools to rebuild." | ||
437 | clean: clean-am | ||
438 | |||
439 | clean-am: clean-generic clean-libtool clean-pluginimpLTLIBRARIES \ | ||
440 | mostlyclean-am | ||
441 | |||
442 | distclean: distclean-am | ||
443 | -rm -rf ./$(DEPDIR) | ||
444 | -rm -f Makefile | ||
445 | distclean-am: clean-am distclean-compile distclean-generic \ | ||
446 | distclean-tags | ||
447 | |||
448 | dvi: dvi-am | ||
449 | |||
450 | dvi-am: | ||
451 | |||
452 | html: html-am | ||
453 | |||
454 | info: info-am | ||
455 | |||
456 | info-am: | ||
457 | |||
458 | install-data-am: install-pluginimpLTLIBRARIES | ||
459 | |||
460 | install-dvi: install-dvi-am | ||
461 | |||
462 | install-exec-am: | ||
463 | |||
464 | install-html: install-html-am | ||
465 | |||
466 | install-info: install-info-am | ||
467 | |||
468 | install-man: | ||
469 | |||
470 | install-pdf: install-pdf-am | ||
471 | |||
472 | install-ps: install-ps-am | ||
473 | |||
474 | installcheck-am: | ||
475 | |||
476 | maintainer-clean: maintainer-clean-am | ||
477 | -rm -rf ./$(DEPDIR) | ||
478 | -rm -f Makefile | ||
479 | maintainer-clean-am: distclean-am maintainer-clean-generic | ||
480 | |||
481 | mostlyclean: mostlyclean-am | ||
482 | |||
483 | mostlyclean-am: mostlyclean-compile mostlyclean-generic \ | ||
484 | mostlyclean-libtool | ||
485 | |||
486 | pdf: pdf-am | ||
487 | |||
488 | pdf-am: | ||
489 | |||
490 | ps: ps-am | ||
491 | |||
492 | ps-am: | ||
493 | |||
494 | uninstall-am: uninstall-pluginimpLTLIBRARIES | ||
495 | |||
496 | .MAKE: install-am install-strip | ||
497 | |||
498 | .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ | ||
499 | clean-libtool clean-pluginimpLTLIBRARIES ctags distclean \ | ||
500 | distclean-compile distclean-generic distclean-libtool \ | ||
501 | distclean-tags distdir dvi dvi-am html html-am info info-am \ | ||
502 | install install-am install-data install-data-am install-dvi \ | ||
503 | install-dvi-am install-exec install-exec-am install-html \ | ||
504 | install-html-am install-info install-info-am install-man \ | ||
505 | install-pdf install-pdf-am install-pluginimpLTLIBRARIES \ | ||
506 | install-ps install-ps-am install-strip installcheck \ | ||
507 | installcheck-am installdirs maintainer-clean \ | ||
508 | maintainer-clean-generic mostlyclean mostlyclean-compile \ | ||
509 | mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ | ||
510 | tags uninstall uninstall-am uninstall-pluginimpLTLIBRARIES | ||
511 | |||
512 | # Tell versions [3.59,3.63) of GNU make to not export all variables. | ||
513 | # Otherwise a system limit (for SysV at least) may be exceeded. | ||
514 | .NOEXPORT: | ||
diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_flt/Makefile.am b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_flt/Makefile.am new file mode 100644 index 0000000..4b479c7 --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_flt/Makefile.am | |||
@@ -0,0 +1,24 @@ | |||
1 | pluginimpdir = $(pkglibdir)/plugins/import | ||
2 | |||
3 | if EXPERIMENTAL | ||
4 | pluginimp_LTLIBRARIES = imp_flt.la | ||
5 | endif | ||
6 | |||
7 | AM_CFLAGS = \ | ||
8 | -Wall -ansi -pedantic \ | ||
9 | -DG_LOG_DOMAIN=\"LibG3D\" \ | ||
10 | @DBG_CFLAGS@ -DDEBUG=@DEBUG@ \ | ||
11 | @GLIB_CFLAGS@ | ||
12 | |||
13 | INCLUDES = -I$(top_srcdir)/include | ||
14 | |||
15 | AM_LDFLAGS = \ | ||
16 | -no-undefined -module \ | ||
17 | @PLUGINS_LDFLAGS@ | ||
18 | |||
19 | LIBTOOL += --quiet | ||
20 | |||
21 | imp_flt_la_SOURCES = imp_flt.c imp_flt.h \ | ||
22 | imp_flt_opcodes.h \ | ||
23 | imp_flt_callbacks.c imp_flt_callbacks.h | ||
24 | imp_flt_la_LIBADD = $(top_builddir)/src/libg3d.la @GLIB_LIBS@ | ||
diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_flt/Makefile.in b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_flt/Makefile.in new file mode 100644 index 0000000..1838da2 --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_flt/Makefile.in | |||
@@ -0,0 +1,514 @@ | |||
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_flt | ||
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_flt_la_DEPENDENCIES = $(top_builddir)/src/libg3d.la | ||
58 | am_imp_flt_la_OBJECTS = imp_flt.lo imp_flt_callbacks.lo | ||
59 | imp_flt_la_OBJECTS = $(am_imp_flt_la_OBJECTS) | ||
60 | @EXPERIMENTAL_TRUE@am_imp_flt_la_rpath = -rpath $(pluginimpdir) | ||
61 | DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include/g3d | ||
62 | depcomp = $(SHELL) $(top_srcdir)/config/depcomp | ||
63 | am__depfiles_maybe = depfiles | ||
64 | COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ | ||
65 | $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) | ||
66 | LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ | ||
67 | --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ | ||
68 | $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) | ||
69 | CCLD = $(CC) | ||
70 | LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ | ||
71 | --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ | ||
72 | $(LDFLAGS) -o $@ | ||
73 | SOURCES = $(imp_flt_la_SOURCES) | ||
74 | DIST_SOURCES = $(imp_flt_la_SOURCES) | ||
75 | ETAGS = etags | ||
76 | CTAGS = ctags | ||
77 | DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) | ||
78 | ACLOCAL = @ACLOCAL@ | ||
79 | AMTAR = @AMTAR@ | ||
80 | AR = @AR@ | ||
81 | AS = @AS@ | ||
82 | AUTOCONF = @AUTOCONF@ | ||
83 | AUTOHEADER = @AUTOHEADER@ | ||
84 | AUTOMAKE = @AUTOMAKE@ | ||
85 | AWK = @AWK@ | ||
86 | CC = @CC@ | ||
87 | CCDEPMODE = @CCDEPMODE@ | ||
88 | CFLAGS = @CFLAGS@ | ||
89 | CPP = @CPP@ | ||
90 | CPPFLAGS = @CPPFLAGS@ | ||
91 | CXX = @CXX@ | ||
92 | CXXCPP = @CXXCPP@ | ||
93 | CXXDEPMODE = @CXXDEPMODE@ | ||
94 | CXXFLAGS = @CXXFLAGS@ | ||
95 | CYGPATH_W = @CYGPATH_W@ | ||
96 | DBG_CFLAGS = @DBG_CFLAGS@ | ||
97 | DEBUG = @DEBUG@ | ||
98 | DEFS = @DEFS@ | ||
99 | DEPDIR = @DEPDIR@ | ||
100 | DLLTOOL = @DLLTOOL@ | ||
101 | ECHO = @ECHO@ | ||
102 | ECHO_C = @ECHO_C@ | ||
103 | ECHO_N = @ECHO_N@ | ||
104 | ECHO_T = @ECHO_T@ | ||
105 | EGREP = @EGREP@ | ||
106 | EXEEXT = @EXEEXT@ | ||
107 | F77 = @F77@ | ||
108 | FFLAGS = @FFLAGS@ | ||
109 | GDKPIXBUF_CFLAGS = @GDKPIXBUF_CFLAGS@ | ||
110 | GDKPIXBUF_LIBS = @GDKPIXBUF_LIBS@ | ||
111 | GLIB_CFLAGS = @GLIB_CFLAGS@ | ||
112 | GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ | ||
113 | GLIB_LIBS = @GLIB_LIBS@ | ||
114 | GLIB_MKENUMS = @GLIB_MKENUMS@ | ||
115 | GOBJECT_QUERY = @GOBJECT_QUERY@ | ||
116 | GREP = @GREP@ | ||
117 | GTKDOC_CHECK = @GTKDOC_CHECK@ | ||
118 | GTK_CFLAGS = @GTK_CFLAGS@ | ||
119 | GTK_LIBS = @GTK_LIBS@ | ||
120 | HTML_DIR = @HTML_DIR@ | ||
121 | INSTALL = @INSTALL@ | ||
122 | INSTALL_DATA = @INSTALL_DATA@ | ||
123 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ | ||
124 | INSTALL_SCRIPT = @INSTALL_SCRIPT@ | ||
125 | INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ | ||
126 | LDFLAGS = @LDFLAGS@ | ||
127 | LEX = @LEX@ | ||
128 | LEXLIB = @LEXLIB@ | ||
129 | LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ | ||
130 | LIBGSF_CFLAGS = @LIBGSF_CFLAGS@ | ||
131 | LIBGSF_LIBS = @LIBGSF_LIBS@ | ||
132 | LIBOBJS = @LIBOBJS@ | ||
133 | LIBS = @LIBS@ | ||
134 | LIBTOOL = @LIBTOOL@ --quiet | ||
135 | LIBXML2_CFLAGS = @LIBXML2_CFLAGS@ | ||
136 | LIBXML2_LIBS = @LIBXML2_LIBS@ | ||
137 | LN_S = @LN_S@ | ||
138 | LTLIBOBJS = @LTLIBOBJS@ | ||
139 | LTVERSION = @LTVERSION@ | ||
140 | MAGIC_LIBS = @MAGIC_LIBS@ | ||
141 | MAKEINFO = @MAKEINFO@ | ||
142 | MATH_LIBS = @MATH_LIBS@ | ||
143 | MKDIR_P = @MKDIR_P@ | ||
144 | OBJDUMP = @OBJDUMP@ | ||
145 | OBJEXT = @OBJEXT@ | ||
146 | PACKAGE = @PACKAGE@ | ||
147 | PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ | ||
148 | PACKAGE_NAME = @PACKAGE_NAME@ | ||
149 | PACKAGE_STRING = @PACKAGE_STRING@ | ||
150 | PACKAGE_TARNAME = @PACKAGE_TARNAME@ | ||
151 | PACKAGE_VERSION = @PACKAGE_VERSION@ | ||
152 | PATH_SEPARATOR = @PATH_SEPARATOR@ | ||
153 | PKG_CONFIG = @PKG_CONFIG@ | ||
154 | PLUGINS_LDFLAGS = @PLUGINS_LDFLAGS@ | ||
155 | RANLIB = @RANLIB@ | ||
156 | SET_MAKE = @SET_MAKE@ | ||
157 | SHELL = @SHELL@ | ||
158 | STRIP = @STRIP@ | ||
159 | VERSION = @VERSION@ | ||
160 | XML2_CONFIG = @XML2_CONFIG@ | ||
161 | XML_CPPFLAGS = @XML_CPPFLAGS@ | ||
162 | XML_LIBS = @XML_LIBS@ | ||
163 | Z_CFLAGS = @Z_CFLAGS@ | ||
164 | Z_LIBS = @Z_LIBS@ | ||
165 | abs_builddir = @abs_builddir@ | ||
166 | abs_srcdir = @abs_srcdir@ | ||
167 | abs_top_builddir = @abs_top_builddir@ | ||
168 | abs_top_srcdir = @abs_top_srcdir@ | ||
169 | ac_ct_CC = @ac_ct_CC@ | ||
170 | ac_ct_CXX = @ac_ct_CXX@ | ||
171 | ac_ct_F77 = @ac_ct_F77@ | ||
172 | am__include = @am__include@ | ||
173 | am__leading_dot = @am__leading_dot@ | ||
174 | am__quote = @am__quote@ | ||
175 | am__tar = @am__tar@ | ||
176 | am__untar = @am__untar@ | ||
177 | bindir = @bindir@ | ||
178 | build = @build@ | ||
179 | build_alias = @build_alias@ | ||
180 | build_cpu = @build_cpu@ | ||
181 | build_os = @build_os@ | ||
182 | build_vendor = @build_vendor@ | ||
183 | builddir = @builddir@ | ||
184 | datadir = @datadir@ | ||
185 | datarootdir = @datarootdir@ | ||
186 | docdir = @docdir@ | ||
187 | dvidir = @dvidir@ | ||
188 | exec_prefix = @exec_prefix@ | ||
189 | host = @host@ | ||
190 | host_alias = @host_alias@ | ||
191 | host_cpu = @host_cpu@ | ||
192 | host_os = @host_os@ | ||
193 | host_vendor = @host_vendor@ | ||
194 | htmldir = @htmldir@ | ||
195 | includedir = @includedir@ | ||
196 | infodir = @infodir@ | ||
197 | install_sh = @install_sh@ | ||
198 | libdir = @libdir@ | ||
199 | libexecdir = @libexecdir@ | ||
200 | localedir = @localedir@ | ||
201 | localstatedir = @localstatedir@ | ||
202 | mandir = @mandir@ | ||
203 | mkdir_p = @mkdir_p@ | ||
204 | oldincludedir = @oldincludedir@ | ||
205 | pdfdir = @pdfdir@ | ||
206 | prefix = @prefix@ | ||
207 | program_transform_name = @program_transform_name@ | ||
208 | psdir = @psdir@ | ||
209 | sbindir = @sbindir@ | ||
210 | sharedstatedir = @sharedstatedir@ | ||
211 | srcdir = @srcdir@ | ||
212 | sysconfdir = @sysconfdir@ | ||
213 | target_alias = @target_alias@ | ||
214 | top_builddir = @top_builddir@ | ||
215 | top_srcdir = @top_srcdir@ | ||
216 | pluginimpdir = $(pkglibdir)/plugins/import | ||
217 | @EXPERIMENTAL_TRUE@pluginimp_LTLIBRARIES = imp_flt.la | ||
218 | AM_CFLAGS = \ | ||
219 | -Wall -ansi -pedantic \ | ||
220 | -DG_LOG_DOMAIN=\"LibG3D\" \ | ||
221 | @DBG_CFLAGS@ -DDEBUG=@DEBUG@ \ | ||
222 | @GLIB_CFLAGS@ | ||
223 | |||
224 | INCLUDES = -I$(top_srcdir)/include | ||
225 | AM_LDFLAGS = \ | ||
226 | -no-undefined -module \ | ||
227 | @PLUGINS_LDFLAGS@ | ||
228 | |||
229 | imp_flt_la_SOURCES = imp_flt.c imp_flt.h \ | ||
230 | imp_flt_opcodes.h \ | ||
231 | imp_flt_callbacks.c imp_flt_callbacks.h | ||
232 | |||
233 | imp_flt_la_LIBADD = $(top_builddir)/src/libg3d.la @GLIB_LIBS@ | ||
234 | all: all-am | ||
235 | |||
236 | .SUFFIXES: | ||
237 | .SUFFIXES: .c .lo .o .obj | ||
238 | $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) | ||
239 | @for dep in $?; do \ | ||
240 | case '$(am__configure_deps)' in \ | ||
241 | *$$dep*) \ | ||
242 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ | ||
243 | && exit 0; \ | ||
244 | exit 1;; \ | ||
245 | esac; \ | ||
246 | done; \ | ||
247 | echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/import/imp_flt/Makefile'; \ | ||
248 | cd $(top_srcdir) && \ | ||
249 | $(AUTOMAKE) --gnu plugins/import/imp_flt/Makefile | ||
250 | .PRECIOUS: Makefile | ||
251 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status | ||
252 | @case '$?' in \ | ||
253 | *config.status*) \ | ||
254 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ | ||
255 | *) \ | ||
256 | echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ | ||
257 | cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ | ||
258 | esac; | ||
259 | |||
260 | $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) | ||
261 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh | ||
262 | |||
263 | $(top_srcdir)/configure: $(am__configure_deps) | ||
264 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh | ||
265 | $(ACLOCAL_M4): $(am__aclocal_m4_deps) | ||
266 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh | ||
267 | install-pluginimpLTLIBRARIES: $(pluginimp_LTLIBRARIES) | ||
268 | @$(NORMAL_INSTALL) | ||
269 | test -z "$(pluginimpdir)" || $(MKDIR_P) "$(DESTDIR)$(pluginimpdir)" | ||
270 | @list='$(pluginimp_LTLIBRARIES)'; for p in $$list; do \ | ||
271 | if test -f $$p; then \ | ||
272 | f=$(am__strip_dir) \ | ||
273 | echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(pluginimpLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(pluginimpdir)/$$f'"; \ | ||
274 | $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(pluginimpLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(pluginimpdir)/$$f"; \ | ||
275 | else :; fi; \ | ||
276 | done | ||
277 | |||
278 | uninstall-pluginimpLTLIBRARIES: | ||
279 | @$(NORMAL_UNINSTALL) | ||
280 | @list='$(pluginimp_LTLIBRARIES)'; for p in $$list; do \ | ||
281 | p=$(am__strip_dir) \ | ||
282 | echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pluginimpdir)/$$p'"; \ | ||
283 | $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pluginimpdir)/$$p"; \ | ||
284 | done | ||
285 | |||
286 | clean-pluginimpLTLIBRARIES: | ||
287 | -test -z "$(pluginimp_LTLIBRARIES)" || rm -f $(pluginimp_LTLIBRARIES) | ||
288 | @list='$(pluginimp_LTLIBRARIES)'; for p in $$list; do \ | ||
289 | dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ | ||
290 | test "$$dir" != "$$p" || dir=.; \ | ||
291 | echo "rm -f \"$${dir}/so_locations\""; \ | ||
292 | rm -f "$${dir}/so_locations"; \ | ||
293 | done | ||
294 | imp_flt.la: $(imp_flt_la_OBJECTS) $(imp_flt_la_DEPENDENCIES) | ||
295 | $(LINK) $(am_imp_flt_la_rpath) $(imp_flt_la_OBJECTS) $(imp_flt_la_LIBADD) $(LIBS) | ||
296 | |||
297 | mostlyclean-compile: | ||
298 | -rm -f *.$(OBJEXT) | ||
299 | |||
300 | distclean-compile: | ||
301 | -rm -f *.tab.c | ||
302 | |||
303 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imp_flt.Plo@am__quote@ | ||
304 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imp_flt_callbacks.Plo@am__quote@ | ||
305 | |||
306 | .c.o: | ||
307 | @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< | ||
308 | @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po | ||
309 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ | ||
310 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | ||
311 | @am__fastdepCC_FALSE@ $(COMPILE) -c $< | ||
312 | |||
313 | .c.obj: | ||
314 | @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` | ||
315 | @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po | ||
316 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ | ||
317 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | ||
318 | @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` | ||
319 | |||
320 | .c.lo: | ||
321 | @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< | ||
322 | @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo | ||
323 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ | ||
324 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | ||
325 | @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< | ||
326 | |||
327 | mostlyclean-libtool: | ||
328 | -rm -f *.lo | ||
329 | |||
330 | clean-libtool: | ||
331 | -rm -rf .libs _libs | ||
332 | |||
333 | ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) | ||
334 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ | ||
335 | unique=`for i in $$list; do \ | ||
336 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ | ||
337 | done | \ | ||
338 | $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ | ||
339 | END { if (nonempty) { for (i in files) print i; }; }'`; \ | ||
340 | mkid -fID $$unique | ||
341 | tags: TAGS | ||
342 | |||
343 | TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ | ||
344 | $(TAGS_FILES) $(LISP) | ||
345 | tags=; \ | ||
346 | here=`pwd`; \ | ||
347 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ | ||
348 | unique=`for i in $$list; do \ | ||
349 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ | ||
350 | done | \ | ||
351 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ | ||
352 | END { if (nonempty) { for (i in files) print i; }; }'`; \ | ||
353 | if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ | ||
354 | test -n "$$unique" || unique=$$empty_fix; \ | ||
355 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ | ||
356 | $$tags $$unique; \ | ||
357 | fi | ||
358 | ctags: CTAGS | ||
359 | CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ | ||
360 | $(TAGS_FILES) $(LISP) | ||
361 | tags=; \ | ||
362 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ | ||
363 | unique=`for i in $$list; do \ | ||
364 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ | ||
365 | done | \ | ||
366 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ | ||
367 | END { if (nonempty) { for (i in files) print i; }; }'`; \ | ||
368 | test -z "$(CTAGS_ARGS)$$tags$$unique" \ | ||
369 | || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ | ||
370 | $$tags $$unique | ||
371 | |||
372 | GTAGS: | ||
373 | here=`$(am__cd) $(top_builddir) && pwd` \ | ||
374 | && cd $(top_srcdir) \ | ||
375 | && gtags -i $(GTAGS_ARGS) $$here | ||
376 | |||
377 | distclean-tags: | ||
378 | -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags | ||
379 | |||
380 | distdir: $(DISTFILES) | ||
381 | @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ | ||
382 | topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ | ||
383 | list='$(DISTFILES)'; \ | ||
384 | dist_files=`for file in $$list; do echo $$file; done | \ | ||
385 | sed -e "s|^$$srcdirstrip/||;t" \ | ||
386 | -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ | ||
387 | case $$dist_files in \ | ||
388 | */*) $(MKDIR_P) `echo "$$dist_files" | \ | ||
389 | sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ | ||
390 | sort -u` ;; \ | ||
391 | esac; \ | ||
392 | for file in $$dist_files; do \ | ||
393 | if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ | ||
394 | if test -d $$d/$$file; then \ | ||
395 | dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ | ||
396 | if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ | ||
397 | cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ | ||
398 | fi; \ | ||
399 | cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ | ||
400 | else \ | ||
401 | test -f $(distdir)/$$file \ | ||
402 | || cp -p $$d/$$file $(distdir)/$$file \ | ||
403 | || exit 1; \ | ||
404 | fi; \ | ||
405 | done | ||
406 | check-am: all-am | ||
407 | check: check-am | ||
408 | all-am: Makefile $(LTLIBRARIES) | ||
409 | installdirs: | ||
410 | for dir in "$(DESTDIR)$(pluginimpdir)"; do \ | ||
411 | test -z "$$dir" || $(MKDIR_P) "$$dir"; \ | ||
412 | done | ||
413 | install: install-am | ||
414 | install-exec: install-exec-am | ||
415 | install-data: install-data-am | ||
416 | uninstall: uninstall-am | ||
417 | |||
418 | install-am: all-am | ||
419 | @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am | ||
420 | |||
421 | installcheck: installcheck-am | ||
422 | install-strip: | ||
423 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ | ||
424 | install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ | ||
425 | `test -z '$(STRIP)' || \ | ||
426 | echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install | ||
427 | mostlyclean-generic: | ||
428 | |||
429 | clean-generic: | ||
430 | |||
431 | distclean-generic: | ||
432 | -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) | ||
433 | |||
434 | maintainer-clean-generic: | ||
435 | @echo "This command is intended for maintainers to use" | ||
436 | @echo "it deletes files that may require special tools to rebuild." | ||
437 | clean: clean-am | ||
438 | |||
439 | clean-am: clean-generic clean-libtool clean-pluginimpLTLIBRARIES \ | ||
440 | mostlyclean-am | ||
441 | |||
442 | distclean: distclean-am | ||
443 | -rm -rf ./$(DEPDIR) | ||
444 | -rm -f Makefile | ||
445 | distclean-am: clean-am distclean-compile distclean-generic \ | ||
446 | distclean-tags | ||
447 | |||
448 | dvi: dvi-am | ||
449 | |||
450 | dvi-am: | ||
451 | |||
452 | html: html-am | ||
453 | |||
454 | info: info-am | ||
455 | |||
456 | info-am: | ||
457 | |||
458 | install-data-am: install-pluginimpLTLIBRARIES | ||
459 | |||
460 | install-dvi: install-dvi-am | ||
461 | |||
462 | install-exec-am: | ||
463 | |||
464 | install-html: install-html-am | ||
465 | |||
466 | install-info: install-info-am | ||
467 | |||
468 | install-man: | ||
469 | |||
470 | install-pdf: install-pdf-am | ||
471 | |||
472 | install-ps: install-ps-am | ||
473 | |||
474 | installcheck-am: | ||
475 | |||
476 | maintainer-clean: maintainer-clean-am | ||
477 | -rm -rf ./$(DEPDIR) | ||
478 | -rm -f Makefile | ||
479 | maintainer-clean-am: distclean-am maintainer-clean-generic | ||
480 | |||
481 | mostlyclean: mostlyclean-am | ||
482 | |||
483 | mostlyclean-am: mostlyclean-compile mostlyclean-generic \ | ||
484 | mostlyclean-libtool | ||
485 | |||
486 | pdf: pdf-am | ||
487 | |||
488 | pdf-am: | ||
489 | |||
490 | ps: ps-am | ||
491 | |||
492 | ps-am: | ||
493 | |||
494 | uninstall-am: uninstall-pluginimpLTLIBRARIES | ||
495 | |||
496 | .MAKE: install-am install-strip | ||
497 | |||
498 | .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ | ||
499 | clean-libtool clean-pluginimpLTLIBRARIES ctags distclean \ | ||
500 | distclean-compile distclean-generic distclean-libtool \ | ||
501 | distclean-tags distdir dvi dvi-am html html-am info info-am \ | ||
502 | install install-am install-data install-data-am install-dvi \ | ||
503 | install-dvi-am install-exec install-exec-am install-html \ | ||
504 | install-html-am install-info install-info-am install-man \ | ||
505 | install-pdf install-pdf-am install-pluginimpLTLIBRARIES \ | ||
506 | install-ps install-ps-am install-strip installcheck \ | ||
507 | installcheck-am installdirs maintainer-clean \ | ||
508 | maintainer-clean-generic mostlyclean mostlyclean-compile \ | ||
509 | mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ | ||
510 | tags uninstall uninstall-am uninstall-pluginimpLTLIBRARIES | ||
511 | |||
512 | # Tell versions [3.59,3.63) of GNU make to not export all variables. | ||
513 | # Otherwise a system limit (for SysV at least) may be exceeded. | ||
514 | .NOEXPORT: | ||
diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_flt/imp_flt.c b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_flt/imp_flt.c new file mode 100644 index 0000000..6a92b5a --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_flt/imp_flt.c | |||
@@ -0,0 +1,175 @@ | |||
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 <g3d/types.h> | ||
24 | #include <g3d/context.h> | ||
25 | #include <g3d/stream.h> | ||
26 | #include <g3d/material.h> | ||
27 | #include <g3d/model.h> | ||
28 | #include <g3d/matrix.h> | ||
29 | |||
30 | #include "imp_flt_opcodes.h" | ||
31 | |||
32 | FltOpcode *flt_opcode_info(guint32 opcode); | ||
33 | |||
34 | EAPI | ||
35 | gboolean plugin_load_model_from_stream(G3DContext *context, G3DStream *stream, | ||
36 | G3DModel *model, gpointer user_data) | ||
37 | { | ||
38 | guint16 opcode, rlen; | ||
39 | FltOpcode *oi; | ||
40 | FltGlobalData *gd; | ||
41 | FltLocalData *ld; | ||
42 | G3DObject *g3dobj = NULL; | ||
43 | gpointer level_object = NULL; | ||
44 | gchar *pad; | ||
45 | G3DFloat prev_pcnt = 0.0, pcnt; | ||
46 | G3DMatrix rmatrix[16]; | ||
47 | |||
48 | gd = g_new0(FltGlobalData, 1); | ||
49 | gd->context = context; | ||
50 | gd->model = model; | ||
51 | gd->stream = stream; | ||
52 | gd->oqueue = g_queue_new(); | ||
53 | |||
54 | while(!g3d_stream_eof(stream)) { | ||
55 | /* get record information */ | ||
56 | opcode = g3d_stream_read_int16_be(stream); | ||
57 | rlen = g3d_stream_read_int16_be(stream); | ||
58 | |||
59 | /* create local data */ | ||
60 | ld = g_new0(FltLocalData, 1); | ||
61 | ld->opcode = opcode; | ||
62 | ld->nb = rlen - 4; | ||
63 | ld->g3dobj = g3dobj; | ||
64 | ld->level_object = level_object; | ||
65 | |||
66 | if(opcode == 0) { | ||
67 | /* end of file or error */ | ||
68 | break; | ||
69 | } | ||
70 | |||
71 | oi = flt_opcode_info(opcode); | ||
72 | |||
73 | pad = g_strnfill(gd->level, ' '); | ||
74 | g_debug("\\%s[%04d][%c] %8d: %s", pad, opcode, | ||
75 | oi ? (oi->callback ? 'f' : ' ') : ' ', | ||
76 | rlen, | ||
77 | oi ? oi->description : "unknown"); | ||
78 | g_free(pad); | ||
79 | |||
80 | if(oi && oi->callback) | ||
81 | oi->callback(gd, ld); | ||
82 | |||
83 | /* skip remaining bytes */ | ||
84 | if(ld->nb > 0) | ||
85 | g3d_stream_skip(stream, ld->nb); | ||
86 | |||
87 | /* free local data */ | ||
88 | g3dobj = ld->g3dobj; | ||
89 | level_object = ld->level_object; | ||
90 | g_free(ld); | ||
91 | |||
92 | /* update caller */ | ||
93 | pcnt = (G3DFloat)g3d_stream_tell(stream) / | ||
94 | (G3DFloat)g3d_stream_size(stream); | ||
95 | if((pcnt - prev_pcnt) > 0.002) { | ||
96 | prev_pcnt = pcnt; | ||
97 | g3d_context_update_progress_bar(context, pcnt, TRUE); | ||
98 | } | ||
99 | g3d_context_update_interface(context); | ||
100 | } | ||
101 | |||
102 | g_queue_free(gd->oqueue); | ||
103 | if(gd->vertex_palette) { | ||
104 | g_free(gd->vertex_palette->offsets); | ||
105 | g_free(gd->vertex_palette->flags); | ||
106 | g_free(gd->vertex_palette->vertex_data); | ||
107 | g_free(gd->vertex_palette->normal_data); | ||
108 | g_free(gd->vertex_palette->tex_vertex_data); | ||
109 | g_free(gd->vertex_palette->vertex_materials); | ||
110 | g_free(gd->vertex_palette); | ||
111 | } | ||
112 | if(gd->texture_palette) { | ||
113 | g_free(gd->texture_palette->offsets); | ||
114 | g_free(gd->texture_palette->textures); | ||
115 | g_free(gd->texture_palette); | ||
116 | } | ||
117 | g_free(gd); | ||
118 | |||
119 | g3d_matrix_identity(rmatrix); | ||
120 | g3d_matrix_rotate_xyz(G_PI * -90.0 / 180, 0.0, 0.0, rmatrix); | ||
121 | g3d_model_transform(model, rmatrix); | ||
122 | |||
123 | return TRUE; | ||
124 | } | ||
125 | |||
126 | EAPI | ||
127 | gchar *plugin_description(G3DContext *context) | ||
128 | { | ||
129 | return g_strdup("OpenFlight models."); | ||
130 | } | ||
131 | |||
132 | EAPI | ||
133 | gchar **plugin_extensions(G3DContext *context) | ||
134 | { | ||
135 | return g_strsplit("flt", ":", 0); | ||
136 | } | ||
137 | |||
138 | /* | ||
139 | * FLT specific | ||
140 | */ | ||
141 | |||
142 | FltOpcode *flt_opcode_info(guint32 opcode) | ||
143 | { | ||
144 | guint32 i; | ||
145 | |||
146 | for(i = 0; flt_opcodes[i].opcode != 0; i ++) | ||
147 | if(flt_opcodes[i].opcode == opcode) | ||
148 | return &(flt_opcodes[i]); | ||
149 | return NULL; | ||
150 | } | ||
151 | |||
152 | guint32 flt_read_typed_index(G3DStream *stream, guint32 type, gint32 *len) | ||
153 | { | ||
154 | guint32 val = 0; | ||
155 | |||
156 | switch(type) { | ||
157 | case 1: | ||
158 | val = g3d_stream_read_int8(stream); | ||
159 | *len -= 1; | ||
160 | break; | ||
161 | case 2: | ||
162 | val = g3d_stream_read_int16_be(stream); | ||
163 | *len -= 2; | ||
164 | break; | ||
165 | case 4: | ||
166 | val = g3d_stream_read_int32_be(stream); | ||
167 | *len -= 4; | ||
168 | break; | ||
169 | default: | ||
170 | g_warning("FLT: unknown index type %d\n", type); | ||
171 | break; | ||
172 | } | ||
173 | return val; | ||
174 | } | ||
175 | |||
diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_flt/imp_flt.h b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_flt/imp_flt.h new file mode 100644 index 0000000..0c23cd1 --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_flt/imp_flt.h | |||
@@ -0,0 +1,30 @@ | |||
1 | /* $Id$ */ | ||
2 | |||
3 | /* | ||
4 | libg3d - 3D object loading library | ||
5 | |||
6 | Copyright (C) 2005-2009 Markus Dahms <mad@automagically.de> | ||
7 | |||
8 | This library is free software; you can redistribute it and/or | ||
9 | modify it under the terms of the GNU Lesser General Public | ||
10 | License as published by the Free Software Foundation; either | ||
11 | version 2.1 of the License, or (at your option) any later version. | ||
12 | |||
13 | This library is distributed in the hope that it will be useful, | ||
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
16 | Lesser General Public License for more details. | ||
17 | |||
18 | You should have received a copy of the GNU Lesser General Public | ||
19 | License along with this library; if not, write to the Free Software | ||
20 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
21 | */ | ||
22 | #ifndef _IMP_FLT_H | ||
23 | #define _IMP_FLT_H | ||
24 | |||
25 | #include <glib.h> | ||
26 | #include <g3d/stream.h> | ||
27 | |||
28 | guint32 flt_read_typed_index(G3DStream *stream, guint32 type, gint32 *len); | ||
29 | |||
30 | #endif /* _IMP_FLT_H */ | ||
diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_flt/imp_flt_callbacks.c b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_flt/imp_flt_callbacks.c new file mode 100644 index 0000000..44fd8f6 --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_flt/imp_flt_callbacks.c | |||
@@ -0,0 +1,999 @@ | |||
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 <math.h> | ||
25 | |||
26 | #include <g3d/stream.h> | ||
27 | #include <g3d/material.h> | ||
28 | #include <g3d/texture.h> | ||
29 | #include <g3d/model.h> | ||
30 | |||
31 | #include "imp_flt.h" | ||
32 | #include "imp_flt_callbacks.h" | ||
33 | |||
34 | /* header */ | ||
35 | gboolean flt_cb_0001(FltGlobalData *gd, FltLocalData *ld) | ||
36 | { | ||
37 | gchar id[8]; | ||
38 | |||
39 | g3d_stream_read(gd->stream, id, 8); | ||
40 | id[7] = '\0'; | ||
41 | ld->nb -= 8; | ||
42 | gd->fversion = g3d_stream_read_int32_be(gd->stream); | ||
43 | ld->nb -= 4; | ||
44 | |||
45 | g_debug("FLT: header: '%s' revision %u", id, gd->fversion); | ||
46 | |||
47 | return TRUE; | ||
48 | } | ||
49 | |||
50 | /* group */ | ||
51 | gboolean flt_cb_0002(FltGlobalData *gd, FltLocalData *ld) | ||
52 | { | ||
53 | G3DObject *object, *pobj; | ||
54 | gchar namebuf[8]; | ||
55 | |||
56 | object = g_new0(G3DObject, 1); | ||
57 | pobj = (G3DObject *)g_queue_peek_head(gd->oqueue); | ||
58 | if(pobj != NULL) | ||
59 | pobj->objects = g_slist_append(pobj->objects, object); | ||
60 | else | ||
61 | gd->model->objects = g_slist_append(gd->model->objects, object); | ||
62 | ld->g3dobj = object; | ||
63 | |||
64 | /* group ID */ | ||
65 | g3d_stream_read(gd->stream, namebuf, 8); | ||
66 | ld->nb -= 8; | ||
67 | namebuf[7] = '\0'; | ||
68 | object->name = g_strdup_printf("group '%s'", namebuf); | ||
69 | |||
70 | return TRUE; | ||
71 | } | ||
72 | |||
73 | /* object */ | ||
74 | gboolean flt_cb_0004(FltGlobalData *gd, FltLocalData *ld) | ||
75 | { | ||
76 | G3DObject *object, *pobj; | ||
77 | G3DMaterial *material; | ||
78 | gchar namebuf[8]; | ||
79 | |||
80 | object = g_new0(G3DObject, 1); | ||
81 | pobj = (G3DObject *)g_queue_peek_head(gd->oqueue); | ||
82 | if(pobj != NULL) | ||
83 | pobj->objects = g_slist_append(pobj->objects, object); | ||
84 | else | ||
85 | gd->model->objects = g_slist_append(gd->model->objects, object); | ||
86 | ld->g3dobj = object; | ||
87 | |||
88 | material = g3d_material_new(); | ||
89 | material->name = g_strdup("fallback material"); | ||
90 | object->materials = g_slist_append(object->materials, material); | ||
91 | |||
92 | /* object ID */ | ||
93 | g3d_stream_read(gd->stream, namebuf, 8); | ||
94 | ld->nb -= 8; | ||
95 | namebuf[7] = '\0'; | ||
96 | object->name = g_strdup_printf("object '%s'", namebuf); | ||
97 | |||
98 | /* flags */ | ||
99 | g3d_stream_read_int32_be(gd->stream); | ||
100 | ld->nb -= 4; | ||
101 | |||
102 | /* relative priority */ | ||
103 | g3d_stream_read_int16_be(gd->stream); | ||
104 | ld->nb -= 2; | ||
105 | |||
106 | /* transparency */ | ||
107 | g3d_stream_read_int16_be(gd->stream); | ||
108 | ld->nb -= 2; | ||
109 | |||
110 | /* special effect ID 1 */ | ||
111 | g3d_stream_read_int16_be(gd->stream); | ||
112 | ld->nb -= 2; | ||
113 | |||
114 | /* special effect ID 2 */ | ||
115 | g3d_stream_read_int16_be(gd->stream); | ||
116 | ld->nb -= 2; | ||
117 | |||
118 | /* significance */ | ||
119 | g3d_stream_read_int16_be(gd->stream); | ||
120 | ld->nb -= 2; | ||
121 | |||
122 | /* reserved */ | ||
123 | g3d_stream_read_int16_be(gd->stream); | ||
124 | ld->nb -= 2; | ||
125 | |||
126 | return TRUE; | ||
127 | } | ||
128 | |||
129 | /* face */ | ||
130 | gboolean flt_cb_0005(FltGlobalData *gd, FltLocalData *ld) | ||
131 | { | ||
132 | G3DObject *object = ld->g3dobj; | ||
133 | G3DMaterial *material; | ||
134 | G3DFace *face; | ||
135 | gint16 index; | ||
136 | guint32 flags; | ||
137 | G3DFloat r, g, b; | ||
138 | |||
139 | g_return_val_if_fail(object != NULL, FALSE); | ||
140 | |||
141 | if(object->materials == NULL) { | ||
142 | material = g3d_material_new(); | ||
143 | material->name = g_strdup("(default material)"); | ||
144 | object->materials = g_slist_append(object->materials, material); | ||
145 | } | ||
146 | |||
147 | face = g_new0(G3DFace, 1); | ||
148 | face->material = g_slist_nth_data(object->materials, 0); | ||
149 | object->faces = g_slist_append(object->faces, face); | ||
150 | ld->level_object = face; | ||
151 | |||
152 | if(object->vertex_count == 0) { | ||
153 | if(gd->vertex_palette) { | ||
154 | /* copy vertex palette to object */ | ||
155 | object->vertex_count = gd->vertex_palette->n_entries; | ||
156 | object->vertex_data = g_new0(G3DFloat, object->vertex_count * 3); | ||
157 | memcpy(object->vertex_data, gd->vertex_palette->vertex_data, | ||
158 | object->vertex_count * 3 * sizeof(G3DFloat)); | ||
159 | } | ||
160 | } | ||
161 | |||
162 | /* id */ | ||
163 | g3d_stream_skip(gd->stream, 8); | ||
164 | ld->nb -= 8; | ||
165 | /* IR color code */ | ||
166 | g3d_stream_read_int32_be(gd->stream); | ||
167 | ld->nb -= 4; | ||
168 | /* relative priority */ | ||
169 | g3d_stream_read_int16_be(gd->stream); | ||
170 | ld->nb -= 2; | ||
171 | /* draw type */ | ||
172 | g3d_stream_read_int8(gd->stream); | ||
173 | ld->nb --; | ||
174 | /* texture white */ | ||
175 | g3d_stream_read_int8(gd->stream); | ||
176 | ld->nb --; | ||
177 | /* color name index */ | ||
178 | g3d_stream_read_int16_be(gd->stream); | ||
179 | ld->nb -= 2; | ||
180 | /* alternate color name index */ | ||
181 | g3d_stream_read_int16_be(gd->stream); | ||
182 | ld->nb -= 2; | ||
183 | /* reserved */ | ||
184 | g3d_stream_read_int8(gd->stream); | ||
185 | ld->nb --; | ||
186 | /* template (billboard) */ | ||
187 | g3d_stream_read_int8(gd->stream); | ||
188 | ld->nb --; | ||
189 | /* detail texture pattern */ | ||
190 | index = g3d_stream_read_int16_be(gd->stream); | ||
191 | ld->nb -= 2; | ||
192 | if(index != -1) | ||
193 | if(gd->texture_palette && (index < gd->texture_palette->size)) | ||
194 | face->tex_image = gd->texture_palette->textures[index]; | ||
195 | /* texture pattern */ | ||
196 | index = g3d_stream_read_int16_be(gd->stream); | ||
197 | ld->nb -= 2; | ||
198 | if((face->tex_image == NULL) && (index != -1)) | ||
199 | if(gd->texture_palette && (index < gd->texture_palette->size)) | ||
200 | face->tex_image = gd->texture_palette->textures[index]; | ||
201 | |||
202 | if(face->tex_image) | ||
203 | face->tex_image->tex_env = G3D_TEXENV_REPLACE; | ||
204 | |||
205 | /* material index */ | ||
206 | index = g3d_stream_read_int16_be(gd->stream); | ||
207 | ld->nb -= 2; | ||
208 | if(index != -1) { | ||
209 | material = g_slist_nth_data(gd->model->materials, index); | ||
210 | if(material) | ||
211 | face->material = material; | ||
212 | } | ||
213 | /* surface material code */ | ||
214 | g3d_stream_read_int16_be(gd->stream); | ||
215 | ld->nb -= 2; | ||
216 | /* feature ID */ | ||
217 | g3d_stream_read_int16_be(gd->stream); | ||
218 | ld->nb -= 2; | ||
219 | /* IR material code */ | ||
220 | g3d_stream_read_int32_be(gd->stream); | ||
221 | ld->nb -= 4; | ||
222 | /* transparency */ | ||
223 | g3d_stream_read_int16_be(gd->stream); | ||
224 | ld->nb -= 2; | ||
225 | /* LOD generation control */ | ||
226 | g3d_stream_read_int8(gd->stream); | ||
227 | ld->nb --; | ||
228 | /* line style index */ | ||
229 | g3d_stream_read_int8(gd->stream); | ||
230 | ld->nb --; | ||
231 | /* flags */ | ||
232 | flags = g3d_stream_read_int32_be(gd->stream); | ||
233 | ld->nb -= 4; | ||
234 | /* light mode */ | ||
235 | g3d_stream_read_int8(gd->stream); | ||
236 | ld->nb --; | ||
237 | /* reserved */ | ||
238 | g3d_stream_skip(gd->stream, 7); | ||
239 | ld->nb -= 7; | ||
240 | /* packed color, primary */ | ||
241 | if((flags & (1 << 1)) /* no color */ || | ||
242 | !(flags & (1 << 3))) /* packed color */ | ||
243 | g3d_stream_read_int32_be(gd->stream); | ||
244 | else { | ||
245 | g3d_stream_read_int8(gd->stream); /* alpha, unused */ | ||
246 | b = (G3DFloat)g3d_stream_read_int8(gd->stream) / 255.0; | ||
247 | g = (G3DFloat)g3d_stream_read_int8(gd->stream) / 255.0; | ||
248 | r = (G3DFloat)g3d_stream_read_int8(gd->stream) / 255.0; | ||
249 | material = g3d_material_new(); | ||
250 | material->r = r; | ||
251 | material->g = g; | ||
252 | material->b = b; | ||
253 | material->a = 1.0; | ||
254 | face->material = material; | ||
255 | } | ||
256 | ld->nb -= 4; | ||
257 | /* packed color, alternate */ | ||
258 | g3d_stream_read_int32_be(gd->stream); | ||
259 | ld->nb -= 4; | ||
260 | /* texture mapping index */ | ||
261 | index = g3d_stream_read_int16_be(gd->stream); | ||
262 | ld->nb -= 2; | ||
263 | |||
264 | return TRUE; | ||
265 | } | ||
266 | |||
267 | /* push level */ | ||
268 | gboolean flt_cb_0010(FltGlobalData *gd, FltLocalData *ld) | ||
269 | { | ||
270 | g_queue_push_head(gd->oqueue, ld->g3dobj); | ||
271 | |||
272 | gd->level ++; | ||
273 | return TRUE; | ||
274 | } | ||
275 | |||
276 | /* pop level */ | ||
277 | gboolean flt_cb_0011(FltGlobalData *gd, FltLocalData *ld) | ||
278 | { | ||
279 | ld->g3dobj = g_queue_pop_head(gd->oqueue); | ||
280 | ld->level_object = NULL; | ||
281 | |||
282 | if(gd->level > 0) | ||
283 | gd->level --; | ||
284 | return TRUE; | ||
285 | } | ||
286 | |||
287 | /* color palette */ | ||
288 | gboolean flt_cb_0032(FltGlobalData *gd, FltLocalData *ld) | ||
289 | { | ||
290 | G3DMaterial *material; | ||
291 | G3DObject *cobj; | ||
292 | gint32 i; | ||
293 | |||
294 | cobj = g_new0(G3DObject, 1); | ||
295 | cobj->name = g_strdup("color palette"); | ||
296 | gd->model->objects = g_slist_append(gd->model->objects, cobj); | ||
297 | |||
298 | /* skip reserved bytes */ | ||
299 | g3d_stream_skip(gd->stream, 128); | ||
300 | ld->nb -= 128; | ||
301 | |||
302 | /* get colors */ | ||
303 | for(i = 0; i < 1024; i ++) { | ||
304 | material = g3d_material_new(); | ||
305 | material->name = g_strdup_printf("color %d", i); | ||
306 | cobj->materials = g_slist_append(cobj->materials, material); | ||
307 | |||
308 | material->a = g3d_stream_read_int8(gd->stream) / 255.0; | ||
309 | material->b = g3d_stream_read_int8(gd->stream) / 255.0; | ||
310 | material->g = g3d_stream_read_int8(gd->stream) / 255.0; | ||
311 | material->r = g3d_stream_read_int8(gd->stream) / 255.0; | ||
312 | ld->nb -= 4; | ||
313 | } | ||
314 | |||
315 | return TRUE; | ||
316 | } | ||
317 | |||
318 | /* long ID */ | ||
319 | gboolean flt_cb_0033(FltGlobalData *gd, FltLocalData *ld) | ||
320 | { | ||
321 | G3DObject *object = ld->g3dobj; | ||
322 | |||
323 | g_return_val_if_fail(object != NULL, FALSE); | ||
324 | |||
325 | g_free(object->name); | ||
326 | object->name = g_new0(gchar, ld->nb); | ||
327 | g3d_stream_read(gd->stream, object->name, ld->nb); | ||
328 | object->name[ld->nb - 1] = '\0'; | ||
329 | ld->nb = 0; | ||
330 | |||
331 | return TRUE; | ||
332 | } | ||
333 | |||
334 | /* texture palette */ | ||
335 | gboolean flt_cb_0064(FltGlobalData *gd, FltLocalData *ld) | ||
336 | { | ||
337 | gchar fname[201]; | ||
338 | gint32 max, index, offx, offy; | ||
339 | |||
340 | g3d_stream_read(gd->stream, fname, 200); | ||
341 | ld->nb -= 200; | ||
342 | |||
343 | index = g3d_stream_read_int32_be(gd->stream); | ||
344 | offx = g3d_stream_read_int32_be(gd->stream); | ||
345 | offy = g3d_stream_read_int32_be(gd->stream); | ||
346 | ld->nb -= 12; | ||
347 | |||
348 | if(gd->texture_palette == NULL) | ||
349 | gd->texture_palette = g_new0(FltTexturePalette, 1); | ||
350 | |||
351 | max = MAX(index + 1, gd->texture_palette->size); | ||
352 | gd->texture_palette->size = max; | ||
353 | gd->texture_palette->offsets = g_realloc(gd->texture_palette->offsets, | ||
354 | max * 2 * sizeof(gint32)); | ||
355 | gd->texture_palette->textures = g_realloc(gd->texture_palette->textures, | ||
356 | max * sizeof(G3DImage *)); | ||
357 | gd->texture_palette->offsets[index * 2 + 0] = offx; | ||
358 | gd->texture_palette->offsets[index * 2 + 1] = offy; | ||
359 | |||
360 | #if DEBUG > 2 | ||
361 | g_debug("FLT: 0064: %s (index %d @ %d, %d)", fname, index, offx, offy); | ||
362 | #endif | ||
363 | |||
364 | gd->texture_palette->textures[index] = | ||
365 | g3d_texture_load_cached(gd->context, gd->model, fname); | ||
366 | |||
367 | return TRUE; | ||
368 | } | ||
369 | |||
370 | static gboolean flt_inc_vertex_palette(FltGlobalData *gd) | ||
371 | { | ||
372 | g_return_val_if_fail(gd->vertex_palette != NULL, FALSE); | ||
373 | |||
374 | gd->vertex_palette->n_entries ++; | ||
375 | gd->vertex_palette->offsets = g_realloc( | ||
376 | gd->vertex_palette->offsets, | ||
377 | gd->vertex_palette->n_entries * sizeof(goffset)); | ||
378 | gd->vertex_palette->flags = g_realloc( | ||
379 | gd->vertex_palette->flags, | ||
380 | gd->vertex_palette->n_entries * sizeof(guint32)); | ||
381 | gd->vertex_palette->vertex_data = g_realloc( | ||
382 | gd->vertex_palette->vertex_data, | ||
383 | gd->vertex_palette->n_entries * 3 * sizeof(G3DFloat)); | ||
384 | gd->vertex_palette->normal_data = g_realloc( | ||
385 | gd->vertex_palette->normal_data, | ||
386 | gd->vertex_palette->n_entries * 3 * sizeof(G3DFloat)); | ||
387 | gd->vertex_palette->tex_vertex_data = g_realloc( | ||
388 | gd->vertex_palette->tex_vertex_data, | ||
389 | gd->vertex_palette->n_entries * 2 * sizeof(G3DFloat)); | ||
390 | gd->vertex_palette->vertex_materials = g_realloc( | ||
391 | gd->vertex_palette->vertex_materials, | ||
392 | gd->vertex_palette->n_entries * sizeof(G3DMaterial *)); | ||
393 | return TRUE; | ||
394 | } | ||
395 | |||
396 | /* vertex palette */ | ||
397 | gboolean flt_cb_0067(FltGlobalData *gd, FltLocalData *ld) | ||
398 | { | ||
399 | gd->vertex_palette = g_new0(FltVertexPalette, 1); | ||
400 | gd->vertex_palette->offset = 8; | ||
401 | return TRUE; | ||
402 | } | ||
403 | |||
404 | static G3DMaterial *flt_material_by_index(FltGlobalData *gd, guint32 i) | ||
405 | { | ||
406 | G3DObject *colobj; | ||
407 | |||
408 | colobj = g3d_model_get_object_by_name(gd->model, "color palette"); | ||
409 | if(colobj == NULL) | ||
410 | return NULL; | ||
411 | |||
412 | return g_slist_nth_data(colobj->materials, i); | ||
413 | } | ||
414 | |||
415 | #define FLOAT_EQUALS(a, b) (fabs((a) - (b)) < 0.001) | ||
416 | |||
417 | static G3DMaterial *flt_find_color(G3DObject *pobj, | ||
418 | G3DFloat r, G3DFloat g, G3DFloat b, G3DFloat a) | ||
419 | { | ||
420 | GSList *item; | ||
421 | G3DMaterial *material; | ||
422 | |||
423 | for(item = pobj->materials; item != NULL; item = item->next) { | ||
424 | material = item->data; | ||
425 | if(FLOAT_EQUALS(material->r, r) && FLOAT_EQUALS(material->g, g) && | ||
426 | FLOAT_EQUALS(material->b, b) && FLOAT_EQUALS(material->a, a)) | ||
427 | return material; | ||
428 | } | ||
429 | g_debug("did not find material"); | ||
430 | return NULL; | ||
431 | } | ||
432 | |||
433 | static gboolean flt_handle_vertex_color(FltGlobalData *gd, FltLocalData *ld, | ||
434 | guint32 flags) | ||
435 | { | ||
436 | G3DObject *vcolobj; | ||
437 | G3DMaterial *material; | ||
438 | G3DFloat r, g, b, a; | ||
439 | |||
440 | if(flags & FLT_FLAG_NO_COLOR) | ||
441 | return TRUE; | ||
442 | |||
443 | vcolobj = g3d_model_get_object_by_name(gd->model, "vertex colors"); | ||
444 | if(vcolobj == NULL) { | ||
445 | vcolobj = g_new0(G3DObject, 1); | ||
446 | vcolobj->name = g_strdup("vertex colors"); | ||
447 | gd->model->objects = g_slist_append(gd->model->objects, vcolobj); | ||
448 | } | ||
449 | a = (G3DFloat)g3d_stream_read_int8(gd->stream) / 255.0; | ||
450 | b = (G3DFloat)g3d_stream_read_int8(gd->stream) / 255.0; | ||
451 | g = (G3DFloat)g3d_stream_read_int8(gd->stream) / 255.0; | ||
452 | r = (G3DFloat)g3d_stream_read_int8(gd->stream) / 255.0; | ||
453 | ld->nb -= 4; | ||
454 | |||
455 | if(flags & FLT_FLAG_PACKED_COLOR) { | ||
456 | material = flt_find_color(vcolobj, r, g, b, a); | ||
457 | if(material == NULL) { | ||
458 | material = g3d_material_new(); | ||
459 | material->r = r; | ||
460 | material->g = g; | ||
461 | material->b = b; | ||
462 | material->a = a; | ||
463 | material->name = g_strdup_printf( | ||
464 | "vertex material (%.2f, %.2f, %.2f, %.2f)", r, g, b, a); | ||
465 | vcolobj->materials = g_slist_prepend(vcolobj->materials, material); | ||
466 | } | ||
467 | } else { | ||
468 | /* color index */ | ||
469 | material = flt_material_by_index(gd, | ||
470 | g3d_stream_read_int32_be(gd->stream)); | ||
471 | ld->nb -= 4; | ||
472 | } | ||
473 | gd->vertex_palette->vertex_materials[gd->vertex_palette->n_entries - 1] = | ||
474 | material; | ||
475 | return TRUE; | ||
476 | } | ||
477 | |||
478 | /* vertex with color record */ | ||
479 | gboolean flt_cb_0068(FltGlobalData *gd, FltLocalData *ld) | ||
480 | { | ||
481 | gint32 i, index; | ||
482 | guint32 flags; | ||
483 | |||
484 | if(!flt_inc_vertex_palette(gd)) | ||
485 | return FALSE; | ||
486 | |||
487 | index = gd->vertex_palette->n_entries - 1; | ||
488 | gd->vertex_palette->offsets[index] = gd->vertex_palette->offset; | ||
489 | gd->vertex_palette->offset += ld->nb + 4; | ||
490 | gd->vertex_palette->flags[index] = 0; | ||
491 | |||
492 | /* color name index */ | ||
493 | gd->vertex_palette->vertex_materials[index] = | ||
494 | flt_material_by_index(gd, g3d_stream_read_int16_be(gd->stream)); | ||
495 | ld->nb -= 2; | ||
496 | |||
497 | /* flags */ | ||
498 | flags = g3d_stream_read_int16_be(gd->stream); | ||
499 | ld->nb -= 2; | ||
500 | |||
501 | /* vertex coordinate */ | ||
502 | for(i = 0; i < 3; i ++) { | ||
503 | gd->vertex_palette->vertex_data[index * 3 + i] = | ||
504 | g3d_stream_read_double_be(gd->stream); | ||
505 | ld->nb -= 8; | ||
506 | } | ||
507 | |||
508 | flt_handle_vertex_color(gd, ld, flags); | ||
509 | |||
510 | return TRUE; | ||
511 | } | ||
512 | |||
513 | /* vertex with color and normal record */ | ||
514 | gboolean flt_cb_0069(FltGlobalData *gd, FltLocalData *ld) | ||
515 | { | ||
516 | gint32 i, index; | ||
517 | guint32 flags; | ||
518 | |||
519 | if(!flt_inc_vertex_palette(gd)) | ||
520 | return FALSE; | ||
521 | |||
522 | index = gd->vertex_palette->n_entries - 1; | ||
523 | gd->vertex_palette->offsets[index] = gd->vertex_palette->offset; | ||
524 | gd->vertex_palette->offset += ld->nb + 4; | ||
525 | gd->vertex_palette->flags[index] = G3D_FLAG_FAC_NORMALS; | ||
526 | |||
527 | /* color name index */ | ||
528 | gd->vertex_palette->vertex_materials[index] = | ||
529 | flt_material_by_index(gd, g3d_stream_read_int16_be(gd->stream)); | ||
530 | ld->nb -= 2; | ||
531 | |||
532 | /* flags */ | ||
533 | flags = g3d_stream_read_int16_be(gd->stream); | ||
534 | ld->nb -= 2; | ||
535 | |||
536 | /* vertex coordinate */ | ||
537 | for(i = 0; i < 3; i ++) { | ||
538 | gd->vertex_palette->vertex_data[index * 3 + i] = | ||
539 | g3d_stream_read_double_be(gd->stream); | ||
540 | ld->nb -= 8; | ||
541 | } | ||
542 | |||
543 | /* vertex normal */ | ||
544 | for(i = 0; i < 3; i ++) { | ||
545 | gd->vertex_palette->normal_data[index * 3 + i] = | ||
546 | g3d_stream_read_float_be(gd->stream); | ||
547 | ld->nb -= 4; | ||
548 | } | ||
549 | |||
550 | flt_handle_vertex_color(gd, ld, flags); | ||
551 | |||
552 | return TRUE; | ||
553 | } | ||
554 | |||
555 | /* vertex with color, normal and uv record */ | ||
556 | gboolean flt_cb_0070(FltGlobalData *gd, FltLocalData *ld) | ||
557 | { | ||
558 | gint32 i, index; | ||
559 | guint32 flags; | ||
560 | |||
561 | if(!flt_inc_vertex_palette(gd)) | ||
562 | return FALSE; | ||
563 | |||
564 | index = gd->vertex_palette->n_entries - 1; | ||
565 | gd->vertex_palette->offsets[index] = gd->vertex_palette->offset; | ||
566 | gd->vertex_palette->offset += ld->nb + 4; | ||
567 | gd->vertex_palette->flags[index] = | ||
568 | G3D_FLAG_FAC_NORMALS | G3D_FLAG_FAC_TEXMAP; | ||
569 | |||
570 | /* color name index */ | ||
571 | gd->vertex_palette->vertex_materials[index] = | ||
572 | flt_material_by_index(gd, g3d_stream_read_int16_be(gd->stream)); | ||
573 | ld->nb -= 2; | ||
574 | |||
575 | /* flags */ | ||
576 | flags = g3d_stream_read_int16_be(gd->stream); | ||
577 | ld->nb -= 2; | ||
578 | |||
579 | /* vertex coordinate */ | ||
580 | for(i = 0; i < 3; i ++) { | ||
581 | gd->vertex_palette->vertex_data[index * 3 + i] = | ||
582 | g3d_stream_read_double_be(gd->stream); | ||
583 | ld->nb -= 8; | ||
584 | } | ||
585 | |||
586 | /* vertex normal */ | ||
587 | for(i = 0; i < 3; i ++) { | ||
588 | gd->vertex_palette->normal_data[index * 3 + i] = | ||
589 | g3d_stream_read_float_be(gd->stream); | ||
590 | ld->nb -= 4; | ||
591 | } | ||
592 | |||
593 | /* vertex texture coordinate */ | ||
594 | for(i = 0; i < 2; i ++) { | ||
595 | gd->vertex_palette->tex_vertex_data[index * 2 + i] = | ||
596 | g3d_stream_read_float_be(gd->stream); | ||
597 | ld->nb -= 4; | ||
598 | } | ||
599 | |||
600 | flt_handle_vertex_color(gd, ld, flags); | ||
601 | |||
602 | return TRUE; | ||
603 | } | ||
604 | |||
605 | /* vertex with color and uv record */ | ||
606 | gboolean flt_cb_0071(FltGlobalData *gd, FltLocalData *ld) | ||
607 | { | ||
608 | gint32 i, index; | ||
609 | guint32 flags; | ||
610 | |||
611 | if(!flt_inc_vertex_palette(gd)) | ||
612 | return FALSE; | ||
613 | |||
614 | index = gd->vertex_palette->n_entries - 1; | ||
615 | gd->vertex_palette->offsets[index] = gd->vertex_palette->offset; | ||
616 | gd->vertex_palette->offset += ld->nb + 4; | ||
617 | gd->vertex_palette->flags[index] = G3D_FLAG_FAC_TEXMAP; | ||
618 | |||
619 | /* color name index */ | ||
620 | gd->vertex_palette->vertex_materials[index] = | ||
621 | flt_material_by_index(gd, g3d_stream_read_int16_be(gd->stream)); | ||
622 | ld->nb -= 2; | ||
623 | |||
624 | /* flags */ | ||
625 | flags = g3d_stream_read_int16_be(gd->stream); | ||
626 | ld->nb -= 2; | ||
627 | |||
628 | /* vertex coordinate */ | ||
629 | for(i = 0; i < 3; i ++) { | ||
630 | gd->vertex_palette->vertex_data[index * 3 + i] = | ||
631 | g3d_stream_read_double_be(gd->stream); | ||
632 | ld->nb -= 8; | ||
633 | } | ||
634 | |||
635 | /* vertex texture coordinate */ | ||
636 | for(i = 0; i < 2; i ++) { | ||
637 | gd->vertex_palette->tex_vertex_data[index * 2 + i] = | ||
638 | g3d_stream_read_float_be(gd->stream); | ||
639 | ld->nb -= 4; | ||
640 | } | ||
641 | |||
642 | flt_handle_vertex_color(gd, ld, flags); | ||
643 | |||
644 | return TRUE; | ||
645 | } | ||
646 | |||
647 | static gint32 flt_vertex_palette_index_from_offset(FltGlobalData *gd, | ||
648 | goffset offset) | ||
649 | { | ||
650 | FltVertexPalette *pal = gd->vertex_palette; | ||
651 | gint i; | ||
652 | |||
653 | g_return_val_if_fail(pal != NULL, -1); | ||
654 | |||
655 | for(i = 0; (i < pal->n_entries) && (pal->offsets[i] < offset); i ++); | ||
656 | if((i < pal->n_entries) && (pal->offsets[i] == offset)) | ||
657 | return i; | ||
658 | g_warning("FLT: flt_vertex_palette_index_from_offset: " | ||
659 | "could not get index for offset %li (i=%d)", (long int)offset, i); | ||
660 | return -1; | ||
661 | } | ||
662 | |||
663 | /* vertex list */ | ||
664 | gboolean flt_cb_0072(FltGlobalData *gd, FltLocalData *ld) | ||
665 | { | ||
666 | G3DFace *face = ld->level_object; | ||
667 | gint32 i, j, index; | ||
668 | guint32 n; | ||
669 | |||
670 | g_return_val_if_fail(face != NULL, FALSE); | ||
671 | |||
672 | n = ld->nb / 4; | ||
673 | face->vertex_count = n; | ||
674 | face->vertex_indices = g_new0(guint32, n); | ||
675 | |||
676 | for(i = 0; i < n; i ++) { | ||
677 | j = g3d_stream_read_int32_be(gd->stream); | ||
678 | ld->nb -= 4; | ||
679 | |||
680 | #define FLT_SUPPORT_BROKEN_VERTEX_LIST 1 | ||
681 | #if FLT_SUPPORT_BROKEN_VERTEX_LIST | ||
682 | /* FIXME: there are some broken models which directly specify the | ||
683 | * index instead of a byte offset in the vertex palette */ | ||
684 | |||
685 | if(gd->flags & FLT_FLAG_BROKEN_VERTEX_LIST) | ||
686 | index = j; | ||
687 | else | ||
688 | index = flt_vertex_palette_index_from_offset(gd, j); | ||
689 | if(index == -1) { | ||
690 | index = j; | ||
691 | gd->flags |= FLT_FLAG_BROKEN_VERTEX_LIST; | ||
692 | } | ||
693 | #else | ||
694 | index = flt_vertex_palette_index_from_offset(gd, j); | ||
695 | #endif | ||
696 | if(index == -1) | ||
697 | return FALSE; | ||
698 | face->vertex_indices[i] = index; | ||
699 | if(gd->vertex_palette->flags[index] & G3D_FLAG_FAC_NORMALS) { | ||
700 | /* copy normal data */ | ||
701 | if(face->normals == NULL) { | ||
702 | face->normals = g_new0(G3DFloat, n * 3); | ||
703 | face->flags |= G3D_FLAG_FAC_NORMALS; | ||
704 | } | ||
705 | for(j = 0; j < 3; j ++) | ||
706 | face->normals[i * 3 + j] = | ||
707 | gd->vertex_palette->normal_data[index * 3 + j]; | ||
708 | } | ||
709 | if(gd->vertex_palette->flags[index] & G3D_FLAG_FAC_TEXMAP) { | ||
710 | /* copy texture coordinate data */ | ||
711 | if(face->tex_vertex_data == NULL) { | ||
712 | face->tex_vertex_data = g_new0(G3DFloat, n * 2); | ||
713 | face->tex_vertex_count = n; | ||
714 | if(face->tex_image) | ||
715 | face->flags |= G3D_FLAG_FAC_TEXMAP; | ||
716 | } | ||
717 | for(j = 0; j < 2; j ++) | ||
718 | face->tex_vertex_data[i * 2 + j] = | ||
719 | gd->vertex_palette->tex_vertex_data[index * 2 + j]; | ||
720 | } | ||
721 | if(gd->vertex_palette->vertex_materials[index] != NULL) | ||
722 | face->material = gd->vertex_palette->vertex_materials[index]; | ||
723 | } | ||
724 | return TRUE; | ||
725 | } | ||
726 | |||
727 | /* mesh */ | ||
728 | gboolean flt_cb_0084(FltGlobalData *gd, FltLocalData *ld) | ||
729 | { | ||
730 | G3DObject *object; | ||
731 | gchar *namebuf[8]; | ||
732 | gint32 index; | ||
733 | |||
734 | object = (G3DObject *)g_queue_peek_head(gd->oqueue); | ||
735 | g_return_val_if_fail(object != NULL, FALSE); | ||
736 | |||
737 | /* ASCII ID */ | ||
738 | g3d_stream_read(gd->stream, namebuf, 8); | ||
739 | namebuf[7] = '\0'; | ||
740 | ld->nb -= 8; | ||
741 | |||
742 | /* reserved */ | ||
743 | g3d_stream_read_int32_be(gd->stream); | ||
744 | ld->nb -= 4; | ||
745 | /* IR color code */ | ||
746 | g3d_stream_read_int32_be(gd->stream); | ||
747 | ld->nb -= 4; | ||
748 | /* priority */ | ||
749 | g3d_stream_read_int16_be(gd->stream); | ||
750 | ld->nb -= 2; | ||
751 | /* draw type */ | ||
752 | g3d_stream_read_int8(gd->stream); | ||
753 | ld->nb --; | ||
754 | /* texture white */ | ||
755 | g3d_stream_read_int8(gd->stream); | ||
756 | ld->nb --; | ||
757 | /* color name index */ | ||
758 | g3d_stream_read_int16_be(gd->stream); | ||
759 | ld->nb -= 2; | ||
760 | /* alternate color name index */ | ||
761 | g3d_stream_read_int16_be(gd->stream); | ||
762 | ld->nb -= 2; | ||
763 | /* reserved */ | ||
764 | g3d_stream_read_int8(gd->stream); | ||
765 | ld->nb --; | ||
766 | /* template (billboard) */ | ||
767 | g3d_stream_read_int8(gd->stream); | ||
768 | ld->nb --; | ||
769 | /* detail texture pattern */ | ||
770 | index = g3d_stream_read_int16_be(gd->stream); | ||
771 | ld->nb -= 2; | ||
772 | if(index > -1) | ||
773 | if(gd->texture_palette && (index < gd->texture_palette->size)) | ||
774 | object->tex_image = gd->texture_palette->textures[index]; | ||
775 | /* texture pattern */ | ||
776 | index = g3d_stream_read_int16_be(gd->stream); | ||
777 | ld->nb -= 2; | ||
778 | if((index > -1) && (object->tex_image == NULL)) | ||
779 | if(gd->texture_palette && (index < gd->texture_palette->size)) | ||
780 | object->tex_image = gd->texture_palette->textures[index]; | ||
781 | |||
782 | return TRUE; | ||
783 | } | ||
784 | |||
785 | /* local vertex pool */ | ||
786 | gboolean flt_cb_0085(FltGlobalData *gd, FltLocalData *ld) | ||
787 | { | ||
788 | G3DObject *object; | ||
789 | guint32 nverts, attrmask; | ||
790 | gint32 i; | ||
791 | |||
792 | object = (G3DObject *)g_queue_peek_head(gd->oqueue); | ||
793 | g_return_val_if_fail(object != NULL, FALSE); | ||
794 | |||
795 | nverts = g3d_stream_read_int32_be(gd->stream); | ||
796 | attrmask = g3d_stream_read_int32_be(gd->stream); | ||
797 | ld->nb -= 8; | ||
798 | |||
799 | object->vertex_count = nverts; | ||
800 | object->vertex_data = g_new0(G3DFloat, nverts * 3); | ||
801 | object->tex_vertex_count = nverts; | ||
802 | object->tex_vertex_data = g_new0(G3DFloat, nverts * 2); | ||
803 | |||
804 | for(i = 0; i < nverts; i ++) { | ||
805 | if(attrmask & (1 << 31)) { /* has position */ | ||
806 | object->vertex_data[i * 3 + 0] = | ||
807 | g3d_stream_read_double_be(gd->stream); | ||
808 | object->vertex_data[i * 3 + 1] = | ||
809 | g3d_stream_read_double_be(gd->stream); | ||
810 | object->vertex_data[i * 3 + 2] = | ||
811 | g3d_stream_read_double_be(gd->stream); | ||
812 | ld->nb -= 24; | ||
813 | } | ||
814 | |||
815 | if(attrmask & (1 << 30)) { /* has color index */ | ||
816 | g3d_stream_read_int32_be(gd->stream); | ||
817 | ld->nb -= 4; | ||
818 | } | ||
819 | |||
820 | if(attrmask & (1 << 29)) { /* has RGBA color */ | ||
821 | g3d_stream_read_int32_be(gd->stream); | ||
822 | ld->nb -= 4; | ||
823 | } | ||
824 | |||
825 | if(attrmask & (1 << 28)) { /* has normal */ | ||
826 | g3d_stream_read_float_be(gd->stream); | ||
827 | g3d_stream_read_float_be(gd->stream); | ||
828 | g3d_stream_read_float_be(gd->stream); | ||
829 | ld->nb -= 12; | ||
830 | } | ||
831 | |||
832 | if(attrmask & (1 << 27)) { /* has base UV */ | ||
833 | object->tex_vertex_data[i * 2 + 0] = | ||
834 | g3d_stream_read_float_be(gd->stream); | ||
835 | object->tex_vertex_data[i * 2 + 1] = | ||
836 | g3d_stream_read_float_be(gd->stream); | ||
837 | ld->nb -= 8; | ||
838 | } | ||
839 | |||
840 | if(attrmask & (1 << 26)) { /* has UV layer 1 */ | ||
841 | g3d_stream_read_float_be(gd->stream); | ||
842 | g3d_stream_read_float_be(gd->stream); | ||
843 | ld->nb -= 8; | ||
844 | } | ||
845 | |||
846 | if(attrmask & (1 << 25)) { /* has UV layer 2 */ | ||
847 | g3d_stream_read_float_be(gd->stream); | ||
848 | g3d_stream_read_float_be(gd->stream); | ||
849 | ld->nb -= 8; | ||
850 | } | ||
851 | |||
852 | if(attrmask & (1 << 24)) { /* has UV layer 3 */ | ||
853 | g3d_stream_read_float_be(gd->stream); | ||
854 | g3d_stream_read_float_be(gd->stream); | ||
855 | ld->nb -= 8; | ||
856 | } | ||
857 | |||
858 | if(attrmask & (1 << 23)) { /* has UV layer 4 */ | ||
859 | g3d_stream_read_float_be(gd->stream); | ||
860 | g3d_stream_read_float_be(gd->stream); | ||
861 | ld->nb -= 8; | ||
862 | } | ||
863 | |||
864 | if(attrmask & (1 << 22)) { /* has UV layer 5 */ | ||
865 | g3d_stream_read_float_be(gd->stream); | ||
866 | g3d_stream_read_float_be(gd->stream); | ||
867 | ld->nb -= 8; | ||
868 | } | ||
869 | |||
870 | if(attrmask & (1 << 21)) { /* has UV layer 6 */ | ||
871 | g3d_stream_read_float_be(gd->stream); | ||
872 | g3d_stream_read_float_be(gd->stream); | ||
873 | ld->nb -= 8; | ||
874 | } | ||
875 | |||
876 | if(attrmask & (1 << 20)) { /* has UV layer 7 */ | ||
877 | g3d_stream_read_float_be(gd->stream); | ||
878 | g3d_stream_read_float_be(gd->stream); | ||
879 | ld->nb -= 8; | ||
880 | } | ||
881 | } | ||
882 | |||
883 | return TRUE; | ||
884 | } | ||
885 | |||
886 | /* mesh primitive */ | ||
887 | gboolean flt_cb_0086(FltGlobalData *gd, FltLocalData *ld) | ||
888 | { | ||
889 | guint32 type, isize, nverts; | ||
890 | gint32 i; | ||
891 | G3DFace *face; | ||
892 | G3DObject *object; | ||
893 | |||
894 | object = (G3DObject *)g_queue_peek_head(gd->oqueue); | ||
895 | g_return_val_if_fail(object != NULL, FALSE); | ||
896 | |||
897 | type = g3d_stream_read_int16_be(gd->stream); | ||
898 | isize = g3d_stream_read_int16_be(gd->stream); | ||
899 | nverts = g3d_stream_read_int32_be(gd->stream); | ||
900 | ld->nb -= 8; | ||
901 | |||
902 | switch(type) { | ||
903 | case 1: /* triangle strip */ | ||
904 | g_debug("0086: triangle strip"); | ||
905 | break; | ||
906 | |||
907 | case 2: /* triangle fan */ | ||
908 | g_debug("0086: triangle fan"); | ||
909 | break; | ||
910 | |||
911 | case 3: /* quadriteral strip */ | ||
912 | g_debug("0086: quadriteral strip"); | ||
913 | break; | ||
914 | |||
915 | case 4: /* indexed polygon */ | ||
916 | face = g_new0(G3DFace, 1); | ||
917 | face->material = (G3DMaterial *)g_slist_nth_data(object->materials, | ||
918 | 0); | ||
919 | face->vertex_count = nverts; | ||
920 | face->vertex_indices = g_new0(guint32, nverts); | ||
921 | for(i = 0; i < nverts; i ++) { | ||
922 | face->vertex_indices[i] = flt_read_typed_index( | ||
923 | gd->stream, isize, &(ld->nb)); | ||
924 | } | ||
925 | face->tex_image = object->tex_image; | ||
926 | if(face->tex_image != NULL) { | ||
927 | face->tex_vertex_count = nverts; | ||
928 | face->tex_vertex_data = g_new0(G3DFloat, nverts * 2); | ||
929 | for(i = 0; i < nverts; i ++) { | ||
930 | face->tex_vertex_data[i * 2 + 0] = | ||
931 | object->tex_vertex_data[ | ||
932 | face->vertex_indices[i] * 2 + 0]; | ||
933 | face->tex_vertex_data[i * 2 + 1] = | ||
934 | object->tex_vertex_data[ | ||
935 | face->vertex_indices[i] * 2 + 1]; | ||
936 | } | ||
937 | face->flags |= G3D_FLAG_FAC_TEXMAP; | ||
938 | } | ||
939 | object->faces = g_slist_append(object->faces, face); | ||
940 | break; | ||
941 | |||
942 | default: | ||
943 | g_warning("FLT: mesh primitive: unknown type %d\n", type); | ||
944 | } | ||
945 | |||
946 | return TRUE; | ||
947 | } | ||
948 | |||
949 | /* material palette */ | ||
950 | gboolean flt_cb_0113(FltGlobalData *gd, FltLocalData *ld) | ||
951 | { | ||
952 | G3DMaterial *material; | ||
953 | gchar name[13]; | ||
954 | |||
955 | material = g3d_material_new(); | ||
956 | |||
957 | /* material index */ | ||
958 | g3d_stream_read_int32_be(gd->stream); | ||
959 | ld->nb -= 4; | ||
960 | /* material name */ | ||
961 | g3d_stream_read(gd->stream, name, 12); | ||
962 | ld->nb -= 12; | ||
963 | name[12] = '\0'; | ||
964 | material->name = g_strdup(name); | ||
965 | /* flags */ | ||
966 | g3d_stream_read_int32_be(gd->stream); | ||
967 | ld->nb -= 4; | ||
968 | /* ambient */ | ||
969 | g3d_stream_read_float_be(gd->stream); | ||
970 | g3d_stream_read_float_be(gd->stream); | ||
971 | g3d_stream_read_float_be(gd->stream); | ||
972 | ld->nb -= 12; | ||
973 | /* diffuse */ | ||
974 | material->r = g3d_stream_read_float_be(gd->stream); | ||
975 | material->g = g3d_stream_read_float_be(gd->stream); | ||
976 | material->b = g3d_stream_read_float_be(gd->stream); | ||
977 | ld->nb -= 12; | ||
978 | /* specular */ | ||
979 | material->specular[0] = g3d_stream_read_float_be(gd->stream); | ||
980 | material->specular[1] = g3d_stream_read_float_be(gd->stream); | ||
981 | material->specular[2] = g3d_stream_read_float_be(gd->stream); | ||
982 | ld->nb -= 12; | ||
983 | /* emissive */ | ||
984 | g3d_stream_read_float_be(gd->stream); | ||
985 | g3d_stream_read_float_be(gd->stream); | ||
986 | g3d_stream_read_float_be(gd->stream); | ||
987 | ld->nb -= 12; | ||
988 | /* shininess */ | ||
989 | material->shininess = g3d_stream_read_float_be(gd->stream); | ||
990 | ld->nb -= 4; | ||
991 | /* alpha */ | ||
992 | material->a = g3d_stream_read_float_be(gd->stream); | ||
993 | ld->nb -= 4; | ||
994 | |||
995 | gd->model->materials = g_slist_append(gd->model->materials, material); | ||
996 | |||
997 | return TRUE; | ||
998 | } | ||
999 | |||
diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_flt/imp_flt_callbacks.h b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_flt/imp_flt_callbacks.h new file mode 100644 index 0000000..cc26120 --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_flt/imp_flt_callbacks.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 | #ifndef _IMP_FLT_CALLBACKS_H | ||
23 | #define _IMP_FLT_CALLBACKS_H | ||
24 | |||
25 | #include <stdio.h> | ||
26 | #include <glib.h> | ||
27 | #include <g3d/types.h> | ||
28 | #include <g3d/stream.h> | ||
29 | |||
30 | typedef struct { | ||
31 | guint32 n_entries; | ||
32 | goffset offset; | ||
33 | |||
34 | goffset *offsets; /* n * goffset */ | ||
35 | guint32 *flags; /* n * guint32 */ | ||
36 | G3DMaterial **vertex_materials; /* n * G3DMaterial* */ | ||
37 | G3DFloat *vertex_data; /* 3 x n * G3DFloat */ | ||
38 | G3DFloat *normal_data; /* 3 x n * G3DFloat */ | ||
39 | G3DFloat *tex_vertex_data; /* 2 x n * G3DFloat */ | ||
40 | } FltVertexPalette; | ||
41 | |||
42 | typedef struct { | ||
43 | guint32 size; | ||
44 | G3DImage **textures; | ||
45 | gint32 *offsets; | ||
46 | } FltTexturePalette; | ||
47 | |||
48 | #define FLT_FLAG_BROKEN_VERTEX_LIST (1 << 0) | ||
49 | |||
50 | #define FLT_FLAG_NO_COLOR (1 << 2) | ||
51 | #define FLT_FLAG_PACKED_COLOR (1 << 3) | ||
52 | |||
53 | typedef struct { | ||
54 | G3DContext *context; | ||
55 | G3DModel *model; | ||
56 | G3DStream *stream; | ||
57 | guint32 level; | ||
58 | GQueue *oqueue; | ||
59 | FltVertexPalette *vertex_palette; | ||
60 | FltTexturePalette *texture_palette; | ||
61 | guint32 fversion; /* format version */ | ||
62 | guint32 flags; | ||
63 | } FltGlobalData; | ||
64 | |||
65 | typedef struct { | ||
66 | guint32 opcode; | ||
67 | G3DObject *g3dobj; | ||
68 | gpointer level_object; | ||
69 | gint32 nb; | ||
70 | } FltLocalData; | ||
71 | |||
72 | typedef gboolean (*FltCallbackFunc)(FltGlobalData *gd, FltLocalData *ld); | ||
73 | |||
74 | /* callback functions */ | ||
75 | gboolean flt_cb_0001(FltGlobalData *gd, FltLocalData *ld); | ||
76 | gboolean flt_cb_0002(FltGlobalData *gd, FltLocalData *ld); | ||
77 | gboolean flt_cb_0004(FltGlobalData *gd, FltLocalData *ld); | ||
78 | gboolean flt_cb_0005(FltGlobalData *gd, FltLocalData *ld); | ||
79 | gboolean flt_cb_0010(FltGlobalData *gd, FltLocalData *ld); | ||
80 | gboolean flt_cb_0011(FltGlobalData *gd, FltLocalData *ld); | ||
81 | gboolean flt_cb_0032(FltGlobalData *gd, FltLocalData *ld); | ||
82 | gboolean flt_cb_0033(FltGlobalData *gd, FltLocalData *ld); | ||
83 | gboolean flt_cb_0064(FltGlobalData *gd, FltLocalData *ld); | ||
84 | gboolean flt_cb_0067(FltGlobalData *gd, FltLocalData *ld); | ||
85 | gboolean flt_cb_0068(FltGlobalData *gd, FltLocalData *ld); | ||
86 | gboolean flt_cb_0069(FltGlobalData *gd, FltLocalData *ld); | ||
87 | gboolean flt_cb_0070(FltGlobalData *gd, FltLocalData *ld); | ||
88 | gboolean flt_cb_0071(FltGlobalData *gd, FltLocalData *ld); | ||
89 | gboolean flt_cb_0072(FltGlobalData *gd, FltLocalData *ld); | ||
90 | gboolean flt_cb_0084(FltGlobalData *gd, FltLocalData *ld); | ||
91 | gboolean flt_cb_0085(FltGlobalData *gd, FltLocalData *ld); | ||
92 | gboolean flt_cb_0086(FltGlobalData *gd, FltLocalData *ld); | ||
93 | gboolean flt_cb_0113(FltGlobalData *gd, FltLocalData *ld); | ||
94 | |||
95 | #endif /* _IMP_FLT_CALLBACKS_H */ | ||
diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_flt/imp_flt_opcodes.h b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_flt/imp_flt_opcodes.h new file mode 100644 index 0000000..8cb02b0 --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_flt/imp_flt_opcodes.h | |||
@@ -0,0 +1,136 @@ | |||
1 | /* $Id$ */ | ||
2 | |||
3 | /* | ||
4 | libg3d - 3D object loading library | ||
5 | |||
6 | Copyright (C) 2005-2009 Markus Dahms <mad@automagically.de> | ||
7 | |||
8 | This library is free software; you can redistribute it and/or | ||
9 | modify it under the terms of the GNU Lesser General Public | ||
10 | License as published by the Free Software Foundation; either | ||
11 | version 2.1 of the License, or (at your option) any later version. | ||
12 | |||
13 | This library is distributed in the hope that it will be useful, | ||
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
16 | Lesser General Public License for more details. | ||
17 | |||
18 | You should have received a copy of the GNU Lesser General Public | ||
19 | License along with this library; if not, write to the Free Software | ||
20 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
21 | */ | ||
22 | #ifndef _IMP_FLT_OPCODES_H | ||
23 | #define _IMP_FLT_OPCODES_H | ||
24 | |||
25 | #include <glib.h> | ||
26 | |||
27 | #include "imp_flt_callbacks.h" | ||
28 | |||
29 | typedef struct { | ||
30 | guint32 opcode; | ||
31 | gchar *description; | ||
32 | gboolean container; | ||
33 | FltCallbackFunc callback; | ||
34 | } FltOpcode; | ||
35 | |||
36 | static FltOpcode flt_opcodes[] = { | ||
37 | { 1, "header", 0, flt_cb_0001 }, | ||
38 | { 2, "group", 0, flt_cb_0002 }, | ||
39 | |||
40 | { 4, "object", 0, flt_cb_0004 }, | ||
41 | { 5, "face", 0, flt_cb_0005 }, | ||
42 | |||
43 | { 10, "push level", 0, flt_cb_0010 }, | ||
44 | { 11, "pop level", 0, flt_cb_0011 }, | ||
45 | |||
46 | { 14, "degree of freedom", 0, NULL }, | ||
47 | |||
48 | { 19, "push subface", 0, NULL }, | ||
49 | { 20, "pop subface", 0, NULL }, | ||
50 | { 21, "push extension", 0, NULL }, | ||
51 | { 22, "pop extension", 0, NULL }, | ||
52 | { 23, "continuation", 0, NULL }, | ||
53 | |||
54 | { 31, "comment", 0, NULL }, | ||
55 | { 32, "color palette", 0, flt_cb_0032 }, | ||
56 | { 33, "long ID", 0, flt_cb_0033 }, | ||
57 | |||
58 | { 49, "matrix", 0, NULL }, | ||
59 | { 50, "vector", 0, NULL }, | ||
60 | |||
61 | { 52, "multitexture", 0, NULL }, | ||
62 | { 53, "UV list", 0, NULL }, | ||
63 | |||
64 | { 55, "binary separating plane", 0, NULL }, | ||
65 | |||
66 | { 60, "replicate", 0, NULL }, | ||
67 | { 61, "instance reference", 0, NULL }, | ||
68 | { 62, "instance definition", 0, NULL }, | ||
69 | { 63, "external reference", 0, NULL }, | ||
70 | { 64, "texture palette", 0, flt_cb_0064 }, | ||
71 | |||
72 | { 67, "vertex palette", 0, flt_cb_0067 }, | ||
73 | { 68, "vertex with color", 0, flt_cb_0068 }, | ||
74 | { 69, "vertex with color and normal", 0, flt_cb_0069 }, | ||
75 | { 70, "vertex with color, normal and UV", 0, flt_cb_0070 }, | ||
76 | { 71, "vertex with color and UV", 0, flt_cb_0071 }, | ||
77 | { 72, "vertex list", 0, flt_cb_0072 }, | ||
78 | { 73, "level of detail", 0, NULL }, | ||
79 | { 74, "bounding box", 0, NULL }, | ||
80 | |||
81 | { 76, "rotate about edge", 0, NULL }, | ||
82 | |||
83 | { 78, "translate", 0, NULL }, | ||
84 | { 79, "scale", 0, NULL }, | ||
85 | { 80, "rotate about point", 0, NULL }, | ||
86 | { 81, "rotate and/or scale to point", 0, NULL }, | ||
87 | { 82, "put", 0, NULL }, | ||
88 | { 83, "eyepoint and trackplane palette", 0, NULL }, | ||
89 | { 84, "mesh", 0, flt_cb_0084 }, | ||
90 | { 85, "local vertex pool", 0, flt_cb_0085 }, | ||
91 | { 86, "mesh primitive", 0, flt_cb_0086 }, | ||
92 | { 87, "road segment", 0, NULL }, | ||
93 | { 88, "road zone", 0, NULL }, | ||
94 | { 89, "morph vertex list", 0, NULL }, | ||
95 | { 90, "linkage palette", 0, NULL }, | ||
96 | { 91, "sound node", 0, NULL }, | ||
97 | { 92, "road path", 0, NULL }, | ||
98 | { 93, "sound palette", 0, NULL }, | ||
99 | { 94, "general matrix", 0, NULL }, | ||
100 | { 95, "text", 0, NULL }, | ||
101 | { 96, "switch", 0, NULL }, | ||
102 | { 97, "line style palette", 0, NULL }, | ||
103 | { 98, "clip region", 0, NULL }, | ||
104 | |||
105 | { 100, "extension", 0, NULL }, | ||
106 | { 101, "light source", 0, NULL }, | ||
107 | { 102, "light source palette", 0, NULL }, | ||
108 | |||
109 | { 105, "bounding sphere", 0, NULL }, | ||
110 | { 106, "bounding cylinder", 0, NULL }, | ||
111 | { 107, "bounding convex hull", 0, NULL }, | ||
112 | { 108, "bounding volume center", 0, NULL }, | ||
113 | { 109, "bounding volume orientation", 0, NULL }, | ||
114 | |||
115 | { 111, "light point", 0, NULL }, | ||
116 | { 112, "texture mapping palette", 0, NULL }, | ||
117 | { 113, "material palette", 0, flt_cb_0113 }, | ||
118 | { 114, "name table", 0, NULL }, | ||
119 | { 115, "continuously adaptive terrain (CAT)", 0, NULL }, | ||
120 | { 116, "CAT data", 0, NULL }, | ||
121 | |||
122 | { 119, "bounding histogram", 0, NULL }, | ||
123 | |||
124 | { 126, "curve", 0, NULL }, | ||
125 | { 127, "road construction", 0, NULL }, | ||
126 | { 128, "light point appearance palette", 0, NULL }, | ||
127 | { 129, "light point animation", 0, NULL }, | ||
128 | { 130, "indexed light point", 0, NULL }, | ||
129 | |||
130 | { 132, "indexed string", 0, NULL }, | ||
131 | { 133, "shader", 0, NULL }, | ||
132 | |||
133 | { 0, NULL, 0, NULL } | ||
134 | }; | ||
135 | |||
136 | #endif /* _IMP_FLT_OPCODES_H */ | ||