diff --git a/AssimpToMesh.sln b/AssimpToMesh.sln deleted file mode 100644 index 3a95254..0000000 --- a/AssimpToMesh.sln +++ /dev/null @@ -1,20 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AssimpToMesh", "AssimpToMesh\AssimpToMesh.vcxproj", "{1706D477-F8C1-4CD9-A9F6-06A9D903FD3C}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {1706D477-F8C1-4CD9-A9F6-06A9D903FD3C}.Debug|Win32.ActiveCfg = Debug|Win32 - {1706D477-F8C1-4CD9-A9F6-06A9D903FD3C}.Debug|Win32.Build.0 = Debug|Win32 - {1706D477-F8C1-4CD9-A9F6-06A9D903FD3C}.Release|Win32.ActiveCfg = Release|Win32 - {1706D477-F8C1-4CD9-A9F6-06A9D903FD3C}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/AssimpToMesh/AssimpToMesh.vcxproj b/AssimpToMesh/AssimpToMesh.vcxproj deleted file mode 100644 index 9604751..0000000 --- a/AssimpToMesh/AssimpToMesh.vcxproj +++ /dev/null @@ -1,107 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - {1706D477-F8C1-4CD9-A9F6-06A9D903FD3C} - Win32Proj - AssimpToMesh - - - - Application - true - Unicode - - - Application - false - true - Unicode - - - - - - - - - - - - - true - E:\assimp--2.0.863-sdk\include;$(IncludePath) - E:\assimp--2.0.863-sdk\lib\assimp_debug-dll_win32;$(LibraryPath) - - - false - E:\assimp--2.0.863-sdk\include;$(IncludePath) - E:\assimp--2.0.863-sdk\lib\assimp_release-dll_win32;$(LibraryPath) - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions) - - - Console - true - assimp.lib;%(AdditionalDependencies) - - - - - Level3 - - - MaxSpeed - true - true - WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions) - - - Console - true - true - true - assimp.lib;%(AdditionalDependencies) - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/AssimpToMesh/AssimpToMesh.vcxproj.filters b/AssimpToMesh/AssimpToMesh.vcxproj.filters deleted file mode 100644 index b1fe21f..0000000 --- a/AssimpToMesh/AssimpToMesh.vcxproj.filters +++ /dev/null @@ -1,75 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..9cabc86 --- /dev/null +++ b/Makefile @@ -0,0 +1,150 @@ +# this Makefile is based on the ones from devkitPro +# TODO: probably should simplify it a bunch (mainly the rules at the bottom) + +TARGET := assimptomesh + + + +#------------------------------------------------------------------------------- +# detect build configuration +#------------------------------------------------------------------------------- +ifndef ("CFG") +CFG=Debug +endif + +ifeq ("$(CFG)","Debug") +BUILD := Debug +endif +ifeq ("$(CFG)","Release") +BUILD := Release +endif +ifeq ("$(BUILD)", "") +$(error invalid configuration specified via CFG argument) +endif + +$(info $(CFG) configuration selected) + + + +#------------------------------------------------------------------------------- +# set up platform specifics +#------------------------------------------------------------------------------- +UNAME := $(shell uname) + +# default windows libraries and options +PLATFORM := win32 +PLATFORM_LD_FLAGS := -static-libgcc -static-libstdc++ + +ifeq ($(UNAME), Linux) +# it appears that we're running on linux +PLATFORM := linux +PLATFORM_LD_FLAGS := +endif + +# TODO: other platform detection + + + +#------------------------------------------------------------------------------- +ifeq ("$(BUILD)","Debug") +DEFINES := -DDEBUG -DDEBUG_ASSERT_BREAK +CFLAGS := $(DEFINES) -g -Wall -I/usr/include/assimp +CXXFLAGS := $(CFLAGS) +LDFLAGS := $(PLATFORM_LD_FLAGS) +LIBS := -g -lassimp +endif +#------------------------------------------------------------------------------- +ifeq ("$(BUILD)","Release") +DEFINES := +CFLAGS := $(DEFINES) -O2 -Wall -I/usr/include/assimp +CXXFLAGS := $(CFLAGS) +LDFLAGS := -O2 $(PLATFORM_LD_FLAGS) +LIBS := -lassimp +endif +#------------------------------------------------------------------------------- + + + +#------------------------------------------------------------------------------- +# find sources, setup commands +#------------------------------------------------------------------------------- +ifneq ($(BUILD),$(notdir $(CURDIR))) +#------------------------------------------------------------------------------- + +SOURCES := ${shell find ./src -type d} +export OUTPUT := $(TARGET) +export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) + +CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c))) +CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp))) +SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s))) + +export CXX := g++ +export CC := g++ +export LD := g++ +export OFILES := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o) + +.PHONY: $(BUILD) clean + +#------------------------------------------------------------------------------- +$(BUILD): + $(info building ...) + @[ -d $@ ] || mkdir -p $@ + @make --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile + +#------------------------------------------------------------------------------- +clean: + $(info clean ...) + @rm -fr $(BUILD) + +#------------------------------------------------------------------------------- +else + + + +#------------------------------------------------------------------------------- +# main targets +#------------------------------------------------------------------------------- +$(OUTPUT): $(OFILES) + $(info linking $(notdir $@)) + $(LD) -o $@ $(LDFLAGS) $(OFILES) $(LIBS) + cp $(OUTPUT) ../../ + + + + +#------------------------------------------------------------------------------- +# build rules by filetype +#------------------------------------------------------------------------------- + +#------------------------------------------------------------------------------- +%.a: +#------------------------------------------------------------------------------- + $(info $(notdir $<)) + @rm -f $@ + @$(AR) -rc $@ $^ + +#------------------------------------------------------------------------------- +%.o: %.cpp + $(info $(notdir $<)) + @$(CXX) -c $< -o $@ $(CXXFLAGS) + +#------------------------------------------------------------------------------- +%.o: %.c + $(info $(notdir $<)) + @$(CC) -c $< -o $@ $(CFLAGS) + +#------------------------------------------------------------------------------- +%.o: %.s + $(info $(notdir $<)) + @$(CC) -x assembler-with-cpp $(ASFLAGS) -c $< -o $@ + +#------------------------------------------------------------------------------- +%.o: %.S + @echo $(notdir $<) + @$(CC) -x assembler-with-cpp $(ASFLAGS) -c $< -o $@ + +#------------------------------------------------------------------------------- +endif +#------------------------------------------------------------------------------- + diff --git a/AssimpToMesh/src/assimputils/assimpgeometry.cpp b/src/assimputils/assimpgeometry.cpp similarity index 100% rename from AssimpToMesh/src/assimputils/assimpgeometry.cpp rename to src/assimputils/assimpgeometry.cpp diff --git a/AssimpToMesh/src/assimputils/assimpsceneinfo.cpp b/src/assimputils/assimpsceneinfo.cpp similarity index 100% rename from AssimpToMesh/src/assimputils/assimpsceneinfo.cpp rename to src/assimputils/assimpsceneinfo.cpp diff --git a/AssimpToMesh/src/assimputils/types.h b/src/assimputils/types.h similarity index 100% rename from AssimpToMesh/src/assimputils/types.h rename to src/assimputils/types.h diff --git a/AssimpToMesh/src/assimputils/utils.h b/src/assimputils/utils.h similarity index 100% rename from AssimpToMesh/src/assimputils/utils.h rename to src/assimputils/utils.h diff --git a/AssimpToMesh/src/convert/convert.h b/src/convert/convert.h similarity index 100% rename from AssimpToMesh/src/convert/convert.h rename to src/convert/convert.h diff --git a/AssimpToMesh/src/convert/mesh.h b/src/convert/mesh.h similarity index 100% rename from AssimpToMesh/src/convert/mesh.h rename to src/convert/mesh.h diff --git a/AssimpToMesh/src/convert/meshjoint.h b/src/convert/meshjoint.h similarity index 100% rename from AssimpToMesh/src/convert/meshjoint.h rename to src/convert/meshjoint.h diff --git a/AssimpToMesh/src/convert/meshmaterial.h b/src/convert/meshmaterial.h similarity index 100% rename from AssimpToMesh/src/convert/meshmaterial.h rename to src/convert/meshmaterial.h diff --git a/AssimpToMesh/src/convert/meshtriangle.h b/src/convert/meshtriangle.h similarity index 100% rename from AssimpToMesh/src/convert/meshtriangle.h rename to src/convert/meshtriangle.h diff --git a/AssimpToMesh/src/convert/meshutils.cpp b/src/convert/meshutils.cpp similarity index 100% rename from AssimpToMesh/src/convert/meshutils.cpp rename to src/convert/meshutils.cpp diff --git a/AssimpToMesh/src/convert/skeletalanimated.cpp b/src/convert/skeletalanimated.cpp similarity index 100% rename from AssimpToMesh/src/convert/skeletalanimated.cpp rename to src/convert/skeletalanimated.cpp diff --git a/AssimpToMesh/src/convert/static.cpp b/src/convert/static.cpp similarity index 100% rename from AssimpToMesh/src/convert/static.cpp rename to src/convert/static.cpp diff --git a/AssimpToMesh/src/convert/submesh.h b/src/convert/submesh.h similarity index 100% rename from AssimpToMesh/src/convert/submesh.h rename to src/convert/submesh.h diff --git a/AssimpToMesh/src/main.cpp b/src/main.cpp similarity index 100% rename from AssimpToMesh/src/main.cpp rename to src/main.cpp diff --git a/AssimpToMesh/src/nodetree/nodetree.cpp b/src/nodetree/nodetree.cpp similarity index 100% rename from AssimpToMesh/src/nodetree/nodetree.cpp rename to src/nodetree/nodetree.cpp diff --git a/AssimpToMesh/src/nodetree/nodetree.h b/src/nodetree/nodetree.h similarity index 100% rename from AssimpToMesh/src/nodetree/nodetree.h rename to src/nodetree/nodetree.h diff --git a/AssimpToMesh/src/utils/fileutils.cpp b/src/utils/fileutils.cpp similarity index 100% rename from AssimpToMesh/src/utils/fileutils.cpp rename to src/utils/fileutils.cpp diff --git a/AssimpToMesh/src/utils/utils.h b/src/utils/utils.h similarity index 100% rename from AssimpToMesh/src/utils/utils.h rename to src/utils/utils.h