use map instead of linear search to find texture indices for animation
This commit is contained in:
parent
3bd80ab8f6
commit
8ae93fb87f
4 changed files with 42 additions and 22 deletions
|
|
@ -1,4 +1,5 @@
|
|||
#pragma once
|
||||
#define TEXTUREID_H
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
|
|
@ -66,3 +67,13 @@ public:
|
|||
constexpr FSetTextureID(int v) : FTextureID(v) {}
|
||||
};
|
||||
|
||||
#ifdef TARRAY_H
|
||||
template<> struct THashTraits<FTextureID>
|
||||
{
|
||||
|
||||
hash_t Hash(const FTextureID key) { return (hash_t)key.GetIndex(); }
|
||||
|
||||
// Compares two keys, returning zero if they are the same.
|
||||
int Compare(const FTextureID left, const FTextureID right) { return left != right; }
|
||||
};
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue