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, Renderer::Backend::IDevice *device)
 
 ~CTextureManagerImpl ()
 
const CTexturePtrGetErrorTexture ()
 
const CTexturePtrGetWhiteTexture ()
 
const CTexturePtrGetTransparentTexture ()
 
const CTexturePtrGetAlphaGradientTexture ()
 
const CTexturePtrGetBlackTextureCube ()
 
CTexturePtr CreateTexture (const CTextureProperties &props)
 See CTextureManager::CreateTexture. More...
 
CTexturePtr WrapBackendTexture (std::unique_ptr< Renderer::Backend::ITexture > backendTexture)
 
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 TextureExists (const VfsPath &path) const
 
bool GenerateCachedTexture (const VfsPath &sourcePath, VfsPath &archiveCachePath)
 
bool MakeProgress ()
 
bool MakeUploadProgress (Renderer::Backend::IDeviceCommandContext *deviceCommandContext)
 
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)
 
void ReloadAllTextures ()
 
size_t GetBytesUploaded () const
 
void OnQualityChanged ()
 

Static Public Member Functions

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

Private Types

using TextureCache = std::unordered_set< CTexturePtr, TPhash, TPequal_to >
 
using HotloadFilesMap = std::unordered_map< VfsPath, std::set< std::weak_ptr< CTexture >, std::owner_less< std::weak_ptr< CTexture > >> >
 
using SettingsFilesMap = std::unordered_map< VfsPath, std::shared_ptr< CTextureConverter::SettingsFile > >
 

Private Attributes

PIVFS m_VFS
 
CCacheLoader m_CacheLoader
 
Renderer::Backend::IDevicem_Device = nullptr
 
CTextureConverter m_TextureConverter
 
CSingleColorTexture m_DefaultTexture
 
CSingleColorTexture m_ErrorTexture
 
CSingleColorTexture m_WhiteTexture
 
CSingleColorTexture m_TransparentTexture
 
CGradientTexture m_AlphaGradientTexture
 
CSingleColorTextureCube m_BlackTextureCube
 
bool m_PredefinedTexturesUploaded = false
 
TextureCache m_TextureCache
 
HotloadFilesMap m_HotloadFiles
 
SettingsFilesMap m_SettingsFiles
 
bool m_HasS3TC = false
 

Friends

class CTexture
 

Member Typedef Documentation

◆ HotloadFilesMap

using CTextureManagerImpl::HotloadFilesMap = std::unordered_map<VfsPath, std::set<std::weak_ptr<CTexture>, std::owner_less<std::weak_ptr<CTexture> >> >
private

◆ SettingsFilesMap

using CTextureManagerImpl::SettingsFilesMap = std::unordered_map<VfsPath, std::shared_ptr<CTextureConverter::SettingsFile> >
private

◆ TextureCache

using CTextureManagerImpl::TextureCache = std::unordered_set<CTexturePtr, TPhash, TPequal_to>
private

Constructor & Destructor Documentation

◆ CTextureManagerImpl()

CTextureManagerImpl::CTextureManagerImpl ( PIVFS  vfs,
bool  highQuality,
Renderer::Backend::IDevice device 
)
inline

◆ ~CTextureManagerImpl()

CTextureManagerImpl::~CTextureManagerImpl ( )
inline

Member Function Documentation

◆ ConvertTexture()

void CTextureManagerImpl::ConvertTexture ( const CTexturePtr texture)
inline

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

◆ CreateTexture()

CTexturePtr CTextureManagerImpl::CreateTexture ( const CTextureProperties props)
inline

◆ GenerateCachedTexture()

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

◆ GetAlphaGradientTexture()

const CTexturePtr& CTextureManagerImpl::GetAlphaGradientTexture ( )
inline

◆ GetBlackTextureCube()

const CTexturePtr& CTextureManagerImpl::GetBlackTextureCube ( )
inline

◆ GetBytesUploaded()

size_t CTextureManagerImpl::GetBytesUploaded ( ) const
inline

◆ GetConverterSettings()

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

◆ GetErrorTexture()

const CTexturePtr& CTextureManagerImpl::GetErrorTexture ( )
inline

◆ GetSettingsFile()

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

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

◆ GetTransparentTexture()

const CTexturePtr& CTextureManagerImpl::GetTransparentTexture ( )
inline

◆ GetWhiteTexture()

const CTexturePtr& CTextureManagerImpl::GetWhiteTexture ( )
inline

◆ LoadTexture()

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.

◆ MakeProgress()

bool CTextureManagerImpl::MakeProgress ( )
inline

◆ MakeUploadProgress()

bool CTextureManagerImpl::MakeUploadProgress ( Renderer::Backend::IDeviceCommandContext deviceCommandContext)
inline

◆ OnQualityChanged()

void CTextureManagerImpl::OnQualityChanged ( )
inline

◆ PrepareCacheKey()

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

Set up some parameters for the loose cache filename code.

◆ ReloadAllTextures()

void CTextureManagerImpl::ReloadAllTextures ( )
inline

◆ ReloadChangedFile()

Status CTextureManagerImpl::ReloadChangedFile ( const VfsPath path)
inline

◆ ReloadChangedFileCB()

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

◆ TextureExists()

bool CTextureManagerImpl::TextureExists ( const VfsPath path) const
inline

◆ TryLoadingCached()

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.

◆ WrapBackendTexture()

CTexturePtr CTextureManagerImpl::WrapBackendTexture ( std::unique_ptr< Renderer::Backend::ITexture backendTexture)
inline

Friends And Related Function Documentation

◆ CTexture

friend class CTexture
friend

Member Data Documentation

◆ m_AlphaGradientTexture

CGradientTexture CTextureManagerImpl::m_AlphaGradientTexture
private

◆ m_BlackTextureCube

CSingleColorTextureCube CTextureManagerImpl::m_BlackTextureCube
private

◆ m_CacheLoader

CCacheLoader CTextureManagerImpl::m_CacheLoader
private

◆ m_DefaultTexture

CSingleColorTexture CTextureManagerImpl::m_DefaultTexture
private

◆ m_Device

Renderer::Backend::IDevice* CTextureManagerImpl::m_Device = nullptr
private

◆ m_ErrorTexture

CSingleColorTexture CTextureManagerImpl::m_ErrorTexture
private

◆ m_HasS3TC

bool CTextureManagerImpl::m_HasS3TC = false
private

◆ m_HotloadFiles

HotloadFilesMap CTextureManagerImpl::m_HotloadFiles
private

◆ m_PredefinedTexturesUploaded

bool CTextureManagerImpl::m_PredefinedTexturesUploaded = false
private

◆ m_SettingsFiles

SettingsFilesMap CTextureManagerImpl::m_SettingsFiles
private

◆ m_TextureCache

TextureCache CTextureManagerImpl::m_TextureCache
private

◆ m_TextureConverter

CTextureConverter CTextureManagerImpl::m_TextureConverter
private

◆ m_TransparentTexture

CSingleColorTexture CTextureManagerImpl::m_TransparentTexture
private

◆ m_VFS

PIVFS CTextureManagerImpl::m_VFS
private

◆ m_WhiteTexture

CSingleColorTexture CTextureManagerImpl::m_WhiteTexture
private

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