mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 09:52:27 -04:00
Merge branch 'release/1.10.x'
This commit is contained in:
commit
390abac276
@ -135,7 +135,7 @@ macOS
|
|||||||
-----
|
-----
|
||||||
|
|
||||||
On macOS, you will need to download a set of precompiled thirdparty packages in order to
|
On macOS, you will need to download a set of precompiled thirdparty packages in order to
|
||||||
compile Panda3D, which can be acquired from [here](https://www.panda3d.org/download/panda3d-1.10.4.1/panda3d-1.10.4.1-tools-mac.tar.gz).
|
compile Panda3D, which can be acquired from [here](https://www.panda3d.org/download/panda3d-1.10.5/panda3d-1.10.5-tools-mac.tar.gz).
|
||||||
|
|
||||||
After placing the thirdparty directory inside the panda3d source directory,
|
After placing the thirdparty directory inside the panda3d source directory,
|
||||||
you may build Panda3D using a command like the following:
|
you may build Panda3D using a command like the following:
|
||||||
|
3
direct/src/dist/commands.py
vendored
3
direct/src/dist/commands.py
vendored
@ -240,6 +240,9 @@ class build_apps(setuptools.Command):
|
|||||||
'macosx_10_6_x86_64',
|
'macosx_10_6_x86_64',
|
||||||
'win_amd64',
|
'win_amd64',
|
||||||
]
|
]
|
||||||
|
if sys.version_info >= (3, 8):
|
||||||
|
# This version of Python is only available for 10.9+.
|
||||||
|
self.platforms[1] = 'macosx_10_9_x86_64'
|
||||||
self.plugins = []
|
self.plugins = []
|
||||||
self.embed_prc_data = True
|
self.embed_prc_data = True
|
||||||
self.extra_prc_files = []
|
self.extra_prc_files = []
|
||||||
|
@ -304,6 +304,7 @@ class StreamIOWrapper(io.IOBase):
|
|||||||
self.__stream.clear() # clear eof flag
|
self.__stream.clear() # clear eof flag
|
||||||
self.__write(b)
|
self.__write(b)
|
||||||
self.__lastWrite = True
|
self.__lastWrite = True
|
||||||
|
return len(b)
|
||||||
|
|
||||||
def writelines(self, lines):
|
def writelines(self, lines):
|
||||||
if not self.__writer:
|
if not self.__writer:
|
||||||
|
@ -277,3 +277,8 @@ if (__name__ == "__main__"):
|
|||||||
outputdir=options.outputdir,
|
outputdir=options.outputdir,
|
||||||
python_versions=ReadPythonVersionInfoFile())
|
python_versions=ReadPythonVersionInfoFile())
|
||||||
print("Installation finished!")
|
print("Installation finished!")
|
||||||
|
|
||||||
|
if not destdir:
|
||||||
|
warn_prefix = "%sNote:%s " % (GetColor("red"), GetColor())
|
||||||
|
print(warn_prefix + "You may need to call this command to update the library cache:")
|
||||||
|
print(" sudo ldconfig")
|
||||||
|
@ -837,6 +837,7 @@ if (COMPILER=="GCC"):
|
|||||||
PkgDisable("OPENCV")
|
PkgDisable("OPENCV")
|
||||||
|
|
||||||
if GetTarget() == "darwin" and not PkgSkip("OPENAL"):
|
if GetTarget() == "darwin" and not PkgSkip("OPENAL"):
|
||||||
|
LibName("OPENAL", "-framework AudioUnit")
|
||||||
LibName("OPENAL", "-framework AudioToolbox")
|
LibName("OPENAL", "-framework AudioToolbox")
|
||||||
LibName("OPENAL", "-framework CoreAudio")
|
LibName("OPENAL", "-framework CoreAudio")
|
||||||
|
|
||||||
@ -1896,6 +1897,8 @@ def CompileRsrc(target, src, opts):
|
|||||||
ipath = GetListOption(opts, "DIR:")
|
ipath = GetListOption(opts, "DIR:")
|
||||||
if os.path.isfile("/usr/bin/Rez"):
|
if os.path.isfile("/usr/bin/Rez"):
|
||||||
cmd = "Rez -useDF"
|
cmd = "Rez -useDF"
|
||||||
|
elif os.path.isfile("/Library/Developer/CommandLineTools/usr/bin/Rez"):
|
||||||
|
cmd = "/Library/Developer/CommandLineTools/usr/bin/Rez -useDF"
|
||||||
else:
|
else:
|
||||||
cmd = "/Developer/Tools/Rez -useDF"
|
cmd = "/Developer/Tools/Rez -useDF"
|
||||||
cmd += " -o " + BracketNameWithQuotes(target)
|
cmd += " -o " + BracketNameWithQuotes(target)
|
||||||
|
@ -1690,18 +1690,20 @@ def SmartPkgEnable(pkg, pkgconfig = None, libs = None, incs = None, defs = None,
|
|||||||
LibName(target_pkg, "-framework " + framework)
|
LibName(target_pkg, "-framework " + framework)
|
||||||
return
|
return
|
||||||
|
|
||||||
if os.path.isdir(os.path.join(pkg_dir, "include")):
|
inc_dir = os.path.join(pkg_dir, "include")
|
||||||
IncDirectory(target_pkg, os.path.join(pkg_dir, "include"))
|
if os.path.isdir(inc_dir):
|
||||||
|
IncDirectory(target_pkg, inc_dir)
|
||||||
|
|
||||||
# Handle cases like freetype2 where the include dir is a subdir under "include"
|
# Handle cases like freetype2 where the include dir is a subdir under "include"
|
||||||
for i in incs:
|
for i in incs:
|
||||||
if os.path.isdir(os.path.join(pkg_dir, "include", i)):
|
if os.path.isdir(os.path.join(inc_dir, i)):
|
||||||
IncDirectory(target_pkg, os.path.join(pkg_dir, "include", i))
|
IncDirectory(target_pkg, os.path.join(inc_dir, i))
|
||||||
|
|
||||||
lpath = [os.path.join(pkg_dir, "lib")]
|
lib_dir = os.path.join(pkg_dir, "lib")
|
||||||
|
lpath = [lib_dir]
|
||||||
|
|
||||||
if not PkgSkip("PYTHON"):
|
if not PkgSkip("PYTHON"):
|
||||||
py_lib_dir = os.path.join(pkg_dir, "lib", SDK["PYTHONVERSION"])
|
py_lib_dir = os.path.join(lib_dir, SDK["PYTHONVERSION"])
|
||||||
if os.path.isdir(py_lib_dir):
|
if os.path.isdir(py_lib_dir):
|
||||||
lpath.append(py_lib_dir)
|
lpath.append(py_lib_dir)
|
||||||
|
|
||||||
@ -2383,7 +2385,9 @@ def SdkLocateMacOSX(osxtarget = None):
|
|||||||
if (GetHost() != "darwin"): return
|
if (GetHost() != "darwin"): return
|
||||||
if (osxtarget != None):
|
if (osxtarget != None):
|
||||||
sdkname = "MacOSX%d.%d" % osxtarget
|
sdkname = "MacOSX%d.%d" % osxtarget
|
||||||
if (os.path.exists("/Developer/SDKs/%su.sdk" % sdkname)):
|
if (os.path.exists("/Library/Developer/CommandLineTools/SDKs/%s.sdk" % sdkname)):
|
||||||
|
SDK["MACOSX"] = "/Library/Developer/CommandLineTools/SDKs/%s.sdk" % sdkname
|
||||||
|
elif (os.path.exists("/Developer/SDKs/%su.sdk" % sdkname)):
|
||||||
SDK["MACOSX"] = "/Developer/SDKs/%su.sdk" % sdkname
|
SDK["MACOSX"] = "/Developer/SDKs/%su.sdk" % sdkname
|
||||||
elif (os.path.exists("/Developer/SDKs/%s.sdk" % sdkname)):
|
elif (os.path.exists("/Developer/SDKs/%s.sdk" % sdkname)):
|
||||||
SDK["MACOSX"] = "/Developer/SDKs/%s.sdk" % sdkname
|
SDK["MACOSX"] = "/Developer/SDKs/%s.sdk" % sdkname
|
||||||
|
@ -364,7 +364,7 @@ init_device() {
|
|||||||
|
|
||||||
// Try to detect which type of device we have here
|
// Try to detect which type of device we have here
|
||||||
if (_device_class == DeviceClass::unknown) {
|
if (_device_class == DeviceClass::unknown) {
|
||||||
int device_scores[(size_t)DeviceClass::spatial_mouse] = {0};
|
int device_scores[(size_t)DeviceClass::digitizer + 1] = {0};
|
||||||
|
|
||||||
// Test for specific keys
|
// Test for specific keys
|
||||||
if (test_bit(BTN_GAMEPAD, keys) && test_bit(ABS_X, axes) && test_bit(ABS_RX, axes)) {
|
if (test_bit(BTN_GAMEPAD, keys) && test_bit(ABS_X, axes) && test_bit(ABS_RX, axes)) {
|
||||||
@ -385,6 +385,9 @@ init_device() {
|
|||||||
if (test_bit(BTN_MOUSE, keys) && test_bit(EV_REL, evtypes)) {
|
if (test_bit(BTN_MOUSE, keys) && test_bit(EV_REL, evtypes)) {
|
||||||
device_scores[(size_t)DeviceClass::mouse] += 20;
|
device_scores[(size_t)DeviceClass::mouse] += 20;
|
||||||
}
|
}
|
||||||
|
if (test_bit(BTN_DIGI, keys) && test_bit(EV_ABS, evtypes)) {
|
||||||
|
device_scores[(size_t)DeviceClass::digitizer] += 20;
|
||||||
|
}
|
||||||
uint8_t unknown_keys[] = {KEY_POWER};
|
uint8_t unknown_keys[] = {KEY_POWER};
|
||||||
for (int i = 0; i < 1; i++) {
|
for (int i = 0; i < 1; i++) {
|
||||||
if (test_bit(unknown_keys[i], keys)) {
|
if (test_bit(unknown_keys[i], keys)) {
|
||||||
@ -424,7 +427,7 @@ init_device() {
|
|||||||
|
|
||||||
// Check which device type got the most points
|
// Check which device type got the most points
|
||||||
int highest_score = 0;
|
int highest_score = 0;
|
||||||
for (size_t i = 0; i < (size_t)DeviceClass::spatial_mouse; i++) {
|
for (size_t i = 0; i <= (size_t)DeviceClass::digitizer; i++) {
|
||||||
if (device_scores[i] > highest_score) {
|
if (device_scores[i] > highest_score) {
|
||||||
highest_score = device_scores[i];
|
highest_score = device_scores[i];
|
||||||
_device_class = (DeviceClass)i;
|
_device_class = (DeviceClass)i;
|
||||||
@ -619,6 +622,9 @@ init_device() {
|
|||||||
have_analog_triggers = true;
|
have_analog_triggers = true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case ABS_PRESSURE:
|
||||||
|
axis = InputDevice::Axis::pressure;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check the initial value and ranges.
|
// Check the initial value and ranges.
|
||||||
@ -630,7 +636,8 @@ init_device() {
|
|||||||
// Also T.Flight Hotas X throttle is reversed and can go backwards.
|
// Also T.Flight Hotas X throttle is reversed and can go backwards.
|
||||||
if (axis == Axis::yaw || axis == Axis::rudder || axis == Axis::left_y || axis == Axis::right_y ||
|
if (axis == Axis::yaw || axis == Axis::rudder || axis == Axis::left_y || axis == Axis::right_y ||
|
||||||
(axis == Axis::throttle && (quirks & QB_reversed_throttle) != 0) ||
|
(axis == Axis::throttle && (quirks & QB_reversed_throttle) != 0) ||
|
||||||
(_device_class == DeviceClass::spatial_mouse && (axis == Axis::y || axis == Axis::z || axis == Axis::roll))) {
|
(_device_class == DeviceClass::spatial_mouse && (axis == Axis::y || axis == Axis::z || axis == Axis::roll)) ||
|
||||||
|
(_device_class == DeviceClass::digitizer && axis == Axis::y)) {
|
||||||
std::swap(absinfo.maximum, absinfo.minimum);
|
std::swap(absinfo.maximum, absinfo.minimum);
|
||||||
}
|
}
|
||||||
if (axis == Axis::throttle && (quirks & QB_centered_throttle) != 0) {
|
if (axis == Axis::throttle && (quirks & QB_centered_throttle) != 0) {
|
||||||
|
@ -578,6 +578,9 @@ format_device_class(DeviceClass dc) {
|
|||||||
|
|
||||||
case InputDevice::DeviceClass::spatial_mouse:
|
case InputDevice::DeviceClass::spatial_mouse:
|
||||||
return "spatial_mouse";
|
return "spatial_mouse";
|
||||||
|
|
||||||
|
case InputDevice::DeviceClass::digitizer:
|
||||||
|
return "digitizer";
|
||||||
}
|
}
|
||||||
return "**invalid**";
|
return "**invalid**";
|
||||||
}
|
}
|
||||||
@ -644,6 +647,9 @@ format_axis(Axis axis) {
|
|||||||
|
|
||||||
case InputDevice::Axis::brake:
|
case InputDevice::Axis::brake:
|
||||||
return "brake";
|
return "brake";
|
||||||
|
|
||||||
|
case InputDevice::Axis::pressure:
|
||||||
|
return "pressure";
|
||||||
}
|
}
|
||||||
return "**invalid**";
|
return "**invalid**";
|
||||||
}
|
}
|
||||||
|
@ -80,6 +80,9 @@ PUBLISHED:
|
|||||||
|
|
||||||
// 3D mouse, such as produced by 3Dconnexion.
|
// 3D mouse, such as produced by 3Dconnexion.
|
||||||
spatial_mouse,
|
spatial_mouse,
|
||||||
|
|
||||||
|
// A graphics tablet with stylus/pen.
|
||||||
|
digitizer,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum class Feature {
|
enum class Feature {
|
||||||
@ -128,6 +131,9 @@ PUBLISHED:
|
|||||||
wheel,
|
wheel,
|
||||||
accelerator,
|
accelerator,
|
||||||
brake,
|
brake,
|
||||||
|
|
||||||
|
// Pen pressure
|
||||||
|
pressure,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum State {
|
enum State {
|
||||||
|
@ -28,6 +28,7 @@ typedef USHORT USAGE, *PUSAGE;
|
|||||||
#define HID_USAGE_PAGE_KEYBOARD ((USAGE) 0x07)
|
#define HID_USAGE_PAGE_KEYBOARD ((USAGE) 0x07)
|
||||||
#define HID_USAGE_PAGE_LED ((USAGE) 0x08)
|
#define HID_USAGE_PAGE_LED ((USAGE) 0x08)
|
||||||
#define HID_USAGE_PAGE_BUTTON ((USAGE) 0x09)
|
#define HID_USAGE_PAGE_BUTTON ((USAGE) 0x09)
|
||||||
|
#define HID_USAGE_PAGE_DIGITIZER ((USAGE) 0x0d)
|
||||||
|
|
||||||
#define HID_USAGE_GENERIC_POINTER ((USAGE) 0x01)
|
#define HID_USAGE_GENERIC_POINTER ((USAGE) 0x01)
|
||||||
#define HID_USAGE_GENERIC_MOUSE ((USAGE) 0x02)
|
#define HID_USAGE_GENERIC_MOUSE ((USAGE) 0x02)
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
#include "winInputDeviceManager.h"
|
#include "winInputDeviceManager.h"
|
||||||
#include "winRawInputDevice.h"
|
#include "winRawInputDevice.h"
|
||||||
#include "throw_event.h"
|
#include "throw_event.h"
|
||||||
|
#include "phidsdi.h"
|
||||||
|
|
||||||
#if defined(_WIN32) && !defined(CPPPARSER)
|
#if defined(_WIN32) && !defined(CPPPARSER)
|
||||||
|
|
||||||
@ -385,7 +386,7 @@ setup_message_loop() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Now listen for raw input devices using the created message loop.
|
// Now listen for raw input devices using the created message loop.
|
||||||
RAWINPUTDEVICE rid[3];
|
RAWINPUTDEVICE rid[4];
|
||||||
rid[0].usUsagePage = 1;
|
rid[0].usUsagePage = 1;
|
||||||
rid[0].usUsage = 4; // Joysticks
|
rid[0].usUsage = 4; // Joysticks
|
||||||
rid[0].dwFlags = RIDEV_DEVNOTIFY | RIDEV_INPUTSINK;
|
rid[0].dwFlags = RIDEV_DEVNOTIFY | RIDEV_INPUTSINK;
|
||||||
@ -398,7 +399,11 @@ setup_message_loop() {
|
|||||||
rid[2].usUsage = 8; // Multi-axis controllers (including 3D mice)
|
rid[2].usUsage = 8; // Multi-axis controllers (including 3D mice)
|
||||||
rid[2].dwFlags = RIDEV_DEVNOTIFY | RIDEV_INPUTSINK;
|
rid[2].dwFlags = RIDEV_DEVNOTIFY | RIDEV_INPUTSINK;
|
||||||
rid[2].hwndTarget = _message_hwnd;
|
rid[2].hwndTarget = _message_hwnd;
|
||||||
if (!RegisterRawInputDevices(rid, 3, sizeof(RAWINPUTDEVICE))) {
|
rid[3].usUsagePage = HID_USAGE_PAGE_DIGITIZER;
|
||||||
|
rid[3].usUsage = 1; // Digitizers
|
||||||
|
rid[3].dwFlags = RIDEV_DEVNOTIFY | RIDEV_INPUTSINK;
|
||||||
|
rid[3].hwndTarget = _message_hwnd;
|
||||||
|
if (!RegisterRawInputDevices(rid, 4, sizeof(RAWINPUTDEVICE))) {
|
||||||
device_cat.warning()
|
device_cat.warning()
|
||||||
<< "Failed to register raw input devices.\n";
|
<< "Failed to register raw input devices.\n";
|
||||||
}
|
}
|
||||||
|
@ -199,6 +199,11 @@ on_arrival(HANDLE handle, const RID_DEVICE_INFO &info, std::string name) {
|
|||||||
info.hid.usUsage == HID_USAGE_GENERIC_KEYBOARD) {
|
info.hid.usUsage == HID_USAGE_GENERIC_KEYBOARD) {
|
||||||
_device_class = DeviceClass::keyboard;
|
_device_class = DeviceClass::keyboard;
|
||||||
|
|
||||||
|
// Digitizers
|
||||||
|
} else if (info.hid.usUsagePage == HID_USAGE_PAGE_DIGITIZER &&
|
||||||
|
info.hid.usUsage == 1) {
|
||||||
|
_device_class = DeviceClass::digitizer;
|
||||||
|
|
||||||
// 3Dconnexion SpaceNavigator and friends.
|
// 3Dconnexion SpaceNavigator and friends.
|
||||||
} else if (_vendor_id == 0x046d &&
|
} else if (_vendor_id == 0x046d &&
|
||||||
(_product_id == 0xc623 ||
|
(_product_id == 0xc623 ||
|
||||||
@ -504,6 +509,14 @@ on_arrival(HANDLE handle, const RID_DEVICE_INFO &info, std::string name) {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case HID_USAGE_PAGE_DIGITIZER:
|
||||||
|
switch (usage) {
|
||||||
|
case 0x30:
|
||||||
|
axis = Axis::pressure;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If this axis already exists, don't double-map it, but take the first
|
// If this axis already exists, don't double-map it, but take the first
|
||||||
|
Loading…
x
Reference in New Issue
Block a user