mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 02:15:43 -04:00
Display better error when encountering invalid prim index
This commit is contained in:
parent
a7d1eb90c5
commit
9b2e322f29
@ -2445,6 +2445,17 @@ get_num_primitives() const {
|
||||
////////////////////////////////////////////////////////////////////
|
||||
bool GeomPrimitivePipelineReader::
|
||||
check_valid(const GeomVertexDataPipelineReader *data_reader) const {
|
||||
return get_num_vertices() == 0 ||
|
||||
get_max_vertex() < data_reader->get_num_rows();
|
||||
if (get_num_vertices() != 0 &&
|
||||
get_max_vertex() >= data_reader->get_num_rows()) {
|
||||
|
||||
#ifndef NDEBUG
|
||||
gobj_cat.error()
|
||||
<< get_object()->get_type() << " references vertices up to "
|
||||
<< get_max_vertex() << ", but GeomVertexData has only "
|
||||
<< data_reader->get_num_rows() << " rows!\n";
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user