mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2025-02-16 11:50:19 -05:00
Use tinystl/unordered_map in geometry
This commit is contained in:
parent
5aaddfccb9
commit
8e57c9fa2b
1 changed files with 5 additions and 3 deletions
|
@ -13,7 +13,9 @@
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <unordered_map>
|
#include <tinystl/allocator.h>
|
||||||
|
#include <tinystl/unordered_map.h>
|
||||||
|
namespace stl = tinystl;
|
||||||
|
|
||||||
#include <forsythtriangleorderoptimizer.h>
|
#include <forsythtriangleorderoptimizer.h>
|
||||||
|
|
||||||
|
@ -79,7 +81,7 @@ struct Index3
|
||||||
int32_t m_vertexIndex;
|
int32_t m_vertexIndex;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef std::unordered_map<uint64_t, Index3> Index3Map;
|
typedef stl::unordered_map<uint64_t, Index3> Index3Map;
|
||||||
|
|
||||||
struct Triangle
|
struct Triangle
|
||||||
{
|
{
|
||||||
|
@ -478,7 +480,7 @@ int main(int _argc, const char* _argv[])
|
||||||
uint64_t hash2 = uint64_t(index.m_normal)<<40;
|
uint64_t hash2 = uint64_t(index.m_normal)<<40;
|
||||||
uint64_t hash = hash0^hash1^hash2;
|
uint64_t hash = hash0^hash1^hash2;
|
||||||
|
|
||||||
std::pair<Index3Map::iterator, bool> result = indexMap.insert(std::make_pair(hash, index) );
|
stl::pair<Index3Map::iterator, bool> result = indexMap.insert(stl::make_pair(hash, index) );
|
||||||
if (!result.second)
|
if (!result.second)
|
||||||
{
|
{
|
||||||
Index3& oldIndex = result.first->second;
|
Index3& oldIndex = result.first->second;
|
||||||
|
|
Loading…
Reference in a new issue