"L. Spiro Engine"

F:/My Projects/LSEngine/Modules/LSImageLib/Src/ImagePack/LSIImagePack.h

00001 
00018 #ifndef __LSE_IMAGEPACK_H__
00019 #define __LSE_IMAGEPACK_H__
00020 
00021 #include "../LSIImageLib.h"
00022 #include "../Image/LSIImage.h"
00023 #include "Map/LSTLMap.h"
00024 #include "Streams/LSSTDStream.h"
00025 #include "String/LSTLString.h"
00026 
00027 namespace lsi {
00028 
00038         class CImagePack {
00039         public :
00040                 // == Various constructors.
00041                 LSE_CALLCTOR                                                    CImagePack();
00042                 LSE_CALLCTOR                                                    ~CImagePack();
00043 
00044 
00045                 // == Functions.
00053                 LSSTD_ERRORS LSE_CALL                                   LoadPackFromMemory( const LSUINT8 * _pui8Data, LSUINTPTR _uiptrLen );
00054 
00061                 LSSTD_ERRORS LSE_CALL                                   LoadPackFromFile( const LSCHAR * _pcPath );
00062 
00069                 LSSTD_ERRORS LSE_CALL                                   LoadPackFromSteam( const lsstd::IStream &_sStream );
00070 
00074                 LSVOID LSE_CALL                                                 Reset();
00075 
00084                 CImage * LSE_CALL                                               GetImageByName( const CString _sName );
00085 
00086 
00087         protected :
00088                 // == Types.
00092                 typedef struct LSI_ENTRIES {
00096                         LSUINT32                                                        ui32Offset;
00097 
00101                         LSUINT32                                                        ui32Size;
00102                 } * LPLSI_ENTRIES, * const LPCLSI_ENTRIES;
00103 
00107 #pragma pack( push, 1 )
00108                 typedef struct LSI_DIR_ENTRY {
00112                         LSCHAR                                                          cMaterialName[16];
00113 
00117                         LSUINT32                                                        ui32Offset;
00118 
00122                         LSUINT32                                                        ui32Size;
00123                 } * LPLSI_DIR_ENTRY, * const LPCLSI_DIR_ENTRY;
00124 #pragma pack( pop )
00125 
00126                 // == Members.
00130                 CMap<CString, LSI_ENTRIES>                              m_mDictionary;
00131 
00135                 CVector<CVector<LSUINT8, LSUINT32>, LSUINT32>
00136                                                                                                 m_vCompressedImages;
00137 
00141                 CMap<CString, CImage *>                                 m_mUnpackedImages;
00142         };
00143 
00144 
00145         // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
00146         // DEFINITIONS
00147         // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
00148         
00149 
00150 }       // namespace lsi
00151 
00152 #endif  // __LSE_IMAGEPACK_H__
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator