ManaPlus
Functions | Variables
wallpaper.cpp File Reference

(986a3bf)

#include "resources/wallpaper.h"
#include "configuration.h"
#include "fs/virtfs/fs.h"
#include "fs/virtfs/list.h"
#include "resources/wallpaperdata.h"
#include "utils/cast.h"
#include "utils/foreach.h"
#include <algorithm>
#include "debug.h"

Go to the source code of this file.

Functions

static bool wallpaperCompare (const WallpaperData &a, const WallpaperData &b)
 
static void initDefaultWallpaperPaths ()
 

Variables

static std::vector< WallpaperDatawallpaperData
 
static bool haveBackup
 
static std::string wallpaperPath
 
static std::string wallpaperFile
 

Function Documentation

◆ initDefaultWallpaperPaths()

static void initDefaultWallpaperPaths ( )
static

Definition at line 57 of file wallpaper.cpp.

58 {
59  // Init the path
60  wallpaperPath = branding.getStringValue("wallpapersPath");
61 
63  wallpaperPath = paths.getValue("wallpapers", "");
64 
66  wallpaperPath = "graphics/images/";
67 
68  // Init the default file
69  wallpaperFile = branding.getStringValue("wallpaperFile");
70 
72  return;
73  wallpaperFile = paths.getValue("wallpaperFile", "");
74 
76  wallpaperFile = "login_wallpaper.png";
77 }
std::string getValue(const std::string &key, const std::string &deflt) const
std::string getStringValue(const std::string &key) const
Configuration paths
Configuration branding
bool isDirectory(std::string name)
Definition: fs.cpp:239
static std::string wallpaperFile
Definition: wallpaper.cpp:54
static std::string wallpaperPath
Definition: wallpaper.cpp:53

References branding, Configuration::getStringValue(), ConfigurationObject::getValue(), VirtFs::isDirectory(), paths, wallpaperFile, and wallpaperPath.

Referenced by Wallpaper::loadWallpapers().

◆ wallpaperCompare()

static bool wallpaperCompare ( const WallpaperData a,
const WallpaperData b 
)
static

Definition at line 79 of file wallpaper.cpp.

80 {
81  const int aa = a.width * a.height;
82  const int ab = b.width * b.height;
83 
84  return aa > ab ||
85  (aa == ab && a.width > b.width);
86 }

References WallpaperData::height, and WallpaperData::width.

Referenced by Wallpaper::loadWallpapers().

Variable Documentation

◆ haveBackup

bool haveBackup
static

Definition at line 51 of file wallpaper.cpp.

Referenced by Wallpaper::getWallpaper(), and Wallpaper::loadWallpapers().

◆ wallpaperData

std::vector<WallpaperData> wallpaperData
static

Definition at line 50 of file wallpaper.cpp.

Referenced by Wallpaper::getWallpaper(), and Wallpaper::loadWallpapers().

◆ wallpaperFile

std::string wallpaperFile
static

◆ wallpaperPath

std::string wallpaperPath
static