]> git.mxchange.org Git - flightgear.git/commitdiff
Minor tweaks related to FGBucket usage.
authorcurt <curt>
Thu, 25 Mar 1999 19:03:50 +0000 (19:03 +0000)
committercurt <curt>
Thu, 25 Mar 1999 19:03:50 +0000 (19:03 +0000)
Array/array.cxx
Array/testarray.cxx
DEM/dem.cxx

index 90e04142d7ee42039c7f1a010f42564a72652bd0..76d4b7f27ea08cee78dc3dea7fee5b372cd4b9a6 100644 (file)
@@ -443,14 +443,13 @@ void FGArray::outputmesh_output_nodes( const string& fg_root, FGBucket& p )
 {
     double exnodes[MAX_EX_NODES][3];
     struct stat stat_buf;
-    string dir;
-    char file[256], exfile[256];
+    string dir, file;
+    char exfile[256];
 #ifdef WIN32
     char tmp_path[256];
 #endif
     string command;
     FILE *fd;
-    long int index;
     int colmin, colmax, rowmin, rowmax;
     int i, j, count, excount, result;
 
@@ -481,13 +480,11 @@ void FGArray::outputmesh_output_nodes( const string& fg_root, FGBucket& p )
     }
 
     // get index and generate output file name
-    index = p.gen_index();
-    sprintf(file, "%s/%ld.node", dir.c_str(), index);
+    file = dir + "/" + p.gen_index_str() + ".node";
 
     // get (optional) extra node file name (in case there is matching
     // .poly file.
-    strcpy(exfile, file);
-    strcat(exfile, ".ex");
+    exfile = file + ".ex";
 
     // load extra nodes if they exist
     excount = 0;
@@ -560,6 +557,9 @@ FGArray::~FGArray( void ) {
 
 
 // $Log$
+// Revision 1.5  1999/03/25 19:03:50  curt
+// Minor tweaks related to FGBucket usage.
+//
 // Revision 1.4  1999/03/20 20:32:51  curt
 // First mostly successful tile triangulation works.  There's plenty of tweaking
 // to do, but we are marching in the right direction.
index 9d65c0bf79898f5fa2b45b9b6819543c73cb46f6..74012eb93451babd66831f431a44ebb031658ddb 100644 (file)
@@ -3,7 +3,6 @@
 #include "array.hxx"
 
 main(int argc, char **argv) {
-    char tile_name[256];
     double lon, lat;
 
     if ( argc != 2 ) {
@@ -12,7 +11,6 @@ main(int argc, char **argv) {
     }
 
     string work_dir = argv[1];
-
    
     lon = -146.248360; lat = 61.133950;  // PAVD (Valdez, AK)
     lon = -110.664244; lat = 33.352890;  // P13
@@ -21,9 +19,7 @@ main(int argc, char **argv) {
     string base = b.gen_base_path();
     string path = work_dir + "/Scenery/" + base;
 
-    long int b_index = b.gen_index();
-    sprintf(tile_name, "%ld", b_index);
-    string arrayfile = path + "/" + tile_name + ".dem";
+    string arrayfile = path + "/" + b.gen_index_str() + ".dem";
     cout << "arrayfile = " << arrayfile << endl;
     
     FGArray a(arrayfile);
index b7fdbfc74a2ee9e575d2d3d680107698fc3cb56d..e4661a3c70b7896816700732797e08c243a752da 100644 (file)
@@ -371,8 +371,6 @@ FGDem::parse( ) {
 // corner.
 int
 FGDem::write_area( const string& root, FGBucket& b, bool compress ) {
-    char tile_name[256];
-
     // calculate some boundaries
     double min_x = ( b.get_center_lon() - 0.5 * b.get_width() ) * 3600.0;
     double max_x = ( b.get_center_lon() + 0.5 * b.get_width() ) * 3600.0;
@@ -412,9 +410,7 @@ FGDem::write_area( const string& root, FGBucket& b, bool compress ) {
     string command = "mkdir -p " + path;
     system( command.c_str() );
 
-    long int b_index = b.gen_index();
-    sprintf(tile_name, "%ld", b_index);
-    string demfile = path + "/" + tile_name + ".dem";
+    string demfile = path + "/" + b.gen_index_str() + ".dem";
     cout << "demfile = " << demfile << endl;
 
     // write the file
@@ -869,6 +865,9 @@ FGDem::~FGDem( void ) {
 
 
 // $Log$
+// Revision 1.27  1999/03/25 19:04:36  curt
+// Minor tweaks related to FGBucket usage.
+//
 // Revision 1.26  1999/03/13 17:40:37  curt
 // Moved point interpolation and least squares fitting to contruction program
 // area.