mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00
fix bug in <lines>
This commit is contained in:
parent
da6d5fc3b9
commit
259ce0f3e3
@ -1228,29 +1228,22 @@ rebuild_vertex_pools(EggVertexPools &vertex_pools, unsigned int max_vertices,
|
|||||||
vertices.push_back(*pi);
|
vertices.push_back(*pi);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
typedef pvector<EggAttributes> Attributes;
|
||||||
|
Attributes attributes;
|
||||||
|
|
||||||
if (prim->is_of_type(EggCompositePrimitive::get_class_type())) {
|
if (prim->is_of_type(EggCompositePrimitive::get_class_type())) {
|
||||||
// A compositive primitive has the additional complication of
|
// A compositive primitive has the additional complication of
|
||||||
// dealing with its attributes.
|
// dealing with its attributes.
|
||||||
typedef pvector<EggAttributes> Attributes;
|
|
||||||
Attributes attributes;
|
|
||||||
|
|
||||||
EggCompositePrimitive *cprim = DCAST(EggCompositePrimitive, prim);
|
EggCompositePrimitive *cprim = DCAST(EggCompositePrimitive, prim);
|
||||||
int i;
|
int i;
|
||||||
int num_components = cprim->get_num_components();
|
int num_components = cprim->get_num_components();
|
||||||
for (i = 0; i < num_components; i++) {
|
for (i = 0; i < num_components; i++) {
|
||||||
attributes.push_back(*cprim->get_component(i));
|
attributes.push_back(*cprim->get_component(i));
|
||||||
}
|
}
|
||||||
|
|
||||||
cprim->clear();
|
|
||||||
|
|
||||||
for (i = 0; i < num_components; i++) {
|
|
||||||
cprim->set_component(i, &attributes[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
|
||||||
prim->clear();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
prim->clear();
|
||||||
|
|
||||||
// Now look for a new home for the vertices. First, see if any
|
// Now look for a new home for the vertices. First, see if any
|
||||||
// of the vertex pools we've already created already have a copy
|
// of the vertex pools we've already created already have a copy
|
||||||
// of each one of the vertices.
|
// of each one of the vertices.
|
||||||
@ -1327,6 +1320,17 @@ rebuild_vertex_pools(EggVertexPools &vertex_pools, unsigned int max_vertices,
|
|||||||
prim->add_vertex(new_vertex);
|
prim->add_vertex(new_vertex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (prim->is_of_type(EggCompositePrimitive::get_class_type())) {
|
||||||
|
// Now restore the composite attributes.
|
||||||
|
EggCompositePrimitive *cprim = DCAST(EggCompositePrimitive, prim);
|
||||||
|
int i;
|
||||||
|
int num_components = cprim->get_num_components();
|
||||||
|
nassertv(num_components == (int)attributes.size());
|
||||||
|
for (i = 0; i < num_components; i++) {
|
||||||
|
cprim->set_component(i, &attributes[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} else if (child->is_of_type(EggGroupNode::get_class_type())) {
|
} else if (child->is_of_type(EggGroupNode::get_class_type())) {
|
||||||
if (recurse) {
|
if (recurse) {
|
||||||
DCAST(EggGroupNode, child)->rebuild_vertex_pools(vertex_pools, max_vertices, recurse);
|
DCAST(EggGroupNode, child)->rebuild_vertex_pools(vertex_pools, max_vertices, recurse);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user