Merge branch 'release/1.9.x'

This commit is contained in:
rdb 2016-09-08 22:18:50 +02:00
commit 61b7af74db
4 changed files with 90 additions and 7 deletions

View File

@ -1421,6 +1421,17 @@ create_runtime_environment() {
}
}
#ifndef _WIN32
// If we're running from the console, make sure that terminating the parent
// process will cause the child process to terminate as well.
if (_console_environment) {
struct sigaction ignore;
memset(&ignore, 0, sizeof(ignore));
ignore.sa_handler = SIG_IGN;
sigaction(SIGINT, &ignore, NULL);
}
#endif
_created_runtime_environment = true;
}

View File

@ -29,6 +29,9 @@ This issue fixes several bugs that were still found in 1.9.2.
* Fix race condition reading string config var
* Fix interrogate parsing issue with "const static"
* Add back missing libp3pystub.a to Mac OS X SDK
* Fix RAM caching of 2D texture arrays
* Fix Ctrl+C interrupt propagation to runtime applications
* Support for InvSphere, Box and Tube solids in bam2egg
------------------------ RELEASE 1.9.2 ------------------------

View File

@ -440,7 +440,12 @@ convert_collision_node(CollisionNode *node, const WorkingNodePath &node_path,
egg_sphere->set_collide_flags(EggGroup::CF_descend);
egg_group->add_child(egg_sphere);
}
egg_sphere->set_cs_type(EggGroup::CST_sphere);
if (child->is_of_type(CollisionInvSphere::get_class_type())) {
egg_sphere->set_cs_type(EggGroup::CST_inv_sphere);
} else {
egg_sphere->set_cs_type(EggGroup::CST_sphere);
}
EggVertex ev1, ev2;
ev1.set_pos(LCAST(double, (center + offset) * net_mat));
@ -492,13 +497,77 @@ convert_collision_node(CollisionNode *node, const WorkingNodePath &node_path,
egg_poly->add_vertex(cvpool->create_unique_vertex(ev2));
} else if (child->is_of_type(CollisionBox::get_class_type())) {
nout << "Encountered unhandled collsion type: CollisionBox" << "\n";
} else if (child->is_of_type(CollisionInvSphere::get_class_type())) {
nout << "Encountered unhandled collsion type: CollisionInvSphere" << "\n";
CPT(CollisionBox) box = DCAST(CollisionBox, child);
LPoint3 min_point = box->get_min();
LPoint3 max_point = box->get_max();
EggGroup *egg_box;
if (num_solids == 1) {
egg_box = egg_group;
} else {
egg_box = new EggGroup;
egg_box->set_collide_flags(EggGroup::CF_descend);
egg_group->add_child(egg_box);
}
egg_box->set_cs_type(EggGroup::CST_box);
// Just add the min and max points.
EggVertex ev0, ev1;
ev0.set_pos(LCAST(double, min_point * net_mat));
ev1.set_pos(LCAST(double, max_point * net_mat));
EggLine *egg_poly = new EggLine;
egg_box->add_child(egg_poly);
egg_poly->add_vertex(cvpool->create_unique_vertex(ev0));
egg_poly->add_vertex(cvpool->create_unique_vertex(ev1));
} else if (child->is_of_type(CollisionTube::get_class_type())) {
nout << "Encountered unhandled collsion type: CollisionTube" << "\n";
CPT(CollisionTube) tube = DCAST(CollisionTube, child);
LPoint3 point_a = tube->get_point_a();
LPoint3 point_b = tube->get_point_b();
LPoint3 centroid = (point_a + point_b) * 0.5f;
// Also get an arbitrary vector perpendicular to the tube.
LVector3 axis = point_b - point_a;
LVector3 sideways;
if (abs(axis[2]) > abs(axis[1])) {
sideways = axis.cross(LVector3(0, 1, 0));
} else {
sideways = axis.cross(LVector3(0, 0, 1));
}
sideways.normalize();
sideways *= tube->get_radius();
LVector3 extend = axis.normalized() * tube->get_radius();
EggGroup *egg_tube;
if (num_solids == 1) {
egg_tube = egg_group;
} else {
egg_tube = new EggGroup;
egg_tube->set_collide_flags(EggGroup::CF_descend);
egg_group->add_child(egg_tube);
}
egg_tube->set_cs_type(EggGroup::CST_tube);
// Add two points for the endcaps, and then two points around the
// centroid to indicate the radius.
EggVertex ev0, ev1, ev2, ev3;
ev0.set_pos(LCAST(double, (point_a - extend) * net_mat));
ev1.set_pos(LCAST(double, (centroid + sideways) * net_mat));
ev2.set_pos(LCAST(double, (point_b + extend) * net_mat));
ev3.set_pos(LCAST(double, (centroid - sideways) * net_mat));
EggPolygon *egg_poly = new EggPolygon;
egg_tube->add_child(egg_poly);
egg_poly->add_vertex(cvpool->create_unique_vertex(ev0));
egg_poly->add_vertex(cvpool->create_unique_vertex(ev1));
egg_poly->add_vertex(cvpool->create_unique_vertex(ev2));
egg_poly->add_vertex(cvpool->create_unique_vertex(ev3));
} else {
nout << "Encountered unknown CollisionSolid" << "\n";
nout << "Encountered unknown collision solid type " << child->get_type() << "\n";
}
}
}

View File

@ -745,7 +745,7 @@ ns_load_cube_map(const Filename &filename_pattern, bool read_mipmaps,
nassertr(tex != (Texture *)NULL, NULL);
tex->set_filename(filename_pattern);
tex->set_fullpath(filename);
tex->_texture_pool_key = filename;
tex->_texture_pool_key = unique_filename;
{
MutexHolder holder(_lock);