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 TARRAY_H
|
||||
/*
|
||||
** tarray.h
|
||||
** Templated, automatically resizing array
|
||||
|
|
@ -943,6 +944,17 @@ template<class KT> struct THashTraits
|
|||
int Compare(const KT left, const KT right) { return left != right; }
|
||||
};
|
||||
|
||||
#ifdef TEXTUREID_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
|
||||
|
||||
template<> struct THashTraits<float>
|
||||
{
|
||||
// Use all bits when hashing singles instead of converting them to ints.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue