summaryrefslogtreecommitdiff
path: root/src/resources/resourcemanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/resources/resourcemanager.cpp')
-rw-r--r--src/resources/resourcemanager.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/resources/resourcemanager.cpp b/src/resources/resourcemanager.cpp
index d6ab39a0..50eda0ce 100644
--- a/src/resources/resourcemanager.cpp
+++ b/src/resources/resourcemanager.cpp
@@ -1,9 +1,8 @@
/*
- * Aethyra
+ * The Mana World
* Copyright (C) 2004 The Mana World Development Team
*
- * This file is part of Aethyra based on original code
- * from The Mana World.
+ * This file is part of The Mana World.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -214,7 +213,7 @@ std::string ResourceManager::getPath(const std::string &file)
return path;
}
-Resource *ResourceManager::get(std::string const &idPath, generator fun,
+Resource *ResourceManager::get(const std::string &idPath, generator fun,
void *data)
{
// Check if the id exists, and return the value if it does.
@@ -266,7 +265,7 @@ struct ResourceLoader
}
};
-Resource *ResourceManager::load(std::string const &path, loader fun)
+Resource *ResourceManager::load(const std::string &path, loader fun)
{
ResourceLoader l = { this, path, fun };
return get(path, ResourceLoader::load, &l);
@@ -308,7 +307,7 @@ struct DyedImageLoader
}
};
-Image *ResourceManager::getImage(std::string const &idPath)
+Image *ResourceManager::getImage(const std::string &idPath)
{
DyedImageLoader l = { this, idPath };
return static_cast<Image*>(get(idPath, DyedImageLoader::load, &l));
@@ -350,8 +349,7 @@ struct SpriteDefLoader
}
};
-SpriteDef *ResourceManager::getSprite
- (std::string const &path, int variant)
+SpriteDef *ResourceManager::getSprite(const std::string &path, int variant)
{
SpriteDefLoader l = { path, variant };
std::stringstream ss;
@@ -380,7 +378,8 @@ void ResourceManager::release(Resource *res)
ResourceManager *ResourceManager::getInstance()
{
// Create a new instance if necessary.
- if (instance == NULL) instance = new ResourceManager();
+ if (!instance)
+ instance = new ResourceManager;
return instance;
}