2 #include "TextureFactory.h" 3 #include "TextureEntity.h" 10 #define MAX_NUM_TEXTURE_LAYERS 4 48 short layers[MAX_NUM_TEXTURE_LAYERS];
72 this->nIndex = nIndex;
73 this->pTexture = pTexture;
74 this->nHitCount = 1<<31;
78 this->nHitCount |= 1<<31;
82 if(this->nHitCount<0x0000ffff)
85 this->nHitCount = this->nHitCount>>1;
97 void DeleteOldestCacheItem();
105 void Init(
int numTiles,
float fTileSize);
111 void DeleteAllTextures();
116 int GetTextureIDAt(
float originX,
float originY,
short nLayer=0);
126 void UnloadTexture(
int index);
Which DXT Compression to Use? Obviously, there are some trade-offs between the different formats whic...
Definition: TextureEntity.h:29
index to he texture list for each layer
Definition: DetailTextureFactory.h:43
Definition: SceneObject.h:15
a cached texture item
Definition: DetailTextureFactory.h:60
different physics engine has different winding order.
Definition: EventBinding.h:32
float m_fTileSize
the size of each tile in world unit.
Definition: DetailTextureFactory.h:38
vector< string > m_listTextures
all texture file path lists.
Definition: DetailTextureFactory.h:92
int nIndex
index of the item, into the m_listTextures
Definition: DetailTextureFactory.h:63
void FrameMove()
this is called every rendering frame.
Definition: DetailTextureFactory.h:81
HighResTextureInfo * m_TexturesMatrix
a m_nTileNumX*m_nTileNumY matrix, with the cell storing the texture index.
Definition: DetailTextureFactory.h:53
this class implements a texture factory class for detailed tile based terrain surface texture...
Definition: DetailTextureFactory.h:27
void OnHit()
on hit
Definition: DetailTextureFactory.h:77
int m_nTileNum
the number of tiles in the x or y direction.They must be equal.
Definition: DetailTextureFactory.h:36
asset_ptr< TextureEntity > pTexture
the texture object
Definition: DetailTextureFactory.h:65
int m_nNumTextureCache
maximum number of tile textures to cache in memory
Definition: DetailTextureFactory.h:56
string m_sFileName
the low-res texture file path
Definition: DetailTextureFactory.h:34
list< TextureCacheItem > m_CachedTextureItems
all cached items
Definition: DetailTextureFactory.h:89
DWORD nHitCount
a bits mask of number of times that this texture is hit in the last 32 render frames.
Definition: DetailTextureFactory.h:69