Browse Source

PR review changes

Ashwini Jha 5 years ago
parent
commit
bb260ef663

+ 5 - 10
panda/src/navigation/navMeshNode.cxx

@@ -34,7 +34,6 @@ NavMeshNode::~NavMeshNode() {}
 void NavMeshNode::
 register_with_read_factory() {
   std::cout<<"\nCalled NavMeshNode::register_with_read_factory()\n";
-  
   BamReader::get_factory()->register_factory(get_class_type(), make_from_bam);
 }
 
@@ -45,11 +44,7 @@ register_with_read_factory() {
 void NavMeshNode::
 write_datagram(BamWriter *manager, Datagram &dg) {
   PandaNode::write_datagram(manager, dg);
-
   manager->write_pointer(dg, _nav_mesh);
-  // Write NULL pointer to indicate the end of the list.
-  manager->write_pointer(dg, nullptr);
-
 }
 
 /**
@@ -65,11 +60,11 @@ complete_pointers(TypedWritable **p_list, BamReader *manager) {
   return pi;
 }
 
-// /**
-//  * This function is called by the BamReader's factory when a new object of
-//  * type BulletShape is encountered in the Bam file.  It should create the
-//  * BulletShape and extract its information from the file.
-//  */
+/**
+ * This function is called by the BamReader's factory when a new object of
+ * type BulletShape is encountered in the Bam file.  It should create the
+ * BulletShape and extract its information from the file.
+ */
 TypedWritable *NavMeshNode::
 make_from_bam(const FactoryParams &params) {
   std::string name = "FromBam";

+ 4 - 8
panda/src/navmeshgen/navMeshBuilder.cxx

@@ -28,10 +28,6 @@
 
 #include "string_utils.h"
 
-#ifdef WIN32
-# define snprintf _snprintf
-#endif
-
 NavMeshBuilder::NavMeshBuilder() :
   _filter_low_hanging_obstacles(true),
   _filter_ledge_spans(true),
@@ -274,16 +270,16 @@ void NavMeshBuilder::cleanup()
   
 }
 
-void NavMeshBuilder::set_partition_type(std::string p) {
-  if (downcase(p) == "watershed") {
+void NavMeshBuilder::set_partition_type(std::string partition) {
+  if (downcase(partition) == "watershed") {
     _partition_type = SAMPLE_PARTITION_WATERSHED;
     return;
   }
-  if (downcase(p) == "monotone") {
+  if (downcase(partition) == "monotone") {
     _partition_type = SAMPLE_PARTITION_MONOTONE;
     return;
   }
-  if (downcase(p) == "layer") {
+  if (downcase(partition) == "layer") {
     _partition_type = SAMPLE_PARTITION_LAYERS;
     return;
   }

+ 4 - 4
panda/src/navmeshgen/navMeshBuilder.h

@@ -67,10 +67,10 @@ PUBLISHED:
   float get_actor_radius() { return _agent_radius; }
   float get_actor_height() { return _agent_height; }
   float get_actor_climb() { return _agent_max_climb; }
-  void set_actor_height(float h) { _agent_height = h; }
-  void set_actor_radius(float r) { _agent_radius = r; }
-  void set_actor_climb(float c) { _agent_max_climb = c; }
-  void set_partition_type(std::string p);
+  void set_actor_height(float height) { _agent_height = height; }
+  void set_actor_radius(float radius) { _agent_radius = radius; }
+  void set_actor_climb(float climb) { _agent_max_climb = climb; }
+  void set_partition_type(std::string partition);
   void reset_common_settings();
   bool from_node_path(NodePath node);
   bool from_geom(PT(Geom) geom);