1
0
Fork 0

Changes to allow multiple copies of the scenery processing tools

to be run concurrently.
This commit is contained in:
curt 1998-09-17 18:40:15 +00:00
parent 2e30b5bdb6
commit 52a1d87c1c
3 changed files with 40 additions and 32 deletions

View 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))
{

View 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);
}

View file

@ -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.
#