]> git.jsancho.org Git - lugaru.git/blobdiff - Source/Texture.cpp
Trying to handle a bit better missing files and avoid segfaults
[lugaru.git] / Source / Texture.cpp
index 7fb4b94609740f7ba55e8ad4ac2119ea7f981f54..3106c8f31ac4490ff265e24b8faeb1d2b37fe3d4 100644 (file)
@@ -34,7 +34,10 @@ void TextureRes::load()
     ImageRec texture;
 
     //load image into 'texture'
-    load_image(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;