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

[AI] Represents a texture which wraps a LegoImage and provides loading/saving functionality. More...

#include <legotexture.h>

Collaboration diagram for LegoTexture:

Public Member Functions

 LegoTexture ()
 [AI] Constructs a LegoTexture object and allocates a new LegoImage. More...
 
 ~LegoTexture ()
 [AI] Destructor. Frees the owned LegoImage. More...
 
LegoImageGetImage ()
 [AI] Returns the associated image used by this texture. More...
 
void SetImage (LegoImage *p_image)
 [AI] Sets the associated image for this texture. More...
 
LegoResult Read (LegoStorage *p_storage, LegoU32 p_square)
 [AI] Reads texture data from a LegoStorage. More...
 
LegoResult Write (LegoStorage *p_storage)
 [AI] Writes texture data to a LegoStorage. More...
 

Protected Attributes

LegoImagem_image
 [AI] Pointer to the image data associated with this texture. Owned by the LegoTexture instance. More...
 

Detailed Description

[AI] Represents a texture which wraps a LegoImage and provides loading/saving functionality.

[AI] LegoTexture owns a pointer to a LegoImage and is responsible for managing its lifetime. It provides methods to read texture data from and write it to a LegoStorage (file/memory), delegating the actual I/O work to the underlying LegoImage. Used throughout the LEGO Island engine for texture management. [AI]

See also
LegoImage [AI]

Definition at line 15 of file legotexture.h.

Constructor & Destructor Documentation

◆ LegoTexture()

LegoTexture::LegoTexture ( )

[AI] Constructs a LegoTexture object and allocates a new LegoImage.

Definition at line 10 of file legotexture.cpp.

◆ ~LegoTexture()

LegoTexture::~LegoTexture ( )

[AI] Destructor. Frees the owned LegoImage.

Definition at line 16 of file legotexture.cpp.

Member Function Documentation

◆ GetImage()

LegoImage * LegoTexture::GetImage ( )
inline

[AI] Returns the associated image used by this texture.

Returns
[AI] Pointer to the underlying LegoImage for this texture.

Definition at line 25 of file legotexture.h.

◆ Read()

LegoResult LegoTexture::Read ( LegoStorage p_storage,
LegoU32  p_square 
)

[AI] Reads texture data from a LegoStorage.

Parameters
p_storage[AI] Storage object to read from (can be file or memory).
p_square[AI] The mipmap or level-of-detail index to read (purpose dependent on image format).

[AI] Delegates the actual reading process to the internal LegoImage object.

Returns
[AI] Returns a LegoResult indicating success or failure.

Definition at line 22 of file legotexture.cpp.

◆ SetImage()

void LegoTexture::SetImage ( LegoImage p_image)
inline

[AI] Sets the associated image for this texture.

Parameters
p_image[AI] The new LegoImage instance to associate with this texture. Ownership is NOT transferred. The previous image is not deleted. [AI]

Definition at line 29 of file legotexture.h.

◆ Write()

LegoResult LegoTexture::Write ( LegoStorage p_storage)

[AI] Writes texture data to a LegoStorage.

Parameters
p_storage[AI] Storage object to write to (can be file or memory).

[AI] Delegates the actual writing process to the internal LegoImage object.

Returns
[AI] Returns a LegoResult indicating success or failure.

Definition at line 28 of file legotexture.cpp.

Member Data Documentation

◆ m_image

LegoImage* LegoTexture::m_image
protected

[AI] Pointer to the image data associated with this texture. Owned by the LegoTexture instance.

Definition at line 45 of file legotexture.h.


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