Main Page | Namespace List | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

TextureManager.h

00001 #ifndef _TEX_MANAGER__
00002 #define _TEX_MANAGER__
00003 
00004 #include <sps2util.h>
00005 #include <sps2tags.h>
00006 
00009 namespace NablaPS2Utils {
00010 
00015 struct TextureFileHeader {
00016     
00017     int HeaderSize;
00018     char    FileVersion;
00019     int Width;
00020     int Height;
00021     PSM_t PixelFormat;
00022     char    Swizzled;
00023     int DataSize;
00024 }  __attribute__((packed));
00025 
00033 class TextureManager {
00034 
00036     PSM_t   m_pixelFormat;
00037     int m_width;       
00038     int m_height;       
00039     bool    m_swizzled;     
00040     int   m_numMemBlocks;
00041     int   m_imageSize;  
00042     sps2Memory_t  *m_imageData;  
00043     sps2Memory_t  *m_clutData;  
00044 
00046     bool  m_status;
00048     int   m_UploadAddress;
00050     void UpdateImageData(const TextureFileHeader &TFH);
00051     
00053     int m_SPS2Desc;
00054 public:
00055 
00057     TextureManager(const char *FileName, int SPS2Descriptor);
00059     ~TextureManager();
00061     void SendTexture(sps2uint32 GSAddress, sps2Memory_t *DMAMemory);
00063     sps2uint64 BuildTEX0(int TextureFunction) const;
00065     sps2uint64 BuildTEX1(int FilteringMode) const;
00066 
00068     int  Height() const {return m_height;}
00070     int  Width() const {return m_width;}
00072     operator void *() const {return (void *) (m_status);}
00073 }; //End of TetureManager Class
00074 
00075 int GetPixelSizeInBytes(PSM_t Format);
00076 }; //End of namespace.
00077 #endif

Generated on Wed Jan 7 19:11:57 2004 for PS2 Tutorial by doxygen 1.3.4