Browse Source

distort: Fix unprotected debug output

rdb 1 year ago
parent
commit
8d1524b675
1 changed files with 5 additions and 3 deletions
  1. 5 3
      panda/src/distort/projectionScreen.cxx

+ 5 - 3
panda/src/distort/projectionScreen.cxx

@@ -451,9 +451,11 @@ recompute_geom_node(const WorkingNodePath &np, LMatrix4 &rel_mat,
   int num_geoms = node->get_num_geoms();
   int num_geoms = node->get_num_geoms();
   for (int i = 0; i < num_geoms; i++) {
   for (int i = 0; i < num_geoms; i++) {
     PT(Geom) geom = node->modify_geom(i);
     PT(Geom) geom = node->modify_geom(i);
-    distort_cat.debug()
-      << "  " << *node << " got geom " << geom
-      << ", cache_ref = " << geom->get_cache_ref_count() << "\n";
+    if (distort_cat.is_debug()) {
+      distort_cat.debug()
+        << "  " << *node << " got geom " << geom
+        << ", cache_ref = " << geom->get_cache_ref_count() << "\n";
+    }
     geom->test_ref_count_integrity();
     geom->test_ref_count_integrity();
     recompute_geom(geom, rel_mat);
     recompute_geom(geom, rel_mat);
   }
   }