Home » Community » Newbie corner » MSVC 10 to Upp conversion
Re: MSVC 10 to Upp conversion [message #32662 is a reply to message #32660] |
Wed, 01 June 2011 02:59   |
nlneilson
Messages: 644 Registered: January 2010 Location: U.S. California. Mojave &...
|
Contributor |
|
|
Finally got around to starting the changes to iterate through the files and noticed that has all ready been done with findfirst/findnext.
I used the original tilepack.cpp and tinkered with these without any luck.
#ifdef WIN32
#else
#endif
Does Upp treat these differently?
#ifdef WIN32
void ScanDatasetR(const char *path) {
struct _finddata_t c_file;
long hFile;
int l, x, y;
string s;
string filespec;
filespec = string(path) + "\\*.*";
hFile = _findfirst( filespec.c_str(), &c_file ); // _findfirst
if( hFile == -1L )
return;
do {
if ((c_file.attrib & _A_SUBDIR) && (c_file.name[0] != '.'))
ScanDatasetR((string(path) + string(c_file.name) + "\\").c_str());
else if (c_file.attrib & _A_NORMAL) {
s = c_file.name;
if (sscanf(s.substr(0, 2).c_str(), "%x", &l) && sscanf(s.substr(2, 8).c_str(), "%x", &x) && sscanf(s.substr(10, 8).c_str(), "%x", &y)) {
bm[(static_cast<unsigned __int64>(l) << 50) + (static_cast<unsigned __int64>(y >> 7) << 25) + (x >> 7)].push_back((x & 0x7f) + ((y & 0x7f) << 7));
}
}
} while( _findnext( hFile, &c_file) == 0 ); // _findnext
_findclose( hFile );
}
#else
void ScanDatasetR(const char *path) {
DIR *d;
struct dirent *de;
int l, x, y;
string s;
d = opendir(path); // opendir
if (!d) return;
while (de = readdir(d)) {
if ((de->d_type == DT_DIR) && (de->d_name[0] != '.')) ScanDatasetR((string(path) + string(de->d_name) + "/").c_str());
if (de->d_type == DT_REG) {
s = de->d_name;
if (sscanf(s.substr(0, 2).c_str(), "%x", &l) && sscanf(s.substr(2, 8).c_str(), "%x", &x) && sscanf(s.substr(10, 8).c_str(), "%x", &y)) {
bm[(static_cast<unsigned __int64>(l) << 50) + (static_cast<unsigned __int64>(y >> 7) << 25) + (x >> 7)].push_back((x & 0x7f) + ((y & 0x7f) << 7));
}
}
}
closedir(d);
}
#endif
edit: I did a search in the package for WIN32
Other than in tilepack.cpp the only other is in the main (GUItiler.cpp)
#ifndef WIN32
-
Attachment: tilepack.cpp
(Size: 4.15KB, Downloaded 353 times)
[Updated on: Wed, 01 June 2011 05:20] Report message to a moderator
|
|
|
 |
|
MSVC 10 to Upp conversion
|
 |
|
Re: MSVC 10 to Upp conversion
By: koldo on Mon, 30 May 2011 22:54
|
 |
|
Re: MSVC 10 to Upp conversion
|
 |
|
Re: MSVC 10 to Upp conversion
|
 |
|
Re: MSVC 10 to Upp conversion
|
 |
|
Re: MSVC 10 to Upp conversion
|
 |
|
Re: MSVC 10 to Upp conversion
By: koldo on Tue, 31 May 2011 08:40
|
 |
|
Re: MSVC 10 to Upp conversion
|
 |
|
Re: MSVC 10 to Upp conversion
By: koldo on Tue, 31 May 2011 21:20
|
 |
|
Re: MSVC 10 to Upp conversion
|
 |
|
Re: MSVC 10 to Upp conversion
|
 |
|
Re: MSVC 10 to Upp conversion
By: koldo on Wed, 01 June 2011 08:06
|
 |
|
Re: MSVC 10 to Upp conversion
|
 |
|
Re: MSVC 10 to Upp conversion
|
 |
|
Re: MSVC 10 to Upp conversion
|
 |
|
Re: MSVC 10 to Upp conversion
By: koldo on Wed, 01 June 2011 12:09
|
 |
|
Re: MSVC 10 to Upp conversion
|
 |
|
Re: MSVC 10 to Upp conversion
By: koldo on Wed, 01 June 2011 17:19
|
 |
|
Re: MSVC 10 to Upp conversion
|
 |
|
Re: MSVC 10 to Upp conversion
|
 |
|
Re: MSVC 10 to Upp conversion
By: koldo on Thu, 02 June 2011 08:36
|
 |
|
Re: MSVC 10 to Upp conversion
|
 |
|
Re: MSVC 10 to Upp conversion
By: koldo on Thu, 02 June 2011 11:37
|
 |
|
Re: MSVC 10 to Upp conversion
|
 |
|
Re: MSVC 10 to Upp conversion
|
 |
|
Re: MSVC 10 to Upp conversion
By: koldo on Thu, 02 June 2011 13:53
|
 |
|
Re: MSVC 10 to Upp conversion
|
 |
|
Re: MSVC 10 to Upp conversion
|
 |
|
Re: MSVC 10 to Upp conversion
|
 |
|
Re: MSVC 10 to Upp conversion
|
 |
|
Re: MSVC 10 to Upp conversion
By: koldo on Sun, 05 June 2011 06:58
|
 |
|
Re: MSVC 10 to Upp conversion
|
 |
|
Re: MSVC 10 to Upp conversion
|
 |
|
Re: MSVC 10 to Upp conversion
By: koldo on Tue, 07 June 2011 07:17
|
 |
|
Re: MSVC 10 to Upp conversion
|
 |
|
Re: MSVC 10 to Upp conversion
By: koldo on Tue, 07 June 2011 15:59
|
 |
|
Re: MSVC 10 to Upp conversion
|
 |
|
Re: MSVC 10 to Upp conversion
|
 |
|
Re: MSVC 10 to Upp conversion
|
 |
|
Re: MSVC 10 to Upp conversion
|
 |
|
Re: MSVC 10 to Upp conversion
|
 |
|
Re: MSVC 10 to Upp conversion
|
 |
|
Re: MSVC 10 to Upp conversion
|
 |
|
Re: MSVC 10 to Upp conversion
By: koldo on Tue, 14 June 2011 09:17
|
 |
|
Re: MSVC 10 to Upp conversion
|
Goto Forum:
Current Time: Sat Jul 05 16:17:13 CEST 2025
Total time taken to generate the page: 0.03726 seconds
|