summaryrefslogtreecommitdiff
path: root/src/gui/theme.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-08-22 14:14:34 +0300
committerAndrei Karas <akaras@inbox.ru>2015-08-22 14:14:34 +0300
commitda05d9dd98315378bdded216184294f376643191 (patch)
treeffc4b984c73c3bb68d26a1df6481634254075744 /src/gui/theme.cpp
parentec856b2026c7ceecab5f74942bb36661d7c6ae67 (diff)
downloadplus-da05d9dd98315378bdded216184294f376643191.tar.gz
plus-da05d9dd98315378bdded216184294f376643191.tar.bz2
plus-da05d9dd98315378bdded216184294f376643191.tar.xz
plus-da05d9dd98315378bdded216184294f376643191.zip
Use resource manager as global variable.
Diffstat (limited to 'src/gui/theme.cpp')
-rw-r--r--src/gui/theme.cpp17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/gui/theme.cpp b/src/gui/theme.cpp
index 000994368..90c351476 100644
--- a/src/gui/theme.cpp
+++ b/src/gui/theme.cpp
@@ -347,8 +347,7 @@ struct SkinHelper final
height(),
rect(),
node(),
- image(),
- resman()
+ image()
{
}
@@ -362,7 +361,6 @@ struct SkinHelper final
ImageRect *rect;
XmlNodePtr *node;
Image *image;
- ResourceManager *resman;
bool loadList(const SkinParameter *const params,
const size_t size) A_NONNULL(2)
@@ -372,7 +370,7 @@ struct SkinHelper final
const SkinParameter &param = params[f];
if (partType == param.name)
{
- rect->grid[param.index] = resman->getSubImage(
+ rect->grid[param.index] = resourceManager->getSubImage(
image, xPos, yPos, width, height);
return true;
}
@@ -430,7 +428,6 @@ Skin *Theme::readSkin(const std::string &filename, const bool full)
if (widgetType == "Window")
{
SkinHelper helper;
- helper.resman = ResourceManager::getInstance();
const int globalXPos = XML::getProperty(widgetNode, "xpos", 0);
const int globalYPos = XML::getProperty(widgetNode, "ypos", 0);
for_each_xml_child_node(partNode, widgetNode)
@@ -635,15 +632,13 @@ std::string Theme::resolveThemePath(const std::string &path)
Image *Theme::getImageFromTheme(const std::string &path)
{
- ResourceManager *const resman = ResourceManager::getInstance();
- return resman->getImage(resolveThemePath(path));
+ return resourceManager->getImage(resolveThemePath(path));
}
ImageSet *Theme::getImageSetFromTheme(const std::string &path,
const int w, const int h)
{
- ResourceManager *const resman = ResourceManager::getInstance();
- return resman->getImageSet(resolveThemePath(path), w, h);
+ return resourceManager->getImageSet(resolveThemePath(path), w, h);
}
static int readColorType(const std::string &type)
@@ -1143,8 +1138,8 @@ ImageSet *Theme::getImageSetFromThemeXml(const std::string &name,
const SDL_Rect &rect2 = image->mBounds;
if (rect2.w && rect2.h)
{
- ResourceManager *const resman = ResourceManager::getInstance();
- ImageSet *const imageSet = resman->getSubImageSet(image, w, h);
+ ImageSet *const imageSet = resourceManager->getSubImageSet(
+ image, w, h);
theme->unload(skin);
return imageSet;
}