mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
limit cost of test_vref_integrity()
This commit is contained in:
parent
66b5af633b
commit
326da19431
@ -144,6 +144,12 @@ ConfigVariableDouble egg_coplanar_threshold
|
||||
PRC_DESC("The numerical threshold below which polygons are considered "
|
||||
"to be coplanar. Determined empirically."));
|
||||
|
||||
ConfigVariableInt egg_test_vref_integrity
|
||||
("egg-test-vref-integrity", 20,
|
||||
PRC_DESC("The maximum number of vertices a primitive may have before "
|
||||
"its vertices will no longer be checked for internal integrity. "
|
||||
"This is meaningful in non-production builds only."));
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: init_libegg
|
||||
// Description: Initializes the library. This must be called at
|
||||
|
@ -39,6 +39,7 @@ extern EXPCL_PANDAEGG ConfigVariableBool egg_consider_fans;
|
||||
extern EXPCL_PANDAEGG ConfigVariableDouble egg_max_tfan_angle;
|
||||
extern EXPCL_PANDAEGG ConfigVariableInt egg_min_tfan_tris;
|
||||
extern EXPCL_PANDAEGG ConfigVariableDouble egg_coplanar_threshold;
|
||||
extern EXPCL_PANDAEGG ConfigVariableInt egg_test_vref_integrity;
|
||||
|
||||
extern EXPCL_PANDAEGG void init_libegg();
|
||||
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include "eggMiscFuncs.h"
|
||||
#include "eggTextureCollection.h"
|
||||
#include "lexerDefs.h"
|
||||
#include "config_egg.h"
|
||||
|
||||
#include "indent.h"
|
||||
#include "vector_int.h"
|
||||
@ -814,6 +815,7 @@ void EggPrimitive::
|
||||
test_vref_integrity() const {
|
||||
test_ref_count_integrity();
|
||||
|
||||
if ((int)size() <= egg_test_vref_integrity) {
|
||||
// First, we need to know how many times each vertex appears.
|
||||
// Usually, this will be only one, but it's possible for a vertex to
|
||||
// appear more than once.
|
||||
@ -845,6 +847,7 @@ test_vref_integrity() const {
|
||||
|
||||
nassertv(count == vert_count);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // NDEBUG
|
||||
|
Loading…
x
Reference in New Issue
Block a user