#include <Texture.h>
Inherited by DAEffect, Interface, and Object.
Inheritance diagram for Texture:
Public Member Functions | |
Texture () | |
Standard constructor. | |
virtual | ~Texture () |
Standard destructor. | |
int | loadAndBind (std::string p_filename, eTextureModification p_modifikationflag=TM_Masked_Normal) |
Loads and binds the texture and generates a mask and also binds it. | |
virtual int | render () |
Renders the plane with the textures on it. | |
virtual Field * | getField () |
Returns a pointer to the field class if it is one. | |
virtual Button * | getButton () |
Returns a pointer to the button class if it is one. | |
Static Public Member Functions | |
static Texture * | get (int p_id) |
Returns a pointer to the Object identified by its id;. | |
Public Attributes | |
int | id |
Holds the unique ID, identifying the Object;. | |
int | sequence |
Holds the sequenz number to render. | |
int | sequenceCount |
Holds the number of frames per line. | |
Protected Attributes | |
TextureInterface * | myTexture |
Holds the texture to render. | |
double | ratio |
Holds the ratio of the Image. | |
Static Private Attributes | |
static std::map< std::string, TextureInterface * > | cachedTextures |
Ressource cache - every Texture and Mask has to be loaded only once. | |
static int | idCounter = 1 |
Counter for the unique identifier. | |
static std::map< int, Texture * > | allItems |
Map for all Objects ever created. |
Definition at line 35 of file Texture.h.
Texture::Texture | ( | ) |
Texture::~Texture | ( | ) | [virtual] |
int Texture::loadAndBind | ( | std::string | p_filename, | |
eTextureModification | p_modifikationflag = TM_Masked_Normal | |||
) |
Loads and binds the texture and generates a mask and also binds it.
p_filename | Filename for the texture to load. | |
p_modifikationflag | Flag for postprocess modifying. |
Definition at line 60 of file Texture.cpp.
References cachedTextures, myTexture, TextureInterface::ratio, ratio, sequence, and sequenceCount.
Referenced by Unit::load(), Level::load(), Interface::load(), Field::select(), Unit::settle(), and FunctionHandler::standardAction().
int Texture::render | ( | ) | [virtual] |
Renders the plane with the textures on it.
Reimplemented in Button, DAEffect, and Interface.
Definition at line 78 of file Texture.cpp.
References myTexture, ratio, TextureInterface::render(), sequence, and sequenceCount.
Referenced by Unit::render(), Object::render(), Interface::render(), Field::render(), DAEffect::render(), and Button::render().
Here is the call graph for this function:
Texture * Texture::get | ( | int | p_id | ) | [static] |
Returns a pointer to the Object identified by its id;.
p_id | id for the object |
Definition at line 51 of file Texture.cpp.
References allItems.
Referenced by Interface::render(), FunctionHandler::select(), FunctionHandler::selectBonus(), FunctionHandler::setSpawnDestination(), FunctionHandler::settle(), FunctionHandler::standardAction(), and FunctionHandler::terminate().
Field * Texture::getField | ( | ) | [virtual] |
Returns a pointer to the field class if it is one.
Reimplemented in Field.
Definition at line 102 of file Texture.cpp.
Referenced by Interface::render(), FunctionHandler::select(), FunctionHandler::selectBonus(), FunctionHandler::setSpawnDestination(), FunctionHandler::settle(), FunctionHandler::standardAction(), and FunctionHandler::terminate().
Button * Texture::getButton | ( | ) | [virtual] |
Returns a pointer to the button class if it is one.
Reimplemented in Button.
Definition at line 107 of file Texture.cpp.
Referenced by FunctionHandler::select(), and FunctionHandler::selectBonus().
int Texture::id |
Holds the unique ID, identifying the Object;.
Definition at line 89 of file Texture.h.
Referenced by FunctionHandler::select(), FunctionHandler::standardAction(), and Texture().
Holds the sequenz number to render.
Definition at line 94 of file Texture.h.
Referenced by EventAnimation::compute(), loadAndBind(), and render().
Holds the number of frames per line.
It is assumed, that we have a square texture.
Definition at line 99 of file Texture.h.
Referenced by loadAndBind(), render(), and FunctionHandler::standardAction().
TextureInterface* Texture::myTexture [protected] |
Holds the texture to render.
Definition at line 105 of file Texture.h.
Referenced by loadAndBind(), and render().
double Texture::ratio [protected] |
Holds the ratio of the Image.
Definition at line 110 of file Texture.h.
Referenced by loadAndBind(), render(), and DAEffect::render().
std::map< std::string, TextureInterface * > Texture::cachedTextures [static, private] |
Ressource cache - every Texture and Mask has to be loaded only once.
Definition at line 116 of file Texture.h.
Referenced by loadAndBind().
int Texture::idCounter = 1 [static, private] |
std::map< int, Texture * > Texture::allItems [static, private] |
Map for all Objects ever created.
Definition at line 126 of file Texture.h.
Referenced by get(), Texture(), and ~Texture().