X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2FMoof%2FTexture.cc;h=3ca067af4ebe72dcc6552b92b3aa2c1aab09f07a;hp=7d82e2d093416cf5190475a803de81873405d662;hb=90b2c7fb10b244b781b84965a0d36f1f323ee94d;hpb=8148b51f1bec8f662672d3ca36eea1784991e5cc diff --git a/src/Moof/Texture.cc b/src/Moof/Texture.cc index 7d82e2d..3ca067a 100644 --- a/src/Moof/Texture.cc +++ b/src/Moof/Texture.cc @@ -215,7 +215,9 @@ public: 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()) @@ -395,8 +397,8 @@ public: 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)) {} @@ -490,19 +492,9 @@ bool Texture::getTileCoords(TileIndex index, Scalar coords[8], } -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"); }