#include <TextureManager.h>
Public Member Functions | |
TextureManager (const char *FileName, int SPS2Descriptor) | |
Create a textureManger object reading a filename. | |
~TextureManager () | |
Deallocate all memory used. | |
void | SendTexture (sps2uint32 GSAddress, sps2Memory_t *DMAMemory) |
Send texture to GS. | |
sps2uint64 | BuildTEX0 (int TextureFunction) const |
Set TEX0 register. | |
sps2uint64 | BuildTEX1 (int FilteringMode) const |
Set TEX1 register. | |
int | Height () const |
Access height of the image. | |
int | Width () const |
Access width of the image. | |
operator void * () const | |
Convert to void * for testing. | |
Private Member Functions | |
void | UpdateImageData (const TextureFileHeader &TFH) |
Used to update data of the image. | |
Private Attributes | |
PSM_t | m_pixelFormat |
Format of the pixel, used to determine if CLUT is present. | |
int | m_width |
Image width. | |
int | m_height |
Image height. | |
bool | m_swizzled |
Image is swizzled (True/False). | |
int | m_numMemBlocks |
Number of allocated blocks (4KB each). | |
int | m_imageSize |
Size of the image in bytes. | |
sps2Memory_t * | m_imageData |
Pixel of the image, raw data read from file. | |
sps2Memory_t * | m_clutData |
Clut, raw data read from file. | |
bool | m_status |
True if TextureManger object can be used, false otherwise. | |
int | m_UploadAddress |
Last address where the texture was uploaded. | |
int | m_SPS2Desc |
Descriptor of the SPS2 library used to manage memory. |
Definition at line 33 of file TextureManager.h.
|
This is a simple routine because all swizzling, converting, resizing, etc etc is done previously by texture converter program. This way of proceeding is often used, to reduce run time complexity of the program. In this first release only 32 bit clut entries are supported, class must be extended to permit the use of 16 bit clut format. To correctly read the header, first the header structure must be read, then seek the file at first byte after the header, and header size must be taken by structure itself.
Definition at line 25 of file TextureManager.cpp. |
|
Simply release allocated memory for the texture. Definition at line 78 of file TextureManager.cpp. |
|
Since TEX0 register must be set by main application when this texture must be used, this function build the structure of TEX0 register using texture function passed as argument by the main program.
Definition at line 217 of file TextureManager.cpp. |
|
Since TEX1 register must be set by main application when this texture must be used but contains texture information, this function is used to build the structure of TEX1 register using filtering mode passed as argument by the main program.
Definition at line 244 of file TextureManager.cpp. |
|
DMA packet is build sequentially updating pointer to memory that hold the packet. This routine assume that texture data is to be uploaded in the first location of GSAdress, remember that is possible to transfer texture not only at the beginning of the buffer using TRXPOS register.
Update upload address. Definition at line 100 of file TextureManager.cpp. |
|
This function update image data into texture manager. Definition at line 259 of file TextureManager.cpp. |