瀏覽代碼

*** empty log message ***

David Rose 25 年之前
父節點
當前提交
d69d3fc470

+ 2 - 2
panda/src/chan/animBundle.cxx

@@ -34,7 +34,7 @@ void AnimBundle::
 write_datagram(BamWriter *manager, Datagram &me)
 {
   AnimGroup::write_datagram(manager, me);
-  me.add_float64(_fps);
+  me.add_float32(_fps);
   me.add_uint16(_num_frames);
 }
 
@@ -50,7 +50,7 @@ void AnimBundle::
 fillin(DatagramIterator& scan, BamReader* manager)
 {
   AnimGroup::fillin(scan, manager);
-  _fps = scan.get_float64();
+  _fps = scan.get_float32();
   _num_frames = scan.get_uint16();
 }
 

+ 2 - 2
panda/src/chan/animChannel.h

@@ -94,11 +94,11 @@ public:
   static const char *get_part_type_name() { return "MovingPart<float>"; }
   static void write_datagram(Datagram &dest, ValueType& me)
   {
-    dest.add_float64(me); 
+    dest.add_float32(me); 
   }
   static void read_datagram(DatagramIterator &source, ValueType& me)
   {
-    me = source.get_float64();
+    me = source.get_float32();
   }
 };
 

+ 4 - 8
panda/src/chan/animChannelMatrixXfmTable.cxx

