Browse Source

Merge branch 'release/1.10.x'

rdb 5 years ago
parent
commit
9fb60b18e7

+ 2 - 1
makepanda/makepanda.py

@@ -177,6 +177,7 @@ def parseopts(args):
         "static","debversion=","rpmrelease=","p3dsuffix=","rtdist-version=",
         "static","debversion=","rpmrelease=","p3dsuffix=","rtdist-version=",
         "directx-sdk=", "windows-sdk=", "msvc-version=", "clean", "use-icl",
         "directx-sdk=", "windows-sdk=", "msvc-version=", "clean", "use-icl",
         "target=", "arch=", "git-commit=", "no-copy-python",
         "target=", "arch=", "git-commit=", "no-copy-python",
+        "cggl-incdir=", "cggl-libdir=",
         ] + removedopts
         ] + removedopts
 
 
     anything = 0
     anything = 0
@@ -239,7 +240,7 @@ def parseopts(args):
             elif (option[2:] in removedopts):
             elif (option[2:] in removedopts):
                 Warn("Ignoring removed option %s" % (option))
                 Warn("Ignoring removed option %s" % (option))
             else:
             else:
-                for pkg in PkgListGet():
+                for pkg in PkgListGet() + ['CGGL']:
                     if option == "--use-" + pkg.lower():
                     if option == "--use-" + pkg.lower():
                         PkgEnable(pkg)
                         PkgEnable(pkg)
                         break
                         break

+ 1 - 2
panda/src/express/virtualFileSystem.cxx

