Const love: std::function<void(Texture2D*)> -> const

std::function<void(Texture2D*)>&
This commit is contained in:
James Chen 2014-04-14 10:01:17 +08:00
parent 6feef5fa55
commit 5000873778
2 changed files with 2 additions and 2 deletions

View File

@ -93,7 +93,7 @@ std::string TextureCache::getDescription() const
return StringUtils::format("<TextureCache | Number of textures = %d>", static_cast<int>(_textures.size()));
}
void TextureCache::addImageAsync(const std::string &path, std::function<void(Texture2D*)> callback)
void TextureCache::addImageAsync(const std::string &path, const std::function<void(Texture2D*)>& callback)
{
Texture2D *texture = nullptr;

View File

@ -117,7 +117,7 @@ public:
* Supported image extensions: .png, .jpg
* @since v0.8
*/
virtual void addImageAsync(const std::string &filepath, std::function<void(Texture2D*)> callback);
virtual void addImageAsync(const std::string &filepath, const std::function<void(Texture2D*)>& callback);
/** Returns a Texture2D object given an Image.
* If the image was not previously loaded, it will create a new Texture2D object and it will return it.