Răsfoiți Sursa

don't make directories for incorrect files, and put alpha 1 on red could-not-find textures

David Rose 22 ani în urmă
părinte
comite
218659244f

+ 4 - 0
pandatool/src/egg-palettize/destTextureImage.cxx

@@ -82,6 +82,10 @@ copy(TextureImage *texture) {
     // Couldn't read the texture, so fill it with red.
     // Couldn't read the texture, so fill it with red.
     PNMImage dest_image(_x_size, _y_size, texture->get_num_channels());
     PNMImage dest_image(_x_size, _y_size, texture->get_num_channels());
     dest_image.fill(1.0, 0.0, 0.0);
     dest_image.fill(1.0, 0.0, 0.0);
+    if (dest_image.has_alpha()) {
+      dest_image.alpha_fill(1.0);
+    }
+
     write(dest_image);
     write(dest_image);
   }
   }
 }
 }

+ 0 - 4
pandatool/src/egg-palettize/filenameUnifier.cxx

@@ -134,9 +134,6 @@ make_user_filename(Filename filename) {
 //               caches the operation so that repeated calls to
 //               caches the operation so that repeated calls to
 //               filenames in the same directory will tend to be
 //               filenames in the same directory will tend to be
 //               faster.
 //               faster.
-//
-//               Also guarantees that the directory containing the
-//               filename exists by making it if it does not.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 void FilenameUnifier::
 void FilenameUnifier::
 make_canonical(Filename &filename) {
 make_canonical(Filename &filename) {
@@ -153,7 +150,6 @@ make_canonical(Filename &filename) {
     return;
     return;
   }
   }
 
 
-  filename.make_dir();
   filename.make_canonical();
   filename.make_canonical();
   _canonical_filenames.insert(CanonicalFilenames::value_type(dirname, filename.get_dirname()));
   _canonical_filenames.insert(CanonicalFilenames::value_type(dirname, filename.get_dirname()));
 }
 }