#include "gamegl.h"
#include "Texture.h"
#include "ImageIO.h"
+#include "Utils/Folders.h"
using namespace std;
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;
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()