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++)
201 float alphafront, alphaback;
207 VSlot(
Slot *slot =
nullptr,
int index = -1) : slot(slot), next(nullptr), index(index), changed(0)
216 void addvariant(
Slot *slot);
224 angle =
vec(0, sinf(0), cosf(0));
225 offset =
ivec2(0, 0);
230 colorscale =
vec(1, 1, 1);
231 glowcolor =
vec(1, 1, 1);
233 refractcolor =
vec(1, 1, 1);
241 bool isdynamic()
const;
247struct DecalSlot final : Slot, VSlot
251 DecalSlot(
int index = -1) : Slot(index), VSlot(
this), depth(1), fade(0.5f) {}
253 int type()
const override final
255 return SlotType_Decal;
258 const char *name()
const override final;
259 const char *texturedir()
const override final
261 return "media/decal";
264 VSlot &emptyvslot()
override final
269 int cancombine(
int type)
const override final;
270 bool shouldpremul(
int type)
const override final;
287extern std::vector<Slot *> slots;
288extern std::vector<VSlot *> vslots;
289extern std::vector<int *> editingvslots;
291extern const char *getshaderparamname(
const char *name,
bool insert =
true);
292extern void setldrnotexture();
296extern Slot &lookupslot(
int slot,
bool load =
true);
297extern VSlot &lookupvslot(
int slot,
bool load =
true);
298extern bool unpackvslot(ucharbuf &buf,
VSlot &dst,
bool delta);
299extern 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
std::vector< SlotShaderParam > params
bitmask containing zero or more bits defined above in the VSlot enum values.
Definition slot.h:193
integer vector2
Definition geom.h:2646
two dimensional Cartesian vector object
Definition geom.h:34
three dimensional Cartesian vector object
Definition geom.h:207