void init(const std::string& name)
{
- std::string path = Texture::getPath(name);
+ std::string path(name);
+
+ Texture::getPath(path);
mImage = Image::alloc(path);
if (!mImage->isValid())
GLuint Texture::Impl::gObject = 0;
-Texture::Texture(const std::string& name) :
- Image(Texture::getPath(name)),
+Texture::Texture(const std::string& name) : // TODO hmm..
+ Image(name),
// pass through
mImpl(Texture::Impl::getInstance(name)) {}
}
-std::string Texture::getPath(const std::string& name)
+bool Texture::getPath(std::string& name)
{
- if (boost::find_last(name, ".png"))
- {
- return Resource::getPath(name);
- }
- else
- {
- std::string path("textures/");
- path += name;
- path += ".png";
- return Resource::getPath(path);
- }
+ return Resource::getPath(name, "textures/", "png");
}