using namespace std;
-extern ImageRec texture;
extern bool trilinear;
vector<TextureRes*> TextureRes::list;
void TextureRes::load()
{
- //load image into 'texture' global var
- upload_image(ConvertFileName(filename.c_str()));
+ ImageRec texture;
+
+ //load image into 'texture'
+ load_image(ConvertFileName(filename.c_str()), texture);
skinsize = texture.sizeX;
GLuint type = GL_RGBA;
glBindTexture(GL_TEXTURE_2D, id);
}
-TextureRes::TextureRes(const string& _filename, bool _hasMipmap, bool _hasAlpha):
- id(0), filename(_filename), hasMipmap(_hasMipmap), hasAlpha(_hasAlpha), isSkin(false),
+TextureRes::TextureRes(const string& _filename, bool _hasMipmap):
+ id(0), filename(_filename), hasMipmap(_hasMipmap), isSkin(false),
skinsize(0), data(NULL), datalen(0)
{
load();
}
TextureRes::TextureRes(const string& _filename, bool _hasMipmap, GLubyte* array, int* skinsizep):
- id(0), filename(_filename), hasMipmap(_hasMipmap), hasAlpha(false), isSkin(true),
+ id(0), filename(_filename), hasMipmap(_hasMipmap), isSkin(true),
skinsize(0), data(NULL), datalen(0)
{
load();
}
}
-void Texture::load(const string& filename, bool hasMipmap, bool hasAlpha)
+void Texture::load(const string& filename, bool hasMipmap)
{
destroy();
- tex = new TextureRes(filename, hasMipmap, hasAlpha);
+ tex = new TextureRes(filename, hasMipmap);
}
void Texture::load(const string& filename, bool hasMipmap, GLubyte* array, int* skinsizep)