Browse Source

*** empty log message ***

David Rose 25 years ago
parent
commit
7bc76af81d

+ 20 - 0
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

+ 3 - 0
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);
 

+ 6 - 0
pandatool/src/egg-palettize/textureImage.cxx

@@ -17,6 +17,7 @@
 #include <datagramIterator.h>
 #include <bamReader.h>
 #include <bamWriter.h>
+#include <pnmFileType.h>
 
 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();
 

+ 4 - 0
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:

+ 4 - 0
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) {