]> git.mxchange.org Git - flightgear.git/commitdiff
Changes to allow multiple copies of the scenery processing tools
authorcurt <curt>
Thu, 17 Sep 1998 18:40:15 +0000 (18:40 +0000)
committercurt <curt>
Thu, 17 Sep 1998 18:40:15 +0000 (18:40 +0000)
to be run concurrently.

Stripe_w/bands.c
Stripe_w/options.c
Tools/process-dem.pl

index 981c132556f9d2507c842a991de2903edb4d55cc..1992795a6046f6dfe16faaf7e2d5e57b81af64e3 100644 (file)
@@ -93,7 +93,7 @@ void get_time()
 
 int main (int argc,char *argv[])
 {
-  char *fname,*all,buff[255], *ptr, *ptr2;
+  char *fname, *oname, *all,buff[255], *ptr, *ptr2;
        FILE    *file, *bands;
        int face_id=0;
   int vert_count=0;
@@ -125,27 +125,29 @@ int main (int argc,char *argv[])
 
   get_time();
 
-  /*   File that will contain the triangle strip data */
-  bands = fopen("stripe.objf","w");
-
   /*
-       Scan the file once to find out the number of vertices,
-       vertice normals, and faces so we can set up some memory
-       structures 
-       */
-       /* Interpret the options specified */
-       norm_difference = get_options(argc,argv,&f,&t,&tr,&g);
+    Scan the file once to find out the number of vertices,
+    vertice normals, and faces so we can set up some memory
+    structures 
+    */
+  /* Interpret the options specified */
+  norm_difference = get_options(argc,argv,&f,&t,&tr,&g);
   if (f == BINARY)
-    file_open = "rb";
+      file_open = "rb";
   else
-    file_open = "r";
-
-       fname = argv[argc-1];
-
-  printf ("File: %s\n",fname);
-       printf ("Scanning...%s ",file_open);
+      file_open = "r";
+  
+  fname = argv[argc-2];
+  oname = argv[argc-1];
+  
+  printf ("Input file: %s  Output file: %s\n", fname, oname);
+  printf ("Scanning...%s ",file_open);
 
            
+  /*   File that will contain the triangle strip data */
+  
+  bands = fopen(oname, "w");
+
   /*   File can be in binary for faster reading */
   if (file = fopen (fname,file_open))
        {
index cbc9d4e15c029e5c5eb6bdc94c6f1a52772475d9..7e1243e247c7c60edf4bcd16717816fe473badb6 100644 (file)
@@ -84,7 +84,7 @@ double get_options(int argc, char **argv, int *f, int *t, int *tr, int *group)
      /*      User has the wrong number of options */
        if ((argc > 5) || (argc < 2))
        {
-               printf("Usage: bands -[file_option][ties_option][triangulation_option][normal_difference] file_name\n");
+               printf("Usage: bands -[file_option][ties_option][triangulation_option][normal_difference] in_file_name out_file_name\n");
                exit(0);
        }
        
index ad791d10d17aa4660c712ba17025eda503963c42..d81f53b4aa82e600ceb0651f830f23051191ea5c 100755 (executable)
@@ -30,7 +30,7 @@
 $scenery_format_version = "0.1";
 
 $max_area = 10000;            # maximum triangle area
-$remove_tmps = 0;
+$remove_tmps = 1;
 
 $| = 1;                         # flush buffers after every write
 
@@ -360,16 +360,18 @@ sub tri2obj {
 #     Strip the file.1.obj's.  Note, strips doesn't handle the minimal
 #     case of striping a square correctly.
 #
-# 7.  cp bands.d file.2.obj
+# 7.  cp stripe.objf file.2.obj
 #
-#     strips produces a file called "bands.d" ... copy this to file.2.obj
+#     strips produces a file called "stripe.objf" ... copy this to file.2.obj
 
 sub strips {
     @FILES = `ls $subdir`;
     foreach $file ( @FILES ) {
        chop($file);
        if ( $file =~ m/\.1\.obj$/ ) {
-           $command = "Stripe_w/strips $subdir/$file";
+           $newfile = $file;
+           $newfile =~ s/\.1\.obj$//;
+           $command = "Stripe_w/strips $subdir/$file $subdir/$newfile.2.obj";
            $command = fix_command($command);
            print "Running '$command'\n";
            # $input = <STDIN>;
@@ -380,17 +382,17 @@ sub strips {
            close(OUT);
            
            # copy to destination file
-           $newfile = $file;
-           $newfile =~ s/\.1\.obj$//;
-           print "Copying to $subdir/$newfile.2.obj\n";
+           $newfile = $file;
+           $newfile =~ s/\.1\.obj$//;
+           print "Copying to $subdir/$newfile.2.obj\n";
            # open(IN, "<bands.d");
-           open(IN, "<stripe.objf");
-           open(OUT, ">$subdir/$newfile.2.obj");
-           while ( <IN> ) {
-               print OUT $_;
-           }
-           close(IN);
-           close(OUT);
+           open(IN, "<stripe.objf");
+           open(OUT, ">$subdir/$newfile.2.obj");
+           while ( <IN> ) {
+               print OUT $_;
+           }
+           close(IN);
+           close(OUT);
            
            if ( $remove_tmps ) {
                unlink("$subdir/$file");
@@ -487,6 +489,10 @@ sub install {
 
 #---------------------------------------------------------------------------
 # $Log$
+# Revision 1.28  1998/09/17 18:40:15  curt
+# Changes to allow multiple copies of the scenery processing tools
+# to be run concurrently.
+#
 # Revision 1.27  1998/09/09 20:58:35  curt
 # Fixes and tweaks to handle area cutouts for airports.
 #