Added std::hash for String, made use of unordered_map

Former-commit-id: 20f3d12bc3222873706949f0a7d0a131e237a247
This commit is contained in:
Lynix
2013-06-23 16:53:37 +02:00
parent 3e82794b70
commit 3609f31708
9 changed files with 51 additions and 15 deletions

View File

@@ -11,7 +11,7 @@
#include <Nazara/Core/Color.hpp>
#include <Nazara/Core/InputStream.hpp>
#include <Nazara/Core/String.hpp>
#include <map>
#include <unordered_map>
class NzMTLParser
{
@@ -49,7 +49,7 @@ class NzMTLParser
void Warning(const NzString& message);
void UnrecognizedLine(bool error = false);
std::map<NzString, Material> m_materials;
std::unordered_map<NzString, Material> m_materials;
NzInputStream& m_stream;
NzString m_currentLine;
bool m_keepLastLine;

View File

@@ -7,8 +7,8 @@
#include <Nazara/Core/Log.hpp>
#include <Nazara/Utility/Config.hpp>
#include <cstdio>
#include <map>
#include <memory>
#include <unordered_map>
#include <Nazara/Graphics/Debug.hpp>
NzOBJParser::NzOBJParser(NzInputStream& stream) :
@@ -98,7 +98,7 @@ bool NzOBJParser::Parse()
m_positions.reserve(100);
m_texCoords.reserve(100);
std::map<NzString, std::map<NzString, std::vector<Face>>> meshes;
std::unordered_map<NzString, std::unordered_map<NzString, std::vector<Face>>> meshes;
std::vector<Face>* currentMesh = &meshes[meshName][matName];
@@ -348,7 +348,7 @@ bool NzOBJParser::Parse()
}
}
std::map<NzString, unsigned int> materials;
std::unordered_map<NzString, unsigned int> materials;
unsigned int matCount = 0;
for (auto meshIt : meshes)