Pyrogenesis  trunk
Public Member Functions | Static Public Member Functions | Private Types | Private Attributes | Friends | List of all members
CTextureManagerImpl Class Reference
Collaboration diagram for CTextureManagerImpl:
Collaboration graph
[legend]

Public Member Functions

 CTextureManagerImpl (PIVFS vfs, bool highQuality, bool disableGL)
 
 ~CTextureManagerImpl ()
 
CTexturePtr GetErrorTexture ()
 
CTexturePtr CreateTexture (const CTextureProperties &props)
 See CTextureManager::CreateTexture. More...
 
void LoadTexture (const CTexturePtr &texture, const VfsPath &path)
 Load the given file into the texture object and upload it to OpenGL. More...
 
void PrepareCacheKey (const CTexturePtr &texture, MD5 &hash, u32 &version)
 Set up some parameters for the loose cache filename code. More...
 
bool TryLoadingCached (const CTexturePtr &texture)
 Attempts to load a cached version of a texture. More...
 
void ConvertTexture (const CTexturePtr &texture)
 Initiates an asynchronous conversion process, from the texture's source file to the corresponding loose cache file. More...
 
bool GenerateCachedTexture (const VfsPath &sourcePath, VfsPath &archiveCachePath)
 
bool MakeProgress ()
 
CTextureConverter::Settings GetConverterSettings (const CTexturePtr &texture)
 Compute the conversion settings that apply to a given texture, by combining the textures.xml files from its directory and all parent directories (up to the VFS root). More...
 
CTextureConverter::SettingsFileGetSettingsFile (const VfsPath &path)
 Return the (cached) settings file with the given filename, or NULL if it doesn't exist. More...
 
Status ReloadChangedFile (const VfsPath &path)
 
size_t GetBytesUploaded () const
 

Static Public Member Functions

static Status ReloadChangedFileCB (void *param, const VfsPath &path)
 

Private Types

typedef boost::unordered_set< CTexturePtr, TPhash, TPequal_toTextureCache
 
typedef boost::unordered_map< VfsPath, std::set< std::weak_ptr< CTexture >, std::owner_less< std::weak_ptr< CTexture > > > > HotloadFilesMap
 
typedef boost::unordered_map< VfsPath, shared_ptr< CTextureConverter::SettingsFile > > SettingsFilesMap
 

Private Attributes

PIVFS m_VFS
 
CCacheLoader m_CacheLoader
 
bool m_DisableGL
 
CTextureConverter m_TextureConverter
 
Handle m_DefaultHandle
 
Handle m_ErrorHandle
 
CTexturePtr m_ErrorTexture
 
TextureCache m_TextureCache
 
HotloadFilesMap m_HotloadFiles
 
SettingsFilesMap m_SettingsFiles
 

Friends

class CTexture
 

Member Typedef Documentation

typedef boost::unordered_map<VfsPath, std::set<std::weak_ptr<CTexture>, std::owner_less<std::weak_ptr<CTexture> > > > CTextureManagerImpl::HotloadFilesMap
private
typedef boost::unordered_map<VfsPath, shared_ptr<CTextureConverter::SettingsFile> > CTextureManagerImpl::SettingsFilesMap
private
typedef boost::unordered_set<CTexturePtr, TPhash, TPequal_to> CTextureManagerImpl::TextureCache
private

Constructor & Destructor Documentation

CTextureManagerImpl::CTextureManagerImpl ( PIVFS  vfs,
bool  highQuality,
bool  disableGL 
)
inline
CTextureManagerImpl::~CTextureManagerImpl ( )
inline

Member Function Documentation

void CTextureManagerImpl::ConvertTexture ( const CTexturePtr texture)
inline

Initiates an asynchronous conversion process, from the texture's source file to the corresponding loose cache file.

CTexturePtr CTextureManagerImpl::CreateTexture ( const CTextureProperties props)
inline
bool CTextureManagerImpl::GenerateCachedTexture ( const VfsPath sourcePath,
VfsPath archiveCachePath 
)
inline
size_t CTextureManagerImpl::GetBytesUploaded ( ) const
inline
CTextureConverter::Settings CTextureManagerImpl::GetConverterSettings ( const CTexturePtr texture)
inline

Compute the conversion settings that apply to a given texture, by combining the textures.xml files from its directory and all parent directories (up to the VFS root).

CTexturePtr CTextureManagerImpl::GetErrorTexture ( )
inline
CTextureConverter::SettingsFile* CTextureManagerImpl::GetSettingsFile ( const VfsPath path)
inline

Return the (cached) settings file with the given filename, or NULL if it doesn't exist.

void CTextureManagerImpl::LoadTexture ( const CTexturePtr texture,
const VfsPath path 
)
inline

Load the given file into the texture object and upload it to OpenGL.

Assumes the file already exists.

bool CTextureManagerImpl::MakeProgress ( )
inline
void CTextureManagerImpl::PrepareCacheKey ( const CTexturePtr texture,
MD5 hash,
u32 version 
)
inline

Set up some parameters for the loose cache filename code.

Status CTextureManagerImpl::ReloadChangedFile ( const VfsPath path)
inline
static Status CTextureManagerImpl::ReloadChangedFileCB ( void *  param,
const VfsPath path 
)
inlinestatic
bool CTextureManagerImpl::TryLoadingCached ( const CTexturePtr texture)
inline

Attempts to load a cached version of a texture.

If the texture is loaded (or there was an error), returns true. Otherwise, returns false to indicate the caller should generate the cached version.

Friends And Related Function Documentation

friend class CTexture
friend

Member Data Documentation

CCacheLoader CTextureManagerImpl::m_CacheLoader
private
Handle CTextureManagerImpl::m_DefaultHandle
private
bool CTextureManagerImpl::m_DisableGL
private
Handle CTextureManagerImpl::m_ErrorHandle
private
CTexturePtr CTextureManagerImpl::m_ErrorTexture
private
HotloadFilesMap CTextureManagerImpl::m_HotloadFiles
private
SettingsFilesMap CTextureManagerImpl::m_SettingsFiles
private
TextureCache CTextureManagerImpl::m_TextureCache
private
CTextureConverter CTextureManagerImpl::m_TextureConverter
private
PIVFS CTextureManagerImpl::m_VFS
private

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