From f56688822567dee10bf1219fac33570369e68b33 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 16 Apr 2013 17:43:06 +0300 Subject: improve wallpaper class. --- src/resources/wallpaper.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/resources') 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); } -- cgit v1.2.3-70-g09d2