@@ -497,8 +497,7 @@ make_directory_full(const Filename &filename) {
   // Now make the last one, and check the return value.
   // Now make the last one, and check the return value.
   PT(VirtualFile) result = do_get_file(filename, OF_make_directory);
   PT(VirtualFile) result = do_get_file(filename, OF_make_directory);
   _lock.unlock();
   _lock.unlock();
-  nassertr_always(result != nullptr, false);
-  return result->is_directory();
+  return (result != nullptr) ? result->is_directory() : false;
 }
 }
 
 
 /**
 /**

+ 12 - 1
panda/src/pgraphnodes/shaderGenerator.cxx

@@ -1241,12 +1241,23 @@ synthesize_shader(const RenderState *rs, const GeomVertexAnimationSpec &anim) {
       const ShaderKey::TextureInfo &tex = key._textures[i];
       const ShaderKey::TextureInfo &tex = key._textures[i];
       if (tex._flags & ShaderKey::TF_map_normal) {
       if (tex._flags & ShaderKey::TF_map_normal) {
         if (is_first) {
         if (is_first) {
-          text << "\t float3 tsnormal = normalize((tex" << i << ".xyz * 2) - 1);\n";
+          if (tex._flags & ShaderKey::TF_has_texscale) {
+            text << "\t float3 tsnormal = normalize(((tex" << i << ".xyz * 2) - 1) * texscale_" << i << ");\n";
+          } else if (tex._flags & ShaderKey::TF_has_texmat) {
+            text << "\t float3 tsnormal = normalize(mul(texmat_" << i << ", float4((tex" << i << ".xyz * 2) - 1, 0)).xyz);\n";
+          } else {
+            text << "\t float3 tsnormal = normalize((tex" << i << ".xyz * 2) - 1);\n";
+          }
           is_first = false;
           is_first = false;
           continue;
           continue;
         }
         }
         text << "\t tsnormal.z += 1;\n";
         text << "\t tsnormal.z += 1;\n";
         text << "\t float3 tmp" << i << " = tex" << i << ".xyz * float3(-2, -2, 2) + float3(1, 1, -1);\n";
         text << "\t float3 tmp" << i << " = tex" << i << ".xyz * float3(-2, -2, 2) + float3(1, 1, -1);\n";
+        if (tex._flags & ShaderKey::TF_has_texscale) {
+          text << "\t tmp" << i << " *= texscale_" << i << ";\n";
+        } else if (tex._flags & ShaderKey::TF_has_texmat) {
+          text << "\t tmp" << i << " = mul(texmat_" << i << ", float4(tmp" << i << ", 0)).xyz;\n";
+        }
         text << "\t tsnormal = normalize(tsnormal * dot(tsnormal, tmp" << i << ") - tmp" << i << " * tsnormal.z);\n";
         text << "\t tsnormal = normalize(tsnormal * dot(tsnormal, tmp" << i << ") - tmp" << i << " * tsnormal.z);\n";
       }
       }
     }
     }

+ 8 - 2
panda/src/putil/bamCache.cxx

@@ -133,10 +133,16 @@ set_root(const Filename &root) {
   delete _index;
   delete _index;
   _index = new BamCacheIndex;
   _index = new BamCacheIndex;
   _index_stale_since = 0;
   _index_stale_since = 0;
+
+  if (!vfs->is_directory(_root)) {
+    util_cat.error()
+      << "Unable to make directory " << _root << ", caching disabled.\n";
+    _active = false;
+    return;
+  }
+
   read_index();
   read_index();
   check_cache_size();
   check_cache_size();
-
-  nassertv(vfs->is_directory(_root));
 }
 }
 
 
 /**
 /**

+ 3 - 0
panda/src/tform/mouseWatcher.cxx

@@ -726,6 +726,9 @@ clear_current_regions() {
       MouseWatcherRegion *old_region = (*old_ri);
       MouseWatcherRegion *old_region = (*old_ri);
       old_region->exit_region(param);
       old_region->exit_region(param);
       throw_event_pattern(_leave_pattern, old_region, ButtonHandle::none());
       throw_event_pattern(_leave_pattern, old_region, ButtonHandle::none());
+      if (_preferred_region == old_region) {
+        _preferred_region = nullptr;
+      }
       ++old_ri;
       ++old_ri;
     }
     }
 
 

+ 29 - 1
panda/src/x11display/x11GraphicsWindow.cxx

@@ -330,7 +330,7 @@ process_events() {
 
 
         // We thought about not generating the keypress event, but we need
         // We thought about not generating the keypress event, but we need
         // that repeat for backspace.  Rethink later.
         // that repeat for backspace.  Rethink later.
-        handle_keypress(event.xkey);
+        handle_keyrepeat(event.xkey);
         continue;
         continue;
 
 
       } else {
       } else {
@@ -1537,6 +1537,34 @@ handle_keypress(XKeyEvent &event) {
   }
   }
 }
 }
 
 
+/**
+ * Generates a keyrepeat corresponding to the indicated X KeyPress event.
+ */
+void x11GraphicsWindow::
+handle_keyrepeat(XKeyEvent &event) {
+  if (_properties.get_mouse_mode() != WindowProperties::M_relative) {
+    _input->set_pointer_in_window(event.x, event.y);
+  }
+
+  // Now get the raw unshifted button.
+  ButtonHandle button = get_button(event, false);
+  if (button != ButtonHandle::none()) {
+    if (button == KeyboardButton::lcontrol() || button == KeyboardButton::rcontrol()) {
+      _input->button_down(KeyboardButton::control());
+    }
+    if (button == KeyboardButton::lshift() || button == KeyboardButton::rshift()) {
+      _input->button_down(KeyboardButton::shift());
+    }
+    if (button == KeyboardButton::lalt() || button == KeyboardButton::ralt()) {
+      _input->button_down(KeyboardButton::alt());
+    }
+    if (button == KeyboardButton::lmeta() || button == KeyboardButton::rmeta()) {
+      _input->button_down(KeyboardButton::meta());
+    }
+    _input->button_down(button);
+  }
+}
+
 /**
 /**
  * Generates a keyrelease corresponding to the indicated X KeyRelease event.
  * Generates a keyrelease corresponding to the indicated X KeyRelease event.
  */
  */

+ 1 - 0
panda/src/x11display/x11GraphicsWindow.h

@@ -59,6 +59,7 @@ protected:
   virtual void setup_colormap(XVisualInfo *visual);
   virtual void setup_colormap(XVisualInfo *visual);
   void handle_keystroke(XKeyEvent &event);
   void handle_keystroke(XKeyEvent &event);
   void handle_keypress(XKeyEvent &event);
   void handle_keypress(XKeyEvent &event);
+  void handle_keyrepeat(XKeyEvent &event);
   void handle_keyrelease(XKeyEvent &event);
   void handle_keyrelease(XKeyEvent &event);
 
 
   ButtonHandle get_button(XKeyEvent &key_event, bool allow_shift);
   ButtonHandle get_button(XKeyEvent &key_event, bool allow_shift);