diff --git a/panda/src/putil/string_utils.cxx b/panda/src/putil/string_utils.cxx index 8f82abd0e2..a6db3ebd3f 100644 --- a/panda/src/putil/string_utils.cxx +++ b/panda/src/putil/string_utils.cxx @@ -51,6 +51,11 @@ cmp_nocase_uh(const string &s, const string &s2) { +//////////////////////////////////////////////////////////////////// +// Function: downcase +// Description: Returns the input string with all uppercase letters +// converted to lowercase. +//////////////////////////////////////////////////////////////////// string downcase(const string &s) { string result; @@ -61,6 +66,21 @@ downcase(const string &s) { return result; } +//////////////////////////////////////////////////////////////////// +// Function: upcase +// Description: Returns the input string with all lowercase letters +// converted to uppercase. +//////////////////////////////////////////////////////////////////// +string +upcase(const string &s) { + string result; + string::const_iterator p; + for (p = s.begin(); p != s.end(); ++p) { + result += toupper(*p); + } + return result; +} + //////////////////////////////////////////////////////////////////// // Function: extract_words diff --git a/panda/src/putil/string_utils.h b/panda/src/putil/string_utils.h index 29db5201eb..c763f3378b 100644 --- a/panda/src/putil/string_utils.h +++ b/panda/src/putil/string_utils.h @@ -21,6 +21,9 @@ EXPCL_PANDA int cmp_nocase_uh(const string &s, const string &s2); // Returns the string converted to lowercase. EXPCL_PANDA string downcase(const string &s); +// Returns the string converted to uppercase. +EXPCL_PANDA string upcase(const string &s); + // Separates the string into words according to whitespace. EXPCL_PANDA int extract_words(const string &str, vector_string &words); diff --git a/pandatool/src/egg-palettize/textureImage.cxx b/pandatool/src/egg-palettize/textureImage.cxx index 377a9afb97..8b17c0bb94 100644 --- a/pandatool/src/egg-palettize/textureImage.cxx +++ b/pandatool/src/egg-palettize/textureImage.cxx @@ -17,6 +17,7 @@ #include #include #include +#include TypeHandle TextureImage::_type_handle; @@ -297,6 +298,11 @@ post_txa_file() { _properties._magfilter = _request._magfilter; } + if (_properties._color_type == (PNMFileType *)NULL) { + _properties._color_type = _request._properties._color_type; + _properties._alpha_type = _request._properties._alpha_type; + } + // Finally, make sure our properties are fully defined. _properties.fully_define(); diff --git a/pandatool/src/egg-palettize/textureProperties.cxx b/pandatool/src/egg-palettize/textureProperties.cxx index b16e0aed57..972eb329a3 100644 --- a/pandatool/src/egg-palettize/textureProperties.cxx +++ b/pandatool/src/egg-palettize/textureProperties.cxx @@ -487,6 +487,10 @@ union_format(EggTexture::Format a, EggTexture::Format b) { case EggTexture::F_rgba8: case EggTexture::F_rgba4: case EggTexture::F_rgba5: + case EggTexture::F_red: + case EggTexture::F_green: + case EggTexture::F_blue: + case EggTexture::F_alpha: return b; default: diff --git a/pandatool/src/egg-palettize/txaLine.cxx b/pandatool/src/egg-palettize/txaLine.cxx index f5badeec4d..a2304bf495 100644 --- a/pandatool/src/egg-palettize/txaLine.cxx +++ b/pandatool/src/egg-palettize/txaLine.cxx @@ -470,6 +470,10 @@ output(ostream &out) const { out << " " << (*gi)->get_name(); } + if (_format != EggTexture::F_unspecified) { + out << " " << _format; + } + if (_color_type != (PNMFileType *)NULL) { out << " " << _color_type->get_suggested_extension(); if (_alpha_type != (PNMFileType *)NULL) {