Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- src/graphics/gl3v/renderer.cpp | 34 +++++++++++++++++-----------------
- src/graphics/gl3v/renderpass.cpp | 28 ++++++++++++++--------------
- 2 files changed, 31 insertions(+), 31 deletions(-)
- diff --git a/src/graphics/gl3v/renderer.cpp b/src/graphics/gl3v/renderer.cpp
- index 8774b86..c165f32 100644
- --- a/src/graphics/gl3v/renderer.cpp
- +++ b/src/graphics/gl3v/renderer.cpp
- @@ -172,7 +172,7 @@ RenderModelHandle Renderer::addModel(const RenderModelEntry & entry)
- RenderModelHandle handle = models.insert(entry);
- // For all passes that use this draw group, send them the model.
- - std::tr1::unordered_map <StringId, std::vector <unsigned int> >::iterator iter = drawGroupToPasses.find(models.get(handle).group);
- + std::tr1::unordered_map <StringId, std::vector <unsigned int>, StringId::hash>::iterator iter = drawGroupToPasses.find(models.get(handle).group);
- if (iter != drawGroupToPasses.end())
- {
- const std::vector <unsigned int> & passesWithDrawGroup = iter->second;
- @@ -189,7 +189,7 @@ void Renderer::removeModel(RenderModelHandle handle)
- models.erase(handle);
- // For all passes that use this draw group, tell them to remove the model.
- - std::tr1::unordered_map <StringId, std::vector <unsigned int> >::iterator iter = drawGroupToPasses.find(models.get(handle).group);
- + std::tr1::unordered_map <StringId, std::vector <unsigned int>, StringId::hash>::iterator iter = drawGroupToPasses.find(models.get(handle).group);
- if (iter != drawGroupToPasses.end())
- {
- const std::vector <unsigned int> & passesWithDrawGroup = iter->second;
- @@ -202,7 +202,7 @@ void Renderer::removeModel(RenderModelHandle handle)
- void Renderer::setModelTexture(RenderModelHandle handle, const RenderTextureEntry & texture)
- {
- // For all passes that use this draw group, pass on the message.
- - std::tr1::unordered_map <StringId, std::vector <unsigned int> >::iterator iter = drawGroupToPasses.find(models.get(handle).group);
- + std::tr1::unordered_map <StringId, std::vector <unsigned int>, StringId::hash>::iterator iter = drawGroupToPasses.find(models.get(handle).group);
- if (iter != drawGroupToPasses.end())
- {
- const std::vector <unsigned int> & passesWithDrawGroup = iter->second;
- @@ -215,7 +215,7 @@ void Renderer::setModelTexture(RenderModelHandle handle, const RenderTextureEntr
- void Renderer::removeModelTexture(RenderModelHandle handle, StringId name)
- {
- // For all passes that use this draw group, pass on the message.
- - std::tr1::unordered_map <StringId, std::vector <unsigned int> >::iterator iter = drawGroupToPasses.find(models.get(handle).group);
- + std::tr1::unordered_map <StringId, std::vector <unsigned int>, StringId::hash>::iterator iter = drawGroupToPasses.find(models.get(handle).group);
- if (iter != drawGroupToPasses.end())
- {
- const std::vector <unsigned int> & passesWithDrawGroup = iter->second;
- @@ -228,7 +228,7 @@ void Renderer::removeModelTexture(RenderModelHandle handle, StringId name)
- void Renderer::setModelUniform(RenderModelHandle handle, const RenderUniformEntry & uniform)
- {
- // For all passes that use this draw group, pass on the message.
- - std::tr1::unordered_map <StringId, std::vector <unsigned int> >::iterator iter = drawGroupToPasses.find(models.get(handle).group);
- + std::tr1::unordered_map <StringId, std::vector <unsigned int>, StringId::hash>::iterator iter = drawGroupToPasses.find(models.get(handle).group);
- if (iter != drawGroupToPasses.end())
- {
- const std::vector <unsigned int> & passesWithDrawGroup = iter->second;
- @@ -241,7 +241,7 @@ void Renderer::setModelUniform(RenderModelHandle handle, const RenderUniformEntr
- void Renderer::removeModelUniform(RenderModelHandle handle, StringId name)
- {
- // For all passes that use this draw group, pass on the message.
- - std::tr1::unordered_map <StringId, std::vector <unsigned int> >::iterator iter = drawGroupToPasses.find(models.get(handle).group);
- + std::tr1::unordered_map <StringId, std::vector <unsigned int>, StringId::hash>::iterator iter = drawGroupToPasses.find(models.get(handle).group);
- if (iter != drawGroupToPasses.end())
- {
- const std::vector <unsigned int> & passesWithDrawGroup = iter->second;
- @@ -271,7 +271,7 @@ void Renderer::removeGlobalTexture(StringId name)
- void Renderer::setPassTexture(StringId passName, StringId textureName, const RenderTextureEntry & texture)
- {
- - std::tr1::unordered_map <StringId, int>::iterator i = passIndexMap.find(passName);
- + std::tr1::unordered_map <StringId, int, StringId::hash>::iterator i = passIndexMap.find(passName);
- if (i != passIndexMap.end())
- {
- assert((unsigned int)i->second < passes.size());
- @@ -281,7 +281,7 @@ void Renderer::setPassTexture(StringId passName, StringId textureName, const Ren
- void Renderer::removePassTexture(StringId passName, StringId textureName)
- {
- - std::tr1::unordered_map <StringId, int>::iterator i = passIndexMap.find(passName);
- + std::tr1::unordered_map <StringId, int, StringId::hash>::iterator i = passIndexMap.find(passName);
- if (i != passIndexMap.end())
- {
- assert((unsigned int)i->second < passes.size());
- @@ -310,7 +310,7 @@ void Renderer::removeGlobalUniform(StringId name)
- void Renderer::setPassUniform(StringId passName, const RenderUniformEntry & uniform)
- {
- - std::tr1::unordered_map <StringId, int>::iterator i = passIndexMap.find(passName);
- + std::tr1::unordered_map <StringId, int, StringId::hash>::iterator i = passIndexMap.find(passName);
- if (i != passIndexMap.end())
- {
- assert((unsigned int)i->second < passes.size());
- @@ -320,7 +320,7 @@ void Renderer::setPassUniform(StringId passName, const RenderUniformEntry & unif
- void Renderer::removePassUniform(StringId passName, StringId uniformName)
- {
- - std::tr1::unordered_map <StringId, int>::iterator i = passIndexMap.find(passName);
- + std::tr1::unordered_map <StringId, int, StringId::hash>::iterator i = passIndexMap.find(passName);
- if (i != passIndexMap.end())
- {
- assert((unsigned int)i->second < passes.size());
- @@ -330,7 +330,7 @@ void Renderer::removePassUniform(StringId passName, StringId uniformName)
- bool Renderer::getPassUniform(StringId passName, StringId uniformName, RenderUniform & out)
- {
- - std::tr1::unordered_map <StringId, int>::iterator i = passIndexMap.find(passName);
- + std::tr1::unordered_map <StringId, int, StringId::hash>::iterator i = passIndexMap.find(passName);
- if (i != passIndexMap.end())
- {
- assert((unsigned int)i->second < passes.size());
- @@ -342,7 +342,7 @@ bool Renderer::getPassUniform(StringId passName, StringId uniformName, RenderUni
- void Renderer::setPassEnabled(StringId passName, bool enable)
- {
- - std::tr1::unordered_map <StringId, int>::iterator i = passIndexMap.find(passName);
- + std::tr1::unordered_map <StringId, int, StringId::hash>::iterator i = passIndexMap.find(passName);
- if (i != passIndexMap.end())
- {
- assert((unsigned int)i->second < passes.size());
- @@ -352,7 +352,7 @@ void Renderer::setPassEnabled(StringId passName, bool enable)
- bool Renderer::getPassEnabled(StringId passName) const
- {
- - std::tr1::unordered_map <StringId, int>::const_iterator i = passIndexMap.find(passName);
- + std::tr1::unordered_map <StringId, int, StringId::hash>::const_iterator i = passIndexMap.find(passName);
- if (i != passIndexMap.end())
- {
- assert((unsigned int)i->second < passes.size());
- @@ -364,7 +364,7 @@ bool Renderer::getPassEnabled(StringId passName) const
- static const std::map <std::string, std::string> emptyStringMap;
- const std::map <std::string, std::string> & Renderer::getUserDefinedFields(StringId passName) const
- {
- - std::tr1::unordered_map <StringId, int>::const_iterator i = passIndexMap.find(passName);
- + std::tr1::unordered_map <StringId, int, StringId::hash>::const_iterator i = passIndexMap.find(passName);
- if (i != passIndexMap.end())
- {
- assert((unsigned int)i->second < passes.size());
- @@ -376,7 +376,7 @@ const std::map <std::string, std::string> & Renderer::getUserDefinedFields(Strin
- static const std::set <StringId> emptySet;
- const std::set <StringId> & Renderer::getDrawGroups(StringId passName) const
- {
- - std::tr1::unordered_map <StringId, int>::const_iterator i = passIndexMap.find(passName);
- + std::tr1::unordered_map <StringId, int, StringId::hash>::const_iterator i = passIndexMap.find(passName);
- if (i != passIndexMap.end())
- {
- assert((unsigned int)i->second < passes.size());
- @@ -427,7 +427,7 @@ void Renderer::printRendererStatus(RendererStatusVerbosity verbosity, const Stri
- if (verbosity >= VERBOSITY_MODELS_TEXTURES)
- {
- out << "Global textures: " << sharedTextures.size() << std::endl;
- - for (std::tr1::unordered_map <StringId, RenderTextureEntry>::const_iterator i = sharedTextures.begin(); i != sharedTextures.end(); i++)
- + for (std::tr1::unordered_map <StringId, RenderTextureEntry, StringId::hash>::const_iterator i = sharedTextures.begin(); i != sharedTextures.end(); i++)
- out << passPrefix << stringMap.getString(i->first) << ", handle " << i->second.handle << std::endl;
- }
- @@ -439,7 +439,7 @@ void Renderer::printRendererStatus(RendererStatusVerbosity verbosity, const Stri
- out << passPrefix << "Draw groups: ";
- int dgcount = 0;
- - for (std::tr1::unordered_map <StringId, std::vector <unsigned int> >::const_iterator dg = drawGroupToPasses.begin(); dg != drawGroupToPasses.end(); dg++)
- + for (std::tr1::unordered_map <StringId, std::vector <unsigned int>, StringId::hash>::const_iterator dg = drawGroupToPasses.begin(); dg != drawGroupToPasses.end(); dg++)
- if (std::find(dg->second.begin(), dg->second.end(), passcount) != dg->second.end())
- {
- if (dgcount != 0)
- diff --git a/src/graphics/gl3v/renderpass.cpp b/src/graphics/gl3v/renderpass.cpp
- index df0652e..92923e2 100644
- --- a/src/graphics/gl3v/renderpass.cpp
- +++ b/src/graphics/gl3v/renderpass.cpp
- @@ -138,7 +138,7 @@ bool RenderPass::initialize(int passCount, const RealtimeExportPassInfo & config
- // Fill default textures from passed-in shared textures.
- // Fexture bindings that can be overridden (or not) by specific models.
- - std::tr1::unordered_map <StringId, RenderTextureEntry>::const_iterator defaultTexIter = sharedTextures.find(stringMap.addStringId(textureName));
- + std::tr1::unordered_map <StringId, RenderTextureEntry, StringId::hash>::const_iterator defaultTexIter = sharedTextures.find(stringMap.addStringId(textureName));
- if (defaultTexIter != sharedTextures.end())
- defaultTextureBindings.push_back(RenderTexture(tu, defaultTexIter->second));
- }
- @@ -410,7 +410,7 @@ bool RenderPass::render(GLWrapper & gl, unsigned int w, unsigned int h, StringId
- for (std::vector <RenderTextureEntry>::const_iterator t = m->textures.begin(); t != m->textures.end(); t++)
- {
- // Get the TU associated with this texture name id.
- - std::tr1::unordered_map <StringId, GLuint>::iterator tui = textureNameToTextureUnit.find(t->name);
- + std::tr1::unordered_map <StringId, GLuint, StringId::hash>::iterator tui = textureNameToTextureUnit.find(t->name);
- if (tui != textureNameToTextureUnit.end()) // if the texture isn't used in this pass, it might not be in textureNameToTextureUnit.
- {
- GLuint tu = tui->second;
- @@ -473,7 +473,7 @@ bool RenderPass::render(GLWrapper & gl, unsigned int w, unsigned int h, StringId
- {
- for (std::vector <RenderUniformEntry>::const_iterator u = m->uniforms.begin(); u != m->uniforms.end(); u++)
- {
- - std::tr1::unordered_map <StringId, GLuint>::iterator loci = variableNameToUniformLocation.find(u->name);
- + std::tr1::unordered_map <StringId, GLuint, StringId::hash>::iterator loci = variableNameToUniformLocation.find(u->name);
- if (loci != variableNameToUniformLocation.end()) // If the texture isn't used in this pass, it might not be in variableNameToUniformLocation.
- {
- GLuint location = loci->second;
- @@ -551,7 +551,7 @@ void RenderPass::setModelTexture(RenderModelHandle handle, const RenderTextureEn
- RenderModel & model = models.get(iter->second);
- // First, see if there's an existing texture override with this name.
- - std::tr1::unordered_map <StringId, keyed_container <RenderTexture>::handle>::iterator existing = model.textureNameToTextureOverride.find(texture.name);
- + std::tr1::unordered_map <StringId, keyed_container <RenderTexture>::handle, StringId::hash>::iterator existing = model.textureNameToTextureOverride.find(texture.name);
- if (existing != model.textureNameToTextureOverride.end())
- {
- // There is an existing override. Change it!
- @@ -561,7 +561,7 @@ void RenderPass::setModelTexture(RenderModelHandle handle, const RenderTextureEn
- else
- {
- // This is a new override.
- - std::tr1::unordered_map <StringId, GLuint>::iterator tui = textureNameToTextureUnit.find(texture.name);
- + std::tr1::unordered_map <StringId, GLuint, StringId::hash>::iterator tui = textureNameToTextureUnit.find(texture.name);
- assert(tui != textureNameToTextureUnit.end()); // textureNameToTextureUnit should have been populated when we loaded the sampler.
- GLuint tu = tui->second;
- @@ -582,7 +582,7 @@ void RenderPass::removeModelTexture(RenderModelHandle handle, StringId name)
- RenderModel & model = models.get(iter->second);
- // Find the existing texture override with this name.
- - std::tr1::unordered_map <StringId, keyed_container <RenderTexture>::handle>::iterator existing = model.textureNameToTextureOverride.find(name);
- + std::tr1::unordered_map <StringId, keyed_container <RenderTexture>::handle, StringId::hash>::iterator existing = model.textureNameToTextureOverride.find(name);
- if (existing != model.textureNameToTextureOverride.end())
- {
- // There is an existing override. Remove it, then remove it from the mapping.
- @@ -605,7 +605,7 @@ void RenderPass::setModelUniform(RenderModelHandle handle, const RenderUniformEn
- RenderModel & model = models.get(iter->second);
- // First, see if there's an existing override with this name.
- - std::tr1::unordered_map <StringId, keyed_container <RenderUniform>::handle>::iterator existing = model.variableNameToUniformOverride.find(uniform.name);
- + std::tr1::unordered_map <StringId, keyed_container <RenderUniform>::handle, StringId::hash>::iterator existing = model.variableNameToUniformOverride.find(uniform.name);
- if (existing != model.variableNameToUniformOverride.end())
- {
- // There is an existing override. Change it!
- @@ -615,7 +615,7 @@ void RenderPass::setModelUniform(RenderModelHandle handle, const RenderUniformEn
- else
- {
- // This is a new override.
- - std::tr1::unordered_map <StringId, GLuint>::iterator loci = variableNameToUniformLocation.find(uniform.name);
- + std::tr1::unordered_map <StringId, GLuint, StringId::hash>::iterator loci = variableNameToUniformLocation.find(uniform.name);
- assert(loci != variableNameToUniformLocation.end()); // variableNameToUniformLocation should have been populated when we initialized.
- GLuint loc = loci->second;
- @@ -636,7 +636,7 @@ void RenderPass::removeModelUniform(RenderModelHandle handle, StringId name)
- RenderModel & model = models.get(iter->second);
- // Find the existing uniform override with this name.
- - std::tr1::unordered_map <StringId, keyed_container <RenderUniform>::handle>::iterator existing = model.variableNameToUniformOverride.find(name);
- + std::tr1::unordered_map <StringId, keyed_container <RenderUniform>::handle, StringId::hash>::iterator existing = model.variableNameToUniformOverride.find(name);
- if (existing != model.variableNameToUniformOverride.end())
- {
- // There is an existing override. Remove it, then remove it from the mapping.
- @@ -654,7 +654,7 @@ void RenderPass::setDefaultTexture(StringId name, const RenderTextureEntry & tex
- {
- // See if we have a mapping for this name id.
- // If we don't that's fine, just ignore the change.
- - std::tr1::unordered_map <StringId, GLuint>::const_iterator tuIter = textureNameToTextureUnit.find(name);
- + std::tr1::unordered_map <StringId, GLuint, StringId::hash>::const_iterator tuIter = textureNameToTextureUnit.find(name);
- if (tuIter != textureNameToTextureUnit.end())
- {
- GLuint tu = tuIter->second;
- @@ -677,7 +677,7 @@ void RenderPass::removeDefaultTexture(StringId name)
- {
- // See if we have a mapping for this name id.
- // If we don't that's fine, just ignore the change.
- - std::tr1::unordered_map <StringId, GLuint>::const_iterator tuIter = textureNameToTextureUnit.find(name);
- + std::tr1::unordered_map <StringId, GLuint, StringId::hash>::const_iterator tuIter = textureNameToTextureUnit.find(name);
- if (tuIter != textureNameToTextureUnit.end())
- {
- GLuint tu = tuIter->second;
- @@ -702,7 +702,7 @@ void RenderPass::removeDefaultTexture(StringId name)
- bool RenderPass::getDefaultUniform(StringId uniformName, RenderUniform & out)
- {
- - std::tr1::unordered_map <StringId, GLuint>::const_iterator locIter = variableNameToUniformLocation.find(uniformName);
- + std::tr1::unordered_map <StringId, GLuint, StringId::hash>::const_iterator locIter = variableNameToUniformLocation.find(uniformName);
- if (locIter != variableNameToUniformLocation.end())
- {
- GLuint location = locIter->second;
- @@ -723,7 +723,7 @@ bool RenderPass::setDefaultUniform(const RenderUniformEntry & uniform)
- {
- // See if we have a mapping for this name id.
- // If we don't that's fine, just ignore the change.
- - std::tr1::unordered_map <StringId, GLuint>::const_iterator locIter = variableNameToUniformLocation.find(uniform.name);
- + std::tr1::unordered_map <StringId, GLuint, StringId::hash>::const_iterator locIter = variableNameToUniformLocation.find(uniform.name);
- if (locIter != variableNameToUniformLocation.end())
- {
- GLuint location = locIter->second;
- @@ -749,7 +749,7 @@ void RenderPass::removeDefaultUniform(StringId name)
- {
- // See if we have a mapping for this name id.
- // If we don't that's fine, just ignore the change.
- - std::tr1::unordered_map <StringId, GLuint>::const_iterator locIter = variableNameToUniformLocation.find(name);
- + std::tr1::unordered_map <StringId, GLuint, StringId::hash>::const_iterator locIter = variableNameToUniformLocation.find(name);
- if (locIter != variableNameToUniformLocation.end())
- {
- GLuint location = locIter->second;
Advertisement
Add Comment
Please, Sign In to add comment