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

This commit is contained in:
2019-05-27 16:36:51 +00:00
parent 09e7268779
commit bb75525a3b
37 changed files with 926 additions and 683 deletions

View File

@@ -76,14 +76,19 @@ class GLTextureManager;
class GLTextureManagerBase {
public:
static void addSearchPath(const QString & path) {search_pathes << path;}
GLTextureManagerBase() {}
virtual ~GLTextureManagerBase() {}
void addSearchPath(const QString & path) {search_pathes << path;}
static QStringList searchPathes() {return search_pathes;}
static QString findFile(const QString & path);
static GLuint loadTexture(const QString & path, bool ownership = true, bool bump = false);
static GLuint loadTexture(const QImage & image, bool ownership = true, bool bump = false);
static void reloadTexture(GLuint tid, const QString & path);
static void reloadTexture(GLuint tid, const QImage & image);
QString findFile(const QString & path);
GLuint loadTexture(const QString & path, bool ownership = true, bool bump = false);
GLuint loadTexture(const QImage & image, bool ownership = true, bool bump = false);
void reloadTexture(GLuint tid, const QString & path);
void reloadTexture(GLuint tid, const QImage & image);
int textureID(const QString & path, bool bump = false) {return tex_ids[bump ? 1 : 0][path];}
virtual void addTexture(const QString & path) = 0;
virtual void addAnimation(const QString & dir, const QString & name) = 0;
virtual bool loadTextures() = 0;
protected:
static void convertToNormal(QImage & im);
@@ -92,8 +97,6 @@ protected:
};
//extern GLTextureManager * currentGLTextureManager;
struct Map {
Map() {bitmap_id = 0; color_amount = 1.f; color_offset = 0.f; animation_frame_rate = -1.f;}
QString bitmap_path;
@@ -108,7 +111,7 @@ struct Map {
struct Material {
Material();
void apply(QOpenGLShaderProgram * prog);
void loadTextures(GLTextureManagerBase * tm = 0);
void loadTextures(GLTextureManagerBase * tm);
QString name;
QColor color_diffuse;
QColor color_specular;