deTexturePropertyMap Class Reference

Texture property map. More...

#include <deTexturePropertyMap.h>

List of all members.

Public Member Functions

Constructors and Destructors
 deTexturePropertyMap (deEngine *engine)
 Creates a new mapper.
 ~deTexturePropertyMap ()
 Cleans up the mapper.
Management
int GetPropertyNameCount () const
 Retrieves the number of property names.
const char * GetPropertyNameAt (int index) const
 Retrieves the property name for the given index/number.
int IndexOfPropertyName (const char *name) const
 Retrieves the index of the given property name or -1 if not found.
bool HasPropertyName (const char *name) const
 Determines if the given property name exists.
int AddPropertyName (const char *name)
 Adds a property name.

Detailed Description

Texture property map.

Properties defined various material properties in skin textures. To allow adding any kind of new material properties without changing the engine code or other modules a simple name based system is used. Depending on the name of a property graphic modules can apply the property to different material properties internally.

To avoid storing long names for each property in the large number
of skins and textures used in a game this texture property map exists which maps property names to indices. Whenever a skin module wants to add a property to a texture it can ask this mapper to get the number for this property. Properties can only be added to this list never deleted. If a property name does not yet exist it is added. In all cases the unique number for the given property is returned.
All modules using property names only have to watch changes in the
engine wide texture property mapper. Whenever a new property name has been added a notification is send to all modules that care about it. All module intern mapping takes place during this notification. After this point in time the mapping can be simply used with the number found in the skins.
Author:
Plüss Roland
Version:
1.0
Date:
2008

Constructor & Destructor Documentation

deTexturePropertyMap::deTexturePropertyMap ( deEngine engine )

Creates a new mapper.

deTexturePropertyMap::~deTexturePropertyMap (  )

Cleans up the mapper.


Member Function Documentation

int deTexturePropertyMap::AddPropertyName ( const char *  name )

Adds a property name.

If the name does not exists yet it is added and all modules are notified about the new name. In all cases the index of the property name is returned.

Parameters:
propertyNameName of the property to add.
Returns:
number of the property.
const char* deTexturePropertyMap::GetPropertyNameAt ( int  index ) const

Retrieves the property name for the given index/number.

int deTexturePropertyMap::GetPropertyNameCount (  ) const [inline]

Retrieves the number of property names.

bool deTexturePropertyMap::HasPropertyName ( const char *  name ) const

Determines if the given property name exists.

int deTexturePropertyMap::IndexOfPropertyName ( const char *  name ) const

Retrieves the index of the given property name or -1 if not found.


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