50 if (p_name ==
NULL || p_texture ==
NULL) {
55 textureInfo->
m_name =
new char[strlen(p_name) + 1];
56 strcpy(textureInfo->
m_name, p_name);
63 memset(&desc, 0,
sizeof(desc));
64 desc.
dwSize =
sizeof(desc);
83 memset(&desc, 0,
sizeof(desc));
84 desc.
dwSize =
sizeof(desc);
95 for (i = 0; i < desc.
dwHeight; i++) {
104 PALETTEENTRY entries[256];
105 memset(entries, 0,
sizeof(entries));
108 if (i < image->GetCount()) {
109 entries[i].peFlags = 0;
115 entries[i].peFlags = 0x80;
135 delete[] textureInfo->
m_name;
149 if (textureInfo !=
NULL) {
171 LPDIRECT3DRMTEXTURE returnPtr =
NULL;
172 LPDIRECT3DRMTEXTURE2 texture =
NULL;
174 if (mesh->GetGroupTexture(
id, &returnPtr) ==
D3DRM_OK) {
175 if (returnPtr->QueryInterface(IID_IDirect3DRMTexture2, (
LPVOID*) &texture) ==
D3DRM_OK) {
179 returnPtr->Release();
193 memset(&desc, 0,
sizeof(desc));
194 desc.
dwSize =
sizeof(desc);
198 const LegoU8* bits = p_bits;
205 memcpy(surface, bits, desc.
dwWidth);
[AI] Class representing an 8-bit palettized image with up to 256 palette entries and indexed pixel da...
LegoU32 GetWidth()
[AI] Returns the current image width in pixels.
LegoPaletteEntry & GetPaletteEntry(LegoU32 p_i)
[AI] Returns a reference to the palette entry at index p_i.
LegoU8 * GetBits()
[AI] Returns pointer to the buffer containing indexed pixel data.
LegoU32 GetHeight()
[AI] Returns the current image height in pixels.
LegoU8 GetBlue()
[AI] Returns the blue color intensity of this palette entry.
LegoU8 GetRed()
[AI] Returns the red color intensity of this palette entry.
LegoU8 GetGreen()
[AI] Returns the green color intensity of this palette entry.
[AI] Contains DirectDraw and Direct3DRM handles and metadata for a texture used in the LEGO Island re...
static BOOL GetGroupTexture(Tgl::Mesh *pMesh, LegoTextureInfo *&p_textureInfo)
[AI] Retrieves the LegoTextureInfo currently attached to the supplied mesh group.
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 ...
LegoTextureInfo()
[AI] Constructor.
LegoResult FUN_10066010(const LegoU8 *p_bits)
[AI] Updates the pixel bits for the current surface/texture with the provided bitmap data.
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.
~LegoTextureInfo()
[AI] Destructor.
char * m_name
[AI] Pointer to the logical name string for this texture (allocated; e.g., "BROWN_ROOF").
static LegoTextureInfo * Create(const char *p_name, LegoTexture *p_texture)
[AI] Creates a new LegoTextureInfo for a given logical name and loaded LegoTexture.
[AI] Represents a texture which wraps a LegoImage and provides loading/saving functionality.
LegoImage * GetImage()
[AI] Returns the associated image used by this texture.
MxDirect3D * GetDirect3D()
[AI] Returns the active Direct3D wrapper (engine/utility) object.
IDirectDraw * DirectDraw()
Returns the DirectDraw device interface pointer.
[AI] Implementation of Tgl::Mesh, manages a mesh object and geometry data with group index [AI]
[AI] Implements Tgl::MeshBuilder; facilitates mesh construction [AI]
[AI] Represents a renderable 3D mesh.
typedef DWORD(FAR PASCAL *LPCLIPPERCALLBACK)(LPDIRECTDRAWCLIPPER lpDDClipper
#define DDCAPS_OVERLAYCANTCLIP
#define DDPF_PALETTEINDEXED8
#define DDLOCK_SURFACEMEMORYPTR
struct IDirectDraw FAR * LPDIRECTDRAW
#define DECOMP_SIZE_ASSERT(T, S)
#define NULL
[AI] Null pointer value (C/C++ semantics).
#define FAILURE
[AI] Used to indicate a failed operation in result codes.
unsigned char LegoU8
[AI] Unsigned 8-bit integer type used throughout LEGO Island.
LegoS32 LegoResult
[AI] Function result type (return code): typically SUCCESS (0) or FAILURE (-1).
#define SUCCESS
[AI] Used to indicate a successful operation in result codes.
LegoVideoManager * VideoManager()
[AI] Accessor for the game's LegoVideoManager subsystem. Used for managing 3D/video hardware....
[AI] Holds D3DRMMesh pointer and group index for referencing geometry [AI]
D3DRMGROUPINDEX groupIndex
[AI] Index within mesh group [AI]
IDirect3DRMMesh * groupMesh
[AI] D3DRM mesh pointer [AI]
DDPIXELFORMAT ddpfPixelFormat