Browse Source

Merge pull request #36 from Moguri/assimp

Changes to makepanda to compile with Assimp
rdb 10 years ago
parent
commit
cf7ae935a0

+ 13 - 1
makepanda/makepanda.py

@@ -87,7 +87,7 @@ PkgListSet(["PYTHON", "DIRECT",                        # Python support
   "ODE", "PHYSX", "BULLET", "PANDAPHYSICS",            # Physics
   "SPEEDTREE",                                         # SpeedTree
   "ZLIB", "PNG", "JPEG", "TIFF", "SQUISH", "FREETYPE", # 2D Formats support
-  ] + MAYAVERSIONS + MAXVERSIONS + [ "FCOLLADA",       # 3D Formats support
+  ] + MAYAVERSIONS + MAXVERSIONS + [ "FCOLLADA", "ASSIMP", # 3D Formats support
   "VRPN", "OPENSSL",                                   # Transport
   "FFTW",                                              # Algorithm helpers
   "ARTOOLKIT", "OPENCV", "DIRECTCAM", "VISION",        # Augmented Reality
@@ -595,6 +595,7 @@ if (COMPILER == "MSVC"):
     if (PkgSkip("FFTW")==0):     LibName("FFTW",     GetThirdpartyDir() + "fftw/lib/fftw.lib")
     if (PkgSkip("ARTOOLKIT")==0):LibName("ARTOOLKIT",GetThirdpartyDir() + "artoolkit/lib/libAR.lib")
     if (PkgSkip("FCOLLADA")==0): LibName("FCOLLADA", GetThirdpartyDir() + "fcollada/lib/FCollada.lib")
+    if (PkgSkip("ASSIMP")==0):   PkgDisable("ASSIMP")  # Not yet supported
     if (PkgSkip("OPENCV")==0):   LibName("OPENCV",   GetThirdpartyDir() + "opencv/lib/cv.lib")
     if (PkgSkip("OPENCV")==0):   LibName("OPENCV",   GetThirdpartyDir() + "opencv/lib/highgui.lib")
     if (PkgSkip("OPENCV")==0):   LibName("OPENCV",   GetThirdpartyDir() + "opencv/lib/cvaux.lib")
@@ -737,6 +738,7 @@ if (COMPILER=="GCC"):
         SmartPkgEnable("EIGEN",     "eigen3",    (), ("Eigen/Dense",), target_pkg = 'ALWAYS')
         SmartPkgEnable("ARTOOLKIT", "",          ("AR"), "AR/ar.h")
         SmartPkgEnable("FCOLLADA",  "",          ChooseLib(fcollada_libs, "FCOLLADA"), ("FCollada", "FCollada/FCollada.h"))
+        SmartPkgEnable("ASSIMP",    "assimp", ("assimp"), "assimp")
         SmartPkgEnable("FFMPEG",    ffmpeg_libs, ffmpeg_libs, ffmpeg_libs)
         SmartPkgEnable("SWSCALE",   "libswscale", "libswscale", ("libswscale", "libswscale/swscale.h"), target_pkg = "FFMPEG")
         SmartPkgEnable("SWRESAMPLE","libswresample", "libswresample", ("libswresample", "libswresample/swresample.h"), target_pkg = "FFMPEG")
@@ -5217,6 +5219,16 @@ if (PkgSkip("PANDATOOL")==0 and PkgSkip("FCOLLADA")==0):
   TargetAdd('libp3daeegg.lib', input='p3daeegg_composite1.obj')
   TargetAdd('libp3daeegg.lib', opts=['FCOLLADA', 'CARBON'])
 
+#
+# DIRECTORY: pandatool/src/assimp
+#
+if (PkgSkip("PANDATOOL") == 0 and PkgSkip("ASSIMP")==0):
+  OPTS=['DIR:pandatool/src/assimp', 'ASSIMP', 'MODULE']
+  TargetAdd('p3assimp_composite1.obj', opts=OPTS, input='p3assimp_composite1.cxx')
+  TargetAdd('libp3assimp.dll', input='p3assimp_composite1.obj')
+  TargetAdd('libp3assimp.dll', input=COMMON_PANDA_LIBS)
+  TargetAdd('libp3assimp.dll', opts=OPTS)
+
 #
 # DIRECTORY: pandatool/src/daeprogs/
 #

+ 1 - 1
pandatool/src/assimp/assimpLoader.cxx

@@ -36,7 +36,7 @@
 #include "pandaIOSystem.h"
 #include "pandaLogger.h"
 
-#include "aiPostProcess.h"
+#include "assimp/postprocess.h"
 
 ////////////////////////////////////////////////////////////////////
 //     Function: AssimpLoader::Constructor

+ 2 - 1
pandatool/src/assimp/assimpLoader.h

@@ -20,7 +20,8 @@
 #include "modelRoot.h"
 #include "texture.h"
 
-#include "aiScene.h"
+#include "assimp/scene.h"
+#include "assimp/Importer.hpp"
 
 ////////////////////////////////////////////////////////////////////
 //       Class : AssimpLoader

+ 0 - 2
pandatool/src/assimp/config_assimp.h

@@ -17,8 +17,6 @@
 
 #include "pandatoolbase.h"
 
-#include "assimp.hpp"
-
 #include "dconfig.h"
 
 ConfigureDecl(config_assimp, EXPCL_ASSIMP, EXPTP_ASSIMP);

+ 7 - 0
pandatool/src/assimp/p3assimp_composite1.cxx

@@ -0,0 +1,7 @@
+
+#include "config_assimp.cxx"
+#include "assimpLoader.cxx"
+#include "loaderFileTypeAssimp.cxx"
+#include "pandaIOStream.cxx"
+#include "pandaIOSystem.cxx"
+#include "pandaLogger.cxx"

+ 1 - 1
pandatool/src/assimp/pandaIOStream.h

@@ -17,7 +17,7 @@
 
 #include "config_assimp.h"
 
-#include "IOStream.h"
+#include "assimp/IOStream.hpp"
 
 class PandaIOSystem;
 

+ 1 - 1
pandatool/src/assimp/pandaIOSystem.h

@@ -18,7 +18,7 @@
 #include "config_assimp.h"
 #include "virtualFileSystem.h"
 
-#include "IOSystem.h"
+#include "assimp/IOSystem.hpp"
 
 ////////////////////////////////////////////////////////////////////
 //       Class : PandaIOSystem

+ 1 - 1
pandatool/src/assimp/pandaLogger.cxx

@@ -14,7 +14,7 @@
 
 #include "pandaLogger.h"
 
-#include "DefaultLogger.h"
+#include "assimp/DefaultLogger.hpp"
 
 PandaLogger *PandaLogger::_ptr = NULL;
 

+ 1 - 1
pandatool/src/assimp/pandaLogger.h

@@ -17,7 +17,7 @@
 
 #include "config_assimp.h"
 
-#include "Logger.h"
+#include "assimp/Logger.hpp"
 
 ////////////////////////////////////////////////////////////////////
 //       Class : PandaLogger