Browse Source

*** empty log message ***

David Rose 25 years ago
parent
commit
4a99983517

+ 12 - 1
pandatool/src/egg-palettize/palettizer.cxx

@@ -102,7 +102,14 @@ Palettizer() {
 //               perusal.
 //               perusal.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 void Palettizer::
 void Palettizer::
-report_pi() const {
+report_pi() const { 
+  // Start out with the cross links and back counts; some of these are
+  // nice to report.
+  EggFiles::const_iterator efi;
+  for (efi = _egg_files.begin(); efi != _egg_files.end(); ++efi) {
+    (*efi).second->build_cross_links();
+  }
+
   cout 
   cout 
     << "\nparams\n"
     << "\nparams\n"
     << "  map directory: " << _map_dirname << "\n"
     << "  map directory: " << _map_dirname << "\n"
@@ -369,7 +376,11 @@ process_command_line_eggs(bool force_texture_read) {
     TextureImage *texture = *ti;
     TextureImage *texture = *ti;
 
 
     if (force_texture_read) {
     if (force_texture_read) {
+      // If we're forcing a redo, re-read the complete image.
       texture->read_source_image();
       texture->read_source_image();
+    } else {
+      // Otherwise, just the header is sufficient.
+      texture->read_header();
     }
     }
 
 
     texture->pre_txa_file();
     texture->pre_txa_file();

+ 31 - 12
pandatool/src/egg-palettize/textureImage.cxx

@@ -579,6 +579,23 @@ read_source_image() {
   return _source_image;
   return _source_image;
 }
 }
 
 
+////////////////////////////////////////////////////////////////////
+//     Function: TextureImage::read_header
+//       Access: Public
+//  Description: Causes the header part of the image to be reread,
+//               usually to confirm that its image properties (size,
+//               number of channels, etc.) haven't changed.
+////////////////////////////////////////////////////////////////////
+void TextureImage::
+read_header() {
+  if (!_read_source_image) {
+    SourceTextureImage *source = get_preferred_source();
+    if (source != (SourceTextureImage *)NULL) {
+      source->read_header();
+    }
+  }
+}
+
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //     Function: TextureImage::write_source_pathnames
 //     Function: TextureImage::write_source_pathnames
 //       Access: Public
 //       Access: Public
@@ -592,20 +609,22 @@ write_source_pathnames(ostream &out, int indent_level) const {
   for (si = _sources.begin(); si != _sources.end(); ++si) {
   for (si = _sources.begin(); si != _sources.end(); ++si) {
     SourceTextureImage *source = (*si).second;
     SourceTextureImage *source = (*si).second;
 
 
-    indent(out, indent_level);
-    source->output_filename(out);
-    if (!source->is_size_known()) {
-      out << " (unknown size)";
-
-    } else {
-      out << " " << source->get_x_size() << " " 
-	  << source->get_y_size();
-
-      if (source->get_properties().has_num_channels()) {
-	out << " " << source->get_properties().get_num_channels();
+    if (source->get_egg_count() > 0) {
+      indent(out, indent_level);
+      source->output_filename(out);
+      if (!source->is_size_known()) {
+	out << " (unknown size)";
+	
+      } else {
+	out << " " << source->get_x_size() << " " 
+	    << source->get_y_size();
+	
+	if (source->get_properties().has_num_channels()) {
+	  out << " " << source->get_properties().get_num_channels();
+	}
       }
       }
+      out << "\n";
     }
     }
-    out << "\n";
   }
   }
 }
 }
 
 

+ 1 - 0
pandatool/src/egg-palettize/textureImage.h

@@ -66,6 +66,7 @@ public:
   void copy_unplaced(bool redo_all);
   void copy_unplaced(bool redo_all);
 
 
   const PNMImage &read_source_image();
   const PNMImage &read_source_image();
+  void read_header();
 
 
   void write_source_pathnames(ostream &out, int indent_level = 0) const;
   void write_source_pathnames(ostream &out, int indent_level = 0) const;
   void write_scale_info(ostream &out, int indent_level = 0);
   void write_scale_info(ostream &out, int indent_level = 0);