git-svn-id: svn://db.shs.com.ru/libs@290 a8b55f48-bf90-11e4-a774-851b48703e85

This commit is contained in:
2017-10-06 11:35:57 +00:00
parent e91cd3d941
commit 7d82c271e3
9 changed files with 136 additions and 102 deletions

View File

@@ -83,6 +83,7 @@ void GLCubeTexture::loadPathesFromDirectory(const QString & dir) {
GLuint GLTextureManagerBase::loadTexture(const QString & path, bool ownership, bool bump) {
if (!currentGLTextureManager) return 0;
QString p = findFile(path, search_pathes);
if (p.isEmpty()) return 0;
int tid = ((GLTextureManagerBase*)currentGLTextureManager)->textureID(p, bump);
@@ -225,7 +226,8 @@ void Material::apply(__GLShaderProgram__ * prog) {
void Material::loadTextures(GLTextureManagerBase * tm) {
//qDebug() << "load textures";
if (tm == 0) tm = (GLTextureManagerBase*)currentGLTextureManager;
if (!tm) tm = (GLTextureManagerBase*)currentGLTextureManager;
if (!tm) return;
if (!map_diffuse.bitmap_path.isEmpty()) map_diffuse.bitmap_id = tm->loadTexture(map_diffuse.bitmap_path);
if (!map_normal.bitmap_path.isEmpty()) map_normal.bitmap_id = tm->loadTexture(map_normal.bitmap_path, true, true);
if (!map_relief.bitmap_path.isEmpty()) map_relief.bitmap_id = tm->loadTexture(map_relief.bitmap_path);