summaryrefslogtreecommitdiff
path: root/src/resources
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-11-25 15:15:54 +0300
committerAndrei Karas <akaras@inbox.ru>2014-11-25 15:15:54 +0300
commit2198ecc98ecc5e94f2856795065d198557387ade (patch)
tree873858ffceb4b6e62f441597860224b9fa3a6207 /src/resources
parent75c5b3d32afdb34b824daafaa6d4300b9a8ec06b (diff)
downloadmanaverse-2198ecc98ecc5e94f2856795065d198557387ade.tar.gz
manaverse-2198ecc98ecc5e94f2856795065d198557387ade.tar.bz2
manaverse-2198ecc98ecc5e94f2856795065d198557387ade.tar.xz
manaverse-2198ecc98ecc5e94f2856795065d198557387ade.zip
Add more profiler labels.
Diffstat (limited to 'src/resources')
-rw-r--r--src/resources/openglimagehelper.cpp2
-rw-r--r--src/resources/resourcemanager.cpp9
-rw-r--r--src/resources/spritedef.cpp5
3 files changed, 16 insertions, 0 deletions
diff --git a/src/resources/openglimagehelper.cpp b/src/resources/openglimagehelper.cpp
index 295ad3e69..e4a1a56b8 100644
--- a/src/resources/openglimagehelper.cpp
+++ b/src/resources/openglimagehelper.cpp
@@ -231,6 +231,7 @@ Image *OpenGLImageHelper::glLoad(SDL_Surface *tmpImage,
if (!tmpImage)
return nullptr;
+ BLOCK_START("OpenGLImageHelper::glLoad")
// Flush current error flag.
graphicsManager.getLastError();
@@ -313,6 +314,7 @@ Image *OpenGLImageHelper::glLoad(SDL_Surface *tmpImage,
// return nullptr;
}
+ BLOCK_END("OpenGLImageHelper::glLoad")
return new Image(texture, width, height, realWidth, realHeight);
}
diff --git a/src/resources/resourcemanager.cpp b/src/resources/resourcemanager.cpp
index 9fd445ffc..5ae057748 100644
--- a/src/resources/resourcemanager.cpp
+++ b/src/resources/resourcemanager.cpp
@@ -544,13 +544,20 @@ struct DyedImageLoader final
std::string path;
static Resource *load(const void *const v)
{
+ BLOCK_START("DyedImageLoader::load")
if (!v)
+ {
+ BLOCK_END("DyedImageLoader::load")
return nullptr;
+ }
const DyedImageLoader *const rl
= static_cast<const DyedImageLoader *const>(v);
if (!rl->manager)
+ {
+ BLOCK_END("DyedImageLoader::load")
return nullptr;
+ }
std::string path1 = rl->path;
const size_t p = path1.find('|');
@@ -564,11 +571,13 @@ struct DyedImageLoader final
if (!rw)
{
delete d;
+ BLOCK_END("DyedImageLoader::load")
return nullptr;
}
Resource *const res = d ? imageHelper->load(rw, *d)
: imageHelper->load(rw);
delete d;
+ BLOCK_END("DyedImageLoader::load")
return res;
}
};
diff --git a/src/resources/spritedef.cpp b/src/resources/spritedef.cpp
index 528151537..267dfaab0 100644
--- a/src/resources/spritedef.cpp
+++ b/src/resources/spritedef.cpp
@@ -81,6 +81,7 @@ unsigned SpriteDef::findNumber(const unsigned num) const
SpriteDef *SpriteDef::load(const std::string &animationFile,
const int variant, const bool prot)
{
+ BLOCK_START("SpriteDef::load")
const size_t pos = animationFile.find('|');
std::string palettes;
if (pos != std::string::npos)
@@ -95,6 +96,7 @@ SpriteDef *SpriteDef::load(const std::string &animationFile,
const std::string errorFile = paths.getStringValue("sprites").append(
paths.getStringValue("spriteErrorFile"));
+ BLOCK_END("SpriteDef::load")
if (animationFile != errorFile)
return load(errorFile, 0, prot);
else
@@ -112,6 +114,7 @@ SpriteDef *SpriteDef::load(const std::string &animationFile,
def->incRef();
def->setProtected(true);
}
+ BLOCK_END("SpriteDef::load")
return def;
}
@@ -177,6 +180,7 @@ void SpriteDef::substituteActions()
void SpriteDef::loadSprite(const XmlNodePtr spriteNode, const int variant,
const std::string &palettes)
{
+ BLOCK_START("SpriteDef::loadSprite")
// Get the variant
const int variantCount = XML::getProperty(spriteNode, "variants", 0);
int variant_offset = 0;
@@ -196,6 +200,7 @@ void SpriteDef::loadSprite(const XmlNodePtr spriteNode, const int variant,
else if (xmlNameEqual(node, "include"))
includeSprite(node, variant);
}
+ BLOCK_END("SpriteDef::loadSprite")
}
void SpriteDef::loadImageSet(const XmlNodePtr node,