diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-04-16 17:43:06 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-04-16 17:43:06 +0300 |
commit | f56688822567dee10bf1219fac33570369e68b33 (patch) | |
tree | e5f0b0fdff385b1c93f0d589caabb7bc46a37467 /src/resources | |
parent | e7e0756c92b425553f1579341ee378871235e00c (diff) | |
download | manaplus-f56688822567dee10bf1219fac33570369e68b33.tar.gz manaplus-f56688822567dee10bf1219fac33570369e68b33.tar.bz2 manaplus-f56688822567dee10bf1219fac33570369e68b33.tar.xz manaplus-f56688822567dee10bf1219fac33570369e68b33.zip |
improve wallpaper class.
Diffstat (limited to 'src/resources')
-rw-r--r-- | src/resources/wallpaper.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/resources/wallpaper.cpp b/src/resources/wallpaper.cpp index 5067bbcc8..62d275628 100644 --- a/src/resources/wallpaper.cpp +++ b/src/resources/wallpaper.cpp @@ -88,16 +88,11 @@ static bool wallpaperCompare(const WallpaperData &a, const WallpaperData &b) void Wallpaper::loadWallpapers() { wallpaperData.clear(); - initDefaultWallpaperPaths(); - char **imgs = PhysFs::enumerateFiles(wallpaperPath.c_str()); for (char **i = imgs; *i; i++) { - int width; - int height; - // If the backup file is found, we tell it. if (strncmp (*i, wallpaperFile.c_str(), strlen(*i)) == 0) haveBackup = true; @@ -117,6 +112,8 @@ void Wallpaper::loadWallpapers() // Then, append the width and height search mask. filename.append("_%dx%d.png"); + int width; + int height; if (sscanf(*i, filename.c_str(), &width, &height) == 2) { WallpaperData wp; @@ -130,7 +127,6 @@ void Wallpaper::loadWallpapers() } PhysFs::freeList(imgs); - std::sort(wallpaperData.begin(), wallpaperData.end(), wallpaperCompare); } |