From cb3716ffb584fe0f593b6f1669a8efdba1305104 Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Tue, 29 Mar 2016 02:16:55 +1000 Subject: Added my version of libg3d and friends. --- .../libg3d-0.0.8/plugins/import/imp_blend/Makefile | 519 +++++++++++++++++++++ .../plugins/import/imp_blend/Makefile.am | 26 ++ .../plugins/import/imp_blend/Makefile.in | 519 +++++++++++++++++++++ .../plugins/import/imp_blend/imp_blend.c | 201 ++++++++ .../plugins/import/imp_blend/imp_blend_callbacks.c | 237 ++++++++++ .../plugins/import/imp_blend/imp_blend_callbacks.h | 35 ++ .../plugins/import/imp_blend/imp_blend_chunks.h | 63 +++ .../plugins/import/imp_blend/imp_blend_def.h | 42 ++ .../plugins/import/imp_blend/imp_blend_read.c | 39 ++ .../plugins/import/imp_blend/imp_blend_read.h | 30 ++ .../plugins/import/imp_blend/imp_blend_sdna.c | 467 ++++++++++++++++++ .../plugins/import/imp_blend/imp_blend_sdna.h | 53 +++ .../plugins/import/imp_blend/imp_blend_types.h | 100 ++++ 13 files changed, 2331 insertions(+) create mode 100644 src/others/mimesh/libg3d-0.0.8/plugins/import/imp_blend/Makefile create mode 100644 src/others/mimesh/libg3d-0.0.8/plugins/import/imp_blend/Makefile.am create mode 100644 src/others/mimesh/libg3d-0.0.8/plugins/import/imp_blend/Makefile.in create mode 100644 src/others/mimesh/libg3d-0.0.8/plugins/import/imp_blend/imp_blend.c create mode 100644 src/others/mimesh/libg3d-0.0.8/plugins/import/imp_blend/imp_blend_callbacks.c create mode 100644 src/others/mimesh/libg3d-0.0.8/plugins/import/imp_blend/imp_blend_callbacks.h create mode 100644 src/others/mimesh/libg3d-0.0.8/plugins/import/imp_blend/imp_blend_chunks.h create mode 100644 src/others/mimesh/libg3d-0.0.8/plugins/import/imp_blend/imp_blend_def.h create mode 100644 src/others/mimesh/libg3d-0.0.8/plugins/import/imp_blend/imp_blend_read.c create mode 100644 src/others/mimesh/libg3d-0.0.8/plugins/import/imp_blend/imp_blend_read.h create mode 100644 src/others/mimesh/libg3d-0.0.8/plugins/import/imp_blend/imp_blend_sdna.c create mode 100644 src/others/mimesh/libg3d-0.0.8/plugins/import/imp_blend/imp_blend_sdna.h create mode 100644 src/others/mimesh/libg3d-0.0.8/plugins/import/imp_blend/imp_blend_types.h (limited to 'src/others/mimesh/libg3d-0.0.8/plugins/import/imp_blend') diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_blend/Makefile b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_blend/Makefile new file mode 100644 index 0000000..a07f936 --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_blend/Makefile @@ -0,0 +1,519 @@ +# Makefile.in generated by automake 1.10.1 from Makefile.am. +# plugins/import/imp_blend/Makefile. Generated from Makefile.in by configure. + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + + + +pkgdatadir = $(datadir)/libg3d +pkglibdir = $(libdir)/libg3d +pkgincludedir = $(includedir)/libg3d +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = x86_64-unknown-linux-gnu +host_triplet = x86_64-unknown-linux-gnu +subdir = plugins/import/imp_blend +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ + $(top_srcdir)/m4/glib-2.0.m4 $(top_srcdir)/m4/gtk-2.0.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/libxml2.m4 $(top_srcdir)/m4/win32.m4 \ + $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/include/g3d/config.h +CONFIG_CLEAN_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(pluginimpdir)" +pluginimpLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(pluginimp_LTLIBRARIES) +imp_blend_la_DEPENDENCIES = $(top_builddir)/src/libg3d.la +am_imp_blend_la_OBJECTS = imp_blend.lo imp_blend_sdna.lo \ + imp_blend_read.lo imp_blend_callbacks.lo +imp_blend_la_OBJECTS = $(am_imp_blend_la_OBJECTS) +#am_imp_blend_la_rpath = -rpath $(pluginimpdir) +DEFAULT_INCLUDES = -I. -I$(top_builddir)/include/g3d +depcomp = $(SHELL) $(top_srcdir)/config/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(imp_blend_la_SOURCES) +DIST_SOURCES = $(imp_blend_la_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = ${SHELL} /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/config/missing --run aclocal-1.10 +AMTAR = ${SHELL} /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/config/missing --run tar +AR = ar +AS = as +AUTOCONF = ${SHELL} /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/config/missing --run autoconf +AUTOHEADER = ${SHELL} /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/config/missing --run autoheader +AUTOMAKE = ${SHELL} /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/config/missing --run automake-1.10 +AWK = gawk +CC = gcc +CCDEPMODE = depmode=gcc3 +CFLAGS = -g -O2 +CPP = gcc -E +CPPFLAGS = +CXX = g++ +CXXCPP = g++ -E +CXXDEPMODE = depmode=gcc3 +CXXFLAGS = -g -O2 +CYGPATH_W = echo +DBG_CFLAGS = -O2 +DEBUG = 0 +DEFS = -DHAVE_CONFIG_H +DEPDIR = .deps +DLLTOOL = dlltool +ECHO = echo +ECHO_C = +ECHO_N = -n +ECHO_T = +EGREP = /bin/grep -E +EXEEXT = +F77 = +FFLAGS = +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 +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 +GLIB_CFLAGS = -pthread -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include +GLIB_GENMARSHAL = glib-genmarshal +GLIB_LIBS = -Wl,--export-dynamic -pthread -lgmodule-2.0 -lrt -lgobject-2.0 -lglib-2.0 +GLIB_MKENUMS = glib-mkenums +GOBJECT_QUERY = gobject-query +GREP = /bin/grep +GTKDOC_CHECK = /usr/bin/gtkdoc-check +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 +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 +HTML_DIR = ${datadir}/gtk-doc/html +INSTALL = /usr/bin/install -c +INSTALL_DATA = ${INSTALL} -m 644 +INSTALL_PROGRAM = ${INSTALL} +INSTALL_SCRIPT = ${INSTALL} +INSTALL_STRIP_PROGRAM = $(install_sh) -c -s +LDFLAGS = +LEX = flex +LEXLIB = -lfl +LEX_OUTPUT_ROOT = lex.yy +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 +LIBGSF_LIBS = -lgsf-1 -lgobject-2.0 -lxml2 -lglib-2.0 +LIBOBJS = +LIBS = -lm +LIBTOOL = $(SHELL) $(top_builddir)/libtool --quiet +LIBXML2_CFLAGS = -I/usr/include/libxml2 +LIBXML2_LIBS = -L/usr/lib/x86_64-linux-gnu -lxml2 +LN_S = ln -s +LTLIBOBJS = +LTVERSION = 0:8:0 +MAGIC_LIBS = -lmagic +MAKEINFO = ${SHELL} /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/config/missing --run makeinfo +MATH_LIBS = -lm +MKDIR_P = /bin/mkdir -p +OBJDUMP = objdump +OBJEXT = o +PACKAGE = libg3d +PACKAGE_BUGREPORT = +PACKAGE_NAME = +PACKAGE_STRING = +PACKAGE_TARNAME = +PACKAGE_VERSION = +PATH_SEPARATOR = : +PKG_CONFIG = /usr/bin/pkg-config +PLUGINS_LDFLAGS = -avoid-version -export-dynamic +RANLIB = ranlib +SET_MAKE = +SHELL = /bin/bash +STRIP = strip +VERSION = 0.0.8 +XML2_CONFIG = /usr/bin/xml2-config +XML_CPPFLAGS = -I/usr/include/libxml2 +XML_LIBS = -L/usr/lib/x86_64-linux-gnu -lxml2 +Z_CFLAGS = +Z_LIBS = -lz +abs_builddir = /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_blend +abs_srcdir = /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_blend +abs_top_builddir = /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8 +abs_top_srcdir = /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8 +ac_ct_CC = gcc +ac_ct_CXX = g++ +ac_ct_F77 = +am__include = include +am__leading_dot = . +am__quote = +am__tar = ${AMTAR} chof - "$$tardir" +am__untar = ${AMTAR} xf - +bindir = ${exec_prefix}/bin +build = x86_64-unknown-linux-gnu +build_alias = +build_cpu = x86_64 +build_os = linux-gnu +build_vendor = unknown +builddir = . +datadir = ${datarootdir} +datarootdir = ${prefix}/share +docdir = ${datarootdir}/doc/${PACKAGE} +dvidir = ${docdir} +exec_prefix = ${prefix} +host = x86_64-unknown-linux-gnu +host_alias = +host_cpu = x86_64 +host_os = linux-gnu +host_vendor = unknown +htmldir = ${docdir} +includedir = ${prefix}/include +infodir = ${datarootdir}/info +install_sh = $(SHELL) /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/config/install-sh +libdir = ${exec_prefix}/lib +libexecdir = ${exec_prefix}/libexec +localedir = ${datarootdir}/locale +localstatedir = ${prefix}/var +mandir = ${datarootdir}/man +mkdir_p = /bin/mkdir -p +oldincludedir = /usr/include +pdfdir = ${docdir} +prefix = /usr/local +program_transform_name = s,x,x, +psdir = ${docdir} +sbindir = ${exec_prefix}/sbin +sharedstatedir = ${prefix}/com +srcdir = . +sysconfdir = ${prefix}/etc +target_alias = +top_builddir = ../../.. +top_srcdir = ../../.. +pluginimpdir = $(pkglibdir)/plugins/import +#pluginimp_LTLIBRARIES = imp_blend.la +AM_CFLAGS = \ + -Wall -ansi -pedantic \ + -DG_LOG_DOMAIN=\"LibG3D\" \ + -O2 -DDEBUG=0 \ + -pthread -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include + +INCLUDES = -I$(top_srcdir)/include +AM_LDFLAGS = \ + -no-undefined -module \ + -avoid-version -export-dynamic + +imp_blend_la_SOURCES = imp_blend.c imp_blend_def.h \ + imp_blend_types.h imp_blend_chunks.h \ + imp_blend_sdna.c imp_blend_sdna.h \ + imp_blend_read.c imp_blend_read.h \ + imp_blend_callbacks.h imp_blend_callbacks.c + +imp_blend_la_LIBADD = $(top_builddir)/src/libg3d.la -Wl,--export-dynamic -pthread -lgmodule-2.0 -lrt -lgobject-2.0 -lglib-2.0 +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/import/imp_blend/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu plugins/import/imp_blend/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-pluginimpLTLIBRARIES: $(pluginimp_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(pluginimpdir)" || $(MKDIR_P) "$(DESTDIR)$(pluginimpdir)" + @list='$(pluginimp_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(pluginimpLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(pluginimpdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(pluginimpLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(pluginimpdir)/$$f"; \ + else :; fi; \ + done + +uninstall-pluginimpLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(pluginimp_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pluginimpdir)/$$p'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pluginimpdir)/$$p"; \ + done + +clean-pluginimpLTLIBRARIES: + -test -z "$(pluginimp_LTLIBRARIES)" || rm -f $(pluginimp_LTLIBRARIES) + @list='$(pluginimp_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +imp_blend.la: $(imp_blend_la_OBJECTS) $(imp_blend_la_DEPENDENCIES) + $(LINK) $(am_imp_blend_la_rpath) $(imp_blend_la_OBJECTS) $(imp_blend_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +include ./$(DEPDIR)/imp_blend.Plo +include ./$(DEPDIR)/imp_blend_callbacks.Plo +include ./$(DEPDIR)/imp_blend_read.Plo +include ./$(DEPDIR)/imp_blend_sdna.Plo + +.c.o: + $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< + mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +# source='$<' object='$@' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(COMPILE) -c $< + +.c.obj: + $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` + mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +# source='$<' object='$@' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: + $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< + mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +# source='$<' object='$@' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: + for dir in "$(DESTDIR)$(pluginimpdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-pluginimpLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: install-pluginimpLTLIBRARIES + +install-dvi: install-dvi-am + +install-exec-am: + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-pluginimpLTLIBRARIES + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-pluginimpLTLIBRARIES ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-pluginimpLTLIBRARIES \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-pluginimpLTLIBRARIES + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_blend/Makefile.am b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_blend/Makefile.am new file mode 100644 index 0000000..7cc9cf5 --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_blend/Makefile.am @@ -0,0 +1,26 @@ +pluginimpdir = $(pkglibdir)/plugins/import + +if EXPERIMENTAL +pluginimp_LTLIBRARIES = imp_blend.la +endif + +AM_CFLAGS = \ + -Wall -ansi -pedantic \ + -DG_LOG_DOMAIN=\"LibG3D\" \ + @DBG_CFLAGS@ -DDEBUG=@DEBUG@ \ + @GLIB_CFLAGS@ + +INCLUDES = -I$(top_srcdir)/include + +AM_LDFLAGS = \ + -no-undefined -module \ + @PLUGINS_LDFLAGS@ + +LIBTOOL += --quiet + +imp_blend_la_SOURCES = imp_blend.c imp_blend_def.h \ + imp_blend_types.h imp_blend_chunks.h \ + imp_blend_sdna.c imp_blend_sdna.h \ + imp_blend_read.c imp_blend_read.h \ + imp_blend_callbacks.h imp_blend_callbacks.c +imp_blend_la_LIBADD = $(top_builddir)/src/libg3d.la @GLIB_LIBS@ diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_blend/Makefile.in b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_blend/Makefile.in new file mode 100644 index 0000000..00b28ba --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_blend/Makefile.in @@ -0,0 +1,519 @@ +# Makefile.in generated by automake 1.10.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = plugins/import/imp_blend +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ + $(top_srcdir)/m4/glib-2.0.m4 $(top_srcdir)/m4/gtk-2.0.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/libxml2.m4 $(top_srcdir)/m4/win32.m4 \ + $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/include/g3d/config.h +CONFIG_CLEAN_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(pluginimpdir)" +pluginimpLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(pluginimp_LTLIBRARIES) +imp_blend_la_DEPENDENCIES = $(top_builddir)/src/libg3d.la +am_imp_blend_la_OBJECTS = imp_blend.lo imp_blend_sdna.lo \ + imp_blend_read.lo imp_blend_callbacks.lo +imp_blend_la_OBJECTS = $(am_imp_blend_la_OBJECTS) +@EXPERIMENTAL_TRUE@am_imp_blend_la_rpath = -rpath $(pluginimpdir) +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include/g3d +depcomp = $(SHELL) $(top_srcdir)/config/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(imp_blend_la_SOURCES) +DIST_SOURCES = $(imp_blend_la_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DBG_CFLAGS = @DBG_CFLAGS@ +DEBUG = @DEBUG@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GDKPIXBUF_CFLAGS = @GDKPIXBUF_CFLAGS@ +GDKPIXBUF_LIBS = @GDKPIXBUF_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GOBJECT_QUERY = @GOBJECT_QUERY@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_LIBS = @GTK_LIBS@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LEX = @LEX@ +LEXLIB = @LEXLIB@ +LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ +LIBGSF_CFLAGS = @LIBGSF_CFLAGS@ +LIBGSF_LIBS = @LIBGSF_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ --quiet +LIBXML2_CFLAGS = @LIBXML2_CFLAGS@ +LIBXML2_LIBS = @LIBXML2_LIBS@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LTVERSION = @LTVERSION@ +MAGIC_LIBS = @MAGIC_LIBS@ +MAKEINFO = @MAKEINFO@ +MATH_LIBS = @MATH_LIBS@ +MKDIR_P = @MKDIR_P@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PLUGINS_LDFLAGS = @PLUGINS_LDFLAGS@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +XML2_CONFIG = @XML2_CONFIG@ +XML_CPPFLAGS = @XML_CPPFLAGS@ +XML_LIBS = @XML_LIBS@ +Z_CFLAGS = @Z_CFLAGS@ +Z_LIBS = @Z_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +pluginimpdir = $(pkglibdir)/plugins/import +@EXPERIMENTAL_TRUE@pluginimp_LTLIBRARIES = imp_blend.la +AM_CFLAGS = \ + -Wall -ansi -pedantic \ + -DG_LOG_DOMAIN=\"LibG3D\" \ + @DBG_CFLAGS@ -DDEBUG=@DEBUG@ \ + @GLIB_CFLAGS@ + +INCLUDES = -I$(top_srcdir)/include +AM_LDFLAGS = \ + -no-undefined -module \ + @PLUGINS_LDFLAGS@ + +imp_blend_la_SOURCES = imp_blend.c imp_blend_def.h \ + imp_blend_types.h imp_blend_chunks.h \ + imp_blend_sdna.c imp_blend_sdna.h \ + imp_blend_read.c imp_blend_read.h \ + imp_blend_callbacks.h imp_blend_callbacks.c + +imp_blend_la_LIBADD = $(top_builddir)/src/libg3d.la @GLIB_LIBS@ +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/import/imp_blend/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu plugins/import/imp_blend/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-pluginimpLTLIBRARIES: $(pluginimp_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(pluginimpdir)" || $(MKDIR_P) "$(DESTDIR)$(pluginimpdir)" + @list='$(pluginimp_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(pluginimpLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(pluginimpdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(pluginimpLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(pluginimpdir)/$$f"; \ + else :; fi; \ + done + +uninstall-pluginimpLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(pluginimp_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pluginimpdir)/$$p'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pluginimpdir)/$$p"; \ + done + +clean-pluginimpLTLIBRARIES: + -test -z "$(pluginimp_LTLIBRARIES)" || rm -f $(pluginimp_LTLIBRARIES) + @list='$(pluginimp_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +imp_blend.la: $(imp_blend_la_OBJECTS) $(imp_blend_la_DEPENDENCIES) + $(LINK) $(am_imp_blend_la_rpath) $(imp_blend_la_OBJECTS) $(imp_blend_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imp_blend.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imp_blend_callbacks.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imp_blend_read.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imp_blend_sdna.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: + for dir in "$(DESTDIR)$(pluginimpdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-pluginimpLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: install-pluginimpLTLIBRARIES + +install-dvi: install-dvi-am + +install-exec-am: + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-pluginimpLTLIBRARIES + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-pluginimpLTLIBRARIES ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-pluginimpLTLIBRARIES \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-pluginimpLTLIBRARIES + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_blend/imp_blend.c b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_blend/imp_blend.c new file mode 100644 index 0000000..7893c1e --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_blend/imp_blend.c @@ -0,0 +1,201 @@ +/* $Id$ */ + +/* + libg3d - 3D object loading library + + Copyright (C) 2005-2009 Markus Dahms + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include +#include + +#include +#include + +#include "imp_blend_def.h" +#include "imp_blend_types.h" +#include "imp_blend_sdna.h" +#include "imp_blend_read.h" +#include "imp_blend_chunks.h" + +static gboolean blend_read_file(BlendGlobal *global); + +EAPI +gboolean plugin_load_model_from_stream(G3DContext *context, G3DStream *stream, + G3DModel *model, gpointer user_data) +{ + gchar buf[BLEND_HEADER_SIZE + 1]; + guint32 flags = 0, version; + BlendGlobal *global; + + if(g3d_stream_read(stream, buf, BLEND_HEADER_SIZE) != BLEND_HEADER_SIZE) { + g_warning("Blend: %s: failed to read header", stream->uri); + return FALSE; + } + buf[BLEND_HEADER_SIZE] = '\0'; + if(strncmp(buf, "BLENDER", 7) != 0) { + g_warning("Blend: %s: not a blender file", stream->uri); + return FALSE; + } + if(buf[7] == '_') + flags |= FLAG_POINTERSIZE_4; + if(buf[8] == 'v') + flags |= FLAG_LITTLE_ENDIAN; + version = atoi(buf + 9); + + g_debug("Blend: version %.2f, %s endian, pointer size is %d", + version / 100.0, + (flags & FLAG_LITTLE_ENDIAN) ? "little" : "big", + (flags & FLAG_POINTERSIZE_4) ? 4 : 8); + + if(!(flags & FLAG_POINTERSIZE_4)) { + g_warning("Blend: 8-byte pointers are not implemented as I lack a " + "test file. Please send me one :)."); + return FALSE; + } + + global = g_new0(BlendGlobal, 1); + global->context = context; + global->stream = stream; + global->model = model; + global->flags = flags; + + blend_read_file(global); + + g_free(global); + + return TRUE; +} + +EAPI +gchar *plugin_description(void) +{ + return g_strdup("Blender models."); +} + +EAPI +gchar **plugin_extensions(void) +{ + return g_strsplit("blend", ":", 0); +} + +/*****************************************************************************/ + +static inline const BlendChunkInfo *blend_get_chunk_info(guint32 code, + guint32 oid) +{ + gint32 i; + + for(i = 0; blend_chunks[i].code != 0; i ++) + if((blend_chunks[i].code == code) && (blend_chunks[i].oid == oid)) + return &(blend_chunks[i]); + if(oid != 0) + return blend_get_chunk_info(code, 0); + return NULL; +} + +static gboolean blend_read_file(BlendGlobal *global) +{ + guint32 code, old, sdnanr, nr; + gsize len; + BlendLocal *local; + const BlendChunkInfo *cinfo; + const BlendSdnaStruct *sstruct; + gint i; + G3DObject *object = NULL; + G3DObject *grpobject = NULL; + guint32 object_id = 0; + + while(TRUE) { + code = blend_read_uint(global->stream, global->flags); + len = blend_read_uint(global->stream, global->flags); + if(code == MKID('E','N','D','B')) + return TRUE; + + old = blend_read_uint(global->stream, global->flags); + sdnanr = blend_read_uint(global->stream, global->flags); + nr = blend_read_uint(global->stream, global->flags); + + if((global->sdna == NULL) && (code != MKID('D','N','A','1'))) { + g3d_stream_skip(global->stream, len); + continue; + } + + cinfo = blend_get_chunk_info(code, (code == ID_DATA) ? object_id : 0); + if(cinfo == NULL) + g_warning("unknown chunk: %c%c%c%c", + blend_from_id(code, 0), blend_from_id(code, 1), + blend_from_id(code, 2), blend_from_id(code, 3)); + + g_debug("\\%c%c%c%c: %-20s - %8d bytes (0x%08x, %d, %d)", + blend_from_id(code, 0), blend_from_id(code, 1), + blend_from_id(code, 2), blend_from_id(code, 3), + cinfo ? cinfo->description : "(unknown)", + (int) len, old, sdnanr, nr); + + if(len == 0) + return FALSE; + + /* on non-DATA nodes a new object starts */ + if(code != ID_DATA) { + object_id = code; + } + + local = g_new0(BlendLocal, 1); + local->ndata = nr; + local->data = g_new0(BlendSdnaData *, nr); + + if(global->sdna) { + for(i = 0; i < nr; i ++) { + sstruct = blend_sdna_get_struct_by_id(global->sdna, sdnanr); + if(sstruct) { +#if DEBUG > BLEND_DEBUG_STRUCT + g_debug("|struct %s /* %d */", + sstruct->name, sstruct->size); +#endif + local->data[i] = blend_sdna_data_read(global->sdna, + sstruct, global, &len, 0); + } + } + } + + local->object = object; + local->grpobject = grpobject; + local->object_id = object_id; + local->len = len; + + if(cinfo && cinfo->callback) + if(!cinfo->callback(global, local)) + return FALSE; + + len = local->len; + object = local->object; + grpobject = local->grpobject; + + for(i = 0; i < local->ndata; i ++) + if(local->data[i]) + blend_sdna_data_free(local->data[i]); + g_free(local->data); + g_free(local); + + /* skip remaining data */ + g3d_stream_skip(global->stream, len); + } + + blend_sdna_cleanup(global->sdna); + return TRUE; +} diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_blend/imp_blend_callbacks.c b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_blend/imp_blend_callbacks.c new file mode 100644 index 0000000..f5e7b95 --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_blend/imp_blend_callbacks.c @@ -0,0 +1,237 @@ +/* $Id:$ */ + +/* + libg3d - 3D object loading library + + Copyright (C) 2005-2009 Markus Dahms + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ +#include + +#include +#include +#include + +#include "imp_blend_types.h" +#include "imp_blend_def.h" +#include "imp_blend_sdna.h" + +/* mesh data */ +gboolean blend_cb_DATA_ME(BlendGlobal *global, BlendLocal *local) +{ + G3DFace *face; + BlendSdnaPropData *spdata; + gchar *stmp; + gint32 i, j; + + if((local->ndata == 0) || (local->data[0] == NULL)) + return TRUE; + g_return_val_if_fail(local->object != NULL, FALSE); + + /* all structs in one DATA chunk have the same type */ + if(strcmp(local->data[0]->sstruct->name, "MVert") == 0) { + local->object->vertex_count = local->ndata; + local->object->vertex_data = g3d_vector_new(3, + local->object->vertex_count); + for(i = 0; i < local->ndata; i ++) { + spdata = blend_sdna_get_property(local->data[i], "co", T_FLOAT); + if(spdata) + for(j = 0; j < 3; j ++) + local->object->vertex_data[i * 3 + j] = spdata->fval[j]; + } + } else if(strcmp(local->data[0]->sstruct->name, "MFace") == 0) { + for(i = 0; i < local->ndata; i ++) { + face = g_new0(G3DFace, 1); + face->vertex_count = 4; + face->vertex_indices = g_new0(guint32, 4); + face->material = g_slist_nth_data(local->object->materials, 0); + local->object->faces = g_slist_prepend(local->object->faces, face); + for(j = 0; j < 4; j ++) { + stmp = g_strdup_printf("v%d", j); + spdata = blend_sdna_get_property(local->data[i], stmp, T_INT); + if(spdata) + face->vertex_indices[j] = spdata->ival[0]; + g_free(stmp); + } +#if DEBUG > 2 + g_debug("MFace: %03i (%02i, %02i, %02i, %02i)", i, + face->vertex_indices[0], face->vertex_indices[1], + face->vertex_indices[2], face->vertex_indices[3]); +#endif + spdata = blend_sdna_get_property(local->data[i], "mat_nr", T_CHAR); + /* TODO */ + } + } else { +#if DEBUG > 0 + for(i = 0; i < local->ndata; i ++) + blend_sdna_dump_data(local->data[i], 0); +#endif + } + return TRUE; +} + +/* struct DNA */ +gboolean blend_cb_DNA1(BlendGlobal *global, BlendLocal *local) +{ + if(global->sdna != NULL) + return TRUE; + global->sdna = blend_sdna_read_dna1(global->stream, + global->flags, local->len); + if(global->sdna == NULL) { + g_warning("Blend: failed to read DNA1, giving up..."); + return FALSE; + } + /* rewind stream to really read content */ + g3d_stream_seek(global->stream, BLEND_HEADER_SIZE, G_SEEK_SET); + local->len = 0; + return TRUE; +} + +static gchar *get_name_from_id(BlendSdnaData *sdata) +{ + BlendSdnaPropData *spdata, *spdata2; + gchar *name = NULL; + gint32 i; + + spdata = blend_sdna_get_property(sdata, "id", T_STRUCT); + if(spdata) { + spdata2 = blend_sdna_get_property(spdata->structval, "name", T_CHAR); + if(spdata2) { + name = g_new0(gchar, spdata2->sprop->nitems + 1); + for(i = 0; i < spdata2->sprop->nitems; i ++) + name[i] = spdata2->ival[i]; + } + } + return name; +} + +static G3DFloat get_float(BlendSdnaData *sdata, const gchar *var) +{ + BlendSdnaPropData *spdata; + spdata = blend_sdna_get_property(sdata, var, T_FLOAT); + if(spdata) + return spdata->fval[0]; + return 0.0; +} + +/* material */ +gboolean blend_cb_MA(BlendGlobal *global, BlendLocal *local) +{ + G3DMaterial *material; + + g_return_val_if_fail(local->data[0] != NULL, FALSE); + +#if DEBUG > 0 + blend_sdna_dump_data(local->data[0], 0); +#endif + + material = g3d_material_new(); + material->name = get_name_from_id(local->data[0]); + global->model->materials = g_slist_append(global->model->materials, + material); + material->r = get_float(local->data[0], "r"); + material->g = get_float(local->data[0], "g"); + material->b = get_float(local->data[0], "b"); + return TRUE; +} + +/* mesh */ +gboolean blend_cb_ME(BlendGlobal *global, BlendLocal *local) +{ + G3DObject *object; + G3DMaterial *material; + G3DVector v[3]; + BlendSdnaPropData *spdata; + gint32 i; + + g_return_val_if_fail(local->data[0] != NULL, FALSE); + +#if DEBUG > 0 + blend_sdna_dump_data(local->data[0], 0); +#endif + + object = g_new0(G3DObject, 1); + if(local->grpobject) + local->grpobject->objects = g_slist_append(local->grpobject->objects, + object); + else + global->model->objects = g_slist_append(global->model->objects, + object); + local->object = object; + material = g3d_material_new(); + material->name = g_strdup("(default material)"); + object->materials = g_slist_append(local->object->materials, material); + + /* name */ + object->name = get_name_from_id(local->data[0]); + + object->transformation = g_new0(G3DTransformation, 1); + g3d_matrix_identity(object->transformation->matrix); + + /* rotation */ + spdata = blend_sdna_get_property(local->data[0], "rot", T_FLOAT); + if(spdata) { + for(i = 0; i < 3; i ++) + v[i] = spdata->fval[i]; + g3d_matrix_rotate_xyz(v[0], v[1], v[2], + object->transformation->matrix); +#if DEBUG > 0 + g_debug("ME: rotate %f, %f, %f", v[0], v[1], v[2]); +#endif + } + /* size */ + spdata = blend_sdna_get_property(local->data[0], "size", T_FLOAT); + if(spdata) { + for(i = 0; i < 3; i ++) + v[i] = spdata->fval[i]; + g3d_matrix_scale(v[0], v[1], v[2], object->transformation->matrix); +#if DEBUG > 2 + g_debug("ME: scale %f, %f, %f", v[0], v[1], v[2]); +#endif + } + /* location */ + spdata = blend_sdna_get_property(local->data[0], "loc", T_FLOAT); + if(spdata) { + for(i = 0; i < 3; i ++) + v[i] = spdata->fval[i]; + g3d_matrix_translate(v[0], v[1], v[2], + object->transformation->matrix); +#if DEBUG > 2 + g_debug("ME: translate %f, %f, %f", v[0], v[1], v[2]); +#endif + } + return TRUE; +} + +gboolean blend_cb_OB(BlendGlobal *global, BlendLocal *local) +{ + G3DObject *object; + + g_return_val_if_fail(local->data[0] != NULL, FALSE); + +#if DEBUG > 0 + blend_sdna_dump_data(local->data[0], 0); +#endif + + object = g_new0(G3DObject, 1); + object->name = get_name_from_id(local->data[0]); + local->grpobject = object; + global->model->objects = g_slist_append(global->model->objects, object); + + return TRUE; +} + + diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_blend/imp_blend_callbacks.h b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_blend/imp_blend_callbacks.h new file mode 100644 index 0000000..160fd07 --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_blend/imp_blend_callbacks.h @@ -0,0 +1,35 @@ +/* $Id:$ */ + +/* + libg3d - 3D object loading library + + Copyright (C) 2005-2009 Markus Dahms + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ +#ifndef _IMP_BLEND_CALLBACKS_H +#define _IMP_BLEND_CALLBACKS_H + +#include "imp_blend_types.h" + +gboolean blend_cb_DATA_ME(BlendGlobal *global, BlendLocal *local); + +gboolean blend_cb_DNA1(BlendGlobal *global, BlendLocal *local); + +gboolean blend_cb_MA(BlendGlobal *global, BlendLocal *local); +gboolean blend_cb_ME(BlendGlobal *global, BlendLocal *local); +gboolean blend_cb_OB(BlendGlobal *global, BlendLocal *local); + +#endif /* _IMP_BLEND_CALLBACKS_H */ diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_blend/imp_blend_chunks.h b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_blend/imp_blend_chunks.h new file mode 100644 index 0000000..6ab82bd --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_blend/imp_blend_chunks.h @@ -0,0 +1,63 @@ +/* $Id:$ */ + +/* + libg3d - 3D object loading library + + Copyright (C) 2005-2009 Markus Dahms + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ +#ifndef _IMP_BLEND_CHUNKS_H +#define _IMP_BLEND_CHUNKS_H + +#include "imp_blend_def.h" +#include "imp_blend_types.h" +#include "imp_blend_callbacks.h" + +typedef gboolean (* BlendCallback)(BlendGlobal *, BlendLocal *); + +typedef struct { + guint32 code; + guint32 oid; + const gchar *description; + BlendCallback callback; +} BlendChunkInfo; + +#define ID_DATA MKID('D','A','T','A') + +static const BlendChunkInfo blend_chunks[] = { + { ID_DATA, MKID2('M','E'), "mesh data", blend_cb_DATA_ME }, + { ID_DATA, 0, "struct data", NULL }, + + { MKID2('C','A'), 0, "camera", NULL }, + { MKID2('I','M'), 0, "image", NULL }, + { MKID2('L','A'), 0, "lamp", NULL }, + { MKID2('M','A'), 0, "material", blend_cb_MA }, + { MKID2('M','E'), 0, "mesh", blend_cb_ME }, + { MKID2('O','B'), 0, "object", blend_cb_OB }, + { MKID2('S','C'), 0, "scene", NULL }, + { MKID2('S','R'), 0, "screen", NULL }, + { MKID2('T','E'), 0, "texture", NULL }, + { MKID2('T','X'), 0, "text", NULL }, + { MKID2('W','O'), 0, "world", NULL }, + + { MKID('D','N','A','1'), 0, "SDNA data", blend_cb_DNA1 }, + { MKID('G','L','O','B'), 0, "global data", NULL }, + { MKID('R','E','N','D'), 0, "render data", NULL }, + + { 0, 0, NULL, NULL } +}; + +#endif /* _IMP_BLEND_CHUNKS_H */ diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_blend/imp_blend_def.h b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_blend/imp_blend_def.h new file mode 100644 index 0000000..0a89af4 --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_blend/imp_blend_def.h @@ -0,0 +1,42 @@ +/* $Id:$ */ + +/* + libg3d - 3D object loading library + + Copyright (C) 2005-2009 Markus Dahms + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ +#ifndef _IMP_BLEND_DEF_H +#define _IMP_BLEND_DEF_H + +#include + +#define BLEND_HEADER_SIZE 12 + +#define FLAG_LITTLE_ENDIAN 1 +#define FLAG_POINTERSIZE_4 4 +#define FLAG_POINTERSIZE_8 8 +#define FLAG_POINTER_MASK 0xC + +#define MKID(a,b,c,d) ((a) | ((b) << 8) | ((c) << 16) | ((d) << 24)) +#define MKID2(a,b) ((a) | ((b) << 8)) + +static inline gchar blend_from_id(guint32 id, guint8 pos) { + guint8 c = ((id >> (pos * 8)) & 0xFF); + return ((c < 0x20) || (c > 0x7F)) ? '_' : c; +} + +#endif /* _IMP_BLEND_DEF_H */ diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_blend/imp_blend_read.c b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_blend/imp_blend_read.c new file mode 100644 index 0000000..b73c5dc --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_blend/imp_blend_read.c @@ -0,0 +1,39 @@ +/* $Id$ */ + +/* + libg3d - 3D object loading library + + Copyright (C) 2005-2009 Markus Dahms + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ +#include + +#include "imp_blend_def.h" + +guint32 blend_read_short(G3DStream *stream, guint32 flags) +{ + return (flags & FLAG_LITTLE_ENDIAN) ? + g3d_stream_read_int16_le(stream) : + g3d_stream_read_int16_be(stream); +} + +guint32 blend_read_uint(G3DStream *stream, guint32 flags) +{ + return (flags & FLAG_LITTLE_ENDIAN) ? + g3d_stream_read_int32_le(stream) : + g3d_stream_read_int32_be(stream); +} + diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_blend/imp_blend_read.h b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_blend/imp_blend_read.h new file mode 100644 index 0000000..4f0626d --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_blend/imp_blend_read.h @@ -0,0 +1,30 @@ +/* $Id:$ */ + +/* + libg3d - 3D object loading library + + Copyright (C) 2005-2009 Markus Dahms + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ +#ifndef _IMP_BLEND_READ_H +#define _IMP_BLEND_READ_H + +#include + +guint32 blend_read_short(G3DStream *stream, guint32 flags); +guint32 blend_read_uint(G3DStream *stream, guint32 flags); + +#endif /* _IMP_BLEND_READ_H */ diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_blend/imp_blend_sdna.c b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_blend/imp_blend_sdna.c new file mode 100644 index 0000000..058832a --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_blend/imp_blend_sdna.c @@ -0,0 +1,467 @@ +/* $Id$ */ + +/* + libg3d - 3D object loading library + + Copyright (C) 2005-2009 Markus Dahms + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include +#include + +#include + +#include "imp_blend_def.h" +#include "imp_blend_types.h" +#include "imp_blend_sdna.h" +#include "imp_blend_read.h" + +static gboolean sdna_prop_check_array(BlendSdnaProperty *sprop) +{ + gchar *ob; + guint32 n; + + while(TRUE) { + ob = strrchr(sprop->name, '['); + if(ob == NULL) + return TRUE; + n = atoi(ob + 1); + if(n == 0) + return FALSE; + sprop->nitems *= n; + *ob = '\0'; + } + return FALSE; +} + +BlendSdna *blend_sdna_read_dna1(G3DStream *stream, guint32 flags, gint32 len) +{ + BlendSdna *sdna; + BlendSdnaProperty *sprop; + BlendSdnaStruct *sstruct; + guint32 code, n, n2, nn, m, t; + gint32 i, j; + gchar buf[2048], *bufp, c, **aptr; + + code = blend_read_uint(stream, flags); + len -= 4; + if(code != MKID('S','D','N','A')) { + g_warning("Blend: DNA1: no SDNA"); + g3d_stream_skip(stream, len); + return NULL; + } + + sdna = g_new0(BlendSdna, 1); + + while(len > 0) { + code = blend_read_uint(stream, flags); + len -= 4; + + switch(code) { + case MKID('N','A','M','E'): + case MKID('T','Y','P','E'): + n = blend_read_uint(stream, flags); + len -= 4; + if(code == MKID('T','Y','P','E')) { + g_debug("\\ TYPE: %d types", n); + sdna->n_types = n; + sdna->type_names = g_new0(gchar *, n); + sdna->type_sizes = g_new0(guint32, n); + aptr = sdna->type_names; + } else { + g_debug("\\ NAME: %d names", n); + sdna->n_names = n; + sdna->names = g_new0(gchar *, n); + aptr = sdna->names; + } + m = 0; + for(i = 0; i < n; i ++) { + bufp = buf; + do { + c = *bufp = g3d_stream_read_int8(stream); + bufp ++; + len --; + m ++; + } while(c != '\0'); + aptr[i] = g_strdup(buf); +#if DEBUG > 2 + g_debug("\\ %s", buf); +#endif + } + m %= 4; + if(m > 0) { + /* padding */ + g3d_stream_skip(stream, 4 - m); + len -= (4 - m); + } + break; + case MKID('T','L','E','N'): + g_debug("\\ TLEN: %d type sizes", sdna->n_types); + for(i = 0; i < sdna->n_types; i ++) { + m = blend_read_short(stream, flags); + len -= 2; +#if DEBUG > 2 + g_debug("\\ %d", m); +#endif + sdna->type_sizes[i] = m; + } + m = sdna->n_types % 2; + if(m > 0) { + g3d_stream_skip(stream, 2); + len -= 2; + } + break; + case MKID('S','T','R','C'): + n = blend_read_uint(stream, flags); + g_debug("\\ STRC: %d structs", n); + len -= 4; + for(i = 0; i < n; i ++) { + t = blend_read_short(stream, flags); + n2 = blend_read_short(stream, flags); + len -= 4; + sstruct = g_new0(BlendSdnaStruct, 1); + sstruct->tid = t; + sstruct->name = sdna->type_names[t]; + sstruct->size = sdna->type_sizes[t]; + sdna->structs = g_slist_append(sdna->structs, sstruct); + for(j = 0; j < n2; j ++) { + t = blend_read_short(stream, flags); + nn = blend_read_short(stream, flags); + len -= 4; + sprop = g_new0(BlendSdnaProperty, 1); + sprop->name = g_strdup(sdna->names[nn]); + sprop->tname = sdna->type_names[t]; + sprop->tid = t; + sprop->tsize = sdna->type_sizes[t]; + sprop->ptr = + (sprop->name[0] == '*') || + (sprop->name[0] == '('); + sprop->nitems = 1; + sdna_prop_check_array(sprop); + sstruct->properties = g_slist_append( + sstruct->properties, sprop); + } + } + break; + default: + g_warning("Blend: DNA1: unexpected section 0x%x", code); + return sdna; + break; + } + } + return sdna; +} + +static void blend_sdna_struct_free(BlendSdnaStruct *sstruct) +{ + GSList *item, *next; + BlendSdnaProperty *sprop; + + item = sstruct->properties; + while(item) { + sprop = item->data; + next = item->next; + g_free(sprop->name); + g_free(sprop); + g_slist_free_1(item); + item = next; + } + g_free(sstruct); +} + +void blend_sdna_cleanup(BlendSdna *sdna) +{ + GSList *item, *next; + BlendSdnaStruct *sstruct; + + g_return_if_fail(sdna != NULL); + + /* names */ + g_free(sdna->names); + /* types */ + g_free(sdna->type_names); + g_free(sdna->type_sizes); + /* structs */ + item = sdna->structs; + while(item) { + sstruct = item->data; + next = item->next; + blend_sdna_struct_free(sstruct); + g_slist_free_1(next); + item = next; + } + /* sdna */ + g_free(sdna); +} + +const BlendSdnaStruct *blend_sdna_get_struct_by_id(BlendSdna *sdna, + guint32 sdnanr) +{ + g_return_val_if_fail(sdnanr < g_slist_length(sdna->structs), NULL); + + if(sdnanr < 10) + return NULL; + + return g_slist_nth_data(sdna->structs, sdnanr); +} + +const BlendSdnaStruct *blend_sdna_get_struct_by_tid(BlendSdna *sdna, + guint32 tid) +{ + GSList *item; + BlendSdnaStruct *sstruct; + + for(item = sdna->structs; item != NULL; item = item->next) { + sstruct = item->data; + if(sstruct->tid == tid) + return sstruct; + } + + return NULL; +} + +static inline void sdna_data_read_basic_types(BlendSdna *sdna, + BlendSdnaPropData *spdata, BlendGlobal *global, gsize *r) +{ + gint32 i; + + g_return_if_fail(spdata->sprop->nitems > 0); + + switch(spdata->type) { + case T_CHAR: + spdata->ival = g_new0(gint32, spdata->sprop->nitems); + for(i = 0; i < spdata->sprop->nitems; i ++) + spdata->ival[i] = g3d_stream_read_int8(global->stream); + (*r) -= spdata->sprop->nitems; + break; + case T_UCHAR: + spdata->uval = g_new0(guint32, spdata->sprop->nitems); + for(i = 0; i < spdata->sprop->nitems; i ++) + spdata->uval[i] = g3d_stream_read_int8(global->stream); + (*r) -= spdata->sprop->nitems; + break; + case T_SHORT: /* FIXME: BE/LE */ + spdata->ival = g_new0(gint32, spdata->sprop->nitems); + for(i = 0; i < spdata->sprop->nitems; i ++) + spdata->ival[i] = g3d_stream_read_int16_le(global->stream); + (*r) -= spdata->sprop->nitems * 2; + break; + case T_USHORT: + spdata->uval = g_new0(guint32, spdata->sprop->nitems); + for(i = 0; i < spdata->sprop->nitems; i ++) + spdata->uval[i] = g3d_stream_read_int16_le(global->stream); + (*r) -= spdata->sprop->nitems * 2; + break; + case T_INT: /* FIXME: 32/64 bit */ + spdata->ival = g_new0(gint32, spdata->sprop->nitems); + for(i = 0; i < spdata->sprop->nitems; i ++) + spdata->ival[i] = g3d_stream_read_int32_le(global->stream); + (*r) -= spdata->sprop->nitems * 4; + break; + case T_LONG: + spdata->ival = g_new0(gint32, spdata->sprop->nitems); + for(i = 0; i < spdata->sprop->nitems; i ++) + spdata->ival[i] = g3d_stream_read_int32_le(global->stream); + (*r) -= spdata->sprop->nitems * 4; + break; + case T_ULONG: + spdata->uval = g_new0(guint32, spdata->sprop->nitems); + for(i = 0; i < spdata->sprop->nitems; i ++) + spdata->uval[i] = g3d_stream_read_int32_le(global->stream); + (*r) -= spdata->sprop->nitems * 4; + break; + case T_FLOAT: + spdata->fval = g_new0(G3DFloat, spdata->sprop->nitems); + for(i = 0; i < spdata->sprop->nitems; i ++) + spdata->fval[i] = g3d_stream_read_float_le(global->stream); + (*r) -= spdata->sprop->nitems * 4; + break; + case T_DOUBLE: + spdata->fval = g_new0(G3DFloat, spdata->sprop->nitems); + for(i = 0; i < spdata->sprop->nitems; i ++) + spdata->fval[i] = g3d_stream_read_double_le(global->stream); + (*r) -= spdata->sprop->nitems * 8; + break; + case T_VOID: + g_warning("SDNA: non-pointer void type"); + break; + case T_STRUCT: + /* handled elsewhere */ + break; + } +} + +BlendSdnaPropData *blend_sdna_get_property(BlendSdnaData *sdata, + const gchar *name, BlendSdnaPropType type) +{ + BlendSdnaPropData *spdata; + + spdata = g_hash_table_lookup(sdata->prophash, name); + if(!spdata) + return NULL; + if(spdata->type != type) + return NULL; + return spdata; +} + +BlendSdnaData *blend_sdna_data_read(BlendSdna *sdna, + const BlendSdnaStruct *sstruct, BlendGlobal *global, gsize *r, + guint32 level) +{ + BlendSdnaData *sdata; + BlendSdnaProperty *sprop; + BlendSdnaPropData *spdata; + const BlendSdnaStruct *substruct; + GSList *pitem; + + sdata = g_new0(BlendSdnaData, 1); + sdata->sstruct = sstruct; + sdata->prophash = g_hash_table_new(g_str_hash, g_str_equal); + +#if DEBUG > BLEND_DEBUG_STRUCT + g_debug("|%s{ /* %s */", + debug_pad(level * 2), sstruct->name); +#endif + + for(pitem = sstruct->properties; pitem != NULL; pitem = pitem->next) { + sprop = pitem->data; + spdata = g_new0(BlendSdnaPropData, 1); + spdata->name = g_strdup(sprop->name); + spdata->sprop = sprop; + g_hash_table_insert(sdata->prophash, spdata->name, spdata); + spdata->type = (sprop->tid < 10) ? sprop->tid : 0xFF; + + if(sprop->ptr) { + spdata->pval = g_new0(guint32, 1); + spdata->pval[0] = g3d_stream_read_int32_le(global->stream); + (*r) -= 4; +#if DEBUG > BLEND_DEBUG_STRUCT + g_debug("|%s %-10s %-10s = 0x%08x; /* len = %d */", + debug_pad(level * 2), + sprop->tname, sprop->name, spdata->pval[0], *r); +#endif + continue; + } + + if(spdata->type == T_STRUCT) { + substruct = blend_sdna_get_struct_by_tid(sdna, sprop->tid); +#if DEBUG > BLEND_DEBUG_STRUCT + g_debug("|%s %-10s %-10s = /* %s */", + debug_pad(level * 2), + sprop->tname, sprop->name, + substruct ? substruct->name : "(unknown)"); +#endif + if(substruct) + spdata->structval = blend_sdna_data_read(sdna, + substruct, global, r, level + 1); + else { + g3d_stream_skip(global->stream, sprop->tsize); + (*r) -= sprop->tsize; + } + } else { + sdna_data_read_basic_types(sdna, spdata, global, r); + } + } /* properties */ + +#if DEBUG > BLEND_DEBUG_STRUCT + g_debug("|%s};", debug_pad(level * 2)); +#endif + + return sdata; +} + +void blend_sdna_data_free(BlendSdnaData *sdata) +{ + /* TODO: free BlendSdnaPropData nodes */ + g_hash_table_destroy(sdata->prophash); + g_free(sdata); +} + +/*****************************************************************************/ +/* debugging code */ + +#if DEBUG > 0 + +static void blend_sdna_dump_spdata_cb(gpointer key, gpointer value, + gpointer user_data) +{ + BlendSdnaPropData *spdata = value; + guint32 *levelp = user_data; + +#define DUMP_FORMAT "|%s %-10s %-10s [%03d]" +#define DUMP_ARGS debug_pad(*levelp), \ + spdata->sprop->tname, spdata->name, spdata->sprop->nitems + + if(spdata->sprop->ptr) { + g_debug(DUMP_FORMAT " = 0x%08x;", DUMP_ARGS, spdata->pval[0]); + return; + } + switch(spdata->type) { + case T_CHAR: + case T_SHORT: + case T_INT: + case T_LONG: + g_debug(DUMP_FORMAT " = %i;", DUMP_ARGS, spdata->ival[0]); + break; + case T_UCHAR: + case T_USHORT: + case T_ULONG: + g_debug(DUMP_FORMAT " = %u;", DUMP_ARGS, spdata->uval[0]); + break; + case T_FLOAT: + case T_DOUBLE: + g_debug(DUMP_FORMAT " = %f;", DUMP_ARGS, spdata->fval[0]); + break; + case T_STRUCT: + g_debug(DUMP_FORMAT " =", DUMP_ARGS); + blend_sdna_dump_data(spdata->structval, *levelp + 1); + break; + default: + g_debug(DUMP_FORMAT ";", DUMP_ARGS); + break; + } +} + +gboolean blend_sdna_dump_data(BlendSdnaData *sdata, guint32 level) +{ + g_debug("|%s{ /* %s */", debug_pad(level), sdata->sstruct->name); + g_hash_table_foreach(sdata->prophash, blend_sdna_dump_spdata_cb, &level); + g_debug("|%s},", debug_pad(level)); + return TRUE; +} + +gboolean blend_sdna_dump_struct(BlendSdna *sdna, guint32 sdnanr) +{ + const BlendSdnaStruct *sstruct; + BlendSdnaProperty *sprop; + GSList *pitem; + + sstruct = blend_sdna_get_struct_by_id(sdna, sdnanr); + if(!sstruct) + return FALSE; + sstruct = g_slist_nth_data(sdna->structs, sdnanr); + g_debug("| struct %s { /* %d */", sstruct->name, sstruct->size); + for(pitem = sstruct->properties; pitem != NULL; pitem = pitem->next) { + sprop = pitem->data; + g_debug("| \t%-16s %-24s;", sprop->tname, sprop->name); + } + g_debug("| };"); + + return TRUE; +} + +#endif diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_blend/imp_blend_sdna.h b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_blend/imp_blend_sdna.h new file mode 100644 index 0000000..a95369f --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_blend/imp_blend_sdna.h @@ -0,0 +1,53 @@ +/* $Id:$ */ + +/* + libg3d - 3D object loading library + + Copyright (C) 2005-2009 Markus Dahms + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ +#ifndef _IMP_BLEND_SDNA_H +#define _IMP_BLEND_SDNA_H + +#include + +#include "imp_blend_types.h" + +/* as in #if DEBUG > BLEND_DEBUG_STRUCT */ +#define BLEND_DEBUG_STRUCT 1 + +BlendSdna *blend_sdna_read_dna1(G3DStream *stream, guint32 flags, gint32 len); +void blend_sdna_cleanup(BlendSdna *sdna); + +const BlendSdnaStruct *blend_sdna_get_struct_by_id(BlendSdna *sdna, + guint32 sdnanr); +const BlendSdnaStruct *blend_sdna_get_struct_by_name(BlendSdna *sdna, + const gchar *name); + +BlendSdnaData *blend_sdna_data_read(BlendSdna *sdna, + const BlendSdnaStruct *sstruct, BlendGlobal *global, gsize *r, + guint32 level); +void blend_sdna_data_free(BlendSdnaData *sdata); + +BlendSdnaPropData *blend_sdna_get_property(BlendSdnaData *sdata, + const gchar *name, BlendSdnaPropType type); + +#if DEBUG > 0 +gboolean blend_sdna_dump_data(BlendSdnaData *sdata, guint32 level); +gboolean blend_sdna_dump_struct(BlendSdna *sdna, guint32 sdnanr); +#endif + +#endif /* _IMP_BLEND_SDNA_H */ diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_blend/imp_blend_types.h b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_blend/imp_blend_types.h new file mode 100644 index 0000000..b2d9573 --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_blend/imp_blend_types.h @@ -0,0 +1,100 @@ +/* $Id:$ */ + +/* + libg3d - 3D object loading library + + Copyright (C) 2005-2009 Markus Dahms + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ +#ifndef _IMP_BLEND_TYPES_H +#define _IMP_BLEND_TYPES_H + +#include + +typedef struct { + gchar *name; + const gchar *tname; + guint32 tid; + gsize tsize; + gsize nitems; + gboolean ptr; +} BlendSdnaProperty; + +typedef struct { + const gchar *name; + guint32 tid; + gsize size; + GSList *properties; +} BlendSdnaStruct; + +typedef struct { + const BlendSdnaStruct *sstruct; + GHashTable *prophash; +} BlendSdnaData; + +typedef enum { + T_CHAR = 0, + T_UCHAR = 1, + T_SHORT = 2, + T_USHORT = 3, + T_INT = 4, + T_LONG = 5, + T_ULONG = 6, + T_FLOAT = 7, + T_DOUBLE = 8, + T_VOID = 9, + T_STRUCT = 0xFF +} BlendSdnaPropType; + +typedef struct { + gchar *name; + BlendSdnaPropType type; + BlendSdnaProperty *sprop; + guint32 *uval; /* unsigned integer value */ + gint32 *ival; /* signed integer value */ + G3DFloat *fval; /* floating point value */ + guint32 *pval; /* pointer value */ + BlendSdnaData *structval; /* struct value */ +} BlendSdnaPropData; + +typedef struct { + guint32 n_names; + gchar **names; + guint32 n_types; + gchar **type_names; + guint32 *type_sizes; + GSList *structs; +} BlendSdna; + +typedef struct { + G3DContext *context; + G3DModel *model; + G3DStream *stream; + guint32 flags; + BlendSdna *sdna; +} BlendGlobal; + +typedef struct { + guint32 id; + guint32 len; + G3DObject *object; + G3DObject *grpobject; + guint32 object_id; + guint32 ndata; + BlendSdnaData **data; +} BlendLocal; + +#endif -- cgit v1.1