22 memset(&desc, 0,
sizeof(desc));
23 desc.
dwSize =
sizeof(desc);
31 for (LegoCachedTextureList::iterator it =
m_cached.begin(); it !=
m_cached.end(); it++) {
32 if ((*it).second ==
FALSE && (*it).first->m_texture->AddRef() != 0 && (*it).first->m_texture->Release() == 1) {
33 if (!strcmp((*it).first->m_name, p_textureInfo->
m_name)) {
35 memset(&newDesc, 0,
sizeof(newDesc));
36 newDesc.
dwSize =
sizeof(newDesc);
48 (*it).first->m_texture->AddRef();
61 memset(&newDesc, 0,
sizeof(newDesc));
64 newDesc.
dwSize =
sizeof(newDesc);
74 rect.right = newDesc.
dwWidth - 1;
101 delete[] textureInfo->
m_name;
104 textureInfo->
m_name =
new char[strlen(p_textureInfo->
m_name) + 1];
117 if (p_textureInfo ==
NULL) {
122 LegoCachedTextureList::iterator it;
125 for (LegoCachedTextureList::iterator it =
m_cached.begin(); it !=
m_cached.end(); it++) {
127 if ((*it).first == p_textureInfo) {
128 (*it).second =
FALSE;
131 delete p_textureInfo;
Template alias for a map from C-string keys to object pointers, using LegoContainerInfoComparator for...
Specialized LegoContainer handling LegoTextureInfo objects and their DirectDraw/Direct3D caching.
LegoCachedTextureList m_cached
List of cached temporary texture objects, pairing texture info with a cache/in-use flag....
void EraseCached(LegoTextureInfo *p_textureInfo)
Mark a cached texture as unused and release its Direct3D/DirectDraw resources if its reference count ...
LegoTextureInfo * GetCached(LegoTextureInfo *p_textureInfo)
Attempt to find and return a cached LegoTextureInfo with the same properties as p_textureInfo,...
~LegoTextureContainer() override
Destructor.
[AI] Contains DirectDraw and Direct3DRM handles and metadata for a texture used in the LEGO Island re...
LPDIRECTDRAWPALETTE m_palette
[AI] DirectDraw palette object (8-bit) assigned to the m_surface.
LPDIRECTDRAWSURFACE m_surface
[AI] DirectDraw surface holding the 8-bit indexed image for the texture.
LPDIRECT3DRMTEXTURE2 m_texture
[AI] Direct3DRM texture object used by retained-mode rendering.
char * m_name
[AI] Pointer to the logical name string for this texture (allocated; e.g., "BROWN_ROOF").
MxDirect3D * GetDirect3D()
[AI] Returns the active Direct3D wrapper (engine/utility) object.
Tgl::Renderer * GetRenderer()
[AI] Returns the underlying renderer for this manager; normally a Direct3D Retained Mode wrapper.
IDirectDraw * DirectDraw()
Returns the DirectDraw device interface pointer.
[AI] Implements Tgl::MeshBuilder; facilitates mesh construction [AI]
struct IDirectDrawSurface FAR * LPDIRECTDRAWSURFACE
typedef DWORD(FAR PASCAL *LPCLIPPERCALLBACK)(LPDIRECTDRAWCLIPPER lpDDClipper
#define DDCAPS_OVERLAYCANTCLIP
#define DDPF_PALETTEINDEXED8
#define DDLOCK_SURFACEMEMORYPTR
#define DECOMP_SIZE_ASSERT(T, S)
pair< LegoTextureInfo *, BOOL > LegoCachedTexture
Pair associating a LegoTextureInfo pointer with a cache state (BOOL).
#define NULL
[AI] Null pointer value (C/C++ semantics).
LegoVideoManager * VideoManager()
[AI] Accessor for the game's LegoVideoManager subsystem. Used for managing 3D/video hardware....
DDPIXELFORMAT ddpfPixelFormat