Public Member Functions
|CParentMap (const CGridPosition &pos, const CTileSurface *const *parents, CTileSurface::eTextureType type)|
|T *||getLandel (int x, int y)|
|CMap< T > *||m_Maps |
|The map pointers. |
pixel shift (child scale) of the child origin w.r.t. m_Maps
This class can be used in derived classes of CTileSurface, when landscape generation is to be based on map data of parent surfaces. This class accepts pointers to the parent surfaces, and translates pixel coordinates between the different levels to return the correct pixel value from the parent maps.
|libProcTer::CParentMap< T >::CParentMap||(||const CGridPosition &||pos,|
|const CTileSurface *const *||parents,|
|pos||The grid position of the child tile. Can typically be obtained with CTileSurface::getPosition().|
|parents||Array of pointers to the four parents. Can typically be obtained with CTileSurface::getParents().|
|type||The type of surface that is used. CParentMap calls CTileSurface::getInternalMap on the parent surfaces to get pointers to the map data. As it needs to do some type-unsafe pointer conversions, the user of CParentMap is responsible for making sure that the template type of CParentMap corresponds to the actual data type of the map data in the parents.|
|T * libProcTer::CParentMap< T >::getLandel||(||int||x,|
Returns a pointer to the landel ('pixel') in the parent maps that corresponds to the child map coordinates (x,y).
The range of allowed values for x and y is [-PROCTER_TEX_RES, 2*PROCTER_TEX_RES).
As the parent maps have half the resolution of the child map, x and y should be even. If they are not, they are rounded down (e.g. 3 is interpreted as 2, and -1 is interpreted as -2).