From d69478e53960f0f718d4a2808b2dfcd593cf635c Mon Sep 17 00:00:00 2001 From: nodchip Date: Sat, 6 Mar 2010 02:07:48 +0000 Subject: 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 --- Source/Core/VideoCommon/Src/VertexLoaderManager.cpp | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'Source/Core/VideoCommon/Src/VertexLoaderManager.cpp') 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 +#ifdef _MSC_VER +#include +using stdext::hash_map; +#else +#include +using __gnu_cxx::hash_map; +#endif #include #include -#include #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 { + size_t operator()(const VertexLoaderUID& __x) const { + return __x; + } + }; +} +#endif + namespace VertexLoaderManager { -typedef std::map VertexLoaderMap; +typedef hash_map VertexLoaderMap; static VertexLoaderMap g_VertexLoaderMap; // TODO - change into array of pointers. Keep a map of all seen so far. -- cgit v1.2.3