diff options
| author | NeoBrainX <NeoBrainX@gmail.com> | 2013-04-25 14:01:07 +0200 |
|---|---|---|
| committer | NeoBrainX <NeoBrainX@gmail.com> | 2013-04-25 14:05:54 +0200 |
| commit | 5e6b712651dc042b06ce59bcfb4becda5ee15022 (patch) | |
| tree | c82731464d76517cce5ffb6d7e9764c47a433804 /Source/Core/VideoCommon/Src/VertexLoaderManager.cpp | |
| parent | eef95fa4c5919bf93335e10dd61cd5a9fd6a5f6d (diff) | |
| parent | d18b71ccf91c9578236b44ae26e8bc35314cc180 (diff) | |
Merge 'master' into shader-uids-awesome.
Conflicts:
Source/Core/VideoCommon/Src/BPMemory.h
Source/Core/VideoCommon/Src/LightingShaderGen.cpp
Source/Core/VideoCommon/Src/PixelShaderGen.cpp
Source/Core/VideoCommon/Src/PixelShaderGen.h
Source/Core/VideoCommon/Src/PixelShaderManager.cpp
Source/Core/VideoCommon/Src/VertexShaderGen.cpp
Source/Core/VideoCommon/Src/VertexShaderGen.h
Diffstat (limited to 'Source/Core/VideoCommon/Src/VertexLoaderManager.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/Src/VertexLoaderManager.cpp | 74 |
1 files changed, 22 insertions, 52 deletions
diff --git a/Source/Core/VideoCommon/Src/VertexLoaderManager.cpp b/Source/Core/VideoCommon/Src/VertexLoaderManager.cpp index 153e69a8c3..856b5d9fa5 100644 --- a/Source/Core/VideoCommon/Src/VertexLoaderManager.cpp +++ b/Source/Core/VideoCommon/Src/VertexLoaderManager.cpp @@ -1,32 +1,9 @@ -// Copyright (C) 2003 Dolphin Project. - -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, version 2.0. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License 2.0 for more details. - -// A copy of the GPL 2.0 should have been included with the program. -// If not, see http://www.gnu.org/licenses/ - -// Official SVN repository and contact information can be found at -// http://code.google.com/p/dolphin-emu/ +// Copyright 2013 Dolphin Emulator Project +// Licensed under GPLv2 +// Refer to the license.txt file included. #include <algorithm> -#ifdef _MSC_VER -#include <hash_map> -using stdext::hash_map; -#elif defined __APPLE__ -#include <ext/hash_map> -using __gnu_cxx::hash_map; -#else #include <unordered_map> -using std::unordered_map; -#endif -#include <map> #include <vector> #include "VideoCommon.h" @@ -41,32 +18,21 @@ static int s_attr_dirty; // bitfield static VertexLoader *g_VertexLoaders[8]; -#ifdef _MSC_VER -namespace stdext { - inline size_t hash_value(const VertexLoaderUID& uid) { - return uid.GetHash(); - } -} -#else -#ifdef __APPLE__ -namespace __gnu_cxx -#else namespace std -#endif { - template<> struct hash<VertexLoaderUID> { - size_t operator()(const VertexLoaderUID& uid) const { - return uid.GetHash(); - } - }; + +template <> +struct hash<VertexLoaderUID> +{ + size_t operator()(const VertexLoaderUID& uid) const + { + return uid.GetHash(); + } +}; + } -#endif -#if defined _MSC_VER || defined __APPLE__ -typedef hash_map<VertexLoaderUID, VertexLoader*> VertexLoaderMap; -#else -typedef unordered_map<VertexLoaderUID, VertexLoader*> VertexLoaderMap; -#endif +typedef std::unordered_map<VertexLoaderUID, VertexLoader*> VertexLoaderMap; namespace VertexLoaderManager { @@ -91,11 +57,14 @@ void Shutdown() g_VertexLoaderMap.clear(); } -namespace { -struct entry { +namespace +{ +struct entry +{ std::string text; u64 num_verts; - bool operator < (const entry &other) const { + bool operator < (const entry &other) const + { return num_verts > other.num_verts; } }; @@ -116,7 +85,8 @@ void AppendListToString(std::string *dest) } sort(entries.begin(), entries.end()); dest->reserve(dest->size() + total_size); - for (std::vector<entry>::const_iterator iter = entries.begin(); iter != entries.end(); ++iter) { + for (std::vector<entry>::const_iterator iter = entries.begin(); iter != entries.end(); ++iter) + { dest->append(iter->text); } } |
