Browse Source

Merge branch 'release/1.10.x'

rdb 6 years ago
parent
commit
2574d85049

+ 1 - 1
makepanda/config.in

@@ -31,7 +31,7 @@ fullscreen #f
 
 # The framebuffer-hardware flag forces it to use an accelerated driver.
 # The framebuffer-software flag forces it to use a software renderer.
-# If you don't set either, it will use whatever's available.
+# If you set both to false, it will use whatever's available.
 
 framebuffer-hardware #t
 framebuffer-software #f

+ 2 - 1
makepanda/makepanda.py

@@ -863,13 +863,14 @@ if (COMPILER=="GCC"):
     fcollada_libs = ("FColladaD", "FColladaSD", "FColladaS")
     # WARNING! The order of the ffmpeg libraries matters!
     ffmpeg_libs = ("libavformat", "libavcodec", "libavutil")
+    assimp_libs = ("libassimp", "libassimpd")
 
     #         Name         pkg-config   libs, include(dir)s
     if (not RUNTIME):
         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/Importer.hpp")
+        SmartPkgEnable("ASSIMP",    "assimp",    ChooseLib(assimp_libs, "ASSIMP"), "assimp/Importer.hpp")
         SmartPkgEnable("FFMPEG",    ffmpeg_libs, ffmpeg_libs, ("libavformat/avformat.h", "libavcodec/avcodec.h", "libavutil/avutil.h"))
         SmartPkgEnable("SWSCALE",   "libswscale", "libswscale", ("libswscale/swscale.h"), target_pkg = "FFMPEG", thirdparty_dir = "ffmpeg")
         SmartPkgEnable("SWRESAMPLE","libswresample", "libswresample", ("libswresample/swresample.h"), target_pkg = "FFMPEG", thirdparty_dir = "ffmpeg")

+ 1 - 0
panda/src/collide/collisionNode.cxx

@@ -58,6 +58,7 @@ CollisionNode::
 CollisionNode(const CollisionNode &copy) :
   PandaNode(copy),
   _from_collide_mask(copy._from_collide_mask),
+  _collider_sort(copy._collider_sort),
   _solids(copy._solids)
 {
 }

+ 8 - 2
panda/src/gobj/geomVertexColumn.cxx

@@ -258,7 +258,12 @@ make_packer() const {
         case 3:
           return new Packer_point_nativefloat_3;
         case 4:
-          return new Packer_point_nativefloat_4;
+          // Reader may assume 16-byte alignment.
+          if ((get_start() & 0xf) == 0) {
+            return new Packer_point_nativefloat_4;
+          } else {
+            return new Packer_point_float32_4;
+          }
         }
       } else {
         switch (get_num_components()) {
@@ -309,7 +314,8 @@ make_packer() const {
         return new Packer_argb_packed;
 
       case NT_float32:
-        if (sizeof(float) == sizeof(PN_float32)) {
+        if (sizeof(float) == sizeof(PN_float32) &&
+            (get_start() & 0xf) == 0) {
           // Use the native float type implementation for a tiny bit more
           // optimization.
           return new Packer_rgba_nativefloat_4;

+ 2 - 0
panda/src/pgraphnodes/sequenceNode.h

@@ -35,6 +35,8 @@ PUBLISHED:
   virtual int get_num_frames() const;
   INLINE void set_frame_rate(double frame_rate);
 
+  MAKE_PROPERTY(frame_rate, get_frame_rate, set_frame_rate);
+
 public:
   virtual PandaNode *make_copy() const;
   virtual bool safe_to_combine() const;

+ 2 - 0
panda/src/x11display/x11GraphicsWindow.cxx

@@ -1976,6 +1976,8 @@ get_keyboard_map() const {
   // XkbGetMap(_display, XkbAllMapComponentsMask, XkbUseCoreKbd);
   ButtonMap *map = new ButtonMap;
 
+  LightReMutexHolder holder(x11GraphicsPipe::_x_mutex);
+
   for (int k = 9; k <= 135; ++k) {
     ButtonHandle raw_button = map_raw_button(k);
     if (raw_button == ButtonHandle::none()) {

+ 25 - 10
pandatool/src/assimp/loaderFileTypeAssimp.cxx

@@ -15,6 +15,8 @@
 #include "config_assimp.h"
 #include "assimpLoader.h"
 
+#include <assimp/cimport.h>
+
 using std::string;
 
 TypeHandle LoaderFileTypeAssimp::_type_handle;
@@ -23,7 +25,7 @@ TypeHandle LoaderFileTypeAssimp::_type_handle;
  *
  */
 LoaderFileTypeAssimp::
-LoaderFileTypeAssimp() : _loader(new AssimpLoader) {
+LoaderFileTypeAssimp() : _loader(nullptr) {
 }
 
 /**
@@ -31,9 +33,6 @@ LoaderFileTypeAssimp() : _loader(new AssimpLoader) {
  */
 LoaderFileTypeAssimp::
 ~LoaderFileTypeAssimp() {
-  if (_loader != nullptr) {
-    delete _loader;
-  }
 }
 
 /**
@@ -58,9 +57,22 @@ get_extension() const {
  */
 string LoaderFileTypeAssimp::
 get_additional_extensions() const {
-  string exts;
-  _loader->get_extensions(exts);
-  return exts;
+  aiString aexts;
+  aiGetExtensionList(&aexts);
+
+  // The format is like: *.mdc;*.mdl;*.mesh.xml;*.mot
+  std::string ext;
+  char *sub = strtok(aexts.data, ";");
+  while (sub != nullptr) {
+    ext += sub + 2;
+    sub = strtok(nullptr, ";");
+
+    if (sub != nullptr) {
+      ext += ' ';
+    }
+  }
+
+  return ext;
 }
 
 /**
@@ -82,10 +94,13 @@ load_file(const Filename &path, const LoaderOptions &options,
   assimp_cat.info()
     << "Reading " << path << "\n";
 
-  if (!_loader->read(path)) {
+  AssimpLoader loader;
+  loader.local_object();
+
+  if (!loader.read(path)) {
     return nullptr;
   }
 
-  _loader->build_graph();
-  return DCAST(PandaNode, _loader->_root);
+  loader.build_graph();
+  return DCAST(PandaNode, loader._root);
 }