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>
52 lines
1.4 KiB
C++
52 lines
1.4 KiB
C++
// TextureContainer.h: interface for the CTextureContainer class.
|
|
//
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
#if !defined(AFX_TEXTURECONTAINER_H__54E7CE78_FE22_4D67_8E7C_F04CFF06DE90__INCLUDED_)
|
|
#define AFX_TEXTURECONTAINER_H__54E7CE78_FE22_4D67_8E7C_F04CFF06DE90__INCLUDED_
|
|
|
|
#if _MSC_VER > 1000
|
|
#pragma once
|
|
#endif // _MSC_VER > 1000
|
|
|
|
#include <d3d8.h>
|
|
#include <string>
|
|
#include "list.h"
|
|
#include "Exception.h"
|
|
const long TEXTURENAMEBUFFER=256;
|
|
|
|
|
|
class CTextureContainer
|
|
{
|
|
class TextureNode {
|
|
public:
|
|
long m_nUsed;
|
|
char m_strTextureName[TEXTURENAMEBUFFER];
|
|
LPDIRECT3DBASETEXTURE8 m_pddsTexture;
|
|
TextureNode(const char *strName,const LPDIRECT3DBASETEXTURE8 pddTexture)
|
|
{
|
|
m_nUsed=1;
|
|
strcpy(m_strTextureName,strName);
|
|
m_pddsTexture=pddTexture;
|
|
};
|
|
~TextureNode()
|
|
{
|
|
if(m_pddsTexture != NULL) {
|
|
if(m_pddsTexture->Release()!=0)
|
|
throw CGraphicLayerError("TextureNode: ~TextureNode ,This texture used other memory,as yet");
|
|
}
|
|
};
|
|
};
|
|
List<TextureNode*> m_TextureList;
|
|
public:
|
|
void DeleteAllTexture();
|
|
void DeleteTexture(char *strTextName);
|
|
LPDIRECT3DBASETEXTURE8 AddUsedTexture(int nUsed);
|
|
int FindTexture(char *strTextName);
|
|
void AddTexture(const char *strTextName, const LPDIRECT3DBASETEXTURE8 pddTexture);
|
|
CTextureContainer();
|
|
virtual ~CTextureContainer();
|
|
};
|
|
|
|
#endif // !defined(AFX_TEXTURECONTAINER_H__54E7CE78_FE22_4D67_8E7C_F04CFF06DE90__INCLUDED_)
|