Inexor
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Public Member Functions | Public Attributes | List of all members
Slot Class Reference

#include <slot.hpp>

Inheritance diagram for Slot:
MSlot

Classes

struct  Tex
 

Public Member Functions

 Slot (int index=-1)
 
void reset ()
 
void cleanup ()
 
void addtexture (int type, const char *filename)
 
Texfindtexture (int type)
 Find a texture in the sts array, depending on type (beeing one of TEX_DIFFUSE to TEX_NUM). More...
 
void addvariant (VSlot *vs)
 
VSlotsetvariantchain (VSlot *vs)
 Sets a chain of VSlot variants for the owner slot. More...
 
VSlotfindvariant (const VSlot &src, const VSlot &delta)
 
void combinetextures (int index, Slot::Tex &t, bool msg=true, bool forceload=false)
 Combine and load texture data to be ready for sending it to the gpu. More...
 
Slotload (bool msg, bool forceload)
 
Textureloadthumbnail ()
 Generate a preview image of this slot for the texture browser. More...
 
void loadlayermask ()
 

Public Attributes

int index
 
vector< Texsts
 
Shadershader
 
vector< SlotShaderParamparams
 
VSlotvariants
 All virtual Slots deriving from this slot in a node chain. More...
 
bool loaded
 
uint texmask
 
char * autograss
 
Texturegrasstex
 
Texturethumbnail
 
char * layermaskname
 
int layermaskmode
 
float layermaskscale
 
ImageDatalayermask
 

Class Documentation

struct Slot::Tex
Class Members
int combined
string name
Texture * t
int type

Constructor & Destructor Documentation

Slot::Slot ( int  index = -1)
inline

References reset().

Member Function Documentation

void Slot::addtexture ( int  type,
const char *  filename 
)
void Slot::addvariant ( VSlot vs)
inline

References VSlot::next.

Referenced by VSlot::VSlot().

void Slot::cleanup ( )
void Slot::combinetextures ( int  index,
Slot::Tex t,
bool  msg = true,
bool  forceload = false 
)

Combine and load texture data to be ready for sending it to the gpu.

Combination is used to merge the diffuse and the specularity map into one texture (spec as alpha) and to merge the normal info and the depth info into another (depth as alpha)

Parameters
index
tOutput texture made from seperate textures being combined
msgshow progress bar
forceload

References Slot::Tex::combined, tiger::compress(), ImageData::compressed, gencombinedname(), vector< T, MINSIZE >::getbuf(), gettexture(), ImageData::h, loopv, mergedepth(), mergespec(), newtexture(), notexture, scaleimage(), sts, Slot::Tex::t, TEX_DEPTH, TEX_DIFFUSE, TEX_NORMAL, TEX_SPEC, texmask, texturedata(), Slot::Tex::type, and ImageData::w.

Referenced by load().

Slot::Tex * Slot::findtexture ( int  type)

Find a texture in the sts array, depending on type (beeing one of TEX_DIFFUSE to TEX_NUM).

References loopv, and sts.

Referenced by gencombinedname().

VSlot * Slot::findvariant ( const VSlot src,
const VSlot delta 
)

References VSlot::changed, comparevslot(), and VSlot::next.

Referenced by editvslot(), and unpacktex().

Slot & Slot::load ( bool  msg,
bool  forceload 
)
void Slot::loadlayermask ( )
Texture * Slot::loadthumbnail ( )
void Slot::reset ( )
VSlot * Slot::setvariantchain ( VSlot vs)

Sets a chain of VSlot variants for the owner slot.

References VSlot::linked, VSlot::next, and VSlot::slot.

Referenced by emptyvslot().

Member Data Documentation

char* Slot::autograss
Texture* Slot::grasstex

Referenced by cleanup(), gengrassquads(), and reset().

int Slot::index
ImageData* Slot::layermask
int Slot::layermaskmode

Referenced by generatealpha(), reset(), and texlayer().

char* Slot::layermaskname

Referenced by loadlayermask(), reset(), and texlayer().

float Slot::layermaskscale

Referenced by generatealpha(), reset(), and texlayer().

bool Slot::loaded
vector<SlotShaderParam> Slot::params
Shader* Slot::shader
vector<Tex> Slot::sts
uint Slot::texmask
Texture * Slot::thumbnail
VSlot* Slot::variants

The documentation for this class was generated from the following files: