Isle
Loading...
Searching...
No Matches
LegoTextureInfo Class Reference

[AI] Contains DirectDraw and Direct3DRM handles and metadata for a texture used in the LEGO Island rendering system. More...

#include <legotextureinfo.h>

Public Member Functions

 LegoTextureInfo ()
 [AI] Constructor. More...
 
 ~LegoTextureInfo ()
 [AI] Destructor. More...
 
LegoResult FUN_10066010 (const LegoU8 *p_bits)
 [AI] Updates the pixel bits for the current surface/texture with the provided bitmap data. More...
 

Static Public Member Functions

static LegoTextureInfoCreate (const char *p_name, LegoTexture *p_texture)
 [AI] Creates a new LegoTextureInfo for a given logical name and loaded LegoTexture. More...
 
static BOOL SetGroupTexture (Tgl::Mesh *pMesh, LegoTextureInfo *p_textureInfo)
 [AI] Assigns a Direct3DRM texture group from a LegoTextureInfo to a mesh group via the Tgl/Microsoft retained mode API. More...
 
static BOOL GetGroupTexture (Tgl::Mesh *pMesh, LegoTextureInfo *&p_textureInfo)
 [AI] Retrieves the LegoTextureInfo currently attached to the supplied mesh group. More...
 

Public Attributes

char * m_name
 [AI] Pointer to the logical name string for this texture (allocated; e.g., "BROWN_ROOF"). More...
 
LPDIRECTDRAWSURFACE m_surface
 [AI] DirectDraw surface holding the 8-bit indexed image for the texture. More...
 
LPDIRECTDRAWPALETTE m_palette
 [AI] DirectDraw palette object (8-bit) assigned to the m_surface. More...
 
LPDIRECT3DRMTEXTURE2 m_texture
 [AI] Direct3DRM texture object used by retained-mode rendering. More...
 

Detailed Description

[AI] Contains DirectDraw and Direct3DRM handles and metadata for a texture used in the LEGO Island rendering system.

[AI] This structure manages a DirectDrawSurface, a DirectDrawPalette, and a Direct3DRMTexture2 representing a loaded texture, as well as the C string name corresponding to the LEGO logical texture name. It also provides utility methods for creating, applying, and retrieving textures on Tgl/Microsoft Direct3D meshes.

Definition at line 19 of file legotextureinfo.h.

Constructor & Destructor Documentation

◆ LegoTextureInfo()

LegoTextureInfo::LegoTextureInfo ( )

[AI] Constructor.

Initializes all pointer fields to null.

Definition at line 13 of file legotextureinfo.cpp.

◆ ~LegoTextureInfo()

LegoTextureInfo::~LegoTextureInfo ( )

[AI] Destructor.

Releases all associated DirectDraw and Direct3DRM resources, and frees the name string.

Definition at line 22 of file legotextureinfo.cpp.

Member Function Documentation

◆ Create()

LegoTextureInfo * LegoTextureInfo::Create ( const char *  p_name,
LegoTexture p_texture 
)
static

[AI] Creates a new LegoTextureInfo for a given logical name and loaded LegoTexture.

Parameters
p_name[AI] Name of the texture (usually the LEGO logical name, e.g., "BROWN_ROOF").
p_texture[AI] Pointer to a LegoTexture holding image/bitmap and palette data.
Returns
Pointer to a new LegoTextureInfo if successful, or NULL on failure. Returns NULL if either parameter is NULL or if resource allocation fails. [AI]

[AI] Allocates a new LegoTextureInfo, creates DirectDrawSurface/Palette from the image, assigns the name, and stores the resulting D3DRM Texture. The returned object owns its resources. Appends textureInfo into D3DRMAppData.

Definition at line 46 of file legotextureinfo.cpp.

◆ FUN_10066010()

LegoResult LegoTextureInfo::FUN_10066010 ( const LegoU8 p_bits)

[AI] Updates the pixel bits for the current surface/texture with the provided bitmap data.

Parameters
p_bits[AI] Pointer to the updated 8-bit indexed image pixel data to load into the DirectDrawSurface (same format as originally loaded).
Returns
SUCCESS if the update succeeded and the texture is marked as changed, FAILURE otherwise. [AI]

[AI] This is used for dynamic texture updates—locks the surface, copies over p_bits for the correct pitch/stride, and triggers the Direct3DRMTexture2 refresh.

Definition at line 189 of file legotextureinfo.cpp.

◆ GetGroupTexture()

BOOL LegoTextureInfo::GetGroupTexture ( Tgl::Mesh pMesh,
LegoTextureInfo *&  p_textureInfo 
)
static

[AI] Retrieves the LegoTextureInfo currently attached to the supplied mesh group.

Parameters
pMesh[AI] Mesh to query for texture information.
p_textureInfo[AI] Reference to pointer; on success, points to the associated LegoTextureInfo or NULL.
Returns
TRUE if a texture is found and pointer is set, FALSE otherwise. [AI]

[AI] Uses Direct3DRM APIs to query for an attached group texture and extract the LegoTextureInfo from its application data.

Definition at line 165 of file legotextureinfo.cpp.

◆ SetGroupTexture()

BOOL LegoTextureInfo::SetGroupTexture ( Tgl::Mesh pMesh,
LegoTextureInfo p_textureInfo 
)
static

[AI] Assigns a Direct3DRM texture group from a LegoTextureInfo to a mesh group via the Tgl/Microsoft retained mode API.

Parameters
pMesh[AI] Tgl::Mesh pointer representing the mesh group.
p_textureInfo[AI] Texture info instance providing the D3DRMTexture to set.
Returns
TRUE on success. [AI]

[AI] Associates the Direct3DRMTexture2 in p_textureInfo with the specified mesh group using the Tgl layer, so it will be rendered textured.

Definition at line 157 of file legotextureinfo.cpp.

Member Data Documentation

◆ m_name

char* LegoTextureInfo::m_name

[AI] Pointer to the logical name string for this texture (allocated; e.g., "BROWN_ROOF").

Definition at line 73 of file legotextureinfo.h.

◆ m_palette

LPDIRECTDRAWPALETTE LegoTextureInfo::m_palette

[AI] DirectDraw palette object (8-bit) assigned to the m_surface.

Definition at line 83 of file legotextureinfo.h.

◆ m_surface

LPDIRECTDRAWSURFACE LegoTextureInfo::m_surface

[AI] DirectDraw surface holding the 8-bit indexed image for the texture.

Definition at line 78 of file legotextureinfo.h.

◆ m_texture

LPDIRECT3DRMTEXTURE2 LegoTextureInfo::m_texture

[AI] Direct3DRM texture object used by retained-mode rendering.

Receives updates from m_surface.

Definition at line 88 of file legotextureinfo.h.


The documentation for this class was generated from the following files: