Selaa lähdekoodia

*** empty log message ***

David Rose 25 vuotta sitten
vanhempi
sitoutus
fdeb7dfec8

+ 2 - 2
pandatool/src/eggbase/eggWriter.cxx

@@ -89,7 +89,7 @@ EggWriter(bool allow_last_param, bool allow_stdout) :
 
 
 ////////////////////////////////////////////////////////////////////
-//     Function: EggWriter::add_normals_options();
+//     Function: EggWriter::add_normals_options
 //       Access: Public
 //  Description: Adds -no, -np, etc. as valid options for this
 //               program.  If the user specifies one of the options on
@@ -127,7 +127,7 @@ add_normals_options() {
 }
 
 ////////////////////////////////////////////////////////////////////
-//     Function: EggWriter::add_transform_options();
+//     Function: EggWriter::add_transform_options
 //       Access: Public
 //  Description: Adds -TS, -TT, etc. as valid options for this
 //               program.  If the user specifies one of the options on

+ 15 - 5
pandatool/src/eggbase/somethingToEgg.cxx

@@ -36,6 +36,21 @@ SomethingToEgg(const string &format_name,
      "Specify the coordinate system of the input " + _format_name +
      " file.  Normally, this can inferred from the file itself.");
 
+  _input_units = DU_invalid;
+  _output_units = DU_invalid;
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: SomethingToEgg::add_units_options
+//       Access: Public
+//  Description: Adds -ui and -uo as valid options for this program.
+//               If the user specifies -uo and -ui, or just -uo and
+//               the program specifies -ui by setting _input_units,
+//               the indicated units conversion will be automatically
+//               applied before writing out the egg file.
+////////////////////////////////////////////////////////////////////
+void SomethingToEgg::
+add_units_options() {
   add_option
     ("ui", "units", 40, 
      "Specify the units of the input " + _format_name +
@@ -49,11 +64,6 @@ SomethingToEgg(const string &format_name,
      "necessary to make the appropriate units conversion; otherwise, "
      "the vertices will be left as they are.",
      &SomethingToEgg::dispatch_units, NULL, &_output_units);
-
-  _input_units = DU_invalid;
-  _output_units = DU_invalid;
-
-  add_transform_options();
 }
 
 ////////////////////////////////////////////////////////////////////

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

@@ -26,6 +26,8 @@ public:
 		 bool allow_last_param = true,
 		 bool allow_stdout = true);
 
+  void add_units_options();
+
 protected:
   void apply_units_scale(EggData &data);
 

+ 2 - 0
pandatool/src/fltprogs/fltToEgg.cxx

@@ -16,7 +16,9 @@ FltToEgg::
 FltToEgg() :
   SomethingToEgg("MultiGen", ".flt")
 {
+  add_units_options();
   add_normals_options();
+  add_transform_options();
 
   set_program_description
     ("This program converts MultiGen OpenFlight (.flt) files to egg.  Most "