From 4ba12be6692a0afa92a506c08fa750257b9d51c2 Mon Sep 17 00:00:00 2001 From: Jordan Woyak Date: Mon, 1 Apr 2013 19:24:27 -0500 Subject: We can use unordered_map without pain now! --- .../Core/VideoCommon/Src/VertexLoaderManager.cpp | 43 ++++++---------------- 1 file changed, 11 insertions(+), 32 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 153e69a8c3..01db9f647c 100644 --- a/Source/Core/VideoCommon/Src/VertexLoaderManager.cpp +++ b/Source/Core/VideoCommon/Src/VertexLoaderManager.cpp @@ -16,17 +16,7 @@ // http://code.google.com/p/dolphin-emu/ #include -#ifdef _MSC_VER -#include -using stdext::hash_map; -#elif defined __APPLE__ -#include -using __gnu_cxx::hash_map; -#else #include -using std::unordered_map; -#endif -#include #include #include "VideoCommon.h" @@ -41,32 +31,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 { - size_t operator()(const VertexLoaderUID& uid) const { - return uid.GetHash(); - } - }; + +template <> +struct hash +{ + size_t operator()(const VertexLoaderUID& uid) const + { + return uid.GetHash(); + } +}; + } -#endif -#if defined _MSC_VER || defined __APPLE__ -typedef hash_map VertexLoaderMap; -#else -typedef unordered_map VertexLoaderMap; -#endif +typedef std::unordered_map VertexLoaderMap; namespace VertexLoaderManager { -- cgit v1.2.3 From bab9963b00953d60bdd6fabe265d5daa45a27661 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 17 Apr 2013 23:09:55 -0400 Subject: New license header introduced for DiscIO, AudioCommon, InputCommon, VideoCommon, and Common projects. --- Source/Core/VideoCommon/Src/VertexLoaderManager.cpp | 19 +++---------------- 1 file changed, 3 insertions(+), 16 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 01db9f647c..51684e20cc 100644 --- a/Source/Core/VideoCommon/Src/VertexLoaderManager.cpp +++ b/Source/Core/VideoCommon/Src/VertexLoaderManager.cpp @@ -1,19 +1,6 @@ -// 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 #include -- cgit v1.2.3 From 8da425b008b46ef90d649e55c6c0d4a0bc2b556b Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 24 Apr 2013 09:21:54 -0400 Subject: Formatting cleanup for VideoCommon. Block braces on new lines. Also killed off trailing whitespace and dangling elses. Spaced some things out to make them more readable (only in places where it looked like a bit of a clusterfuck). --- Source/Core/VideoCommon/Src/VertexLoaderManager.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 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 51684e20cc..856b5d9fa5 100644 --- a/Source/Core/VideoCommon/Src/VertexLoaderManager.cpp +++ b/Source/Core/VideoCommon/Src/VertexLoaderManager.cpp @@ -57,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; } }; @@ -82,7 +85,8 @@ void AppendListToString(std::string *dest) } sort(entries.begin(), entries.end()); dest->reserve(dest->size() + total_size); - for (std::vector::const_iterator iter = entries.begin(); iter != entries.end(); ++iter) { + for (std::vector::const_iterator iter = entries.begin(); iter != entries.end(); ++iter) + { dest->append(iter->text); } } -- cgit v1.2.3