forked from mrkite/TerraFirma
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgltextures.h
59 lines (48 loc) · 1.15 KB
/
gltextures.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/** @Copyright 2015 seancode */
#ifndef GLTEXTURES_H_
#define GLTEXTURES_H_
#include <QOpenGLTexture>
#include <QSharedPointer>
#include <QHash>
class TextureException {
public:
explicit TextureException(QString reason) : reason(reason) {}
QString reason;
};
class GLTextures {
public:
enum TextureType {
WallOutline = 0x000,
Shroom = 0x001,
Banner = 0x002,
Actuator = 0x003,
Background = 0x1000,
Underworld = 0x2000,
Wall = 0x3000,
Tile = 0x4000,
Liquid = 0x5000,
NPC = 0x6000,
NPCHead = 0x7000,
ArmorHead = 0x8000,
ArmorBody = 0x9000,
ArmorFemale = 0xa000,
ArmorLegs = 0xb000,
TreeTops = 0xc000,
TreeBranches = 0xd000,
Xmas = 0xe000,
Wood = 0xf000,
Cactus = 0x10000,
Wire = 0x11000
};
GLTextures();
void destroy();
void setRoot(QString root);
bool valid;
QSharedPointer<QOpenGLTexture> get(int type, int cropw = 0, int croph = 0);
private:
QSharedPointer<QOpenGLTexture> load(QString name,
int cropw = 0, int croph = 0);
QString root;
QHash<int, QSharedPointer<QOpenGLTexture>> textures;
};
#endif // GLTEXTURES_H_