mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 01:44:06 -04:00
*** empty log message ***
This commit is contained in:
parent
f50dda563e
commit
0a29169b5c
@ -1,22 +1,22 @@
|
|||||||
#begin bin_target
|
// #begin bin_target
|
||||||
#define TARGET egg-palettize-new
|
// #define TARGET egg-palettize-new
|
||||||
#define LOCAL_LIBS \
|
// #define LOCAL_LIBS \
|
||||||
eggbase progbase
|
// eggbase progbase
|
||||||
#define OTHER_LIBS \
|
// #define OTHER_LIBS \
|
||||||
egg:c linmath:c putil:c express:c pnmimage:c pnmimagetypes:c \
|
// egg:c linmath:c putil:c express:c pnmimage:c pnmimagetypes:c \
|
||||||
pandaegg:m panda:m pandaexpress:m \
|
// pandaegg:m panda:m pandaexpress:m \
|
||||||
dtoolutil:c dconfig:c dtool:m pystub
|
// dtoolutil:c dconfig:c dtool:m pystub
|
||||||
|
|
||||||
#define SOURCES \
|
// #define SOURCES \
|
||||||
attribFile.cxx attribFile.h config_egg_palettize.cxx \
|
// attribFile.cxx attribFile.h config_egg_palettize.cxx \
|
||||||
eggPalettize.cxx eggPalettize.h \
|
// eggPalettize.cxx eggPalettize.h \
|
||||||
palette.cxx palette.h paletteGroup.cxx \
|
// palette.cxx palette.h paletteGroup.cxx \
|
||||||
paletteGroup.h pTexture.cxx pTexture.h sourceEgg.cxx \
|
// paletteGroup.h pTexture.cxx pTexture.h sourceEgg.cxx \
|
||||||
sourceEgg.h string_utils.cxx string_utils.h \
|
// sourceEgg.h string_utils.cxx string_utils.h \
|
||||||
textureEggRef.cxx textureEggRef.h textureOmitReason.h \
|
// textureEggRef.cxx textureEggRef.h textureOmitReason.h \
|
||||||
texturePacking.cxx \
|
// texturePacking.cxx \
|
||||||
texturePacking.h userAttribLine.cxx userAttribLine.h
|
// texturePacking.h userAttribLine.cxx userAttribLine.h
|
||||||
|
|
||||||
#define INSTALL_HEADERS
|
// #define INSTALL_HEADERS
|
||||||
|
|
||||||
#end bin_target
|
// #end bin_target
|
||||||
|
@ -1,30 +1,30 @@
|
|||||||
// #begin bin_target
|
#begin bin_target
|
||||||
// #define TARGET egg-palettize
|
#define TARGET egg-palettize
|
||||||
// #define LOCAL_LIBS \
|
#define LOCAL_LIBS \
|
||||||
// eggbase progbase
|
eggbase progbase
|
||||||
// #define OTHER_LIBS \
|
#define OTHER_LIBS \
|
||||||
// egg:c loader:c linmath:c putil:c express:c pnmimage:c pnmimagetypes:c \
|
egg:c loader:c linmath:c putil:c express:c pnmimage:c pnmimagetypes:c \
|
||||||
// pandaegg:m panda:m pandaexpress:m \
|
pandaegg:m panda:m pandaexpress:m \
|
||||||
// dtoolutil:c dconfig:c dtool:m pystub
|
dtoolutil:c dconfig:c dtool:m pystub
|
||||||
|
|
||||||
// #define SOURCES \
|
#define SOURCES \
|
||||||
// config_egg_palettize.cxx config_egg_palettize.h \
|
config_egg_palettize.cxx config_egg_palettize.h \
|
||||||
// destTextureImage.cxx destTextureImage.h \
|
destTextureImage.cxx destTextureImage.h \
|
||||||
// eggFile.cxx eggFile.h eggPalettize.cxx eggPalettize.h \
|
eggFile.cxx eggFile.h eggPalettize.cxx eggPalettize.h \
|
||||||
// filenameUnifier.cxx filenameUnifier.h \
|
filenameUnifier.cxx filenameUnifier.h \
|
||||||
// imageFile.cxx imageFile.h omitReason.cxx omitReason.h \
|
imageFile.cxx imageFile.h omitReason.cxx omitReason.h \
|
||||||
// paletteGroup.h paletteGroup.cxx \
|
paletteGroup.h paletteGroup.cxx \
|
||||||
// paletteGroups.h paletteGroups.cxx paletteImage.h paletteImage.cxx \
|
paletteGroups.h paletteGroups.cxx paletteImage.h paletteImage.cxx \
|
||||||
// palettePage.cxx palettePage.h \
|
palettePage.cxx palettePage.h \
|
||||||
// palettizer.cxx palettizer.h \
|
palettizer.cxx palettizer.h \
|
||||||
// sourceTextureImage.cxx sourceTextureImage.h string_utils.cxx \
|
sourceTextureImage.cxx sourceTextureImage.h string_utils.cxx \
|
||||||
// string_utils.h textureImage.cxx textureImage.h \
|
string_utils.h textureImage.cxx textureImage.h \
|
||||||
// texturePlacement.cxx texturePlacement.h \
|
texturePlacement.cxx texturePlacement.h \
|
||||||
// texturePosition.cxx texturePosition.h \
|
texturePosition.cxx texturePosition.h \
|
||||||
// textureProperties.cxx textureProperties.h textureReference.cxx \
|
textureProperties.cxx textureProperties.h textureReference.cxx \
|
||||||
// textureReference.h textureRequest.h textureRequest.cxx \
|
textureReference.h textureRequest.h textureRequest.cxx \
|
||||||
// txaFile.cxx txaFile.h \
|
txaFile.cxx txaFile.h \
|
||||||
// txaLine.cxx txaLine.h
|
txaLine.cxx txaLine.h
|
||||||
|
|
||||||
// #end bin_target
|
#end bin_target
|
||||||
|
|
||||||
|
@ -16,6 +16,8 @@
|
|||||||
#include <datagramIterator.h>
|
#include <datagramIterator.h>
|
||||||
#include <bamReader.h>
|
#include <bamReader.h>
|
||||||
#include <bamWriter.h>
|
#include <bamWriter.h>
|
||||||
|
#include <executionEnvironment.h>
|
||||||
|
#include <dSearchPath.h>
|
||||||
|
|
||||||
TypeHandle EggFile::_type_handle;
|
TypeHandle EggFile::_type_handle;
|
||||||
|
|
||||||
@ -44,6 +46,12 @@ from_command_line(EggData *data,
|
|||||||
const Filename &source_filename,
|
const Filename &source_filename,
|
||||||
const Filename &dest_filename) {
|
const Filename &dest_filename) {
|
||||||
_data = data;
|
_data = data;
|
||||||
|
|
||||||
|
// We save the current directory at the time the egg file appeared
|
||||||
|
// on the command line, so that we'll later be able to properly
|
||||||
|
// resolve external references (like textures) that might be
|
||||||
|
// relative to this directory.
|
||||||
|
_current_directory = ExecutionEnvironment::get_cwd();
|
||||||
_source_filename = source_filename;
|
_source_filename = source_filename;
|
||||||
_dest_filename = dest_filename;
|
_dest_filename = dest_filename;
|
||||||
|
|
||||||
@ -367,6 +375,14 @@ read_egg() {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// We also want to search for filenames based on our current
|
||||||
|
// directory from which we originally loaded the egg file. This is
|
||||||
|
// important because it's possible the egg file referenced some
|
||||||
|
// textures or something relative to that directory.
|
||||||
|
DSearchPath dir;
|
||||||
|
dir.append_directory(_current_directory);
|
||||||
|
data->resolve_filenames(dir);
|
||||||
|
|
||||||
if (!data->resolve_externals()) {
|
if (!data->resolve_externals()) {
|
||||||
// Failure reading an external.
|
// Failure reading an external.
|
||||||
delete data;
|
delete data;
|
||||||
@ -390,7 +406,8 @@ write_egg() {
|
|||||||
nassertr(!_dest_filename.empty(), false);
|
nassertr(!_dest_filename.empty(), false);
|
||||||
|
|
||||||
_dest_filename.make_dir();
|
_dest_filename.make_dir();
|
||||||
nout << "Writing " << _dest_filename << "\n";
|
nout << "Writing " << FilenameUnifier::make_user_filename(_dest_filename)
|
||||||
|
<< "\n";
|
||||||
if (!_data->write_egg(_dest_filename)) {
|
if (!_data->write_egg(_dest_filename)) {
|
||||||
// Some error while writing. Most unusual.
|
// Some error while writing. Most unusual.
|
||||||
_is_stale = true;
|
_is_stale = true;
|
||||||
@ -464,6 +481,7 @@ write_datagram(BamWriter *writer, Datagram &datagram) {
|
|||||||
|
|
||||||
// We don't write out _data; that needs to be reread each session.
|
// We don't write out _data; that needs to be reread each session.
|
||||||
|
|
||||||
|
datagram.add_string(FilenameUnifier::make_bam_filename(_current_directory));
|
||||||
datagram.add_string(FilenameUnifier::make_bam_filename(_source_filename));
|
datagram.add_string(FilenameUnifier::make_bam_filename(_source_filename));
|
||||||
datagram.add_string(FilenameUnifier::make_bam_filename(_dest_filename));
|
datagram.add_string(FilenameUnifier::make_bam_filename(_dest_filename));
|
||||||
|
|
||||||
@ -545,6 +563,7 @@ make_EggFile(const FactoryParams ¶ms) {
|
|||||||
void EggFile::
|
void EggFile::
|
||||||
fillin(DatagramIterator &scan, BamReader *manager) {
|
fillin(DatagramIterator &scan, BamReader *manager) {
|
||||||
set_name(scan.get_string());
|
set_name(scan.get_string());
|
||||||
|
_current_directory = FilenameUnifier::get_bam_filename(scan.get_string());
|
||||||
_source_filename = FilenameUnifier::get_bam_filename(scan.get_string());
|
_source_filename = FilenameUnifier::get_bam_filename(scan.get_string());
|
||||||
_dest_filename = FilenameUnifier::get_bam_filename(scan.get_string());
|
_dest_filename = FilenameUnifier::get_bam_filename(scan.get_string());
|
||||||
|
|
||||||
|
@ -67,6 +67,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
EggData *_data;
|
EggData *_data;
|
||||||
|
Filename _current_directory;
|
||||||
Filename _source_filename;
|
Filename _source_filename;
|
||||||
Filename _dest_filename;
|
Filename _dest_filename;
|
||||||
|
|
||||||
|
@ -335,9 +335,9 @@ run() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (_all_textures) {
|
if (_all_textures) {
|
||||||
pal->process_all();
|
pal->process_all(_redo_all);
|
||||||
} else {
|
} else {
|
||||||
pal->process_command_line_eggs();
|
pal->process_command_line_eggs(_redo_all);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_force_optimal) {
|
if (_force_optimal) {
|
||||||
|
@ -25,6 +25,9 @@ void FilenameUnifier::
|
|||||||
set_txa_filename(const Filename &txa_filename) {
|
set_txa_filename(const Filename &txa_filename) {
|
||||||
_txa_filename = txa_filename;
|
_txa_filename = txa_filename;
|
||||||
_txa_dir = txa_filename.get_dirname();
|
_txa_dir = txa_filename.get_dirname();
|
||||||
|
if (_txa_dir.empty()) {
|
||||||
|
_txa_dir = ".";
|
||||||
|
}
|
||||||
_txa_dir.make_canonical();
|
_txa_dir.make_canonical();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -193,9 +193,13 @@ read_txa_file(const Filename &txa_filename) {
|
|||||||
// Description: Processes all the textures named in the
|
// Description: Processes all the textures named in the
|
||||||
// _command_line_eggs, placing them on the appropriate
|
// _command_line_eggs, placing them on the appropriate
|
||||||
// palettes or whatever needs to be done with them.
|
// palettes or whatever needs to be done with them.
|
||||||
|
//
|
||||||
|
// If force_texture_read is true, it forces each texture
|
||||||
|
// image file to be read (and thus legitimately checked
|
||||||
|
// for grayscaleness etc.) before placing.
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
void Palettizer::
|
void Palettizer::
|
||||||
process_command_line_eggs() {
|
process_command_line_eggs(bool force_texture_read) {
|
||||||
_command_line_textures.clear();
|
_command_line_textures.clear();
|
||||||
|
|
||||||
// Start by scanning all the egg files we read up on the command
|
// Start by scanning all the egg files we read up on the command
|
||||||
@ -222,6 +226,10 @@ process_command_line_eggs() {
|
|||||||
++ti) {
|
++ti) {
|
||||||
TextureImage *texture = *ti;
|
TextureImage *texture = *ti;
|
||||||
|
|
||||||
|
if (force_texture_read) {
|
||||||
|
texture->read_source_image();
|
||||||
|
}
|
||||||
|
|
||||||
texture->pre_txa_file();
|
texture->pre_txa_file();
|
||||||
_txa_file.match_texture(texture);
|
_txa_file.match_texture(texture);
|
||||||
texture->post_txa_file();
|
texture->post_txa_file();
|
||||||
@ -273,9 +281,13 @@ process_command_line_eggs() {
|
|||||||
// Function: Palettizer::process_all
|
// Function: Palettizer::process_all
|
||||||
// Access: Public
|
// Access: Public
|
||||||
// Description: Reprocesses all textures known.
|
// Description: Reprocesses all textures known.
|
||||||
|
//
|
||||||
|
// If force_texture_read is true, it forces each texture
|
||||||
|
// image file to be read (and thus legitimately checked
|
||||||
|
// for grayscaleness etc.) before placing.
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
void Palettizer::
|
void Palettizer::
|
||||||
process_all() {
|
process_all(bool force_texture_read) {
|
||||||
// If there *were* any egg files on the command line, deal with
|
// If there *were* any egg files on the command line, deal with
|
||||||
// them.
|
// them.
|
||||||
CommandLineEggs::const_iterator ei;
|
CommandLineEggs::const_iterator ei;
|
||||||
@ -304,6 +316,10 @@ process_all() {
|
|||||||
for (ti = _textures.begin(); ti != _textures.end(); ++ti) {
|
for (ti = _textures.begin(); ti != _textures.end(); ++ti) {
|
||||||
TextureImage *texture = (*ti).second;
|
TextureImage *texture = (*ti).second;
|
||||||
|
|
||||||
|
if (force_texture_read) {
|
||||||
|
texture->read_source_image();
|
||||||
|
}
|
||||||
|
|
||||||
texture->pre_txa_file();
|
texture->pre_txa_file();
|
||||||
_txa_file.match_texture(texture);
|
_txa_file.match_texture(texture);
|
||||||
texture->post_txa_file();
|
texture->post_txa_file();
|
||||||
|
@ -35,8 +35,8 @@ public:
|
|||||||
|
|
||||||
void report_pi() const;
|
void report_pi() const;
|
||||||
void read_txa_file(const Filename &txa_filename);
|
void read_txa_file(const Filename &txa_filename);
|
||||||
void process_command_line_eggs();
|
void process_command_line_eggs(bool force_texture_read);
|
||||||
void process_all();
|
void process_all(bool force_texture_read);
|
||||||
void optimal_resize();
|
void optimal_resize();
|
||||||
void reset_images();
|
void reset_images();
|
||||||
void generate_images(bool redo_all);
|
void generate_images(bool redo_all);
|
||||||
|
@ -29,6 +29,9 @@ TextureImage() {
|
|||||||
_read_source_image = false;
|
_read_source_image = false;
|
||||||
_got_dest_image = false;
|
_got_dest_image = false;
|
||||||
_is_surprise = true;
|
_is_surprise = true;
|
||||||
|
_ever_read_image = false;
|
||||||
|
_forced_grayscale = false;
|
||||||
|
_forced_unalpha = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
@ -55,7 +58,13 @@ note_egg_file(EggFile *egg_file) {
|
|||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
void TextureImage::
|
void TextureImage::
|
||||||
assign_groups() {
|
assign_groups() {
|
||||||
nassertv(!_egg_files.empty());
|
if (_egg_files.empty()) {
|
||||||
|
// If we're not referenced by any egg files any more, assign us to
|
||||||
|
// no groups.
|
||||||
|
PaletteGroups empty;
|
||||||
|
assign_to_groups(empty);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
PaletteGroups definitely_in;
|
PaletteGroups definitely_in;
|
||||||
|
|
||||||
@ -265,12 +274,12 @@ post_txa_file() {
|
|||||||
} else {
|
} else {
|
||||||
// If we didn't request a particular number of channels, examine
|
// If we didn't request a particular number of channels, examine
|
||||||
// the image to determine if we can downgrade it, for instance
|
// the image to determine if we can downgrade it, for instance
|
||||||
// from color to grayscale.
|
// from color to grayscale.
|
||||||
if (_properties._got_num_channels &&
|
if (_properties._got_num_channels &&
|
||||||
(_properties._num_channels == 3 || _properties._num_channels == 4)) {
|
(_properties._num_channels == 3 || _properties._num_channels == 4)) {
|
||||||
consider_grayscale();
|
consider_grayscale();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Also consider downgrading from alpha to non-alpha.
|
// Also consider downgrading from alpha to non-alpha.
|
||||||
if (_properties._got_num_channels &&
|
if (_properties._got_num_channels &&
|
||||||
(_properties._num_channels == 2 || _properties._num_channels == 4)) {
|
(_properties._num_channels == 2 || _properties._num_channels == 4)) {
|
||||||
@ -504,6 +513,7 @@ read_source_image() {
|
|||||||
source->read(_source_image);
|
source->read(_source_image);
|
||||||
}
|
}
|
||||||
_read_source_image = true;
|
_read_source_image = true;
|
||||||
|
_ever_read_image = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return _source_image;
|
return _source_image;
|
||||||
@ -570,7 +580,24 @@ write_source_pathnames(ostream &out, int indent_level) const {
|
|||||||
void TextureImage::
|
void TextureImage::
|
||||||
write_scale_info(ostream &out, int indent_level) {
|
write_scale_info(ostream &out, int indent_level) {
|
||||||
SourceTextureImage *source = get_preferred_source();
|
SourceTextureImage *source = get_preferred_source();
|
||||||
indent(out, indent_level) << get_name() << " orig ";
|
indent(out, indent_level) << get_name();
|
||||||
|
|
||||||
|
// Write the list of groups we're placed in.
|
||||||
|
if (_placement.empty()) {
|
||||||
|
out << " (not used)";
|
||||||
|
} else {
|
||||||
|
Placement::const_iterator pi;
|
||||||
|
pi = _placement.begin();
|
||||||
|
out << " (" << (*pi).second->get_group()->get_name();
|
||||||
|
++pi;
|
||||||
|
while (pi != _placement.end()) {
|
||||||
|
out << " " << (*pi).second->get_group()->get_name();
|
||||||
|
++pi;
|
||||||
|
}
|
||||||
|
out << ")";
|
||||||
|
}
|
||||||
|
|
||||||
|
out << " orig ";
|
||||||
|
|
||||||
if (source == (SourceTextureImage *)NULL ||
|
if (source == (SourceTextureImage *)NULL ||
|
||||||
!source->is_size_known()) {
|
!source->is_size_known()) {
|
||||||
@ -694,6 +721,19 @@ assign_to_groups(const PaletteGroups &groups) {
|
|||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
void TextureImage::
|
void TextureImage::
|
||||||
consider_grayscale() {
|
consider_grayscale() {
|
||||||
|
// Since this isn't likely to change for a particular texture after
|
||||||
|
// its creation, we save a bit of time by not performing this check
|
||||||
|
// unless this is the first time we've ever seen this texture. This
|
||||||
|
// will save us from having to load the texture images time we look
|
||||||
|
// at them. On the other hand, if we've already loaded up the
|
||||||
|
// image, then go ahead.
|
||||||
|
if (!_read_source_image && _ever_read_image) {
|
||||||
|
if (_forced_grayscale) {
|
||||||
|
_properties._num_channels -= 2;
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const PNMImage &source = read_source_image();
|
const PNMImage &source = read_source_image();
|
||||||
if (!source.is_valid()) {
|
if (!source.is_valid()) {
|
||||||
return;
|
return;
|
||||||
@ -704,6 +744,7 @@ consider_grayscale() {
|
|||||||
const xel &v = source.get_xel_val(x, y);
|
const xel &v = source.get_xel_val(x, y);
|
||||||
if (PPM_GETR(v) != PPM_GETG(v) || PPM_GETR(v) != PPM_GETB(v)) {
|
if (PPM_GETR(v) != PPM_GETG(v) || PPM_GETR(v) != PPM_GETB(v)) {
|
||||||
// Here's a colored pixel. We can't go grayscale.
|
// Here's a colored pixel. We can't go grayscale.
|
||||||
|
_forced_grayscale = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -711,6 +752,7 @@ consider_grayscale() {
|
|||||||
|
|
||||||
// All pixels in the image were grayscale!
|
// All pixels in the image were grayscale!
|
||||||
_properties._num_channels -= 2;
|
_properties._num_channels -= 2;
|
||||||
|
_forced_grayscale = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
@ -723,6 +765,15 @@ consider_grayscale() {
|
|||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
void TextureImage::
|
void TextureImage::
|
||||||
consider_unalpha() {
|
consider_unalpha() {
|
||||||
|
// As above, we don't bother doing this if we've already done this
|
||||||
|
// in a previous session.
|
||||||
|
if (!_read_source_image && _ever_read_image) {
|
||||||
|
if (_forced_unalpha) {
|
||||||
|
_properties._num_channels--;
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const PNMImage &source = read_source_image();
|
const PNMImage &source = read_source_image();
|
||||||
if (!source.is_valid()) {
|
if (!source.is_valid()) {
|
||||||
return;
|
return;
|
||||||
@ -736,6 +787,7 @@ consider_unalpha() {
|
|||||||
for (int x = 0; x < source.get_x_size(); x++) {
|
for (int x = 0; x < source.get_x_size(); x++) {
|
||||||
if (source.get_alpha_val(x, y) != source.get_maxval()) {
|
if (source.get_alpha_val(x, y) != source.get_maxval()) {
|
||||||
// Here's a non-white pixel; the alpha channel is meaningful.
|
// Here's a non-white pixel; the alpha channel is meaningful.
|
||||||
|
_forced_unalpha = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -743,6 +795,7 @@ consider_unalpha() {
|
|||||||
|
|
||||||
// All alpha pixels in the image were white!
|
// All alpha pixels in the image were white!
|
||||||
_properties._num_channels--;
|
_properties._num_channels--;
|
||||||
|
_forced_unalpha = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
@ -860,6 +913,9 @@ write_datagram(BamWriter *writer, Datagram &datagram) {
|
|||||||
// session.
|
// session.
|
||||||
|
|
||||||
datagram.add_bool(_is_surprise);
|
datagram.add_bool(_is_surprise);
|
||||||
|
datagram.add_bool(_ever_read_image);
|
||||||
|
datagram.add_bool(_forced_grayscale);
|
||||||
|
datagram.add_bool(_forced_unalpha);
|
||||||
|
|
||||||
// We don't write out _explicitly_assigned_groups; this is re-read
|
// We don't write out _explicitly_assigned_groups; this is re-read
|
||||||
// from the .txa file each time.
|
// from the .txa file each time.
|
||||||
@ -971,6 +1027,9 @@ fillin(DatagramIterator &scan, BamReader *manager) {
|
|||||||
set_name(scan.get_string());
|
set_name(scan.get_string());
|
||||||
|
|
||||||
_is_surprise = scan.get_bool();
|
_is_surprise = scan.get_bool();
|
||||||
|
_ever_read_image = scan.get_bool();
|
||||||
|
_forced_grayscale = scan.get_bool();
|
||||||
|
_forced_unalpha = scan.get_bool();
|
||||||
|
|
||||||
_actual_assigned_groups.fillin(scan, manager);
|
_actual_assigned_groups.fillin(scan, manager);
|
||||||
|
|
||||||
|
@ -92,6 +92,10 @@ private:
|
|||||||
TextureProperties _pre_txa_properties;
|
TextureProperties _pre_txa_properties;
|
||||||
SourceTextureImage *_preferred_source;
|
SourceTextureImage *_preferred_source;
|
||||||
bool _is_surprise;
|
bool _is_surprise;
|
||||||
|
|
||||||
|
bool _ever_read_image;
|
||||||
|
bool _forced_grayscale;
|
||||||
|
bool _forced_unalpha;
|
||||||
|
|
||||||
PaletteGroups _explicitly_assigned_groups;
|
PaletteGroups _explicitly_assigned_groups;
|
||||||
PaletteGroups _actual_assigned_groups;
|
PaletteGroups _actual_assigned_groups;
|
||||||
|
@ -123,6 +123,9 @@ get_group() const {
|
|||||||
void TexturePlacement::
|
void TexturePlacement::
|
||||||
add_egg(TextureReference *reference) {
|
add_egg(TextureReference *reference) {
|
||||||
reference->mark_egg_stale();
|
reference->mark_egg_stale();
|
||||||
|
|
||||||
|
// Turns out that turning these off is a bad idea, because it may
|
||||||
|
// make us forget the size information halfway through processing.
|
||||||
/*
|
/*
|
||||||
_has_uvs = false;
|
_has_uvs = false;
|
||||||
_size_known = false;
|
_size_known = false;
|
||||||
@ -207,11 +210,17 @@ determine_size() {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This seems to be unnecessary (because of omit_solitary() and
|
||||||
|
// not_solitary()), and in fact bitches the logic in omit_solitary()
|
||||||
|
// and not_solitary() so that we call mark_egg_stale()
|
||||||
|
// unnecessarily.
|
||||||
|
/*
|
||||||
if (_omit_reason == OR_solitary) {
|
if (_omit_reason == OR_solitary) {
|
||||||
// If the texture was previously 'omitted' for being solitary, we
|
// If the texture was previously 'omitted' for being solitary, we
|
||||||
// give it a second chance now.
|
// give it a second chance now.
|
||||||
_omit_reason = OR_none;
|
_omit_reason = OR_none;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
// Determine the actual minmax of the UV's in use, as well as
|
// Determine the actual minmax of the UV's in use, as well as
|
||||||
// whether we should wrap or clamp.
|
// whether we should wrap or clamp.
|
||||||
@ -552,8 +561,10 @@ force_replace() {
|
|||||||
_image->unplace(this);
|
_image->unplace(this);
|
||||||
_image = (PaletteImage *)NULL;
|
_image = (PaletteImage *)NULL;
|
||||||
}
|
}
|
||||||
|
if (_omit_reason == OR_none) {
|
||||||
|
mark_eggs_stale();
|
||||||
|
}
|
||||||
_omit_reason = OR_working;
|
_omit_reason = OR_working;
|
||||||
mark_eggs_stale();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
|
Loading…
x
Reference in New Issue
Block a user