From 4a999835174f14e0169eb92e8dcc235e321a6f84 Mon Sep 17 00:00:00 2001 From: David Rose Date: Tue, 13 Feb 2001 17:19:31 +0000 Subject: [PATCH] *** empty log message *** --- pandatool/src/egg-palettize/palettizer.cxx | 13 +++++- pandatool/src/egg-palettize/textureImage.cxx | 43 ++++++++++++++------ pandatool/src/egg-palettize/textureImage.h | 1 + 3 files changed, 44 insertions(+), 13 deletions(-) diff --git a/pandatool/src/egg-palettize/palettizer.cxx b/pandatool/src/egg-palettize/palettizer.cxx index 4746eda5ad..f03f8896ec 100644 --- a/pandatool/src/egg-palettize/palettizer.cxx +++ b/pandatool/src/egg-palettize/palettizer.cxx @@ -102,7 +102,14 @@ Palettizer() { // perusal. //////////////////////////////////////////////////////////////////// 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 << "\nparams\n" << " map directory: " << _map_dirname << "\n" @@ -369,7 +376,11 @@ process_command_line_eggs(bool force_texture_read) { TextureImage *texture = *ti; if (force_texture_read) { + // If we're forcing a redo, re-read the complete image. texture->read_source_image(); + } else { + // Otherwise, just the header is sufficient. + texture->read_header(); } texture->pre_txa_file(); diff --git a/pandatool/src/egg-palettize/textureImage.cxx b/pandatool/src/egg-palettize/textureImage.cxx index 7c49d9bff5..377a9afb97 100644 --- a/pandatool/src/egg-palettize/textureImage.cxx +++ b/pandatool/src/egg-palettize/textureImage.cxx @@ -579,6 +579,23 @@ read_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 // Access: Public @@ -592,20 +609,22 @@ write_source_pathnames(ostream &out, int indent_level) const { for (si = _sources.begin(); si != _sources.end(); ++si) { 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"; } } diff --git a/pandatool/src/egg-palettize/textureImage.h b/pandatool/src/egg-palettize/textureImage.h index 3d9c2ba09e..7a4d2e08e8 100644 --- a/pandatool/src/egg-palettize/textureImage.h +++ b/pandatool/src/egg-palettize/textureImage.h @@ -66,6 +66,7 @@ public: void copy_unplaced(bool redo_all); const PNMImage &read_source_image(); + void read_header(); void write_source_pathnames(ostream &out, int indent_level = 0) const; void write_scale_info(ostream &out, int indent_level = 0);