Pyrogenesis  13997
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | Private Types | Private Attributes | Friends | List of all members
CTextureManagerImpl Class Reference

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)
 

Static Public Member Functions

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

Private Types

typedef boost::unordered_set
< CTexturePtr, TPhash,
TPequal_to
TextureCache
 
typedef boost::unordered_map
< VfsPath, std::set
< boost::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
 

Detailed Description

Definition at line 76 of file TextureManager.cpp.

Member Typedef Documentation

typedef boost::unordered_map<VfsPath, std::set<boost::weak_ptr<CTexture> > > CTextureManagerImpl::HotloadFilesMap
private

Definition at line 501 of file TextureManager.cpp.

typedef boost::unordered_map<VfsPath, shared_ptr<CTextureConverter::SettingsFile> > CTextureManagerImpl::SettingsFilesMap
private

Definition at line 505 of file TextureManager.cpp.

typedef boost::unordered_set<CTexturePtr, TPhash, TPequal_to > CTextureManagerImpl::TextureCache
private

Definition at line 495 of file TextureManager.cpp.

Constructor & Destructor Documentation

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

Definition at line 80 of file TextureManager.cpp.

CTextureManagerImpl::~CTextureManagerImpl ( )
inline

Definition at line 131 of file TextureManager.cpp.

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.

Definition at line 289 of file TextureManager.cpp.

CTexturePtr CTextureManagerImpl::CreateTexture ( const CTextureProperties props)
inline

See CTextureManager::CreateTexture.

Definition at line 147 of file TextureManager.cpp.

bool CTextureManagerImpl::GenerateCachedTexture ( const VfsPath sourcePath,
VfsPath archiveCachePath 
)
inline

Definition at line 308 of file TextureManager.cpp.

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).

Definition at line 415 of file TextureManager.cpp.

CTexturePtr CTextureManagerImpl::GetErrorTexture ( )
inline

Definition at line 139 of file TextureManager.cpp.

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

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

Definition at line 437 of file TextureManager.cpp.

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.

Definition at line 169 of file TextureManager.cpp.

bool CTextureManagerImpl::MakeProgress ( )
inline

Definition at line 332 of file TextureManager.cpp.

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

Set up some parameters for the loose cache filename code.

Definition at line 236 of file TextureManager.cpp.

Status CTextureManagerImpl::ReloadChangedFile ( const VfsPath path)
inline

Definition at line 461 of file TextureManager.cpp.

static Status CTextureManagerImpl::ReloadChangedFileCB ( void *  param,
const VfsPath path 
)
inlinestatic

Definition at line 456 of file TextureManager.cpp.

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.

Definition at line 253 of file TextureManager.cpp.

Friends And Related Function Documentation

friend class CTexture
friend

Definition at line 78 of file TextureManager.cpp.

Member Data Documentation

CCacheLoader CTextureManagerImpl::m_CacheLoader
private

Definition at line 486 of file TextureManager.cpp.

Handle CTextureManagerImpl::m_DefaultHandle
private

Definition at line 490 of file TextureManager.cpp.

bool CTextureManagerImpl::m_DisableGL
private

Definition at line 487 of file TextureManager.cpp.

Handle CTextureManagerImpl::m_ErrorHandle
private

Definition at line 491 of file TextureManager.cpp.

CTexturePtr CTextureManagerImpl::m_ErrorTexture
private

Definition at line 492 of file TextureManager.cpp.

HotloadFilesMap CTextureManagerImpl::m_HotloadFiles
private

Definition at line 502 of file TextureManager.cpp.

SettingsFilesMap CTextureManagerImpl::m_SettingsFiles
private

Definition at line 506 of file TextureManager.cpp.

TextureCache CTextureManagerImpl::m_TextureCache
private

Definition at line 496 of file TextureManager.cpp.

CTextureConverter CTextureManagerImpl::m_TextureConverter
private

Definition at line 488 of file TextureManager.cpp.

PIVFS CTextureManagerImpl::m_VFS
private

Definition at line 485 of file TextureManager.cpp.


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