diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-02-14 20:34:06 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-02-14 20:59:26 +0300 |
commit | bdec92381ef60cd027292ed63e254e8de70028d9 (patch) | |
tree | ebf2722cdc9fe7383a709ba1584432a491cf10ba /src/resources | |
parent | 5283a59db971ec2038149bf26ad9b3cbc4924449 (diff) | |
download | ManaVerse-bdec92381ef60cd027292ed63e254e8de70028d9.tar.gz ManaVerse-bdec92381ef60cd027292ed63e254e8de70028d9.tar.bz2 ManaVerse-bdec92381ef60cd027292ed63e254e8de70028d9.tar.xz ManaVerse-bdec92381ef60cd027292ed63e254e8de70028d9.zip |
In virtfs replace parameters type from char* to std::string.
Diffstat (limited to 'src/resources')
-rw-r--r-- | src/resources/atlas/atlasmanager.cpp | 2 | ||||
-rw-r--r-- | src/resources/loaders/imageloader.cpp | 2 | ||||
-rw-r--r-- | src/resources/loaders/musicloader.cpp | 2 | ||||
-rw-r--r-- | src/resources/loaders/soundloader.cpp | 2 | ||||
-rw-r--r-- | src/resources/mapreader.cpp | 2 | ||||
-rw-r--r-- | src/resources/wallpaper.cpp | 10 |
6 files changed, 10 insertions, 10 deletions
diff --git a/src/resources/atlas/atlasmanager.cpp b/src/resources/atlas/atlasmanager.cpp index 6a141df27..ef06c9527 100644 --- a/src/resources/atlas/atlasmanager.cpp +++ b/src/resources/atlas/atlasmanager.cpp @@ -149,7 +149,7 @@ void AtlasManager::loadImages(const StringVect &files, path = path.substr(0, p); } - SDL_RWops *const rw = VirtFs::RWopsOpenRead(path.c_str()); + SDL_RWops *const rw = VirtFs::RWopsOpenRead(path); if (rw) { Image *const image = d ? surfaceImageHelper->load(rw, *d) diff --git a/src/resources/loaders/imageloader.cpp b/src/resources/loaders/imageloader.cpp index 16a5022c3..b4826238a 100644 --- a/src/resources/loaders/imageloader.cpp +++ b/src/resources/loaders/imageloader.cpp @@ -63,7 +63,7 @@ namespace d = new Dye(path1.substr(p + 1)); path1 = path1.substr(0, p); } - SDL_RWops *const rw = VirtFs::RWopsOpenRead(path1.c_str()); + SDL_RWops *const rw = VirtFs::RWopsOpenRead(path1); if (!rw) { delete d; diff --git a/src/resources/loaders/musicloader.cpp b/src/resources/loaders/musicloader.cpp index 8c6f483db..62fde088b 100644 --- a/src/resources/loaders/musicloader.cpp +++ b/src/resources/loaders/musicloader.cpp @@ -46,7 +46,7 @@ namespace return nullptr; const ResourceLoader *const rl = static_cast<const ResourceLoader *const>(v); - SDL_RWops *const rw = VirtFs::RWopsOpenRead(rl->path.c_str()); + SDL_RWops *const rw = VirtFs::RWopsOpenRead(rl->path); if (!rw) { reportAlways("Physfs error: %s", VirtFs::getLastError()); diff --git a/src/resources/loaders/soundloader.cpp b/src/resources/loaders/soundloader.cpp index a70d188fa..35a938f76 100644 --- a/src/resources/loaders/soundloader.cpp +++ b/src/resources/loaders/soundloader.cpp @@ -46,7 +46,7 @@ namespace return nullptr; const ResourceLoader *const rl = static_cast<const ResourceLoader *const>(v); - SDL_RWops *const rw = VirtFs::RWopsOpenRead(rl->path.c_str()); + SDL_RWops *const rw = VirtFs::RWopsOpenRead(rl->path); if (!rw) { reportAlways("Physfs error: %s", VirtFs::getLastError()); diff --git a/src/resources/mapreader.cpp b/src/resources/mapreader.cpp index 414b87987..35081c7ba 100644 --- a/src/resources/mapreader.cpp +++ b/src/resources/mapreader.cpp @@ -1279,7 +1279,7 @@ void MapReader::updateMusic(Map *const map) if (p != std::string::npos) name = name.substr(0, p); name.append(".ogg"); - if (VirtFs::exists(paths.getStringValue("music").append(name).c_str())) + if (VirtFs::exists(paths.getStringValue("music").append(name))) map->setProperty("music", name); } diff --git a/src/resources/wallpaper.cpp b/src/resources/wallpaper.cpp index 63a8d755c..397f29af5 100644 --- a/src/resources/wallpaper.cpp +++ b/src/resources/wallpaper.cpp @@ -55,21 +55,21 @@ static void initDefaultWallpaperPaths() // Init the path wallpaperPath = branding.getStringValue("wallpapersPath"); - if (wallpaperPath.empty() || !VirtFs::isDirectory(wallpaperPath.c_str())) + if (wallpaperPath.empty() || !VirtFs::isDirectory(wallpaperPath)) wallpaperPath = paths.getValue("wallpapers", ""); - if (wallpaperPath.empty() || !VirtFs::isDirectory(wallpaperPath.c_str())) + if (wallpaperPath.empty() || !VirtFs::isDirectory(wallpaperPath)) wallpaperPath = "graphics/images/"; // Init the default file wallpaperFile = branding.getStringValue("wallpaperFile"); - if (!wallpaperFile.empty() && !VirtFs::isDirectory(wallpaperFile.c_str())) + if (!wallpaperFile.empty() && !VirtFs::isDirectory(wallpaperFile)) return; else wallpaperFile = paths.getValue("wallpaperFile", ""); - if (wallpaperFile.empty() || VirtFs::isDirectory(wallpaperFile.c_str())) + if (wallpaperFile.empty() || VirtFs::isDirectory(wallpaperFile)) wallpaperFile = "login_wallpaper.png"; } @@ -91,6 +91,7 @@ void Wallpaper::loadWallpapers() { // First, get the base filename of the image: std::string filename = *i; + const std::string name = filename; // If the backup file is found, we tell it. if (filename.find(wallpaperFile) != std::string::npos) haveBackup = true; @@ -105,7 +106,6 @@ void Wallpaper::loadWallpapers() separator = filename.find('%'); if (separator == std::string::npos) { - std::string name = filename; // Then, append the width and height search mask. filename.append("_%10dx%10d.png"); |