瀏覽代碼

apply patch in bug LP#1009593 and up bam version

rdb 13 年之前
父節點
當前提交
5ba7076808
共有 2 個文件被更改,包括 11 次插入7 次删除
  1. 8 5
      panda/src/gobj/texture.cxx
  2. 3 2
      panda/src/putil/bam.h

+ 8 - 5
panda/src/gobj/texture.cxx

@@ -7112,6 +7112,7 @@ do_write_datagram_header(CData *cdata, BamWriter *manager, Datagram &me, bool &h
   me.add_uint8(cdata->_alpha_file_channel);
   me.add_uint8(cdata->_alpha_file_channel);
   me.add_bool(has_rawdata);
   me.add_bool(has_rawdata);
   me.add_uint8(cdata->_texture_type);
   me.add_uint8(cdata->_texture_type);
+  me.add_bool(cdata->_has_read_mipmaps);
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
@@ -7233,6 +7234,7 @@ make_this_from_bam(const FactoryParams &params) {
       texture_type = TT_cube_map;
       texture_type = TT_cube_map;
     }
     }
   }
   }
+  bool has_read_mipmaps = scan.get_bool();
 
 
   Texture *me = NULL;
   Texture *me = NULL;
   if (has_rawdata) {
   if (has_rawdata) {
@@ -7248,6 +7250,7 @@ make_this_from_bam(const FactoryParams &params) {
     cdata_me->_primary_file_num_channels = primary_file_num_channels;
     cdata_me->_primary_file_num_channels = primary_file_num_channels;
     cdata_me->_alpha_file_channel = alpha_file_channel;
     cdata_me->_alpha_file_channel = alpha_file_channel;
     cdata_me->_texture_type = texture_type;
     cdata_me->_texture_type = texture_type;
+    cdata_me->_has_read_mipmaps = has_read_mipmaps;
 
 
     // Read the texture attributes directly from the bam stream.
     // Read the texture attributes directly from the bam stream.
     me->do_fillin_body(cdata_me, scan, manager);
     me->do_fillin_body(cdata_me, scan, manager);
@@ -7301,25 +7304,25 @@ make_this_from_bam(const FactoryParams &params) {
       case TT_2d_texture:
       case TT_2d_texture:
         if (alpha_filename.empty()) {
         if (alpha_filename.empty()) {
           me = TexturePool::load_texture(filename, primary_file_num_channels,
           me = TexturePool::load_texture(filename, primary_file_num_channels,
-                                         false, options);
+                                         has_read_mipmaps, options);
         } else {
         } else {
           me = TexturePool::load_texture(filename, alpha_filename,
           me = TexturePool::load_texture(filename, alpha_filename,
                                          primary_file_num_channels,
                                          primary_file_num_channels,
                                          alpha_file_channel,
                                          alpha_file_channel,
-                                         false, options);
+                                         has_read_mipmaps, options);
         }
         }
         break;
         break;
 
 
       case TT_3d_texture:
       case TT_3d_texture:
-        me = TexturePool::load_3d_texture(filename, false, options);
+        me = TexturePool::load_3d_texture(filename, has_read_mipmaps, options);
         break;
         break;
 
 
       case TT_2d_texture_array:
       case TT_2d_texture_array:
-        me = TexturePool::load_2d_texture_array(filename, false, options);
+        me = TexturePool::load_2d_texture_array(filename, has_read_mipmaps, options);
         break;
         break;
 
 
       case TT_cube_map:
       case TT_cube_map:
-        me = TexturePool::load_cube_map(filename, false, options);
+        me = TexturePool::load_cube_map(filename, has_read_mipmaps, options);
         break;
         break;
       }
       }
     }
     }

+ 3 - 2
panda/src/putil/bam.h

@@ -33,7 +33,7 @@ static const unsigned short _bam_major_ver = 6;
 // Bumped to major version 6 on 2/11/06 to factor out PandaNode::CData.
 // Bumped to major version 6 on 2/11/06 to factor out PandaNode::CData.
 
 
 static const unsigned short _bam_first_minor_ver = 14;
 static const unsigned short _bam_first_minor_ver = 14;
-static const unsigned short _bam_minor_ver = 31;
+static const unsigned short _bam_minor_ver = 32;
 // Bumped to minor version 14 on 12/19/07 to change default ColorAttrib.
 // Bumped to minor version 14 on 12/19/07 to change default ColorAttrib.
 // Bumped to minor version 15 on 4/9/08 to add TextureAttrib::_implicit_sort.
 // Bumped to minor version 15 on 4/9/08 to add TextureAttrib::_implicit_sort.
 // Bumped to minor version 16 on 5/13/08 to add Texture::_quality_level.
 // Bumped to minor version 16 on 5/13/08 to add Texture::_quality_level.
@@ -51,7 +51,8 @@ static const unsigned short _bam_minor_ver = 31;
 // Bumped to minor version 28 on 11/28/11 to add Texture::_auto_texture_scale.
 // Bumped to minor version 28 on 11/28/11 to add Texture::_auto_texture_scale.
 // Bumped to minor version 29 on 12/17/11 to add GeomVertexColumn::_column_alignment.
 // Bumped to minor version 29 on 12/17/11 to add GeomVertexColumn::_column_alignment.
 // Bumped to minor version 30 on 1/22/12 to add Texture::_pad_*_size.
 // Bumped to minor version 30 on 1/22/12 to add Texture::_pad_*_size.
-// Bumped to minor version 31 on 2/16/12 to add DepthOffsetAttrib::_min_value, _max_value
+// Bumped to minor version 31 on 2/16/12 to add DepthOffsetAttrib::_min_value, _max_value.
+// Bumped to minor version 32 on 6/11/12 to add Texture::_has_read_mipmaps.
 
 
 
 
 #endif
 #endif