]> git.jsancho.org Git - lugaru.git/blobdiff - Source/Texture.cpp
Removed all modifications of Account active from outside Account
[lugaru.git] / Source / Texture.cpp
index dd2d1cc63ff0e0b7760bcfa4bb7324c3ba8a35b0..3106c8f31ac4490ff265e24b8faeb1d2b37fe3d4 100644 (file)
@@ -21,6 +21,7 @@ along with Lugaru.  If not, see <http://www.gnu.org/licenses/>.
 #include "gamegl.h"
 #include "Texture.h"
 #include "ImageIO.h"
+#include "Utils/Folders.h"
 
 using namespace std;
 
@@ -33,7 +34,10 @@ void TextureRes::load()
     ImageRec texture;
 
     //load image into 'texture'
-    load_image(ConvertFileName(filename.c_str()), texture);
+    if (!load_image(filename.c_str(), texture)) {
+        cerr << "Texture " << filename << " loading failed" << endl;
+        return;
+    }
 
     skinsize = texture.sizeX;
     GLuint type = GL_RGBA;
@@ -107,13 +111,13 @@ TextureRes::~TextureRes()
 void Texture::load(const string& filename, bool hasMipmap)
 {
     destroy();
-    tex = new TextureRes(filename, hasMipmap);
+    tex = new TextureRes(Folders::getResourcePath(filename), hasMipmap);
 }
 
 void Texture::load(const string& filename, bool hasMipmap, GLubyte* array, int* skinsizep)
 {
     destroy();
-    tex = new TextureRes(filename, hasMipmap, array, skinsizep);
+    tex = new TextureRes(Folders::getResourcePath(filename), hasMipmap, array, skinsizep);
 }
 
 void Texture::destroy()