// TextureContainer.cpp: implementation of the CTextureContainer class. // ////////////////////////////////////////////////////////////////////// #include "TextureContainer.h" ////////////////////////////////////////////////////////////////////// // Construction/Destruction ////////////////////////////////////////////////////////////////////// CTextureContainer::CTextureContainer() { } CTextureContainer::~CTextureContainer() { DeleteAllTexture(); } void CTextureContainer::AddTexture(const char *strTextName, const LPDIRECT3DBASETEXTURE8 pddTexture) { m_TextureList.Add(new TextureNode(strTextName,pddTexture)); } int CTextureContainer::FindTexture(char *strTextName) { for(int i=0;im_strTextureName,strTextName)==0) return i; } return -1; } LPDIRECT3DBASETEXTURE8 CTextureContainer::AddUsedTexture(int nUsed) { m_TextureList[nUsed]->m_nUsed++; return m_TextureList[nUsed]->m_pddsTexture; } void CTextureContainer::DeleteTexture(char *strTextName) { for(int i=0;im_strTextureName,strTextName)==0) { if(--m_TextureList[i]->m_nUsed==0) { TextureNode *temp=m_TextureList[i]; m_TextureList.DelIndex(i); delete temp; return; } } } } void CTextureContainer::DeleteAllTexture() { for(int i=0;i