Browse Source

Merge branch 'release/1.10.x'

rdb 3 years ago
parent
commit
e27162df0b

+ 6 - 1
makepanda/makepanda.py

@@ -639,9 +639,14 @@ if (COMPILER == "MSVC"):
         if os.path.isfile(GetThirdpartyDir() + "openssl/lib/libpandassl.lib"):
             LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/libpandassl.lib")
             LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/libpandaeay.lib")
-        else:
+        elif os.path.isfile(GetThirdpartyDir() + "openssl/lib/ssleay32.lib"):
             LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/libeay32.lib")
             LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/ssleay32.lib")
+        else:
+            LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/libssl.lib")
+            LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/libcrypto.lib")
+            LibName("OPENSSL", "crypt32.lib")
+            LibName("OPENSSL", "ws2_32.lib")
     if (PkgSkip("PNG")==0):
         if os.path.isfile(GetThirdpartyDir() + "png/lib/libpng16_static.lib"):
             LibName("PNG", GetThirdpartyDir() + "png/lib/libpng16_static.lib")

+ 6 - 3
panda/src/cocoadisplay/cocoaGraphicsWindow.mm

@@ -1929,11 +1929,14 @@ handle_wheel_event(double x, double y) {
     _input->button_up(MouseButton::wheel_down());
   }
 
-  // TODO: check if this is correct, I don't own a MacBook
-  if (x > 0.0) {
+  if (x != 0 && cocoa_invert_wheel_x) {
+    x = -x;
+  }
+
+  if (x < 0.0) {
     _input->button_down(MouseButton::wheel_right());
     _input->button_up(MouseButton::wheel_right());
-  } else if (x < 0.0) {
+  } else if (x > 0.0) {
     _input->button_down(MouseButton::wheel_left());
     _input->button_up(MouseButton::wheel_left());
   }

+ 2 - 0
panda/src/cocoadisplay/config_cocoadisplay.h

@@ -20,6 +20,8 @@
 
 NotifyCategoryDecl(cocoadisplay, EXPCL_PANDA_COCOADISPLAY, EXPTP_PANDA_COCOADISPLAY);
 
+extern ConfigVariableBool cocoa_invert_wheel_x;
+
 extern EXPCL_PANDA_COCOADISPLAY void init_libcocoadisplay();
 
 #endif

+ 5 - 0
panda/src/cocoadisplay/config_cocoadisplay.mm

@@ -31,6 +31,11 @@ ConfigureFn(config_cocoadisplay) {
   init_libcocoadisplay();
 }
 
+ConfigVariableBool cocoa_invert_wheel_x
+("cocoa-invert-wheel-x", false,
+ PRC_DESC("Set this to true to swap the wheel_left and wheel_right mouse "
+          "button events, to restore to the pre-1.10.12 behavior."));
+
 /**
  * Initializes the library.  This must be called at least once before any of
  * the functions or classes in this library can be used.  Normally it will be

+ 23 - 4
panda/src/device/ioKitInputDeviceManager.cxx

@@ -16,6 +16,18 @@
 
 #if defined(__APPLE__) && !defined(CPPPARSER)
 
+static ConfigVariableBool iokit_scan_mouse_devices
+("iokit-scan-mouse-devices", false,
+ PRC_DESC("Set this to true to enable capturing raw mouse data via IOKit on "
+          "macOS.  This is disabled by default because newer macOS versions "
+          "will prompt the user explicitly for permissions when this is on."));
+
+static ConfigVariableBool iokit_scan_keyboard_devices
+("iokit-scan-keyboard-devices", false,
+ PRC_DESC("Set this to true to enable capturing raw keyboard data via IOKit on "
+          "macOS.  This is disabled by default because newer macOS versions "
+          "will prompt the user explicitly for permissions when this is on."));
+
 /**
  * Initializes the input device manager by scanning which devices are currently
  * connected and setting up any platform-dependent structures necessary for
@@ -34,15 +46,22 @@ IOKitInputDeviceManager() {
   int page = kHIDPage_GenericDesktop;
   int usages[] = {kHIDUsage_GD_GamePad,
                   kHIDUsage_GD_Joystick,
-                  kHIDUsage_GD_Mouse,
-                  kHIDUsage_GD_Keyboard,
-                  kHIDUsage_GD_MultiAxisController, 0};
-  int *usage = usages;
+                  kHIDUsage_GD_MultiAxisController,
+                  0, 0, 0};
+
+  int num_usages = 3;
+  if (iokit_scan_mouse_devices) {
+    usages[num_usages++] = kHIDUsage_GD_Mouse;
+  }
+  if (iokit_scan_keyboard_devices) {
+    usages[num_usages++] = kHIDUsage_GD_Keyboard;
+  }
 
   // This giant mess is necessary to create an array of match dictionaries
   // that will match the devices we're interested in.
   CFMutableArrayRef match = CFArrayCreateMutable(kCFAllocatorDefault, 0, &kCFTypeArrayCallBacks);
   nassertv(match);
+  int *usage = usages;
   while (*usage) {
     CFMutableDictionaryRef dict = CFDictionaryCreateMutable(kCFAllocatorDefault, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
     CFNumberRef page_ref = CFNumberCreate(kCFAllocatorDefault, kCFNumberIntType, &page);

+ 14 - 0
panda/src/mathutil/plane_src.cxx

@@ -158,3 +158,17 @@ void FLOATNAME(LPlane)::
 write(std::ostream &out, int indent_level) const {
   indent(out, indent_level) << *this << "\n";
 }
+
+/**
+ * Returns a string representation of this LPlane.
+ */
+std::string FLOATNAME(LPlane)::
+__repr__() const {
+  std::ostringstream out;
+  out << "LPlane" << FLOATTOKEN << "("
+      << MAYBE_ZERO(_v(0)) << ", "
+      << MAYBE_ZERO(_v(1)) << ", "
+      << MAYBE_ZERO(_v(2)) << ", "
+      << MAYBE_ZERO(_v(3)) << ")";
+  return out.str();
+}

+ 1 - 0
panda/src/mathutil/plane_src.h

@@ -61,6 +61,7 @@ PUBLISHED:
 
   void output(std::ostream &out) const;
   void write(std::ostream &out, int indent_level = 0) const;
+  std::string __repr__() const;
 };
 
 INLINE_MATHUTIL std::ostream &