Replaced std::map with std::unordered_map

Not possible yet with NzString-key map


Former-commit-id: faa628a1c9c10e7bc009bf5a67e112ad5f873bd8
This commit is contained in:
Lynix 2013-02-17 14:08:12 +01:00
parent 2e4c27188f
commit 857d2dd9ed
6 changed files with 8 additions and 8 deletions

View File

@ -192,7 +192,7 @@ NzString NzGLSLShader::GetSourceCode(nzShaderType type) const
int NzGLSLShader::GetUniformLocation(const NzString& name) const int NzGLSLShader::GetUniformLocation(const NzString& name) const
{ {
std::map<NzString, GLint>::const_iterator it = m_idCache.find(name); auto it = m_idCache.find(name);
GLint id; GLint id;
if (it == m_idCache.end()) if (it == m_idCache.end())
{ {

View File

@ -71,8 +71,8 @@ class NzGLSLShader : public NzShaderImpl, NzResourceListener
const NzTexture* texture; const NzTexture* texture;
}; };
mutable std::map<NzString, GLint> m_idCache; mutable std::map<NzString, GLint> m_idCache; ///FIXME: unordered_map
std::map<GLint, TextureSlot> m_textures; std::map<GLint, TextureSlot> m_textures; ///FIXME: unordered_map
GLuint m_program; GLuint m_program;
GLuint m_shaders[nzShaderType_Max+1]; GLuint m_shaders[nzShaderType_Max+1];
NzShader* m_parent; NzShader* m_parent;

View File

@ -7,13 +7,13 @@
#include <Nazara/Core/Log.hpp> #include <Nazara/Core/Log.hpp>
#include <Nazara/Renderer/Renderer.hpp> #include <Nazara/Renderer/Renderer.hpp>
#include <Nazara/Renderer/Shader.hpp> #include <Nazara/Renderer/Shader.hpp>
#include <map>
#include <memory> #include <memory>
#include <unordered_map>
#include <Nazara/Renderer/Debug.hpp> #include <Nazara/Renderer/Debug.hpp>
namespace namespace
{ {
std::map<nzUInt32, NzShader*> s_shaders; std::unordered_map<nzUInt32, NzShader*> s_shaders;
NzString BuildFragmentShaderSource(nzUInt32 flags) NzString BuildFragmentShaderSource(nzUInt32 flags)
{ {

View File

@ -8,11 +8,12 @@
#include <Nazara/Renderer/Config.hpp> #include <Nazara/Renderer/Config.hpp>
#include <Nazara/Renderer/Renderer.hpp> #include <Nazara/Renderer/Renderer.hpp>
#include <Nazara/Renderer/Texture.hpp> #include <Nazara/Renderer/Texture.hpp>
#include <unordered_map>
#include <Nazara/Renderer/Debug.hpp> #include <Nazara/Renderer/Debug.hpp>
namespace namespace
{ {
std::map<nzUInt32, GLuint> s_samplers; std::unordered_map<nzUInt32, GLuint> s_samplers;
nzUInt8 s_maxAnisotropyLevel; nzUInt8 s_maxAnisotropyLevel;
bool s_useAnisotropicFilter; bool s_useAnisotropicFilter;
} }

View File

@ -5,7 +5,6 @@
#include <Nazara/Utility/PixelFormat.hpp> #include <Nazara/Utility/PixelFormat.hpp>
#include <Nazara/Core/Endianness.hpp> #include <Nazara/Core/Endianness.hpp>
#include <Nazara/Core/Error.hpp> #include <Nazara/Core/Error.hpp>
#include <Nazara/Core/Error.hpp>
#include <Nazara/Utility/Debug.hpp> #include <Nazara/Utility/Debug.hpp>
namespace namespace

View File

@ -9,7 +9,7 @@
struct NzSkeletonImpl struct NzSkeletonImpl
{ {
std::map<NzString, unsigned int> jointMap; std::map<NzString, unsigned int> jointMap; ///FIXME: unordered_map
std::vector<NzJoint> joints; std::vector<NzJoint> joints;
NzAxisAlignedBox aabb; NzAxisAlignedBox aabb;
bool jointMapUpdated = false; bool jointMapUpdated = false;