Removed boost dependency ( now use PlusCallback for callbacks, and use my own lexical cast ). With this improved a lot the compiling time. As far as i could test, PlusCallback is faster than boos::function too.

I added a couple of checks to avoid rendering problems on fonts.
And added some minor fixes.
This commit is contained in:
spartanj
2010-10-01 04:49:36 -03:00
parent 0f03b3599a
commit b071630924
36 changed files with 2885 additions and 272 deletions

View File

@@ -114,6 +114,97 @@ std::string AppPath() {
#endif
}
std::vector<std::wstring> FilesGetInPath( const std::wstring& path ) {
std::vector<std::wstring> files;
#ifdef EE_COMPILER_MSVC
#ifdef UNICODE
std::wstring mPath( path );
if ( mPath[ mPath.size() - 1 ] == L'/' || mPath[ mPath.size() - 1 ] == L'\\' ) {
mPath += L"*";
} else {
mPath += L"\\*";
}
WIN32_FIND_DATA findFileData;
HANDLE hFind = FindFirstFile( mPath.c_str(), &findFileData );
if( hFind != INVALID_HANDLE_VALUE ) {
std::wstring tmpstr( findFileData.cFileName );
if ( tmpstr != L"." && tmpstr != L".." )
files.push_back( tmpstr );
while( FindNextFile( hFind, &findFileData ) ) {
tmpstr = std::wstring( findFileData.cFileName );
if ( tmpstr != L"." && tmpstr != L".." )
files.push_back( findFileData.cFileName );
}
FindClose( hFind );
}
#else
std::wstring mPath( path );
if ( mPath[ mPath.size() - 1 ] == L'/' || mPath[ mPath.size() - 1 ] == L'\\' ) {
mPath += L"*";
} else {
mPath += L"\\*";
}
WIN32_FIND_DATA findFileData;
HANDLE hFind = FindFirstFile( (LPCTSTR) mPath.c_str(), &findFileData );
if( hFind != INVALID_HANDLE_VALUE ) {
std::wstring tmpstr( findFileData.cFileName );
if ( tmpstr != L"." && tmpstr != L".." )
files.push_back( tmpstr );
while( FindNextFile( hFind, &findFileData ) ) {
tmpstr = std::wstring( findFileData.cFileName );
if ( tmpstr != "." && tmpstr != ".." )
files.push_back( std::wstring( findFileData.cFileName ) );
}
FindClose( hFind );
}
#endif
return files;
#else
DIR *dp;
struct dirent *dirp;
if( ( dp = opendir( wstringTostring( path.c_str() ).c_str() ) ) == NULL)
return files;
while ( ( dirp = readdir(dp) ) != NULL) {
if ( strcmp( dirp->d_name, ".." ) != 0 && strcmp( dirp->d_name, "." ) != 0 ) {
char * p = &dirp->d_name[0];
std::wstring tmp;
while ( *p ) {
unsigned char y = *p;
tmp.push_back( y );
p++;
}
files.push_back( tmp );
}
}
closedir(dp);
return files;
#endif
}
std::vector<std::string> FilesGetInPath( const std::string& path ) {
std::vector<std::string> files;
@@ -224,6 +315,10 @@ eeDouble GetSystemTime() {
#endif
}
bool IsDirectory( const std::wstring& path ) {
return IsDirectory( wstringTostring( path ) );
}
bool IsDirectory( const std::string& path ) {
#ifndef EE_COMPILER_MSVC
DIR *dp;