Browse Source

add -noexist, flt2egg should call from_os_specific

David Rose 21 years ago
parent
commit
f1671ce1a6

+ 9 - 1
pandatool/src/eggbase/somethingToEgg.cxx

@@ -60,6 +60,14 @@ SomethingToEgg(const string &format_name,
      "which should be self-contained and include only relative pathnames.",
      &SomethingToEgg::dispatch_none, &_noabs);
 
+  add_option
+    ("noexist", "", 0,
+     "Don't treat it as an error if the input file references pathnames "
+     "(e.g. textures) that don't exist.  Normally, this will be flagged as "
+     "an error and the command aborted; with this option, an egg file will "
+     "be generated anyway, referencing pathnames that do not exist.",
+     &SomethingToEgg::dispatch_none, &_noexist);
+
   add_option
     ("ignore", "", 0,
      "Ignore non-fatal errors and generate an egg file anyway.",
@@ -209,7 +217,7 @@ apply_units_scale(EggData &data) {
 void SomethingToEgg::
 apply_parameters(SomethingToEggConverter &converter) {
   _path_replace->_noabs = _noabs;
-  _path_replace->_exists = true;
+  _path_replace->_exists = !_noexist;
   converter.set_path_replace(_path_replace);
 
   converter.set_animation_convert(_animation_convert);

+ 1 - 0
pandatool/src/eggbase/somethingToEgg.h

@@ -76,6 +76,7 @@ protected:
   bool _got_output_frame_rate;
 
   bool _merge_externals;
+  bool _noexist;
   bool _allow_errors;
 };
 

+ 1 - 1
pandatool/src/flt/fltExternalReference.cxx

@@ -120,7 +120,7 @@ extract_record(FltRecordReader &reader) {
       _bead_id = name.substr(open + 1, name.length() - open - 2);
     }
   }
-  _converted_filename = _header->convert_path(_orig_filename);
+  _converted_filename = _header->convert_path(Filename::from_os_specific(_orig_filename));
 
   check_remaining_size(iterator);
   return true;

+ 1 - 1
pandatool/src/flt/fltTexture.cxx

@@ -246,7 +246,7 @@ extract_record(FltRecordReader &reader) {
   } else {
     _orig_filename = iterator.get_fixed_string(200);
   }
-  _converted_filename = _header->convert_path(_orig_filename, get_texture_path());
+  _converted_filename = _header->convert_path(Filename::from_os_specific(_orig_filename), get_texture_path());
   _pattern_index = iterator.get_be_int32();
   _x_location = iterator.get_be_int32();
   _y_location = iterator.get_be_int32();