mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-27 15:25:54 -04:00
Merge branch 'release/1.10.x'
This commit is contained in:
commit
3598222977
@ -805,21 +805,25 @@ read_args() {
|
|||||||
#elif defined(IS_FREEBSD)
|
#elif defined(IS_FREEBSD)
|
||||||
// In FreeBSD, we can use sysctl to determine the command-line arguments.
|
// In FreeBSD, we can use sysctl to determine the command-line arguments.
|
||||||
|
|
||||||
size_t bufsize = 4096;
|
size_t bufsize = 0;
|
||||||
char buffer[4096];
|
|
||||||
int mib[4] = {CTL_KERN, KERN_PROC, KERN_PROC_ARGS, 0};
|
int mib[4] = {CTL_KERN, KERN_PROC, KERN_PROC_ARGS, 0};
|
||||||
mib[3] = getpid();
|
mib[3] = getpid();
|
||||||
if (sysctl(mib, 4, (void*) buffer, &bufsize, nullptr, 0) == -1) {
|
if (sysctl(mib, 4, nullptr, &bufsize, nullptr, 0) == -1) {
|
||||||
perror("sysctl");
|
perror("sysctl");
|
||||||
} else {
|
} else {
|
||||||
if (_binary_name.empty()) {
|
char *buffer = (char *)alloca(bufsize);
|
||||||
_binary_name = buffer;
|
if (sysctl(mib, 4, buffer, &bufsize, nullptr, 0) == -1) {
|
||||||
}
|
perror("sysctl");
|
||||||
size_t idx = strlen(buffer) + 1;
|
} else {
|
||||||
while (idx < bufsize) {
|
if (_binary_name.empty()) {
|
||||||
_args.push_back((char*)(buffer + idx));
|
_binary_name = buffer;
|
||||||
size_t newidx = strlen(buffer + idx);
|
}
|
||||||
idx += newidx + 1;
|
size_t idx = strlen(buffer) + 1;
|
||||||
|
while (idx < bufsize) {
|
||||||
|
_args.push_back((char*)(buffer + idx));
|
||||||
|
size_t newidx = strlen(buffer + idx);
|
||||||
|
idx += newidx + 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -527,8 +527,8 @@ test_intersection_from_sphere(const CollisionEntry &entry) const {
|
|||||||
max_dist = csqrt(max_dist_2);
|
max_dist = csqrt(max_dist_2);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dist > max_dist) {
|
if (dist > max_dist || -dist > max_dist) {
|
||||||
// There's no intersection: the sphere is hanging off the edge.
|
// There's no intersection: the sphere is hanging above or under the edge.
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,12 +32,12 @@ PUBLISHED:
|
|||||||
const LVecBase3 &c);
|
const LVecBase3 &c);
|
||||||
INLINE CollisionPolygon(const LVecBase3 &a, const LVecBase3 &b,
|
INLINE CollisionPolygon(const LVecBase3 &a, const LVecBase3 &b,
|
||||||
const LVecBase3 &c, const LVecBase3 &d);
|
const LVecBase3 &c, const LVecBase3 &d);
|
||||||
INLINE CollisionPolygon(const LPoint3 *begin, const LPoint3 *end);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
INLINE CollisionPolygon();
|
INLINE CollisionPolygon();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
INLINE CollisionPolygon(const LPoint3 *begin, const LPoint3 *end);
|
||||||
CollisionPolygon(const CollisionPolygon ©);
|
CollisionPolygon(const CollisionPolygon ©);
|
||||||
|
|
||||||
virtual CollisionSolid *make_copy();
|
virtual CollisionSolid *make_copy();
|
||||||
|
@ -798,6 +798,12 @@ void PythonTask::
|
|||||||
upon_death(AsyncTaskManager *manager, bool clean_exit) {
|
upon_death(AsyncTaskManager *manager, bool clean_exit) {
|
||||||
AsyncTask::upon_death(manager, clean_exit);
|
AsyncTask::upon_death(manager, clean_exit);
|
||||||
|
|
||||||
|
// If we were polling something when we were removed, get rid of it.
|
||||||
|
if (_future_done != nullptr) {
|
||||||
|
Py_DECREF(_future_done);
|
||||||
|
_future_done = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
if (_upon_death != Py_None) {
|
if (_upon_death != Py_None) {
|
||||||
#if defined(HAVE_THREADS) && !defined(SIMPLE_THREADS)
|
#if defined(HAVE_THREADS) && !defined(SIMPLE_THREADS)
|
||||||
// Use PyGILState to protect this asynchronous call.
|
// Use PyGILState to protect this asynchronous call.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user