diff options
| author | nodchip <nodchip@gmail.com> | 2010-03-06 02:07:48 +0000 |
|---|---|---|
| committer | nodchip <nodchip@gmail.com> | 2010-03-06 02:07:48 +0000 |
| commit | d69478e53960f0f718d4a2808b2dfcd593cf635c (patch) | |
| tree | a35725f43801a4d14e6dd949d6fd39f31f37223f /Source/Core/VideoCommon/Src/VertexLoaderManager.cpp | |
| parent | 1b61742b53b18a1f6907708506f0433cf3e52e3b (diff) | |
Reverted the comparison function to r5159 and rewrote map to hash_map. I confirmed that the code can be compiled and run under Visual Studio 2008. And I confirmed the code can be compiled under gcc 4.4.0 (mingw). I could not confirm that the code run under linux.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5161 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/VideoCommon/Src/VertexLoaderManager.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/Src/VertexLoaderManager.cpp | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/Source/Core/VideoCommon/Src/VertexLoaderManager.cpp b/Source/Core/VideoCommon/Src/VertexLoaderManager.cpp index a7db50e420..cdb4aa42a5 100644 --- a/Source/Core/VideoCommon/Src/VertexLoaderManager.cpp +++ b/Source/Core/VideoCommon/Src/VertexLoaderManager.cpp @@ -15,9 +15,16 @@ // Official SVN repository and contact information can be found at // http://code.google.com/p/dolphin-emu/ +#include <algorithm> +#ifdef _MSC_VER +#include <hash_map> +using stdext::hash_map; +#else +#include <ext/hash_map> +using __gnu_cxx::hash_map; +#endif #include <map> #include <vector> -#include <algorithm> #include "VideoCommon.h" #include "Statistics.h" @@ -30,10 +37,20 @@ static int s_attr_dirty; // bitfield static VertexLoader *g_VertexLoaders[8]; +#ifndef _MSC_VER +namespace __gnu_cxx { + template<> struct hash<VertexLoaderUID> { + size_t operator()(const VertexLoaderUID& __x) const { + return __x; + } + }; +} +#endif + namespace VertexLoaderManager { -typedef std::map<VertexLoaderUID, VertexLoader *> VertexLoaderMap; +typedef hash_map<VertexLoaderUID, VertexLoader*> VertexLoaderMap; static VertexLoaderMap g_VertexLoaderMap; // TODO - change into array of pointers. Keep a map of all seen so far. |