@@ -226,13 +226,13 @@ write_datagram(BamWriter *manager, Datagram &me)
 {
   AnimChannelMatrix::write_datagram(manager, me);
 
-  me.add_uint8(quantize_bam_channels);
+  me.add_bool(quantize_bam_channels);
   if (!quantize_bam_channels) {
     // Write out everything the old way, as floats.
     for(int i = 0; i < num_tables; i++) {
       me.add_uint16(_tables[i].size());
       for(int j = 0; j < (int)_tables[i].size(); j++) {
-	me.add_float64(_tables[i][j]);
+	me.add_float32(_tables[i][j]);
       }
     }
 
@@ -280,11 +280,7 @@ fillin(DatagramIterator& scan, BamReader* manager)
 {
   AnimChannelMatrix::fillin(scan, manager);
 
-  bool wrote_quantized = false;
-  if (manager->get_file_minor_ver() >= 1) {
-    // Version 1 and later: we might have quantized channels.
-    wrote_quantized = (bool)scan.get_uint8();
-  }
+  bool wrote_quantized = scan.get_bool();
 
   if (!wrote_quantized) {
     // Regular floats.
@@ -292,7 +288,7 @@ fillin(DatagramIterator& scan, BamReader* manager)
       int size = scan.get_uint16();
       PTA_float ind_table;
       for(int j = 0; j < size; j++) {
-	ind_table.push_back(scan.get_float64());
+	ind_table.push_back(scan.get_float32());
       }
       _tables[i] = ind_table;
     }

+ 4 - 8
panda/src/chan/animChannelScalarTable.cxx

@@ -118,12 +118,12 @@ write_datagram(BamWriter *manager, Datagram &me)
 {
   AnimChannelScalar::write_datagram(manager, me);
 
-  me.add_uint8(quantize_bam_channels);
+  me.add_bool(quantize_bam_channels);
   if (!quantize_bam_channels) {
     // Write out everything the old way, as floats.
     me.add_uint16(_table.size());
     for(int i = 0; i < (int)_table.size(); i++) {
-      me.add_float64(_table[i]);
+      me.add_float32(_table[i]);
     }
 
   } else {
@@ -150,18 +150,14 @@ fillin(DatagramIterator& scan, BamReader* manager)
 {
   AnimChannelScalar::fillin(scan, manager);
 
-  bool wrote_quantized = false;
-  if (manager->get_file_minor_ver() >= 1) {
-    // Version 1 and later: we might have quantized channels.
-    wrote_quantized = (bool)scan.get_uint8();
-  }
+  bool wrote_quantized = scan.get_bool();
 
   if (!wrote_quantized) {
     // Regular floats.
     int size = scan.get_uint16();
     PTA_float temp_table;
     for(int i = 0; i < size; i++) {
-      temp_table.push_back(scan.get_float64());
+      temp_table.push_back(scan.get_float32());
     }
     _table = temp_table;
 

+ 2 - 2
panda/src/char/computedVertices.cxx

@@ -77,7 +77,7 @@ write_datagram(Datagram &dest)
 {
   int i;
   dest.add_int16(_joint_index);
-  dest.add_float64(_effect);
+  dest.add_float32(_effect);
   dest.add_uint16(_vindex.size());
   for(i = 0; i < (int)_vindex.size(); i++)
   {
@@ -100,7 +100,7 @@ read_datagram(DatagramIterator &source)
 {
   int i;
   _joint_index = source.get_int16();
-  _effect = source.get_float64();
+  _effect = source.get_float32();
   int vsize = source.get_uint16();
   for(i = 0; i < vsize; i++)
   {

+ 2 - 7
panda/src/collide/collisionNode.cxx

@@ -197,7 +197,7 @@ write_datagram(BamWriter *manager, Datagram &me)
 
   me.add_uint32(_from_collide_mask.get_word());
   me.add_uint32(_into_collide_mask.get_word());
-  me.add_uint8(_collide_geom);
+  me.add_bool(_collide_geom);
 }
 
 ////////////////////////////////////////////////////////////////////
@@ -224,12 +224,7 @@ fillin(DatagramIterator& scan, BamReader* manager)
 
   _from_collide_mask.set_word(scan.get_uint32());
   _into_collide_mask.set_word(scan.get_uint32());
-
-  if (manager->get_file_minor_ver() >= 2) {
-    _collide_geom = (scan.get_uint8() != 0);
-  } else {
-    _collide_geom = false;
-  }
+  _collide_geom = scan.get_bool();
 }
 
 ////////////////////////////////////////////////////////////////////

+ 2 - 2
panda/src/collide/collisionSphere.cxx

@@ -285,7 +285,7 @@ write_datagram(BamWriter *manager, Datagram &me)
 {
   CollisionSolid::write_datagram(manager, me);
   _center.write_datagram(me);
-  me.add_float64(_radius);
+  me.add_float32(_radius);
 }
 
 ////////////////////////////////////////////////////////////////////
@@ -301,7 +301,7 @@ fillin(DatagramIterator& scan, BamReader* manager)
 {
   CollisionSolid::fillin(scan, manager);
   _center.read_datagram(scan);
-  _radius = scan.get_float64();
+  _radius = scan.get_float32();
 }
 
 ////////////////////////////////////////////////////////////////////

+ 8 - 8
panda/src/effects/lensFlareNode.cxx

@@ -413,10 +413,10 @@ write_datagram(BamWriter *manager, Datagram &me) {
     WRITE_PTA(manager, me, IPD_Colorf::write_datagram, _flare_colors[i])
   }
 
-  me.add_float64(_global_scale);
-  me.add_float64(_texel_scale);
-  me.add_float64(_blind_fall_off);
-  me.add_float64(_flare_fall_off);
+  me.add_float32(_global_scale);
+  me.add_float32(_texel_scale);
+  me.add_float32(_blind_fall_off);
+  me.add_float32(_flare_fall_off);
 
   manager->write_pointer(me, _light_node);
 }
@@ -481,10 +481,10 @@ fillin(DatagramIterator &scan, BamReader *manager)
     _flare_colors.push_back(temp);
   }
 
-  _global_scale = scan.get_float64();
-  _texel_scale = scan.get_float64();
-  _blind_fall_off = scan.get_float64();
-  _flare_fall_off = scan.get_float64();
+  _global_scale = scan.get_float32();
+  _texel_scale = scan.get_float32();
+  _blind_fall_off = scan.get_float32();
+  _flare_fall_off = scan.get_float32();
 
   manager->read_pointer(scan, this);
 }

+ 4 - 4
panda/src/gobj/LOD.I

@@ -121,8 +121,8 @@ operator < (const LODSwitch &) const {
 ////////////////////////////////////////////////////////////////////
 INLINE void LODSwitch::
 write_datagram(Datagram &destination) const {
-  destination.add_float64(_in);
-  destination.add_float64(_out);
+  destination.add_float32(_in);
+  destination.add_float32(_out);
 }
 
 ////////////////////////////////////////////////////////////////////
@@ -134,6 +134,6 @@ write_datagram(Datagram &destination) const {
 ////////////////////////////////////////////////////////////////////
 INLINE void LODSwitch::
 read_datagram(DatagramIterator &source) {
-  _in = source.get_float64();
-  _out = source.get_float64();
+  _in = source.get_float32();
+  _out = source.get_float32();
 }

+ 1 - 6
panda/src/gobj/imageBuffer.cxx

@@ -77,10 +77,5 @@ write_datagram(BamWriter *, Datagram &me)
 void ImageBuffer::
 fillin(DatagramIterator &scan, BamReader *manager) {
   set_name(scan.get_string());
-
-  if (manager->get_file_minor_ver() >= 3) {
-    set_alpha_name(scan.get_string());
-  } else {
-    clear_alpha_name();
-  }
+  set_alpha_name(scan.get_string());
 }

+ 2 - 9
panda/src/gobj/texture.cxx

@@ -423,11 +423,7 @@ fillin(DatagramIterator &scan, BamReader *manager) {
   _magfiltercolor = (enum FilterType) scan.get_uint8();
   _magfilteralpha = (enum FilterType) scan.get_uint8();
 
-  if (manager->get_file_minor_ver() >= 4) {
-    _anisotropic_degree = scan.get_int16();
-  } else {
-    _anisotropic_degree = 1;
-  }
+  _anisotropic_degree = scan.get_int16();
 }
 
 ////////////////////////////////////////////////////////////////////
@@ -451,10 +447,7 @@ make_Texture(const FactoryParams &params)
   DatagramIterator scan(packet);
 
   string name = scan.get_string();
-  string alpha_name;
-  if (manager->get_file_minor_ver() >= 3) {
-    alpha_name = scan.get_string();
-  }
+  string alpha_name = scan.get_string();
 
   PT(Texture) me;
 

+ 2 - 2
panda/src/linmath/lmatrix3.I

@@ -1043,7 +1043,7 @@ write_datagram(Datagram &destination) const
   {
     for(int j = 0; j < 3; j++)
     {
-      destination.add_float64(get_cell(i,j));
+      destination.add_float32(get_cell(i,j));
     }
   }
 }
@@ -1060,7 +1060,7 @@ read_datagram(DatagramIterator &scan)
   {
     for(int j = 0; j < 3; j++)
     {
-      set_cell(i, j, scan.get_float64());
+      set_cell(i, j, scan.get_float32());
     }
   }
 }

+ 2 - 2
panda/src/linmath/lmatrix4.I

@@ -1449,7 +1449,7 @@ write_datagram(Datagram &destination) const
   {
     for(int j = 0; j < 4; j++)
     {
-      destination.add_float64(get_cell(i,j));
+      destination.add_float32(get_cell(i,j));
     }
   }
 }
@@ -1467,7 +1467,7 @@ read_datagram(DatagramIterator &scan)
   {
     for(int j = 0; j < 4; j++)
     {
-      set_cell(i, j, scan.get_float64());
+      set_cell(i, j, scan.get_float32());
     }
   }
 }

+ 4 - 4
panda/src/linmath/lvecBase2.I

@@ -575,8 +575,8 @@ init_type() {
 template<class NumType>
 void LVecBase2<NumType>::
 write_datagram(Datagram &destination) const {
-  destination.add_float64(_data[0]);
-  destination.add_float64(_data[1]);
+  destination.add_float32(_data[0]);
+  destination.add_float32(_data[1]);
 }
 
 ////////////////////////////////////////////////////////////////////
@@ -587,8 +587,8 @@ write_datagram(Datagram &destination) const {
 template<class NumType>
 void LVecBase2<NumType>::
 read_datagram(DatagramIterator &source) {
-  _data[0] = source.get_float64();
-  _data[1] = source.get_float64();
+  _data[0] = source.get_float32();
+  _data[1] = source.get_float32();
 }
 
 ////////////////////////////////////////////////////////////////////

+ 6 - 6
panda/src/linmath/lvecBase3.I

@@ -648,9 +648,9 @@ init_type() {
 template<class NumType>
 void LVecBase3<NumType>::
 write_datagram(Datagram &destination) const {
-  destination.add_float64(_data[0]);
-  destination.add_float64(_data[1]);
-  destination.add_float64(_data[2]);
+  destination.add_float32(_data[0]);
+  destination.add_float32(_data[1]);
+  destination.add_float32(_data[2]);
 }
 
 ////////////////////////////////////////////////////////////////////
@@ -661,9 +661,9 @@ write_datagram(Datagram &destination) const {
 template<class NumType>
 void LVecBase3<NumType>::
 read_datagram(DatagramIterator &source) {
-  _data[0] = source.get_float64();
-  _data[1] = source.get_float64();
-  _data[2] = source.get_float64();
+  _data[0] = source.get_float32();
+  _data[1] = source.get_float32();
+  _data[2] = source.get_float32();
 }
 
 

+ 8 - 8
panda/src/linmath/lvecBase4.I

@@ -676,10 +676,10 @@ init_type() {
 template<class NumType>
 void LVecBase4<NumType>::
 write_datagram(Datagram &destination) const {
-  destination.add_float64(_data[0]);
-  destination.add_float64(_data[1]);
-  destination.add_float64(_data[2]);
-  destination.add_float64(_data[3]);
+  destination.add_float32(_data[0]);
+  destination.add_float32(_data[1]);
+  destination.add_float32(_data[2]);
+  destination.add_float32(_data[3]);
 }
 
 ////////////////////////////////////////////////////////////////////
@@ -690,10 +690,10 @@ write_datagram(Datagram &destination) const {
 template<class NumType>
 void LVecBase4<NumType>::
 read_datagram(DatagramIterator &source) {
-  _data[0] = source.get_float64();
-  _data[1] = source.get_float64();
-  _data[2] = source.get_float64();
-  _data[3] = source.get_float64();
+  _data[0] = source.get_float32();
+  _data[1] = source.get_float32();
+  _data[2] = source.get_float32();
+  _data[3] = source.get_float32();
 }
 
 

+ 8 - 8
panda/src/mathutil/plane.I

@@ -283,10 +283,10 @@ template<class NumType>
 void Plane<NumType>::
 write_datagram(Datagram &dest) 
 {
-  dest.add_float64(_a);
-  dest.add_float64(_b);
-  dest.add_float64(_c);
-  dest.add_float64(_d);
+  dest.add_float32(_a);
+  dest.add_float32(_b);
+  dest.add_float32(_c);
+  dest.add_float32(_d);
 }
 
 ////////////////////////////////////////////////////////////////////
@@ -298,8 +298,8 @@ template<class NumType>
 void Plane<NumType>::
 read_datagram(DatagramIterator &source) 
 {
-  _a = source.get_float64();
-  _b = source.get_float64();
-  _c = source.get_float64();
-  _d = source.get_float64();
+  _a = source.get_float32();
+  _b = source.get_float32();
+  _c = source.get_float32();
+  _d = source.get_float32();
 }

+ 4 - 6
panda/src/putil/bam.h

@@ -15,13 +15,11 @@
 //for detecting files damaged due to ASCII/Binary conversion
 static const string _bam_header = string("pbj\0\n\r", 6);
 
-static const unsigned short _bam_major_ver = 2;
+static const unsigned short _bam_major_ver = 3;
 // Bumped to major version 2 on 7/6/00 due to major changes in Character.
-static const unsigned short _bam_minor_ver = 4;
-// Bumped to minor version 1 on 7/19/00 to quantize channel files.
-// Bumped to minor version 2 on 8/21/00 for CollisionNode::_collide_geom.
-// Bumped to minor version 3 on 11/21/00 for dual-image textures.
-// Bumped to minor version 4 on 11/28/00 for anisotropic texture filtering.
+// Bumped to major version 3 on 12/8/00 to change float64's to float32's.
+
+static const unsigned short _bam_minor_ver = 0;
 
 
 #endif

+ 2 - 2
panda/src/putil/ioPtaDatagramFloat.cxx

@@ -19,7 +19,7 @@ write_datagram(Datagram &dest, CPTA_float array)
 {
   dest.add_uint32(array.size());
   for (int i = 0; i < (int)array.size(); i++) {
-    dest.add_float64(array[i]);
+    dest.add_float32(array[i]);
   }
 }
 
@@ -35,7 +35,7 @@ read_datagram(DatagramIterator &source)
 
   int size = source.get_uint32();
   for (int i = 0; i < size; i++) {
-    array.push_back(source.get_float64());
+    array.push_back(source.get_float32());
   }
 
   return array;

+ 2 - 2
panda/src/putil/timedCycle.cxx

@@ -15,7 +15,7 @@
 ////////////////////////////////////////////////////////////////////
 void TimedCycle::
 write_datagram(Datagram &me) {
-  me.add_float64(_cycle_time);
+  me.add_float32(_cycle_time);
   me.add_uint16(_element_count);
 }
 
@@ -28,7 +28,7 @@ write_datagram(Datagram &me) {
 ////////////////////////////////////////////////////////////////////
 void TimedCycle::
 fillin(DatagramIterator &scan) {
-  _cycle_time = scan.get_float64();
+  _cycle_time = scan.get_float32();
   _element_count = scan.get_uint16();
   _inv_cycle_time = 1. / _cycle_time;