#include <OgreQuake3ShaderManager.h>
Inheritance diagram for Ogre::Quake3ShaderManager:
Public Methods | |
Quake3ShaderManager () | |
virtual | ~Quake3ShaderManager () |
void | parseShaderFile (DataChunk &chunk) |
Parses a shader file passed as a chunk. More... | |
void | parseAllSources (const String &extension=".shader") |
Parses all shader files in resource folders & archives. More... | |
virtual Resource * | create (const String &name) |
Create implementation required by ResourceManager. More... | |
virtual void | setMemoryBudget (size_t bytes) |
Set a limit on the amount of memory this resource handler may use. More... | |
virtual void | load (Resource *res, int priority) |
Load a resource. More... | |
virtual void | unload (Resource *res) |
Unloads a Resource from the managed resources list, calling it's unload() method. More... | |
virtual void | unloadAndDestroyAll (void) |
Unloads all Resources from memory. More... | |
virtual Resource * | getByName (const String &name) |
Retrieves a pointer to a resource by name. More... | |
void | addSearchPath (const String &path) |
Adds a relative path to search for resources of this type. More... | |
void | addArchiveEx (const String &strName, const String &strDriverName) |
Adds an archive to the search path for this type of resource. More... | |
bool | _findResourceData (const String &filename, DataChunk &refChunk) |
Internal method, used for locating resource data in the file system / archives. More... | |
Static Public Methods | |
Quake3ShaderManager & | getSingleton (void) |
Override standard Singleton retrieval. More... | |
void | addCommonSearchPath (const String &path) |
Adds a relative search path for resources of ALL types. More... | |
void | addCommonArchiveEx (const String &strName, const String &strDriverName) |
Adds an archive to the search path for all resources. More... | |
std::set< String > | _getAllCommonNamesLike (const String &startPath, const String &extension) |
Returns a collection of files with the given extension in the common resource paths. More... | |
bool | _findCommonResourceData (const String &filename, DataChunk &refChunk) |
Internal method, used for locating common resource data in the file system / archives. More... | |
Quake3ShaderManager * | getSingletonPtr (void) |
Protected Types | |
typedef HashMap< String, ArchiveEx *, _StringHash > | FileMap |
Protected Methods | |
void | parseNewShaderPass (DataChunk &chunk, Quake3Shader *pShader) |
void | parseShaderAttrib (const String &line, Quake3Shader *pShader) |
void | parseShaderPassAttrib (const String &line, Quake3Shader *pShader, Quake3Shader::Pass *pPass) |
SceneBlendFactor | convertBlendFunc (const String &q3func) |
void | checkUsage (void) |
Checks memory usage and pages out if required. More... | |
Protected Attributes | |
FileMap | mArchiveFiles |
ResourceMap | mResources |
size_t | mMemoryBudget |
size_t | mMemoryUsage |
std::vector< ArchiveEx * > | mVFS |
Collection of searchable ArchiveEx classes (virtual file system) for this resource type. More... | |
Static Protected Attributes | |
FileMap | mCommonArchiveFiles |
std::vector< ArchiveEx * > | mCommonVFS |
Collection of searchable ArchiveEx classes (virtual file system) for all resource types. More... | |
Quake3ShaderManager * | ms_Singleton = 0 |
Quake3 uses .shader files to define custom shaders, or Materials in Ogre-speak. When a surface texture is mentioned in a level file, it includes no file extension meaning that it can either be a standard texture image (+lightmap) if there is only a .jpg or .tga file, or it may refer to a custom shader if a shader with that name is included in one of the .shader files in the scripts/ folder. Because there are multiple shaders per file you have to parse all the .shader files available to know if there is a custom shader available. This class is designed to parse all the .shader files available and save their settings for future use. I choose not to set up Material instances for shaders found since they may or may not be used by a level, so it would be very wasteful to set up Materials since they load texture images for each layer (apart from the lightmap). Once the usage of a shader is confirmed, a full Material instance can be set up from it. Because this is a subclass of ResourceManager, any files mentioned will be searched for in any path or archive added to the resource paths/archives. See ResourceManager for details.
|
|
|
|
|
|
|
Internal method, used for locating common resource data in the file system / archives.
|
|
Internal method, used for locating resource data in the file system / archives.
|
|
Returns a collection of files with the given extension in the common resource paths.
|
|
Adds an archive to the search path for this type of resource.
|
|
Adds an archive to the search path for all resources.
|
|
Adds a relative search path for resources of ALL types.
This method has the same effect as ResourceManager::addSearchPath, except that the path added applies to ALL resources, not just the one managed by the subclass in question. |
|
Adds a relative path to search for resources of this type.
|
|
Checks memory usage and pages out if required.
|
|
|
|
Create implementation required by ResourceManager.
Implements Ogre::ResourceManager. |
|
Retrieves a pointer to a resource by name.
|
|
Override standard Singleton retrieval. Why do we do this? Well, it's because the Singleton implementation is in a .h file, which means it gets compiled into anybody who includes it. This is needed for the Singleton template to work, but we actually only want it compiled into the implementation of the class based on the Singleton, not all of them. If we don't change this, we get link errors when trying to use the Singleton-based class from an outside dll. This method just delegates to the template version anyway, but the implementation stays in this single compilation unit, preventing link errors. Reimplemented from Ogre::Singleton< Quake3ShaderManager >. |
|
|
|
Load a resource. Resources will be subclasses. Reimplemented in Ogre::TextureManager. |
|
Parses all shader files in resource folders & archives.
|
|
|
|
|
|
Parses a shader file passed as a chunk.
|
|
|
|
Set a limit on the amount of memory this resource handler may use.
|
|
Unloads a Resource from the managed resources list, calling it's unload() method.
|
|
Unloads all Resources from memory.
Reimplemented in Ogre::D3D8TextureManager. |
|
|
|
|
|
Collection of searchable ArchiveEx classes (virtual file system) for all resource types.
|
|
|
|
|
|
|
|
|
|
Collection of searchable ArchiveEx classes (virtual file system) for this resource type.
|
Copyright © 2002 by The OGRE Team