to be run concurrently.
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;
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))
{
/* 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);
}
$scenery_format_version = "0.1";
$max_area = 10000; # maximum triangle area
-$remove_tmps = 0;
+$remove_tmps = 1;
$| = 1; # flush buffers after every write
# 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>;
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");
#---------------------------------------------------------------------------
# $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.
#