Restructure repository to include all source folders
Move git root from Client/ to src/ to track all source code: - Client: Game client source (moved to Client/Client/) - Server: Game server source - GameTools: Development tools - CryptoSource: Encryption utilities - database: Database scripts - Script: Game scripts - rylCoder_16.02.2008_src: Legacy coder tools - GMFont, Game: Additional resources 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
66
GameTools/ZALLA3D BASECLASS/TextureContainer.cpp
Normal file
66
GameTools/ZALLA3D BASECLASS/TextureContainer.cpp
Normal file
@@ -0,0 +1,66 @@
|
||||
// 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;i<m_TextureList.num;i++)
|
||||
{
|
||||
if(strcmp(m_TextureList[i]->m_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;i<m_TextureList.num;i++)
|
||||
{
|
||||
if(strcmp(m_TextureList[i]->m_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<m_TextureList.num;i++)
|
||||
{
|
||||
delete m_TextureList[i];
|
||||
}
|
||||
m_TextureList.num=0;
|
||||
}
|
||||
Reference in New Issue
Block a user