summaryrefslogtreecommitdiff
path: root/src/resources
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2009-04-10 01:33:45 +0200
committerBjørn Lindeijer <bjorn@lindeijer.nl>2009-04-10 01:33:45 +0200
commitb4ebdcf0622ce297704887cf0d653079a1fbcf1e (patch)
tree0cb030bb5f343054305179c2161dd904e2140822 /src/resources
parente36861eaef6f178543bd1029809da3ce1bab0e55 (diff)
downloadmana-b4ebdcf0622ce297704887cf0d653079a1fbcf1e.tar.gz
mana-b4ebdcf0622ce297704887cf0d653079a1fbcf1e.tar.bz2
mana-b4ebdcf0622ce297704887cf0d653079a1fbcf1e.tar.xz
mana-b4ebdcf0622ce297704887cf0d653079a1fbcf1e.zip
Introduced a Desktop widget to handle the wallpaper
Cleans up main.cpp a little.
Diffstat (limited to 'src/resources')
-rw-r--r--src/resources/resourcemanager.h1
-rw-r--r--src/resources/wallpaper.cpp14
-rw-r--r--src/resources/wallpaper.h2
3 files changed, 7 insertions, 10 deletions
diff --git a/src/resources/resourcemanager.h b/src/resources/resourcemanager.h
index 17ce7cae..ec60fa9a 100644
--- a/src/resources/resourcemanager.h
+++ b/src/resources/resourcemanager.h
@@ -40,7 +40,6 @@ struct SDL_Surface;
*/
class ResourceManager
{
-
friend class Resource;
public:
diff --git a/src/resources/wallpaper.cpp b/src/resources/wallpaper.cpp
index 07f6ecb6..5e9aa008 100644
--- a/src/resources/wallpaper.cpp
+++ b/src/resources/wallpaper.cpp
@@ -53,20 +53,20 @@ bool wallpaperCompare(WallpaperSize a, WallpaperSize b)
void Wallpaper::loadWallpapers()
{
- char **imgs = PHYSFS_enumerateFiles(WALLPAPER_FOLDER);
- char **i;
- size_t baseLen = strlen(WALLPAPER_BASE);
- int width;
- int height;
-
wallpaperSizes.clear();
+ size_t baseLen = strlen(WALLPAPER_BASE);
haveBackup = false;
- for (i = imgs; *i != NULL; i++)
+ char **imgs = PHYSFS_enumerateFiles(WALLPAPER_FOLDER);
+
+ for (char **i = imgs; *i != NULL; i++)
{
if (strncmp(*i, WALLPAPER_BASE, baseLen) == 0)
{
+ int width;
+ int height;
+
if (strlen(*i) == baseLen + 4)
{
if (haveBackup)
diff --git a/src/resources/wallpaper.h b/src/resources/wallpaper.h
index 96a655e8..fd501a83 100644
--- a/src/resources/wallpaper.h
+++ b/src/resources/wallpaper.h
@@ -24,8 +24,6 @@
#include <string>
-#include <SDL_types.h>
-
/**
* Handles organizing and choosing of wallpapers.
*/