86 Tex() : t(
nullptr), combined(-1) {}
92 std::vector<SlotShaderParam> params;
97 Texture *grasstex, *thumbnail;
99 Slot(
int index = -1) : index(index), variants(nullptr), grass(nullptr) { reset(); }
102 virtual int type()
const
104 return SlotType_Octa;
107 virtual const char *name()
const;
108 virtual const char *texturedir()
const
110 return "media/texture";
113 virtual VSlot &emptyvslot();
115 virtual int cancombine(
int type)
const;
116 virtual bool shouldpremul(
int)
const
166 for(uint i = 0; i < sts.size(); i++)
192 std::vector<SlotShaderParam> params;
200 float alphafront, alphaback;
206 VSlot(
Slot *slot =
nullptr,
int index = -1) : slot(slot), next(
nullptr), index(index), changed(0)
215 void addvariant(
Slot *slot);
223 angle =
vec(0, sinf(0), cosf(0));
224 offset =
ivec2(0, 0);
229 colorscale =
vec(1, 1, 1);
230 glowcolor =
vec(1, 1, 1);
232 refractcolor =
vec(1, 1, 1);
240 bool isdynamic()
const;
252 int type()
const override final
254 return SlotType_Decal;
257 const char *name()
const override final;
258 const char *texturedir()
const override final
260 return "media/decal";
263 VSlot &emptyvslot()
override final
268 int cancombine(
int type)
const override final;
269 bool shouldpremul(
int type)
const override final;
286extern std::vector<Slot *> slots;
287extern std::vector<VSlot *> vslots;
288extern std::vector<int *> editingvslots;
290extern const char *getshaderparamname(
const char *name,
bool insert =
true);
291extern void setldrnotexture();
295extern Slot &lookupslot(
int slot,
bool load =
true);
296extern VSlot &lookupvslot(
int slot,
bool load =
true);
297extern bool unpackvslot(
ucharbuf &buf,
VSlot &dst,
bool delta);
298extern DecalSlot &lookupdecalslot(
int slot,
bool load =
true);
A representation of a texture inside the engine.
Definition slot.h:71
Texture * loadthumbnail()
Returns a new texture that is a thumbnail of the slot's texture.
int findtextype(int type, int last=-1) const
Attempts to find a tex with index type.
A virtual texture slot.
Definition slot.h:188
integer vector2
Definition geom.h:2158
two dimensional Cartesian vector object
Definition geom.h:34
three dimensional Cartesian vector object
Definition geom.h:185