Browse Source

putil: BamWriter doc fix, initialize _root_node field properly

rdb 1 year ago
parent
commit
89c0371cbb
2 changed files with 4 additions and 1 deletions
  1. 3 0
      panda/src/putil/bamWriter.I
  2. 1 1
      panda/src/putil/bamWriter.h

+ 3 - 0
panda/src/putil/bamWriter.I

@@ -96,6 +96,9 @@ get_file_texture_mode() const {
  * Changes the BamTextureMode preference for the Bam file currently being
  * written.  Texture objects written to this Bam file will be encoded
  * according to the specified mode.
+ *
+ * This should be called after the call to init(), or it will be overwritten
+ * with the default mode in the config file.
  */
 INLINE void BamWriter::
 set_file_texture_mode(BamTextureMode file_texture_mode) {

+ 1 - 1
panda/src/putil/bamWriter.h

@@ -135,7 +135,7 @@ private:
   // Stores the PandaNode representing the root of the node hierarchy we are
   // currently writing, if any, for the purpose of writing NodePaths.  This is
   // a TypedWritable since PandaNode is defined in pgraph.
-  TypedWritable *_root_node;
+  TypedWritable *_root_node = nullptr;
 
   // This is the set of all TypeHandles already written.
   pset<int, int_hash> _types_written;