358c0f5c26
One of #2097: Secret Maryo Chronicles
112 lines
3.8 KiB
Diff
112 lines
3.8 KiB
Diff
Boost >= 1.5 renamed path::leaf() to path::filename().
|
|
Function path(const string_type&, name_check) was removed,
|
|
thus here we use path(const string_type&).
|
|
|
|
--- src/core/filesystem/filesystem.cpp 2015-10-30 19:17:02.512620204 +0100
|
|
+++ src/core/filesystem/filesystem.cpp 2015-10-30 19:17:57.036620043 +0100
|
|
@@ -64,7 +64,7 @@
|
|
|
|
bool Dir_Exists( const std::string &dir )
|
|
{
|
|
- return fs::exists( fs::path( dir, fs::native ) );
|
|
+ return fs::exists( fs::path( dir ) );
|
|
|
|
/*struct stat file_info;
|
|
|
|
@@ -89,7 +89,7 @@
|
|
|
|
bool Create_Directory( const std::string &dir )
|
|
{
|
|
- return fs::create_directory( fs::path( dir, fs::native ) );
|
|
+ return fs::create_directory( fs::path( dir ) );
|
|
}
|
|
|
|
size_t Get_File_Size( const std::string &filename )
|
|
@@ -130,7 +130,7 @@
|
|
{
|
|
vector<std::string> valid_files;
|
|
|
|
- fs::path full_path( dir, fs::native );
|
|
+ fs::path full_path( dir );
|
|
fs::directory_iterator end_iter;
|
|
|
|
// load all available objects
|
|
@@ -142,32 +142,32 @@
|
|
if( fs::is_directory( *dir_itr ) )
|
|
{
|
|
// ignore hidden directories
|
|
- if( dir_itr->path().leaf().find( "." ) == 0 )
|
|
+ if( dir_itr->path().filename().string().find( "." ) == 0 )
|
|
{
|
|
continue;
|
|
}
|
|
|
|
if( with_directories )
|
|
{
|
|
- valid_files.push_back( dir + "/" + dir_itr->path().leaf() );
|
|
+ valid_files.push_back( dir + "/" + dir_itr->path().filename().string() );
|
|
}
|
|
|
|
// load all items from the sub-directory
|
|
if( search_in_sub_directories )
|
|
{
|
|
- vector<std::string> new_valid_files = Get_Directory_Files( dir + "/" + dir_itr->path().leaf(), file_type, with_directories );
|
|
+ vector<std::string> new_valid_files = Get_Directory_Files( dir + "/" + dir_itr->path().filename().string(), file_type, with_directories );
|
|
valid_files.insert( valid_files.end(), new_valid_files.begin(), new_valid_files.end() );
|
|
}
|
|
}
|
|
// valid file
|
|
- else if( file_type.empty() || dir_itr->path().leaf().rfind( file_type ) != std::string::npos )
|
|
+ else if( file_type.empty() || dir_itr->path().filename().string().rfind( file_type ) != std::string::npos )
|
|
{
|
|
- valid_files.push_back( dir + "/" + dir_itr->path().leaf() );
|
|
+ valid_files.push_back( dir + "/" + dir_itr->path().filename().string() );
|
|
}
|
|
}
|
|
catch( const std::exception &ex )
|
|
{
|
|
- printf( "%s %s\n", dir_itr->path().leaf().c_str(), ex.what() );
|
|
+ printf( "%s %s\n", dir_itr->path().filename().c_str(), ex.what() );
|
|
}
|
|
}
|
|
|
|
--- src/overworld/world_manager.cpp 2015-10-30 19:17:02.649620204 +0100
|
|
+++ src/overworld/world_manager.cpp 2015-10-30 18:30:23.299628497 +0100
|
|
@@ -111,7 +111,7 @@
|
|
void cOverworld_Manager :: Load_Dir( const std::string &dir, bool user_dir /* = 0 */ )
|
|
{
|
|
// set world directory
|
|
- fs::path full_path( dir, fs::native );
|
|
+ fs::path full_path( dir );
|
|
fs::directory_iterator end_iter;
|
|
|
|
for( fs::directory_iterator dir_itr( full_path ); dir_itr != end_iter; ++dir_itr )
|
|
@@ -118,7 +118,7 @@
|
|
{
|
|
try
|
|
{
|
|
- std::string current_dir = dir_itr->path().leaf();
|
|
+ std::string current_dir = dir_itr->path().filename().string();
|
|
|
|
// only directories with an existing description
|
|
if( fs::is_directory( *dir_itr ) && File_Exists( dir + "/" + current_dir + "/description.xml" ) )
|
|
--- src/video/video.cpp 2015-10-30 19:17:02.822620203 +0100
|
|
+++ src/video/video.cpp 2015-10-30 19:18:57.493619864 +0100
|
|
@@ -747,7 +747,7 @@
|
|
{
|
|
try
|
|
{
|
|
- fs::remove_all( fs::path( m_imgcache_dir, fs::native ) );
|
|
+ fs::remove_all( fs::path( m_imgcache_dir ) );
|
|
}
|
|
// could happen if a file is locked or we have no write rights
|
|
catch( const std::exception &ex )
|
|
@@ -769,7 +769,7 @@
|
|
// no cache available
|
|
if( !Dir_Exists( imgcache_dir_active ) )
|
|
{
|
|
- fs::create_directories( fs::path( imgcache_dir_active + "/" GAME_PIXMAPS_DIR, fs::native ) );
|
|
+ fs::create_directories( fs::path( imgcache_dir_active + "/" GAME_PIXMAPS_DIR ) );
|
|
}
|
|
// cache available
|
|
else
|